6 | dma_systovram(vmem_addr, src, count)
9 vdp_setreg VDP_REG_MODE2, VDP_M2_INIT + VDP_M2_DISP + VDP_M2_DMA
14 vdp_setreg_reg VDP_REG_DMASRCL, %d0
16 vdp_setreg_reg VDP_REG_DMASRCM, %d1
18 vdp_setreg_reg VDP_REG_DMASRCH, %d0
19 | set count (in words)
22 vdp_setreg_reg VDP_REG_DMACNTL, %d0
24 vdp_setreg_reg VDP_REG_DMACNTH, %d1
25 | set the destination address.
29 or.w #(VDP_VRAM_DMA >> 16), %d0
30 move.w %d0, VDP_CTL_PORT
31 | 2 upper bits and rest of the type flags
34 or.w #(VDP_VRAM_DMA & 0xf0), %d1
35 | last word needs to come from RAM, so we push it on the stack
37 move.w (%sp), VDP_CTL_PORT
40 | after DMA ends the cpu can continue, turn DMA off
41 vdp_setreg VDP_REG_MODE2, VDP_M2_INIT + VDP_M2_DISP