Sonic the Hedgehog 2 (16-bit)/Art Editing
From Sonic Retro
Sonic Community Hacking Guide Sonic the Hedgehog 2 (16-bit) |
---|
Art |
Objects |
Levels |
Text |
Music |
RAM |
Miscellaneous |
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
Most of this information was taken from Nemesis' 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.
Offset | Description | # of blocks |
---|---|---|
Zone Independent | ||
$50000 | Sonic | ? |
$64320 | Tails | ? |
$71FFC | Splash | ? |
$7287C | Spin Dash smoke | ? |
$7A18A | Signpost | ? |
$7AF80 | Drowning countdown | ? |
$7CD30 | Option and level select menu background | ? |
Emerald Hill Zone | ||
$49714 | Animated flowers | ? |
$49914 | Pulsing orb on walls | ? |
Chemical Plant Zone | ||
$4FAFE | Part of background | ? |
Aquatic Ruin Zone | ||
$4FCFE | Waterfall | ? |
Casino Night Zone | ||
$4D4FE | Flipping square in foreground | ? |
$4EEFE | Slot machine pictures | ? |
Hill Top Zone | ||
$49714 | Animated flowers | ? |
$4A33E | Clouds from background | ? |
$4B73E | Lava | ? |
Mystic Cave Zone | ||
$894E4 | Rocks that fall from ceiling during boss fight | ? |
Oil Ocean Zone | ||
$49914 | Pulsing orb on walls | ? |
$4BF7E | Pulsing ball | ? |
$4C0FE | Square rotating around ball (Unknown) | ? |
$4C4FE | Oil | ? |
Metropolis Zone | ||
$4A73E | Rotating net | ? |
$4B73E | Lava | ? |
$4BD3E | Parts of background | ? |
Death Egg Zone | ||
$4FAFE | Part of background | ? |
Compressed Art Locations - Nemesis format
See SCHG:Sonic the Hedgehog 2 (16-bit)/Nemesis Compressed Art.
Compressed Art Locations - Kosinski format
- $95C24 - EHZ/HTZ main level patterns
- $9DB64 - MTZ main level patterns
- $A4204 - OOZ main level patterns
- $A9D74 - MCZ main level patterns
- $B0894 - CNZ main level patterns
- $B6174 - CPZ/DEZ main level patterns
- $BCC24 - ARZ main level patterns
- $C5004 - SCZ/WFZ main level patterns
- $DCA38 - Special stage floor patterns
Palette editing
Usually, it's not really necessary to edit a palette in hex. Palette editors such as HivePal 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 2:
Name | Offset |
---|---|
Sega Screen (Sonic, and initial colors) | $2902 |
Sega Screen 2 (background, and pre-streak logo) | $3A4A4 |
Sega Screen 3 (streaking, and post-streak logo) | $3A514 |
Title Screen (Sonic) | $133EC |
Title Screen (Tails) | $2942 |
Title Screen (Main) | $1340C |
Title Screen Water | $1E5A |
Sonic and Tails | $29E2 |
Sonic to Super Sonic | $2246 |
Super Sonic | $2276 |
Title Cards | $2A02 |
Emerald Hill | $2A22 |
Emerald Hill/Aquatic Ruin Rotating Water | $1E7A |
Wood | $2A82 |
Wood Conveyor Belts | $1F1A |
Metropolis | $2AE2 |
Metropolis Cycle #1 | $1F2A |
Metropolis Cycle #2 | $1F36 |
Metropolis Cycle #3 | $1F42 |
Wing Fortress | $2B42 |
Wing Fortress Fire Cycle | $20A2 |
Hill Top | $2BA2 |
Hill Top Lava | $1E9A |
Hidden Palace | $2C02 |
Hidden Palace (Sonic & Tails Under Water) | $2C62 |
Hidden Palace Underwater Tiles Palette | $2C82 |
Hidden Palace Water Cycle | $1F56 |
Hidden Palace Underwater Cycle | $1F66 |
Oil Ocean (Do not edit or you'll get a huge mess unless you know how to fix it!) | $2CE2 |
Oil Ocean Oil | $1F76 |
Mystic Cave | $2D42 |
Mystic Cave Lanterns | $1F86 |
Casino Night | $2DA2 |
Casino Night Cycle 1 | $1F8E |
Casino Night Cycle 2 | $1FA0 |
Casino Night Cycle 3 | $1FB2 |
Casino Night Cycle 4 | $1FC4 |
Chemical Plant | $2E02 |
Chemical Plant Sonic & Tails Underwater | $2E62 |
Chemical Plant Underwater | $2E82 |
Chemical Plant Underwater Sonic to Super Sonic | $22C6 |
Chemical Plant Underwater Super Sonic | $22F6 |
Chemical Plant Cycle 1 | $2022 |
Chemical Plant Cycle 2 | $2058 |
Chemical Plant Cycle 3 | $2082 |
Chemical Plant Cycle 4 | $20E2 |
Death Egg | $2EE2 |
Aquatic Ruin | $2F42 |
Sonic & Tails Underwater (Aquatic Ruin) | $2FA2 |
Aquatic Ruin Underwater | $2FC2 |
Sonic to Super Sonic Underwater (Aquatic Ruin) | $2346 |
Aquatic Ruin Underwater Super Sonic | $2376 |
Sky Chase | $3022 |
Menus | $30E2 |
Special Stage Main | $3162 |
Special Stage Sonic | $3182 |
Special Stage Tails | $31A2 |
Special Stage 1 | $31C2 |
Special Stage 2 | $31E2 |
Special Stage 3 | $3202 |
Special Stage 4 | $3222 |
Special Stage 5 | $3242 |
Special Stage 6 | $3262 |
Special Stage 7 | $3282 |
Special Stage 1 2p | $32A2 |
Special Stage 2 2p | $32C2 |
Special Stage 3 2p | $32E2 |
Special Stage Chaos Emerald | $35F92 |
Special Stage Results Screen | $3302 |
Emerald Hill Icon | $9880 |
Metropolis Icon | $98A0 |
Hill Top Icon | $98C0 |
Hidden Palace Icon | $98E0 |
Oil Ocean Icon | $9900 |
Mystic Cave Icon | $9920 |
Casino Night Icon | $9940 |
Chemical Plant Icon | $9960 |
Aquatic Ruin Icon | $9980 |
Sky Chase Icon | $99A0 |
Wing Fortress Icon | $99C0 |
Death Egg Icon | $99E0 |
Special Stage Icon | $9A00 |
X 2 Player Versus Icon | $9A20 |
Sound Test Icon | $9A40 |
Ending Grey Cutscenes | $AD1E |
Ending Main | $ACBE |
Ending Sonic | $AC7E |
Ending Tails | $AC9E |
Ending Super Sonic | $AD3E |
Unknown 1 | $3082 |
Unknown 2 | $30A2 |
Oil Ocean Zone Boss (Palette line 1) | $30C2 |
For details of the palette data format, see here.
Pattern load requests
PLRs tell the game engine where to get Nemesis-compressed art data and where to put it. The format is rather simple: each PLR starts off with a one-word header, which is the number of entries to load - 1. The actual entries follow this header - each entry is one longword, which is the location in ROM of the compressed art, followed by one word, which is the location in VRAM to decompress to.
The RAM queue is $60 bytes long, meaning it has space for 16 PLRs. However, a coding error in the clearing routine means that storing a PLR in the last slot screws everything up, so effectively only 15 requests can be stored at one time. Note that the routines that load PLRs into the queue do not do any bounds checking, and it is quite easy to create a buffer overrun condition. Further, both lists seem to be moved into the queue at the same time, so even if neither one is longer than 15 requests, they can still overrun the queue and destroy the variables that are stored just beyond it. Make sure that the primary and secondary PLR lists are no more than 15 requests long.
References