removed VDP_loadTileData (moved in vdp_tile.c unit)
- .align 2
- .globl VDP_loadTileData
- .type VDP_loadTileData, @function
-VDP_loadTileData:
- movm.l %d2-%d4,-(%sp)
-
- move.l 16(%sp),%d2 | d2 = data
- move.w 26(%sp),%d3 | d3 = num
- jeq .L1
-
- movq #0,%d4
- move.w 22(%sp),%d4 | d4 = ind
- lsl.w #5,%d4 | d4 = ind * 32 = VRAM address
-
- move.b 31(%sp),%d0 | d0 = tm (TransferMethod)
- subq.b #1,%d0 | 0 = CPU, 1 = DMA, 2 = DMA QUEUE
- jmi .transfer_CPU
- jeq .transfer_DMA
-
-.DMA_queue:
- lsl.w #4,%d3 | d3 = num * 16 (size of DMA in word)
-
- pea 2.w | prepare parameters for VDP_doDMA
- move.l %d3,-(%sp)
- move.l %d4,-(%sp)
- move.l %d2,-(%sp)
- clr.l -(%sp)
- jsr DMA_queueDma
- lea (20,%sp),%sp
- jra .L1
-
-.transfer_DMA:
- lsl.w #4,%d3 | d3 = num * 16 (size of DMA in word)
-
- pea 2.w | prepare parameters for VDP_doDMA
- move.l %d3,-(%sp)
- move.l %d4,-(%sp)
- move.l %d2,-(%sp)
- clr.l -(%sp)
- jsr DMA_doDma
- lea (20,%sp),%sp
- jra .L1
-
- .align 2
-.transfer_CPU:
- pea 2.w
- jsr VDP_setAutoInc
- addq.l #4,%sp
-
- lsl.l #2,%d4
- lsr.w #2,%d4
- andi.w #0x3FFF,%d4
- ori.w #0x4000,%d4
- swap %d4 | d4 = formated VRAM address for VDP command write
-
- move.l %d4,0xC00004 | set destination address in VDP Ctrl command
-
- move.l %d2,%a0 | a0 = data
- move.l #0xC00000,%a1
- subq.w #1,%d3
-
-.L6:
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- move.l (%a0)+,(%a1)
- dbra %d3,.L6
-
-.L1:
- movm.l (%sp)+,%d2-%d4
- rts
-
-
.align 2
.globl VDP_loadBMPTileData
.type VDP_loadBMPTileData, @function
