This page contains RAM addresses to various interesting and useful processes of GBA and DS Pokemon games.
Breakpoints can be set at these addresses.
| DP RAM Address
| Pl RAM Address
| Description
| Discovered by
|
| 02000C54
| 02000C88
| Main()
| Bond697
|
| 02000FB0
| 02001034
| Begin Seed Calculation Routine
| mingot, arcee
|
| 0201B9E0
| 0201D2DC
| Set PRNG seed
| mingot, arcee
|
| 0201B9EC
| 0201D2E8
| PRNG
| loadingNOW, tsanth
|
| 0201BA10
| 0201D30C
| Alternate RNG used in some cases: Examples, PID generation for mystery gift pokemon, recalculating a PID after a failed shiny check, number which determines swarm pokemon and great marsh pokemon
| SCV
|
| 0201BA1C
| 0201D318
| Set IRNG Seed
| mingot, arcee
|
| 02038B70
| 0203E778
| Script Handler
| loadingNOW
|
|
| 0203E7D2
| Loads address for a command then branches to that address
| SCV
|
| 02042FB4
| 0204BAFC
| ARNG call for PID of Wondercard pokemon
| SCV, arcee
|
| 02042FBA
| 0204BB02
| Loads PID from wondercard to r0
| SCV, arcee
|
| 02042FC8
| 0204BB10
| First Shiny Check call during the generation of some wondercard pokemon
| SCV, arcee
|
| 02042FD0
| 0204BB18
| Beginning of loop that makes sure you do not get a shiny wondercard pokemon (in some cases)
| SCV, arcee
|
| 0204305E
| 0204BBA6
| PRNG call for first set of Wondercard pokemon IVs
| tsanth, arcee
|
| 0204309C
| 0204BBE4
| PRNG call for second set of Wondercard pokemon IVs
| tsanth, arcee
|
| 0205DED4
|
| Create chain set (not sure about address in tsanth's thread it said 205DED
| tsanth, loadingNOW
|
| 0205DF42
|
| End of Create chain set routine
| tsanth, loadingNOW
|
| 0205E40C
| 02069B00
| Pokeradar Routine
| loadingNOW, tsanth, arcee
|
| 02068AAC
| 02075E38
| Shiny Check, used to decide what sprite to show for a pokemon and to make sure dynamic PID mystery gift pokemon are not shiny as well as preventing manaphy from hatching shiny in some cases.
| SCV, arcee
|
|
| 02075C86
| 128 step RNG advancement
| arcee
|
|
| 0207760E
| Poketch check @ daycare screen
| arcee
|
| 0206A90C
| 02078780
| Begin Calculation of Pokemon ID for alternate forms.
| SCV, arcee
|
| 020EBC80
| 020E1F6C
| Division routine; R0= R0 / R1, R1=R0%R1
| tsanth, SCV
|
|
| 020EAC58
| Pointer to Begin Routine for Script Command 0000
| SCV
|
|
| 020EB974
| Pointer to Begin Routine for Script Command 0347
| SCV
|
| 021C4D48
| 021BFB14
| PRNG State
| Kazo
|
| 021C4D4C
| 021BFB18
| Mersenne Twister Lookup Table
| Kazo
|
| 021F4DA8
|
| Beginning of Honey Tree Routine
| SCV
|
| 021F4EE4
|
| Determines a value from 0-3 to use to determine which list will be used and how the shake value is calculated. If 0, slathering fails and not pokemon will show up.
| SCV
|
| 021F4F44
|
| Determines a number from 0-5 that represents which pokemon will be encountered in a honey tree.
| SCV
|
| 021F4F98
|
| Determines which list will be used by (value determined by 021F4EE4) - 1 (its not done this way, but is equivalent)
| SCV
|
| 021F4FAC
|
| Determines a number from 0-3 that represents how much a Honey Tree will shake
| SCV
|
| 021F5138
| 021EFF4C
| Returns 1 if the current tree being slathered is a Munchlax Tree and 0 otherwise.
| SCV
|
| 02211E60
|
| Set GRNG seed
| magical
|
| 02211E70
|
| GRNG
| magical
|
| 0223BA10
|
| Movement Handler Start
| tsanth
|
| 0223BA46
|
| "Am I on grass?" check
| tsanth
|
| 0223BAD4
|
| Wild Encounter Check
| tsanth
|
| 0223BB2E
|
| Pair-battle (NPC partner) check
| tsanth
|
| 0223BD1C
|
| Movement Handler END
| tsanth
|
| 0223C1EE
| 022377A2
| Pokeball catching routine
| tsanth, arcee
|
| 0223C5B8
|
| Start of Encounter Table Lookup Handler
| mingot
|
| 0223C66A
|
| Start of Water (Sweet Scent/Surfing) Encounter Table Lookup Handler
| mingot
|
| 0223C6A0
|
| Start of Water (Fishing) Encounter Table Lookup Handler. There are 3 branches for each of the rods in this routine with different results for old and good/super.
| mingot
|
|
| 022417F4
| Encounter- terrain check
| arcee
|
|
| 02241848
| Encounter- motion mod
| arcee
|
|
| 022479E6
| Call to get ID routine (result in r0)
| SCV
|
|
| 0224E920
| Start of Frozen Handler
| SCV
|
| RAM Address
| Description
| Discovered by
|
| 01FF8000
| ITCM start
| Bond697
|
| 01FF80F0
| ARM9 IRQ Handler
| Bond697
|
| 02005124
| main() function- infinite main/busy loop that runs the game starts at 02005166
| Bond697
|
| 0200520C
| VBlank handler function
| Bond697
|
| 020056D0
| Set up both main RNGs for use
| Bond697
|
| 020056EC
| PRNG advancement routine 1
| Bond697
|
| 02005728
| PRNG advancement routine 2
| Bond697
|
| 0200852C
| Store sidtid as uint
| Bond697
|
| 0201778C
| IV creation routine
| Bond697
|
| 02017EF4
| Shiny check routine
| Bond697
|
| 02018746
| PID type decision
| Bond697
|
| 02018788
| Shiny prevention routine
| Bond697
|
| 02019A6C
| PKM + RAM encryption
| Bond697
|
| 02035F50
| New (NDS-only) input handler
| Bond697
|
| 02035F94
| GBA-equivalent input handler
| Bond697
|
| 0203AE38
| C-Gear startup RNG interaction(reseed MT, encrypt, etc)
| Bond697
|
| 0203EFE0
| memcmp()- memory compare: 2 pointers and length of comparison(in bytes))
| Bond697
|
| 0203F04C
| Set init MT seed (seed = init rng >> 32)
| Bond697
|
| 0203F078
| ARNG(same as gen 4)- build initial MT seed table
| Bond697
|
| 0203F0C0
| Mersenne Twister seed table builder
| Bond697
|
| 0203F270
| Initial Seed Creation Routine
| OmegaDonut
|
| 0203F374
| .sav encryption
| Bond697
|
| 020592E8
| MD5 hashing routine for wifi
| Bond697
|
| 0207FD4C
| VRAM bank control handler
| Bond697
|
| 02082BE4
| Takes 3 arguments: pointer to start of data write, length(in bytes) of data to write, uint to write multiple times- used constantly for clearing freed memory
| Bond697
|
| 02082D5C
| memcpy32()- accepts pointer to data start, pointer to copy start, and a length in bytes to copy
| Bond697
|
| 02085D54
| DSi Detection Routine
| chiizu
|
| 02088E74
| Convert dec -> hex(mainly for RTC data, but usable for anything)
| Bond697
|
| 02088A98
| Date/time switch statement- used to grab pieces of the date and time and convert them to hex
| Bond697
|
| 0209C0C4
| Signed divmod- r0/r1, result in r0; r0%r1, result in r1
| Bond697
|
| 0209C2C8
| Unsigned divmod- r0/r1, result in r0; r0%r1, result in r1
| Bond697
|
| 020946AC
| ARNG2(unused)- not a breakpoint, but notable nonetheless..
| Bond697
|
| 020A1B50
| Model/texture definitions/positioning data
| Bond697
|
| 020AA1C4
| RNG state pointer
| Bond697
|
| 02146292
| Pokemon to be encountered
| Bond697
|
| 02146A18
| Mersenne Twister seed table pointer
| Bond697
|
| 02150920
| SVC mode stack location for card reads/writes
| Bond697
|
| 02151260
| SWI/SVC mode stack
| Bond697
|
| 02193914
| White Forest Trainer # Counter- returns # of trainers in White Forest
| Bond697
|
| 021A9370
| Pre-battle setup(battle test, etc)
| Bond697
|
| 021A948C
| Double battle test
| Bond697
|
| 021AA43A
| Battle test
| Bond697
|
| 021A9DB2
| 0x80000000 OR PID decision routine
| Bond697
|
| 021A9DE8
| ((rand() * 0xFFFF) >> 32) /0x290 -> function is called quite a bit for multiple calcs
| Bond697
|
| 021A9DF8
| Fishing decision
| arcee
|
| 021AA700
| ((rand() * 0xFFFF) >> 32) /0x290 -> seems to only be used for battle tests
| Bond697
|
| 021AA44C
| White Forest Battle Decision Routine- return 0 if no battle, 1 if there's a battle
| Bond697
|
| 021BC4F8
| Player setup on new game
| Bond697
|
| 021BC50A
| Make IDs
| Bond697
|
| 021BFBD0
| Opponent accuracy
| arcee
|
| 021C0A6C
| Battle routine(setup)
| Bond697
|
| 021C2466
| Status infliction routine
| arcee
|
| 021C390C
| Complete breeding routine
| Bond697
|
| 021C4048
| International breeding PID generation
| Bond697
|
| 021C6C18
| Damage formula routine
| Bond697
|
| 021F6388
| Battle PRNG State
| Kaphotics
|
| 02215374
| Mersenne Twister Lookup Table
| Bond697
|
| 02215D34
| Mersenne Twister Lookup Table Counter
| Bond697
|
| 02216244
| PRNG State
| Bond697
|
| 02168844
| rand(0xFFFFFFFF) / 0xFFFF
| Bond697
|
| 02168A52
| ID generation for Battle Subway partner
| Bond697
|
| 021763DC
| Inside probability loop
| Bond697
|
| 021763F8
| Probability routine- influences starting frame/seed
| Bond697
|
| 02176444
| Outside probability loop
| Bond697
|
| 02176C6C
| Probability table
| Bond697
|
| 0221BBD0
| Start of save data in RAM(when saving, all relevant data is written here, then cart RAM, then .sav)
| Bond697
|
| 0223C9D0
| Daycare pokemon 1
| Bond697
|
| 0223CAB4
| Daycare pokemon 2
| Bond697
|
| 0223D8CC
| BP Counter
| Bond697
|
| 02250030
| Encounter slots in RAM
| Bond697
|
| 02257030
| Step Counter
| Bond697
|
| 02257034
| Shaking Patch Step Counter
| Bond697
|
| 0226DC5A
| Move Consecutive Use Counter (Wild Battle)
| Kaphotics
|
| 0226DC66
| Protect Consecutive Turn Counter (Wild Battle)
| Kaphotics
|
| 0226E70E
| Move Consecutive Use Counter (Trainer Battle)
| Kaphotics
|
| 0226E71A
| Protect Consecutive Turn Counter (Trainer Battle)
| Kaphotics
|
| 02274302
| Move Decision Dump (Wild Battle)
| Kaphotics
|
| 022BC734
| Are there trainers in White Forest? (bool)
| Bond697
|
| 0233F004
| Egg step counter
| ToastPlusOne
|
| 02FE0000
| DTCM start
| Bond697
|
| 02FE0020
| Interrupt handler lookup table
| Bond697
|
| 02FE3780
| Main(user/system mode) stack start
| Bond697
|
| 02FE3F80
| IRQ mode stack start
| Bond697
|
| 02FE3FC0
| Supervisor mode stack start
| Bond697
|
| 02FFFC3C
| Vertical blank counter buffer
| OmegaDonut
|
| 02FFFDE8
| RTC buffer(char rtc[8])
| OmegaDonut
|
| 037FBCEC
| ARM7 IRQ Handler
| Bond697
|
| 022394E0
| Date/time in hex - uint array
| Bond697
|
| 021AA41C
| Battle test/decision
| Bond697
|
| 0224120C
| Wifi RNG
| Bond697
|
| 0203AE38
| Seed building routine for wifi RNG
| Bond697
|
(All offsets are White offsets. Black offsets are White offset minus 0x20)
| RAM Address
| Description
| Discovered by
|
| 02020000
| Timer1 storage on TID creation
| Bond697
|
| 020249C0
| Main RNG Frame counter
| mingot
|
| 030022E0
| Timer PRNG Initial State (Egg PIDs)
| Kaphotics
|
| 03002750
| IRQ Handler (user mode)
| Bond697
|
| 03005D80
| PRNG State
| mingot
|
| 03005D84
| Timer RNG Current Seed (Egg PIDs)
| Kaphotics
|
| 08000248
| IRQ setup
| Bond697
|
| 080003A4
| Main loop
| Bond697
|
| 080005E4
| Keypress handler
| Bond697
|
| 08000738
| VBlank interrupt callback
| Bond697
|
| 08000988
| Memblock header setup
| Bond697
|
| 08000B1C
| Malloc init
| Bond697
|
| 08000B38
| Declare memblock(malloc()?)
| Bond697
|
| 0806F5CC
| PRNG Advancement Routine
| mingot
|
| 080B49E2
| Feebas setup routine on finding a Feebas tile
| Bond697
|
|
| Start Method H
|
|
| 080B5144
| Battle Test
| Bond697
|
| 080B4AC8
| Encounter Slot
| Bond697
|
| 080B4C74
| Set level
| Bond697
|
| 080B4E2A
| Sync (bool)
| Bond697
|
| 080B4E4C
| Nature Setup/Decision (skip if sync() == TRUE)
| Bond697
|
| 08067E96
| PKM Building Routine (test temp PIDs, make IVs on success)
| Bond697
|
|
| End Method H
|
|
| 08067BF8
| Roamer creation start
| Bond697
|
| 082E7BE0
| Modulus routine- r0 % r1, return result in r0
| Bond697
|
| 0817759E
| ARNG
| Bond697
|
| 0806D088
| Get nature from tempPID(pass tempPID as an arg, return nature value)
| Bond697
|
| 03000DC0
| RTC array buffer(char rtc[8])
| Bond697
|
| 03000E20
| Directional movement counters(possibly per frame)
| Bond697
|