7 | dma_systovram(vmem_addr, src, count)
10 vdp_setreg VDP_REG_MODE2, VDP_M2_INIT + VDP_M2_DISP + VDP_M2_DMA
16 vdp_setreg_reg VDP_REG_DMASRCL, %d0
18 vdp_setreg_reg VDP_REG_DMASRCM, %d1
20 vdp_setreg_reg VDP_REG_DMASRCH, %d0
21 | set count (in words)
24 vdp_setreg_reg VDP_REG_DMACNTL, %d0
26 vdp_setreg_reg VDP_REG_DMACNTH, %d1
27 | set the destination address.
31 or.w #(VDP_VRAM_DMA >> 16), %d0
32 move.w %d0, VDP_CTL_PORT
33 | 2 upper bits and rest of the type flags
36 or.w #(VDP_VRAM_DMA & 0xf0), %d1
37 | last word needs to come from RAM, so we push it on the stack
39 move.w (%sp)+, VDP_CTL_PORT
41 | after DMA ends the cpu can continue, turn DMA off
42 vdp_setreg VDP_REG_MODE2, VDP_M2_INIT + VDP_M2_DISP