3 ms·
> Set it to point to the top of a sequence of video registers, and then you can rapidly write values to that sequence of registers just by issuing push instruct
by pwg 6y ago
> Set it to point to the top of a sequence of video registers, and then you can rapidly write values to that sequence of registers just by issuing push instructions
How did that work on the 2600? The 6502's stack pointer is also only 8-bits, just like the other registers, and hardwired to use page 1 as the upper byte of the ultimate 16-bit stack address. Were the video registers mapped into the page 1 address zone?
- T-hawk 6y agoYes. It's really that everything exists in both pages. The video registers exist at 0x00 through 0x3F and the RAM is at 0x80 through 0xFF, both in zero-page for the fast access instructions and in page 1 for the stack pointer. It's not so much a mapping as a lack of mapping. The hardware simply doesn't decode address line 8. So accessing 0x002F and 0x012F are the same video register for example. If you push something to 0x01FF, you can read it from 0x00FF. There are more duplications within the address space as well. Address lines 13 and above don't exist in hardware on the 2600, so 0x20FF and 0x40FF and 0x60FF etc also access the same thing. The video registers from 0x00 through 0x3F are also duplicated from 0x40 through 0x7F, by not decoding address line 6 either. The important one is address line 12, which enables the cartridge ROM instead of the video/RAM; in fact that line is wired directly to the chip-enable pin on the cartridge slot.