I can't seem to change more than 16 colors per scanline. I used to think this was because I was changing AGA colors, but switching to OCS hoping to double the amount didn't give the expected boost.
If it is as you say that one can change 1 color per 8-th pixel I would think I could get 320/8 = 40 changes in one scanline.
Some setup which might be relevant:
- 8 bitplanes in use
- DMACONR is 0x2d0 (dmaenable set. Copper, disk, bitplanes, blitter dma enabled. Sprites, audio dma disabled)
- FMODE is 0xf ( 64-bit sprite fetch mode and 64-bit bitplane fetch mode
- None of the colors I'm changing are shown on the line where the changes are being done. They appear first on the next line.
I read about people changing 50 colors per scanline so I'm wondering what I'm missing? I just turned off sprite DMA, but seems no effect. Disabling bitplanes would make me sad.
Here is a snippet for 1 line of copper attempting 17 color changes.
BPLCON3 is the AGA bank switching since I'm using 256 colors throughout the frame.
Just using OCS colors now so not setting the low bits of the color.
dc.w 2cd9, fffe ; cop-wait @ 00032bdc
dc.w 0106, 0ca0 ; BPLCON3 @ 00032be0
dc.w 0180, 0f76 ; COLOR00 @ 00032be4
dc.w 0182, 0e64 ; COLOR01 @ 00032be8
dc.w 0184, 0d54 ; COLOR02 @ 00032bec
dc.w 0186, 0c53 ; COLOR03 @ 00032bf0
dc.w 0188, 0b53 ; COLOR04 @ 00032bf4
dc.w 018a, 0f76 ; COLOR05 @ 00032bf8
dc.w 018c, 0e75 ; COLOR06 @ 00032bfc
dc.w 018e, 0d53 ; COLOR07 @ 00032c00
dc.w 0190, 0b53 ; COLOR08 @ 00032c04
dc.w 0192, 0b64 ; COLOR09 @ 00032c08
dc.w 0194, 0c96 ; COLOR10 @ 00032c0c
dc.w 0196, 0f76 ; COLOR11 @ 00032c10
dc.w 0198, 0f76 ; COLOR12 @ 00032c14
dc.w 019c, 0e65 ; COLOR14 @ 00032c18
dc.w 019e, 0d64 ; COLOR15 @ 00032c1c
dc.w 01a0, 0d53 ; COLOR16 @ 00032c20
dc.w 2dd9, fffe ; cop-wait @ 00032c24
dc.w 018a, 0e88 ; COLOR05 @ 00032c28
:
: repeats for the whole screen
:
*edit after reading article pointed to by Jar*
"MOVE INSTRUCTION TIMING
During horizontal blanking, MOVEs take 8 cycles (pixels) to execute. During DMA activity, MOVEs will take 12 or 16 (but no more than 16). A typical example is between DDFSTRT and DDFSTOP when bitplane DMA has to be read and output to the screen. Here, 3 bitplanes will increase the timing to 12px and 4 (or more) bitplanes will increase it to 16."
It doesn't say how much 8 biplanes is going to affect the timing, but if using positive thinking, the problem should go away after >7 bitplanes are enabled.
Still 16 seems to be achievable during horizontal blank alone, so this must be absolute minimum.
*double edit.. I'm retarded.. It was a different bug causing the corruption*