BPLxMOD for interleaved bitmaps
It's at least 15 years ago when I last programmed the chipset, but this confuses me:
I want to display a soft-scrolling screen of 320x240 pixels. To use the scroll-delay in BPLCON1 I have to fetch an additional word each line. So the usual DDFSTRT of $38 becomes $30, with DDFSTOP still at $d8.
This means I have 42 bytes each line. For an interleaved 32 color bitmap I will point BPL1PT to the bitmap's start address, BPL2PT to bitmap+42, BPL3PT to bitmap+84 and so on.
Now the BPLxMOD. I thought that when the hardware has read its 21 words for a line it has to skip 4 * 21 words (for the other 4 interleaved bitplanes) to advance to the start address of the next line. So I set BPLxMOD to 4*42 = 168.
But that's wrong! It simply didn't work. With some experiments I got the expected result then setting the BPLxMOD to 166. Two bytes are missing. Why?
|