Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some RAM addresses I found screwing around in mGBA #32

Open
rboninsegna opened this issue Aug 27, 2023 · 2 comments
Open

Some RAM addresses I found screwing around in mGBA #32

rboninsegna opened this issue Aug 27, 2023 · 2 comments

Comments

@rboninsegna
Copy link

02000030: spare balls (0-9)
02000040-3: score increment/decrement
02000044-7: score
02000192: coins
020001C6: spinner turns (00-A8)
020001C8: Pikachu charge? gets continuously incremented and capped to spinner value?
02000296-7: clock time remaining (catch, evo, bonus)
02000306: (Sapphire) Pelipper status (0 idle, 1 cocked, 3-6 starting Spheal game, ?-9 ending Spheal game)
02000308-9: bumper hits (resets on new ball, after Spheal bonus, etc)
0200062A-E: end of ball bonus counters (pokemon caught, evolved, travel count, slots played, pikachu saves) (00-FF work fine, unsure if there's a soft cap)
0200070E: bonus multiplier
02000724-5: Ball Saver time remaining
0200072E: EVO loops (0-3)
0200072F: GET loops (0-3)
0200B0C0: what you apparently call gMain
0200B0CF: 2 pause | 4 debug
0200B134-200: pokedex (01 seen = blacked and no data, 02 traded? = dimmed and description only, 03 traded? = dimmed and no h/w, 04 caught) (you apparently call this gMain_saveData.pokedexFlags[])
0200B201: language (EUR: 0-4, invalid values cause graphics corruption)
0200B204: button layout preset (0-4)
0200B206-19: custom button layout (2 bytes per button, up to 2 ANDed buttons per action in on-screen order, nonstandard scancodes)
0200B21C-39B: highscore table (4 bytes (!) per character, 8 bytes for score)

Don't take the multibyte ones for granted (32 bit score and 64 bit highscore? yet it works...)

Hope you'll find them useful though :)

@WhenGryphonsFly
Copy link
Collaborator

Hey, thanks for the information! Sorry for taking so long to respond; I wasn't in a position to document symbols (I'm still not, really).

If you don't mind, could you confirm some of the addresses for me? Specifically, everything from 0200B201 onward? The data structures themselves look right (even the high score table), but they appear to be shifted a few bytes. It might be because we're decompiling the US version, which wouldn't have the language setting.

If you don't have the time to check everything from B201 to B39B, could you at least check from B201 to B204? One of those addresses should be ball speed (1 byte, 0 or 1), which is the only variable in that range we have confirmed the US address of.

@rboninsegna
Copy link
Author

Sure :)

0726 - SAVER indicator on/off (auto set based on time remaining)

B201 - GBP rumble (0 off, 1 [& other nonzero] on), directly affects vibration command generation, when entering options screen is read to draw the rumble cursor then forced to 1, when going back is restored as-is if not changed

B202 - ball speed (0 normal, 1 slow, 2 seems to play as normal but screws up field select screen

B203 - button layout preset

B204-B217 - custom layout

B218-B397 - highscore table (yep, it's really 4 bytes per character* and 8 for the value)

  • 00-19 letters, then digits '0' to '9'; 24 dot; 25 comma; 26 heart; 27 exclamation mark again; 28 the default/blank dash; 29 space; 2A 'F'; the rest seem to be crap

B398-B3A1 - "POKEPINAGB" in ASCII

B3A2-B3A3 - seems to be a checksum for the save

B3A4-B3A7 - could be a save counter but it's weird (increases whenever the pokedex or highscore are changed/erased, when exiting the options menu, and when starting a new game, but not when doing a save & quit or continuing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants