I can't imagine how many things you might find for S1 if you were to try, but by no means should either of you break your momentum here!
Some changes and fixes for Sonic 2
#46
Posted 15 June 2012 - 04:05 PM
I can't imagine how many things you might find for S1 if you were to try, but by no means should either of you break your momentum here!
#47
Posted 15 June 2012 - 04:34 PM
Alriightyman, on 15 June 2012 - 10:17 AM, said:
I had fixed a lot of other bugs, Infinite Scrolling in Sonic 2 Beta screen used in Sonic 2 Delta when Sound Test is highlighted. In normal Sonic 2 Beta you will never notice the bug, since the Demo Mode runs.
Metal Sonic and Spinner Legs in Sonic 2 rev 2 And others.
Not Showed since no other persons uses Sonic 2 Beta or Sonic 2 rev 2 as bases for your hacks.
Some of these I had fixed a long time ago, you can confirm just playing older versions of Sonic 2 Delta.
And Thanks for all persons which show your fixes which can make the Most famous Game (Sonic the Hedgehog 2) more stable than original.
I do know this is not important but I will release my disassembly of Sonic 2 rev 2 (extracted from Sonic Classics (in Brazil) or Compilation) soon.
#48
Posted 15 June 2012 - 05:34 PM
You're really putting Sonic Team to shame, especially since they've had who knows how many tries to fix them (how could that CPZ gag not be used in any release? How?).
#49
Posted 15 June 2012 - 06:49 PM
redhotsonic, on 15 June 2012 - 01:05 PM, said:
Alriightyman, on 15 June 2012 - 10:17 AM, said:
I normally find bugs with my hack "Sonic 2 Recreation". When I notice these bugs, I look to see if it's in the original game, which 95% of the time, it is. Because I fix it for S2R, I might as well tell people how to fix it for the originals, otherwise everyone will have the same bugs.
Jayextee, on 15 June 2012 - 10:21 AM, said:
eh? This shouldn't happen. I've tried this many times, and it works okay to me. In both HTZ and MTZ.
Anyway, seeming as we've moved on from bosses, I have another bug to show:
How to fix Spindash's height collision

Here's Sonic standing with an arrow heading towards him. Obviously, the arrow is going to hurt him.

Here's Sonic ducking with an arrow heading towards him. Obviously, the arrow is going to miss him.

Here's Sonic spindashing with an arrow heading towards him. This should miss him. But in Sonic 2, it doesn't! Bug? I think so! Here's how to fix. (again, I'm using Xenowhirl's 2007 disassembly)
Go to "TouchResponse:" and find this bit of coding:
cmpi.b #$4D,mapping_frame(a0) ; is Sonic ducking? bne.s Touch_NoDuck ; if not, branch addi.w #$C,d3 moveq #$A,d5 ; loc_3F592: Touch_NoDuck:
What it's doing here, is comparing if Sonic is ducking. If so, do NOT branch, and shorten his y_radius (to $A) and edits his y_pos before carrying on with the routine. It only does this with the ducking though. Because of this, when you spindash, it's still branching to continue with the routine without making any edits to his y_radius, so Sonic's y_radius is still the same as Sonic's standing y_radius ($13). When Sonic rolls, his y_radius is changed, but that's set elsewhere. Anyway, change the coding you see above, to this below:
cmpi.b #9,anim(a0) ; is Sonic spindashing? beq.s Duckinganddashing ; if so, branch cmpi.b #$4D,mapping_frame(a0) ; is Sonic ducking? bne.s Touch_NoDuck ; if not, branch Duckinganddashing: ; So, Sonic is spindashing or ducking addi.w #$C,d3 moveq #$A,d5 ; loc_3F592: Touch_NoDuck:
Now, it's doing an extra check to see if Sonic is spindashing, and if so, it will branch to a new label and shorten his y_radius. If not, it will then ask if you're ducking and if so, it won't branch and shorten the y_radius. If you're not ducking either, it will branch to "Touch_NoDuck" and carry on with the routine.
The codes above run the majority of the time of the game, so this affects most of the objects.
You need to do the same for "Touch_Boss:" So go to that label and change this bit of the coding:
cmpi.b #$4D,mapping_frame(a0) bne.s loc_3F68E addi.w #$C,d3 moveq #$A,d5 loc_3F68E:
To this:
cmpi.b #9,anim(a0) ; is Sonic spindashing? beq.s Duckinganddashingboss ; if so, branch cmpi.b #$4D,mapping_frame(a0) bne.s loc_3F68E Duckinganddashingboss: addi.w #$C,d3 moveq #$A,d5 loc_3F68E:
This part of the code only runs when there is a boss present.
Two more, we need to do it again at "loc_170D0:" Go there and change this part of the coding:
cmpi.b #$4D,mapping_frame(a0) bne.s loc_17104 addi.w #$C,d3 moveq #$A,d5 loc_17104:
Change it to this:
cmpi.b #9,anim(a0) ; is Sonic spindashing? beq.s Duckinganddashingrings ; if so, branch cmpi.b #$4D,mapping_frame(a0) bne.s loc_17104 Duckinganddashingrings: addi.w #$C,d3 moveq #$A,d5 loc_17104:
This code runs in the Ring Manager part of the coding. This only affects the rings collision.
One more, but I'm not sure if this is important. It's part of the Specialbumpers routine for CNZ. But I don't see how you can hit the bumpers whilst spindashing. But in case you want to implement it anyway, go to "loc_174DE:" and change this part of the coding:
cmpi.b #$4D,mapping_frame(a0) bne.s loc_17508 addi.w #$C,d3 moveq #$A,d5 loc_17508:
to this:
cmpi.b #9,anim(a0) ; is Sonic spindashing? beq.s Duckinganddashingbumps ; if so, branch cmpi.b #$4D,mapping_frame(a0) bne.s loc_17508 Duckinganddashingbumps: addi.w #$C,d3 moveq #$A,d5 loc_17508:
Done. You should start to see results like this:

Cheers,
redhotsonic
While applying and testing these I have found another which are present for Miles.
The original code only checks for Sonic Ducking. If you playing as Miles you will be Hurt while ducking.
To Fix just add the following code in all instances:
Normal:
cmpi.b #9,anim(a0) ; is Sonic spindashing?
beq.s Duckinganddashing ; if so, branch
;-------------------------------------------------------------------------------
cmpi.b #$02, (A0) ; Is Miles?
bne.s Touch_Check_Sonic ; Not goto Sonic routine
cmpi.b #$5B, mapping_frame(A0) ; is Miles ducking
bne.s Touch_NoDuck
bra.s Duckinganddashing
Touch_Check_Sonic:
;-------------------------------------------------------------------------------
cmpi.b #$4D,mapping_frame(a0) ; is Sonic ducking?
bne.s Touch_NoDuck ; if not, branch
Duckinganddashing: ; So, Sonic is spindashing or ducking
addi.w #$C,d3
moveq #$A,d5
; loc_3F592:
Touch_NoDuck:
Boss:
cmpi.b #9,anim(a0) ; is Sonic spindashing?
beq.s Duckinganddashingboss ; if so, branch
;-------------------------------------------------------------------------------
cmpi.b #$02, (A0) ; Is Miles?
bne.s Touch_Boss_Check_Sonic ; Not goto Sonic routine
cmpi.b #$5B, mapping_frame(A0) ; is Miles ducking
bne.s loc_3F68E
bra.s Duckinganddashingboss
Touch_Boss_Check_Sonic:
;-------------------------------------------------------------------------------
cmpi.b #$4D,mapping_frame(a0)
bne.s loc_3F68E
Duckinganddashingboss:
addi.w #$C,d3
moveq #$A,d5
loc_3F68E:
Rings:
cmpi.b #9,anim(a0) ; is Sonic spindashing?
beq.s Duckinganddashingrings ; if so, branch
;-------------------------------------------------------------------------------
cmpi.b #$02, (A0) ; Is Miles?
bne.s Touch_Rings_Check_Sonic ; Not goto Sonic routine
cmpi.b #$5B, mapping_frame(A0) ; is Miles ducking
bne.s loc_17104
bra.s Duckinganddashingrings
Touch_Rings_Check_Sonic:
;-------------------------------------------------------------------------------
cmpi.b #$4D,mapping_frame(a0)
bne.s loc_17104
Duckinganddashingrings:
addi.w #$C,d3
moveq #$A,d5
loc_17104:
Edit all codes with Miles fix
#50
Posted 15 June 2012 - 07:20 PM
Esrael, on 15 June 2012 - 06:49 PM, said:
The original code only checks for Sonic Ducking. If you playing as Miles you will be Hurt while ducking.
That's a nice fix, but the problem here is that the code is starting to get too long. Seeming as Sonic AND Tails runs this all the time, it can start to slow the game down a little (okay, hardly by any, but still...)
There is another and quicker fix, but it does have a little problem. Which I'm about to explain.
Instead of having this:
cmpi.b #9,anim(a0) ; is Sonic spindashing?
beq.s Duckinganddashing ; if so, branch
cmpi.b #$4D,mapping_frame(a0) ; is Sonic ducking?
bne.s Touch_NoDuck ; if not, branch
Duckinganddashing: ; So, Sonic is spindashing or ducking
addi.w #$C,d3
moveq #$A,d5
; loc_3F592:
Touch_NoDuck:
You could do this:
cmpi.b #9,anim(a0) ; is Sonic spindashing?
beq.s Duckinganddashing ; if so, branch
cmpi.b #8,anim(a0) ; is Sonic ducking?
bne.s Touch_NoDuck ; if not, branch
Duckinganddashing: ; So, Sonic is spindashing or ducking
addi.w #$C,d3
moveq #$A,d5
; loc_3F592:
Touch_NoDuck:
Instead of mapping_frame, it will compare the anim. Both for Sonic and Tails, their duck is anim #8 and their spindash is anim #9. That way, the code won't be too long. Obviously, do the same thing at "Touch_Boss:", "loc_170D0:" and "loc_174DE:".
This is perfect for Tails, but for Sonic, it has one very slight problem:

Whilst going into his ducking position, he will now have the shorter y_radius. This only happens for a split second, and probably isn't noticable.
If you're not bothered about that, then this is the way to go; replacing "#$4D,mapping_frame(a0)" with "#8,anim(a0)". But, if you are bothered about this, then Esrael's idea is the way to go. It's just a little bit slower as it has to do all these checks for both Sonic and Tails all the time.
#51
Posted 16 June 2012 - 12:48 AM
I hope I'm not coming off as rude, but I'm not sure if you guys caught the bug I mentioned a couple of pages back (it was post #30). I can see it easily getting buried in these posts because MoDule posed another fix just minutes after my post, making it appear a page behind. If you haven't checked it out yet, you're welcome to do so!
#52
Posted 16 June 2012 - 06:24 AM
That One Jig, on 16 June 2012 - 12:48 AM, said:
Whoops, must have missed that, sorry. Okay, here's the fix (Xenowhirls 2007 again):
That One Jig, on 12 June 2012 - 03:14 PM, said:


Go to "Obj05_Main:" and find this coding:
moveq #0,d0 move.b anim(a2),d0 btst #5,status(a2) beq.s + moveq #4,d0 +
When Tails is next to something he's about to push, his pushing tails animation is set. The thing is, just before he pushes, one walking anim appears, which conflicts both tails animations. So, change it to this:
moveq #0,d0 move.b anim(a2),d0 btst #5,status(a2) ; is Tails about to push against something? beq.s + ; if not, branch cmpi.b #$63,mapping_frame(a2) ; Is Tails in his pushing animation yet? blt.s + ; If not yet, branch, and do not set tails' tail pushing animation moveq #4,d0 +
Now, as soon as he's about to push, it will still do his one walking animation, but his mapping_frame wouldn't have reach #$63 yet, so it won't set the tails tail pushing animation. That means no more conflicts. Then when he does do his pushing animation, the tails tails animation will set accordingly without conflicting.
Resulting in this:

Done
Cheers,
redhotsonic
#53
Posted 16 June 2012 - 03:08 PM
Here's hoping a fully-fixed Sonic 2 ROM/patch pops up someday! (That's not a request of any kind, just a thought. Or a wonder, whatever.)
#54
Posted 17 June 2012 - 05:15 AM
That One Jig, on 16 June 2012 - 03:08 PM, said:
You're most welcome.
That One Jig, on 16 June 2012 - 03:08 PM, said:
We can make a new hack with all these bug fixes and call it "Sonic 2: Health and Safety" =P
Anyway, here's another.
Firstly, I aplogise if there has already been a fix out there for this. I am aware that people know this bug as it's on the Retro Wiki, but I couldn't see anywhere about a member telling others how to fix it. So here's how
How to fix the Rexon badnik crash in Hill Top Zone

Quote
On Hill Top Zone, it is possible to crash the game when hitting Rexon (the plesiosaur-like badnik that sits in the lava). Conflicts in the code cause it to jump to a section of code it was never meant to jump to. This results in invalid opcodes being processed and an eventual crash. A link to this glitch is here (the player here is Super Sonic but it can happen as regular Sonic as well).
As it doesn't tell you how to fix it, and I couldn't see anyone mentioning it, here's how.
Go to "loc_37454:" and you should see this:
loc_37454: bsr.w loc_3750C subq.b #1,objoff_2A(a0) bmi.s loc_37462 bra.w JmpTo39_MarkObjGone
That "branch to subroutine - loc_3750C" is what is causing the problem. It's happening too early. We need to move that command down a little bit. So change it to this:
loc_37454: subq.b #1,objoff_2A(a0) bmi.s loc_37462 bsr.w loc_3750C ; Now moved here to help fix Rexon crash bra.w JmpTo39_MarkObjGone
One more, go to "loc_37488:" and you should see this:
loc_37488: bsr.w loc_3750C moveq #$10,d0 add.w d0,x_vel(a0) subq.b #1,objoff_2A(a0) bmi.s loc_374A0 bsr.w JmpTo26_ObjectMove bra.w JmpTo39_MarkObjGone
Again, "branch to subroutine - loc_3750C" is too early. So change it to this:
loc_37488: moveq #$10,d0 add.w d0,x_vel(a0) subq.b #1,objoff_2A(a0) bmi.s loc_374A0 bsr.w loc_3750C ; Now moved here to help fix Rexon crash bsr.w JmpTo26_ObjectMove bra.w JmpTo39_MarkObjGone
Done. The rexon crash will no longer happen.

Cheers,
redhotsonic
#55
Posted 17 June 2012 - 07:23 AM
Got some wifi close to home, temporary solution. Here's to start:
http://info.sonicret...Fix_Rexon_crash
http://info.sonicret...animation_error
And here's the CPz boss feature that Esrael put in.
http://info.sonicret...PZ_boss_feature
#58
Posted 17 June 2012 - 05:16 PM
redhotsonic, on 17 June 2012 - 03:40 PM, said:
In rev 2 this was fixed by Sega. As I had promissed here is the Sonic 2 rev 2 source.
You will see some changes in the code.
This disassembly was generated from Esrael Neto Assembly Editor using other labels definitions.
For curiosity Your fixes for Rexon can be found in Obj_0x97.asm (label Offset_0x036F20:)
The source was not modified by me. This is original from Sega (Sonic Compilation /Classics) with New Header Only.
Sonic 2 rev 2 (Sonic compilation / Classics)
#59
Posted 17 June 2012 - 08:44 PM
Esrael, on 06 June 2012 - 08:49 PM, said:
Debug Crash if you try placing an object after you death the game will Crash
In debug routine find this block:
loc_41C12: btst #5,(Ctrl_1_Press).w beq.s loc_41C56 jsr (SingleObjLoad).l
And insert the following code:
loc_41C12: btst #5,(Ctrl_1_Press).w beq.s loc_41C56 ;---------------------------------------------------- ; Debug crash fix ; Neto - Sonic 2D cmpi.b #$06, ($FFFFB024).w bne.s Player_Ok rts Player_Ok: ;--------------------------------------------------- jsr (SingleObjLoad).l
Edit: asm tags
About these fixes, I don't know if this part was noticed or not.
But without these you will be forced to do a hard reset when you die and try placing an object while debugging/testing in Real Hardware.
#60
Posted 18 June 2012 - 09:23 AM
http://info.sonicret...g_on_Air_Glitch

00