Skip to content

Commit

Permalink
Make DMA Fill macro actually work.
Browse files Browse the repository at this point in the history
While most of the fill uses the upper byte, the second byte uses the
lower byte. I only noticed this because my emulator has to recreate
this quirk in order to pass Nemesis's VDP FIFO test ROM.
  • Loading branch information
Clownacy committed Feb 22, 2024
1 parent 26d6691 commit 0dc35ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion s2.macros.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dmaFillVRAM macro byte,addr,length
move.l #(($9400|((((length)-1)&$FF00)>>8))<<16)|($9300|(((length)-1)&$FF)),(a5) ; DMA length ...
move.w #$9780,(a5) ; VRAM fill
move.l #$40000080|(((addr)&$3FFF)<<16)|(((addr)&$C000)>>14),(a5) ; Start at ...
move.w #(byte)<<8,(VDP_data_port).l ; Fill with byte
move.w #(byte)|((byte)<<8),(VDP_data_port).l ; Fill with byte
.loop: move.w (a5),d1
btst #1,d1
bne.s .loop ; busy loop until the VDP is finished filling...
Expand Down

0 comments on commit 0dc35ab

Please sign in to comment.