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] Title Screen Background Moveable in Sonic 1
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: 6478" data-attributes="member: 7577"><p>So, you want to make a moveable title screen background for Sonic 1? Once the devs made it so known for having a famous moving right background, but what I do to move it?</p><p></p><p>It's simple, go to your disassembly root and in <strong>sonic.asm</strong></p><p></p><p>You should find a label with the name "Tit_MainLoop:" and find this simple piece of code</p><p>[CODE] move.w (v_player+obX).w,d0 ; get current title screen position (big Sonic object)</p><p> addq.w #2,d0 ; move it 2px to the right[/CODE]</p><p></p><p>Sounds simple? You can change the 2 with the number you want and changing the speed of it.</p><p></p><p>Replace it with this</p><p>[CODE] move.w (v_objspace+obX).w,d0</p><p> move.b (v_jpadhold1).w,d1 ; Read pressed buttons</p><p></p><p> ; --- Check B button to stop ---</p><p> btst #4,d1 ; Is B button held? (bit 4)</p><p> bne.s .ApplyMove ; If yes, skip movement (stops Sonic)</p><p></p><p> ; --- Speed Logic (Right) ---</p><p> btst #3,d1 ; Is Right held? (bit 3)</p><p> bne.s .FastRight ; If yes, go to +4 speed</p><p> addq.w #2,d0 ; Default: +2 speed</p><p> bra.s .CheckLeft</p><p>.FastRight:</p><p> addq.w #4,d0 ; Fast: +4 speed</p><p></p><p> ; --- Recoil Logic (Left) ---</p><p>.CheckLeft:</p><p> btst #2,d1 ; Is Left held? (bit 2)</p><p> beq.s .ApplyMove ; If not, skip to applying movement</p><p> subq.w #4,d0 ; If yes, subtract 4 (move backward)</p><p></p><p>.ApplyMove:</p><p> move.w d0,(v_objspace+obX).w ; Save the new X position</p><p> cmpi.w #$1C00,d0 ; Check X-axis boundary limit</p><p> blo.s Tit_ChkRegion ; If less than $1C00, branch to continue</p><p>.saveX:</p><p> move.w d0,(v_objspace+obX).w ; Update the X position[/CODE]</p><p></p><p>So, you can change the buttons to whatever you want.</p><p></p><p>Happy hacking! <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f600.png" class="smilie smilie--emoji" loading="lazy" width="72" height="72" alt=":D" title="Big grin :D" data-smilie="8"data-shortname=":D" /></p></blockquote><p></p>
[QUOTE="Mildanner, post: 6478, member: 7577"] So, you want to make a moveable title screen background for Sonic 1? Once the devs made it so known for having a famous moving right background, but what I do to move it? It's simple, go to your disassembly root and in [B]sonic.asm[/B] You should find a label with the name "Tit_MainLoop:" and find this simple piece of code [CODE] move.w (v_player+obX).w,d0 ; get current title screen position (big Sonic object) addq.w #2,d0 ; move it 2px to the right[/CODE] Sounds simple? You can change the 2 with the number you want and changing the speed of it. Replace it with this [CODE] move.w (v_objspace+obX).w,d0 move.b (v_jpadhold1).w,d1 ; Read pressed buttons ; --- Check B button to stop --- btst #4,d1 ; Is B button held? (bit 4) bne.s .ApplyMove ; If yes, skip movement (stops Sonic) ; --- Speed Logic (Right) --- btst #3,d1 ; Is Right held? (bit 3) bne.s .FastRight ; If yes, go to +4 speed addq.w #2,d0 ; Default: +2 speed bra.s .CheckLeft .FastRight: addq.w #4,d0 ; Fast: +4 speed ; --- Recoil Logic (Left) --- .CheckLeft: btst #2,d1 ; Is Left held? (bit 2) beq.s .ApplyMove ; If not, skip to applying movement subq.w #4,d0 ; If yes, subtract 4 (move backward) .ApplyMove: move.w d0,(v_objspace+obX).w ; Save the new X position cmpi.w #$1C00,d0 ; Check X-axis boundary limit blo.s Tit_ChkRegion ; If less than $1C00, branch to continue .saveX: move.w d0,(v_objspace+obX).w ; Update the X position[/CODE] So, you can change the buttons to whatever you want. Happy hacking! :D [/QUOTE]
Insert quotes…
Verification
Post reply
Community
Tutorials & Guides
[Tutorial] Title Screen Background Moveable in Sonic 1
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