Website
Home
Database
News
Submissions queue
Community
Forum
Clubs
Discord
Members
Tools
ROM Patcher
ROM Hasher
Pages
Support us
Learn Romhacking
About
Contact Us
Help & Legal Pages
Guest
Login
Forum
Entries
News
Settings
Community
Tutorials & Guides
[Tutorial] How to add 'Ending Sequence' option to Level Select in Sonic 1 (Newer disassemblies)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mildanner" data-source="post: 6622" data-attributes="member: 7577"><p>If you are using a current version of the disassembly, you notice that there's a extra code that ressembles the Ending sequence and it is not in level select. It was used for the Japanese cheat code, also... You can still interact with it.</p><p></p><p>In your <strong>sonic.asm</strong> file, search for the label <strong>LevSel_Level_SS </strong>and replace the entire routine with this</p><p>[CODE]LevSel_Level_SS:</p><p> andi.l #$FFFF,d0 ; clear top half of d0 to ensure it is clean</p><p> add.l d0,d0 ; double selected line for word-based indexing</p><p> lea LevSel_Ptrs(pc),a0 ; load the pointer table address into a0</p><p> move.w (a0,d0.l),d0 ; read the level pointer using a0 and d0.l</p><p> bmi.w LevelSelect ; if it's an invalid entry ($8000), branch back</p><p> </p><p> cmpi.w #$4000,d0 ; check if Ending Sequence dummy value is selected</p><p> beq.s LevSel_Ending ; if yes, branch to the ending sequence!</p><p> </p><p> cmpi.w #id_SS<<8,d0 ; check if selected level Special Stage</p><p> bne.s LevSel_Level ; if not, branch</p><p> </p><p> move.b #id_Special,(v_gamemode).w ; set screen mode to $10 (Special Stage)</p><p> clr.w (v_zone_act).w ; clear level</p><p> move.b #3,(v_lives).w ; set lives to 3</p><p> moveq #0,d0 ; set d0 to 0</p><p> move.w d0,(v_rings).w ; clear rings</p><p> move.l d0,(v_time).w ; clear time</p><p> move.l d0,(v_score).w ; clear score</p><p> if Revision<>0</p><p> move.l #5000,(v_scorelife).w ; extra life is awarded at 50000 points</p><p> endif</p><p> rts[/CODE]</p><p>Done, there's another one. Go to the <strong>LevSel_SelectionMade</strong> and simply change the <strong>cmpi</strong> code part to <strong>$15</strong> (The number can be still changed even if newer or older disassembly).</p><p></p><p>After changing your code, it will look like this (It was used to be <strong>$14</strong> if sound test is selected)</p><p>[CODE]LevSel_SelectionMade:</p><p> move.w (v_levselitem).w,d0 ; get currently selected line</p><p> cmpi.w #$15,d0 ; have you selected item $15 (sound test)?</p><p> bne.s LevSel_Level_SS ; if not, go to Level/SS/Ending subroutine</p><p> </p><p> move.w (v_levselsound).w,d0 ; get currently selected sound test entry</p><p> addi.w #$80,d0 ; make it $80-based</p><p> </p><p> ; 9E/9F shortcuts with hidden Japanese Credits cheat</p><p> tst.b (f_creditscheat).w ; is hidden Japanese Credits cheat on?</p><p> beq.s LevSel_NoCheat ; if not, branch</p><p> cmpi.w #$9F,d0 ; is sound $9F being played?</p><p> beq.s LevSel_Ending ; if yes, go to Ending Sequence</p><p> cmpi.w #$9E,d0 ; is sound $9E being played?</p><p> beq.s LevSel_Credits ; if yes, go to Credits[/CODE]</p><p>If you are using a new version of the disassembly, <strong>levsel_line_count</strong> was added so you can simply change that to <strong>22</strong>.</p><p></p><p>In older disassemblies, this wasn't existed.</p><p></p><p>The text seens functional, go to the <strong>LevSel_Ptrs:</strong> label and insert this <strong>below</strong> the Final zone pointer code.</p><p>[CODE] dc.w $4000 ; Ending sequence[/CODE]</p><p>For the text, search for <strong>LevelMenuText</strong> and insert this below the FINAL ZONE text. (For alternative text, you want to leave it only one word <strong>Ending</strong> instead of <strong>Ending Sequence.</strong>)</p><p>[CODE] dc.b "ENDING SEQUENCE "[/CODE]</p><p>I hope you enjoy your good ending in the level select, a <strong>way to skip the game</strong> <em>jokes aside</em>.</p><p></p><p>Thank you for following and reading this guide and happy hacking! <img class="smilie smilie--emoji" alt="😃" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f603.png" title="Grinning face with big eyes :smiley:" data-shortname=":smiley:" loading="lazy" width="72" height="72" /></p></blockquote><p></p>
[QUOTE="Mildanner, post: 6622, member: 7577"] If you are using a current version of the disassembly, you notice that there's a extra code that ressembles the Ending sequence and it is not in level select. It was used for the Japanese cheat code, also... You can still interact with it. In your [B]sonic.asm[/B] file, search for the label [B]LevSel_Level_SS [/B]and replace the entire routine with this [CODE]LevSel_Level_SS: andi.l #$FFFF,d0 ; clear top half of d0 to ensure it is clean add.l d0,d0 ; double selected line for word-based indexing lea LevSel_Ptrs(pc),a0 ; load the pointer table address into a0 move.w (a0,d0.l),d0 ; read the level pointer using a0 and d0.l bmi.w LevelSelect ; if it's an invalid entry ($8000), branch back cmpi.w #$4000,d0 ; check if Ending Sequence dummy value is selected beq.s LevSel_Ending ; if yes, branch to the ending sequence! cmpi.w #id_SS<<8,d0 ; check if selected level Special Stage bne.s LevSel_Level ; if not, branch move.b #id_Special,(v_gamemode).w ; set screen mode to $10 (Special Stage) clr.w (v_zone_act).w ; clear level move.b #3,(v_lives).w ; set lives to 3 moveq #0,d0 ; set d0 to 0 move.w d0,(v_rings).w ; clear rings move.l d0,(v_time).w ; clear time move.l d0,(v_score).w ; clear score if Revision<>0 move.l #5000,(v_scorelife).w ; extra life is awarded at 50000 points endif rts[/CODE] Done, there's another one. Go to the [B]LevSel_SelectionMade[/B] and simply change the [B]cmpi[/B] code part to [B]$15[/B] (The number can be still changed even if newer or older disassembly). After changing your code, it will look like this (It was used to be [B]$14[/B] if sound test is selected) [CODE]LevSel_SelectionMade: move.w (v_levselitem).w,d0 ; get currently selected line cmpi.w #$15,d0 ; have you selected item $15 (sound test)? bne.s LevSel_Level_SS ; if not, go to Level/SS/Ending subroutine move.w (v_levselsound).w,d0 ; get currently selected sound test entry addi.w #$80,d0 ; make it $80-based ; 9E/9F shortcuts with hidden Japanese Credits cheat tst.b (f_creditscheat).w ; is hidden Japanese Credits cheat on? beq.s LevSel_NoCheat ; if not, branch cmpi.w #$9F,d0 ; is sound $9F being played? beq.s LevSel_Ending ; if yes, go to Ending Sequence cmpi.w #$9E,d0 ; is sound $9E being played? beq.s LevSel_Credits ; if yes, go to Credits[/CODE] If you are using a new version of the disassembly, [B]levsel_line_count[/B] was added so you can simply change that to [B]22[/B]. In older disassemblies, this wasn't existed. The text seens functional, go to the [B]LevSel_Ptrs:[/B] label and insert this [B]below[/B] the Final zone pointer code. [CODE] dc.w $4000 ; Ending sequence[/CODE] For the text, search for [B]LevelMenuText[/B] and insert this below the FINAL ZONE text. (For alternative text, you want to leave it only one word [B]Ending[/B] instead of [B]Ending Sequence.[/B]) [CODE] dc.b "ENDING SEQUENCE "[/CODE] I hope you enjoy your good ending in the level select, a [B]way to skip the game[/B] [I]jokes aside[/I]. Thank you for following and reading this guide and happy hacking! 😃 [/QUOTE]
Insert quotes…
Verification
Post reply
Community
Tutorials & Guides
[Tutorial] How to add 'Ending Sequence' option to Level Select in Sonic 1 (Newer disassemblies)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Back
Top