Path Swapper - RetroKoH/S1Fixed GitHub Wiki

Object List $04: Auto Roll Tag ->

The Path Swapper is an object in Sonic the Hedgehog, theoretically able to appear anywhere in the game where its necessary to change Sonic's collision path, though it only appears in Green Hill and Star Light Zones, positioned in and around the levels' loops. The functionality of this object is how Sonic is able to run through complex terrain, such as loop-de-loops.

This object was backported from Sonic 2, removing the need for the dedicated subroutine found in Sonic_Loops.

Code

File: _incObj/03 Collision Switcher.asm

Changes from Sonic 1
  • Sonic 1 used a 256x256 chunk system that has been converted to 128x128.
  • This object replaces the original system, wherein loop handling was performed via a flag check. If Sonic ran through specific chunks, the chunk would swap with another, visually identical chunk, whose solidity would allow him to run through.
Changes from Sonic 2
  • Word-length obPriority pointer due to the new Priority Manager.
  • Word-Length obRespawnAddr added due to the S3K Object Manager.
  • The object has been slightly rewritten to process more efficiently.

Subtypes

This object has various subtypes that dictate how Sonic's collision handling works, based on the direction of collision, and whether or not he is grounded.

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 ~ ~ RespawnAddr RespawnAddr ~ ~ Priority Priority Frame ~ ~ ~ ~ ~
2x ~ ~ ~ DispWid ~ ~ ~ ~ Subtype ~ ~ ~ ~ ~ ~ ~
3x obPSwap_Radius obPSwap_Radius obPSwap_Flag ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Sprite Data

Later Game Equivalents

  • Obj03 - Sonic 2
  • Obj_PathSwap - Sonic 3K
⚠️ **GitHub.com Fallback** ⚠️