Separate ending art from GHZ/make Ending load alternate art
From Sonic Retro
(Original guide by JGMR)
(Based on this guide by MKAmeX and originally by Shadow05)
The title says it all. After completing the previous guide, this guide will make the Ending sequence for Sonic 1 to load a different art file, allowing you to have custom level art for the Ending sequence that won't appear in the Title or in GHZ.
Note that this guide is optional; you might not want to follow this guide unless you want the art for GHZ, the title screen and the ending sequence separated.
Hivebrain's 2005 disasssembly
First, we'll need to have a copy of GHZ's level art file:
Simply copy '8x8ghz.bin' and rename it as 8x8end.bin.
With that done, we now have our Ending sequence art (8x8end.bin), the GHZ art (8x8ghz.bin), and our Title Screen art (8x8ghz1.bin + 8x8ghz2.bin). Now we can edit the code to this art separately.
First, open _inc/Main level load blocks.asm.
Find this:
dc.l Nem_GHZ_2nd ; main load block for ending
Change Nem_GHZ_2nd to Nem_Ending, you should be left with this:
dc.l Nem_Ending ; main load block for ending
This is pointless as this particular pointer is never used, but it'll keep things tidy.
Next, open sonic1.asm and look for:
Nem_GHZ: incbin artnem\8x8ghz.bin ; GHZ primary patterns
even
Add this after Nem_GHZ::
Nem_Ending: incbin artnem\8x8end.bin ; Ending sequence primary patterns
even
It should look like:
Blk16_GHZ: incbin map16\ghz.bin
even
Nem_GHZ: incbin artnem\8x8ghz.bin ; GHZ primary patterns
Even
Nem_Ending: incbin artnem\8x8end.bin ; Ending sequence primary patterns
even
Nem_GHZ_1st: incbin artnem\8x8ghz1.bin ; Title Screen only
even
Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin ; Title Screen only
even
Blk256_GHZ: incbin map256\ghz.bin
even
Next, open _inc/Pattern load cues.asm and find:
PLC_Ending: dc.w $E
dc.l Nem_GHZ_1st ; GHZ main patterns
dc.w 0
dc.l Nem_GHZ_2nd ; GHZ secondary patterns
dc.w $39A0
Change Nem_GHZ_1st to Nem_Ending, remove Nem_GHZ_2nd's entry, and change the dc.w $E to dc.w $D. Your code should look like this.
PLC_Ending: dc.w $D
dc.l Nem_Ending ; Ending sequence main patterns
dc.w 0
Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Ending sequence, Title screen, and GHZ art unless you edit it.
SVN/GitHub disassembly
First, we'll need to have a copy of GHZ's level art file:
Simply copy '8x8 - GHZ.bin' and rename it as 8x8 - Ending.bin.
With that done, we now have our Ending sequence art (8x8 - Ending.bin), the GHZ art (8x8 - GHZ.bin), and our Title Screen art (8x8 - GHZ1.bin + 8x8 - GHZ2.bin). Now we can edit the code to this art separately.
First, open _inc/LevelHeaders.asm.
Find this:
lhead 0, Nem_GHZ_2nd, 0, Blk16_GHZ, Blk256_GHZ, bgm_SBZ, palid_Ending ; Ending
Change Nem_GHZ_2nd to Nem_Ending, you should be left with this:
lhead 0, Nem_Ending, 0, Blk16_GHZ, Blk256_GHZ, bgm_SBZ, palid_Ending ; Ending
This is pointless as this particular pointer is never used, but it'll keep things tidy.
Next, open sonic.asm and look for:
Nem_GHZ: incbin "artnem\8x8 - GHZ.bin" ; GHZ primary patterns
even
Add this after Nem_GHZ::
Nem_Ending: incbin "artnem\8x8 - Ending.bin" ; Ending sequence primary patterns
even
It should look like:
Blk16_GHZ: incbin "map16\GHZ.bin"
even
Nem_GHZ: incbin "artnem\8x8 - GHZ.bin" ; GHZ primary patterns
even
Nem_Ending: incbin "artnem\8x8 - Ending.bin" ; Ending sequence primary patterns
even
Nem_GHZ_1st: incbin "artnem\8x8 - GHZ1.bin" ; Title Screen only
even
Nem_GHZ_2nd: incbin "artnem\8x8 - GHZ2.bin" ; Title Screen only
even
Blk256_GHZ: incbin "map256\GHZ.bin"
even
Next, go to _inc/Pattern Load Cues.asm and find:
PLC_Ending: dc.w ((PLC_Endingend-PLC_Ending-2)/6)-1
plcm Nem_GHZ_1st,0 ; GHZ main patterns
plcm Nem_GHZ_2nd, $39A0 ; GHZ secondary patterns
Change Nem_GHZ_1st to Nem_Ending and remove Nem_GHZ_2nd's entry. Your code should look like this:
PLC_Ending: dc.w ((PLC_Endingend-PLC_Ending-2)/6)-1
plcm Nem_Ending,0 ; Ending sequence main patterns
Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Ending sequence, Title screen, and GHZ art unless you edit it.
Also, if you're going to be editing the art, you may want to edit the blocks and chunks, but luckily those are separated between the GHZ, Ending sequence and Title screen. Have fun with your new art!