Sonic Advance 3/RAM Editing

From Sonic Retro

SCHG: Sonic Advance 3
Main Article
ROM Portion
Editing the ROM
Sound Test
Sound and Music List
Dynamic Text
Hidden Level Select Menu
Special Stages
RAM Portion
RAM Editing
See Also
SCHG How-to topics
Sonic Advance PalTool
Sonic Advance 3 Tools

Here you'll find some interesting RAM locations which values can be altered in order to get a certain thing. This is like changing a byte in a savestate. These locations can be used in Memory Viewer and Cheat List from VBA

I'll list the addresses, how bytes they use and a brief description. Numbers between parenthesis refer to partner character. Example: 030015EA(173A) means that the address that changes the partner character is 0300173A.

Location Size Description
0300094C 2 bytes Rings
030015EA(173A) 1 byte Character
030015EB(173B) 1 byte Character flag
030015F0(1740) 2 bytes Character state
030015F2(1742) 2 bytes Character state
030015F4(1744) 2 bytes Sprite state
03001612(1762) 2 bytes Time until going into "wait state"
03001D38 4 bytes Pos X (horizontal)
03001D3C 4 bytes Pos Y (vertical)
03000552 7 bytes SP keys (1 byte per zone)
030008A9 1 byte Zone
030008AA 1 byte Act
030008AE 1 byte Scene flag
030008B4 2 bytes Button flag - A
030008B6 2 bytes Button flag - B
030008B8 2 bytes Button flag - R
0300094E 2 bytes Timer (units in 1/100th of second)
03000954 1 byte Lives
03004532 1 byte Level title (bottom right corner)
03004874 2 bytes Rings in special stage
030008C8 2 bytes Restarting position X
030008CC 2 bytes Restarting position Y
03000541 1 byte Zone access flag
03000559 7 bytes Zone completion flags (1 byte per zone)
03000562 1 byte Emerald flag
03000927 1 byte SP key flag

Rings and time

Two bytes. In the side of the timer, it increases 1 at every 1/100 of second, until reaching the maximum value of 8C9Fh, that is equal to 9:59:99. The timer is present even in the map scene, Sonic Factory and Chao's Playground, but with the difference to a normal act that it's invisible and death is disabled. In the time until going into "wait state", it decreases instead of increasing. When it reaches zero, the character enters into "waiting" animation.


Just a single byte. Sonic=00, Cream=01, Tails=02, Knuckles=03 and Amy=04. The same order from SA2. Changing its value will give the result instantly. If you put the same char as main and partner then you're going to have problems using tag action, mostly the game will lock up, with exception of Cream & Cream and Sonic & Sonic. The lock up is due to the fact that a character hasn't a programmed state that is supposed to be used when performing a tag action with himself/herself.

Character & sprite state

State means an sprite (or sprites) that appears performing some animation. If you know MUGEN (how CNS and AIR files work) then you know what I'm talking about. Character states indicate which animation the char is doing (standing, looking up, looking down, running, etc). Sprite states indicate which animation the game must show in order to fit the char state (and the current char, because it's pretty stupid/pointless having Knuckles appear when you try to jump with Cream, for instance :P). Char state 0 is standing on foot. For Sonic, both states (char & sprite) are the same. But with Cream, sprite state for char state 0 is A3h. Every single object in the game that belongs to GBA's OBJ layer has a sprite state. And in case you're wondering, yes, you can force an object to appear in place of your character with VBA's cheat mode, simulating debug mode, and release a screenshot in order to have about 1 billion stupid kiddies bumping your topic in a forum. So everything that appears in VBA's OAM viewer and uses sprite palette has a sprite state. With Sonic and the cheat, using the attack with B will "force" the sprite to appear. Here comes a cool cheat: 030015F4:0516. You'll turn into G-mel and then turn back to normal. Only few states allow you to come back to normal, otherwise game crashes. There is a total of 1524 sprite states, from 0 to 1523. Some doesn't have data, but 1524 is the max number of states that is actually supported by SA3. Do you remember what I said above about using the same char as main and partner? Let's use Tails & Tails as example. The "jumping-over-Tails" char state is 5Bh. When Tails performs that, sprite state is set to 1A1h(417), and if you check this out in the ROM the pointers for that state will be empty (zero) in all of its mappings. Attempting to read data beyond range and pointing to invalid data are the two things that make games crash.

Character flag

It's a single flag that tells the game how a character must act. With this, you can freeze your main character and even control the partner character. I guess this flag is widely used in multiplayer mode for obvious reasons. When 05 (main char), gameplay is normal. You can "control" the partner by setting his/hers flag to 07.

Pos X / Y

4 bytes. Hex view is highly recomended. But surprise, surprise! The corner of the screen isn't 00000000! It's FFFF... something, that is, lower than zero. PosX increases from left to right and PosY increases from above to below. Forcing a position with cheats doesn't work, and I don't know why. I bet nobody has found a use for this.

Zone and act, level title

Zone: starts at 00 - Route 99 and ends in 06 - Chaos Angel. 07 is Altar Emerald and 08 is Nonaggression. If you're in a zone and you change its byte to another zone, the next part will be based on the new zone. For instance, being in Route 99, changing map byte to 04 and jumping at act 1 ring. You'll be at Twinkle Snow Act 1. The expression "next part" includes map, Chao's Playground, Sonic Factory, acts, bosses and Special Stages. The act byte just says which "part" of the zone you are. Altar Emerald causes a bunch of problems when accessed through "unofficial" methods. About the level title, it changes instantly, without need of going to another "part".

Scene flag

This is really a useful flag! It makes more than give you the current zone and act. It also handles which kind of "scene" you are. 01 is Sonic Factory (precisely from Route 99), and that results in disabling of tag action. 48h is Nonaggression. Example: if you clear an act and then change the scene flag to 48h, the ending sequence with all emeralds will appear. Another example: if you enter Sonic Factory and change scene flag to 02 (Route 99 Map) then you'll be able to use tag action. One more: turn on the timer and ring counter in Sonic Factory, Chao's and map scene by changing scene flag to a value that belongs to an act.

Button flag

It's just about what action is attributed to a button.

0001: jump
0002: attack
0100: partner

Other values will likely result in nothing. "Duplications" don't work - i.e. you can't have two buttons to do the same thing. I wonder how or when it'll be possible to use L button...

Restarting position

2 bytes for X/Y position. It's used to place your character somewhere after you lose a life. The values used here are "compatible" with the starting pos values from Zones subsection at ROM section.

Zone access flag

This 8-bit flag tells the game how many zones are available through Sonic Factory. 00 means that no zones will be available and 07 means that all zones will be available. Example: if the flag value is 05, all zones up to Zone 5 will be available. In other words: if you're at Sonic Factory from Zone 3, the teleport boxes for Zones 1, 2, 4 and 5 will be active.

Zone completion flags

These flags tell the game which acts are complete or not. When playing a completed act, the pause thing will change and an option to go back will be available. I know this can be explained at binary level, but right now I can't think anything better than this:

Flag value Act 1 Act 2 Act 3
00 - 08 Incomplete Incomplete Incomplete
01 - 09 Passed Incomplete Incomplete
02 - 0A Incomplete Passed Incomplete
03 - 0B Passed Passed Incomplete
04 - 0C Incomplete Incomplete Passed
05 - 0D Passed Incomplete Passed
06 - 0E Incomplete Passed Passed
07 - 0F Passed Passed Passed

Values from 00 to 07 mean Boss Arena incomplete. Values from 08 to 0F mean otherwise. However the Boss Arena can only be accessed when all three acts are complete (07 or 0F).

Emerald flag

At least, I figured the "binary spirit" embed in this one. In order to check how many emeralds you have, convert the flag value to binary and read it from right to left, as if it would be from Zone 1 to Zone 7. All emeralds is 7Fh (01111111) and no emeralds is 0 (00000000). Let's say the current flag value is 47h. Converting it to binary (01000111) and then checking out will reveal that emeralds from Zone 1, 2, 3 and 7 were gotten. This flag works in Chao's Playground regardless how many Chaos you found.

SP key flag

Very simple. It's set to 1 when you collect a SP key in an act. The end-of-level results thing checks this flag to add 1 SP key to your count.