Sonic - RetroKoH/S1Fixed GitHub Wiki

Dynamic Objects

Sonic is a playable object in Sonic the Hedgehog, appearing in all playable stages in the standard game mode GM_Level. Given that everything in a standard level operates around Sonic, much of the changes, fixes, and modifications are going to be centered around this object and its subroutines.

It is a dynamic object, loaded at the start of every standard level in GM_Level. In Sonic 1 and 2, as well as earlier iterations of S1Fixed, it had the object index $01.

Code File

_incObj/-- Sonic.asm

Routines

  • Sonic_Main
  • Sonic_Control
  • Sonic_Hurt
  • Sonic_Death
  • Sonic_Restart
  • Sonic_Drowned*

*This routine was added with redhotsonic's underwater handling fixes.

Subtypes

This object has no subtypes.

Object Status Table

x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
0x ID Render Gfx Gfx Map Map Map Map XPos XPos XPos XPos YPos YPos YPos YPos
1x VelX VelX VelY VelY ~ ~ Height Width Priority Priority Frame AniFrame Anim PrevAnim FrameTime DelayTime
2x Inertia Inertia Status DispWid Routine ~ Angle ~ WallJump* WallJump* AutoRollFlag+ ~ ~ ~ DblJumpFlag* DblJumpProp*
3x Invuln Invinc Shoes ~ ~ CtrlLock** FrontAngle RearAngle OnWheel Status2nd* RestartTimer RestartTimer Jumping LRLock PlatformAddr PlatformAddr
  • (+) This is the default function of this RAM byte, but also serves as the SpinDashFlag, if the relevant elective mod is enabled.
  • (*) These OST variables are only used if certain elective mods are active.
  • (**) This OST variable was previously a global RAM variable.

Sprite Data

Later Game Equivalents

Sonic 2

  • Obj01 - Sonic
  • Obj02 - Tails

Sonic 3 & Knuckles

  • Obj_Sonic - Sonic
  • Obj_Tails - Tails
  • Obj_Knuckles - Knuckles
  • Obj_Sonic2P - Sonic (or Knuckles) in Competition Mode
  • Obj_Tails2P - Tails in Competition Mode