Difference between revisions of "Sonic the Hedgehog 2 (Nick Arcade prototype)/Technical information"
From Sonic Retro
Line 7: | Line 7: | ||
=== [[Nemesis compression|Nemesis Compressed]] Art Locations === | === [[Nemesis compression|Nemesis Compressed]] Art Locations === | ||
− | Documented by [[ICEknight]] and [[Quickman]]. | + | Documented by [[User:ICEknight|ICEknight]] and [[Quickman]]. |
{| class="prettytable" | {| class="prettytable" | ||
!Offset||Description | !Offset||Description |
Revision as of 13:32, 9 April 2018
This is the Sonic Community Hacking Guide for Sonic the Hedgehog 2 Early Prototype.
Art Editing
There are several different tools that can be used to edit art. SonED2 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. SonMapEd is useful for editing both art and mappings - it can extract data from either a ROM or use split binary files, and has internal compression/decompression support. Flex 2 is a more recent art and mapping editor that supports importing, exporting as well as directly editing art.
Uncompressed Art Locations
Nemesis Compressed Art Locations
Documented by ICEknight and Quickman.
Offset | Description |
---|---|
$9DF8E | Shield |
$9E114 | Invincibility stars |
$A0960 | SEGA logo |
$A1520 | Title Screen graphics |
$A2E82 | Sonic & Tails at the Title Screen |
$A39C6 | GHZ bit of flower (S1) |
$A3A10 | GHZ & MZ platform with chain (S1) |
$A3B2A | EHZ Log bridge |
$A3C16 | Unused 16x16 block (S1) |
$A3C5E | GHZ rolling ball (S1) |
$A3DFC | GHZ rolling log with spikes (S1) |
$A4010 | GHZ unused spikes around the rolling log (S1) |
$A413C | GHZ rock (S1) |
$A426A | GHZ breakable wall (S1) |
$A4308 | Some GHZ wall (S1) |
$A4368 | Unknown fire |
$A44A0 | Unused, possible burning log |
$A45AE | Waterfall |
$A46B4 | Unused HTZ fireballs |
$A4802 | GHZ Log bridge (S1) |
$A48DA | HTZ crossing platform |
$A4BCE | HTZ automatic door |
$A4C46 | HTZ seesaw with green ball |
$A4DDE | HPZ bridge |
$A4F56 | HPZ waterfalls |
$A52B8 | HPZ big emerald |
$A552A | HPZ ledge artwork |
$A55EA | HPZ glowing orb |
$A5826 | Some platform |
$A59C0 | Unknown unused dust |
$A5AE0 | CPZ floating platform |
$A5C2E | Water surface |
$A5D9E | Button |
$A5E76 | Vertical spring |
$A5F92 | Horizontal spring |
$A605C | Diagonal springs |
$A6230 | Score/Rings/Time HUD |
$A6338 | Lives HUD |
$A644E | Rings |
$A6542 | Monitors |
$A696C | Vertical spikes |
$A69BC | Gathered points |
$A6A96 | Prototype checkpoint |
$A6B3C | Prototype end of level sign |
$A6F8A | Crocodile |
$A732C | EHZ Buzz Bomber |
$A7512 | HPZ Bat |
$A7868 | OOZ Octopus |
$A7B88 | Triceratops |
$A7F84 | HPZ Dinobot |
$A835A | Unused sideways piranha |
$A8852 | OOZ Prototype seahorses |
$A8CA0 | Unused rolling ball |
$A8F36 | Unused Mother Bubbler |
$A9162 | Unused Bubbler |
$A9384 | EHZ Snail |
$A9580 | Prototype Crawler |
$A9902 | EHZ Piranha |
$A9B0E | Boss ship |
$AA24A | CPZ Prototype boss |
$AA7A8 | Big explosion |
$AAE30 | Robotnik's ship boost |
$AAEAE | Puff of smoke |
$AAF94 | EHZ Boss |
$AB780 | EHZ Boss helicopter blades |
$AB874 | SBZ Ball Hog (S1) |
$ABC34 | Crabmeat |
$AC122 | GHZ Buzz Bomber (S1) |
$AC4C8 | Possible unknown explosion from the ground |
$AC6B0 | LZ Burrobot (S1) |
$ACD9A | GHZ Piranha (S1) |
$AD002 | LZ Jaws (S1) |
$AD28C | SYZ Roller (S1) |
$AD7B0 | GHZ Motobug (S1) |
$ADA3A | GHZ Newtron (S1) |
$AE058 | SYZ Snail (S1) |
$AE440 | MZ Bat (S1) |
$AE73C | Splats (S1) |
$AE984 | SLZ Bomb (S1) |
$AEC1C | LZ Orbinaut (S1) |
$AEDFA | MZ Catakiller (S1) |
$AEF88 | Title card (S1) |
$AF596 | Explosions |
$AFBFC | GAME OVER, TIME OVER |
$AFD8E | Vertical spring |
$AFE90 | Sideways spring |
$AFF6C | Big ring flash |
$B00E0 | End of level hidden bonuses (S1) |
$B03E2 | Sonic at Continue screen + Continue star (S1) |
$B0692 | CONTINUE + Minisonic (S1) |
$B08CC | Bunny |
$B0A24 | Chicken |
$B0B80 | Penguin |
$B0CFC | Seal |
$B0E18 | Pig |
$B0F4E | Flicky |
$B1088 | Squirrel |
$B2184 | EHZ graphics |
$B5784 | HTZ graphics |
$B6BAA | HTZ placeholders for animated tiles |
$C0492 | HPZ graphics |
$C31A0 | HPZ glowing orbs |
$CC8F4 | CPZ graphics |
$CFDC0 | Unknown |
$D8C34 | GHZ graphics (S1) |
$DC1F0 | GHZ graphics (S1) |
$E0B62 | Ending scene additional graphics (S1) |
$E0DEA | Credits font (S1) |
$E13E8 | SONIC THE HEDGEHOG ending text (S1) |
Kosinski Compressed Art Locations
Palette Editing
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 desirable 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 the Hedgehog 2 Early Prototype:
Offset | Description |
---|---|
$245A | SEGA Foreground |
$25A2 | SEGA Background |
$2622 | Title Screen |
$26A2 | Level Select |
$2722 | Sonic and Tails |
$2742 | Green Hill Zone |
$27A2 | ??? |
$2822 | Chemical Plant Zone |
$2840 | ??? |
$2882 | Emerald Hill Zone |
$28E2 | Hidden Palace Zone |
$2942 | Hill Top Zone |
$29A2 | (Sonic again?) (Maybe the special stage Sonic) |
$2A22 | Labyrinth Zone |
$2A82 | Scrap Brain Zone Act 3 |
$2B02 | Labyrinth Zone Sonic Underwater |
$2B22 | Scrap Brain Zone Act 3 Sonic Underwater |
$2B42 | Special Stage Title Card (S1) |
$2BC2 | Continue - Sonic (S1) |
$2BE2 | Continue (S1) |
$2C02 | Sonic - Ending (S1) |
Pattern Load Requests
PLRs are what load all the peices of art into the VRAM that are not in the main level load block. Here's a breakdown of the pattern load cue's in the S2 Alpha ROM:
00 | 1C09C | Standard block 1 (checkpoint/HUD/life counter/ring/gathered points) | (4) |
01 | 1C0BC | Standard block 2 (Monitor/Shield/Invincibility stars) | (2) |
02 | 1C0D0 | Unknown (explosion) | (0) |
03 | 1C0D8 | Game/time over (game/time over text) | (0) |
04 | 1C0E0 | GHZ (GHZ patterns/GHZ Piranha/Vertical spikes/Vertical spring/Horrizontal spring/EHZ Log bridge/GHZ swinging platform/Motobug/GHZ Rock) | (8) |
05 | 1C118 | GHZ (GHZ Piranha) | (0) |
06 | 1C120 | LZ (CPZ DUPLICATE) | (2) |
07 | 1C134 | LZ (CPZ DUPLICATE) | (3) |
08 | 1C120 | CPZ (CPZ graphics/Unknown/floating platform) | (2) |
09 | 1C134 | CPZ (Vertical spikes/Diagonal springs/Vertical spring/Horizontal spring) | (3) |
0A | 1C14E | EHZ (EHZ graphics/Fireball/Waterfall/GHZ bridge/HTZ seesaw/Vertical spikes/Diagonal springs/Vertical spring/Horizontal spring) | (8) |
0B | 1C186 | EHZ (Shield/Gathered points/Buzz Bomber/EHZ Snail/EHZ Piranha) | (4) |
0C | 1C1A6 | HPZ (HPZ graphics/HPZ bridge/waterfall/platform/pulsing ball/HPZ stuff/master emerald/Water surface) | (7) |
0D | 1C1D8 | HPZ (HPZ Dinobot/HPZ Bat/Crocodile/Buzz Bomber/HPZ Bat/Triceratops/Dinobot/Sideways piranha | (1)[7] |
0E | 1C20A | HTZ (EHZ graphics/HTZ graphics/HTZ placeholders for animated tiles/Fire/Fireballs/HTZ automatic door/GHZ Log bridge/HTZ seesaw/Vertical spikes/Diagonal springs/Vertical spring/Horizontal spring) | (9) |
0F | 1C254 | HTZ (HTZ lift/Buzz Bomber/EHZ Snail/EHZ Piranha) | (0) [4] |
10 | 1C26E | ??? (Title card (S1)/) | (0) |
11 | 1C276 | Boss (Boss ship/EHZ Boss/EHZ Boss helicopter blades/Boss ship/CPZ Prototype boss/Robotnik's ship boost/Puff of smoke/EHZ Boss/EHZ Boss helicopter blades) | (2)[8] |
12 | 1C2AE | End of level (Signpost/End of level hidden bonuses (S1)/Big ring flash) | (2) |
13 | 1C2C2 | ??? (INVALID) | (10) |
14 | 1C2C2 | ??? (INVALID) | (10) |
15 | 1C2C4 | GHZ Animals (Bunny/Flicky) | (1) |
16 | 1C2D2 | LZ Animals (Penguin/Seal) | (1) |
17 | 1C2E0 | CPZ Animals (Squirrel/Seal) | (1) |
18 | 1C2EE | EHZ Animals (Pig/Flicky) | (1) |
19 | 1C2FC | HPZ Animals (Pig/Chicken) | (1) |
1A | 1C30A | HTZ Animals (Bunny/Chicken) | (1) |
1B | 1C318 | ??? (INVALID) | (NA) |
1C | 1C31A | ??? (INVALID) | (NA) |
1D | 1C31C | ??? (INVALID) | (NA) |
1E | 1C31E | ??? (INVALID) | (NA) |
1F | 1C320 | ??? (INVALID) | (NA) |
Object Editing
Object Pointers
The object pointers are located at $CB7E. Objects in this list are loaded by referencing their ID (starting from 01). Mainly used by level object layout and debug object lists. Each ID uses 4 bytes, which are 32-bit absolute pointers to the start of programming (ASM code) of a certain object.
ID | Offset | Description | Intended place/Owner/Source |
---|---|---|---|
$01 | $F9FC | Sonic | Any zone |
$02 | $10C40 | Tails | Any zone |
$03 | $13E2C | Collision switcher | Any zone |
$04 | $154D4 | Water surface | Water zones |
$05 | $11D7E | Tails' tails | Tails only |
$06 | $14970 | Spiral path | EHZ |
$07 | $CDAE | Null object | Anywhere |
$08 | $12558 | Water splash | Sonic |
$09 | $1A3B8 | Sonic | Special Stage |
$0A | $11E64 | Underwater bubbles | Water zones |
$0B | $141B4 | Unused alternating platform | CPZ |
$0C | $142DC | Unused strange platform | ??? |
$0D | $EF9C | End of level signpost | Any zone |
$0E | $B378 | Sonic & Tails | Title screen |
$0F | $B3FE | ??? | Title screen? |
$10 | $1AA5A | ??? | ??? |
$11 | $7BA0 | Block bridge | GHZ, HPZ, EHZ |
$12 | $143DC | Emerald block | HPZ |
$13 | $14458 | Waterfall | HPZ |
$14 | $14CA0 | Seesaw | HTZ |
$15 | $8204 | Swinging platform | GHZ |
$16 | $15104 | Diagonally moving platform | HTZ |
$17 | $866C | Rotating spike on wooden bridge | GHZ |
$18 | $880C | Generic natural platform | GHZ, EHZ, HTZ |
$19 | $152B8 | Metal platform | CPZ |
$1A | $8C44 | Collapsing platform | GHZ, HPZ |
$1B | $CDAE | Null object | Anywhere |
$1C | $93A4 | Bridge support/Moving platform support | GHZ, EHZ, HTZ |
$1D | $CDAE | Null object | Anywhere |
$1E | $CDAE | Null object | Anywhere |
$1F | $A0D0 | Crabmeat (badnik) | GHZ |
$20 | $CDAE | Null object | Anywhere |
$21 | $1B028 | HUD | Any zone |
$22 | $A408 | Buzz Bomber (badnik) | GHZ |
$23 | $A55E | Buzz Bomber's projectile | Buzz Bomber |
$24 | $9808 | Unknown explosion | ??? |
$25 | $A7E4 | Ring | Debug |
$26 | $AE58 | Monitor | Any zone |
$27 | $987C | Dust explosion | Any zone |
$28 | $9AA8 | Animal plus points from badnik explosion | Any zone |
$29 | $9FA0 | Points | Any zone |
$2A | $94EC | One way barrier | SBZ |
$2B | $B718 | Chopper (badnik) | GHZ |
$2C | $B7DE | Jaws (badnik) | LZ |
$2D | $CDAE | Null object | Anywhere |
$2E | $B03A | Monitor contents | Monitor |
$2F | $CDAE | Null object | Anywhere |
$30 | $CDAE | Null object | Anywhere |
$31 | $CDAE | Null object | Anywhere |
$32 | $CDAE | Null object | Anywhere |
$33 | $CDAE | Null object | Anywhere |
$34 | $B8C8 | Title card | Title card |
$35 | $CDAE | Null object | Anywhere |
$36 | $C664 | Spikes | Any zone |
$37 | $A91E | Ring spray | Any zone |
$38 | $123BA | Blue shield | Any zone |
$39 | $BA84 | Game Over/Time Over | Any zone |
$3A | $BB46 | End of level result screen | Any zone |
$3B | $C848 | Purple rock | GHZ |
$3C | $C8C4 | Breakable wall | GHZ |
$3D | $18CFC | Robotnik | Any zone |
$3E | $194E4 | Egg prison | Any zone |
$3F | $9914 | Fire explosion | Any zone |
$40 | $F248 | Motobug (badnik) | GHZ |
$41 | $E1C8 | Spring | Any zone |
$42 | $EBB8 | Newtron (badnik) | GHZ |
$43 | $CDAE | Null object | Anywhere |
$44 | $EEB4 | Wall barrier | GHZ |
$45 | $CDAE | Null object | Anywhere |
$46 | $CDAE | Null object | Anywhere |
$47 | $CDAE | Null object | Anywhere |
$48 | $190E6 | Big ball | GHZ boss |
$49 | $15690 | Waterfall | EHZ |
$4A | $16AA0 | Octus (badnik) | HPZ |
$4B | $16794 | Buzzer (badnik) | EHZ (HPZ, HTZ) |
$4C | $16D50 | Batbot (badnik) | HPZ |
$4D | $1587C | Tricerabot (badnik) | HPZ |
$4E | $171D8 | Crocobot (badnik) | HPZ |
$4F | $15DA4 | Dinobot (badnik) | HPZ |
$50 | $15F08 | "Strange" Aquis (badnik) | HPZ |
$51 | $16524 | Aquis (badnik) | HPZ |
$52 | $15B4C | Piranha (badnik) | HPZ |
$53 | $174D0 | Masher (badnik) | EHZ |
$54 | $175D0 | Snailbot (badnik) | EHZ (HTZ) |
$55 | $181CC | ??? | ??? |
$56 | $18456 | Unknown double explosion | ??? |
$57 | $17884 | ??? | ??? |
$58 | $17AEE | ??? | ??? |
$59 | $CDAE | Null object | Anywhere |
$5A | $CDAE | Null object | Anywhere |
$5B | $CDAE | Null object | Anywhere |
$5C | $CDAE | Null object | Anywhere |
$5D | $CDAE | Null object | Anywhere |
$5E | $CDAE | Null object | Anywhere |
$5F | $CDAE | Null object | Anywhere |
$60 | $CDAE | Null object | Anywhere |
$61 | $CDAE | Null object | Anywhere |
$62 | $CDAE | Null object | Anywhere |
$63 | $CDAE | Null object | Anywhere |
$64 | $CDAE | Null object | Anywhere |
$65 | $CDAE | Null object | Anywhere |
$66 | $CDAE | Null object | Anywhere |
$67 | $CDAE | Null object | Anywhere |
$68 | $CDAE | Null object | Anywhere |
$69 | $CDAE | Null object | Anywhere |
$6A | $CDAE | Null object | Anywhere |
$6B | $CDAE | Null object | Anywhere |
$6C | $CDAE | Null object | Anywhere |
$6D | $CDAE | Null object | Anywhere |
$6E | $CDAE | Null object | Anywhere |
$6F | $CDAE | Null object | Anywhere |
$70 | $CDAE | Null object | Anywhere |
$71 | $CDAE | Null object | Anywhere |
$72 | $CDAE | Null object | Anywhere |
$73 | $CDAE | Null object | Anywhere |
$74 | $CDAE | Null object | Anywhere |
$75 | $CDAE | Null object | Anywhere |
$76 | $CDAE | Null object | Anywhere |
$77 | $CDAE | Null object | Anywhere |
$78 | $CDAE | Null object | Anywhere |
$79 | $134C8 | Lamppost | Any zone |
$7A | $CDAE | Null object | Anywhere |
$7B | $CDAE | Null object | Anywhere |
$7C | $CDAE | Null object | Anywhere |
$7D | $13770 | Hidden bonus | Any zone |
$7E | $CDAE | Null object | Anywhere |
$7F | $CDAE | Null object | Anywhere |
$80 | $CDAE | Null object | Anywhere |
$81 | $CDAE | Null object | Anywhere |
$82 | $CDAE | Null object | Anywhere |
$83 | $CDAE | Null object | Anywhere |
$84 | $CDAE | Null object | Anywhere |
$85 | $CDAE | Null object | Anywhere |
$86 | $CDAE | Null object | Anywhere |
$87 | $CDAE | Null object | Anywhere |
$88 | $CDAE | Null object | Anywhere |
$89 | $CDAE | Null object | Anywhere |
$8A | $185E0 | Sonic Team Presents/Credits | Title screen/Ending sequence |
$8B | $CDAE | Null object | Anywhere |
$8C | $CDAE | Null object | Anywhere |
Unreferenced Objects
The following objects can occupy a valid slot in order to work on their own instead of being summoned by their respective owners:
- Metal platform's collision mask: $152F0.
- Aquis' shot (inoffensive): $165AA.
- Buzzer's shot: $168A0.
The following objects are not summoned by any other object or event and can occupy a valid slot in order to work:
- Giant ring: $AA72.
- Flash from giant ring: $AB3C.
Sprite Mappings
Dynamic PLCs
Text Editing
Level Select Text Editing
Level names use non-ASCII characters. You need to know the letter code to modify the name. See the table below and change the names.
00 = 0 | 01 = 1 | 02 = 2 | 03 = 3 | 04 = 4 |
05 = 5 | 06 = 6 | 07 = 7 | 08 = 8 | 09 = 9 |
0A = $ | 0B = - | 0C = = | 0D = <- | 0E = <- |
0F = Y | 10 = Z | 11 = A | 12 = B | 13 = C |
14 = D | 15 = E | 16 = F | 17 = G | 18 = H |
19 = I | 1A = J | 1B = K | 1C = L | 1D = M |
1E = N | 1F = O | 20 = P | 21 = Q | 22 = R |
23 = S | 24 = T | 25 = U | 26 = V | 27 = W |
28 = X | FF = (space) |
Miscellaneous
Offset | Description |
---|---|
$035A8 | Level order information |
$02502 | Palette pointers |
$035A8 | Level select level order |
$04620 | Pointer to collision indexes |
$0579A | Level size array |
$059C6 | Rasterized layer Deformation offset index |
$10AF8 | Animation script (Sonic) |
$1BFEC | Main level load block |
$1C05C | Pattern load cues offset index |
$1C09C | Pattern load cues |
$20000 | Curve and resistance mapping (identical to S1) |
$20100 | Curve and resistance mapping |
$20200 | Collision Array (identical to S1) |
$22200 | Collision Array |
$28218 | Level layout offset index |
$40000 | Object layout offset index |
$50000 | Ring location offset index |
Level Slots
Level ID | Level Name |
---|---|
00 | GHZ |
01 | LZ (loads CPZ art) |
02 | CPZ (MZ Music) |
03 | EHZ (SLZ music) |
04 | HPZ (SYZ music) |
05 | HTZ (SBZ music) |
06 | Ending (GHZ art) (crashes) |
Main Level Load Block
This is located at $1BFEC, and uses the Sonic 1 format
Level ID | Level Name | 8x8 art | 16x16 mappings | 128x128 mappings | Palette | Song ID | PLRs used |
---|---|---|---|---|---|---|---|
00 | GHZ | $D8C34 | $D7E34 | $DD850 | $04 | $81 | $04, $05 |
01 | LZ | $CC8F4 | $CB314 | $CFE34 | $05 | $82 | $06, $07 |
02 | CPZ | $CC8F4 | $CB314 | $CFE34 | $06 | $83 | $08, $09 |
03 | EHZ | $B2184 | $B11E4 | $B6EB2 | $07 | $84 | $0A, $0B |
04 | HPZ | $C0492 | $BEEB2 | $C3314 | $08 | $85 | $0C, $0D |
05 | HTZ | $B2184 | $B11E4 | $B6EB2 | $09 | $86 | $0E, $0F |
06 | Ending | $D8C34 | $D7E34 | $DD850 | $13 | $86 | None |
Debug Object Lists
These lists are used to tell the game which objects can be placed through debug mode at each zone. They are handled by an offset index at $1BCEC.
List location | Used by |
---|---|
$1BCFA | GHZ |
$1BD6C | LZ |
$1BD6C | CPZ |
$1BDEE | EHZ |
$1BF6A | HPZ |
$1BED0 | HTZ |
$1BF6A | Ending |
The first two bytes on the list indicate how many objects are there. Each object has 8 bytes: for simply changing which object should appear instead of another, edit bytes 1 & 5, which are object type (ID) and sub-type, respectively.