Sonic - RetroKoH/S1Fixed GitHub Wiki

Dynamic Objects
S1Fixed_004

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

Changes from Sonic 1
  • Word-length obPriority pointer due to the new Priority Manager.
  • Word-length obRespawnAddr added due to the S3K Object Manager.
  • Removed from the Static Object Pointer List due to its dynamic nature.
  • BUGFIX: The Sonic_Drowned routine was added for 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 Render Addr Addr Addr Gfx Gfx Map Map Map Map XPos XPos XPos XPos YPos YPos
1x YPos YPos VelX VelX VelY VelY ~ ~ Height Width Priority Priority Frame Anim AniFrame FrameTime
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
⚠️ **GitHub.com Fallback** ⚠️