Sonic the Hedgehog (16-bit)/Object Editing
From Sonic Retro
(Redirected from SCHG:Sonic the Hedgehog/Object Editing)
SCHG: Sonic the Hedgehog |
---|
|
Object Pointer list
This is the pointer list for every object in Sonic 1, including all zone objects, unused objects, etc. The offsets for the code and mappings are based on where they are found in a clean HG disassembly. These offsets may change even in a clean disassembly, however, due to the Revision variable. Changing this to either the REV 00 or REV JP1 version can result in slightly different offsets for the code, and mappings. The offsets shown on this table reflect the REV 00 version.
NOTE: Code offsets were originally taken from the Nemesis guides, and do not all appear to be accurate. Object pointers are currently in a process of being checked and verified. Mappings offsets are currently 100% accurate, and reflect the point in the ROM where the mapping pointers start, rather than where the code for the pieces themselves start. This is also analogous to the data found in RAM at an objects obMap OST byte.
ID # | Description | Code | Mappings | Subparameters |
---|---|---|---|---|
01 | Sonic | $12BD8 | $211E2 | |
02 | ???? | $D5B2 | N/A | All of these point to ObjectFall, the subroutine directly after the object table; apparently a label for a null object was made but code was never added. |
03 | ???? | $D5B2 | N/A | |
04 | ???? | $D5B2 | N/A | |
05 | ???? | $D5B2 | N/A | |
06 | ???? | $D5B2 | N/A | |
07 | ???? | $D5B2 | N/A | |
08 | LZ water splash | $142F0 | $145CC | |
09 | Sonic in Special Stage | $1B984 | $211E2 | |
0A | Drowning countdown numbers | $13C98 | $129CC | |
0B | LZ vertical pole | $11206 | $11322 |
|
0C | LZ Flapping doors | $11346 | $113F2 | $0x - Door flaps open/shut in xx seconds. |
0D | End of level signpost | $EB28 | $ED38 | |
0E | Sonic on the title screen | $A61C | $A888 | |
0F | "PRESS START BUTTON" and "TM" from title screen | $A69C | $A7C4 | |
10 | Blank object | $1C022 | N/A | |
11 | GHZ Bridge | $7328 | $7934 | Subtype dictates # of logs |
12 | Spinning light behind glass from SYZ | $E90C | $E982 | |
13 | Fireball Maker (MZ/SLZ) | $E296 | N/A | Subtype determines # of frames a fireball is spawned (30, 60, 90, 120, 150, 180) |
14 | Fireball from MZ/SLZ | $E304 | $B36E |
|
15 | GHZ and MZ swinging platforms Spiked ball on a chain (SBZ) SLZ swinging platforms |
$7952 |
|
|
16 | Spear from LZ | $11F04 | $11F9A |
|
17 | Helix of spikes on a pole from GHZ | $7CA2 | $7DF8 | $10 |
18 | GHZ platforms SLZ platforms SYZ platforms |
$7E32 |
|
|
19 | Blank object | $81A8 | N/A | |
1A | Collapsing ledge from GHZ | $8210 | $85A0 |
|
1B | Water surface from LZ | $110C6 | $1116C | |
1C | Zone Scenery object | $87CA | $7934 |
|
1D | Unused Switch object | $885E | $891C | |
1E | Ballhog | $8B4C | $8E62 | |
1F | Crabmeat | $94F0 | $9750 | |
20 | Cannonball that Ball Hog throws | $8C1C | $8E62 | |
21 | SCORE, TIME, RINGS | $1C548 | $1C5B4 | |
22 | Buzz Bomber | $97DE | $9A36 | |
23 | Missile that Buzz Bomber throws | $9932 | $9B06 | |
24 | Buzz Bomber Missile's Dissolve Effect | $8CF2 | $8EA6 | |
25 | Ring | $9B26 | $9F92 | |
26 | Monitor | $A118 | $A58A |
|
27 | Standard explosion | $8D62 | $8EC6 | |
28 | Freed animals | $8F22 |
|
|
29 | Points upon destroying | $9412 | $94AE | |
2A | One way barrier from SBZ | $8934 | $89EC | |
2B | Chopper enemy | $AB20 | $ABCA | |
2C | Jaws enemy | $ABDA | $AC70 | |
2D | Burrobot enemy | $ACA4 | $AE5C | |
2E | Contents of monitor flying up from monitor being busted | $A302 | $A58A | |
2F | Large platforms from MZ | $AEB8 | $B2D4 |
|
30 | Large glassy blocks from MZ | $B39E | $B5FA |
|
31 | Metal stomping blocks on chains | $B67C | $BB4E |
|
32 | Switch | $BD2E | $BEA4 |
|
33 | Moveable block in MZ and LZ | $BED2 | $C2E6 | |
34 | Title card | $C306 | $C9E6 | |
35 | Fireball that sits on the floor (MZ) (appears when you walk on sinking platforms) |
$B1DC | $B36E | |
36 | Spikes | $CE28 | $CFE8 | First nybble - mappings frame (0-5) Second nybble - movement type:
|
37 | Rings flying out from being hit | $9CB6 | $9F92 | |
38 | Shield and invincibility stars | $14158 | $143B2 | |
39 | "Game over"/"Time over" sprite | $C4B8 | $CBA4 | |
3A | End of level results screen | $C572 | $CBD8 | |
3B | GHZ purple rock | $D050 | $D10E | |
3C | Breakable walls in GHZ, SLZ | $D11C | $D2B6 |
|
3D | Eggman (GHZ) | $17700 | $17D0C | |
3E | Egg prison | $1AB22 | $1AD74 | |
3F | Large explosion | $8DF6 | $8F0C | |
40 | Motobug | $F61A | $F7A0 | |
41 | Springs | $DABE | $DD1A |
|
42 | Newtron enemy (GHZ) | $DD68 | $D4F2 |
|
43 | Roller enemy (SYZ) | $DFFA | $E1A2 | |
44 | Wall barrier from GHZ | $E1D4 | $E250 |
|
45 | Spiked metal block from beta version (MZ) | $B99A | $BC5A | |
46 | Solid blocks and blocks that fall from the ceiling (MZ) | $E7D0 | $E904 |
|
47 | Pinball bumper (SYZ) | $E9D0 | $EB00 | |
48 | Swinging ball on a chain from GHZ boss | $17AE4 | $17DD4 (Boss Item) $7C48 (Chain link) $81AA (Ball) |
|
49 | Waterfall sound effect | $D0BE | N/A | |
4A | Special stage entry from beta | $14254 | $1446C | |
4B | Giant ring | $9E06 | $9FD2 | |
4C | Lava geyser / lava that falls from the ceiling trigger (MZ) | $ED84 | $F24A |
|
4D | Lava geyser / lava that falls from ceiling | $EE70 | $F24A | Triggered by object $4C |
4E | Advancing wall of lava (MZ) | $F05E | $F52E | |
4F | Blank object used for object $50 | ??? | N/A | |
50 | Yadrin enemy (SYZ) | $F83A | $F92E | |
51 | Smashable green block (MZ) | $FC92 | $FDD4 | |
52 | Moving blocks (MZ, LZ, SBZ) | $FDF8 | $1004A (MZ & SBZ) $100A0 (LZ) |
|
53 | Collapsing floors (MZ, SLZ, SBZ) | $8320 | $8746 |
|
54 | Invisible lava tag (MZ) | $F1B8 | $F210 | |
55 | Basaran enemy (MZ) | $100A8 | $1023E | |
56 | Moving blocks (SYZ/SLZ/LZ) | $10286 | $10700 |
|
57 | Spiked ball on a chain | $10782 | $10956 (SYZ) $1095E (LZ) |
Subparameters are set so the first half of the nybble sets the speed (lower is faster) and the second half determines the amount of links on the chain, starting with 2 at the 3 value. |
58 | Spikeball | $10976 | $10AA0 |
|
59 | Raising platforms (SLZ) | $10AD2 | $10D48 |
|
5A | Platforms that move in circles (SLZ) | $10D5A | $10E82 |
|
5B | Blocks that form a staircase (SLZ) | $10E90 | $1103C |
|
5C | Metal girders in foreground (SLZ) | $11044 | $11096 | |
5D | Fans (SLZ) | $114FC | $11610 | $00-$02 |
5E | Seesaws (SLZ) | $1163C | $119A4 (Seesaw) $119E6 (Spikeball) |
|
5F | Walking bomb enemy (SLZ, SBZ) | $119F6 | $11C28 | |
60 | Orbinaut enemy (LZ, SLZ, SBZ) | $11CCE | $11EE4 |
|
61 | Blocks (LZ) | $11FD4 | $121C2 |
|
62 | Gargoyle head (LZ) | $121E8 | $12318 | $01-$04 |
63 | Platforms on a conveyor belt (LZ) | $1233C | $1267C |
|
64 | Bubbles (LZ) | $126A4 | $129CC | $80-82 |
65 | Waterfalls (LZ) | $12A9E | $12B54 |
|
66 | Rotating disc that grabs Sonic (SBZ) | $1509A | $15292 |
|
67 | Disc that you run around (SBZ) (Small object; actual disc is in level tiles) |
$154E2 | $15686 | $40 |
68 | Conveyor belts (SBZ) (Small object; actual belt is in level tiles) |
$1568E | N/A |
|
69 | Spinning platforms and trapdoors (SBZ) | $15730 | $158E0 (Trapdoor) $1593A (Spinning platform) |
|
6A | Ground and ceiling saws (SBZ) | $1597C | $15B98 |
|
6B | Stomper and platforms (SBZ) | $15C12 | $15F68 |
|
6C | Vanishing platforms (SBZ) | $15FF8 | $1612A | $00, $40, $80, $C0, $C6, $E6 |
6D | Flamethrower (SBZ) | $E4E0 | $E5F4 | $43 |
6E | Electrocution orbs (SBZ) | $16146 | $161E0 |
|
6F | Spinning platforms that move around a conveyor belt (SBZ) | $1626A | $1593A | $80-$85 |
70 | Large girder block (SBZ) | $1652A | $16628 | |
71 | Invisible solid blocks | $1141A | $114B6 | Various |
72 | Teleporter (SBZ) | $16668 | N/A | $00-$08 |
73 | Eggman (MZ) | $18230 | $17D0C (Eggman) $17DD4 (Boss Item) |
|
74 | Lava that Eggman drops (MZ) | $186A4 | $B36E | |
75 | Eggman (SYZ) | $190EE | $17D0C (Eggman) $17DD4 (Boss Item) |
|
76 | Blocks that Eggman picks up (SYZ) | $19692 | $197F8 | |
77 | Eggman (LZ) | $17E36 | $17D0C (Eggman) | |
78 | Caterkiller enemy (MZ, SBZ) | $16934 | $16D6E | |
79 | Lamppost | $16E2E | $170F8 | $00-$09 - Posts 0 through 9 |
7A | Eggman (SLZ) | $188B8 | $17D0C (Eggman) $17DD4 (Boss Item) |
|
7B | Exploding spikeys that the SLZ boss drops | $18CCE | $190DE | |
7C | Giant Ring Flash Effect | $9ED6 | $A074 | |
7D | Hidden points at the end of a level | $1715E | $17248 |
|
7E | Special stage results screen | $C7AE | $CC9A | |
7F | Chaos Emeralds from the special stage results screen | $C956 | $CDF4 | |
80 | Continue screen | $4E42 | $5056 | |
81 | Sonic on the continue screen | $4F5C | $5056 | |
82 | Eggman (SBZ2) | $19832 | $1AA56 (Eggman) $BEA4 (Button) |
|
83 | Blocks that disintegrate when Eggman presses a switch | $19B60 | $19D12 | |
84 | Cylinders Eggman hides in (FZ) | $1A44E | $1A676 | |
85 | Eggman (FZ) | $19D58 | $17D0C (Eggman) $19A34 (SBZ Eggman) $1A3DA (Damaged Eggmobile) $1A41C (Eggmobile Legs) $1A676 (Cylinder) |
|
86 | Energy balls/launcher (FZ) | $1A7DA | $1AA56 (Launcher) $1AAA6 (Plasma Ball) |
|
87 | Sonic on the ending sequence | $53E2 | $5680 | |
88 | Chaos Emeralds on the ending sequence | $553C | $577A | |
89 | "SONIC THE HEDGEHOG" text on the ending sequence | $5616 | $57B2 | |
8A | "SONIC TEAM PRESENTS" and credits | $17264 | $172E2 | |
8B | Robotnik on the "TRY AGAIN" and "END" screens | $59E2 | $5BCC | |
8C | Chaos Emeralds on the "TRY AGAIN" screen | $5AC2 | $577A |
Dynamic pattern load cues
In Sonic 1, DPLCs are utilized exclusively for Sonic's sprite. Nevertheless, an understanding of the format is useful to have.
The format starts out with relative pointers that are one word in length and stored with a big-endian byte order. These pointers point to data signifying what to load and how much to load. The format for this is:
The first byte contains a count of how many entries there. Each entry follows this format:
One word is stored and is divided up into nybbles where the highest nybble stores how many tiles are to be loaded minus one.
The next three nybbles store the offset relative to the beginning of the tileset in tiles meaning to get an offset in bytes you will have to multiply this value by 32 (or shift to the left by 5).
Mappings editing
Each mapping is 5 bytes long, taking the form TTTT TTTT 0000 WWHH PCCY XAAA AAAA AAAA LLLL LLLL.
- LLLL LLLL is the left co-ordinate of where the mapping appears.
- TTTT TTTT is the top co-ordinate of where the mapping appears.
- WW is the width of the mapping, in tiles minus one. So 0 means 8 pixels wide, 1 means 16 pixels wide, 2 means 24 pixels wide and 3 means 32 pixels wide.
- HH is the height of the mapping, in the same format as the width.
- P is the priority-flag. If P is set, the mapping will appear above everything else.
- CC is the palette line.
- X is the x-flip-flag. If X is set, the mapping will be flipped horizontally.
- Y is the y-flip-flag. If Y is set, the mapping will be flipped vertically.
- AAA AAAA AAAA is the tile index.
The VRAM offset specified in an object's SST will be added to the PCCY XAAA AAAA AAAA word.
References