As described in the MOS 6526 CIA data sheet (at the bottom of page 5) and this answer, the PA0-7 and PB0-7 pins:
- always act as inputs, even when the data direction register (DDR) is set to 1 ("output") for that pin, and
- the outputs are open drain, so setting 1 in both the DDR and the Peripheral Data Register (PR) has the same effect as setting 0 in the DDR and any value in the PR.
So it seems that the DDR isn't really necessary; rather than writing 0 to a bit in the DDR one can just write 1 to the corresponding bit in the PR and have the same effect.
So what use is it to have these two not-strictly-necessary DDR registers? I would think that adding more registers would not make the chip design or manufacture easier or cheaper, though perhaps it could help with testing. Does it make writing certain kinds of programs significantly easier?
A note on the CIA driving its output pins:
The data sheet doesn't explicitly say whether the outputs are open drain or whether there they are driven with additional current beyond that supplied by the built-in pull-up when a pin's bit is set in both the DDR and the PR.
However, Commodore had owned MOS Technologies for several years by the time design on the Commodore 64 started and various stories I've read about the design process indicated that the C64 designers worked closely with the chip designers. Commodore seemed fine with shorting the CIA I/O pins to ground; they did this with ten different joystick switches and, via sinking current through other I/O pins, with the keyboard matrix, as you can see from the schematic on page 12 of the Service Manual.
Clearly this wouldn't be safe if the outputs were not designed to be pulled low regardless of whether the CIA is driving them or not, and the standard way to do this would be to have open drain outputs and pull-ups.
If you posit that the CIA is driving the outputs with additional current beyond that supplied by the pull-up, I'd appreciate an explanation of why you think this would be so and what advantage this might provide, given that those outputs still have to act just like open-drain outputs with pull-ups would anyway.
