Difference between revisions of "Separate title art from GHZ/make GHZ load alternate art"
From Sonic Retro
(→Hivebrain's 2005 disasssembly) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Hivebrain's 2005 disasssembly== | ==Hivebrain's 2005 disasssembly== | ||
− | |||
First, we'll need to merge GHZ's two level art files into one: | First, we'll need to merge GHZ's two level art files into one: | ||
Open your hex editor and open '8x8ghz1.bin' and '8x8ghz2.bin', found in the artnem_u folder, and append the contents of 8x8ghz2.bin to the end of 8x8ghz1.bin. Save it as 8x8ghz.bin. | Open your hex editor and open '8x8ghz1.bin' and '8x8ghz2.bin', found in the artnem_u folder, and append the contents of 8x8ghz2.bin to the end of 8x8ghz1.bin. Save it as 8x8ghz.bin. | ||
− | + | Get a decompressor (you can find some [[Sonic_Hacking_Utilities#Compressors.2FDecompressors | here]]), and compress the file in Nemesis (save the compressed file in the "artnem" folder). | |
With that done, we now have our GHZ art (8x8ghz.bin), and our Title Screen & Ending art (8x8ghz1.bin + 8x8ghz2.bin). Now we can edit the code to use these two separately. | With that done, we now have our GHZ art (8x8ghz.bin), and our Title Screen & Ending art (8x8ghz1.bin + 8x8ghz2.bin). Now we can edit the code to use these two separately. | ||
Line 66: | Line 65: | ||
dc.w $39A0</syntaxhighlight> | dc.w $39A0</syntaxhighlight> | ||
− | Change '''Nem_GHZ_1st''' to '''Nem_GHZ''' | + | Change '''Nem_GHZ_1st''' to '''Nem_GHZ''', remove '''Nem_GHZ_2nd's''' entry, and change the '''dc.w $B''' to '''dc.w $A'''. |
Your code should look like this. | Your code should look like this. | ||
Line 74: | Line 73: | ||
Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Title+Ending and GHZ art unless you edit it. | Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Title+Ending and GHZ art unless you edit it. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==SVN/GitHub disassembly== | ==SVN/GitHub disassembly== | ||
Line 161: | Line 138: | ||
Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Title+Ending and GHZ art unless you edit it. | Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Title+Ending 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, though those are still shared between the GHZ+Ending and Title. If you want to separate those too, look at | + | Also, if you're going to be editing the art, you may want to edit the blocks and chunks, though those are still shared between the GHZ+Ending and Title. If you want to separate those too, look at these guides: [[SCHG How-to:Make an Alternative Title Screen]], [[SCHG How-to:Separate ending art from GHZ/make Ending load alternate art|SCHG How-to:Make Ending load Alternate Art]] |
{{S1Howtos}} | {{S1Howtos}} | ||
− | + | |{{PAGENAME}}]] |
Latest revision as of 23:27, 10 July 2023
(Original guide by MKAmeX)
In case the title's too vague, this guide will make GHZ load a different art file to the Title Screen and the Ending. Allowing you to have custom level art for GHZ that won't appear in the Title or Ending.
Hivebrain's 2005 disasssembly
First, we'll need to merge GHZ's two level art files into one:
Open your hex editor and open '8x8ghz1.bin' and '8x8ghz2.bin', found in the artnem_u folder, and append the contents of 8x8ghz2.bin to the end of 8x8ghz1.bin. Save it as 8x8ghz.bin.
Get a decompressor (you can find some here), and compress the file in Nemesis (save the compressed file in the "artnem" folder).
With that done, we now have our GHZ art (8x8ghz.bin), and our Title Screen & Ending art (8x8ghz1.bin + 8x8ghz2.bin). Now we can edit the code to use these two separately.
First, open _inc/Main level load blocks.asm.
Find this:
dc.l Nem_GHZ_2nd+$4000000
Change Nem_GHZ_2nd to Nem_GHZ, you should be left with this:
dc.l Nem_GHZ+$4000000
This is pointless as this particular pointer is never used, but it'll keep things tidy.
Next, open sonic1.asm and look for:
Blk16_GHZ: incbin map16\ghz.bin
even
Nem_GHZ_1st: incbin artnem\8x8ghz1.bin ; Title Screen and Ending only
even
Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin ; Title Screen and Ending only
even
Blk256_GHZ: incbin map256\ghz.bin
even
Add this above Nem_GHZ_1st::
Nem_GHZ: incbin artnem\8x8ghz.bin ; GHZ 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_GHZ_1st: incbin artnem\8x8ghz1.bin ; Title Screen and Ending only
even
Nem_GHZ_2nd: incbin artnem\8x8ghz2.bin ; Title Screen and Ending only
even
Blk256_GHZ: incbin map256\ghz.bin
even
Next, open _inc/Pattern load cues.asm and find:
PLC_GHZ: dc.w $B
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_GHZ, remove Nem_GHZ_2nd's entry, and change the dc.w $B to dc.w $A. Your code should look like this.
PLC_GHZ: dc.w $A
dc.l Nem_GHZ ; GHZ 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 Title+Ending and GHZ art unless you edit it.
SVN/GitHub disassembly
First, we'll need to merge GHZ's two level art files into one:
Both files are Nemesis-compressed, so we'll need to decompress them before we merge them. Get a decompressor (you can find some here) and use them to decompress the files '8x8 - GHZ1.bin' and '8x8 - GHZ2.bin', found in the artnem folder. After that, open the two decompressed files in a hex editor, and append the contents of 8x8 - GHZ2.bin to the end of 8x8 - GHZ1.bin, and save the result as 8x8 - GHZ.bin. Compress this file in Nemesis and delete the uncompressed files, they won't be needed anymore.
With that done, we now have our GHZ art (8x8 - GHZ.bin), and our Title Screen & Ending art (8x8 - GHZ1.bin + 8x8 - GHZ2.bin). Now we can edit the code to use these two separately.
First, open _inc/LevelHeaders.asm.
Find this:
lhead plcid_GHZ, Nem_GHZ_2nd, plcid_GHZ2, Blk16_GHZ, Blk256_GHZ, bgm_GHZ, palid_GHZ ; Green Hill
Change Nem_GHZ_2nd to Nem_GHZ, you should be left with this:
lhead plcid_GHZ, Nem_GHZ, plcid_GHZ2, Blk16_GHZ, Blk256_GHZ, bgm_GHZ, palid_GHZ ; Green Hill
This is pointless as this particular pointer is never used, but it'll keep things tidy.
Next, open sonic.asm and look for:
Blk16_GHZ: incbin "map16\GHZ.bin"
even
Nem_GHZ_1st: incbin "artnem\8x8 - GHZ1.bin" ; Title Screen and Ending only
even
Nem_GHZ_2nd: incbin "artnem\8x8 - GHZ2.bin" ; Title Screen and Ending only
even
Blk256_GHZ: incbin "map256\GHZ.bin"
even
Add this above Nem_GHZ_1st::
Nem_GHZ: incbin "artnem\8x8 - GHZ.bin" ; GHZ 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_GHZ_1st: incbin "artnem\8x8 - GHZ1.bin" ; Title Screen and Ending only
even
Nem_GHZ_2nd: incbin "artnem\8x8 - GHZ2.bin" ; Title Screen and Ending only
even
Blk256_GHZ: incbin "map256\GHZ.bin"
even
Next, go to _inc/Pattern Load Cues.asm and find:
PLC_GHZ: dc.w ((PLC_GHZ2-PLC_GHZ-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_GHZ and remove Nem_GHZ_2nd's entry. Your code should look like this:
PLC_GHZ: dc.w ((PLC_GHZ2-PLC_GHZ-2)/6)-1
plcm Nem_GHZ, 0 ; GHZ main patterns
Load up your ROM and it should load correctly. Though you won't be able to tell the difference between the Title+Ending 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, though those are still shared between the GHZ+Ending and Title. If you want to separate those too, look at these guides: SCHG How-to:Make an Alternative Title Screen, SCHG How-to:Make Ending load Alternate Art
|Separate title art from GHZ/make GHZ load alternate art]]