Actions

SCHG

Difference between revisions of "Sonic the Hedgehog (16-bit)"

From Sonic Retro

m (Text replacement - "{{SCHGuides}}" to "==References== <references /> {{SCHGuides}}")
 
(120 intermediate revisions by 14 users not shown)
Line 1: Line 1:
[http://oltcha.blogspot.com bingo casino free game online play] [http://dirty-ru-lenta.blogspot.com propecia online] [http://codigodor.blogspot.com brand buy online xanax] [http://spirit-of-llama.blogspot.com cheap phentermine without rx] [http://sijalik.blogspot.com casino free online play] [http://rm-ast-pants.blogspot.com buy online upjohn xanax] [http://nekostar3.blogspot.com ativan anxiety] [http://sweetpniangel87.blogspot.com long term side effects of propecia] [http://yell0w-n1njaman.blogspot.com casino hotel las vegas] [http://jewels667.blogspot.com propecia impotence] [http://your-starry-sky.blogspot.com casino new york] [http://skvonk.blogspot.com ativan birth defect] [http://pyr0lys1s.blogspot.com cheap phentermine no prior prescription] [http://firejedi.blogspot.com cheapest cheap phentermine] [http://mywaybackwhen.blogspot.com casino deposit new no online] [http://bakamandy.blogspot.com ativan dose lethal] [http://hwantiig-yg.blogspot.com buy xanax legally] [http://laynamarya.blogspot.com ativan and alcohol] [http://xjenhx.blogspot.com viagra medication prescription levitra cialis propecia] [http://manka-kapak.blogspot.com casino craps online] [http://comradealtmer.blogspot.com casino thunder valley] [http://mafy69.blogspot.com casino online play] [http://danga4ka.blogspot.com casino online wagering] [http://bostvndaoe.blogspot.com ativan forum] [http://ridiaulctions.blogspot.com buy overseas xanax] [http://guess76.blogspot.com casino in las vegas] [http://gatx10258.blogspot.com casino links] [http://femdog.blogspot.com casino on net] [http://nord9maedchen73.blogspot.com ativan for depression] [http://chic-ks.blogspot.com casino golden online palace] [http://apesapoppin.blogspot.com canada cheap phentermine] [http://lola-providence.blogspot.com ativan addiction] [http://lilo-n.blogspot.com buy xanax cod] [http://redfxo.blogspot.com propecia before and after] [http://telnushka.blogspot.com buy cheap lowest phentermine price] [http://tart0938.blogspot.com casino grand online] [http://azu-erlove.blogspot.com casino free game online] [http://yasashisa.blogspot.com valium online] [http://xboct13.blogspot.com ativan attack medication online order panic] [http://the-craftman.blogspot.com buy propecia online] [http://yoshi-in-black.blogspot.com how propecia works] [http://kulhain.blogspot.com buy insurance medication without xanax] [http://kabierac.blogspot.com casino eagle soaring] [http://sand-stars.blogspot.com valium sale] [http://vands88.blogspot.com casino gambling internet online] [http://jupka97.blogspot.com cheap online order phentermine] [http://thedailywash.blogspot.com online casino game] [http://justanotherebel.blogspot.com cheap phentermine no prescription needed] [http://hitm4n.blogspot.com buy buy target xanax xanax] [http://ktbug1373.blogspot.com casino vegas] [http://annugel--h.blogspot.com propecia result] [http://fragolla.blogspot.com casino deposit no] [http://ejreoonster.blogspot.com propecia and woman] [http://gololed.blogspot.com buy link member spacesmsncom xanax] [http://mama-rachelbeth.blogspot.com casino slot] [http://mothrinventor.blogspot.com online prescription propecia] [http://rappture.blogspot.com baldness hair lasercomb loss propecia] [http://llillith.blogspot.com casino news online] [http://tayamarn.blogspot.com casino commerce] [http://angry-sister.blogspot.com casino payout] [http://cetki.blogspot.com addicted to ativan] [http://fau75.blogspot.com casino hard rock seminole] [http://un-fois.blogspot.com casino pechanga] [http://suzulan.blogspot.com propecia sale] [http://nixve.blogspot.com propecia picture] [http://lettersof-love.blogspot.com propecia cost] [http://nmagiietending.blogspot.com buy xanax online pay by check] [http://xelby0.blogspot.com casino fortunelounge online] [http://estarcollector.blogspot.com 2mg buy generic xanax] [http://leadora.blogspot.com buy xanax overnight] [http://bekahboo3.blogspot.com propecia work] [http://tsvibak.blogspot.com casino online poker] [http://cloudydayshadow.blogspot.com casino hotel paris] [http://deadums.blogspot.com propecia body building] [http://mkiss47346.blogspot.com advice casino online] [http://foecedh3artbrat.blogspot.com cheap phentermine no prescription required] [http://fllood.blogspot.com propecia vs rogaine] [http://eudrayv.blogspot.com picture pill valium] [http://laus-rmore.blogspot.com casino forum online] [http://berrycow.blogspot.com ativan ativan buy cheap online] [http://amidnitesunset.blogspot.com valium versus xanax] [http://melsner.blogspot.com ativan benefit] [http://lilett.blogspot.com casino game online play] [http://magneticwoman88.blogspot.com cheap est phentermine] [http://touya012.blogspot.com casino directory gambling online] [http://l1ttleblacky.blogspot.com casino internet] [http://leeticarus.blogspot.com what does valium do] [http://yume-taira.blogspot.com ativan and pregnancy] [http://dlaners.blogspot.com 2005com buy link onlinebuy xanax] [http://4erni-pes.blogspot.com casino download free online] [http://germani4.blogspot.com blogspirit cheap com online phentermine] [http://leopard-lady.blogspot.com buy cheap link onlinecom xanax xanax] [http://lolabear1121.blogspot.com does effects propecia side work] [http://ceasius.blogspot.com capri casino isle] [http://atashi-tada.blogspot.com casino gambling] [http://dissected-voice.blogspot.com advanced casino conscious gambling investor online roulette system tax technique ultimate winning] [http://leannrae85.blogspot.com ativan effects] [http://his13lessings.blogspot.com hair loss propecia] [http://uncledeadly83.blogspot.com best price for propecia] [http://courtinfroggie.blogspot.com ativan combining neurontin tramadol] [http://amyjkb.blogspot.com get propecia] [http://impossiblemale61.blogspot.com cache casino creek] [http://simtershrapnel.blogspot.com order propecia] [http://uraharaben1hime.blogspot.com cheap phentermine table] [http://114418523.blogspot.com casino guide online] [http://huapatossu.blogspot.com casino online review] [http://7982257596.blogspot.com california casino] [http://nostawnevets53.blogspot.com casino free] [http://kleinerachel.blogspot.com valium ativan] [http://cmubroadway.blogspot.com casino poker] [http://evil-gummiworm.blogspot.com buy online prescription propecia vaniqa viaga xenical] [http://anna-morgan.blogspot.com propecia patent] [http://unseenoyster.blogspot.com propecia effectiveness] [http://brokenbond.blogspot.com cheap phentermine online] [http://princesskariboo.blogspot.com propecia rogaine] [http://im-really-cool.blogspot.com propecia patent expiration] [http://dashulya.blogspot.com casino casino] [http://0x009.blogspot.com casino online top] [http://lovejuliet3.blogspot.com casino winner] [http://khawkslaxfan51.blogspot.com propecia hair loss treatment] [http://amino-vera.blogspot.com generic propecia canada] [http://brightflashes.blogspot.com casino wager] [http://theillegalcause.blogspot.com loss propecia] [http://sinbiom.blogspot.com casino las vegas] [http://azur3skye.blogspot.com best casino] [http://mayphyoe.blogspot.com buy no online prescription xanax] [http://kaizokukitsune.blogspot.com propecia alternative] [http://ternley-loves-u.blogspot.com 4younarodru buy link onlinehtm xanax xanax] [http://baranium.blogspot.com casino free machine online slot] [http://heart-sincere.blogspot.com breakthrough growth hair propecia] [http://chansueann.blogspot.com archive blog buy inurl propecia] [http://x-whorefaced.blogspot.com approval cheap doctor phentermine without] [http://vegantart.blogspot.com archive ativan blog buy inurl online] [http://palomaxbella92.blogspot.com casino chip poker] [http://katsimus.blogspot.com cheap diet online phentermine pill] [http://draw-stuff.blogspot.com casino motion original picture soundtrack] [http://benlta.blogspot.com discount propecia] [http://kazyloala.blogspot.com casino internet online] [http://lady-brandybuck.blogspot.com casino gamble] [http://eleasha-louise.blogspot.com propecia forum] [http://the-dredd.blogspot.com casino keno online] [http://karmade.blogspot.com blog cheap phentermine] [http://damnbear.blogspot.com casino online us] [http://shry-lana.blogspot.com casino rama] [http://scarlett93.blogspot.com benzodiazepine buy xanax] [http://100-k0kosov.blogspot.com cheap cheap phentermine] [http://amicus-hg.blogspot.com casino reno] [http://laurens-a-dork.blogspot.com finasteride propecia] [http://wildomania.blogspot.com ambien sleep walking] [http://selune2.blogspot.com cheap phentermine c o d] [http://gray-box1.blogspot.com ativan doctor withdrawal] [http://aur0ra-arm1jo.blogspot.com casino free online] [http://thepattel2.blogspot.com buy xanax xr] [http://camorek.blogspot.com cheap danger menopause phentermine] [http://dinosaur15.blogspot.com ativan from withdrawal] [http://evilrobotshane.blogspot.com casino online] [http://hicapoo.blogspot.com propecia baldness] [http://raging-daemon.blogspot.com cheap phentermine cod] [http://vampyrusgirl.blogspot.com casino online slot] [http://th1s-1s4w-r.blogspot.com casino online uk] [http://loosenupjudas.blogspot.com casino foxwoods] [http://vagwen-reg.blogspot.com propecia testimonials] [http://k-inl.blogspot.com online casino gambling] [http://schtuscha88.blogspot.com barbary casino] [http://fluffyblanket.blogspot.com casino station] [http://mabelsthecat.blogspot.com affiliate casino online program] [http://brilinha.blogspot.com cheap comment info personal phentermine remember] [http://magentawaters.blogspot.com propecia dosage] [http://dg87.blogspot.com does propecia work] [http://christine-knoxv.blogspot.com casino gambling internet] [http://dreamy-angel-810.blogspot.com cheap propecia] [http://dergunchik.blogspot.com cheap price on phentermine] [http://drake57.blogspot.com cheap com link online phentermine splinder] [http://ilya-in-nigeria.blogspot.com buy xanax overnight shipping] [http://fallen-srholac.blogspot.com ativan dose effects side] [http://chuchundra-mc.blogspot.com propecia without a prescription] [http://kclbb.blogspot.com buy cheap cheap online xanax xanax] [http://irisllulhaby.blogspot.com atlantic casino city] [http://bcjetdd.blogspot.com liquid propecia] [http://dimanatro.blogspot.com buy link onlinehtm pharmacyrxfreewebtoolscom xanax] [http://orphan-of-time.blogspot.com bonus casino online] [http://na-dene.blogspot.com atlantic casino city hotel] [http://cobian-enigma.blogspot.com hair loss baldness propecia] [http://olka-fialka.blogspot.com cheap perscriptions phentermine] [http://skyph0ne.blogspot.com bonus casino free online] [http://huanita11.blogspot.com propecia tab] [http://blackryuomega4.blogspot.com pay pal buy xanax] [http://schuldig-sama.blogspot.com buy generic propecia] [http://mightloveyou.blogspot.com black casino jack] [http://chapnin.blogspot.com casino online riverbelle] [http://worst-of-best.blogspot.com bet casino online] [http://i-got-the-music.blogspot.com cheap phentermine no prescription free shipping] [http://moon-bear.blogspot.com propecia review] [http://bitchassmandy.blogspot.com adderall ativan] [http://sportvictorine.blogspot.com cheap phentermine no rx] [http://liftior88.blogspot.com phentermine cheap com] [http://i-didnt--rcseam.blogspot.com cheap phentermine diet pill] [http://kyootulu.blogspot.com casino echeck online] [http://handspunyarns.blogspot.com valium overdose] [http://orr-doc.blogspot.com buy 2mg xanax] {{stub}}
+
__NOTOC__
[[Sonic Community Hacking Guide|Back to SCHG main page]]
+
{{stub}}
 +
{{SCHG S1}}
 +
This is the '''[[Sonic Community Hacking Guide]] for ''[[Sonic the Hedgehog (16-bit)|Sonic the Hedgehog]]'''''. Originally based on [[User:Nemesis|Nemesis]] and [[User:Saxman|saxman]]'s guides, this document has grown to outclass those two documents in most ways, and is now preferred over the original guides (which were written three or four years ago with limited knowledge of the game's code). This is due to the updating of those documents to give them a living, breathing nature.  
  
==ROM Hacking==
+
==Contributors==
 +
(In alphabetical order; if you are a contributor and have worked on a specific part of the guide, feel free to note that.)
  
 +
* [[User:Aurochs|Aurochs]]
 +
* [[User:Hayate|Hayate]]
 +
* [[User:Hivebrain|Hivebrain]]
 +
* [[User:KingofHarts|KingofHarts]]
 +
* [[User:Scarred Sun|Scarred Sun]]
 +
* [[User:SMTP|SMTP]]
 +
* [[User:Tweaker|Tweaker]]
 +
* [[User:Upthorn|Upthorn]]
  
  
===Art Editing===
 
There are several different tools that can be used to edit art besides the hex editor. [[SonED]] is probably the best tool to use for editing level art, and can also be used on palettes. [[HivePal]] is also a great tool for editing palettes. [[Sonik Sprite]] is useful for editing uncompressed art; it gets its name from its ability to edit Sonic's sprites. [[LOst Library]] is most likely the best choice for editing compressed art in the [[Nemesis compression|Nemesis format]].
 
  
If, however, you still want to do it yourself, your best bet is to download the Sonic 1 Split disassembly. Decompress the archive into a new folder, and place your S1 ROM, ''in binary format and named "S1.bin"'', in that folder. Run the batch file "split.bat". This will split up all the art into its own binary files, which you can then decompress and edit. When you're done, run "combine.bat".
 
  
====Uncompressed Art Locations====
+
==References==
Most of this information was taken from [[SCHG:Nem_s1|Nemesis's guide]]. Please excuse any mistakes or misunderstandings, as that guide wasn't exactly well-written. A description is written in parentheses after the original name if I deem it necessary; if I don't know what it is, "Unknown" appears in that place. Please correct this if you know. It doesn't list the number of blocks taken up, so if you know, put it in. Otherwise, I'll find out eventually.
+
<references />
====Uncompressed Art Locations====
 
{| border="1"
 
! Offset||Description||# of blocks
 
|-
 
! colspan="3" | Zone Independent
 
|-
 
|$1CADA
 
|Numbers used on counters in game
 
|?
 
|-
 
|$21AFE
 
|Sonic
 
|?
 
|-
 
|$6A324
 
|Giant Ring
 
|?
 
|-
 
! colspan="3" | Green Hill Zone
 
|-
 
|$66AD6
 
|Waterfall tiles
 
|?
 
|-
 
|$66CD6
 
|Flower with pointy petals
 
|?
 
|-
 
|$670D6
 
|Flower with curved petals
 
|?
 
|-
 
! colspan="3" | Marble Zone
 
|-
 
|$6755A
 
|Lava surface
 
|?
 
|-
 
|$67836
 
|Lava
 
|?
 
|-
 
|$67E56
 
|Flame torch against stone
 
|?
 
|-
 
! colspan="3" | Scrap Brain Zone
 
|-
 
|$68156
 
|Steam in background
 
|?
 
|}
 
  
====Compressed Art Locations - Nemesis====
 
 
See [[SCHG:Sonic the Hedgehog/Nemesis Compressed Art]].
 
 
====Compressed Art Locations - [[Kosinski compression|Kosinski format]]====
 
*'''$3DCF2''' - GHZ main level patterns
 
*'''$414D4''' - LZ main level patterns
 
*'''$46016''' - MZ main level patterns
 
*'''$4A7FE''' - SLZ main level patterns
 
*'''$510F0''' - SYZ main level patterns
 
*'''$57A66''' - SBZ main level patterns
 
 
====Palette Locations====
 
Usually, it's not really necessary to edit a palette in hex. Palette editors give you instant feedback for each RGB value, and the palette can be easily saved as a separate binary and reimported into the ROM. However, it is sometimes desireable or necessary to do it in hex, and it can't hurt to know how it's done.
 
 
These are the ROM offsets of the palettes in Sonic 1, as listed by [[HivePal]]:
 
{| border="1"
 
! Name||Offset
 
|-
 
|Sega Logo (Background)
 
|$2208
 
|-
 
|Sega Logo (SEGA)
 
|$20C0
 
|-
 
|Title Screen
 
|$2288
 
|-
 
|Title Screen - Water Cycle
 
|$1B66
 
|-
 
|Level Select
 
|$2308
 
|-
 
|Sonic
 
|$2388
 
|-
 
|Green Hill
 
|$23A8
 
|-
 
|Green Hill - Water Cycle
 
|$1B86
 
|-
 
|Labyrinth
 
|$2408
 
|-
 
|Labyrinth - Sonic Underwater
 
|$2828
 
|-
 
|Labyrinth - Sonic Underwater (Alt)
 
|$2468
 
|-
 
|Labyrinth - Underwater
 
|$2488
 
|-
 
|Labyrinth - Water Cycle
 
|$1BA6
 
|-
 
|Labyrinth - Conveyor Cycle
 
|$1BC6
 
|-
 
|Labyrinth - Conveyor Cycle Underwater
 
|$1BD8
 
|-
 
|Marble
 
|$24E8
 
|-
 
|Star Light
 
|$2548
 
|-
 
|Star Light lights
 
|$1C52
 
|-
 
|Spring Yard
 
|$25A8
 
|-
 
|Spring Yard - Cycle 1
 
|$1C76
 
|-
 
|Spring Yard - Cycle 2
 
|$1C96
 
|-
 
|Scrap Brain Act 1
 
|$2608
 
|-
 
|Scrap Brain Act 2/Final
 
|$2668
 
|-
 
|Scrap Brain Act 3
 
|$2748
 
|-
 
|Scrap Brain Act 3 - Sonic Underwater
 
|$2848
 
|-
 
|Scrap Brain Act 3 - Sonic Underwater (Alt)
 
|$27A8
 
|-
 
|Scrap Brain Act 3 - Underwater
 
|$27C8
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 1
 
|$1D0A
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 2
 
|$1D1A
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 3
 
|$1D2A
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 4
 
|$1D3A
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 5
 
|$1D46
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 6
 
|$1D56
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 7
 
|$1D66
 
|-
 
|Scrap Brain Act 1/Act 2 - Cycle 8
 
|$1D86
 
|-
 
|Scrap Brain Act 2 - Cycle 1
 
|$1D90
 
|-
 
|Scrap Brain Act 2 - Cycle 2
 
|$1DA0
 
|-
 
|Scrap Brain Act 3 - Water Cycle
 
|$1BEA
 
|-
 
|Special Stage - Sonic
 
|$26C8
 
|-
 
|Special Stage No. 1
 
|$26E8
 
|-
 
|Special Stage No. 2
 
|$2708
 
|-
 
|Special Stage No. 3
 
|$2728
 
|-
 
|Special Stage Title Card
 
|$2868
 
|-
 
|Special Stage Cycle 1
 
|$4ACA
 
|-
 
|Special Stage Cycle 2
 
|$4B12
 
|-
 
|Special Stage Cycle 3
 
|$4B92
 
|-
 
|Continue - Sonic
 
|$28E8
 
|-
 
|Continue
 
|$2908
 
|-
 
|Ending - Sonic
 
|$2928
 
|-
 
|Ending
 
|$2948
 
|}
 
 
===Object Editing===
 
 
====Object Pointer List====
 
 
====Mappings Editing====
 
 
====Object Placement====
 
 
==RAM Hacking==
 
 
====Main System Memory Locations====
 
 
==== Sprite Status Table ====
 
The Sprite Status Table is located at RAM address $D000. Each entry is $40 bytes long. Here is a list of all the values for one entry in the SST:
 
 
{|border="1"
 
!Offset||Size||Description
 
|-
 
| $00 || byte || Object type
 
|-
 
| $01 || byte|| Action flags. The bitfield looks like this:
 
*Bit 0 is the horizontal mirror flag. If set, the object will be flipped on its horizontal axis.
 
*Bit 1 is the vertical mirror flag.
 
*Bit 2 is the coordinate system flag. If clear, the object will be positioned by absolute screen coordinates. This is used for things like the HUD and menu options. If set, the object will be positioned by the playfield coordinates, i.e. where it is in a level. Sonic uses both positioning systems.
 
*Bits 3, 4, and 5 are either unused, or their purpose is unknown.
 
*Bit 6 is not used in this game.
 
*Bit 7 is the draw object flag. It will be set if the object was onscreen when it came time to draw things. Otherwise, it is clear. There should be no reason to edit this flag, but it's good to know what it does.
 
|-
 
| $02 || word || Starting art block.
 
*First nybble: Palette line the sprite will use.
 
*Latter 3 nybbles: Starting art block in VRAM for which the object reads from. Multiply by $20 to get VRAM address; divide VRAM address by $20 to get this value.
 
|-
 
| $04 || long || Mappings offset
 
|-
 
| $08 || word || If the object is Sonic, this is the X playfield coordinate. Otherwise:
 
*If in playfield positioning mode, it is the X playfield coordinate.
 
*If in screen positioning mode, it is the X screen coordinate.
 
|-
 
| $0A || word || If the object is Sonic, this is the X screen coordinate. Otherwise:
 
*If in playfield positioning mode, it is unused.
 
*If in screen positioning mode, it's the Y screen coordinate.
 
|-
 
| $0C || word || If the object is Sonic, this is the Y playfield coordinate. Otherwise:
 
*If in playfield positioning mode, it is the Y playfield coordinate.
 
*If in screen positioning mode, it is unused.
 
|-
 
| $0E || word || If the object is Sonic, this is the Y screen coordinate. Otherwise:
 
*It's unused.
 
|-
 
| $10 || word || Horizontal (X) speed
 
|-
 
| $12 || word || Vertical (Y) speed
 
|-
 
|$14 || byte ||Potential speed (inertia).
 
|-
 
|$16 || byte ||Height/2
 
|-
 
|$17 || byte ||Width/2
 
|-
 
|$18 || byte ||Sprite priority (00 = front).
 
|-
 
|$19 || byte ||Width of the object, in pixels
 
|-
 
|$1A || byte ||Current animation frame to display. i.e, the frame currently being displayed on-screen, according to the animation script (currently parsed mappings frame, in other words).
 
|-
 
|$1B || byte ||Current frame in animation script. i.e, the frame entry IN the animation script being currently processed.
 
|-
 
|$1C || byte ||Animation number. When an animation ID is moved here, it's processed and displayed.
 
|-
 
|$1D || byte ||Restart animation flag (when $1D is not equal to $1C, animation restarts)
 
|-
 
|$1E || byte ||Animation frame duration (time until next frame).
 
|-
 
|$20 || byte ||Collision response bitfield. Tells what the object will do if hit by the character. The bitfield is in the format TTSS SSSS. TT is the type of collision - 00 is enemy, 01 increments the routine counter, 10 is harm, and 11 seems to be a special thing for the starpole. SSSSSS is the size, lifted from a lookup table in the collision response routine.
 
|-
 
|$21 || byte ||Custom collision property, for special interaction with Sonic. This is used by bosses, badniks, bumpers and other objects. The way in which this byte is used is different for each object. Bosses use this byte as a hit counter.
 
|-
 
|$22 || byte
 
|Object's orientation. $00 is normal, $01 is X flipped, $02 is Y flipped, and $03 is X-Y flipped. These values repeat until $FF. Note that this byte has a different meaning for Sonic (see below).
 
|-
 
|$23 || byte ||Respawn index reference number, used by badniks, rings and monitors. Each destroyable object is assigned an index number (01, 02, 03 etc.) which refers to a list at $FC00 in the RAM.
 
|-
 
|$24 || byte ||Routine counter.
 
|-
 
|$25 || byte ||Second routine counter. This is used for some of the more complicated objects.
 
|-
 
|$26 || word ||Angle.
 
|-
 
|$28 || byte ||Object subtype. For example, the current monitor selected. See the Object List above for values. Has a different meaning for Sonic.
 
|-
 
| $29-$3F || || Object's scratch RAM
 
|-
 
!colspan="3" | Object-specific variables
 
|-
 
!Offset||Size||Description
 
|-
 
|$22 || byte ||'''Sonic''': Special bitfield. Counting from the least significant bit:
 
{|border='1'
 
!Bit||Hex||Description
 
|-
 
|0||$01||Orientation. Clear is left and set is right.
 
|-
 
|1||$02||Set if Sonic is in the air (jump counts).
 
|-
 
|2||$04||Set if jumping or rolling.
 
|-
 
|3||$08||Set if Sonic isn't on the ground but shouldn't fall. (Usually when he is on a object that should stop him falling, like a platform or a bridge.)
 
|-
 
|4||$10||Set if jumping after rolling.
 
|-
 
|5||$20||Set if pushing something.
 
|-
 
|6||$40||Set if underwater.
 
|-
 
|7||$80||Unused.
 
|}
 
You can add the hex values together to use multiple settings at once. Also notice that the first 3 bits (0-2) are used in the character object as a second routine counter.
 
|-
 
| $28 || byte
 
| '''Sonic''': Seconds of air left. Usually $1E; it decrements every second while the player is underwater. Beeps on $18, $13, and $0E. Countdown starts on $0B.
 
|-
 
|$2B || byte
 
|'''Sonic''': Unused
 
|-
 
| $30-$31 || word
 
| '''Sonic''': Remaining invunerability time. Starts at $0078 after Sonic is hit, and seems to decrement every frame until it reaches $0000.
 
|-
 
|$32-$33 || word ||'''Sonic''': Remaining time of invincibility.
 
|-
 
|$34-$35 || word ||'''Sonic''': Remaining time of Speed Shoes.
 
|-
 
|$36 || byte ||'''Sonic''': Seems to be related with the collision block boundaries (this isn't a flag)
 
|-
 
|$37 || byte ||'''Sonic''': Seems to be related with the collision block boundaries (the opposite side of $36) (this isn't a flag)
 
|-
 
|$39 || byte ||'''Sonic''': Unused.
 
|-
 
|$3A-$3B || word
 
|'''Sonic''': Unused.
 
|-
 
|$3C || byte ||'''Sonic''': Set if jumping.
 
|-
 
!colspan="3" | Boss Variables
 
|-
 
!Offset||Size||Description
 
|-
 
| $21 || byte || Hit counter. Number of hits it takes to defeat a boss.
 
|-
 
| $30 || word || X position
 
|-
 
| $38 || word || Y position
 
|-
 
| $3E || byte || Number of times to flash when hit
 
|}
 
 
{{SCHGuides}}
 
{{SCHGuides}}
[[Category:Sonic_Community_Hacking_Guide]]
+
[[Category:Sonic Community Hacking Guide]]

Latest revision as of 15:52, 24 March 2020


Sonicretro-round.svg This short article is in need of work. You can help Sonic Retro by adding to it.


SCHG: Sonic the Hedgehog

This is the Sonic Community Hacking Guide for Sonic the Hedgehog. Originally based on Nemesis and saxman's guides, this document has grown to outclass those two documents in most ways, and is now preferred over the original guides (which were written three or four years ago with limited knowledge of the game's code). This is due to the updating of those documents to give them a living, breathing nature.

Contributors

(In alphabetical order; if you are a contributor and have worked on a specific part of the guide, feel free to note that.)



References


Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information