For the bosses are not very easy as stands now, We have two ways to fix it, removing the Robotnik of enemy list or cancel the Homing Attack in each hit.
A way: Modify the enemy list
The easiest way is remove the Robotnik of enemy list, as we saw in step 2.
Modify this:
As you can see in the list, $F is the Eggman.
BLS = branch low or same (Unsigned)
As is "low or same", if it is low than or same to $F, Homing Attack works against Eggman. But we do not want to work against Eggman, then, modify it to $E, because if low than or same to $E, Homing Attack does not work against Eggman, because $F is not equal or low than $E. ($E < $F)
Other way: Cancel the Homing Attack in each hit
For the Homing Attack works against Eggman, and Sonic not attacking Eggman until the Homing Attack's time is over, we need reset the time's value when Sonic hits Eggman, and this goes for every boss.
GHZ BOSS
Search for loc_177E6, and at the end of it, you will see:
Between this two lines:
LZ BOSS
Search for loc_17F48, and at the end of it, you will see:
Between this two lines:
MZ BOSS
Again, search for loc_1833E, and at the end of it, you will see:
Between this two lines:
SLZ BOSS
Again, search for loc_189FE, and at the end of it, you will see:
Between this two lines:
SYZ BOSS
Once again, search for loc_19202, and at the end of it, you will see:
Between this two lines:
FZ BOSS
The Eggman's ship only appears when he tries to escape, and as we did in all other bosses, search for loc_1A1D4, and at the end of it, you will see:
Between this two lines:
Cancel the Homing Attack in final hit
An bug still continues, the last hit on the boss leaves the Sonic stopped for a time in air, this is done because in the last hit, the "normal code" is not read, but the code of the boss defeated "BossDefeated" is read.
So, to fix this, search for BossDefeated and you will see this:
A way: Modify the enemy list
The easiest way is remove the Robotnik of enemy list, as we saw in step 2.
Modify this:
- Code:
cmpi.b #$F,$20(a1) ; is some enemy of the list above?
bls.s HA_calcdistance ; if yes, branch
- Code:
cmpi.b #$E,$20(a1) ; is some enemy of the list above?
bls.s HA_calcdistance ; if yes, branch
As you can see in the list, $F is the Eggman.
BLS = branch low or same (Unsigned)
As is "low or same", if it is low than or same to $F, Homing Attack works against Eggman. But we do not want to work against Eggman, then, modify it to $E, because if low than or same to $E, Homing Attack does not work against Eggman, because $F is not equal or low than $E. ($E < $F)
Other way: Cancel the Homing Attack in each hit
For the Homing Attack works against Eggman, and Sonic not attacking Eggman until the Homing Attack's time is over, we need reset the time's value when Sonic hits Eggman, and this goes for every boss.
GHZ BOSS
Search for loc_177E6, and at the end of it, you will see:
- Code:
bne.s Obj3D_ShipFlash
move.b #$20,$3E(a0) ; set number of times for ship to flash
move.w #$AC,d0
jsr (PlaySound_Special).l ; play boss damage sound
Between this two lines:
- Code:
bne.s Obj3D_ShipFlash
move.b #$20,$3E(a0) ; set number of times for ship to flash
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object
LZ BOSS
Search for loc_17F48, and at the end of it, you will see:
- Code:
bne.s loc_17F70
move.b #$20,$3E(a0)
move.w #$AC,d0
jsr (PlaySound_Special).l
Between this two lines:
- Code:
bne.s loc_17F70
move.b #$20,$3E(a0)
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object
MZ BOSS
Again, search for loc_1833E, and at the end of it, you will see:
- Code:
bne.s loc_18374
move.b #$28,$3E(a0)
move.w #$AC,d0
jsr (PlaySound_Special).l ; play boss damage sound
Between this two lines:
- Code:
bne.s loc_18374
move.b #$28,$3E(a0)
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object
SLZ BOSS
Again, search for loc_189FE, and at the end of it, you will see:
- Code:
bne.s loc_18A28
move.b #$20,$3E(a0)
move.w #$AC,d0
jsr (PlaySound_Special).l ; play boss damage sound
Between this two lines:
- Code:
bne.s loc_18A28
move.b #$20,$3E(a0)
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object
SYZ BOSS
Once again, search for loc_19202, and at the end of it, you will see:
- Code:
bne.s loc_1923A
move.b #$20,$3E(a0)
move.w #$AC,d0
jsr (PlaySound_Special).l ; play boss damage sound
Between this two lines:
- Code:
bne.s loc_1923A
move.b #$20,$3E(a0)
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object
FZ BOSS
The Eggman's ship only appears when he tries to escape, and as we did in all other bosses, search for loc_1A1D4, and at the end of it, you will see:
- Code:
bne.s loc_1A216
move.w #$1E,$30(a0)
move.w #$AC,d0
jsr (PlaySound_Special).l ; play boss damage sound
Between this two lines:
- Code:
bne.s loc_1A216
move.w #$1E,$30(a0)
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object
Cancel the Homing Attack in final hit
An bug still continues, the last hit on the boss leaves the Sonic stopped for a time in air, this is done because in the last hit, the "normal code" is not read, but the code of the boss defeated "BossDefeated" is read.
So, to fix this, search for BossDefeated and you will see this:
- Code:
BossDefeated:
move.b ($FFFFFE0F).w,d0
andi.b #7,d0
bne.s locret_178A2
jsr SingleObjLoad
bne.s locret_178A2
move.b #$3F,0(a1) ; load explosion object
move.w 8(a0),8(a1)
move.w $C(a0),$C(a1)
jsr (RandomNumber).l
move.w d0,d1
moveq #0,d1
move.b d0,d1
lsr.b #2,d1
subi.w #$20,d1
add.w d1,8(a1)
lsr.w #8,d0
lsr.b #3,d0
add.w d0,$C(a1)
locret_178A2:
rts
; End of function BossDefeated
- Code:
clr.b ($FFFFFFD1).w ; cancel the Homing Attack, clearing the number of frames Sonic can chasing the object