Actions

SCHG How-to

Restore lost CPZ boss feature

From Sonic Retro

(Original guide by Esrael)

At one point of development, there was to be an intended feature involving the Chemical Plant Zone boss, which would see Robotnik accidentally pour chemicals onto himself. This feature was taken out at some point, and has never been seen in any official build. However, a search through the ROM would reveal that the pieces needed for said feature still exist in the game. Now, this guide will show you how to make Dr. Eggman look like a dumbass and pour chemicals onto himself! (It isn't 100% certain if this was the EXACT intended way for this to occur, but if you're going to nitpick at that, go get bent.)

First, find the code:

 loc_2DAD4:
        move.w  d0,(a1)
        subq.b  #1,objoff_3E(a0)
        bne.s   return_2DAE8
        move.b  #$F,collision_flags(a0)
        bclr    #1,objoff_2D(a0)

return_2DAE8:
        rts

and replace it with this

 loc_2DAD4:
        move.w  d0,(a1)
        bset    #1,objoff_2D(a0)   ; Add this line to code
        subq.b  #1,objoff_3E(a0)
        bne.s   return_2DAE8
        move.b  #$F,collision_flags(a0)
        bclr    #1,objoff_2D(a0)

return_2DAE8:
        rts

After you made the changes. Give it a go. Wait for robotnik to fill the bottle, then hit him. You will see the once missing animation working again, though it only works when the bottle is fully filled, and you hit him at the right time. Now, thats all well and good, but... there are other things we need to fix before we call it a day.

One thing, though - the existing code seems to display the art slightly too far to the right for some reason. 3 pixels to be exact! So, we need to shift ol' Robotnik 3 pixels to the left.

There are 2 ways to do this. Here is the ASM fix:

Just edit mappings into the following file: Obj5D_MapUnc_2EADC: BINCLUDE "mappings/sprite/obj5D_a.bin"

The last 3 mappings in the file is animation: Change this:

               0001E00A004A0025FFF0
               0001E80D00530029FFF0
               0001E80D005B002DFFF0

to this:

               0001E00A004A0025FFED
               0001E80D00530029FFED
               0001E80D005B002DFFED

Alternatively just load the mapping file along with the CPZ Boss art file on SonMapEd and nudge the last three sprites three pixels left.

Now, there is one more issue with this feature. The animation won't turn around when Robotnik's ship does, leaving the goo-with-eyes occasionally floating away from Robotnik's head. Lets fix that now...

To fix this in the 2007 disassembly, find:

loc_2E790:

        subi.b  #1,anim_frame_duration(a0)
        bpl.s   loc_2E7B6

Or in the GitHub disassembly:

Obj5D_Gunk_6:
	subi_.w	#1,Obj5D_timer2(a0)
	bpl.s	+

and add the following code to the start of loc_2E790:

                
                cmpi.b  #$25, mapping_frame(A0)
                blt.s   _CPz_2
                move.w  (MainCharacter+x_pos).w, D0
                sub.w   x_pos(A0), D0
                bgt.s   _CPz_1
                bclr    #$00, render_flags(A0)
                bra.s   _CPz_2
_CPz_1:
                bset    #$00, render_flags(A0)                   
_CPz_2:
SCHG How-To Guide: Sonic the Hedgehog 2 (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix Super Sonic Bugs | Use Correct Height When Roll Jumping | Fix Jump Height Bug When Exiting Water | Fix Screen Boundary Spin Dash Bug | Correct Drowning Bugs | Fix Camera Y Position for Tails | Fix Tails Subanimation Error | Fix Tails' Respawn Speeds | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix Rexon Crash | Fix Monitor Collision Bug | Fix EHZ Deformation Bug | Correct CPZ Boss Attack Behavior | Fix Bug in ARZ Boss Arrow's Platform Behavior | Fix ARZ Boss Walking on Air Glitch | Fix ARZ Boss Sprite Behavior | Fix Multiple CNZ Boss Bugs | Fix HTZ Background Scrolling Mountains | Fix OOZ Launcher Speed Up Glitch | Fix DEZ Giant Mech Collision Glitch | Fix Boss Deconstruction Behavior | Fix Speed Bugs | Fix 14 Continues Cheat | Fix Debug Mode Crash | Fix 99+ Lives | Fix Sonic 2's Sega Screen
Design Choices
Remove the Air Speed Cap | Disable Floor Collision While Dying | Modify Super Sonic Transformation Methods & Behavior | Enable/Disable Tails in Certain Levels | Collide with Water After Being Hurt | Retain Rings When Returning at a Star Post | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Insert LZ Water Ripple Effect | Restore Lost CPZ Boss Feature | Prevent SCZ Tornado Spin Dash Death | Improve ObjectMove Subroutines | Port S3K Rings Manager | Port S3K Object Manager | Port S3K Priority Manager | Edit Level Order with ASM‎ | Alter Ring Requirements in Special Stages | Make Special Stage Characters Use Normal DPLCs | Speed Up Ring Loss Process | Change spike behaviour in Sonic 2
Adding Features
Create Insta-kill and High Jump Monitors | Create Clone and Special Stage Monitors | Port Knuckles
Sound Features
Expand Music Index to Start at $00 | Port Sonic 1 Sound Driver | Port Sonic 2 Clone Driver | Port Sonic 3 Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Expand the Music Index to Start at $00 (Sonic 2 Clone Driver Version) | Play Different Songs Per Act
Extending the Game
Extend the Level Index Past $10 | Extend the Level Select | Extend Water Tables | Add Extra Characters | Free Up 2 Universal SSTs

|Restore lost CPZ boss feature]]