Actions

SCHG

Sonic the Hedgehog 2 (16-bit)/Art Editing

From Sonic Retro

Revision as of 22:51, 22 July 2007 by Xenowhirl (talk | contribs) (some artunc addresses were wrong)


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 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 format.

If, however, you still want to do it yourself, your best bet is to download the Sonic 2 Split disassembly here. Decompress the archive into a new folder, and place your S2 ROM, in binary format and named "S2.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

Most of this information was taken from 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.

Offset Description # of blocks
Zone Independent
$50000 Sonic  ?
$64320 Tails  ?
$71FFC Splash  ?
$7287C Spindash 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 2/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 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, as listed by HivePal:

Name Offset
Sega Sonic $2902
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 Pallete $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 (Pallete line 1) $30C2

For details of the palette data format, see Megadrive Palettes.

Pattern Load Requests

Nemesis named this structure the "pattern load queue". However, this name tends to confuse the RAM structure (which is actually a queue) with the ROM structure (which is a set of data to be loaded into the queue).

PLRs tell the game engine where to get Nemesis-compressed art data and where to put it. The format is rather simple, and can be described with this pseudocode:

struct plr{
  long *compPattern;
  word vramStartLoc;
};

struct plrList03{
  const word plrCount = 3;
  plr plrArray[3]
} plr000;

plrCount is the length of plrArray. compPattern is a pointer to Nemesis-compressed patterns, and vramStartLoc is the VRAM address where the patterns are to be decompressed to.

The RAM queue is $60 bytes long, meaning it has space for 16 PLRs. 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 16 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 16 requests long.

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