sprite DMA works
[mdlife] / src / dma.S
index b3f9d86..8cec2e3 100644 (file)
--- a/src/dma.S
+++ b/src/dma.S
@@ -3,6 +3,7 @@
 #include "hwregs.h"
 #include "vdp.inc"
 
+
        | dma_systovram(vmem_addr, src, count)
        .globl dma_systovram
 dma_systovram:
@@ -10,6 +11,7 @@ dma_systovram:
 
        | set source address
        move.l 8(%sp), %d0
+       lsr.l #1, %d0
        move.l %d0, %d1
        vdp_setreg_reg VDP_REG_DMASRCL, %d0
        lsr.w #8, %d1
@@ -34,11 +36,10 @@ dma_systovram:
        or.w #(VDP_VRAM_DMA & 0xf0), %d1
        | last word needs to come from RAM, so we push it on the stack
        move.w %d1, -(%sp)
-       move.w (%sp), VDP_CTL_PORT
-       add.l #2, %sp
+       move.w (%sp)+, VDP_CTL_PORT
 
        | after DMA ends the cpu can continue, turn DMA off
        vdp_setreg VDP_REG_MODE2, VDP_M2_INIT + VDP_M2_DISP
        rts
-       
+
 | vi:ft=gas68k: