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
  • 15 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

Some changes and fixes for Sonic 2

#1 User is offline Esrael 

Posted 06 June 2012 - 08:49 PM

  • Posts: 175
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Esrael Neto Assembler Editor / Sonic 2 Delta
Sorry if was done before, but I don't find it in forums.

If you pay attention after defeating some bosses in Sonic 2 you will notice some strange things.
I am not good in explanations. But look in to pictures to understand what I am saying.


Edit:
When the boss is defeated, it falls apart. If it is facing left, it falls apart properly. However, if it is facing the other way, the pieces still fall as if it was facing the other way. This behaviour is obviously wrong. The following code checks which way he is facing, and properly calls for the right routine so that he falls apart properly!
Thanks to Irixion for better explanation:

Using Sonic 2 Delta for comparisons.

(All codes translated to use with Xenowhirl, 2007 version.)

Posted Image
ARZ Boss:
Find:
loc_30850:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_3088A
	subi.w	#1,y_radius(a0)    ; <---------- 
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1



Make the following changes:

loc_30850:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_3088A
	bsr     NGHz_Boss_Fix_EjectHammer ; subi.w	#1,y_radius(a0)    ; <----------
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1
        ....
return_3088A:
	rts
;===============================================================================                
NGHz_Boss_Fix_EjectHammer:  ; Esrael L. G. Neto Rotina para corrigir o bug ao ejetar o martelo  
                btst    #$00, $0001(A0)
                bne.s   NGHz_Boss_Fix_EjectHammer_Mirror                                        		
                subi.w	#$0001, $0016(A0)       ; Ejeta o Martelo
                rts 
NGHz_Boss_Fix_EjectHammer_Mirror: 
                addi.w	#$0001, $0016(A0)       ; Ejeta o Martelo                           
                rts 
;===============================================================================     



Posted Image

MCz Boss

Find:
loc_31358:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_313C4
	subi.w	#1,status(a0)  <------------ 

        ....

loc_31392:
	addi.w	#1,x_vel(a0)   <------------
	move.l	objoff_34(a0),d0




Make the following changes:

loc_31358:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_313C4
	bsr     MCz_Boss_Fix_EjectDrill ; subi.w	#1,status(a0)  <------------ 

       ....

loc_31392:
	bsr     MCz_Boss_Fix_EjectDrill ; addi.w	#1,x_vel(a0)   <------------
	move.l	objoff_34(a0),d0
        ......
return_313C4:
        rts  
;===============================================================================                
MCz_Boss_Fix_EjectDrill:  ; Esrael L. G. Neto Rotina para corrigir o bug ao ejetar as blocas  
                btst    #$00, $0001(A0)
                bne.s   MCz_Boss_Fix_EjectDrill_Mirror                                        		
                addi.w	#$0001, $0010(A0)       ; Ejeta a bloca da frente da Nave
                subi.w	#$0001, $0022(A0)       ; Ejeta a bloca de trás da Nave
                rts 
MCz_Boss_Fix_EjectDrill_Mirror: 
                subi.w	#$0001, $0010(A0)       ; Ejeta a bloca da frente da Nave
                addi.w	#$0001, $0022(A0)       ; Ejeta a bloca de trás da Nave                         
                rts 
;===============================================================================    



Posted Image

CNz Boss

Find:
loc_31EAE:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_31F22
	subi.w	#1,status(a0)  ; <------------------
	move.l	objoff_3A(a0),d0
        ....
loc_31EE8:
	cmpi.w	#$3C,($FFFFF75C).w
	bgt.s	return_31F22
	addi.w	#1,x_vel(a0)    ; <--------------
	move.l	objoff_34(a0),d0



Make the following changes:

loc_31EAE:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_31F22
	bsr.s   Obj51_Fix_Eject_Left_Catcher ; subi.w	#1,status(a0)  ; <------------------
	move.l	objoff_3A(a0),d0
        ....
loc_31EE8:
	cmpi.w	#$3C,($FFFFF75C).w
	bgt.s	return_31F22
	bsr.s   Obj51_Fix_Eject_Right_Catcher ; addi.w	#1,x_vel(a0)    ; <--------------
	move.l	objoff_34(a0),d0
        .....
return_31F22:
	rts

;===============================================================================
; Eject Catcher Fix                                   Added by Esrael L. G. Neto
; [ Begin ] 
;===============================================================================
Obj51_Fix_Eject_Left_Catcher:
                btst    #$00, $0001(A0)
                bne.s   Obj51_Eject_Left_Catcher_Mirror
                subi.w	#$0001, $0022(a0)       ; Eject Left Catcher From Ship
                rts
Obj51_Eject_Left_Catcher_Mirror: 
                addi.w  #$0001, $0022(a0)       ; Eject Left Catcher From Ship
                rts     

Obj51_Fix_Eject_Right_Catcher:
                btst    #$00, $0001(A0)
                bne.s   Obj51_Eject_Right_Catcher_Mirror
                addi.w  #$0001, $0010(A0)       ; Eject Right Catcher From Ship
                rts
Obj51_Eject_Right_Catcher_Mirror: 
                subi.w  #$0001, $0010(A0)       ; Eject Right Catcher From Ship
                rts        
;===============================================================================                
; Eject Catcher Fix                                   Added by Esrael L. G. Neto
; [ End ] 
;===============================================================================







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

#2 User is offline Irixion 

Posted 06 June 2012 - 09:08 PM

  • Posts: 1469
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
Nicely done! :o I never noticed this until you brought it up.


Edit: Thought I'd whip an en explanation that you can paste into your post.


When the boss is defeated, it falls apart. If it is facing left, it falls apart properly. However, if it is facing the other way, the pieces still fall as if it was facing the other way. This behaviour is obviously wrong. The following code checks which way he is facing, and properly calls for the right routine so that he falls apart properly!
This post has been edited by Irixion: 06 June 2012 - 09:19 PM

#3 User is offline Uberham 

Posted 06 June 2012 - 09:48 PM

  • King Of Oblivion
  • Posts: 1097
  • Joined: 23-February 08
  • Gender:Male
  • Location:Sheffield England
I like the crossover drills :(

#4 User is offline Irixion 

Posted 06 June 2012 - 10:28 PM

  • Posts: 1469
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
Someone with wiki skills ought to put this on SCHG. Boggles my mind how I never noticed this @_@

#5 User is offline KingofHarts 

Posted 07 June 2012 - 01:50 AM

  • WHY CANT I EDIT THE WIKIIII????
  • Posts: 1541
  • Joined: 07-August 10
  • Gender:Male
  • Project:Sonic 1 Complete (SHC 2016 Entry)
  • Wiki edits:1

View PostIrixion, on 06 June 2012 - 10:28 PM, said:

Someone with wiki skills ought to put this on SCHG. Boggles my mind how I never noticed this @_@


I wont be able to until tomorrow, but I can do it.
Provided it isn't already done by then...

I remember Esreal pointing this out in his Delta hack thread, and I thought he meant something else entirely... I feel stupid now. LOL

#6 User is offline redhotsonic 

Posted 07 June 2012 - 04:17 AM

  • Also known as RHS
  • Posts: 1505
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24
I see you're joining me on the bug hunting =P

Except for the ARZ boss bug, I've fixed all these already. Nice find and will apply the ARZ bug today. Cheers for that, mate.


For ARZ boss bug, keep reading this post.
For MCZ boss and 5 CNZ boss bugs, click here
For CPZ boss bug, click here




EDIT: Looking at your ARZ boss fix, I will say, there is another "quicker" and "shorter" way to fix the ARZ boss bug. This can be followed for the other bosses as well. It's just quicker on the processor rather than it branching to a subroutine and such. Just thought I'd let you know about it in case.



Change:

loc_30850:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_3088A
	subi.w	#1,y_radius(a0)
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1



To this:


loc_30850:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_3088A
	subi.w	#1,y_radius(a0)		; Make hammer fall to the left
	btst	#0,render_flags(a0)	; Is Eggman facing left?
	beq.s	+			; Yes?  Branch and continue
	addi.w	#2,y_radius(a0)		; So he's facing right?  Make hammer fall to the right instead
+
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1




This works also, and it's just quicker and it save space as it doesn't have to contain a subroutine. You can do something similar to this with the other bosses.
This post has been edited by redhotsonic: 07 June 2012 - 05:18 PM

#7 User is offline Esrael 

Posted 07 June 2012 - 09:04 AM

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

View Postredhotsonic, on 07 June 2012 - 04:17 AM, said:

I see you're joining me on the bug hunting =P

Except for the ARZ boss bug, I've fixed all these already. Nice find and will apply the ARZ bug today. Cheers for that, mate.



EDIT: Looking at your ARZ boss fix, I will say, there is another "quicker" and "shorter" way to fix the ARZ boss bug. This can be followed for the other bosses as well. It's just quicker on the processor rather than it branching to a subroutine and such. Just thought I'd let you know about it in case.



Change:

loc_30850:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_3088A
	subi.w	#1,y_radius(a0)
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1



To this:


loc_30850:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_3088A
	subi.w	#1,y_radius(a0)		; Make hammer fall to the left
	btst	#0,render_flags(a0)	; Is Eggman facing left?
	beq.s	+			; Yes?  Branch and continue
	addi.w	#2,y_radius(a0)		; So he's facing right?  Make hammer fall to the right instead
+
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1




This works also, and it's just quicker and it save space as it doesn't have to contain a subroutine. You can do something similar to this with the other bosses.



Thanks, Is possible to optimize all codes, but I Make these to show new code separated from original.
And I make translation of Sonic 2 Delta codes since I am using revision 2 of Sonic 2.
I use the following code in Sonic 2 Delta for ARz Boss:


(Original Sonic 2 rev 2 code with fix in Sonic 2 Delta)
Offset_0x03036E:
                cmpi.w  #$0078, ($FFFFF75C).w
                bgt.s   Offset_0x0303A6
              ; subq.w  #$01, $0016(A0)
;===============================================================================
; Faz com que o martelo seja ejetado para fora independente da direção da nave
; [ Início ]                                                   ; Neto - Sonic 2D
;===============================================================================    
                btst    #$00, $0001(A0)
                bne.s   ARz_Boss_Fix_EjectHammer_Mirror                                        		
                subq.w  #$0001, $0016(A0)       ; Ejeta o Martelo
                bra.s   ARz_Boss_Fix_EjectHammer_Exit
ARz_Boss_Fix_EjectHammer_Mirror: 
                addq.w  #$0001, $0016(A0)       ; Ejeta o Martelo                           
ARz_Boss_Fix_EjectHammer_Exit:                  
;===============================================================================
; Faz com que o martelo seja ejetado para fora independente da direção da nave
; [ Término ]                                                  ; Neto - Sonic 2D
;===============================================================================            
                move.l  $003A(A0), D0
                move.w  $002E(A0), D1



I can't find your links to other fixes.
This post has been edited by Esrael: 07 June 2012 - 09:10 AM

#8 User is offline redhotsonic 

Posted 07 June 2012 - 11:59 AM

  • Also known as RHS
  • Posts: 1505
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24
Either way is good. Just saying the way I did it will be quicker and will save you some ROM space (okay, hardly much space, but every little helps, right? =P )


You couldn't find my other fixes, because I hadn't posted them. I was saying that to do it my way for MCZ and CNZ boss, just follow the same principle I showed you for ARZ boss. But I'll post them here now if you like =)




MCZ boss


Change all this:

loc_31358:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_313C4
	subi.w	#1,status(a0)
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1
	addi.w	#$38,objoff_2E(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_3A(a0)
	move.w	objoff_3A(a0),routine(a0)
	cmpi.w	#$6F0,routine(a0)
	blt.s	loc_31392
	move.w	#0,objoff_2E(a0)

loc_31392:
	addi.w	#1,x_vel(a0)
	move.l	objoff_34(a0),d0
	move.w	objoff_30(a0),d1
	addi.w	#$38,objoff_30(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_34(a0)
	move.w	objoff_34(a0),y_vel(a0)
	cmpi.w	#$6F0,y_vel(a0)
	blt.s	return_313C4
	move.w	#0,objoff_30(a0)

return_313C4:
	rts



To this:

loc_31358:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.w	return_313C4
	subi.w	#1,status(a0)		; Make drill face to the left
        btst    #0,render_flags(a0)     ; Is Eggman facing left?
        beq.s   +                       ; Yes?  Branch and continue
        addi.w  #2,status(a0)		; So he's facing right?  Make drill face to the right instead
+
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1
	addi.w	#$38,objoff_2E(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_3A(a0)
	move.w	objoff_3A(a0),routine(a0)
	cmpi.w	#$6F0,routine(a0)
	blt.s	loc_31392
	move.w	#0,objoff_2E(a0)

loc_31392:
	addi.w	#1,x_vel(a0)		; Make drill fall to the left
        btst    #0,render_flags(a0)     ; Is Eggman facing left?
        beq.s   +                       ; Yes?  Branch and continue
        subi.w  #2,x_vel(a0)		; So he's facing right?  Make drill fall to the right instead
+
	move.l	objoff_34(a0),d0
	move.w	objoff_30(a0),d1
	addi.w	#$38,objoff_30(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_34(a0)
	move.w	objoff_34(a0),y_vel(a0)
	cmpi.w	#$6F0,y_vel(a0)
	blt.s	return_313C4
	move.w	#0,objoff_30(a0)

return_313C4:
	rts


Done




CNZ boss


Change all this:

loc_31EAE:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.s	return_31F22
	subi.w	#1,status(a0)
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1
	addi.w	#$38,objoff_2E(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_3A(a0)
	move.w	objoff_3A(a0),routine(a0)
	cmpi.w	#$6F0,routine(a0)
	blt.s	loc_31EE8
	move.w	#0,objoff_2E(a0)

loc_31EE8:
	cmpi.w	#$3C,($FFFFF75C).w
	bgt.s	return_31F22
	addi.w	#1,x_vel(a0)
	move.l	objoff_34(a0),d0
	move.w	objoff_30(a0),d1
	addi.w	#$38,objoff_30(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_34(a0)
	move.w	objoff_34(a0),y_vel(a0)
	cmpi.w	#$6F0,y_vel(a0)
	blt.s	return_31F22
	move.w	#0,objoff_30(a0)

return_31F22:
	rts



To this:

loc_31EAE:
	cmpi.w	#$78,($FFFFF75C).w
	bgt.w	return_31F22
	subi.w	#1,status(a0)		; Make catcher face to the left
        btst    #0,render_flags(a0)     ; Is Eggman facing left?
        beq.s   +                       ; Yes?  Branch and continue
        addi.w  #2,status(a0)		; So he's facing right?  Make catcher face to the right instead
+
	move.l	objoff_3A(a0),d0
	move.w	objoff_2E(a0),d1
	addi.w	#$38,objoff_2E(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_3A(a0)
	move.w	objoff_3A(a0),routine(a0)
	cmpi.w	#$6F0,routine(a0)
	blt.s	loc_31EE8
	move.w	#0,objoff_2E(a0)

loc_31EE8:
	cmpi.w	#$3C,($FFFFF75C).w
	bgt.s	return_31F22
	addi.w	#1,x_vel(a0)		; Make catcher fall to the left
        btst    #0,render_flags(a0)     ; Is Eggman facing left?
        beq.s   +                       ; Yes?  Branch and continue
        subi.w  #2,x_vel(a0)		; So he's facing right?  Make catcher fall to the right instead
+
	move.l	objoff_34(a0),d0
	move.w	objoff_30(a0),d1
	addi.w	#$38,objoff_30(a0)
	ext.l	d1
	asl.l	#8,d1
	add.l	d1,d0
	move.l	d0,objoff_34(a0)
	move.w	objoff_34(a0),y_vel(a0)
	cmpi.w	#$6F0,y_vel(a0)
	blt.s	return_31F22
	move.w	#0,objoff_30(a0)

return_31F22:
	rts


Done



Another CNZ boss BUG


As we're on fixing boss bugs, ever noticed the other 4 bugs on CNZ's boss? If not, read on. The very first hit on the CNZ boss, it will NEVER make the boss-hit sound. Also, you know Eggman normally shows his hurt face when you hit him? The very first hit, he delays showing his hurt face (about 2 seconds later after the first hit). Also, during his first hit, he will flash a lot longer, and until he stops flashing, you cannot hit him again!


So, that's the 4 bugs, all happening on the first hit:

  • Never plays boss hit sound
  • Eggman's hurt face delayed
  • Eggman flashes a hell of a lot longer
  • Because he flashes a lot longer, you cannot hit a second time for a while



The rest of the hits, he's fine though. To solve all these bugs, the fix is EXTREMELY simple =P




Go to "loc_31904:". You should see this near the middle of the coding:

	move.b	#$80,objoff_14(a0)


Delete it.

There, done.


Explaination

objoff_14 is part of the countdown timer. Normally, this timer is at 0. When you hit Eggman, the countdown timer is set to $30, then starts counting down. Whilst it's counting down, Eggman will flash. You cannot hit him whilst flashing (that's not a bug). At "loc_31CDC", it tests objoff_14 for 0. If not equal, it will branch away. NORMALLY, when you hit Eggman, as soon as you hit him, it will set objoff_14 to $30, play the sound and display Eggman's hurt face, and then countdown from $30. But because at "loc_31904" where Eggman is being created, it has set this timer to $80. So on the first hit, it's got a lot to countdown (until it reaches 0). Because of this, he flashes for AGES. And because of this, you cannot hit him a second time for a while. Because it's $80, it cannot branch to the playsound and set objoff_14 to $30. Eventually, it's counted down to 0, then he's fine the rest of the time.


At "loc_31C92", it compares the objoff_14 at $2F. If so, branch to display Eggman's hurt face. On the first hit, because it's counting down from $80, it takes ages to $2F, and that's why Eggman has a delay on showing his hurt face on the first hit.


Because we've deleted the command, objoff_14 is already set at 0. So, it is ready for action. So now, on the first hit, he will now play the sound and set the timer to $30, he will display his hurt face immediately (because it's only a byte away), and because it's counting down from $30, he will not flash as long, and you can get back to hitting him quicker. All 4 bugs, fixed!


Why the hell did they set objoff_14 to $80 when being created in the first place, I have no idea.


This may help you on your hack =)


Cheers,
redhotsonic

#9 User is offline dsrb 

Posted 07 June 2012 - 12:10 PM

  • Posts: 3150
  • Joined: 10-June 09
  • Gender:Male
  • Wiki edits:196
Did anyone ever make the CPZ boss's blue gunk able to hurt Sonic when he's ducking? I think there's something of a debate over whether it's intentional, muddied by the fact that it does hurt Tails and (I'm assuming) Knuckles, but anyway. It's (like most of them) not the kind of boss I think needs an easy method like that. :P

#10 User is offline Esrael 

Posted 07 June 2012 - 12:48 PM

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

View Postredhotsonic, on 07 June 2012 - 11:59 AM, said:

Either way is good. Just saying the way I did it will be quicker and will save you some ROM space (okay, hardly much space, but every little helps, right? =P )

.........

Cheers,
redhotsonic



Thanks, for replying.
I made these change in old versions of Sonic 2 Delta, but never find anyone to notice these little details and searched in the forums before posting.
This will help others to fix these on yours hacks no just me.
Thanks and all Help are welcome.

#11 User is offline redhotsonic 

Posted 07 June 2012 - 05:00 PM

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

View PostEsrael, on 07 June 2012 - 12:48 PM, said:

Thanks, for replying.
I made these change in old versions of Sonic 2 Delta, but never find anyone to notice these little details and searched in the forums before posting.
This will help others to fix these on yours hacks no just me.
Thanks and all Help are welcome.



You're welcome. I'm glad I could be an assistance. Especially to you, Esrael.




View Postdsrb, on 07 June 2012 - 12:10 PM, said:

Did anyone ever make the CPZ boss's blue gunk able to hurt Sonic when he's ducking? I think there's something of a debate over whether it's intentional, muddied by the fact that it does hurt Tails and (I'm assuming) Knuckles, but anyway. It's (like most of them) not the kind of boss I think needs an easy method like that. :P


Sure, there is an easy fix. I've applied it myself, and it seems to work. And it hasn't affected anything else. So, here goes.




CPZ boss bug


As many of you are aware, during the CPZ boss, when Eggman drops the blue gunge on you, if you are "ducking" you cannot get hurt, making it too easy to avoid Eggman's attacks.

Posted Image
Sonic unhurt from gunge



To fix this so you will get hurt whilst ducking, follow this.


Go to "loc_2E692:" and you'll see this:

loc_2E692:
	addq.b	#2,routine_secondary(a0)
	move.b	#$20,y_radius(a0)
	move.b	#$19,anim(a0)
	move.w	#0,y_vel(a0)
	movea.l	objoff_34(a0),a1 ; a1=object
	movea.l	$34(a1),a1
	btst	#2,$2D(a1)
	beq.s	loc_2E6CA
	bclr	#2,$2D(a1)
	move.b	#6,routine_secondary(a0)
	move.w	#9,objoff_2A(a0)



See that command?

	move.b	#$20,y_radius(a0)


Change #$20 to #$16. So you have this in the end:

loc_2E692:
	addq.b	#2,routine_secondary(a0)
	move.b	#$16,y_radius(a0)
	move.b	#$19,anim(a0)
	move.w	#0,y_vel(a0)
	movea.l	objoff_34(a0),a1 ; a1=object
	movea.l	$34(a1),a1
	btst	#2,$2D(a1)
	beq.s	loc_2E6CA
	bclr	#2,$2D(a1)
	move.b	#6,routine_secondary(a0)
	move.w	#9,objoff_2A(a0)


Done




Explanation

The gunge's y_radius is #$20. This is fine normally. But when Sonic "ducks", Sonic's y_radius is "shortened". So, now, when the gunge is falling and hits the ground, it actually doesn't touch Sonic.

Because we have "lowered" the gunge's y_radius, it's distance from the floor has grown just a little bit. Because of this, the gunge now falls down, just a little bit more, and because of this, it will now hit Sonic when he's "ducking". And it will still hurt Sonic in any other position also.




Something Cool for CPZ boss!

THIS IS JUST FOR LAUGHS, but I thought I'd share it anyway! Back at the label "loc_2E692:". See these two lines?

	btst	#2,$2D(a1)
	beq.s	loc_2E6CA


Comment them out! And everytime Eggman drops the gunge, this will happen!

Posted Image


Well, I found it funny =P

#12 User is offline amphobius 

Posted 08 June 2012 - 05:30 AM

  • where are the japanese shaman girls, lintahlo?
  • Posts: 2102
  • Joined: 19-February 08
  • Gender:Male
  • Location:Northern Ireland, Belfast
  • Project:Sonic Thrash, Sonic Boom, Super Famidev
  • Wiki edits:165
...That's a bug? That always seemed intentional. Hell, I found it cool that you could do that even.

#13 User is offline E-122-Psi 

Posted 08 June 2012 - 06:59 AM

  • Posts: 1707
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
Maybe it was intended when he drops the gunge over himself. It would likely be more complex to recognise when the player is directly beside Robotnik when it drops though.

#14 User is offline redhotsonic 

Posted 09 June 2012 - 04:14 AM

  • Also known as RHS
  • Posts: 1505
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24
"For fuck sake, RHS! Stop it with all these bug fixes!" Is what you lot are probably thinking =P


But as this subject seems to be on bosses, I thought I'd post another one here. Another ARZ glitch.




ARZ boss bug


Posted Image

With this boss, as soon as you're hurt, Eggman won't laugh instantly. Instead, he waits for you to hit the ground, then he laughs. Same goes for Tails. All the other boss, Eggman laughs instantly. So let's fix this.




Go to "loc_30770:" (part of the ARZ boss code) and you'll see this:

loc_30770:
	lea	($FFFFF740).w,a1
	move.b	#$31,3(a1)

loc_3077A:



Under the "move.b #$31,3(a1)", insert this line:

	move.b	#1,objoff_36(a0)	; move 1 to checker



So you have something like this:

loc_30770:
	lea	($FFFFF740).w,a1
	move.b	#$31,3(a1)
	move.b	#1,objoff_36(a0)	; move 1 to checker

loc_3077A:




Next, go to "loc_3075C:" and you'll see this:

loc_3075C:
	bsr.w	loc_3078E
	cmpi.b	#4,(MainCharacter+routine).w
	beq.s	loc_30770
	cmpi.b	#4,(Sidekick+routine).w
	bne.s	loc_3077A


After the "bsr.w loc_3078E" command, insert these two lines:

	tst.b	objoff_36(a0)		; Is checker 0?
	bne.s	loc_3077A		; If not, branch and do not check for Sonic/Tails hurt state



So you have something like this:

loc_3075C:
	bsr.w	loc_3078E
	tst.b	objoff_36(a0)		; Is checker 0?
	bne.s	loc_3077A		; If not, branch and do not check for Sonic/Tails hurt state
	cmpi.b	#4,(MainCharacter+routine).w
	beq.s	loc_30770
	cmpi.b	#4,(Sidekick+routine).w
	bne.s	loc_3077A




Next, go to "return_3078C:" and you'll see this:

return_3078C:
	rts



Change it to this:

return_3078C:
	cmpi.b	#$17,($FFFFF743).w	; Has Eggman stopped laughing?
	bne.s	+			; If not, branch
	clr.b	objoff_36(a0)		; If so, clear checker, so Eggman can check to see if Sonic/Tails are hurt again
+
	rts




Done


Posted Image





Explanation

Most of you have probably noticed that Eggman didn't laugh instantly. BUT, did any of you notice that when hurt, Eggman's animation is actually frozen? Yup, that's right. Normally, his mustache is moving (due to wind I guess), but as soon as you're hurt, his mustache isn't moving anymore. He's frozen and until you hit the ground, he will remain that way. When you've hit the ground, he will then laugh, then carry on with his normal animations.


It's important to know, for this boss, the animations are working another way rather than they normally do. instead of "anim" being set, $FFFFF743 (or $FFFFF740+3) is being set. This RAM adress counts down every frame, to make Eggman animate. Every odd number dispalys one part of his anim, and every even number displays another part of his anim. His mustache for instance. Every odd number displays 1 part and every even displays another, making his mustache move.


Anyway, the reason for Eggman's animation freezing is because when Sonic/Tails gets hurt, their routine is set to 4 (hurt routine). Eggman checks this, and if hurt, move $31 to his animation. But at this moment in time, the RAM address CANNOT countdown. It tries to, but it can't. The reason why, is because as Sonic and tails are hurt, until they land on the floor, their routine will stay at 4. Because Eggman is continuously seeing them at routine 4, it constantly writes $31 to $FFFFF743. That's why the RAM cannot countdown. And because it's constantly at $31, it's only able to display one part of his animation, and that's why Eggman's anim is frozen.


As soon as Sonic/Tails lands, their routine is set back to normal. Eggman now stops writing $31 to $FFFFF743, letting the RAM address able to countdown, now displaying his laugh animation.



So, what have we done to fix this? We've added a new check using objoff_36(a0) (not used in ARZ boss so it's free to use). As soon as Sonic/Tails gets hurt, it now moves #1 to objoff_36(a0). We've added a check before the Sonic/Tails hurt check. If objoff_36(a0) is now equals 1, to branch away from the hurt check, leaving $FFFFF743 free to countdown. Eggman now displays his laugh instantly.

After Eggman's laugh, $FFFFF743 is set back to $17 and counts down again (Eggman's normal animation). We've done one more check to see if $FFFFF743 equals $17 and if so, to clear objoff_36(a0). Now that objoff_36(a0) is now 0 again, Eggman can now check to see when Sonic/Tails gets hurt again, and laugh when so.


Everything is fine once again!


Long explanation, eh? =P



redhotsonic

#15 User is offline KingofHarts 

Posted 10 June 2012 - 04:52 AM

  • WHY CANT I EDIT THE WIKIIII????
  • Posts: 1541
  • Joined: 07-August 10
  • Gender:Male
  • Project:Sonic 1 Complete (SHC 2016 Entry)
  • Wiki edits:1
http://info.sonicret...uction_Behavior
http://info.sonicret...e_CNZ_boss_bugs
http://info.sonicret...attack_behavior
http://info.sonicret...sprite_behavior
God damn it RHS! LOL I kid, I like that you are pointing out these bugs.
And Esrael as well! Let's keep finding more. This is fun.
This post has been edited by KingofHarts: 10 June 2012 - 05:56 AM

  • 15 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

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