Sonic and Sega Retro Message Board: Some changes and fixes for Sonic 2 - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 16 Pages +
  • ◄ First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last ►
    Locked
    Locked Forum

Some changes and fixes for Sonic 2

#46 User is offline dsrb 

Posted 15 June 2012 - 04:05 PM

  • Posts: 3150
  • Joined: 10-June 09
  • Gender:Male
  • Wiki edits:196
Bloody hell, you guys just keep blowing this game apart! And then putting it back together way more awesome.

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! :thumbsup:

#47 User is offline Esrael 

Posted 15 June 2012 - 04:34 PM

  • Posts: 186
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Neto Assembler Editor / Sonic 2 Delta / Neto Boot Loader

View PostAlriightyman, on 15 June 2012 - 10:17 AM, said:

How the hell do all of you notice these things?!?!?!? I love all these previously unknown fixes!


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.
This post has been edited by Esrael: 15 June 2012 - 04:35 PM

#48 User is offline E-122-Psi 

Posted 15 June 2012 - 05:34 PM

  • Posts: 1764
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
It's pretty impressive, especially since a lot of these bugs weren't even noticed by many to begin with.

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 User is offline Esrael 

Posted 15 June 2012 - 06:49 PM

  • Posts: 186
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Neto Assembler Editor / Sonic 2 Delta / Neto Boot Loader

View Postredhotsonic, on 15 June 2012 - 01:05 PM, said:

View PostAlriightyman, on 15 June 2012 - 10:17 AM, said:

How the hell do all of you notice these things?!?!?!? I love all these previously unknown fixes!


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.



View PostJayextee, on 15 June 2012 - 10:21 AM, said:

...and why he can't collect dropped rings in lava without jumping.


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




Posted Image

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



Posted Image

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



Posted Image

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:

Posted Image



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
This post has been edited by Esrael: 15 June 2012 - 07:09 PM

#50 User is offline redhotsonic 

Posted 15 June 2012 - 07:20 PM

  • Also known as RHS
  • Posts: 1583
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24

View PostEsrael, on 15 June 2012 - 06:49 PM, said:

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.




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:

Posted Image

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 User is offline That One Jig 

Posted 16 June 2012 - 12:48 AM

  • Well, shoot.
  • Posts: 62
  • Joined: 04-July 11
  • Gender:Male
  • Location:Somewhere in America
  • Project:Anti-Hoarding
Man, if I could make an appropriate surprised face right now via text, I'd be doing it like crazy right now. Those CPZ and crouching fixes not only make the game more "perfect," but they add flair to it at the same time! As someone who doesn't see video games quite as timeless as other forms of media, I'm ecstatic to see all these fixes come out for the game. Excellent work, Esrael and redhotsonic!

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 User is offline redhotsonic 

Posted 16 June 2012 - 06:24 AM

  • Also known as RHS
  • Posts: 1583
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24

View PostThat One Jig, on 16 June 2012 - 12:48 AM, said:

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! :)



Whoops, must have missed that, sorry. Okay, here's the fix (Xenowhirls 2007 again):



View PostThat One Jig, on 12 June 2012 - 03:14 PM, said:

While on the subject of Tails bugs, I've noticed one that I don't think I've seen mentioned before. When Tails is standing next to a solid object, his tails use their pushing animation as opposed to his standard tail animation (the improper animation is in pic 1). Also, during the few frames before Tails enters his actual pushing animation, his tails look corrupted (pic 2).

Posted ImagePosted Image




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:

Posted Image


Done

Cheers,
redhotsonic

#53 User is offline That One Jig 

Posted 16 June 2012 - 03:08 PM

  • Well, shoot.
  • Posts: 62
  • Joined: 04-July 11
  • Gender:Male
  • Location:Somewhere in America
  • Project:Anti-Hoarding
Dang. That was fast! Thanks for that fix, redhotsonic! It's amazing to see all these bugfixes pile up at one time.

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 User is offline redhotsonic 

Posted 17 June 2012 - 05:15 AM

  • Also known as RHS
  • Posts: 1583
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24

View PostThat One Jig, on 16 June 2012 - 03:08 PM, said:

Dang. That was fast! Thanks for that fix, redhotsonic! It's amazing to see all these bugfixes pile up at one time.


You're most welcome.



View PostThat One Jig, on 16 June 2012 - 03:08 PM, said:

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.)



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


Posted Image


Quote

Rexon Crash

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.

Posted Image


Cheers,
redhotsonic

#55 User is offline KingofHarts 

Posted 17 June 2012 - 07:23 AM

  • Posts: 1610
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1
Btw I apologize. I'm slipping on documenting these in the wiki. This is a result of having no wifi at home, otherwise they'd be done immediately. I'll do my best to catch up later this week. Please hang tight.

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
This post has been edited by KingofHarts: 17 June 2012 - 09:45 AM

#56 User is offline ICEknight 

Posted 17 June 2012 - 02:33 PM

  • Posts: 10999
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
Pretty cool stuff guys, please do keep it coming.

View Postredhotsonic, on 17 June 2012 - 05:15 AM, said:

How to fix the Rexon badnik crash in Hill Top Zone
Just wondering, is this the same fix as the official one from v.02?
This post has been edited by ICEknight: 17 June 2012 - 02:34 PM

#57 User is offline redhotsonic 

Posted 17 June 2012 - 03:40 PM

  • Also known as RHS
  • Posts: 1583
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24

View PostICEknight, on 17 June 2012 - 02:33 PM, said:

View Postredhotsonic, on 17 June 2012 - 05:15 AM, said:

How to fix the Rexon badnik crash in Hill Top Zone
Just wondering, is this the same fix as the official one from v.02?


It was fixed from S2K. That's where I got this fix from =P

#58 User is offline Esrael 

Posted 17 June 2012 - 05:16 PM

  • Posts: 186
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Neto Assembler Editor / Sonic 2 Delta / Neto Boot Loader

View Postredhotsonic, on 17 June 2012 - 03:40 PM, said:

View PostICEknight, on 17 June 2012 - 02:33 PM, said:

View Postredhotsonic, on 17 June 2012 - 05:15 AM, said:

How to fix the Rexon badnik crash in Hill Top Zone
Just wondering, is this the same fix as the official one from v.02?


It was fixed from S2K. That's where I got this fix from =P


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)
This post has been edited by Esrael: 17 June 2012 - 05:18 PM

#59 User is offline Esrael 

Posted 17 June 2012 - 08:44 PM

  • Posts: 186
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Neto Assembler Editor / Sonic 2 Delta / Neto Boot Loader

View PostEsrael, 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 User is offline KingofHarts 

Posted 18 June 2012 - 09:23 AM

  • Posts: 1610
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1
Here's one of MoDule's... I'm on my iPod... So any errors, sorry, I'm doing the best I can.
http://info.sonicret...g_on_Air_Glitch

  • 16 Pages +
  • ◄ First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last ►
    Locked
    Locked Forum

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users