Actions

SCHG How-to

Difference between revisions of "Port Sonic 2 Level Select to Sonic 1"

From Sonic Retro

m
m (Editing cheats: duplicated screenshot)
 
(33 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{cleanup-rewrite}}
+
''(Original guide by [[User:DelayHacks|DelayHacks (a.k.a. JustMe)]], updated for the SVN/GitHub disassembly by [[Special:Contributions/The Catman 22|The Catman 22]], Minor refinements by  [[User:DeltaWooloo|DeltaWooloo]] and [https://info.sonicretro.org/User:XPointZPoint XPointZPoint])''
  
''(Guide by [[DelayHacks|User:DelayHacks]])''
+
You need to download the level select code made by [[User:Esrael|Esrael]]:
 
 
You need to download level select by [[Esrael]]:
 
 
{{Download|title=Sonic 2 Level Select in Sonic 1|version=|file=s2menu.rar}}
 
{{Download|title=Sonic 2 Level Select in Sonic 1|version=|file=s2menu.rar}}
  
 
and extract it to the root of your dissassembly.
 
and extract it to the root of your dissassembly.
  
==Getting Level select in game==
+
==Hivebrain's 2005 disassembly==
 
+
After downloading and extracting the file, go to the end of the main file (sonic1.asm) and you'll find the end of ROM:
After downloading and extracting, go to the end and you'll find this:
 
  
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
Line 19: Line 16:
 
END
 
END
 
</syntaxhighlight>
 
</syntaxhighlight>
Add this line before it:
+
Add this include before the "EndOfRom" label:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
        include 's2_menu.asm' ; Sonic 2 Level Select
+
include "s2_menu.asm" ; Sonic 2 level select
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Now go to:
 
Now go to:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
 
Title_ChkLevSel:
 
Title_ChkLevSel:
tst.b ($FFFFFFE0).w ; check if level select code is on
+
tst.b ($FFFFFFE0).w ; check if level select code is on
beq.w PlayLevel ; if not, play level
+
beq.w PlayLevel ; if not, play level
btst #iA,(Joypad|Held).w ; check if A is held
+
btst #6,($FFFFF604).w ; check if A is pressed
beq.w PlayLevel ; if not, play level
+
beq.w PlayLevel ; if not, play level
 
moveq #2,d0
 
moveq #2,d0
bsr.w PalLoad2 ; load level select pallet
+
bsr.w PalLoad2 ; load level select pallet
 
lea ($FFFFCC00).w,a1
 
lea ($FFFFCC00).w,a1
 
moveq #0,d0
 
moveq #0,d0
 
move.w #$DF,d1
 
move.w #$DF,d1
 
</syntaxhighlight>
 
</syntaxhighlight>
and replace with this:
+
and add a jump to "Level_Select_Menu" after the check if A was pressed:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
 
Title_ChkLevSel:
 
Title_ChkLevSel:
 
tst.b ($FFFFFFE0).w ; check if level select code is on
 
tst.b ($FFFFFFE0).w ; check if level select code is on
 
beq.w PlayLevel ; if not, play level
 
beq.w PlayLevel ; if not, play level
btst #iA,(Joypad|Held).w ; check if A is held
+
btst #6,($FFFFF604).w ; check if A is pressed
 
beq.w PlayLevel ; if not, play level
 
beq.w PlayLevel ; if not, play level
jmp     Level_Select_Menu ; if yes, goto Sonic 2 level select
+
jmp Level_Select_Menu ; if yes, goto Sonic 2 level select
 
moveq #2,d0
 
moveq #2,d0
 
lea ($FFFFCC00).w,a1
 
lea ($FFFFCC00).w,a1
Line 50: Line 47:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==Other==
+
Now open "_inc\Pallet pointers.asm" and after this palette:
Go to "_inc\Pallet pointers.asm" and under this:
 
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
 
dc.l Pal_Ending
 
dc.l Pal_Ending
Line 59: Line 55:
 
add this:
 
add this:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
    dc.l Menu_Palette; pallet address
+
dc.l Menu_Palette; pallet address
    dc.w $FB00 ; RAM address
+
dc.w $FB00 ; RAM address
    dc.w $1F ; (pallet length / 2) - 1
+
dc.w $1F ; (pallet length / 2) - 1
 +
</syntaxhighlight>
 +
If you haven't added any new palettes before, proceed.
 +
Otherwise find the palette ID (you can count it from the start of PalPointers, starting palette ID is 0) and change $14 on these lines in "s2_menu.asm" to the ID you have:
 +
<syntaxhighlight lang="asm">
 +
                moveq  #$14, D0
 +
                bsr    Menu_PalLoad1
 +
</syntaxhighlight>
 +
Now you have Sonic 2's level select palette.
 +
 
 +
Now we need to fix some bugs.
 +
You need to uncomment these lines in "s2_menu.asm" in order to enable the second star at Sound Test:
 +
<syntaxhighlight lang="asm">
 +
;                lea    $FF10(A2), A2
 +
;                move.w  #$001A, (A2)          ; Load "*"
 +
</syntaxhighlight>
 +
Not sure why they were commented out though.
 +
 
 +
Now to fix some assembling errors you should fix $FF10 from the lines above to $FFFFFF10 and you may see "$FBA0" on the line before "Menu_Clear_Act_x" label, change it to "$FFFFFBA0".
 +
 
 +
==SVN/GitHub disassembly==
 +
 
 +
After downloading and extracting the file, go to the end of the main file (sonic1.asm) and you'll find the end of ROM:
 +
 
 +
<syntaxhighlight lang="asm">
 +
; end of 'ROM'
 +
EndOfRom:
 +
 
 +
 
 +
END
 +
</syntaxhighlight>
 +
Add this include before the "EndOfRom" label:
 +
<syntaxhighlight lang="asm">
 +
include "s2_menu.asm" ; Sonic 2 level select
 +
</syntaxhighlight>
 +
Now go to:
 +
<syntaxhighlight lang="asm">
 +
Title_ChkLevSel:
 +
tst.b (f_levselcheat).w ; check if level select code is on
 +
beq.w PlayLevel ; if not, play level
 +
btst #bitA,(v_jpadhold1).w ; check if A is pressed
 +
beq.w PlayLevel ; if not, play level
 +
 
 +
moveq #palid_LevelSel,d0
 +
bsr.w PalLoad2 ; load level select palette
 +
lea (v_hscrolltablebuffer).w,a1
 +
moveq #0,d0
 +
move.w #$DF,d1
 +
</syntaxhighlight>
 +
and add a jump to "Level_Select_Menu" after the check if A was pressed:
 +
<syntaxhighlight lang="asm">
 +
Title_ChkLevSel:
 +
tst.b (f_levselcheat).w ; check if level select code is on
 +
beq.w PlayLevel ; if not, play level
 +
btst #bitA,(v_jpadhold1).w ; check if A is pressed
 +
beq.w PlayLevel ; if not, play level
 +
jmp Level_Select_Menu; Go to Sonic 2 Level Select
 +
moveq #palid_LevelSel,d0
 +
bsr.w PalLoad2 ; load level select palette
 +
lea (v_hscrolltablebuffer).w,a1
 +
moveq #0,d0
 +
move.w #$DF,d1
 +
</syntaxhighlight>
 +
 
 +
Now open "_inc\Palette pointers.asm" and after this palette:
 +
<syntaxhighlight lang="asm">
 +
ptr_Pal_Ending: palp Pal_Ending,v_pal_dry,$40 ; $13 (19) - ending sequence
 +
</syntaxhighlight>
 +
add this:
 +
<syntaxhighlight lang="asm">
 +
ptr_Pal_Menu: palp Pal_Menu,v_pal_dry,$40 ; 2 - level select
 +
</syntaxhighlight>
 +
If you haven't added any new palettes before, proceed.
 +
Otherwise find the palette ID (you can count it from the start of PalPointers, starting palette ID is 0) and change $14 on these lines in "s2_menu.asm" to the ID you have:
 +
<syntaxhighlight lang="asm">
 +
                moveq  #$14, D0
 +
                bsr    Menu_PalLoad1
 +
</syntaxhighlight>
 +
Now you have Sonic 2's level select palette.
 +
 
 +
Now we need to fix some bugs.
 +
You need to uncomment these lines in "s2_menu.asm" in order to enable the second star at Sound Test:
 +
<syntaxhighlight lang="asm">
 +
;                lea    $FF10(A2), A2
 +
;                move.w  #$001A, (A2)          ; Load "*"
 +
</syntaxhighlight>
 +
Not sure why they were commented out though.
 +
 
 +
Now to fix some assembling errors you should fix $FF10 from the lines above to $FFFFFF10 and you may see "$FBA0" on the line before "Menu_Clear_Act_x" label, change it to "$FFFFFBA0".
 +
 
 +
Now open "s2_menu.asm" and change this code:
 +
 
 +
<syntaxhighlight lang="asm">
 +
Menu_Palette:
 +
                incbin  'data\menu\menu.pal'
 +
Menu_ClearScreen:
 +
                jmp    ClearScreen
 +
Menu_ShowVDPGraphics:               
 +
                jmp    ShowVDPGraphics               
 +
Menu_NemesisDec:
 +
                jmp    NemDec 
 +
Menu_LoadPLC2:     
 +
                jmp    LoadPLC2
 +
Menu_RunPLC:                   
 +
                jmp    RunPLC_RAM                         
 +
Menu_EnigmaDec
 +
                jmp    EniDec
 +
Menu_Pal_FadeTo:
 +
                jmp    Pal_FadeTo
 +
Menu_Pal_FadeFrom:
 +
                jmp    Pal_FadeFrom   
 +
Menu_Play_Music:
 +
                jmp    PlaySound 
 +
Menu_PalLoad1:
 +
                jmp    PalLoad1
 +
Menu_DelayProgram:
 +
                jmp    DelayProgram
 +
</syntaxhighlight>
 +
 
 +
to this:
 +
<syntaxhighlight lang="asm">
 +
Pal_Menu:
 +
                incbin  'data\menu\menu.pal'   
 +
Menu_ClearScreen:
 +
                jmp    ClearScreen
 +
Menu_ShowVDPGraphics:               
 +
                jmp    TilemapToVRAM               
 +
Menu_NemesisDec:
 +
                jmp    NemDec 
 +
Menu_LoadPLC2:     
 +
                jmp    NewPLC
 +
Menu_RunPLC:                   
 +
                jmp    RunPLC                         
 +
Menu_EnigmaDec
 +
                jmp    EniDec
 +
Menu_Pal_FadeTo:
 +
                jmp    PaletteFadeIn
 +
Menu_Pal_FadeFrom:
 +
                jmp    PaletteFadeOut   
 +
Menu_Play_Music:
 +
                jmp    PlaySound 
 +
Menu_PalLoad1:
 +
                jmp    PalLoad1
 +
Menu_DelayProgram:
 +
                jmp    WaitForVBla
 
</syntaxhighlight>
 
</syntaxhighlight>
Now you have Sonic 2's level select palette.
+
 
To change music in the level select, go to "s2_menu.asm" and find:
+
==Other==
 +
 
 +
===Changing sounds and editing zone names===
 +
 
 +
Now go to "s2_menu.asm" you can find these lines of code around the start of the file:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
 
Level_Select_Menu_snd  = $0081
 
Level_Select_Menu_snd  = $0081
 +
Emerald_Snd            = $0093
 +
Ring_Snd                = $00B5
 +
Volume_Down            = $00E0
 +
Stop_Sound              = $00E4
 +
</syntaxhighlight>
 +
Level_Select_Menu_snd is the music played in the menu, Emerald_Snd is the sound played if all emeralds code is entered, Ring_Snd is the sound played if debug mode code is entered.
 +
 +
To edit zone names, find label "Menu_Level_Select_Text":
 +
<syntaxhighlight lang="asm">
 +
                dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
 +
                dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
 +
                dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
 +
                dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
 +
                dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
 +
                dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
 +
                dc.b    $0E, _F, _I, _N, _A, _L, __, __, __, __, __, __, __, __, __, __ 
 +
                dc.b    $0E, _S, _P, _E, _C, _I, _A, _L, __, _S, _T, _A, _G, _E, __, __
 +
                dc.b    $0E, _E, _N, _D, _I, _N, _G, __, _S, _E, _Q, _U, _E, _N, _C, _E
 +
                dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __
 
</syntaxhighlight>
 
</syntaxhighlight>
Replace "81" with any music you want in the level select (# of music + 80).
+
Now you can edit the text in the level select.
To edit sound after "all emeralds" code find:
+
 
 +
===Fixing Level Order in Level Select Menu===
 +
To Correct the Level Order , find this piece of code:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
Emerald_Snd            = $0093
+
Menu_Level_Select_Array:
 +
                dc.w    $0000, $0001, $0002
 +
                dc.w    $0100, $0101, $0102
 +
                dc.w    $0200, $0201, $0202
 +
                dc.w    $0300, $0301, $0302
 +
                dc.w    $0400, $0401, $0402
 +
                dc.w    $0500, $0501, $0103
 +
                dc.w    $0502, $4000, $0600
 +
                dc.w    $FFFF
 
</syntaxhighlight>
 
</syntaxhighlight>
and replace "93" with sound what you want. To edit ring sound after "debug mode" code find:
+
And change it to this:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
Ring_Snd                = $00B5
+
Menu_Level_Select_Array:
 +
                dc.w    $0000, $0001, $0002 ;GHZ
 +
                dc.w    $0200, $0201, $0202 ;MZ
 +
                dc.w    $0400, $0401, $0402 ;SYZ
 +
                dc.w    $0100, $0101, $0102 ;LZ
 +
                dc.w    $0300, $0301, $0302 ;SLZ
 +
                dc.w    $0500, $0501, $0103 ;SBZ
 +
                dc.w    $0502, $4000, $0600
 +
                dc.w    $FFFF
 
</syntaxhighlight>
 
</syntaxhighlight>
and replace "B5" with sound what you want. To edit texts find label "Menu_Level_Select_Text:" and you see
+
Now for the Level Select text, find this:
 
<syntaxhighlight lang="asm">
 
<syntaxhighlight lang="asm">
 +
Menu_Level_Select_Text:
 
                 dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
 
                 dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
 
                 dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
 
                 dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
 
                 dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
 
                 dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
 
                 dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
 
                 dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
 +
                dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
 +
                dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
 +
                dc.b    $0E, _F, _I, _N, _A, _L, __, __, __, __, __, __, __, __, __, __ 
 +
                dc.b    $0E, _S, _P, _E, _C, _I, _A, _L, __, _S, _T, _A, _G, _E, __, __
 +
                dc.b    $0E, _E, _N, _D, _I, _N, _G, __, _S, _E, _Q, _U, _E, _N, _C, _E
 +
                dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __   
 +
</syntaxhighlight>
 +
And change it to this:
 +
<syntaxhighlight lang="asm">
 +
Menu_Level_Select_Text:
 +
                dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
 +
                dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
 +
                dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
 +
                dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
 
                 dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
 
                 dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
 
                 dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
 
                 dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
Line 90: Line 286:
 
                 dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __  
 
                 dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __  
 
</syntaxhighlight>
 
</syntaxhighlight>
now you can edit texts in level select. To edit "debug mode" code go to label "Code_Debug_Mode:".
+
'''Now you have the Rev01 level select order'''
 +
 
 +
===Changing zone icons===
 +
If you wish to change zone icons you need to change the data at "Menu_Icon_List" label in "s2_menu.asm":
 +
<syntaxhighlight lang="asm">
 +
Menu_Icon_List:
 +
                dc.b    $00, $00, $00, $0E, $0E, $0E, $06, $06, $06, $0B, $0B, $0B, $0D, $0D, $0D, $09
 +
                dc.b    $09, $09, $04, $10, $0F, $11
 +
</syntaxhighlight>
 +
 
 +
===Editing cheats===
 +
To edit "debug mode" code go to the label "Code_Debug_Mode:".
 
To edit "all emeralds" code go to label "Code_All_Emeralds:"
 
To edit "all emeralds" code go to label "Code_All_Emeralds:"
Thats all. All permissions for this level select code goes to [[Esrael]]. Result:
+
 
[[File:S2levelselectInS1.png]]
+
That's all. All permissions for this level select code goes to [[User:Esrael|Esrael]]. Result:
 +
 
 +
[[File:S2levelselectInS1.png|320px]]
 +
 
 +
'''NOTE: If you attempt to play a sound that is place 14 or above if you haven't [[SCHG_How-to:Expand_the_Sonic_1_sound_index|fixed the sound test]], the game will throw an illegal instruction'''
 +
[[File:Sonic2LevelSelectInSonic1HowToWarning.png|320px]]
  
 
{{S1Howtos}}
 
{{S1Howtos}}
 
[[Category:SCHG_How-tos]]
 

Latest revision as of 13:20, 26 December 2022

(Original guide by DelayHacks (a.k.a. JustMe), updated for the SVN/GitHub disassembly by The Catman 22, Minor refinements by DeltaWooloo and XPointZPoint)

You need to download the level select code made by Esrael:

Download.svg Download Sonic 2 Level Select in Sonic 1
File: s2menu.rar (29 kB) (info)

and extract it to the root of your dissassembly.

Hivebrain's 2005 disassembly

After downloading and extracting the file, go to the end of the main file (sonic1.asm) and you'll find the end of ROM:

; end of 'ROM'
EndOfRom:


		END

Add this include before the "EndOfRom" label:

	include	"s2_menu.asm"	; Sonic 2 level select

Now go to:

Title_ChkLevSel:
		tst.b	($FFFFFFE0).w	; check	if level select	code is	on
		beq.w	PlayLevel	; if not, play level
		btst	#6,($FFFFF604).w ; check if A is pressed
		beq.w	PlayLevel	; if not, play level
		moveq	#2,d0
		bsr.w	PalLoad2	; load level select pallet
		lea	($FFFFCC00).w,a1
		moveq	#0,d0
		move.w	#$DF,d1

and add a jump to "Level_Select_Menu" after the check if A was pressed:

Title_ChkLevSel:
		tst.b	($FFFFFFE0).w		; check	if level select	code is	on
		beq.w	PlayLevel		; if not, play level
		btst	#6,($FFFFF604).w ; check if A is pressed
		beq.w	PlayLevel		; if not, play level
		jmp	Level_Select_Menu	; if yes, goto Sonic 2 level select	
		moveq	#2,d0
		lea	($FFFFCC00).w,a1
		moveq	#0,d0
		move.w	#$DF,d1

Now open "_inc\Pallet pointers.asm" and after this palette:

	dc.l Pal_Ending
	dc.w $FB00
	dc.w $1F

add this:

	dc.l Menu_Palette; pallet address
	dc.w $FB00	; RAM address
	dc.w $1F	; (pallet length / 2) - 1

If you haven't added any new palettes before, proceed. Otherwise find the palette ID (you can count it from the start of PalPointers, starting palette ID is 0) and change $14 on these lines in "s2_menu.asm" to the ID you have:

                moveq   #$14, D0
                bsr     Menu_PalLoad1

Now you have Sonic 2's level select palette.

Now we need to fix some bugs. You need to uncomment these lines in "s2_menu.asm" in order to enable the second star at Sound Test:

;                lea     $FF10(A2), A2
;                move.w  #$001A, (A2)          ; Load "*"

Not sure why they were commented out though.

Now to fix some assembling errors you should fix $FF10 from the lines above to $FFFFFF10 and you may see "$FBA0" on the line before "Menu_Clear_Act_x" label, change it to "$FFFFFBA0".

SVN/GitHub disassembly

After downloading and extracting the file, go to the end of the main file (sonic1.asm) and you'll find the end of ROM:

; end of 'ROM'
EndOfRom:


		END

Add this include before the "EndOfRom" label:

	include	"s2_menu.asm"	; Sonic 2 level select

Now go to:

Title_ChkLevSel:
		tst.b	(f_levselcheat).w ; check if level select code is on
		beq.w	PlayLevel	; if not, play level
		btst	#bitA,(v_jpadhold1).w ; check if A is pressed
		beq.w	PlayLevel	; if not, play level

		moveq	#palid_LevelSel,d0
		bsr.w	PalLoad2	; load level select palette
		lea	(v_hscrolltablebuffer).w,a1
		moveq	#0,d0
		move.w	#$DF,d1

and add a jump to "Level_Select_Menu" after the check if A was pressed:

Title_ChkLevSel:
		tst.b	(f_levselcheat).w ; check if level select code is on
		beq.w	PlayLevel	; if not, play level
		btst	#bitA,(v_jpadhold1).w ; check if A is pressed
		beq.w	PlayLevel	; if not, play level
		jmp	Level_Select_Menu; Go to Sonic 2 Level Select
		moveq	#palid_LevelSel,d0
		bsr.w	PalLoad2	; load level select palette
		lea	(v_hscrolltablebuffer).w,a1
		moveq	#0,d0
		move.w	#$DF,d1

Now open "_inc\Palette pointers.asm" and after this palette:

	ptr_Pal_Ending:		palp	Pal_Ending,v_pal_dry,$40		; $13 (19) - ending sequence

add this:

	ptr_Pal_Menu:		palp	Pal_Menu,v_pal_dry,$40		; 2 - level select

If you haven't added any new palettes before, proceed. Otherwise find the palette ID (you can count it from the start of PalPointers, starting palette ID is 0) and change $14 on these lines in "s2_menu.asm" to the ID you have:

                moveq   #$14, D0
                bsr     Menu_PalLoad1

Now you have Sonic 2's level select palette.

Now we need to fix some bugs. You need to uncomment these lines in "s2_menu.asm" in order to enable the second star at Sound Test:

;                lea     $FF10(A2), A2
;                move.w  #$001A, (A2)          ; Load "*"

Not sure why they were commented out though.

Now to fix some assembling errors you should fix $FF10 from the lines above to $FFFFFF10 and you may see "$FBA0" on the line before "Menu_Clear_Act_x" label, change it to "$FFFFFBA0".

Now open "s2_menu.asm" and change this code:

Menu_Palette:
                incbin  'data\menu\menu.pal' 
Menu_ClearScreen:
                jmp     ClearScreen
Menu_ShowVDPGraphics:                
                jmp     ShowVDPGraphics                
Menu_NemesisDec: 
                jmp     NemDec  
Menu_LoadPLC2:      
                jmp     LoadPLC2
Menu_RunPLC:                    
                jmp     RunPLC_RAM                           
Menu_EnigmaDec
                jmp     EniDec
Menu_Pal_FadeTo:
                jmp     Pal_FadeTo
Menu_Pal_FadeFrom:
                jmp     Pal_FadeFrom     
Menu_Play_Music:
                jmp     PlaySound  
Menu_PalLoad1:
                jmp     PalLoad1
Menu_DelayProgram:
                jmp     DelayProgram

to this:

Pal_Menu:
                incbin  'data\menu\menu.pal'    
Menu_ClearScreen:
                jmp     ClearScreen
Menu_ShowVDPGraphics:                
                jmp     TilemapToVRAM                
Menu_NemesisDec: 
                jmp     NemDec  
Menu_LoadPLC2:      
                jmp     NewPLC
Menu_RunPLC:                    
                jmp     RunPLC                          
Menu_EnigmaDec
                jmp     EniDec
Menu_Pal_FadeTo:
                jmp     PaletteFadeIn
Menu_Pal_FadeFrom:
                jmp     PaletteFadeOut     
Menu_Play_Music:
                jmp     PlaySound  
Menu_PalLoad1:
                jmp     PalLoad1
Menu_DelayProgram:
                jmp     WaitForVBla

Other

Changing sounds and editing zone names

Now go to "s2_menu.asm" you can find these lines of code around the start of the file:

Level_Select_Menu_snd   = $0081
Emerald_Snd             = $0093
Ring_Snd                = $00B5
Volume_Down             = $00E0
Stop_Sound              = $00E4

Level_Select_Menu_snd is the music played in the menu, Emerald_Snd is the sound played if all emeralds code is entered, Ring_Snd is the sound played if debug mode code is entered.

To edit zone names, find label "Menu_Level_Select_Text":

                dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
                dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
                dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
                dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
                dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
                dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
                dc.b    $0E, _F, _I, _N, _A, _L, __, __, __, __, __, __, __, __, __, __   
                dc.b    $0E, _S, _P, _E, _C, _I, _A, _L, __, _S, _T, _A, _G, _E, __, __
                dc.b    $0E, _E, _N, _D, _I, _N, _G, __, _S, _E, _Q, _U, _E, _N, _C, _E
                dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __

Now you can edit the text in the level select.

Fixing Level Order in Level Select Menu

To Correct the Level Order , find this piece of code:

Menu_Level_Select_Array:
                dc.w    $0000, $0001, $0002
                dc.w    $0100, $0101, $0102
                dc.w    $0200, $0201, $0202
                dc.w    $0300, $0301, $0302
                dc.w    $0400, $0401, $0402
                dc.w    $0500, $0501, $0103
                dc.w    $0502, $4000, $0600
                dc.w    $FFFF

And change it to this:

Menu_Level_Select_Array:
                dc.w    $0000, $0001, $0002	;GHZ
                dc.w    $0200, $0201, $0202	;MZ
                dc.w    $0400, $0401, $0402	;SYZ				
                dc.w    $0100, $0101, $0102 ;LZ
                dc.w    $0300, $0301, $0302	;SLZ
                dc.w    $0500, $0501, $0103	;SBZ
                dc.w    $0502, $4000, $0600	
                dc.w    $FFFF

Now for the Level Select text, find this:

Menu_Level_Select_Text: 
                dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
                dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
                dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
                dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
                dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
                dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
                dc.b    $0E, _F, _I, _N, _A, _L, __, __, __, __, __, __, __, __, __, __   
                dc.b    $0E, _S, _P, _E, _C, _I, _A, _L, __, _S, _T, _A, _G, _E, __, __
                dc.b    $0E, _E, _N, _D, _I, _N, _G, __, _S, _E, _Q, _U, _E, _N, _C, _E
                dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __

And change it to this:

Menu_Level_Select_Text: 
                dc.b    $0E, _G, _R, _E, _E, _N, __, _H, _I, _L, _L, __, __, __, __, __
                dc.b    $0E, _M, _A, _R, _B, _L, _E, __, __, __, __, __, __, __, __, __
                dc.b    $0E, _S, _P, _R, _I, _N, _G, __, _Y, _A, _R, _D, __, __, __, __
                dc.b    $0E, _L, _A, _B, _Y, _R, _I, _N, _T, _H, __, __, __, __, __, __
                dc.b    $0E, _S, _T, _A, _R, __, _L, _I, _G, _H, _T, __, __, __, __, __
                dc.b    $0E, _S, _C, _R, _A, _P, __, _B, _R, _A, _I, _N, __, __, __, __
                dc.b    $0E, _F, _I, _N, _A, _L, __, __, __, __, __, __, __, __, __, __   
                dc.b    $0E, _S, _P, _E, _C, _I, _A, _L, __, _S, _T, _A, _G, _E, __, __
                dc.b    $0E, _E, _N, _D, _I, _N, _G, __, _S, _E, _Q, _U, _E, _N, _C, _E
                dc.b    $0E, _S, _O, _U, _N, _D, __, _T, _E, _S, _T, __, __, _st,__, __

Now you have the Rev01 level select order

Changing zone icons

If you wish to change zone icons you need to change the data at "Menu_Icon_List" label in "s2_menu.asm":

Menu_Icon_List:
                dc.b    $00, $00, $00, $0E, $0E, $0E, $06, $06, $06, $0B, $0B, $0B, $0D, $0D, $0D, $09
                dc.b    $09, $09, $04, $10, $0F, $11

Editing cheats

To edit "debug mode" code go to the label "Code_Debug_Mode:". To edit "all emeralds" code go to label "Code_All_Emeralds:"

That's all. All permissions for this level select code goes to Esrael. Result:

S2levelselectInS1.png

NOTE: If you attempt to play a sound that is place 14 or above if you haven't fixed the sound test, the game will throw an illegal instruction Sonic2LevelSelectInSonic1HowToWarning.png

SCHG How-To Guide: Sonic the Hedgehog (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix the SEGA Sound | Display the Press Start Button Text | Fix the Level Select Menu | Fix the Hidden Points Bug | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix the Walk-Jump Bug | Correct Drowning Bugs | Fix the Death Boundary Bug | Fix the Camera Follow Bug | Fix Song Restoration Bugs | Fix the HUD Blinking | Fix the Level Select Graphics Bug | Fix a remember sprite related bug
Changing Design Choices
Change Spike Behavior | Collide with Water After Being Hurt | Fix Special Stage Jumping Physics | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Remove the Speed Cap | Port the REV01 Background Effects | Port Sonic 2's Level Art Loader | Retain Rings Between Acts | Add Sonic 2 (Simon Wai Prototype) Level Select | Improve ObjectMove Subroutines | Port Sonic 2 Level Select
Adding Features
Add Spin Dash ( Part 1 / Part 2 / Part 3 / Part 4 ) | Add Eggman Monitor | Add Super Sonic | Add the Air Roll
Sound Features
Expand the Sound Index | Play Different Songs Per Act | Port Sonic 2 Final Sound Driver | Port Sonic 3's Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Change The SEGA Sound
Extending the Game
Load Chunks From ROM | Add Extra Characters | Make an Alternative Title Screen | Use Dynamic Tilesets | Make GHZ Load Alternate Art | Make Ending Load Alternate Art | Add a New Zone | Set Up the Goggle Monitor | Add New Moves | Add a Dynamic Collision System | Dynamic Special Stage Walls System | Extend Sprite Mappings and Art Limit | Enigma Credits | Use Dynamic Palettes
Miscellaneous
Convert the Hivebrain 2005 Disassembly to ASM68K
Split Disassembly Guides
Set Up a Split Disassembly | Basic Level Editing | Basic Art Editing | Basic ASM Editing (Spin Dash)