Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LoadPalettes:
- lea ($C00000).l,a1 ; Load VDP data port into a1.
- add.b d0,d0 ; Double palette ID value to index it.
- move.w PalettesIndex(pc,d0.w),d1 ; Load palette subroutine distance from index.
- lea PalettesIndex(pc,d0.w),a0 ; Load palette address to dump from.
- adda.w d1,a0 ; Add to get palettes address.
- move.l #$C0000000,4(a1) ; Set VDP to CRAM write.
- @loop
- move.w (a0)+,(a1) ; Write first palette into CRAM.
- move.w (a0),d1 ; Is the next entry a terminator ($FFFF)?
- bpl.s @loop ; If not, keep looping until the palettes are filled.
- rts ; Return.
- PalettesIndex:
- dc.w Pal_GM0-PalettesIndex, Pal_GM1End-Pal_GM1
- Pal_GM0:
- dc.w $0000, $0EEE, $0000, $0EEE
- dc.w $0000, $0EEE, $0000, $0EEE
- dc.w $0000, $0EEE, $0000, $0EEE
- dc.w $0000, $0EEE, $0000, $0EEE
- dc.w $FFFF
Advertisement
Add Comment
Please, Sign In to add comment