Difference between revisions of "Extend the level index past $10 in Sonic 2"
From Sonic Retro
Line 339: | Line 339: | ||
That inserts empty slots for the cycling palettes of out new levels. | That inserts empty slots for the cycling palettes of out new levels. | ||
+ | |||
+ | Next we locate: | ||
+ | <asm> | ||
+ | PalPointers: | ||
+ | palptr Pal_SEGA, Normal_palette, $1F | ||
+ | palptr Pal_Title, Normal_palette_line2, 7 | ||
+ | palptr Pal_UNK1, Normal_palette, $1F | ||
+ | palptr Pal_BGND, Normal_palette, $F | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_WZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_MTZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_MTZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_WFZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_HTZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_HPZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_OOZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_MCZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_CNZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_CPZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_DEZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_ARZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_SCZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_HPZ_U, Normal_palette, $1F | ||
+ | palptr Pal_CPZ_U, Normal_palette, $1F | ||
+ | palptr Pal_ARZ_U, Normal_palette, $1F | ||
+ | palptr Pal_SS, Normal_palette, $17 | ||
+ | palptr Pal_UNK2, Normal_palette_line2, 7 | ||
+ | palptr Pal_UNK3, Normal_palette_line2, 7 | ||
+ | palptr Pal_SS1, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS2, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS3, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS4, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS5, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS6, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS7, Normal_palette_line4, 7 | ||
+ | palptr Pal_UNK4, Normal_palette_line4, 7 | ||
+ | palptr Pal_UNK5, Normal_palette_line4, 7 | ||
+ | palptr Pal_UNK6, Normal_palette_line4, 7 | ||
+ | palptr Pal_OOZ_B, Normal_palette_line2, 7 | ||
+ | palptr Pal_Menu, Normal_palette, $1F | ||
+ | palptr Pal_UNK7, Normal_palette, $1F | ||
+ | |||
+ | ; ---------------------------------------------------------------------------- | ||
+ | Pal_SEGA: BINCLUDE "art/palettes/Sega screen.bin" ; SEGA screen palette (Sonic and initial background) | ||
+ | Pal_Title: BINCLUDE "art/palettes/Title screen.bin" ; Title screen Palette | ||
+ | Pal_UNK1: BINCLUDE "art/palettes/Unknown 1.bin" ; Unknown palette 1 (leftover S1 level select palette?) | ||
+ | Pal_BGND: BINCLUDE "art/palettes/SonicAndTails.bin" ; "Sonic and Miles" background palette (also usually the primary palette line) | ||
+ | Pal_EHZ: BINCLUDE "art/palettes/EHZ.bin" ; Emerald Hill Zone palette | ||
+ | Pal_WZ: BINCLUDE "art/palettes/Wood Zone.bin" ; Wood Zone palette | ||
+ | Pal_MTZ: BINCLUDE "art/palettes/MTZ.bin" ; Metropolis Zone palette | ||
+ | Pal_WFZ: BINCLUDE "art/palettes/WFZ.bin" ; Wing Fortress Zone palette | ||
+ | Pal_HTZ: BINCLUDE "art/palettes/HTZ.bin" ; Hill Top Zone palette | ||
+ | Pal_HPZ: BINCLUDE "art/palettes/HPZ.bin" ; Hidden Palace Zone palette | ||
+ | Pal_HPZ_U: BINCLUDE "art/palettes/HPZ underwater.bin" ; Hidden Palace Zone underwater palette | ||
+ | Pal_OOZ: BINCLUDE "art/palettes/OOZ.bin" ; Oil Ocean Zone palette | ||
+ | Pal_MCZ: BINCLUDE "art/palettes/MCZ.bin" ; Mystic Cave Zone palette | ||
+ | Pal_CNZ: BINCLUDE "art/palettes/CNZ.bin" ; Casino Night Zone palette | ||
+ | Pal_CPZ: BINCLUDE "art/palettes/CPZ.bin" ; Chemical Plant Zone palette | ||
+ | Pal_CPZ_U: BINCLUDE "art/palettes/CPZ underwater.bin" ; Chemical Plant Zone underwater palette | ||
+ | Pal_DEZ: BINCLUDE "art/palettes/DEZ.bin" ; Death Egg Zone palette | ||
+ | Pal_ARZ: BINCLUDE "art/palettes/ARZ.bin" ; Aquatic Ruin Zone palette | ||
+ | Pal_ARZ_U: BINCLUDE "art/palettes/ARZ underwater.bin" ; Aquatic Ruin Zone underwater palette | ||
+ | Pal_SCZ: BINCLUDE "art/palettes/SCZ.bin" ; Sky Chase Zone palette | ||
+ | Pal_UNK2: BINCLUDE "art/palettes/Unknown 2.bin" ; Unknown palette 2 | ||
+ | Pal_UNK3: BINCLUDE "art/palettes/Unknown 3.bin" ; Unknown palette 3 | ||
+ | Pal_OOZ_B: BINCLUDE "art/palettes/OOZ Boss.bin" ; Oil Ocean Zone boss palette | ||
+ | Pal_Menu: BINCLUDE "art/palettes/Menu.bin" ; Menu palette | ||
+ | Pal_SS: BINCLUDE "art/palettes/Special Stage Main.bin" ; Special Stage palette | ||
+ | Pal_SS1: BINCLUDE "art/palettes/Special Stage 1.bin" ; Special Stage 1 palette | ||
+ | Pal_SS2: BINCLUDE "art/palettes/Special Stage 2.bin" ; Special Stage 2 palette | ||
+ | Pal_SS3: BINCLUDE "art/palettes/Special Stage 3.bin" ; Special Stage 3 palette | ||
+ | Pal_SS4: BINCLUDE "art/palettes/Special Stage 4.bin" ; Special Stage 4 palette | ||
+ | Pal_SS5: BINCLUDE "art/palettes/Special Stage 5.bin" ; Special Stage 5 palette | ||
+ | Pal_SS6: BINCLUDE "art/palettes/Special Stage 6.bin" ; Special Stage 6 palette | ||
+ | Pal_SS7: BINCLUDE "art/palettes/Special Stage 7.bin" ; Special Stage 7 palette | ||
+ | Pal_UNK4: BINCLUDE "art/palettes/Special Stage 1 2p.bin" ; Special Stage 1 2p palette | ||
+ | Pal_UNK5: BINCLUDE "art/palettes/Special Stage 2 2p.bin" ; Special Stage 2 2p palette | ||
+ | Pal_UNK6: BINCLUDE "art/palettes/Special Stage 3 2p.bin" ; Special Stage 3 2p palette | ||
+ | Pal_UNK7: BINCLUDE "art/palettes/Special Stage Results Screen.bin" ; Special Stage Results Screen palette | ||
+ | </asm> | ||
+ | |||
+ | and replace it with: | ||
+ | <asm> | ||
+ | PalPointers: | ||
+ | palptr Pal_SEGA, Normal_palette, $1F | ||
+ | palptr Pal_Title, Normal_palette_line2, 7 | ||
+ | palptr Pal_UNK1, Normal_palette, $1F | ||
+ | palptr Pal_BGND, Normal_palette, $F | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_WZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_MTZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_MTZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_WFZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_HTZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_HPZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_EHZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_OOZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_MCZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_CNZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_CPZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_DEZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_ARZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_SCZ, Normal_palette_line2, $17 | ||
+ | palptr Pal_HPZ_U, Normal_palette, $1F | ||
+ | palptr Pal_CPZ_U, Normal_palette, $1F | ||
+ | palptr Pal_ARZ_U, Normal_palette, $1F | ||
+ | palptr Pal_SS, Normal_palette, $17 | ||
+ | palptr Pal_UNK2, Normal_palette_line2, 7 | ||
+ | palptr Pal_UNK3, Normal_palette_line2, 7 | ||
+ | palptr Pal_SS1, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS2, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS3, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS4, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS5, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS6, Normal_palette_line4, 7 | ||
+ | palptr Pal_SS7, Normal_palette_line4, 7 | ||
+ | palptr Pal_UNK4, Normal_palette_line4, 7 | ||
+ | palptr Pal_UNK5, Normal_palette_line4, 7 | ||
+ | palptr Pal_UNK6, Normal_palette_line4, 7 | ||
+ | palptr Pal_OOZ_B, Normal_palette_line2, 7 | ||
+ | palptr Pal_Menu, Normal_palette, $1F | ||
+ | palptr Pal_UNK7, Normal_palette, $1F | ||
+ | palptr Pal_Lev11, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev12, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev13, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev14, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev15, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev16, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev17, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev18, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev19, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev1A, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev1B, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev1C, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev1D, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev1E, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev1F, Normal_palette_line2, $17 | ||
+ | palptr Pal_Lev20, Normal_palette_line2, $17 | ||
+ | |||
+ | ; ---------------------------------------------------------------------------- | ||
+ | Pal_SEGA: BINCLUDE "art/palettes/Sega screen.bin" ; SEGA screen palette (Sonic and initial background) | ||
+ | Pal_Title: BINCLUDE "art/palettes/Title screen.bin" ; Title screen Palette | ||
+ | Pal_UNK1: BINCLUDE "art/palettes/Unknown 1.bin" ; Unknown palette 1 (leftover S1 level select palette?) | ||
+ | Pal_BGND: BINCLUDE "art/palettes/SonicAndTails.bin" ; "Sonic and Miles" background palette (also usually the primary palette line) | ||
+ | Pal_EHZ: BINCLUDE "art/palettes/EHZ.bin" ; Emerald Hill Zone palette | ||
+ | Pal_WZ: BINCLUDE "art/palettes/Wood Zone.bin" ; Wood Zone palette | ||
+ | Pal_MTZ: BINCLUDE "art/palettes/MTZ.bin" ; Metropolis Zone palette | ||
+ | Pal_WFZ: BINCLUDE "art/palettes/WFZ.bin" ; Wing Fortress Zone palette | ||
+ | Pal_HTZ: BINCLUDE "art/palettes/HTZ.bin" ; Hill Top Zone palette | ||
+ | Pal_HPZ: BINCLUDE "art/palettes/HPZ.bin" ; Hidden Palace Zone palette | ||
+ | Pal_HPZ_U: BINCLUDE "art/palettes/HPZ underwater.bin" ; Hidden Palace Zone underwater palette | ||
+ | Pal_OOZ: BINCLUDE "art/palettes/OOZ.bin" ; Oil Ocean Zone palette | ||
+ | Pal_MCZ: BINCLUDE "art/palettes/MCZ.bin" ; Mystic Cave Zone palette | ||
+ | Pal_CNZ: BINCLUDE "art/palettes/CNZ.bin" ; Casino Night Zone palette | ||
+ | Pal_CPZ: BINCLUDE "art/palettes/CPZ.bin" ; Chemical Plant Zone palette | ||
+ | Pal_CPZ_U: BINCLUDE "art/palettes/CPZ underwater.bin" ; Chemical Plant Zone underwater palette | ||
+ | Pal_DEZ: BINCLUDE "art/palettes/DEZ.bin" ; Death Egg Zone palette | ||
+ | Pal_ARZ: BINCLUDE "art/palettes/ARZ.bin" ; Aquatic Ruin Zone palette | ||
+ | Pal_ARZ_U: BINCLUDE "art/palettes/ARZ underwater.bin" ; Aquatic Ruin Zone underwater palette | ||
+ | Pal_SCZ: BINCLUDE "art/palettes/SCZ.bin" ; Sky Chase Zone palette | ||
+ | Pal_Lev11: BINCLUDE "art/palettes/Lev11.bin" ; New Level palette | ||
+ | Pal_Lev12: BINCLUDE "art/palettes/Lev12.bin" ; New Level palette | ||
+ | Pal_Lev13: BINCLUDE "art/palettes/Lev13.bin" ; New Level palette | ||
+ | Pal_Lev14: BINCLUDE "art/palettes/Lev14.bin" ; New Level palette | ||
+ | Pal_Lev15: BINCLUDE "art/palettes/Lev15.bin" ; New Level palette | ||
+ | Pal_Lev16: BINCLUDE "art/palettes/Lev16.bin" ; New Level palette | ||
+ | Pal_Lev17: BINCLUDE "art/palettes/Lev17.bin" ; New Level palette | ||
+ | Pal_Lev18: BINCLUDE "art/palettes/Lev18.bin" ; New Level palette | ||
+ | Pal_Lev19: BINCLUDE "art/palettes/Lev19.bin" ; New Level palette | ||
+ | Pal_Lev1A: BINCLUDE "art/palettes/Lev1A.bin" ; New Level palette | ||
+ | Pal_Lev1B: BINCLUDE "art/palettes/Lev1B.bin" ; New Level palette | ||
+ | Pal_Lev1C: BINCLUDE "art/palettes/Lev1C.bin" ; New Level palette | ||
+ | Pal_Lev1D: BINCLUDE "art/palettes/Lev1D.bin" ; New Level palette | ||
+ | Pal_Lev1E: BINCLUDE "art/palettes/Lev1E.bin" ; New Level palette | ||
+ | Pal_Lev1F: BINCLUDE "art/palettes/Lev1F.bin" ; New Level palette | ||
+ | Pal_Lev20: BINCLUDE "art/palettes/Lev20.bin" ; New Level palette | ||
+ | Pal_UNK2: BINCLUDE "art/palettes/Unknown 2.bin" ; Unknown palette 2 | ||
+ | Pal_UNK3: BINCLUDE "art/palettes/Unknown 3.bin" ; Unknown palette 3 | ||
+ | Pal_OOZ_B: BINCLUDE "art/palettes/OOZ Boss.bin" ; Oil Ocean Zone boss palette | ||
+ | Pal_Menu: BINCLUDE "art/palettes/Menu.bin" ; Menu palette | ||
+ | Pal_SS: BINCLUDE "art/palettes/Special Stage Main.bin" ; Special Stage palette | ||
+ | Pal_SS1: BINCLUDE "art/palettes/Special Stage 1.bin" ; Special Stage 1 palette | ||
+ | Pal_SS2: BINCLUDE "art/palettes/Special Stage 2.bin" ; Special Stage 2 palette | ||
+ | Pal_SS3: BINCLUDE "art/palettes/Special Stage 3.bin" ; Special Stage 3 palette | ||
+ | Pal_SS4: BINCLUDE "art/palettes/Special Stage 4.bin" ; Special Stage 4 palette | ||
+ | Pal_SS5: BINCLUDE "art/palettes/Special Stage 5.bin" ; Special Stage 5 palette | ||
+ | Pal_SS6: BINCLUDE "art/palettes/Special Stage 6.bin" ; Special Stage 6 palette | ||
+ | Pal_SS7: BINCLUDE "art/palettes/Special Stage 7.bin" ; Special Stage 7 palette | ||
+ | Pal_UNK4: BINCLUDE "art/palettes/Special Stage 1 2p.bin" ; Special Stage 1 2p palette | ||
+ | Pal_UNK5: BINCLUDE "art/palettes/Special Stage 2 2p.bin" ; Special Stage 2 2p palette | ||
+ | Pal_UNK6: BINCLUDE "art/palettes/Special Stage 3 2p.bin" ; Special Stage 3 2p palette | ||
+ | Pal_UNK7: BINCLUDE "art/palettes/Special Stage Results Screen.bin" ; Special Stage Results Screen palette | ||
+ | </asm> | ||
+ | |||
+ | That inserts our new palettes, which we will be using when we start on the main level load block. |
Revision as of 12:36, 29 April 2008
WARNING: I strongly recommend you port the sonic1 sound driver first before proceeding. A lot of major data shifting will occur in this tutorial and it will make the rom size a lot bigger than it was before. This will break the sonic2 or even sonic2 beta sound driver, thus so you definitely want the sonic 1 sound driver due to the fact that it can take the shifting and still work properly.
You probably noticed that all the indexes in the game stop at $10 and when you try to extend it, by extending the MLLB, you get weird glitches or even crashes, that is because you haven't extended all the indexes that need to be extended.
first we will look at the data that defines the titlecard layout:
<asm>
- word_13CD4
Obj34_TitleCardData: dc.b 8, 0, $80, $1B dc.w $240, $120, $B8
dc.b $A, $11, $40, $1C dc.w $28, $148, $D0
dc.b $C, $12, $18, $1C dc.w $68, $188, $D0
dc.b 2, 0, 0, 0 dc.w 0, 0, 0
dc.b 4, $15, $48, 8 dc.w $2A8, $168,$120
dc.b 6, $16, 8, $15 dc.w $80, $F0, $F0 </asm>
we want to change it to:
<asm>
- word_13CD4
Obj34_TitleCardData: dc.b 8, 0, $80, $1B; Index 0 is the start of Zone names dc.w $240, $120, $B8
dc.b $A, $21, $40, $1C; Use index $21 to load the "ZONE" string dc.w $28, $148, $D0
dc.b $C, $22, $18, $1C; Use index $22 as the index for act 1, $23 for act 2, $24 for act 3 dc.w $68, $188, $D0
dc.b 2, 0, 0, 0; I have no idea what this is. dc.w 0, 0, 0
dc.b 4, $25, $48, 8; Use index $25 for "SONIC THE HEDGEHOG" string dc.w $2A8, $168,$120
dc.b 6, $26, 8, $15; Use index $26 for red panel edge dc.w $80, $F0, $F0 </asm>
That change allows us to make room for our extra 16 levels.
Next we locate: <asm>
- loc_157D2
LoadTitleCard: bsr.s LoadTitleCard0 moveq #0,d0 move.b (Current_Zone).w,d0 move.b byte_15820(pc,d0.w),d0 lea word_15832(pc),a0 lea (a0,d0.w),a0 move.l #$7BC00002,d0 </asm>
and replace it with: <asm>
- loc_157D2
LoadTitleCard: bsr.s LoadTitleCard0 moveq #0,d0 move.b (Current_Zone).w,d0 add.w d0,d0 move.w Off_FontIndexes(pc,d0.w),d0 lea Off_FontIndexes(pc,d0.w),a0 move.l #$7BC00002,d0 </asm>
Next we locate: <asm>
- unknown
byte_15820: dc.b 0, 0, 0, 0,$10,$10,$98,$20,$2C, 0,$3C,$46,$58,$68,$A8,$7A dc.b $8A, 0 ; 16
- unknown
word_15832: dc.w $2A06,$3804, 4,$2604, $C04,$1804,$1C02,$FFFF dc.w $2A06,$4004,$3804,$3004,$2604,$1C02,$3C04,$FFFF; 8 dc.w $1804,$1C02,$2604,$4004,$3004,$FFFF,$1804,$1C02; 16 dc.w $C04,$3004, 4,$2604, $804,$FFFF,$1C02,$2604; 24 dc.w $804, 4,$FFFF,$2A06,$5604,$3C04,$4004,$1C02; 32 dc.w $804, 4,$4804,$FFFF, $804, 4,$3C04,$1C02; 40 dc.w $1404,$1804,$4004,$FFFF, $804,$1804,$2A06,$1C02; 48 dc.w 4,$2604,$3004,$4004,$FFFF, 4,$3404,$4404; 56 dc.w $4004,$1C02, $804,$3804,$FFFF,$3C04,$2204,$5604; 64 dc.w $804,$1804, 4,$FFFF,$4C06,$1C02,$1404,$1004; 72 dc.w $3804,$4004,$3C04,$FFFF, $C04, 4,$4004,$1804; 80 dc.w $1404,$FFFF ; 88 </asm>
and replace it with: <asm>; offset index to loaded artwork index for titlecards Off_FontIndexes: dc.w FontIndex_EHZ-Off_FontIndexes dc.w FontIndex_LZ-Off_FontIndexes dc.w FontIndex_WZ-Off_FontIndexes dc.w FontIndex_DHZ-Off_FontIndexes dc.w FontIndex_MTZ-Off_FontIndexes dc.w FontIndex_MTZ-Off_FontIndexes dc.w FontIndex_WFZ-Off_FontIndexes dc.w FontIndex_HTZ-Off_FontIndexes dc.w FontIndex_HPZ-Off_FontIndexes dc.w FontIndex_GCZ-Off_FontIndexes dc.w FontIndex_OOZ-Off_FontIndexes dc.w FontIndex_MCZ-Off_FontIndexes dc.w FontIndex_CNZ-Off_FontIndexes dc.w FontIndex_CPZ-Off_FontIndexes dc.w FontIndex_DEZ-Off_FontIndexes dc.w FontIndex_ARZ-Off_FontIndexes dc.w FontIndex_SCZ-Off_FontIndexes dc.w FontIndex_Lev11-Off_FontIndexes dc.w FontIndex_Lev12-Off_FontIndexes dc.w FontIndex_Lev13-Off_FontIndexes dc.w FontIndex_Lev14-Off_FontIndexes dc.w FontIndex_Lev15-Off_FontIndexes dc.w FontIndex_Lev16-Off_FontIndexes dc.w FontIndex_Lev17-Off_FontIndexes dc.w FontIndex_Lev18-Off_FontIndexes dc.w FontIndex_Lev19-Off_FontIndexes dc.w FontIndex_Lev1A-Off_FontIndexes dc.w FontIndex_Lev1B-Off_FontIndexes dc.w FontIndex_Lev1C-Off_FontIndexes dc.w FontIndex_Lev1D-Off_FontIndexes dc.w FontIndex_Lev1E-Off_FontIndexes dc.w FontIndex_Lev1F-Off_FontIndexes dc.w FontIndex_Lev20-Off_FontIndexes
- Letters displayed on EHZ titlecard
FontIndex_EHZ: dc.w $2A06,$3804, 4,$2604, $C04,$1804,$1C02,$FFFF
- Letters displayed on LZ titlecard
FontIndex_LZ: dc.w $2604, 4, $404,$3804,$1C02,$4004,$1804,$FFFF
- Letters displayed on WZ titlecard
FontIndex_WZ: dc.w $4C06, $C04,$FFFF
- Letters displayed on DHZ titlecard
FontIndex_DHZ: dc.w $C04,$4404,$3C04,$4004,$1804,$1C02,$2604,$FFFF
- Letters displayed on MTZ titlecard
FontIndex_MTZ: dc.w $2A06,$4004,$3804,$3004,$2604,$1C02,$3C04,$FFFF
- Letters displayed on WFZ titlecard
FontIndex_WFZ: dc.w $4C06,$1C02,$1404,$1004,$3804,$4004,$3C04,$FFFF
- Letters displayed on HTZ titlecard
FontIndex_HTZ: dc.w $1804,$1C02,$2604,$4004,$3004,$FFFF
- Letters displayed on HPZ titlecard
FontIndex_HPZ: dc.w $1804,$1C02, $C04,$3004, 4,$2604, $804,$FFFF
- Letters displayed on GCZ titlecard
FontIndex_GCZ: dc.w $1404, $804,$1C02, $C04,$4004,$5604,$FFFF
- Letters displayed on OOZ titlecard
FontIndex_OOZ: dc.w $1C02,$2604, $804, 4,$FFFF
- Letters displayed on MCZ titlecard
FontIndex_MCZ: dc.w $2A06,$5604,$3C04,$4004,$1C02, $804, 4,$4804 dc.w $FFFF
- Letters displayed on CNZ titlecard
FontIndex_CNZ: dc.w $804, 4,$3C04,$1C02,$1404,$1804,$4004,$FFFF
- Letters displayed on CPZ titlecard
FontIndex_CPZ: dc.w $804,$1804,$2A06,$1C02, 4,$2604,$3004,$4004 dc.w $FFFF
- Letters displayed on DEZ titlecard
FontIndex_DEZ: dc.w $C04, 4,$4004,$1804,$1404,$FFFF
- Letters displayed on ARZ titlecard
FontIndex_ARZ: dc.w 4,$3404,$4404,$4004,$1C02, $804,$3804,$FFFF
- Letters displayed on SCZ titlecard
FontIndex_SCZ: dc.w $3C04,$2204,$5604, $804,$1804, 4,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev11: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev12: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev13: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev14: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev15: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev16: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev17: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev18: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev19: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev1A: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev1B: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev1C: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev1D: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev1E: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev1F: dc.w $4606,$2604,$4804,$FFFF
- Letters displayed on New Level titlecard
FontIndex_Lev20: dc.w $4606,$2604,$4804,$FFFF </asm>
The original 8-bit proprietary offset index just won't cut it for the scope of this tutorial, so we replaced it with a much friendlier 16-bit relative offset index. also, we changed the order of the text artwork loading data to something much easier to manage, and added not only the ESE names for the empty levels that were already there, and you may choose to change again later, but also the slots for the new levels too. (they will read "NEW LEVEL ZONE" until you give the levels names and change the data here and mappings for those level titlecards.
You will find a link to the archive with the extra data files (sprite 34 mappings included) at the end of the tutorial.
Now we want to locate: <asm>
- off_19F4
PalCycle: dc.w PalCycle_EHZ - PalCycle ; 0 dc.w PalCycle_Null - PalCycle ; 1 dc.w PalCycle_Level2 - PalCycle ; 2 dc.w PalCycle_Null - PalCycle ; 3 dc.w PalCycle_MTZ - PalCycle ; 4 dc.w PalCycle_MTZ - PalCycle ; 5 dc.w PalCycle_WFZ - PalCycle ; 6 dc.w PalCycle_HTZ - PalCycle ; 7 dc.w PalCycle_HPZ - PalCycle ; 8 dc.w PalCycle_Null - PalCycle ; 9 dc.w PalCycle_OOZ - PalCycle ; 10 dc.w PalCycle_MCZ - PalCycle ; 11 dc.w PalCycle_CNZ - PalCycle ; 12 dc.w PalCycle_CPZ - PalCycle ; 13 dc.w PalCycle_CPZ - PalCycle ; 14 dc.w PalCycle_ARZ - PalCycle ; 15 dc.w PalCycle_WFZ - PalCycle ; 16 </asm>
and replace it with: <asm>
- off_19F4
PalCycle: dc.w PalCycle_EHZ - PalCycle ; 00 dc.w PalCycle_Null - PalCycle ; 01 dc.w PalCycle_Level2 - PalCycle ; 02 dc.w PalCycle_Null - PalCycle ; 03 dc.w PalCycle_MTZ - PalCycle ; 04 dc.w PalCycle_MTZ - PalCycle ; 05 dc.w PalCycle_WFZ - PalCycle ; 06 dc.w PalCycle_HTZ - PalCycle ; 07 dc.w PalCycle_HPZ - PalCycle ; 08 dc.w PalCycle_Null - PalCycle ; 09 dc.w PalCycle_OOZ - PalCycle ; 0A dc.w PalCycle_MCZ - PalCycle ; 0B dc.w PalCycle_CNZ - PalCycle ; 0C dc.w PalCycle_CPZ - PalCycle ; 0D dc.w PalCycle_CPZ - PalCycle ; 0E dc.w PalCycle_ARZ - PalCycle ; 0F dc.w PalCycle_WFZ - PalCycle ; 10 dc.w PalCycle_Null - PalCycle ; 11 dc.w PalCycle_Null - PalCycle ; 12 dc.w PalCycle_Null - PalCycle ; 13 dc.w PalCycle_Null - PalCycle ; 14 dc.w PalCycle_Null - PalCycle ; 15 dc.w PalCycle_Null - PalCycle ; 16 dc.w PalCycle_Null - PalCycle ; 17 dc.w PalCycle_Null - PalCycle ; 18 dc.w PalCycle_Null - PalCycle ; 19 dc.w PalCycle_Null - PalCycle ; 1A dc.w PalCycle_Null - PalCycle ; 1B dc.w PalCycle_Null - PalCycle ; 1C dc.w PalCycle_Null - PalCycle ; 1D dc.w PalCycle_Null - PalCycle ; 1E dc.w PalCycle_Null - PalCycle ; 1F dc.w PalCycle_Null - PalCycle ; 20 </asm>
That inserts empty slots for the cycling palettes of out new levels.
Next we locate: <asm> PalPointers: palptr Pal_SEGA, Normal_palette, $1F palptr Pal_Title, Normal_palette_line2, 7 palptr Pal_UNK1, Normal_palette, $1F palptr Pal_BGND, Normal_palette, $F palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_WZ, Normal_palette_line2, $17 palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_MTZ, Normal_palette_line2, $17 palptr Pal_MTZ, Normal_palette_line2, $17 palptr Pal_WFZ, Normal_palette_line2, $17 palptr Pal_HTZ, Normal_palette_line2, $17 palptr Pal_HPZ, Normal_palette_line2, $17 palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_OOZ, Normal_palette_line2, $17 palptr Pal_MCZ, Normal_palette_line2, $17 palptr Pal_CNZ, Normal_palette_line2, $17 palptr Pal_CPZ, Normal_palette_line2, $17 palptr Pal_DEZ, Normal_palette_line2, $17 palptr Pal_ARZ, Normal_palette_line2, $17 palptr Pal_SCZ, Normal_palette_line2, $17 palptr Pal_HPZ_U, Normal_palette, $1F palptr Pal_CPZ_U, Normal_palette, $1F palptr Pal_ARZ_U, Normal_palette, $1F palptr Pal_SS, Normal_palette, $17 palptr Pal_UNK2, Normal_palette_line2, 7 palptr Pal_UNK3, Normal_palette_line2, 7 palptr Pal_SS1, Normal_palette_line4, 7 palptr Pal_SS2, Normal_palette_line4, 7 palptr Pal_SS3, Normal_palette_line4, 7 palptr Pal_SS4, Normal_palette_line4, 7 palptr Pal_SS5, Normal_palette_line4, 7 palptr Pal_SS6, Normal_palette_line4, 7 palptr Pal_SS7, Normal_palette_line4, 7 palptr Pal_UNK4, Normal_palette_line4, 7 palptr Pal_UNK5, Normal_palette_line4, 7 palptr Pal_UNK6, Normal_palette_line4, 7 palptr Pal_OOZ_B, Normal_palette_line2, 7 palptr Pal_Menu, Normal_palette, $1F palptr Pal_UNK7, Normal_palette, $1F
- ----------------------------------------------------------------------------
Pal_SEGA: BINCLUDE "art/palettes/Sega screen.bin" ; SEGA screen palette (Sonic and initial background) Pal_Title: BINCLUDE "art/palettes/Title screen.bin" ; Title screen Palette Pal_UNK1: BINCLUDE "art/palettes/Unknown 1.bin" ; Unknown palette 1 (leftover S1 level select palette?) Pal_BGND: BINCLUDE "art/palettes/SonicAndTails.bin" ; "Sonic and Miles" background palette (also usually the primary palette line) Pal_EHZ: BINCLUDE "art/palettes/EHZ.bin" ; Emerald Hill Zone palette Pal_WZ: BINCLUDE "art/palettes/Wood Zone.bin" ; Wood Zone palette Pal_MTZ: BINCLUDE "art/palettes/MTZ.bin" ; Metropolis Zone palette Pal_WFZ: BINCLUDE "art/palettes/WFZ.bin" ; Wing Fortress Zone palette Pal_HTZ: BINCLUDE "art/palettes/HTZ.bin" ; Hill Top Zone palette Pal_HPZ: BINCLUDE "art/palettes/HPZ.bin" ; Hidden Palace Zone palette Pal_HPZ_U: BINCLUDE "art/palettes/HPZ underwater.bin" ; Hidden Palace Zone underwater palette Pal_OOZ: BINCLUDE "art/palettes/OOZ.bin" ; Oil Ocean Zone palette Pal_MCZ: BINCLUDE "art/palettes/MCZ.bin" ; Mystic Cave Zone palette Pal_CNZ: BINCLUDE "art/palettes/CNZ.bin" ; Casino Night Zone palette Pal_CPZ: BINCLUDE "art/palettes/CPZ.bin" ; Chemical Plant Zone palette Pal_CPZ_U: BINCLUDE "art/palettes/CPZ underwater.bin" ; Chemical Plant Zone underwater palette Pal_DEZ: BINCLUDE "art/palettes/DEZ.bin" ; Death Egg Zone palette Pal_ARZ: BINCLUDE "art/palettes/ARZ.bin" ; Aquatic Ruin Zone palette Pal_ARZ_U: BINCLUDE "art/palettes/ARZ underwater.bin" ; Aquatic Ruin Zone underwater palette Pal_SCZ: BINCLUDE "art/palettes/SCZ.bin" ; Sky Chase Zone palette Pal_UNK2: BINCLUDE "art/palettes/Unknown 2.bin" ; Unknown palette 2 Pal_UNK3: BINCLUDE "art/palettes/Unknown 3.bin" ; Unknown palette 3 Pal_OOZ_B: BINCLUDE "art/palettes/OOZ Boss.bin" ; Oil Ocean Zone boss palette Pal_Menu: BINCLUDE "art/palettes/Menu.bin" ; Menu palette Pal_SS: BINCLUDE "art/palettes/Special Stage Main.bin" ; Special Stage palette Pal_SS1: BINCLUDE "art/palettes/Special Stage 1.bin" ; Special Stage 1 palette Pal_SS2: BINCLUDE "art/palettes/Special Stage 2.bin" ; Special Stage 2 palette Pal_SS3: BINCLUDE "art/palettes/Special Stage 3.bin" ; Special Stage 3 palette Pal_SS4: BINCLUDE "art/palettes/Special Stage 4.bin" ; Special Stage 4 palette Pal_SS5: BINCLUDE "art/palettes/Special Stage 5.bin" ; Special Stage 5 palette Pal_SS6: BINCLUDE "art/palettes/Special Stage 6.bin" ; Special Stage 6 palette Pal_SS7: BINCLUDE "art/palettes/Special Stage 7.bin" ; Special Stage 7 palette Pal_UNK4: BINCLUDE "art/palettes/Special Stage 1 2p.bin" ; Special Stage 1 2p palette Pal_UNK5: BINCLUDE "art/palettes/Special Stage 2 2p.bin" ; Special Stage 2 2p palette Pal_UNK6: BINCLUDE "art/palettes/Special Stage 3 2p.bin" ; Special Stage 3 2p palette Pal_UNK7: BINCLUDE "art/palettes/Special Stage Results Screen.bin" ; Special Stage Results Screen palette </asm>
and replace it with: <asm> PalPointers: palptr Pal_SEGA, Normal_palette, $1F palptr Pal_Title, Normal_palette_line2, 7 palptr Pal_UNK1, Normal_palette, $1F palptr Pal_BGND, Normal_palette, $F palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_WZ, Normal_palette_line2, $17 palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_MTZ, Normal_palette_line2, $17 palptr Pal_MTZ, Normal_palette_line2, $17 palptr Pal_WFZ, Normal_palette_line2, $17 palptr Pal_HTZ, Normal_palette_line2, $17 palptr Pal_HPZ, Normal_palette_line2, $17 palptr Pal_EHZ, Normal_palette_line2, $17 palptr Pal_OOZ, Normal_palette_line2, $17 palptr Pal_MCZ, Normal_palette_line2, $17 palptr Pal_CNZ, Normal_palette_line2, $17 palptr Pal_CPZ, Normal_palette_line2, $17 palptr Pal_DEZ, Normal_palette_line2, $17 palptr Pal_ARZ, Normal_palette_line2, $17 palptr Pal_SCZ, Normal_palette_line2, $17 palptr Pal_HPZ_U, Normal_palette, $1F palptr Pal_CPZ_U, Normal_palette, $1F palptr Pal_ARZ_U, Normal_palette, $1F palptr Pal_SS, Normal_palette, $17 palptr Pal_UNK2, Normal_palette_line2, 7 palptr Pal_UNK3, Normal_palette_line2, 7 palptr Pal_SS1, Normal_palette_line4, 7 palptr Pal_SS2, Normal_palette_line4, 7 palptr Pal_SS3, Normal_palette_line4, 7 palptr Pal_SS4, Normal_palette_line4, 7 palptr Pal_SS5, Normal_palette_line4, 7 palptr Pal_SS6, Normal_palette_line4, 7 palptr Pal_SS7, Normal_palette_line4, 7 palptr Pal_UNK4, Normal_palette_line4, 7 palptr Pal_UNK5, Normal_palette_line4, 7 palptr Pal_UNK6, Normal_palette_line4, 7 palptr Pal_OOZ_B, Normal_palette_line2, 7 palptr Pal_Menu, Normal_palette, $1F palptr Pal_UNK7, Normal_palette, $1F palptr Pal_Lev11, Normal_palette_line2, $17 palptr Pal_Lev12, Normal_palette_line2, $17 palptr Pal_Lev13, Normal_palette_line2, $17 palptr Pal_Lev14, Normal_palette_line2, $17 palptr Pal_Lev15, Normal_palette_line2, $17 palptr Pal_Lev16, Normal_palette_line2, $17 palptr Pal_Lev17, Normal_palette_line2, $17 palptr Pal_Lev18, Normal_palette_line2, $17 palptr Pal_Lev19, Normal_palette_line2, $17 palptr Pal_Lev1A, Normal_palette_line2, $17 palptr Pal_Lev1B, Normal_palette_line2, $17 palptr Pal_Lev1C, Normal_palette_line2, $17 palptr Pal_Lev1D, Normal_palette_line2, $17 palptr Pal_Lev1E, Normal_palette_line2, $17 palptr Pal_Lev1F, Normal_palette_line2, $17 palptr Pal_Lev20, Normal_palette_line2, $17
- ----------------------------------------------------------------------------
Pal_SEGA: BINCLUDE "art/palettes/Sega screen.bin" ; SEGA screen palette (Sonic and initial background) Pal_Title: BINCLUDE "art/palettes/Title screen.bin" ; Title screen Palette Pal_UNK1: BINCLUDE "art/palettes/Unknown 1.bin" ; Unknown palette 1 (leftover S1 level select palette?) Pal_BGND: BINCLUDE "art/palettes/SonicAndTails.bin" ; "Sonic and Miles" background palette (also usually the primary palette line) Pal_EHZ: BINCLUDE "art/palettes/EHZ.bin" ; Emerald Hill Zone palette Pal_WZ: BINCLUDE "art/palettes/Wood Zone.bin" ; Wood Zone palette Pal_MTZ: BINCLUDE "art/palettes/MTZ.bin" ; Metropolis Zone palette Pal_WFZ: BINCLUDE "art/palettes/WFZ.bin" ; Wing Fortress Zone palette Pal_HTZ: BINCLUDE "art/palettes/HTZ.bin" ; Hill Top Zone palette Pal_HPZ: BINCLUDE "art/palettes/HPZ.bin" ; Hidden Palace Zone palette Pal_HPZ_U: BINCLUDE "art/palettes/HPZ underwater.bin" ; Hidden Palace Zone underwater palette Pal_OOZ: BINCLUDE "art/palettes/OOZ.bin" ; Oil Ocean Zone palette Pal_MCZ: BINCLUDE "art/palettes/MCZ.bin" ; Mystic Cave Zone palette Pal_CNZ: BINCLUDE "art/palettes/CNZ.bin" ; Casino Night Zone palette Pal_CPZ: BINCLUDE "art/palettes/CPZ.bin" ; Chemical Plant Zone palette Pal_CPZ_U: BINCLUDE "art/palettes/CPZ underwater.bin" ; Chemical Plant Zone underwater palette Pal_DEZ: BINCLUDE "art/palettes/DEZ.bin" ; Death Egg Zone palette Pal_ARZ: BINCLUDE "art/palettes/ARZ.bin" ; Aquatic Ruin Zone palette Pal_ARZ_U: BINCLUDE "art/palettes/ARZ underwater.bin" ; Aquatic Ruin Zone underwater palette Pal_SCZ: BINCLUDE "art/palettes/SCZ.bin" ; Sky Chase Zone palette Pal_Lev11: BINCLUDE "art/palettes/Lev11.bin" ; New Level palette Pal_Lev12: BINCLUDE "art/palettes/Lev12.bin" ; New Level palette Pal_Lev13: BINCLUDE "art/palettes/Lev13.bin" ; New Level palette Pal_Lev14: BINCLUDE "art/palettes/Lev14.bin" ; New Level palette Pal_Lev15: BINCLUDE "art/palettes/Lev15.bin" ; New Level palette Pal_Lev16: BINCLUDE "art/palettes/Lev16.bin" ; New Level palette Pal_Lev17: BINCLUDE "art/palettes/Lev17.bin" ; New Level palette Pal_Lev18: BINCLUDE "art/palettes/Lev18.bin" ; New Level palette Pal_Lev19: BINCLUDE "art/palettes/Lev19.bin" ; New Level palette Pal_Lev1A: BINCLUDE "art/palettes/Lev1A.bin" ; New Level palette Pal_Lev1B: BINCLUDE "art/palettes/Lev1B.bin" ; New Level palette Pal_Lev1C: BINCLUDE "art/palettes/Lev1C.bin" ; New Level palette Pal_Lev1D: BINCLUDE "art/palettes/Lev1D.bin" ; New Level palette Pal_Lev1E: BINCLUDE "art/palettes/Lev1E.bin" ; New Level palette Pal_Lev1F: BINCLUDE "art/palettes/Lev1F.bin" ; New Level palette Pal_Lev20: BINCLUDE "art/palettes/Lev20.bin" ; New Level palette Pal_UNK2: BINCLUDE "art/palettes/Unknown 2.bin" ; Unknown palette 2 Pal_UNK3: BINCLUDE "art/palettes/Unknown 3.bin" ; Unknown palette 3 Pal_OOZ_B: BINCLUDE "art/palettes/OOZ Boss.bin" ; Oil Ocean Zone boss palette Pal_Menu: BINCLUDE "art/palettes/Menu.bin" ; Menu palette Pal_SS: BINCLUDE "art/palettes/Special Stage Main.bin" ; Special Stage palette Pal_SS1: BINCLUDE "art/palettes/Special Stage 1.bin" ; Special Stage 1 palette Pal_SS2: BINCLUDE "art/palettes/Special Stage 2.bin" ; Special Stage 2 palette Pal_SS3: BINCLUDE "art/palettes/Special Stage 3.bin" ; Special Stage 3 palette Pal_SS4: BINCLUDE "art/palettes/Special Stage 4.bin" ; Special Stage 4 palette Pal_SS5: BINCLUDE "art/palettes/Special Stage 5.bin" ; Special Stage 5 palette Pal_SS6: BINCLUDE "art/palettes/Special Stage 6.bin" ; Special Stage 6 palette Pal_SS7: BINCLUDE "art/palettes/Special Stage 7.bin" ; Special Stage 7 palette Pal_UNK4: BINCLUDE "art/palettes/Special Stage 1 2p.bin" ; Special Stage 1 2p palette Pal_UNK5: BINCLUDE "art/palettes/Special Stage 2 2p.bin" ; Special Stage 2 2p palette Pal_UNK6: BINCLUDE "art/palettes/Special Stage 3 2p.bin" ; Special Stage 3 2p palette Pal_UNK7: BINCLUDE "art/palettes/Special Stage Results Screen.bin" ; Special Stage Results Screen palette </asm>
That inserts our new palettes, which we will be using when we start on the main level load block.