Advertisement
Leo40Bin

the fuck, flamewing?

May 25th, 2019
2,676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Subroutine for issuing all VDP commands that were queued
  3. ; (by earlier calls to QueueDMATransfer)
  4. ; Resets the queue when it's done
  5. ; ---------------------------------------------------------------------------
  6.  
  7. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  8.  
  9. ; sub_14AC: CopyToVRAM: IssueVDPCommands: Process_DMA:
  10. Process_DMA_Queue:
  11. ProcessDMAQueue:
  12.     movea.w (VDP_Command_Buffer_Slot).w,a1
  13.     jmp .jump_table-VDP_Command_Buffer(a1)
  14. ; ---------------------------------------------------------------------------
  15. .jump_table:
  16.     rts
  17.     rept 6
  18.         trap    #0                                          ; Just in case
  19.     endm
  20. ; ---------------------------------------------------------------------------
  21. c := 1
  22.     rept QueueSlotCount
  23.         lea (VDP_control_port).l,a5
  24.         lea (VDP_Command_Buffer).w,a1
  25.         if c<>QueueSlotCount
  26.             bra.w   .jump0 - c*8
  27.         endif
  28. c := c + 1
  29.     endm
  30. ; ---------------------------------------------------------------------------
  31.     rept QueueSlotCount
  32.         move.l  (a1)+,(a5)                                  ; Transfer length
  33.         move.l  (a1)+,(a5)                                  ; Source address high
  34.         move.l  (a1)+,(a5)                                  ; Source address low + destination high
  35.         move.w  (a1)+,(a5)                                  ; Destination low, trigger DMA
  36.     endm
  37.  
  38. .jump0:
  39.     ResetDMAQueue
  40.     rts
  41. ; End of function ProcessDMAQueue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement