Hello, This is guide how to make sonic ''float'' on air when up is pressed
This is made to hivebrain 2005 dissassembly, so if you have another one, you may have trouble with this
First, find Obj01_mdnormal
you should see something like this:
this is your normal command line for md_normal.
Add
now find obj01_mdjump2
you should find this
add this code before bsr.w Sonic_JumpHeight
find ; End of function Sonic_JumpHeight
After it, add this:
Now its ready, compile it, and tell me if there is some problems
modify ''iUp'' to change button to press
btst #iUp,(Joypad|Held).w ; is A button held?
For sound, put this before float_rts:
Edit ''XX'' to what you want to get effect
This is made to hivebrain 2005 dissassembly, so if you have another one, you may have trouble with this
First, find Obj01_mdnormal
you should see something like this:
- Code:
bsr.w Sonic_Jump
bsr.w Sonic_SlopeResist
bsr.w Sonic_Move
bsr.w Sonic_Roll
bsr.w Sonic_LevelBound
jsr SpeedToPos
bsr.w Sonic_AnglePos
bsr.w Sonic_SlopeRepel
rts
this is your normal command line for md_normal.
Add
- Code:
bsr.w Sonic_Float
now find obj01_mdjump2
you should find this
- Code:
bsr.w Sonic_JumpHeight
bsr.w Sonic_ChgJumpDir
bsr.w Sonic_LevelBound
jsr ObjectFall
btst #6,$22(a0) ; is Sonic underwater?
beq.s loc_12EA6 ; if no, branch
subi.w #$28,$12(a0)
loc_12EA6:
bsr.w Sonic_JumpAngle
bsr.w Sonic_Floor
rts
add this code before bsr.w Sonic_JumpHeight
- Code:
bsr.w Sonic_float
find ; End of function Sonic_JumpHeight
After it, add this:
- Code:
; ---------------------------------------------------------------------------
; Subroutine to Float Sonic by pressing A button
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
Sonic_float: ; XREF: Obj01_MdNormal
btst #iUp,(Joypad|Held).w ; is A button held?
beq.s Float_rts ; if not, branch
cmpi.b #2,$1C(a1) ; is Sonic rolling?
beq.s float_rts ; if not, branch
move.w $12(a0),d0 ; load Y-velocity
move.w #$0,$12(a0) ; decrease Y-velocity
addi.w #$20,$12(a0) ; decrease Y-velocity
Float_rts:
rts
Now its ready, compile it, and tell me if there is some problems
modify ''iUp'' to change button to press
btst #iUp,(Joypad|Held).w ; is A button held?
For sound, put this before float_rts:
- Code:
move.w #$XX,d0 ; play Float sound
jsr (PlaySound_Special).l ;
Edit ''XX'' to what you want to get effect