Dandaman955

Suggestions?

May 18th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LoadPalettes:
  2.                 lea     ($C00000).l,a1              ; Load VDP data port into a1.
  3.                 add.b   d0,d0                       ; Double palette ID value to index it.
  4.                 move.w  PalettesIndex(pc,d0.w),d1   ; Load palette subroutine distance from index.
  5.                 lea     PalettesIndex(pc,d0.w),a0   ; Load palette address to dump from.
  6.                 adda.w  d1,a0                       ; Add to get palettes address.
  7.                 move.l  #$C0000000,4(a1)            ; Set VDP to CRAM write.
  8. @loop
  9.                 move.w  (a0)+,(a1)                  ; Write first palette into CRAM.
  10.                 move.w  (a0),d1                     ; Is the next entry a terminator ($FFFF)?
  11.                 bpl.s   @loop                       ; If not, keep looping until the palettes are filled.
  12.                 rts                                 ; Return.
  13.  
  14.  
  15. PalettesIndex:
  16.                 dc.w    Pal_GM0-PalettesIndex, Pal_GM1End-Pal_GM1
  17.  
  18. Pal_GM0:
  19.                 dc.w    $0000, $0EEE, $0000, $0EEE
  20.                 dc.w    $0000, $0EEE, $0000, $0EEE
  21.                 dc.w    $0000, $0EEE, $0000, $0EEE
  22.                 dc.w    $0000, $0EEE, $0000, $0EEE
  23.                 dc.w    $FFFF
Advertisement
Add Comment
Please, Sign In to add comment