Mildanner
Member
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 sonic.asm
You should find a label with the name "Tit_MainLoop:" and find this simple piece of code
Sounds simple? You can change the 2 with the number you want and changing the speed of it.
Replace it with this
So, you can change the buttons to whatever you want.
Happy hacking!
It's simple, go to your disassembly root and in sonic.asm
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
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
So, you can change the buttons to whatever you want.
Happy hacking!