Actions

SCHG

Difference between revisions of "Chaotix"

From Sonic Retro

(Art Pointers)
m (Text replacement - "Genesis" to "Mega Drive")
 
(154 intermediate revisions by 9 users not shown)
Line 1: Line 1:
This is the [[Knuckles' Chaotix]] portion of the [[Sonic Community Hacking Guide]].
+
{{back}}
  
==About this Guide==
+
==About ROM addresses==
 +
The 32X remaps the main Mega Drive 68000 memory space to suit its needs (for example, to provide framebuffer access to the 68000) and maps the SH-2 memory space (shared by both SH-2s) in a particular way. Because of this, game addresses may appear weird when being viewed directly. Furthermore, the 68000 remapping doesn't allow the full 4 MB ROM to be accessed, so the ROM needs to be banked. Fortunately, Chaotix only uses one of these ROM banks throughout the entire game, making locating data easy. The SH-2s do have full access to the ROM.
  
I'm Lostgame, and I'm obsessed with Chaotix. It simply has to be the greatest Sonic-related game I've ever played. And it's not just the amazing 32-bit graphics, with  real rotation and scaling, it's the original gameplay, the amazing music, and the general fun involved. So strap yourself in, and get ready for the most fun you've ever had hacking a Sonic game.
+
On the 68000 side, an address between $880000 and $8FFFFF inclusive is mapped to ROM $0..$7FFFF; this cannot be swapped out and is used for game code. If you encounter an address like this, simply subtract $880000 to get the original ROM address. An address between $900000 and $9FFFFF inclusive is banked. Chaotix uses ROM bank 2 (indexing from 0), which is defined between $200000 and $2FFFFF inclusive, so simply subtract $700000 to get the ROM address.
  
==MD Palettes==
+
On the SH-2 side, the cartridge can be accessed either between $02000000 and $022FFFFF inclusive or between $22000000 and $222FFFFF inclusive (Chaotix is only 3 MB so there is nothing above $02300000/$22300000). The former is used in the actual SH-2 code, the latter in SH-2 data. Simply take off that uppermost byte to get the physical address.
  
One thing that shocked me, when I was looking through the ROM for palettes was that the standard levels actually only use the Genesis colors, as beautiful as they are! Well, so, as you most likely already know, if you're here, the format for most Genesis palettes is:
+
For simplicity, this page will use physical ROM addresses.
  
0B-GR
+
==Pointer lists==
 +
===Normal data pointers===
 +
These lists are just lists of addresses.
  
The first character, I dunno what it's for. If you put something there it's either ignored, or causes an error, depends on the game, and the level, whatever.
+
{| class="prettytable" style="width: auto;"
The second, third and fourth characters are the Blue, Green and Red values, accordingly.
+
! ROM Address||Description
 +
|-
 +
|$2275FA
 +
|Demo data
 +
|}
 +
 
 +
===Base offset pointer lists===
 +
These lists consist of a series of words which describe offsets from a common base. These usually look like
 +
<blockquote><pre>Data: dc.w FirstData-Data
 +
    dc.w SecondData-Data
 +
    dc.w ThirdData-Data
 +
    ;...</pre></blockquote>
 +
{| class="prettytable" style="width: auto;"
 +
! Rom Address||Description
 +
|-
 +
|$7F638
 +
|32X character palettes for special stages. Each palette is $12 words long.
 +
|}
 +
 
 +
===Level data pointers===
 +
''Knuckles' Chaotix'' uses lists of pointers to get level data. On the 68000 side, these lists come in two forms:
 +
* Triple indirection - At the given address is a list of pointers corresponding to the current level. At each address in that list is a list of pointers corresponding to stage numbers. At each address in this new list is a list of addresses corresponding to the time of day, whose entries point to the actual data. For instance:
 +
<blockquote><pre>    dc.l BotanicBaseData
 +
    dc.l SpeedSliderData
 +
    ; ...
 +
BotanicBaseData:
 +
    dc.l BB1Data
 +
    dc.l BB2Data
 +
    ; ...
 +
BB1Data:
 +
    dc.l pBB1MData
 +
    dc.l pBB1DData
 +
    dc.l pBB1SData
 +
    dc.l pBB1NData
 +
BB2Data:
 +
    ; ...
 +
pBB1MData: dc.l BB1MData
 +
pBB1DData: dc.l BB1DData
 +
    ; ...
 +
BB1MData: ; ...</pre></blockquote>
 +
* Offset lists - The pointers are represented as jump tables are represented (a list of words describing offsets), except this time, the offsets are from the address of each word, and not from a master address. These lists take the form
 +
<blockquote><pre>zone 0 stage 0 morning
 +
zome 0 stage 0 day
 +
zone 0 stage 0 sunset
 +
zone 0 stage 0 night
 +
zone 0 stage 1 morning
 +
zone 0 stage 1 day
 +
...
 +
zone 0 stage 6 sunset
 +
zone 0 stage 6 night
 +
zone 1 stage 0 morning
 +
...</pre></blockquote>
 +
:Some assume the zone, and therefore take this format:
 +
<blockquote><pre>stage 0 morning
 +
stage 0 day
 +
stage 0 sunset
 +
stage 0 night
 +
stage 1 morning
 +
stage 1 day
 +
...
 +
stage 6 sunset
 +
stage 6 night</pre></blockquote>
 +
 
 +
{| class="prettytable" style="width: auto;"
 +
! ROM Address||List Format||Description
 +
|-
 +
|$4EEA
 +
|Triple indirection
 +
|Object positions. Each list of object positions consists of four word entries:
 +
dc.w ''x position'', ''y position'', ''object type'', ''object subtype''
 +
The list ends with a single $FFFF.
 +
|-
 +
|$22E584
 +
|Offset list
 +
|Level art. Each entry is a list of pointers that end in $FFFFFFFF. A value of 0 denotes the end of foreground tiles and the beginning of background tiles; Marina Madness and Isolated Island hold both foreground and background tiles together.
 +
|-
 +
|$22E974
 +
|Offset list
 +
|Level mappings. At each pointed address is a list of addresses. If the uppermost byte of the address is $01, stop processing this specific type of mapping (16x16 primary, 16x16 secondary, 128x128 primary, 128x128 secondary). If the first byte is $03, stop processing all of this type of mapping (16x16 or 128x128).
 +
16x16 primary (as many as needed until $01 or $03)
 +
16x16 secondary (as many as needed until $01, only if not $03)
 +
128x128 primary (as many as needed until $01 or $03)
 +
128x128 secondary (as many as needed until $01, only if not $03)
 +
level layout (exactly one)
 +
unknown (exactly one)
 +
|-
 +
|$22F1AC
 +
|Offset list
 +
|Level collision data pointers.
 +
|-
 +
|$2B32B0
 +
|Offset list
 +
|Mega Drive format level palettes.
 +
|-
 +
|$2B4B74
 +
|Offset list
 +
|Level boundaries. Each entry points to a list of addresses of the form
 +
dc.l ''foreground bounds''
 +
dc.l ''background bounds''
 +
dc.l $FFFFFFFF
 +
At the address of the foreground bounds is a list of the form
 +
dc.w (unknown)
 +
dc.w (unknown, possibly starting Y position of player)
 +
dc.b ''width of level in 128x128 chunks''
 +
dc.b ''height of level in 128x128 chunks''
 +
dc.w ''rightmost X position where camera will stop scrolling''
 +
dc.w (unknown, possibly always 0)
 +
dc.w ''bottommost Y position where camera will stop scrolling''
 +
dc.w (unknown, possibly always 0)
 +
The background bounds's format is unknown, but follows the same byte structure as above.
 +
|-
 +
|$2B61FA
 +
|Offset list, zone assumed
 +
|Amazing Arena lit palettes.
 +
|}
  
Here is a list of the palettes that I know of in Chaotix
+
==Palette locations==
that use the Genesis palette format:
+
===Mega Drive format===
{| border="1"
+
{| class="prettytable" style="width: auto;"
 
! Palette Offset||Description
 
! Palette Offset||Description
 
|-
 
|-
|2b3CF0,40
+
|$003A60
|Amazing Arena - Morning / Day
+
|Title Screen road and sides
 +
|-
 +
|$005AA2
 +
|Special Stage background
 +
|-
 +
|$0066C8
 +
|Credits - Flames
 +
|-
 +
|$006E18
 +
|Sound Test - Foreground
 +
|-
 +
|$006E98
 +
|Sound Test - Amy
 +
|-
 +
|$03E8CA
 +
|Data Load screen
 
|-
 
|-
|2b3D70,40
+
|$2B3470
|Amazing Arena - Sunset / Night
+
|Botanic Base Stages 1-3 - Morning
 
|-
 
|-
|2b3EF0,40
+
|$2B34F0
|Techno Tower - Morning
+
|Botanic Base Stages 1-3 - Day
 
|-
 
|-
|2b4070,40
+
|$2B3570
|Techno Tower - Day
+
|Botanic Base Stages 1-3 - Sunset
 
|-
 
|-
|2b41F0,40
+
|$2B35F0
|Techno Tower - Sunset
+
|Botanic Base Stages 1-3 - Night
 
|-
 
|-
|2b42F0,40
+
|$2B3670
|Techno Tower - Night
+
|Botanic Base Stage 4 - Morning
 
|-
 
|-
|2b4470,40
+
|$2B36F0
 +
|Botanic Base Stage 4 - Day
 +
|-
 +
|$2B3770
 +
|Botanic Base Stage 4 - Sunset
 +
|-
 +
|$2B37F0
 +
|Botanic Base Stage 4 - Night
 +
|-
 +
|$2B3870
 +
|Botanic Base Stage 5 - Morning
 +
|-
 +
|$2B38F0
 +
|Botanic Base Stage 5 - Day
 +
|-
 +
|$2B3970
 +
|Botanic Base Stage 5 - Sunset
 +
|-
 +
|$2B39F0
 +
|Botanic Base Stage 5 - Night
 +
|-
 +
|$2B3A70
 +
|Speed Slider - Morning
 +
|-
 +
|$2B3AF0
 +
|Speed Slider - Day
 +
|-
 +
|$2B3B70
 +
|Speed Slider Stages 1 and 2 - Sunset
 +
|-
 +
|$2B3BF0
 +
|Speed Slider Stages 3-5 - Sunset
 +
|-
 +
|$2B3C70
 +
|Speed Slider - Night
 +
|-
 +
|$2B3CF0
 +
|Amazing Arena Stages 1 and 2 - Morning/Day - Unlit
 +
|-
 +
|$2B3D70
 +
|Amazing Arena Stages 1 and 2 - Sunset/Night - Unlit
 +
|-
 +
|$2B3DF0
 +
|Amazing Arena Stages 3 and 4 - All - Unlit
 +
|-
 +
|$2B3E70
 +
|Amazing Arena Stage 5 - All - Unlit
 +
|-
 +
|$2B3EF0
 +
|Techno Tower Stages 1 and 2 - Morning
 +
|-
 +
|$2B3F70
 +
|Techno Tower Stages 3 and 4 - Morning
 +
|-
 +
|$2B3FF0
 +
|Techno Tower Stage 5 - Morning
 +
|-
 +
|$2B4070
 +
|Techno Tower Stages 1 and 2 - Day
 +
|-
 +
|$2B40F0
 +
|Techno Tower Stages 3 and 4 - Day
 +
|-
 +
|$2B4170
 +
|Techno Tower Stage 5 - Day
 +
|-
 +
|$2B41F0
 +
|Techno Tower Stages 1-4 - Sunset
 +
|-
 +
|$2B4270
 +
|Techno Tower Stage 5 - Sunset
 +
|-
 +
|$2B42F0
 +
|Techno Tower Stages 1 and 2 - Night
 +
|-
 +
|$2B4370
 +
|Techno Tower Stages 3 and 4 - Night
 +
|-
 +
|$2B43F0
 +
|Techno Tower Stage 5 - Night
 +
|-
 +
|$2B4470
 
|Marina Madness - Morning
 
|Marina Madness - Morning
 
|-
 
|-
|2b44F0,40
+
|$2B44F0
 
|Marina Madness - Day
 
|Marina Madness - Day
 
|-
 
|-
|2b4570,40
+
|$2B4570
 
|Marina Madness - Sunset
 
|Marina Madness - Sunset
 
|-
 
|-
|2b45F0,40
+
|$2B45F0
 
|Marina Madness - Night
 
|Marina Madness - Night
 
|-
 
|-
|2b4670,40
+
|$2B4670
|Introduction - Morning
+
|Isolated Island - Morning
 +
|-
 +
|$2B46F0
 +
|Isolated Island - Day
 +
|-
 +
|$2B4770
 +
|Isolated Island - Sunset
 +
|-
 +
|$2B47F0
 +
|Isolated Island - Night
 +
|-
 +
|$2B4870
 +
|Practice Mode
 +
|-
 +
|$2B48F0
 +
|World Entrance (First Screen) - Morning
 +
|-
 +
|$2B4970
 +
|World Entrance (First Screen) - Day
 +
|-
 +
|$2B49F0
 +
|World Entrance (First Screen) - Sunset
 
|-
 
|-
|2b46F0,40
+
|$2B4A70
|Introduction - Day
+
|World Entrance (First Screen) - Night
 
|-
 
|-
|2b4770,40
+
|$2B6232
|Introduction - Sunset
+
|Amazing Arena Stages 1 and 2 - Morning - Lit
 
|-
 
|-
|2b47F0,40
+
|$2B62B2
|Introduction - Night
+
|Amazing Arena Stages 3 and 4 - Morning - Lit
 
|-
 
|-
|0066c8,24
+
|$2B6332
|Credits - Flames
+
|Amazing Arena Stage 5 - Morning - Lit
 +
|-
 +
|$2B63B2
 +
|Amazing Arena Stages 1 and 2 - Day - Lit
 +
|-
 +
|$2B6432
 +
|Amazing Arena Stages 3 and 4 - Day - Lit
 +
|-
 +
|$2B64B2
 +
|Amazing Arena Stage 5 - Day - Lit
 +
|-
 +
|$2B6532
 +
|Amazing Arena Stages 1 and 2 - Sunset - Lit
 +
|-
 +
|$2B65B2
 +
|Amazing Arena Stages 3 and 4 - Sunset - Lit
 +
|-
 +
|$2B6632
 +
|Amazing Arena Stage 5 - Sunset - Lit
 +
|-
 +
|$2B66B2
 +
|Amazing Arena Stages 1 and 2 - Night - Lit
 
|-
 
|-
|006e18,40
+
|$2B6732
|Sound Test - Foreground
+
|Amazing Arena Stages 3 and 4 - Night - Lit
 
|-
 
|-
|006E98,10
+
|$2B67B2
|Sound Test - Amy
+
|Amazing Arena Stage 5 - Night - Lit
 
|}
 
|}
  
==MARS Palettes==
+
===MARS format===
 
+
{| class="prettytable" style="width: auto;"
Now, you may say "Oh, great! Now I can change the palettes in the levels, but what I really wanted to do was change Mighty's palette to look like Sonic!
 
 
 
Alright. You can do that, but this is the tricky part. As you can imagine, the 32x uses it's own palette format that has been dubbed/officially called(?) the MARS format. Why?
 
Simply because MARS was a prototype name for the 32x. Or the Super 32x in Japan. Anywho, this format is different and very confusing. Let's take a look.
 
 
 
XB+(brightness G, max blue value is C)GR<br/>
 
//I only made that mark on the first line to help you <br/>
 
//understand it better. It still applies to the other<br/>
 
//two characters.<br/>
 
 
 
 
 
Wow. Another 2-byte format. Well, what do the characters represent? Let's see. For the Blue value, the character to edit is the second one, but the first character controls the
 
brightness, for a nicer effect. The brightness of the blue can be a max of 7, and, of course, a min of 0. But if it's 0, you get no blue. The maximum blue value is C, or it starts affecting the green. The green is the same, but instead of the first character affecting the brightness, the second one does. So, a value from C-F refers to the brightness of the green. The limit of the green value is E. Leaving Red as our last color, with a max value of F, and you can change the green to F if you like.
 
 
 
Voila. Now for the offsets.
 
 
 
{| border="1"
 
 
! Palette Offset||Description
 
! Palette Offset||Description
 
|-
 
|-
|0022921A
+
|$00001924
 +
|HUD (similar to Sonic and Tails's palette in ''[[Sonic Crackers]]'')
 +
|-
 +
|$0000E7C4
 +
|Espio's Rotating Palette
 +
|-
 +
|$0022921A
 
|Mighty The Armadillo
 
|Mighty The Armadillo
 
|-
 
|-
|0022923E
+
|$0022923E
 
|Knuckles The Echidna
 
|Knuckles The Echidna
 
|-
 
|-
|0022927E
+
|$0022925C
 +
|Charmy The Bee
 +
|-
 +
|$0022927E
 
|Vector The Crocodile
 
|Vector The Crocodile
 
|-
 
|-
|0022925C
+
|$002292A0
|Charmy The Bee
+
|Heavy The Mechanic
|-
 
|002292A0
 
|Heavy The Robot
 
 
|-
 
|-
|002292BE
+
|$002292BE
|Bomb The Robot
+
|Bomb The Mechanic
 
|-
 
|-
|002292DC
+
|$002292DC
 
|Espio The Chameleon
 
|Espio The Chameleon
 
|-
 
|-
|0000E7C4
+
|$002299D6
|Espio's Rotating Pallete
+
|Sega logo
 
|}
 
|}
  
Say you want to conver your favorite colors from photoshop to MARS to make Mighty juuuuust the right shade of blue.
+
To convert from standard RGB colors to MARS colors, use [[HBGDRGB2GBA32XCC]].
Take a RGB color.
 
Now you need to find the red(r) green(g) and blue(b) values for this color. In paint you can select the color and chose Colors>Edit Colors>>Define Custom Colors. In Photoshop, you can double-click the color chosen on the bottom of the tool bar. In any case, find the specifics of your choice color.
 
It's got three values, r, g, and b.  
 
  
(note: all math is in decimal. =/)
+
==Art locations==
 +
===Mega Drive Format Art, Nemesis-compressed===
 +
{| class="prettytable" style="width: auto;"
 +
! Art Offset||Description
 +
|-
 +
|$22E100
 +
|8x8 Menu Font (same as in ''[[Sonic Crackers]]'')
 +
|-
 +
|$22E40E
 +
|Ring
 +
|-
 +
|$22F3B4
 +
|Botanic Base foreground tiles
 +
|-
 +
|$232736
 +
|Botanic Base Stages 1 and 2 secondary foreground tiles
 +
|-
 +
|$2335E6
 +
|Botanic Base Stage 3 secondary foreground tiles
 +
|-
 +
|$2343D4
 +
|Botanic Base Stage 4 secondary foreground tiles
 +
|-
 +
|$235582
 +
|Botanic Base Stage 5 secondary foreground tiles
 +
|-
 +
|$23FA74
 +
|Botanic Base background tiles
 +
|-
 +
|$24036C
 +
|Botanic Base Stages 1 and 2 secondary background tiles
 +
|-
 +
|$2409FC
 +
|Botanic Base Stage 3 secondary background tiles
 +
|-
 +
|$24136C
 +
|Botanic Base Stage 4 secondary background tiles
 +
|-
 +
|$241AFC
 +
|Botanic Base Stage 5 secondary background tiles
 +
|-
 +
|$2432D8
 +
|Speed Slider foreground tiles
 +
|-
 +
|$245EE0
 +
|Speed Slider Stages 1 and 2 secondary foreground tiles
 +
|-
 +
|$246AD2
 +
|Speed Slider Stage 3 secondary foreground tiles
 +
|-
 +
|$2479E6
 +
|Speed Slider Stages 4 and 5 secondary foreground tiles
 +
|-
 +
|$25670E
 +
|Speed Slider background tiles
 +
|-
 +
|$2570B8
 +
|Speed Slider Stages 1 and 2 Morning and Day secondary background tiles
 +
|-
 +
|$25845C
 +
|Speed Slider Stages 1 and 2 Sunset and Night secondary background tiles
 +
|-
 +
|$259768
 +
|Speed Slider Stage 3 Morning and Day secondary background tiles
 +
|-
 +
|$25B036
 +
|Speed Slider Stage 3 Sunset and Night secondary background tiles
 +
|-
 +
|$25C8D6
 +
|Speed Slider Stages 4 and 5 Morning and Day secondary background tiles
 +
|-
 +
|$25E040
 +
|Speed Slider Stages 4 and 5 Sunset and Night secondary background tiles
 +
|-
 +
|$263554
 +
|Amazing Arena foreground tiles
 +
|-
 +
|$26617E
 +
|Amazing Arena Stages 1 and 2 secondary foreground tiles
 +
|-
 +
|$266998
 +
|Amazing Arena Stage 3 secondary foreground tiles
 +
|-
 +
|$267C84
 +
|Amazing Arena Stage 4 secondary foreground tiles
 +
|-
 +
|$269062
 +
|Amazing Arena Stage 5 secondary foreground tiles
 +
|-
 +
|$275AF0
 +
|Amazing Arena Stages 1 and 2 primary background tiles
 +
|-
 +
|$2762F2
 +
|Amazing Arena Stages 1 and 2 secondary background tiles
 +
|-
 +
|$276408
 +
|Amazing Arena Stages 3 and 4 background tiles
 +
|-
 +
|$2772A6
 +
|Amazing Arena Stage 5 background tiles
 +
|-
 +
|$279512
 +
|Techno Tower foreground tiles
 +
|-
 +
|$27C608
 +
|Techno Tower Stage 3 secondary foreground tiles
 +
|-
 +
|$27C6DE
 +
|Techno Tower Stage 5 secondary foreground tiles
 +
|-
 +
|$287AEC
 +
|Techno Tower background tiles
 +
|-
 +
|$288296
 +
|Techno Tower Stages 1 and 2 secondary background tiles
 +
|-
 +
|$288CEA
 +
|Techno Tower Stages 3 and 4 secondary background tiles
 +
|-
 +
|$289F9C
 +
|Techno Tower Stage 5 secondary background tiles
 +
|-
 +
|$28BFC4
 +
|Marina Madness tiles
 +
|-
 +
|$28FF70
 +
|Marina Madness Stage 1 secondary tiles
 +
|-
 +
|$29009C
 +
|Marina Madness Stage 3 secondary tiles
 +
|-
 +
|$2907B2
 +
|Marina Madness Stage 4 secondary tiles
 +
|-
 +
|$291A3A
 +
|Marina Madness Stage 5 secondary tiles
 +
|-
 +
|$299638
 +
|Isolated Island primary tiles
 +
|-
 +
|$29B778
 +
|Isolated Island secondary tiles
 +
|-
 +
|$2A4DF8
 +
|Practice Mode primary foreground tiles
 +
|-
 +
|$2A53B0
 +
|Practice Mode secondary foreground tiles
 +
|-
 +
|$2A5906
 +
|Practice Mode background tiles
 +
|-
 +
|$2A7924
 +
|World Entrance foreground tiles
 +
|-
 +
|$2ACA02
 +
|World Entrance background tiles
 +
|-
 +
|$2AEF66
 +
|Final boss tiles (including Metal Sonic Kai's body in the first and third parts of the battle)
 +
|-
 +
|$2C0712
 +
|Speed Slider small elevator gears
 +
|-
 +
|$2C2DC8
 +
|Sound Test Amy Rose
 +
|-
 +
|$2C3BFA
 +
|Title Screen road and sides of road
 +
|-
 +
|$2C4B20
 +
|Sound Test letters/numbers
 +
|-
 +
|$2C7818
 +
|Sound Test art
 +
|-
 +
|$2CE004
 +
|Special Stage background art and spheres
 +
|-
 +
|$2CFA40
 +
|Bonus Stage background
 +
|}
  
[(r + 1) / 8.25] rounded to the nearest integer = R.
+
===MARS Format pointers===
[(g + 1) / 8.25] rounded to the nearest integer = G.
+
'''Note:''' All pointers for these locations add $2000000 to the listed offset.
[(b + 1) / 8.25] rounded to the nearest integer = B.
+
{| class="prettytable" style="width: auto;"
 +
! Art Offset||Description
 +
|-
 +
|$0A0504
 +
|Mighty
 +
|-
 +
|$0B18BC
 +
|Knuckles
 +
|-
 +
|$0CB3B4
 +
|Charmy
 +
|-
 +
|$0D4E44
 +
|Vector
 +
|-
 +
|$0F1130
 +
|Bomb
 +
|-
 +
|$0F6A18
 +
|Heavy
 +
|-
 +
|$101304
 +
|Espio
 +
|-
 +
|$11B088
 +
|Mighty ring and hand
 +
|}
  
R    = x
+
==Mapping locations==
G * 2 = y
+
===16x16 Blocks, Enigma-compressed===
B * 4 = z
+
{| class="prettytable" style="width: auto;"
 +
!ROM Address||Description
 +
|-
 +
|$236608
 +
|Botanic Base Primary
 +
|-
 +
|$23716A
 +
|Botanic Base Stages 1 and 2 Custom 1
 +
|-
 +
|$237202
 +
|Botanic Base Stage 3 Custom 1
 +
|-
 +
|$23730A
 +
|Botanic Base Stage 4 Custom 1
 +
|-
 +
|$23751A
 +
|Botanic Base Stage 5 Custom 1
 +
|-
 +
|$24251C
 +
|Botanic Base Secondary
 +
|-
 +
|$242640
 +
|Botanic Base Stages 1 and 2 Custom 2
 +
|-
 +
|$2427A6
 +
|Botanic Base Stage 3 Custom 2
 +
|-
 +
|$2429AC
 +
|Botanic Base Stage 4 Custom 2
 +
|-
 +
|$242B08
 +
|Botanic Base Stage 5 Custom 2
 +
|-
 +
|$24A854
 +
|Speed Slider Primary
 +
|-
 +
|$24B426
 +
|Speed Slider Stages 1 and 2 Custom 1
 +
|-
 +
|$24B80E
 +
|Speed Slider Stage 3 Custom 1
 +
|-
 +
|$24BC2E
 +
|Speed Slider Stages 4 and 5 Custom 1
 +
|-
 +
|$25F766
 +
|Speed Slider Secondary
 +
|-
 +
|$25F858
 +
|Speed Slider Stages 1 and 2 Morning and Day Custom 2
 +
|-
 +
|$25FC04
 +
|Speed Slider Stages 1 and 2 Sunset and Night Custom 2
 +
|-
 +
|$25FF56
 +
|Speed Slider Stage 3 Morning and Day Custom 2
 +
|-
 +
|$2603FA
 +
|Speed Slider Stage 3 Sunset and Night Custom 2
 +
|-
 +
|$260850
 +
|Speed Slider Stages 4 and 5 Morning and Day Custom 2
 +
|-
 +
|$260C52
 +
|Speed Slider Stages 4 and 5 Sunset and Night Custom 2
 +
|-
 +
|$26AB3C
 +
|Amazing Arena Primary
 +
|-
 +
|$26B54E
 +
|Amazing Arena Stages 1 and 2 Custom 1
 +
|-
 +
|$26B640
 +
|Amazing Arena Stage 3 Custom
 +
|-
 +
|$26B854
 +
|Amazing Arena Stage 4 Custom
 +
|-
 +
|$26BA78
 +
|Amazing Arena Stage 5 Custom
 +
|-
 +
|$278114
 +
|Amazing Arena Stages 1 and 2 Secondary
 +
|-
 +
|$2787BA
 +
|Amazing Arena Stages 1 and 2 Custom 2
 +
|-
 +
|$2787D8
 +
|Amazing Arena Stages 3 and 4 Secondary
 +
|-
 +
|$278B2A
 +
|Amazing Arena Stage 5 Secondary
 +
|-
 +
|$27E8C6
 +
|Techno Tower Primary
 +
|-
 +
|$27FD94
 +
|Techno Tower Stage 3 Custom 1
 +
|-
 +
|$27FDB2
 +
|Techno Tower Stage 5 Custom 1
 +
|-
 +
|$28B768
 +
|Techno Tower Secondary
 +
|-
 +
|$28B7E0
 +
|Techno Tower Stages 1 and 2 Custom
 +
|-
 +
|$28B95E
 +
|Techno Tower Stage 3 Custom 2 and Stage 4 Custom
 +
|-
 +
|$28BA74
 +
|Techno Tower Stage 5 Custom 2
 +
|-
 +
|$293512
 +
|Marina Madness
 +
|-
 +
|$2942B2
 +
|Marina Madness Stages 3-5 Custom 1
 +
|-
 +
|$294306
 +
|Marina Madness Stages 4 and 5 Custom 2
 +
|-
 +
|$29435A
 +
|Marina Madness Stage 1 Custom
 +
|-
 +
|$294372
 +
|Marina Madness Stage 3 Custom 2
 +
|-
 +
|$2943E6
 +
|Marina Madness Stage 4 Custom 3
 +
|-
 +
|$2946A4
 +
|Marina Madness Stage 5 Custom 3
 +
|-
 +
|$29D87E
 +
|Isolated Island
 +
|-
 +
|$2A5CAA
 +
|Practice Mode Primary
 +
|-
 +
|$2A6066
 +
|Practice Mode Secondary
 +
|-
 +
|$2AA830
 +
|World Entrance Primary
 +
|-
 +
|$2AE704
 +
|World Entrance Secondary
 +
|}
  
x      = X
+
===128x128 Blocks, Enigma-compressed===
y * 16 = Y
+
{| class="prettytable" style="width: auto;"
z * 256= Z
+
!ROM Address||Description
 +
|-
 +
|$237730
 +
|Botanic Base Primary
 +
|-
 +
|$2393C8
 +
|Botanic Base Stage 1 Custom 1
 +
|-
 +
|$239722
 +
|Botanic Base Stage 2 Custom 1
 +
|-
 +
|$239F2A
 +
|Botanic Base Stage 3 Custom 1
 +
|-
 +
|$23B0C2
 +
|Botanic Base Stage 4 Custom 1
 +
|-
 +
|$23C422
 +
|Botanic Base Stage 5 Custom 1
 +
|-
 +
|$242CAC
 +
|Botanic Base Secondary
 +
|-
 +
|$242E2C
 +
|Botanic Base Stages 1 and 2 Custom 2
 +
|-
 +
|$242F36
 +
|Botanic Base Stage 3 Custom 2
 +
|-
 +
|$24304A
 +
|Botanic Base Stage 4 Custom 2
 +
|-
 +
|$24315A
 +
|Botanic Base Stage 5 Custom 2
 +
|-
 +
|$24C65C
 +
|Speed Slider Primary
 +
|-
 +
|$24F4DC
 +
|Speed Slider Stages 1 and 2 Custom 1
 +
|-
 +
|$25044A
 +
|Speed Slider Stage 3 Custom 1
 +
|-
 +
|$2515F0
 +
|Speed Slider Stages 4 and 5 Custom 1
 +
|-
 +
|$261008
 +
|Speed Slider Secondary
 +
|-
 +
|$2610B6
 +
|Speed Slider Stages 1 and 2 Morning and Day Custom 2
 +
|-
 +
|$2615D4
 +
|Speed Slider Stages 1 and 2 Sunset and Night Custom 2
 +
|-
 +
|$261C08
 +
|Speed Slider Stage 3 Morning and Day Custom 2
 +
|-
 +
|$26216A
 +
|Speed Slider Stage 3 Sunset and Night Custom 2
 +
|-
 +
|$2627AA
 +
|Speed Slider Stages 4 and 5 Morning and Day Custom 2
 +
|-
 +
|$262DB4
 +
|Speed Slider Stages 4 and 5 Sunset and Night Custom 2
 +
|-
 +
|$26BC20
 +
|Amazing Arena Primary
 +
|-
 +
|$26D560
 +
|Amazing Arena Stages 1 and 2 Custom 1
 +
|-
 +
|$26E9EE
 +
|Amazing Arena Stage 3 Custom
 +
|-
 +
|$26FFDA
 +
|Amazing Arena Stage 4 Custom
 +
|-
 +
|$271716
 +
|Amazing Arena Stage 5 Custom
 +
|-
 +
|$27846A
 +
|Amazing Arena Stages 1 and 2 Secondary
 +
|-
 +
|$278D78
 +
|Amazing Arena Stages 1 and 2 Custom 2
 +
|-
 +
|$278DCA
 +
|Amazing Arena Stages 3 and 4 Secondary
 +
|-
 +
|$27919C
 +
|Amazing Arena Stage 5 Secondary
 +
|-
 +
|$280424
 +
|Techno Tower Primary
 +
|-
 +
|$2838DA
 +
|Techno Tower Stage 1 Custom 1
 +
|-
 +
|$283ABA
 +
|Techno Tower Stage 2 Custom 1
 +
|-
 +
|$283D8E
 +
|Techno Tower Stage 3 Custom 1
 +
|-
 +
|$2842AE
 +
|Techno Tower Stage 4 Custom 1
 +
|-
 +
|$284474
 +
|Techno Tower Stage 5 Custom 1
 +
|-
 +
|$28BB9C
 +
|Techno Tower Secondary
 +
|-
 +
|$28BC78
 +
|Techno Tower Stages 1 and 2 Custom 2
 +
|-
 +
|$28BD40
 +
|Techno Tower Stages 3 and 4 Custom 2
 +
|-
 +
|$28BE08
 +
|Techno Tower Stage 5 Custom 2
 +
|-
 +
|$294940
 +
|Marina Madness
 +
|-
 +
|$2966F6
 +
|Marina Madness Stage 1 Custom
 +
|-
 +
|$296950
 +
|Marina Madness Stage 2 Custom
 +
|-
 +
|$296992
 +
|Marina Madness Stage 3 Custom
 +
|-
 +
|$296F38
 +
|Marina Madness Stage 4 Custom
 +
|-
 +
|$29761E
 +
|Marina Madness Stage 5 Custom
 +
|-
 +
|$29EA5C
 +
|Isolated Island
 +
|-
 +
|$2A60C0
 +
|Practice Mode Primary
 +
|-
 +
|$2A7034
 +
|Practice Mode Secondary
 +
|-
 +
|$2AB48C
 +
|World Entrance Primary
 +
|-
 +
|$2AEC92
 +
|World Entrance Secondary
 +
|}
  
Z + Y + Z = N
+
===Planes, Enigma-compressed===
 +
{| class="prettytable" style="width: auto;"
 +
!ROM Address||X Size||Description
 +
|-
 +
|$2C3910
 +
|40
 +
|Road from title screen
 +
|-
 +
|$2C39CC
 +
|62
 +
|Sides of road from title screen
 +
|-
 +
|$2C801A
 +
|37
 +
|Sound Test layout
 +
|-
 +
|$2CBFA6
 +
|36
 +
|Data selection screens (Data Select, Player Select, etc) data background oval
 +
|-
 +
|$2CC006
 +
|46
 +
|Data selection screens large blue background oval
 +
|-
 +
|$2CC09E
 +
|22
 +
|Data selection screens small blue background oval
 +
|-
 +
|$2CF7DA
 +
|32
 +
|Special Stage background spheres
 +
|-
 +
|$2CF93E
 +
|32
 +
|Special Stage background art
 +
|-
 +
|$2D0E04
 +
|40
 +
|Bonus Stage background circles
 +
|-
 +
|$2D0EDC
 +
|40
 +
|Bonus Stage background pattern
 +
|}
  
convert N to HEX.
+
==Other ROM data==
 +
===Level layouts===
 +
All level layouts are Enigma compressed. The Level Boundaries data list (above) defines the total size of the level. The layout data is the raw byte-sized indices into the 128x128 blocks, red left to right, then top to bottom. Foreground and background layouts are separate.
  
If your result does not have four digits (ex. 1F, 893, A, 0), tack 0s on to the beggining. (ex. 001F, 0893, 000A, 0000).
+
{| class="prettytable" style="width: auto;"
 +
! Foreground||Description
 +
|-
 +
|$23E7F4
 +
|Botanic Base Stage 1
 +
|-
 +
|$23EA62
 +
|Botanic Base Stage 2
 +
|-
 +
|$23ED52
 +
|Botanic Base Stage 3
 +
|-
 +
|$23F188
 +
|Botanic Base Stage 4
 +
|-
 +
|$23F5FA
 +
|Botanic Base Stage 5
 +
|-
 +
|$255354
 +
|Speed Slider Stage 1
 +
|-
 +
|$25568A
 +
|Speed Slider Stage 2
 +
|-
 +
|$255A28
 +
|Speed Slider Stage 3
 +
|-
 +
|$255DEA
 +
|Speed Slider Stage 4
 +
|-
 +
|$2561F0
 +
|Speed Slider Stage 5
 +
|-
 +
|$2746FE
 +
|Amazing Arena Stage 1
 +
|-
 +
|$274A3A
 +
|Amazing Arena Stage 2
 +
|-
 +
|$274DA8
 +
|Amazing Arena Stage 3
 +
|-
 +
|$27528E
 +
|Amazing Arena Stage 4
 +
|-
 +
|$2755F0
 +
|Amazing Arena Stage 5
 +
|-
 +
|$286E5E
 +
|Techno Tower Stage 1
 +
|-
 +
|$287052
 +
|Techno Tower Stage 2
 +
|-
 +
|$28726E
 +
|Techno Tower Stage 3
 +
|-
 +
|$2874F2
 +
|Techno Tower Stage 4
 +
|-
 +
|$2877D2
 +
|Techno Tower Stage 5
 +
|-
 +
|$298858
 +
|Marina Madness Stage 1
 +
|-
 +
|$298A24
 +
|Marina Madness Stage 2
 +
|-
 +
|$298C00
 +
|Marina Madness Stage 3
 +
|-
 +
|$298D9C
 +
|Marina Madness Stage 4
 +
|-
 +
|$298F74
 +
|Marina Madness Stage 5
 +
|-
 +
|$2A3DCA
 +
|Isolated Island (Tutorial) Stage 1
 +
|-
 +
|$2A41C8
 +
|Isolated Island (Tutorial) Stage 2
 +
|-
 +
|$2A3CCC
 +
|Isolated Island (Tutorial) Stage 3
 +
|-
 +
|$2A45EE
 +
|Isolated Island (Tutorial) Stage 4
 +
|-
 +
|$2A4934
 +
|Isolated Island (Introduction) Stages 0 (before meeting Espio) and 1
 +
|-
 +
|$2A4AC8
 +
|Isolated Island (Introduction) Stage 2
 +
|-
 +
|$2A4BFC
 +
|Isolated Island (Introduction) Stage 3
 +
|-
 +
|$2A4D0A
 +
|Isolated Island (Introduction) Stage 4
 +
|-
 +
|$2A786E
 +
|Practice Mode Level 0
 +
|-
 +
|$2A7882
 +
|Practice Mode Level 1
 +
|-
 +
|$2A78A4
 +
|Practice Mode Level 2
 +
|-
 +
|$2A78E0
 +
|Practice Mode Levels 3 and 4
 +
|-
 +
|$2A7904
 +
|Practice Mode Levels 5 and 6
 +
|-
 +
|$2AC9A0
 +
|World Entrance
 +
|}
  
There you have your 32-bit (MARS) color. (Thanks Kojichao and EricJS. Big helps.)
+
===Collision data===
 +
Each collision block is $800 bytes with the first $400 being the primary collision layer.
 +
{| class="prettytable" style="width: auto;"
 +
! ROM Address||Description
 +
|-
 +
|$23D7F4
 +
|Botanic Base Stages 1 and 2
 +
|-
 +
|$23DFF4
 +
|Botanic Base Stages 3-5
 +
|-
 +
|$253354
 +
|Speed Slider Stages 1 and 2
 +
|-
 +
|$253B54
 +
|Speed Slider Stage 3
 +
|-
 +
|$254354
 +
|Speed Slider Stages 4 and 5
 +
|-
 +
|$272EFE
 +
|Amazing Arena Stages 1 and 2
 +
|-
 +
|$2736FE
 +
|Amazing Arena Stages 3 and 4
 +
|-
 +
|$273EFE
 +
|Amazing Arena Stage 5
 +
|-
 +
|$284E5E
 +
|Techno Tower Stages 1, 2, and 4 (note: stage 4 uses a different pointer from stages 1 and 2 in the pointer list; they both point to this location)
 +
|-
 +
|$28565E
 +
|Techno Tower Stage 3
 +
|-
 +
|$285E5E
 +
|Techno Tower Stage 5
 +
|-
 +
|$298058
 +
|Marina Madness (All Stages)
 +
|-
 +
|$2A34CC
 +
|Isolated Island
 +
|-
 +
|$2A706E
 +
|Practice Mode
 +
|-
 +
|$2AC1A0
 +
|World Entrance
 +
|}
  
But what if you want to edit, say, an enemies pallete? That's MARS but not documented (yet, hopefully).
+
===Text===
Well, now you can convert their colors (bebug>32X VDP) and find them in the ROM. once you know where it is, you can change it.
+
====Sound Test Song names====
 +
The Sound Test song names are a bunch of null terminated ASCII strings starting at $227338. The equals sign (=) character translates to an apostraphe ('); otherwise the string is interpreted as-is. Not all characters may be supported. Sound effects use the last string in the list ("S.E.") and the number is appended programmatically.
  
Great tools for aiding in this are Icy Guy's GBA color picker (assure byteswap is disabled) which can be obtained from Zophar's Domain, and Heran Bago's RGB2GBA32XCC (shameless plug).
+
===Demo Data format===
 +
At each demo address (see the list of pointers above), a structure of the following form is used:
 +
{| class="prettytable" style="width: auto;"
 +
! Offset||Size||Description
 +
|-
 +
|0
 +
|Byte
 +
|Zone
 +
|-
 +
|1
 +
|Byte
 +
|Stage number
 +
|-
 +
|2
 +
|Byte
 +
|Time of day
 +
|-
 +
|3
 +
|Byte
 +
|Player 1 character
 +
|-
 +
|4
 +
|Byte
 +
|Player 2 character
 +
|-
 +
|5
 +
|Byte
 +
|Unused
 +
|-
 +
|6
 +
|Undefined
 +
|Possibly control button data
 +
|}
  
==Crackers Palettes==
+
===Music playlist===
 +
At address $76ED0, a null-terminated list of bytes corresponding to song numbers is given for the five normal levels and the two Isolated Island levels (see RAM address $DFF2). The World Entrance determines which song to play in code, so a code edit would be required. All other game modes play a song directly.
  
Well, thanks to ICEknight, we now know that there are Sonic Crackers palettes in Chaotix.
+
===Mega Drive VDP Register List locations===
 +
''Knuckles' Chaotix'' reloads VDP registers with each game mode. At each address is a list of word corresponding to the register/value words sent to the VDP (unmodified). A word $0 ends the list.
 +
{| class="prettytable" style="width: auto;"
 +
!ROM offset||Description
 +
|-
 +
|$B34
 +
|Sega screen
 +
|-
 +
|$3736
 +
|Title screen
 +
|-
 +
|$4CE6
 +
|Level
 +
|-
 +
|$5A8A
 +
|Special Stage
 +
|}
  
$005750 in Chaotix ROM == $008D08 in Crackers ROM
+
==RAM locations==
 
+
These locations are offset from the base of RAM ($FF0000, which is mirrored to $FFFF0000; addresses above $8000 will use the latter for code size purposes).
==Art Format==
+
{| class="prettytable" style="width: auto;"
 
+
!RAM offset||Size||Description
'''Intro'''<br>
+
|-
The way this art works is that the coordinates are just like a coordinate plane
+
|$C030
positive and negative values. So if the x pos = -4, and y pos = 5, its just like saying on a regular plane that
+
|Word
the x pos = 0, and the y pos = 9. There is a big list of pointers that point to another list of pointers which point to art datas in chaotix. Each art data is one frame. For example, mighty's starting
+
|VBlank handler opcode.
frame is at 0x0a0674. Look at the datas there, and you'll notice it follows this
+
|-
format:<br><br>
+
|$C032
 
+
|Long
'''Header'''<br>
+
|VBlank handler address.
The header tells you how big the piece of art is, and the origin is always 0,0.<br>
+
|-
    x1 = 0x00 (word)
+
|$C036
    x2 = 0x02 (word)
+
|Word
    y1 = 0x04 (byte) (Followed by it is 00, don't ask me why they did this =P)
+
|HBlank handler opcode.
    y2 = 0x06 (byte) (Again, it is followed by another 00)
+
|-
<br>
+
|$C038
'''Art Data'''<br>
+
|Long
After the header, there is a header for a line of pixels. After this header there
+
|HBlank handler address.
is bytes of pixels. I will explain that in a second.
+
|-
    x1 = 0x00 (byte)
+
|$C1FE
    x2 = 0x01 (byte)
+
|Long
    y = 0x02 (byte) (Also followed by 00)
+
|RAM address of the current uncompressed level layout data.
For however long that line is, pixel data will follow it. To find out how many
+
|-
pixels will follow, just use x2 - x1 (distance formula). Each pixel following it
+
|$C202
correspond to a color in the palette. Followed are More line headers followed by
+
|Long
more Pixels, for each line (y2 - y1). You know it is finished when you see straight
+
|RAM address of the current uncompressed 128x128 block mappings.
word of 0x000.<br><br>
+
|-
 
+
|$C206
==Art Pointers==
+
|Long
Here is a list of pointers that point to more pointers that point to each frame of
+
|RAM address of the current uncompressed primary 16x16 block mappings.
art per character. <br>\'''Note:''' Each pointer is added 0x2000000 to it:
+
|-
<br>
+
|$C242
{| border="1"
+
|Long
! Art Offset||Description
+
|RAM address of the current uncompressed secondary 128x128 block mappings.
 +
|-
 +
|$C246
 +
|Long
 +
|RAM address of the current uncompressed secondary 16x16 block mappings.
 +
|-
 +
|$D460
 +
|$40 words
 +
|Mega Drive palette cache.
 +
|-
 +
|$D560
 +
|$40 words
 +
|Copy of the current level's Mega Drive palette. Used by the Bonus Stage to reload the level.
 +
|-
 +
|$DFDE
 +
|Word
 +
|Current game mode. Known values:
 +
*$00: Sega screen
 +
*$08: Title screen
 +
*$18: Level
 +
*$20: Special Stage
 +
*$38: Demo
 +
*$40: Options Menu and Items
 +
*$50: Bonus Stage
 +
*$70: "Exit the World Entrance Screen to Save the Game" screen
 +
(These will always be a factor of 8.)
 +
|-
 +
|$DFE0
 +
|Word
 +
|Current game submode.
 +
*Sega Screen: used to determine which part of the animation to play.
 +
*Options Menu and Items:
 +
**$00: Options Menu
 +
**$04: Sound Test
 +
**$08: Color Test
 +
**$0C: Sound Test (jumps to the same location as $04)
 +
|-
 +
|$DFF2
 +
|Word
 +
|Current level:
 +
*$00: Botanic Base
 +
*$01: Speed Slider
 +
*$02: Amazing Arena
 +
*$03: Techno Tower
 +
*$04: Marina Madness
 +
*$05: Isolated Island (Tutorial)
 +
*$06: Isolated Island (Introduction)
 +
*$07: World Entrance
 +
*$09: Bonus Stage
 +
*$0A: Special Stage
 
|-
 
|-
|0a0504
+
|$DFF4
|Mighty
+
|Word
 +
|Current stage number. For normal stages, this starts from 1; 0 ==1 and 6== 5 (except 6 crashes the game). For the introduction mode of Isolated Island, 0 is the opening (before Knuckles meets Espio), 1-4 behave as expected and 5 and 6 are Practice Mode. In Practice Mode, this variable and the current time of day variable decide which practice lesson is in session; see below.
 
|-
 
|-
|0b18bc
+
|$DFF6
|Knuckles
+
|Word
 +
|Current time of day:
 +
*$00: Morning
 +
*$02: Day
 +
*$04: Sunset
 +
*$06: Night
 +
If bit 0 is set ($01, $03, $05, $07), then Amazing Arena is lit, otherwise it is unlit.
 +
In Practice Mode, the formula
 +
:(current act - 5) * 4 + current time
 +
is used to determine the current lesson:
 +
*0: Standard buttons
 +
*1: Hold and charge in current direction
 +
*2: Hold and charge in opposite direction
 +
*3: Hold and send your partner to a ledge
 +
*4: Throw your partner up onto a ledge
 +
*5: Shoot yourself up onto a ledge your partner is on
 +
*6: Shoot your partner up onto a ledge you are on
 
|-
 
|-
|0cb3b4
+
|$E008
|Charmy
+
|Word
 +
|Number of rings.
 
|-
 
|-
|0d4e44
+
|$E00A
|Vector
+
|Long
 +
|Current score.
 
|-
 
|-
|0f1130
+
|$E01A
|Bomb
+
|Word
 +
|Number of Chaos Rings.
 
|-
 
|-
|0f6a18
+
|$FCE6
|Heavy
+
|Byte
 +
|Current pan of the ring sound; positive is left, negative/zero is right.
 
|-
 
|-
|101304
+
|$FCFC
|Espio
+
|Byte
 +
|Current song; only set by a certain function and only used by the Bonus Stage to replay the previous song when exiting.
 
|-
 
|-
|11b088
+
|$FFD0
|Mighty ring and hand
+
|Byte
 +
|Current demo number (0-4).
 
|}
 
|}
<br>
+
 
 +
==Contributors==
 +
* [[User:Drx|drx]] - Data offsets (art, palettes), character art format information.
 +
* [[User:Heran Bago|Heran Bago]] - [http://heranbago.com/hax/resources/knux/2.1.htm Some Nemesis-compressed art locations]
 +
* [[User:Andlabs|Andlabs]] - More stuff
 +
 
 +
==References==
 +
<references />
 +
 
 
{{SCHGuides}}
 
{{SCHGuides}}
[[Category:Sonic Community Hacking Guide]]
+
[[Category:Sonic Community Hacking Guide|Knuckles' Chaotix]]

Latest revision as of 04:44, 25 March 2020

Back to: [[]].

About ROM addresses

The 32X remaps the main Mega Drive 68000 memory space to suit its needs (for example, to provide framebuffer access to the 68000) and maps the SH-2 memory space (shared by both SH-2s) in a particular way. Because of this, game addresses may appear weird when being viewed directly. Furthermore, the 68000 remapping doesn't allow the full 4 MB ROM to be accessed, so the ROM needs to be banked. Fortunately, Chaotix only uses one of these ROM banks throughout the entire game, making locating data easy. The SH-2s do have full access to the ROM.

On the 68000 side, an address between $880000 and $8FFFFF inclusive is mapped to ROM $0..$7FFFF; this cannot be swapped out and is used for game code. If you encounter an address like this, simply subtract $880000 to get the original ROM address. An address between $900000 and $9FFFFF inclusive is banked. Chaotix uses ROM bank 2 (indexing from 0), which is defined between $200000 and $2FFFFF inclusive, so simply subtract $700000 to get the ROM address.

On the SH-2 side, the cartridge can be accessed either between $02000000 and $022FFFFF inclusive or between $22000000 and $222FFFFF inclusive (Chaotix is only 3 MB so there is nothing above $02300000/$22300000). The former is used in the actual SH-2 code, the latter in SH-2 data. Simply take off that uppermost byte to get the physical address.

For simplicity, this page will use physical ROM addresses.

Pointer lists

Normal data pointers

These lists are just lists of addresses.

ROM Address Description
$2275FA Demo data

Base offset pointer lists

These lists consist of a series of words which describe offsets from a common base. These usually look like

Data: dc.w FirstData-Data
    dc.w SecondData-Data
    dc.w ThirdData-Data
    ;...
Rom Address Description
$7F638 32X character palettes for special stages. Each palette is $12 words long.

Level data pointers

Knuckles' Chaotix uses lists of pointers to get level data. On the 68000 side, these lists come in two forms:

  • Triple indirection - At the given address is a list of pointers corresponding to the current level. At each address in that list is a list of pointers corresponding to stage numbers. At each address in this new list is a list of addresses corresponding to the time of day, whose entries point to the actual data. For instance:
    dc.l BotanicBaseData
    dc.l SpeedSliderData
    ; ...
BotanicBaseData:
    dc.l BB1Data
    dc.l BB2Data
    ; ...
BB1Data:
    dc.l pBB1MData
    dc.l pBB1DData
    dc.l pBB1SData
    dc.l pBB1NData
BB2Data:
    ; ...
pBB1MData: dc.l BB1MData
pBB1DData: dc.l BB1DData
    ; ...
BB1MData: ; ...
  • Offset lists - The pointers are represented as jump tables are represented (a list of words describing offsets), except this time, the offsets are from the address of each word, and not from a master address. These lists take the form
zone 0 stage 0 morning
zome 0 stage 0 day
zone 0 stage 0 sunset
zone 0 stage 0 night
zone 0 stage 1 morning
zone 0 stage 1 day
...
zone 0 stage 6 sunset
zone 0 stage 6 night
zone 1 stage 0 morning
...
Some assume the zone, and therefore take this format:
stage 0 morning
stage 0 day
stage 0 sunset
stage 0 night
stage 1 morning
stage 1 day
...
stage 6 sunset
stage 6 night
ROM Address List Format Description
$4EEA Triple indirection Object positions. Each list of object positions consists of four word entries:
dc.w x position, y position, object type, object subtype

The list ends with a single $FFFF.

$22E584 Offset list Level art. Each entry is a list of pointers that end in $FFFFFFFF. A value of 0 denotes the end of foreground tiles and the beginning of background tiles; Marina Madness and Isolated Island hold both foreground and background tiles together.
$22E974 Offset list Level mappings. At each pointed address is a list of addresses. If the uppermost byte of the address is $01, stop processing this specific type of mapping (16x16 primary, 16x16 secondary, 128x128 primary, 128x128 secondary). If the first byte is $03, stop processing all of this type of mapping (16x16 or 128x128).
16x16 primary (as many as needed until $01 or $03)
16x16 secondary (as many as needed until $01, only if not $03)
128x128 primary (as many as needed until $01 or $03)
128x128 secondary (as many as needed until $01, only if not $03)
level layout (exactly one)
unknown (exactly one)
$22F1AC Offset list Level collision data pointers.
$2B32B0 Offset list Mega Drive format level palettes.
$2B4B74 Offset list Level boundaries. Each entry points to a list of addresses of the form
dc.l foreground bounds
dc.l background bounds
dc.l $FFFFFFFF

At the address of the foreground bounds is a list of the form

dc.w (unknown)
dc.w (unknown, possibly starting Y position of player)
dc.b width of level in 128x128 chunks
dc.b height of level in 128x128 chunks
dc.w rightmost X position where camera will stop scrolling
dc.w (unknown, possibly always 0)
dc.w bottommost Y position where camera will stop scrolling
dc.w (unknown, possibly always 0)

The background bounds's format is unknown, but follows the same byte structure as above.

$2B61FA Offset list, zone assumed Amazing Arena lit palettes.

Palette locations

Mega Drive format

Palette Offset Description
$003A60 Title Screen road and sides
$005AA2 Special Stage background
$0066C8 Credits - Flames
$006E18 Sound Test - Foreground
$006E98 Sound Test - Amy
$03E8CA Data Load screen
$2B3470 Botanic Base Stages 1-3 - Morning
$2B34F0 Botanic Base Stages 1-3 - Day
$2B3570 Botanic Base Stages 1-3 - Sunset
$2B35F0 Botanic Base Stages 1-3 - Night
$2B3670 Botanic Base Stage 4 - Morning
$2B36F0 Botanic Base Stage 4 - Day
$2B3770 Botanic Base Stage 4 - Sunset
$2B37F0 Botanic Base Stage 4 - Night
$2B3870 Botanic Base Stage 5 - Morning
$2B38F0 Botanic Base Stage 5 - Day
$2B3970 Botanic Base Stage 5 - Sunset
$2B39F0 Botanic Base Stage 5 - Night
$2B3A70 Speed Slider - Morning
$2B3AF0 Speed Slider - Day
$2B3B70 Speed Slider Stages 1 and 2 - Sunset
$2B3BF0 Speed Slider Stages 3-5 - Sunset
$2B3C70 Speed Slider - Night
$2B3CF0 Amazing Arena Stages 1 and 2 - Morning/Day - Unlit
$2B3D70 Amazing Arena Stages 1 and 2 - Sunset/Night - Unlit
$2B3DF0 Amazing Arena Stages 3 and 4 - All - Unlit
$2B3E70 Amazing Arena Stage 5 - All - Unlit
$2B3EF0 Techno Tower Stages 1 and 2 - Morning
$2B3F70 Techno Tower Stages 3 and 4 - Morning
$2B3FF0 Techno Tower Stage 5 - Morning
$2B4070 Techno Tower Stages 1 and 2 - Day
$2B40F0 Techno Tower Stages 3 and 4 - Day
$2B4170 Techno Tower Stage 5 - Day
$2B41F0 Techno Tower Stages 1-4 - Sunset
$2B4270 Techno Tower Stage 5 - Sunset
$2B42F0 Techno Tower Stages 1 and 2 - Night
$2B4370 Techno Tower Stages 3 and 4 - Night
$2B43F0 Techno Tower Stage 5 - Night
$2B4470 Marina Madness - Morning
$2B44F0 Marina Madness - Day
$2B4570 Marina Madness - Sunset
$2B45F0 Marina Madness - Night
$2B4670 Isolated Island - Morning
$2B46F0 Isolated Island - Day
$2B4770 Isolated Island - Sunset
$2B47F0 Isolated Island - Night
$2B4870 Practice Mode
$2B48F0 World Entrance (First Screen) - Morning
$2B4970 World Entrance (First Screen) - Day
$2B49F0 World Entrance (First Screen) - Sunset
$2B4A70 World Entrance (First Screen) - Night
$2B6232 Amazing Arena Stages 1 and 2 - Morning - Lit
$2B62B2 Amazing Arena Stages 3 and 4 - Morning - Lit
$2B6332 Amazing Arena Stage 5 - Morning - Lit
$2B63B2 Amazing Arena Stages 1 and 2 - Day - Lit
$2B6432 Amazing Arena Stages 3 and 4 - Day - Lit
$2B64B2 Amazing Arena Stage 5 - Day - Lit
$2B6532 Amazing Arena Stages 1 and 2 - Sunset - Lit
$2B65B2 Amazing Arena Stages 3 and 4 - Sunset - Lit
$2B6632 Amazing Arena Stage 5 - Sunset - Lit
$2B66B2 Amazing Arena Stages 1 and 2 - Night - Lit
$2B6732 Amazing Arena Stages 3 and 4 - Night - Lit
$2B67B2 Amazing Arena Stage 5 - Night - Lit

MARS format

Palette Offset Description
$00001924 HUD (similar to Sonic and Tails's palette in Sonic Crackers)
$0000E7C4 Espio's Rotating Palette
$0022921A Mighty The Armadillo
$0022923E Knuckles The Echidna
$0022925C Charmy The Bee
$0022927E Vector The Crocodile
$002292A0 Heavy The Mechanic
$002292BE Bomb The Mechanic
$002292DC Espio The Chameleon
$002299D6 Sega logo

To convert from standard RGB colors to MARS colors, use HBGDRGB2GBA32XCC.

Art locations

Mega Drive Format Art, Nemesis-compressed

Art Offset Description
$22E100 8x8 Menu Font (same as in Sonic Crackers)
$22E40E Ring
$22F3B4 Botanic Base foreground tiles
$232736 Botanic Base Stages 1 and 2 secondary foreground tiles
$2335E6 Botanic Base Stage 3 secondary foreground tiles
$2343D4 Botanic Base Stage 4 secondary foreground tiles
$235582 Botanic Base Stage 5 secondary foreground tiles
$23FA74 Botanic Base background tiles
$24036C Botanic Base Stages 1 and 2 secondary background tiles
$2409FC Botanic Base Stage 3 secondary background tiles
$24136C Botanic Base Stage 4 secondary background tiles
$241AFC Botanic Base Stage 5 secondary background tiles
$2432D8 Speed Slider foreground tiles
$245EE0 Speed Slider Stages 1 and 2 secondary foreground tiles
$246AD2 Speed Slider Stage 3 secondary foreground tiles
$2479E6 Speed Slider Stages 4 and 5 secondary foreground tiles
$25670E Speed Slider background tiles
$2570B8 Speed Slider Stages 1 and 2 Morning and Day secondary background tiles
$25845C Speed Slider Stages 1 and 2 Sunset and Night secondary background tiles
$259768 Speed Slider Stage 3 Morning and Day secondary background tiles
$25B036 Speed Slider Stage 3 Sunset and Night secondary background tiles
$25C8D6 Speed Slider Stages 4 and 5 Morning and Day secondary background tiles
$25E040 Speed Slider Stages 4 and 5 Sunset and Night secondary background tiles
$263554 Amazing Arena foreground tiles
$26617E Amazing Arena Stages 1 and 2 secondary foreground tiles
$266998 Amazing Arena Stage 3 secondary foreground tiles
$267C84 Amazing Arena Stage 4 secondary foreground tiles
$269062 Amazing Arena Stage 5 secondary foreground tiles
$275AF0 Amazing Arena Stages 1 and 2 primary background tiles
$2762F2 Amazing Arena Stages 1 and 2 secondary background tiles
$276408 Amazing Arena Stages 3 and 4 background tiles
$2772A6 Amazing Arena Stage 5 background tiles
$279512 Techno Tower foreground tiles
$27C608 Techno Tower Stage 3 secondary foreground tiles
$27C6DE Techno Tower Stage 5 secondary foreground tiles
$287AEC Techno Tower background tiles
$288296 Techno Tower Stages 1 and 2 secondary background tiles
$288CEA Techno Tower Stages 3 and 4 secondary background tiles
$289F9C Techno Tower Stage 5 secondary background tiles
$28BFC4 Marina Madness tiles
$28FF70 Marina Madness Stage 1 secondary tiles
$29009C Marina Madness Stage 3 secondary tiles
$2907B2 Marina Madness Stage 4 secondary tiles
$291A3A Marina Madness Stage 5 secondary tiles
$299638 Isolated Island primary tiles
$29B778 Isolated Island secondary tiles
$2A4DF8 Practice Mode primary foreground tiles
$2A53B0 Practice Mode secondary foreground tiles
$2A5906 Practice Mode background tiles
$2A7924 World Entrance foreground tiles
$2ACA02 World Entrance background tiles
$2AEF66 Final boss tiles (including Metal Sonic Kai's body in the first and third parts of the battle)
$2C0712 Speed Slider small elevator gears
$2C2DC8 Sound Test Amy Rose
$2C3BFA Title Screen road and sides of road
$2C4B20 Sound Test letters/numbers
$2C7818 Sound Test art
$2CE004 Special Stage background art and spheres
$2CFA40 Bonus Stage background

MARS Format pointers

Note: All pointers for these locations add $2000000 to the listed offset.

Art Offset Description
$0A0504 Mighty
$0B18BC Knuckles
$0CB3B4 Charmy
$0D4E44 Vector
$0F1130 Bomb
$0F6A18 Heavy
$101304 Espio
$11B088 Mighty ring and hand

Mapping locations

16x16 Blocks, Enigma-compressed

ROM Address Description
$236608 Botanic Base Primary
$23716A Botanic Base Stages 1 and 2 Custom 1
$237202 Botanic Base Stage 3 Custom 1
$23730A Botanic Base Stage 4 Custom 1
$23751A Botanic Base Stage 5 Custom 1
$24251C Botanic Base Secondary
$242640 Botanic Base Stages 1 and 2 Custom 2
$2427A6 Botanic Base Stage 3 Custom 2
$2429AC Botanic Base Stage 4 Custom 2
$242B08 Botanic Base Stage 5 Custom 2
$24A854 Speed Slider Primary
$24B426 Speed Slider Stages 1 and 2 Custom 1
$24B80E Speed Slider Stage 3 Custom 1
$24BC2E Speed Slider Stages 4 and 5 Custom 1
$25F766 Speed Slider Secondary
$25F858 Speed Slider Stages 1 and 2 Morning and Day Custom 2
$25FC04 Speed Slider Stages 1 and 2 Sunset and Night Custom 2
$25FF56 Speed Slider Stage 3 Morning and Day Custom 2
$2603FA Speed Slider Stage 3 Sunset and Night Custom 2
$260850 Speed Slider Stages 4 and 5 Morning and Day Custom 2
$260C52 Speed Slider Stages 4 and 5 Sunset and Night Custom 2
$26AB3C Amazing Arena Primary
$26B54E Amazing Arena Stages 1 and 2 Custom 1
$26B640 Amazing Arena Stage 3 Custom
$26B854 Amazing Arena Stage 4 Custom
$26BA78 Amazing Arena Stage 5 Custom
$278114 Amazing Arena Stages 1 and 2 Secondary
$2787BA Amazing Arena Stages 1 and 2 Custom 2
$2787D8 Amazing Arena Stages 3 and 4 Secondary
$278B2A Amazing Arena Stage 5 Secondary
$27E8C6 Techno Tower Primary
$27FD94 Techno Tower Stage 3 Custom 1
$27FDB2 Techno Tower Stage 5 Custom 1
$28B768 Techno Tower Secondary
$28B7E0 Techno Tower Stages 1 and 2 Custom
$28B95E Techno Tower Stage 3 Custom 2 and Stage 4 Custom
$28BA74 Techno Tower Stage 5 Custom 2
$293512 Marina Madness
$2942B2 Marina Madness Stages 3-5 Custom 1
$294306 Marina Madness Stages 4 and 5 Custom 2
$29435A Marina Madness Stage 1 Custom
$294372 Marina Madness Stage 3 Custom 2
$2943E6 Marina Madness Stage 4 Custom 3
$2946A4 Marina Madness Stage 5 Custom 3
$29D87E Isolated Island
$2A5CAA Practice Mode Primary
$2A6066 Practice Mode Secondary
$2AA830 World Entrance Primary
$2AE704 World Entrance Secondary

128x128 Blocks, Enigma-compressed

ROM Address Description
$237730 Botanic Base Primary
$2393C8 Botanic Base Stage 1 Custom 1
$239722 Botanic Base Stage 2 Custom 1
$239F2A Botanic Base Stage 3 Custom 1
$23B0C2 Botanic Base Stage 4 Custom 1
$23C422 Botanic Base Stage 5 Custom 1
$242CAC Botanic Base Secondary
$242E2C Botanic Base Stages 1 and 2 Custom 2
$242F36 Botanic Base Stage 3 Custom 2
$24304A Botanic Base Stage 4 Custom 2
$24315A Botanic Base Stage 5 Custom 2
$24C65C Speed Slider Primary
$24F4DC Speed Slider Stages 1 and 2 Custom 1
$25044A Speed Slider Stage 3 Custom 1
$2515F0 Speed Slider Stages 4 and 5 Custom 1
$261008 Speed Slider Secondary
$2610B6 Speed Slider Stages 1 and 2 Morning and Day Custom 2
$2615D4 Speed Slider Stages 1 and 2 Sunset and Night Custom 2
$261C08 Speed Slider Stage 3 Morning and Day Custom 2
$26216A Speed Slider Stage 3 Sunset and Night Custom 2
$2627AA Speed Slider Stages 4 and 5 Morning and Day Custom 2
$262DB4 Speed Slider Stages 4 and 5 Sunset and Night Custom 2
$26BC20 Amazing Arena Primary
$26D560 Amazing Arena Stages 1 and 2 Custom 1
$26E9EE Amazing Arena Stage 3 Custom
$26FFDA Amazing Arena Stage 4 Custom
$271716 Amazing Arena Stage 5 Custom
$27846A Amazing Arena Stages 1 and 2 Secondary
$278D78 Amazing Arena Stages 1 and 2 Custom 2
$278DCA Amazing Arena Stages 3 and 4 Secondary
$27919C Amazing Arena Stage 5 Secondary
$280424 Techno Tower Primary
$2838DA Techno Tower Stage 1 Custom 1
$283ABA Techno Tower Stage 2 Custom 1
$283D8E Techno Tower Stage 3 Custom 1
$2842AE Techno Tower Stage 4 Custom 1
$284474 Techno Tower Stage 5 Custom 1
$28BB9C Techno Tower Secondary
$28BC78 Techno Tower Stages 1 and 2 Custom 2
$28BD40 Techno Tower Stages 3 and 4 Custom 2
$28BE08 Techno Tower Stage 5 Custom 2
$294940 Marina Madness
$2966F6 Marina Madness Stage 1 Custom
$296950 Marina Madness Stage 2 Custom
$296992 Marina Madness Stage 3 Custom
$296F38 Marina Madness Stage 4 Custom
$29761E Marina Madness Stage 5 Custom
$29EA5C Isolated Island
$2A60C0 Practice Mode Primary
$2A7034 Practice Mode Secondary
$2AB48C World Entrance Primary
$2AEC92 World Entrance Secondary

Planes, Enigma-compressed

ROM Address X Size Description
$2C3910 40 Road from title screen
$2C39CC 62 Sides of road from title screen
$2C801A 37 Sound Test layout
$2CBFA6 36 Data selection screens (Data Select, Player Select, etc) data background oval
$2CC006 46 Data selection screens large blue background oval
$2CC09E 22 Data selection screens small blue background oval
$2CF7DA 32 Special Stage background spheres
$2CF93E 32 Special Stage background art
$2D0E04 40 Bonus Stage background circles
$2D0EDC 40 Bonus Stage background pattern

Other ROM data

Level layouts

All level layouts are Enigma compressed. The Level Boundaries data list (above) defines the total size of the level. The layout data is the raw byte-sized indices into the 128x128 blocks, red left to right, then top to bottom. Foreground and background layouts are separate.

Foreground Description
$23E7F4 Botanic Base Stage 1
$23EA62 Botanic Base Stage 2
$23ED52 Botanic Base Stage 3
$23F188 Botanic Base Stage 4
$23F5FA Botanic Base Stage 5
$255354 Speed Slider Stage 1
$25568A Speed Slider Stage 2
$255A28 Speed Slider Stage 3
$255DEA Speed Slider Stage 4
$2561F0 Speed Slider Stage 5
$2746FE Amazing Arena Stage 1
$274A3A Amazing Arena Stage 2
$274DA8 Amazing Arena Stage 3
$27528E Amazing Arena Stage 4
$2755F0 Amazing Arena Stage 5
$286E5E Techno Tower Stage 1
$287052 Techno Tower Stage 2
$28726E Techno Tower Stage 3
$2874F2 Techno Tower Stage 4
$2877D2 Techno Tower Stage 5
$298858 Marina Madness Stage 1
$298A24 Marina Madness Stage 2
$298C00 Marina Madness Stage 3
$298D9C Marina Madness Stage 4
$298F74 Marina Madness Stage 5
$2A3DCA Isolated Island (Tutorial) Stage 1
$2A41C8 Isolated Island (Tutorial) Stage 2
$2A3CCC Isolated Island (Tutorial) Stage 3
$2A45EE Isolated Island (Tutorial) Stage 4
$2A4934 Isolated Island (Introduction) Stages 0 (before meeting Espio) and 1
$2A4AC8 Isolated Island (Introduction) Stage 2
$2A4BFC Isolated Island (Introduction) Stage 3
$2A4D0A Isolated Island (Introduction) Stage 4
$2A786E Practice Mode Level 0
$2A7882 Practice Mode Level 1
$2A78A4 Practice Mode Level 2
$2A78E0 Practice Mode Levels 3 and 4
$2A7904 Practice Mode Levels 5 and 6
$2AC9A0 World Entrance

Collision data

Each collision block is $800 bytes with the first $400 being the primary collision layer.

ROM Address Description
$23D7F4 Botanic Base Stages 1 and 2
$23DFF4 Botanic Base Stages 3-5
$253354 Speed Slider Stages 1 and 2
$253B54 Speed Slider Stage 3
$254354 Speed Slider Stages 4 and 5
$272EFE Amazing Arena Stages 1 and 2
$2736FE Amazing Arena Stages 3 and 4
$273EFE Amazing Arena Stage 5
$284E5E Techno Tower Stages 1, 2, and 4 (note: stage 4 uses a different pointer from stages 1 and 2 in the pointer list; they both point to this location)
$28565E Techno Tower Stage 3
$285E5E Techno Tower Stage 5
$298058 Marina Madness (All Stages)
$2A34CC Isolated Island
$2A706E Practice Mode
$2AC1A0 World Entrance

Text

Sound Test Song names

The Sound Test song names are a bunch of null terminated ASCII strings starting at $227338. The equals sign (=) character translates to an apostraphe ('); otherwise the string is interpreted as-is. Not all characters may be supported. Sound effects use the last string in the list ("S.E.") and the number is appended programmatically.

Demo Data format

At each demo address (see the list of pointers above), a structure of the following form is used:

Offset Size Description
0 Byte Zone
1 Byte Stage number
2 Byte Time of day
3 Byte Player 1 character
4 Byte Player 2 character
5 Byte Unused
6 Undefined Possibly control button data

Music playlist

At address $76ED0, a null-terminated list of bytes corresponding to song numbers is given for the five normal levels and the two Isolated Island levels (see RAM address $DFF2). The World Entrance determines which song to play in code, so a code edit would be required. All other game modes play a song directly.

Mega Drive VDP Register List locations

Knuckles' Chaotix reloads VDP registers with each game mode. At each address is a list of word corresponding to the register/value words sent to the VDP (unmodified). A word $0 ends the list.

ROM offset Description
$B34 Sega screen
$3736 Title screen
$4CE6 Level
$5A8A Special Stage

RAM locations

These locations are offset from the base of RAM ($FF0000, which is mirrored to $FFFF0000; addresses above $8000 will use the latter for code size purposes).

RAM offset Size Description
$C030 Word VBlank handler opcode.
$C032 Long VBlank handler address.
$C036 Word HBlank handler opcode.
$C038 Long HBlank handler address.
$C1FE Long RAM address of the current uncompressed level layout data.
$C202 Long RAM address of the current uncompressed 128x128 block mappings.
$C206 Long RAM address of the current uncompressed primary 16x16 block mappings.
$C242 Long RAM address of the current uncompressed secondary 128x128 block mappings.
$C246 Long RAM address of the current uncompressed secondary 16x16 block mappings.
$D460 $40 words Mega Drive palette cache.
$D560 $40 words Copy of the current level's Mega Drive palette. Used by the Bonus Stage to reload the level.
$DFDE Word Current game mode. Known values:
  • $00: Sega screen
  • $08: Title screen
  • $18: Level
  • $20: Special Stage
  • $38: Demo
  • $40: Options Menu and Items
  • $50: Bonus Stage
  • $70: "Exit the World Entrance Screen to Save the Game" screen

(These will always be a factor of 8.)

$DFE0 Word Current game submode.
  • Sega Screen: used to determine which part of the animation to play.
  • Options Menu and Items:
    • $00: Options Menu
    • $04: Sound Test
    • $08: Color Test
    • $0C: Sound Test (jumps to the same location as $04)
$DFF2 Word Current level:
  • $00: Botanic Base
  • $01: Speed Slider
  • $02: Amazing Arena
  • $03: Techno Tower
  • $04: Marina Madness
  • $05: Isolated Island (Tutorial)
  • $06: Isolated Island (Introduction)
  • $07: World Entrance
  • $09: Bonus Stage
  • $0A: Special Stage
$DFF4 Word Current stage number. For normal stages, this starts from 1; 0 ==1 and 6== 5 (except 6 crashes the game). For the introduction mode of Isolated Island, 0 is the opening (before Knuckles meets Espio), 1-4 behave as expected and 5 and 6 are Practice Mode. In Practice Mode, this variable and the current time of day variable decide which practice lesson is in session; see below.
$DFF6 Word Current time of day:
  • $00: Morning
  • $02: Day
  • $04: Sunset
  • $06: Night

If bit 0 is set ($01, $03, $05, $07), then Amazing Arena is lit, otherwise it is unlit. In Practice Mode, the formula

(current act - 5) * 4 + current time

is used to determine the current lesson:

  • 0: Standard buttons
  • 1: Hold and charge in current direction
  • 2: Hold and charge in opposite direction
  • 3: Hold and send your partner to a ledge
  • 4: Throw your partner up onto a ledge
  • 5: Shoot yourself up onto a ledge your partner is on
  • 6: Shoot your partner up onto a ledge you are on
$E008 Word Number of rings.
$E00A Long Current score.
$E01A Word Number of Chaos Rings.
$FCE6 Byte Current pan of the ring sound; positive is left, negative/zero is right.
$FCFC Byte Current song; only set by a certain function and only used by the Bonus Stage to replay the previous song when exiting.
$FFD0 Byte Current demo number (0-4).

Contributors

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