Use Dynamic Palettes in Sonic 1
From Sonic Retro
Original guide by PsychoSk8r from SSRG.
This will require the Old hivebrain ASM68K Disassembly.
Pallet Pointers 2&3
To start make copies of Pallet Pointers and rename them Pallet Pointers2&3
Then in Pallet Pointers2 replace the code with this.
; ---------------------------------------------------------------------------
; Pallet pointers 2
; ---------------------------------------------------------------------------
dc.l Pal_SegaBG ; pallet address
dc.w $FB00 ; RAM address
dc.w $1F ; (pallet length / 2) - 1
dc.l Pal_Title
dc.w $FB00
dc.w $1F
dc.l Pal_LevelSel
dc.w $FB00
dc.w $1F
dc.l Pal_Sonic
dc.w $FB00
dc.w 7
dc.l Pal_GHZ2
dc.w $FB20
dc.w $17
dc.l Pal_LZ2
dc.w $FB20
dc.w $17
dc.l Pal_MZ2
dc.w $FB20
dc.w $17
dc.l Pal_SLZ2
dc.w $FB20
dc.w $17
dc.l Pal_SYZ2
dc.w $FB20
dc.w $17
dc.l Pal_SBZ1
dc.w $FB20
dc.w $17
dc.l Pal_Special
dc.w $FB00
dc.w $1F
dc.l Pal_LZWater2
dc.w $FB00
dc.w $1F
dc.l Pal_SBZ3
dc.w $FB20
dc.w $17
dc.l Pal_SBZ3Water
dc.w $FB00
dc.w $1F
dc.l Pal_SBZ2
dc.w $FB20
dc.w $17
dc.l Pal_LZSonWater2
dc.w $FB00
dc.w 7
dc.l Pal_SBZ3SonWat
dc.w $FB00
dc.w 7
dc.l Pal_SpeResult
dc.w $FB00
dc.w $1F
dc.l Pal_SpeContinue
dc.w $FB00
dc.w $F
dc.l Pal_Ending
dc.w $FB00
dc.w $1F
And in Pallet Pointers3 replace it with this.
; ---------------------------------------------------------------------------
; Pallet pointers 3
; ---------------------------------------------------------------------------
dc.l Pal_SegaBG ; pallet address
dc.w $FB00 ; RAM address
dc.w $1F ; (pallet length / 2) - 1
dc.l Pal_Title
dc.w $FB00
dc.w $1F
dc.l Pal_LevelSel
dc.w $FB00
dc.w $1F
dc.l Pal_Sonic
dc.w $FB00
dc.w 7
dc.l Pal_GHZ3
dc.w $FB20
dc.w $17
dc.l Pal_LZ3
dc.w $FB20
dc.w $17
dc.l Pal_MZ3
dc.w $FB20
dc.w $17
dc.l Pal_SLZ3
dc.w $FB20
dc.w $17
dc.l Pal_SYZ3
dc.w $FB20
dc.w $17
dc.l Pal_SBZ1
dc.w $FB20
dc.w $17
dc.l Pal_Special
dc.w $FB00
dc.w $1F
dc.l Pal_LZWater3
dc.w $FB00
dc.w $1F
dc.l Pal_SBZ3
dc.w $FB20
dc.w $17
dc.l Pal_SBZ3Water
dc.w $FB00
dc.w $1F
dc.l Pal_SBZ2
dc.w $FB20
dc.w $17
dc.l Pal_LZSonWater3
dc.w $FB00
dc.w 7
dc.l Pal_SBZ3SonWat
dc.w $FB00
dc.w 7
dc.l Pal_SpeResult
dc.w $FB00
dc.w $1F
dc.l Pal_SpeContinue
dc.w $FB00
dc.w $F
dc.l Pal_Ending
dc.w $FB00
dc.w $1F
Then find PalPointers and right below it place this.
PalPointers2:
include "_inc\Pallet pointers2.asm"
PalPointers3:
include "_inc\Pallet pointers3.asm"
Then replace PalLoad1-4 with this.
; ---------------------------------------------------------------------------
; Subroutines to load pallets
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
PalLoad1:
move.b ($FFFFFE11),d1
lea (PalPointers).l,a1
cmp.b #0,d1
beq.w PalLoad1_Continue
lea (PalPointers2).l,a1
cmp.b #1,d1
beq.w PalLoad1_Continue
lea (PalPointers3).l,a1
PalLoad1_Continue:
lsl.w #3,d0
adda.w d0,a1
movea.l (a1)+,a2
movea.w (a1)+,a3
adda.w #$80,a3
move.w (a1)+,d7
loc_2110:
move.l (a2)+,(a3)+
dbf d7,loc_2110
rts
; End of function PalLoad1
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
PalLoad2:
move.b ($FFFFFE11),d1
lea (PalPointers).l,a1
cmp.b #0,d1
beq.w PalLoad2_Continue
lea (PalPointers2).l,a1
cmp.b #1,d1
beq.w PalLoad2_Continue
lea (PalPointers3).l,a1
PalLoad2_Continue:
lsl.w #3,d0
adda.w d0,a1
movea.l (a1)+,a2
movea.w (a1)+,a3
move.w (a1)+,d7
loc_2128:
move.l (a2)+,(a3)+
dbf d7,loc_2128
rts
; End of function PalLoad2
; ---------------------------------------------------------------------------
; Underwater pallet loading subroutine
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
PalLoad3_Water:
move.b ($FFFFFE11),d1
lea (PalPointers).l,a1
cmp.b #0,d1
beq.w PalLoad3_Continue
lea (PalPointers2).l,a1
cmp.b #1,d1
beq.w PalLoad3_Continue
lea (PalPointers3).l,a1
PalLoad3_Continue:
lsl.w #3,d0
adda.w d0,a1
movea.l (a1)+,a2
movea.w (a1)+,a3
suba.w #$80,a3
move.w (a1)+,d7
loc_2144:
move.l (a2)+,(a3)+
dbf d7,loc_2144
rts
; End of function PalLoad3_Water
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
PalLoad4_Water:
move.b ($FFFFFE11),d1
lea (PalPointers).l,a1
cmp.b #0,d1
beq.w PalLoad4_Continue
lea (PalPointers2).l,a1
cmp.b #1,d1
beq.w PalLoad4_Continue
lea (PalPointers3).l,a1
PalLoad4_Continue:
lsl.w #3,d0
adda.w d0,a1
movea.l (a1)+,a2
movea.w (a1)+,a3
suba.w #$100,a3
move.w (a1)+,d7
loc_2160:
move.l (a2)+,(a3)+
dbf d7,loc_2160
rts
; End of function PalLoad4_Water
Adding Much More Palletes
Now this will be the longest part you'll need to add ALOT of palettes.
Oh and you don't need to worry about LZ4.