I try hard to run a 512 colors demo, but can't manage to do it. I've read the TmEE 960 demo, but didn't figure out how to use it.
So, here are my datas.
I have 16 tiles, from 00000000 ... 00000000 to FFFFFFFF ... FFFFFFFF. I store it in VRAM 0x0000
I have 512 colors, from 0000, 0002, 0004 ... to 0EEE. It is stored in RAM 0XFF0000
I have plane A 0000, 0001, ... 000F, 2000, 20001, ... 2000F ... to 600F. 64 tiles, 2 lines of tiles, 16 raster lines, that I repeat so that the A plane is full.
Here's my point.
My plane is made of 2 rows of 32 tiles. I repeat this 2 rows to fill the screen. These 2 rows are 16 raster lines height. So, I want the H interrupt to be triggered every 16 lines. So I put
Code: Select all
move.w #$8A10,GFX_CTRL
I want to use DMA.
Address FF0000, FF0040, FF0080 ... become 7F8000, 7F8020, 7F8040, ...
DMA src high and DMA src mid remain the same (977F and 9680). Only DMA src low will change, incrementing by 0x20 every time. 0x20 will be my offset.
When the H int is triggered (so every 16 raster line),
I add the offset to the DMA src low reg (9500).
I switch DMA ON, I trigger DMA to CRAM 0x00.
I finally turn DMA off.
It runs once, I even see it in the GensKmod Debug message, but then, the DMA is never triggered again !!! I enter HBL, the offset is incremented, I see the DMA src low running ... but nothing happens ! My palette remains the same, and the debug message doesn't show anything anymore.
Here's my HBL code :
Code: Select all
HBL:
add.b d2,d1 ; d2 is 0x20, d1 was initialized to $9500
move.w d1,(a0) ; put DMA src low, a0 = #$GFX_CTRL
move.w d3,(a0) ; Set DMA ON, d3 = #$817C
move.l d5,(a0) ; Trigger DMA to CRAM 0x00, d5 = C0000080
move.w d4,(a0) ; Set DMA OFF, d4 = #816C
rte