Jump to content

Search the Community

Showing results for 'Sprite Index' in technical documents.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Pokémon
    • Pokémon (Ultra Sun/Ultra Moon)
    • Pokémon (Sun/Moon)
    • Pokémon (PSMD)
    • Pokémon (EoS)
  • Egg Groups
    • Egg Groups (Ultra Sun/Ultra Moon)
    • Egg Groups (Sun/Moon)
  • Moves
    • Moves (Ultra Sun/Ultra Moon)
    • Moves (Sun/Moon)
    • Moves (PSMD)
    • Moves (EoS)
  • Abilities
    • Abilities (Ultra Sun/Ultra Moon)
    • Abilities (Sun/Moon)
    • Abilities (PSMD)
  • Types
    • Types (Ultra Sun/Ultra Moon)
    • Types (SM)
    • Types (PSMD)
    • Types (EoS)

Categories

  • Pokémon HOME
  • Generation 9
  • Generation 8
  • Generation 7
  • Generation 6
  • Generation 5
  • Generation 4
  • Mystery Dungeon 3DS
  • Mystery Dungeon NDS
  • Sprite Index
  • Other

Categories

  • Project Pokémon
  • Games
    • Pokémon Ultra Sun and Ultra Moon
    • Pokémon Sun and Moon
    • Pokémon Super Mystery Dungeon

Categories

  • Save Editing
    • Managing GB/GBC Saves
    • Managing GBA Saves
    • Managing NDS Saves
    • Managing 3DS Saves
    • Managing Gamecube Saves
    • Managing Wii Saves
    • Managing Switch Saves
    • Using PKHeX
    • Gen 3 Specific Edits
    • Gen 4 Specific Edits
    • Gen 5 Specific Edits
    • Gen 6 Specific Edits
    • Gen 7 Specific Edits
    • Gen 8 Specific Edits
    • Gen 9 Specific Edits
  • ROM Editing
    • Stars' Pokémon Colosseum and XD Hacking Tutorial
    • Editing ROMs with Sky Editor
    • NDS Pokémon Games Hacking Tutorials
    • 3DS Pokémon Games Hacking Tutorials
    • Switch Pokémon Games Hacking Tutorials
  • RAM Editing
    • GS ACE: Coin Case
    • GS ACE: TM17
  • Gameplay related support
    • How to play Rescue Team DX ROM hacks
    • e-reader support
    • Max Raid RNG Manipulation

Forums

  • ProjectPokemon.org
    • Announcements
    • News Discussion
    • Project Pokémon Feedback
    • Introductions
  • Event Pokémon
    • Event Pokémon News
    • Event Contributions
    • Events Help and Questions
  • Technical Discussions
    • ROM
    • Saves
    • RAM and Live Edits
    • Hardware
    • General Development
  • Pokémon Discussions
    • Pokémon Games Discussion
    • Pokémon Online Play
    • Pokémon Franchise
  • Other
    • Creative Discussion
    • General Gaming
    • Off Topic
  • Mystery Dungeon Hacking's Discussions
  • The "I Love Cats" Club's Discussions
  • The Cool Kids Corner's Discussions
  • Team Valor's General Discussion
  • Pokemon USUM Breeder's Club's Rules
  • Pokemon USUM Breeder's Club's Post breeding stories & pictures here
  • Pokemon USUM Breeder's Club's Competitive Breeding Requests
  • Pokemon USUM Breeder's Club's Non-Competitive Breeding Requests
  • Pokemon USUM Breeder's Club's Introduce self
  • The PBOE, (Pokémon Brotherhood of Evil)'s Topics
  • Sky Editor's Topics
  • Sky Editor's Questions
  • Hoopa's Café's Topics
  • Super pokemon POWER's Topics
  • Steel Of Time Club's Topics

Calendars

  • Pokémon Event Calendar
  • The "I Love Cats" Club's Events
  • Hoopa's Café's Important Dates
  • Super pokemon POWER's Events
  • Steel Of Time Club's Events

Categories

  • Event Gallery
    • Pokémon HOME
    • Generation 9
    • Generation 8
    • Generation 7 (Switch)
    • Generation 7 (3DS)
    • Generation 6
    • Generation 5
    • Dream World
    • C-Gear Skins
    • Pokédex Skins
    • Pokémon Musicals
    • Pokémon World Tournaments
    • Generation 4
    • Generation 3
    • Generation 2
    • Generation 1
  • In-Game Series
    • Pokémon GO -> HOME Transfers
    • Generation 9
    • Generation 8
    • Generation 7
    • Generation 6
    • Generation 5
    • Generation 4
    • Generation 3
    • Generation 2
    • Generation 1
  • Unreleased/Beta PKM Gallery
  • Tools
    • Save Editing
    • ROM Editing
    • RAM Editing
    • Files compatible w/ Saves
  • Saves and RAM edits
    • User Contributed Saves
    • User Contributed RAM edits and cheat files
    • User Contributed Super Secret Bases
  • PKM Files
    • User Contributed PKM files
  • ROM related entries
    • ROM hacks
    • Image Assets
    • Custom Resources
  • Misc
    • Images
    • Tools
  • Mystery Dungeon Hacking's Files
  • Hoopa's Café's Files
  • Super pokemon POWER's Files
  • Steel Of Time Club's Files

Blogs

  • Project Pokémon
  • Evan's Dev Blog
  • Diary
  • Pokémon Mystery Dungeon: Gate of the Shooting Star
  • theSLAYER's thoughts and ramblings
  • Alack Alay!
  • Mario and Lugi
  • Diary of Borjitasstoi
  • Bigjon357
  • Benjamen
  • Céliana || Cecillia || TheRealProcyon's Fun Blog
  • the manufacturing of steel structural parts
  • The Best in Career Guidance
  • How I Get My FREE ROBUX In One Easy Lesson
  • hello kitty has a day :3
  • Dairy, perharps pokemon
  • Trainer Sagas; An original series premiering on Cupencil!
  • Pokemon and their trainer bond in Pokémon GO
  • Pokemon distribution
  • Pknx error
  • Upgrated PPRE2 Editing Gen IV Pokemon Stats/Moves Beta Release!
  • Pokémon cards in Canada
  • UTI Relief Starts Here at Prime Health
  • Staff Discussions's Blog
  • Mystery Dungeon Hacking's Blog
  • The Cool Kids Corner's Blog
  • Project Pokemon Fun Club!'s Blog: Random Stuff
  • Project Pokemon Fun Club!'s Blog.. So fun..So wow...SHARE YOUR NEWS!
  • Create your own Pokemon Region's Storyline
  • Create your own Pokemon Region's Team Rocket of the Region
  • Create your own Pokemon Region's Pokemon Region base off of.....
  • Create your own Pokemon Region's Pokemon Region main Character
  • Sky Editor's Sky Editor
  • Sky Editor's Blog
  • Hoopa's Café's Blog
  • Steel Of Time Club's Blog
  • SkyTemple Documentation's Documentation & Tutorial Drafts

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Gender


About Me


Friend Code (Nintendo Switch)


Friend Code (3DS)


NNID (Wii U)

  1. theSLAYER

    Generation 2: Headbutt Mechanics

    Introduction Generation 2 saw the introduction of Headbutt as a field move, as a new way to obtain different Pokemon. By now, players probably know that certain rare Pokemon can only be found in certain headbuttable trees, but may be unaware how to differentiate moderate encounter trees from low encounter trees. The intention behind this document, is to log the necessary information relating to this. Mechanic Explanation On every map, every tile can be assigned a value that ranges from 0 to 9, based on it's distance from tile 0 (the upper left tile). When a tree falls on said tile, the value on the tile will be used in the determination of whether the headbuttable tree will result in a moderate or low encounter type. The formula used to determine the tree's index: index = ( ( X * Y + X + Y ) / 5 ) % 10 The determination whether the index will result in moderate or low encounter type, depends on the value of the Trainer ID. The formula used to determine the rare index (basically the last digit/right-most digit on the TID): rare_index = trainer_id % 10 Example of usage For example, if your Trainer ID is 26117, the rare index is 7. Meaning every tree with the index 7 on that map will result in a low encounter type of tree. Here's an example: With the circled tree in the image, users can potentially encounter Heracross there! Implemention As seen in the image above, there's actually a web tool that presently works. The web tool is created by u/TShadowKnight on reddit. In the event the tool goes offline, I've got all the maps data recorded! (Or if you prefer to know which map has the mon, but want to go hunting.) The table below shows which index tree is available on which map. Map Available Tree Indexes Missing Tree Index Unique to Rare Tree on Map Gold Silver Crystal Azalea Town 0, 1, 2, 3, 4, 5, 6, 8, 9 7 Pineco Pineco Pineco Ilex Forest 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Pineco Pineco Butterfree, Beedrill, Noctowl, Pineco Lake of Rage 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Pineco Pineco Pineco Route 26 9 0, 1, 2, 3, 4, 5, 6, 7, 8 Pineco Pineco Pineco Route 27 0, 1, 3, 4, 5, 7, 9 2, 6, 8 Pineco Pineco Pineco Route 29 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Heracross Heracross Pineco Route 30 0, 1, 2, 3, 4, 5, 6, 7 8, 9 Heracross Heracross Pineco Route 31 1, 2, 3, 4, 5, 6, 7, 8, 9 0 Heracross Heracross Pineco Route 32 1, 2, 3, 5, 6, 7, 8, 9 0, 4 Heracross Heracross Pineco Route 33 6, 9 0, 1, 2, 3, 4, 5, 7, 8 Heracross Heracross Heracross Route 34 0 1, 2, 3, 4, 5, 6, 7, 8, 9 Pineco Pineco Pineco Route 35 0, 5, 6, 9 1, 2, 3, 4, 7, 8 Pineco Pineco Pineco Route 36 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Pineco Pineco Pineco Route 37 0, 3, 4, 5, 7, 9 1, 2, 6, 8 Pineco Pineco Pineco Route 38 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Pineco Pineco Pineco Route 39 2, 7, 8 0, 1, 3, 4, 5, 6, 9 Pineco Pineco Pineco Route 42 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Heracross Heracross Heracross Route 43 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Heracross Heracross Pineco Route 44 0, 1, 2, 3, 4, 5, 6, 7, 9 8 Heracross Heracross Heracross For images of the specific maps, go here: Sources The formulas regarding the Headbutt mechanics: https://bulbapedia.bulbagarden.net/wiki/Headbutt_tree Tiles overlaying the maps: http://37.97.147.73/Headbutt Grid.htm from u/TShadowKnight on reddit
  2. Pokestar Opponents (as in pseudo-Pokemon) Pokestar Trainer sprites (Opponents and backs) Others
  3. evandixon

    X/Y File System

    Authors: Kaphotics, magical, Zhorken a/0/0/0: bits of Pokémon status interface? strings seem to indicate status icons, type icons, damage class icons,... a/0/0/1: 3 × CGFX a/0/0/2: pokelist (more bits of interface?), camera & lighting CGFX a/0/0/3: substitute texture (+model?) a/0/0/4: moooore bits of interface? a/0/0/5: battle interface? status/type icons a/0/0/6: species related binary file a/0/0/7: pokemon models a/0/0/8: map fade animation a/0/0/9: 20 BCH (+1 dummy) “tuki(h)(0-9)”, 3 binary a/0/1/0: child menu (gray) a/0/1/1: cute menu (orangered) a/0/1/2: encounters (other map data?) zonedata in [360.0] * encounters - https://db.tt/s8DSBBnz [Dead link] * location names - http://pastebin.com/5nUR9xpU (@0x1C zd, txt file 72) a/0/1/3: map models a/0/1/4: config UI a/0/1/5: bclims/an - berries “nuts_pile”, balloon, background a/0/1/6: amie minigame yarns, puffs & UI a/0/1/7: pokepuff UI a/0/1/8: camera UI a/0/1/9: namechange/input UI a/0/2/0: alphabetical/phonetic sorting logic binaries? a/0/2/1: MM BCH (overworld entity models?) a/0/2/2: 269 * 24byte, 1*136byte (16 entries, 8bp?) a/0/2/3: 78 * (4byte header count, 0x50 entry) a/0/2/4: 380 BM BCH map objects (fountain, chandelier) a/0/2/5: 144 * (4byte header count, 100byte entry) a/0/2/6: bottom screen UI (PSS/Amie bg, Pokemon/Bag Circulars) a/0/2/7: PSS specific UI (dummy trainers, birthday, icons) a/0/2/8: reaction faces, amie buttons UI a/0/2/9: super training UI a/0/3/0: super training bags, enemy portraits a/0/3/1: 59 * (4byte length) a/0/3/2: cursor & hover effects (waza oboe) a/0/3/3: 1779 × CGFX - battle effect graphics? a/0/3/4: pokeball model a/0/3/5: vs trainer plates & battle fade gfx a/0/3/6: 904 × SESD a/0/3/7: 16 × CGFX emitted models (exclamation, heart) a/0/3/8: 785 * 20 bytes a/0/3/9: 178 * 16 bytes a/0/4/0: Trainer Pokemon a/0/4/1: 1030 * varied GR a/0/4/2: 227 * varied MM a/0/4/3: amie face a/0/4/4: amie hand a/0/4/5: pss enemy/self connection a/0/4/6: pss interaction option buttons a/0/4/7: pss lower team bclan a/0/4/8: pss interfare(?) redundant stuff a/0/4/9: pss yesno a/0/5/0: pss msg a/0/5/1: pss npc & icon folder a/0/5/2: pss select effects a/0/5/3: pss checklist a/0/5/4: pss object select a/0/5/5: pss lower window anim a/0/5/6: pss menu sprites a/0/5/7: pss config a/0/5/8: pss selectmenu a/0/5/9: pss battle lower a/0/6/0: 1 binary a/0/6/1: 39 binary * various (floating point numbers?) a/0/6/2: Weather Effects ~ 9 * WE CGFX/BCH a/0/6/3: bag sprites a/0/6/4: salon 8 * CGFX a/0/6/5: 2 * CGFX ~ kujira_CullingShader a/0/6/6: Lumiose subMap a/0/6/7: pss colosseum a/0/6/8: 1 binary (4 byte entries?) a/0/6/9: town map UI a/0/7/0: title language UI a/0/7/1: report (last on / off) a/0/7/[2-9]: text (ja-kana, ja-kanji, en, fr, it, de, es, ko) a/0/8/[0-7]: script text a/0/8/8: Clothing Mannequin model (612 bch), 19 binary a/0/8/9: Player Trainer models a/0/9/0: ??? ← as about everything? (signed int tables? 1091) a/0/9/1: Apparel animation/UI a/0/9/2: TM BCH for gym04 a/0/9/3: pokemon icons (945, 40×30) (montage) a/0/9/4: item icons (579, 30×30) (montage) a/0/9/5: move category sprites a/0/9/6: bordered message boxes (?) a/0/9/7: held item sprite, xp/hp fillers a/0/9/8: pkmdata summary view sprites (pkrscure, penta, marks) a/0/9/9: time spinner a/1/0/0: cursor a/1/0/1: cries (3751×CSEQ + 997×CWAR) a/1/0/2: 160 CGFX (okashi/Candy) a/1/0/3: 2 CGFX (lighting?), 1 BIN (22byte entries, 307 total) a/1/0/4: box UI (backgrounds,etc) a/1/0/5: 24 CGFX pokeballs a/1/0/6: pokeball models a/1/0/7: 1 BIN (2049 bytes) a/1/0/8: TM CGFX (‘jump out’ tobidashi) a/1/0/9: 4 CGFX, 5 BCH, 1 darc (pokeselect) a/1/1/0: grass gym ™ a/1/1/1: shop UI a/1/1/2: 1 bin, PSS spritebuilding a/1/1/3: badge case a/1/1/4: pokemon view UI a/1/1/5: intro CGFX a/1/1/6: encount tile/panels (pc, 30 each) a/1/1/7: pc buttons a/1/1/8: trade UI a/1/1/9: super training UI a/1/2/0: super training minigame stuff with 85 BCH, 1 CGFX a/1/2/1: 47 * 12 bytes a/1/2/2: 36 * (header count @0x4, 0xC entry length) a/1/2/3: 48 * 32 bytes a/1/2/4: 80 * 236 bytes a/1/2/5: 80 * 216 bytes a/1/2/6: 500 * 36 bytes (end is unused) a/1/2/7: 500 * 28 bytes (end is unused) a/1/2/8: 63 * 120 “” a/1/2/9: 50 * 120 “” a/1/3/0: 80 * 20 a/1/3/1: 100 * 244 a/1/3/2: 58 * 244 a/1/3/3: 80 * 64 a/1/3/4: 80 * 80 a/1/3/5: 109 CGFX (effects?) a/1/3/6: little bit of data for each pokemon form a/1/3/7: evolution (shinka) CGFX & UI a/1/3/8: pokedex data sprites a/1/3/9: 2 TM (no ext?) a/1/4/0: Team Flare NPC Models a/1/4/1: common menu window a/1/4/2: 2 binary (index tables?) a/1/4/3: 28 CGFX cameras + darc video related a/1/4/4: 44 CGFX (mega transformation animations?) a/1/4/5: battle backgrounds? a/1/4/6: 26 BCH, 4 CGFX, 105 BG BCH a/1/4/7: 1 TM (rope/door) a/1/4/8: 1 TM BCH (fire) a/1/4/9: 170 binaries a/1/5/0: GTS Background & Windows a/1/5/1: 44 * various a/1/5/2: holo caster streetpass pokeball jpeg (with exif data!), debug camera a/1/5/3: assist power UI related a/1/5/4: box search UI a/1/5/5: 4 * SESD a/1/5/6: TM berrytree a/1/5/7: gym6 cgfx/anim a/1/5/8: customize amie a/1/5/9: amie bg 224 bclim (misc backgrounds/items) a/1/6/0: pokepuff sprites a/1/6/1: benri/handy button a/1/6/2: remembering move (waza omoidashi) UI a/1/6/3: finger pointing down icon a/1/6/4: pokeride TM CGFX (riding rhydon) a/1/6/5: title screens, map models a/1/6/6: list menu window a/1/6/7: 1 TM CGFX (skeletal wing? haze) a/1/6/8: 1 TM CGFX a/1/6/9: 6 × CGFX a/1/7/0: wonder UI a/1/7/1: 6 × CGFX a/1/7/2: gamesync a/1/7/3: 26 BCH a/1/7/4: 1 TM BCH gym08 a/1/7/5: 1 TM CGFX a/1/7/6: text dialog windows a/1/7/7: 1 TM CGFX a/1/7/8: trainer sprites a/1/7/9: battlematch UI a/1/8/0: 66 * SESD a/1/8/1: TM cut tree animation CGFX a/1/8/2: TM rock smash(?) animation CGFX a/1/8/3: TM rock strength(?) animation CGFX a/1/8/4: TM dig animation (anahoru) CGFX a/1/8/5: 4 CFNT fonts a/1/8/6: Friend entry UI a/1/8/7: TM water animation CGFX a/1/8/8: 23 MM a/1/8/9: 38 * 604 bytes a/1/9/0: battle video save a/1/9/1: TM CGFX of a red/blue switch & belt a/1/9/2: a handful of grammar bits in different languages a/1/9/3: traial UI/bg a/1/9/4: 15 * various bin (16bit indexes) a/1/9/5: TM BCH tr0906+ trainer models? a/1/9/6: 2 BCH kujira_CullingShader a/1/9/7: 1 BIN; 2A entries @ 0x54/84d ea a/1/9/8: communications wait a/1/9/9: 22 TGA images (TRUEVISION-XFILE) a/2/0/0: friend safari UI a/2/0/1: camera CGFX a/2/0/{3,5,7}: Normal Maison, Super Maison, and Inverse Battle PKM a/2/0/{4,6}: Normal Maison & Super Maison Trainer choices a/2/0/8: memory clear UI a/2/0/9: homenix UI (no pressing home?) a/2/1/0: com_towerin BCH a/2/1/1: com_tower BCH (buildings)? a/2/1/2: move stats a/2/1/3: egg moves a/2/1/4: level-up moves a/2/1/5: evolution data a/2/1/6: mega "evolution" map a/2/1/7: 8 * 404 bytes (101 entries) a/2/1/8: pokemon stats (personal) a/2/1/9: baby map a/2/2/0: item stats a/2/2/1: 718 byte binary (int vals?) a/2/2/2: battle video UI a/2/2/3: syoujyou (diploma/certificate) dex complete a/2/2/4: dendoiri (certificate) BCH model a/2/2/5: language selection a/2/2/6: number input lower a/2/2/7: ‘picture watch’ a/2/2/8: eshop item present a/2/2/9: battle institute certificate a/2/3/0: TM BCH glittering grass a/2/3/1: miracle wonder trade UI a/2/3/2: vs battle UI (score) a/2/3/3: TM BCH smoke/scaffolding? a/2/3/4: battle house UI a/2/3/5: TM BCH gym05 floor a/2/3/6: TM CGFX lighting (pichu heart/star?) a/2/3/7: 6 TM models (face/armsbody) a/2/3/8: TM BCH waterfall splash a/2/3/9: type icons and other stuff a/2/4/0: bclims: “ally_gauge”, “bag_button”, “battle timer”... a/2/4/1: bclims: “big_four_name01” through 04, “big_four_vs”, similar for champion/gym a/2/4/2: vs win/loss images a/2/4/3: bclims: “high_score”, “result_title”, … a/2/4/4: bclims: “clear”, “cleared”, “gameover_c”, “meter_bougyo”, … a/2/4/5: 1 SESD a/2/4/6: live/world online tournament UI a/2/4/7: 13 CGFX (flower,notes) a/2/4/8: TM BCH fishing float bite a/2/4/9: “The End” screen a/2/5/0: two short files; all bytes 0x06 or below a/2/5/1: odd, short file a/2/5/2: bclans: “tutorial_active_lower”, “tutorial_lower_cansel”, … a/2/5/3: bclims: amie and super training overview pics (tutorial?) a/2/5/4: battle party poke select UI a/2/5/5: 7 bins, 24byte entries (header u32 entry ct) a/2/5/6: SMDH game icon (large/small) & 2 bin a/2/5/7: battle video UI (local tournament?) -- lacking delete a/2/5/8: staffroll credits a/2/5/9: 36200byte & 400byte bins a/2/6/0: stereo frame ani a/2/6/1: game over ani a/2/6/2: battle fade-in effects (flare rock fly etc) a/2/6/3: game sync screenshots a/2/6/4: pokedex captions / search filter UI a/2/6/5: the end “Fin” a/2/6/6: BCH CGFX type backgrounds (color & a sun) (hall of fame?) a/2/6/7: fatal error screen a/2/6/8: mode01 mode02 mode04 bclim a/2/6/9: congratulations a/2/7/0: fade animation Original link: http://pastebin.com/QNCz7Avh
  4. evandixon

    Platinum Save Structure

    This page is under construction, because previously, there was pretty much NO documentation here. I will add more as I continue my research, but since no one seems keen to volunteer the information, it is based off my own research. Small block offsets Trainer Name - 0x68 8 unsigned 16-bit integers. Each word represents a character in the game's character table. Trainer ID - 0x78 Random unsigned 16-bit integer The visible identification number of a trainer Determines ownership of Pokémon. Secret ID - 0x7A Random unsigned 16-bit integer The hidden identification number of a trainer Determines ownership of Pokémon. Determines variation in the game. Money - 0x7C Unsigned 32-bit integer. Limited to 0xF423F (999,999) Trainer Gender - 0x80 0 if male, 1 if female. Determines ownership of Pokémon. Country of Origin - 0x81 Unsigned 8-bit integer. Determines whether or not Pokémon get an outsider EXP bonus. Countries other than Japan are inferred from D/P/Pt, since the game has only been released in Japanese. 0x1 = 日本語 (Japan) 0x2 = English (US/UK/AU) 0x3 = Français (France/Québec) 0x4 = Italiano (Italy) 0x5 = Deutsch (Germany) 0x7 = Español (Spain/Latin Americas) 0x8 = 한국어 (South Korea) Badges - 0x82 Unsigned 8-bit bitfield Determines what PokéMart items are for sale, what level outsider Pokémon will obey until, and flags certain in-game events. 0x01 = Coal Badge 0x02 = Forest Badge 0x04 = Cobble Badge 0x08 = Fen Badge 0x10 = Relic Badge 0x20 = Mine Badge 0x40 = Icicle Badge 0x80 = Beacon Badge Multiplayer Avatar - 0x83 Unsigned 8-bit integer. Determines the sprite seen by other players in a multi-player environment such as the Union Room. 0x00 = None 0x03 = School Kid 0x05 = Bug Catcher 0x06 = Lass 0x07 = Battle Girl 0x0B = Ace Trainer Male 0x0D = Beauty 0x0E = Ace Trainer Female 0x0F = Roughneck 0x1F = Pop Idol 0x23 = Social 0x25 = Cowgirl 0x2A = Ruin Maniac 0x32 = Black Belt 0x3E = Rich Boy 0x3F = Lady 0x46 = Psychic Please correct if these are wrong, or if there are more. Number of Current Party Pokémon - 0x9C Unsigned 8-bit integer. Note: In my opinion this is actually a 32-bit integer, but only 8 bits of it are ever used. Party Pokémon - 0xA0 The Pokémon in the trainer's party. 6 blocks of 236 byte structures Main article: Pokemon NDS Structure General Items - 0x630 Main article: Other items The items in the Trainer's general Items bag pocket. 165 blocks of 4 byte structures (two bytes for item index, two bytes for quantity) Key Items - 0x8C4 Main article: Key items The items in the Trainer's Key Items bag pocket. 50 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). TMs & HMs - 0x98C Main article: TMs and HMs The items in the Trainer's TMs & HMs bag pocket. 100 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). TMs & HMs are auto-sorted by item index in ascending order. Mail - 0xB1C Main article: Mail The items in the Trainer's Mail bag pocket. 12 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Medicine - 0xB4C Main article: Medicine The items in the Trainer's Medicine bag pocket. 40 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Berries - 0xBEC Main article: Berries The items in the Trainer's Berries bag pocket. 64 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Berries are auto-sorted by item index in ascending order. Balls - 0xCEC Main article: Pokéballs The items in the Trainer's Balls bag pocket. 15 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Battle Items - 0xD28 Main article: Battle items The items in the Trainer's Battle Items bag pocket. 30 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Starter Pokémon - 0xE0C The Pokédex number of the starter chosen. Unsigned 16-bit integer. Lotto number - 0xE24 Unsigned 16-bit integer. Has obtained lotto prize - 0x1141 1 if obtained, 0 if not yet obtained. Rival's Name - 0x27E8 8 unsigned 16bit integers. Each word represents a character in the game's character table. Safari Zone Pokémon - 0x7F24 Unsigned 32bit integer result from the ARNG. Four daily safari zone Pokémon Indexn = ( ARNG >> ( n * 0x5 ) ) & 0x1F List of Safari Zone Pokémon Notes: Both Safari Zone Pokémon and Swarm Pokémon have the same ARNG value. Swarm Pokémon - 0x7F28 Unsigned 32bit integer result from the ARNG. One daily swarm Pokémon Index = ARNG % 0x1C List of Swarm Pokémon Notes: Both Safari Zone Pokémon and Swarm Pokémon have the same ARNG value. Daily Trophy Pokémon Today - 0x7F30 Unsigned 8bit integer First daily trophy garden Pokémon List of Daily Trophy Pokémon Daily Trophy Pokémon Yesterday - 0x7F32 Unsigned 8bit integer Second daily trophy garden Pokémon List of Daily Trophy Pokémon Notes: Yesterday's Pokémon can be caught after beating the Elite 4 and receiving the National Pokédex upgrade. Honey Trees - 0x7F38 21 blocks of 8byte structures List of Honey Tree locations Main article: Honey Trees
  5. Pokémon NDS uses a checksum at the footer each block in the save file to ensure consistent data. Diamond & Pearl usage filestream.Seek( 0xC0FE, SeekOrigin.Begin ); GetCheckSum( smallblock1 ); //small block 1 filestream.Seek( 0x1E2DE, SeekOrigin.Begin ); GetCheckSum( bigblock1 ); //big block 1 filestream.Seek( 0x4C0FE, SeekOrigin.Begin ); GetCheckSum( smallblock2 ); //small block 2 filestream.Seek( 0x5E2DE, SeekOrigin.Begin ); GetCheckSum( bigblock2 ); //big block 2 Platinum usage filestream.Seek( 0xCF2A, SeekOrigin.Begin ); GetCheckSum( smallblock1 ); //small block 1 filestream.Seek( 0x1F10E, SeekOrigin.Begin ); GetCheckSum( bigblock1 ); //big block 1 filestream.Seek( 0x4CF2A, SeekOrigin.Begin ); GetCheckSum( smallblock2 ); //small block 2 filestream.Seek( 0x5F10E, SeekOrigin.Begin ); GetCheckSum( bigblock2 ); //big block 2 Determining the seeds public static int[] SeedTable; public static void GetSeeds() { SeedTable = new int[0x100]; int index = 0; int result = 0; do { result = index << 8; int index2 = 0; do { if (((byte)(result>>8) & 0x80)!=0) result = (2 * result )^ 0x1021; else result *= 2; } while (++index2 < 8); SeedTable[index++] = (ushort)(result); } while (index <= 0xFF); } Also a static list can be used with the following values: public static readonly int[] SeedTable = new int[] { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 }; Determining the checksum data is a byte array for a small block or big block. public ushort GetCheckSum( byte[] data ) { int sum = 0xFFFF; for ( int i = 0; i < data.Length; i++ ) sum = (sum << 8) ^ SeedTable[ (byte)(data[i] ^ (byte)(sum>>8)) ]; return (ushort)sum; }
  6. evandixon

    HGSS Save Structure

    Small block offsets Adventure Started - 0x34 Unsigned 32bit integer. Number of seconds since 1/1/2000 00:00:00 Pokémon League Champ Date - 0x3C Unsigned 32bit integer. Number of seconds since 1/1/2000 00:00:00 Trainer Name - 0x64 8 unsigned 16bit integers. Each word represents a character in the game's character table. Trainer ID - 0x74 Random unsigned 16bit integer The visible identification number of a trainer Determines ownership of Pokémon. Secret ID - 0x76 Random unsigned 16bit integer The hidden identification number of a trainer Determines ownership of Pokémon. Determines variation in the game. Money - 0x78 Unsigned 32bit integer. Limited to 0xF423F (999,999) Trainer Gender - 0x7C 0 if male, 1 if female. Determines ownership of Pokémon. Country of Origin - 0x7D Unsigned 8bit integer. Determines whether or not Pokémon get an outsider EXP bonus. Countries other than Japan are inferred from D/P/Pt, since the game has only been released in Japanese. 0x1 = 日本語 (Japan) 0x2 = English (US/UK/AU) 0x3 = Français (France/Québec) 0x4 = Italiano (Italy) 0x5 = Deutsch (Germany) 0x7 = Español (Spain/Latin Americas) 0x8 = 한국어 (South Korea) Johto League Badges - 0x7E Unsigned 8bit bitfield Determines what PokéMart items are for sale, what level outsider Pokémon will obey until, and flags certain in-game events. 0x01 = Zephyr Badge 0x02 = Hive Badge 0x04 = Plain Badge 0x08 = Fog Badge 0x10 = Storm Badge 0x20 = Mineral Badge 0x40 = Glacier Badge 0x80 = Rising Badge Multiplayer Avatar - 0x7F Unsigned 8bit integer. Determines the sprite seen by other players in a multiplayer environment such as the Union Room. 0x00 = None 0x03 = School Kid 0x05 = Bug Catcher 0x06 = Lass 0x07 = Battle Girl 0x0B = Ace Trainer Male 0x0D = Beauty 0x0E = Ace Trainer Female 0x0F = Roughneck 0x1F = Pop Idol 0x23 = Social 0x25 = Cowgirl 0x2A = Ruin Maniac 0x32 = Black Belt 0x3E = Rich Boy 0x3F = Lady 0x46 = Psychic Kanto League Badges - 0x83 Unsigned 8bit bitfield Determines what PokéMart items are for sale, what level outsider Pokémon will obey until, and flags certain in-game events. 0x01 = Boulder Badge 0x02 = Cascade Badge 0x04 = Thunder Badge 0x08 = Rainbow Badge 0x10 = Soul Badge 0x20 = Marsh Badge 0x40 = Volcano Badge 0x80 = Earth Badge Total Playtime - 0x86 Hours = unsigned 16bit integer. Minutes = unsigned 8bit integer. Seconds = unsigned 8bit integer. Number of Current Party Pokémon - 0x94 Unsigned 8bit integer. Party Pokémon - 0x98 The Pokémon in the trainer's party. 6 blocks of 236byte structures Main article: Pokemon NDS Structure General Items - 0x644 Main article: Other items The items in the Trainer's general Items bag pocket. 165 blocks of 4 byte structures (two bytes for item index, two bytes for quantity) Key Items - 0x8D8 Main article: Key items The items in the Trainer's Key Items bag pocket. 43 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). TMs & HMs - 0x9A4 Main article: TMs and HMs The items in the Trainer's TMs & HMs bag pocket. 100 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). TMs & HMs are auto-sorted by item index in ascending order. Mail - 0xB34 Main article: Mail The items in the Trainer's Mail bag pocket. 12 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Medicine - 0xB64 Main article: Medicine The items in the Trainer's Medicine bag pocket. 40 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Berries - 0xC04 Main article: Berries The items in the Trainer's Berries bag pocket. 64 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Berries are auto-sorted by item index in ascending order. Balls - 0xD04 Main article: Pokéballs The items in the Trainer's Balls bag pocket. 24 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Battle Items - 0xD64 Main article: Battle items The items in the Trainer's Battle Items bag pocket. 31 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). First Registered Item - 0xDE0 The first Key items registered for use with the Y button. Unsigned 16bit integer, representing the ID of the item. Second Registered Item - 0xDE2 The first Key items registered for use with a button on the Touch Screen. Unsigned 16bit integer, representing the ID of the item. Starter Pokémon - 0xE44 The Pokédex number of the starter chosen. Unsigned 16bit integer. Map ID Number - 0x1234 Main article: MAP LIST HGSS Unsigned 16bit integer. Player Map X Coordinate - 0x236E Unsigned 16bit integer. Player Map Y Coordinate - 0x2372 Unsigned 16bit integer. Player Map Z Coordinate - 0x2376 Unsigned 16bit integer. Follower Map X Coordinate - 0x23BE Unsigned 16bit integer. Follower Map Y Coordinate - 0x23C2 Unsigned 16bit integer. Follower Map Z Coordinate - 0x23C6 Unsigned 16bit integer. Money held by mother - 0xC0D8 Unsigned 32bit integer. Limited to 0xF423F (999,999) Big block offsets Pokémon in Storage - 0xF700 The Pokémon in Bill's PC. 18 blocks of 4080byte structures (each box contains 30 136byte Pokémon structures). Each box structure is separated by 16 bytes of space (unlike D/P). Main article: Pokemon NDS Structure Box Names - 0x21708 18 blocks of 40byte structures The first 11 words (22 bytes) each word represent a character in the game's character table. Box Wallpapers - 0x219D8 18 bytes, each representing the wallpaper for the corresponding box. 0x20 = Ho-oh 0x21 = Lugia 0x22 = TV 0x23 = Pokéthlon 0x24 = Starters 0x25 = Pichu 0x26 = Ecruteak 0x27 = Team Rocket
  7. evandixon

    DP Save Structure

    General Save File Structure A Pokémon Diamond and Pearl save file is divided into two pairs of blocks. Each pair consists of one general block, one storage box block, and one hall of fame block. The storage box block contains current information regarding Bebe's storage system, including stored Pokémon, box names, box wallpapers, and the current open box. The general block contains current information on every other aspect of the game's progress, such as the trainer's name, ID number, acquired badges, party Pokémon, items, and much more. The hall of fame block contains information about the Pokémon used to defeat the Elite 4. The other pair is a backup from the previous save. The first general block in the file begins at 0x00000. The first storage block begins at 0x0C100. The first hall of fame block starts at 0x20000. The second general, storage, and hall of fame blocks are at the same address + 0x40000. The current blocks are not always stored in linear order in the save file (i.e. if the second general block is the more current, the first or second storage box block can possibly be the current as well). Block Footers The last 20 bytes of each general and storage box block is a footer. The last 24 bytes of each hall of fame block is a footer. The footer is used to determine: The size of the block Whether the block is current or a backup. Which big & small blocks link together. General/Storage Box Footer Offset Purpose 0x00 - 0x03 Storage Block Save Count 0x04 - 0x07 General Block Save Count 0x08 - 0x0B Size of block 0x0C - 0x0F Run-time usage 0x10 - 0x11 Run-time usage 0x12 - 0x13 Checksum Hall of Fame Footer Offset Purpose 0x00 - 0x03 Save ID number 0x04 - 0x07 Save index number 0x08 - 0x0B Run-time usage 0x0C - 0x0F Run-time usage 0x10 - 0x13 Size of block 0x14 - 0x15 Run-time usage 0x16 - 0x17 Checksum Loading/Saving A Save File When one starts a new game for the very first time, every byte of the save file is set to 0xFF. The first time the game is saved, the "current" info is written to the second half of the save file. This is important to note when loading a save. When the game loads a save file, it first compares the small block save count of both general blocks. If the general block with the highest save count has a correct checksum, then the game moves on to check the storage blocks. The storage block with the highest storage block save count is chosen first, and if its general block save count matches the currently chosen general block (and has a correct checksum), the file is successfully loaded. If both storage blocks have the same storage block save count, then the storage block with a higher general block save count is chosen instead, and the if the checksum is correct, the file is successfully loaded. If the checksum was incorrect for either block, the game falls on the other pair of general and storage blocks; if the checksums are correct in both, the game reports a save file corruption error, and that is the data loaded. If the checksum in either block is incorrect, the game reports a save file corruption error, and the save file is not loaded. A new game must be started at that point. When the game saves data, the general block save count is incremented + 1. If nothing in the storage block has changed, then no changes are made to the storage block and no further changes are made to the general block. However, if changes have been made to the storage block, then the storage block save count is incremented by 1 in both the storage block and general block footers. At this point, the backup general block is overwritten with the new general block data, and (if changes were made to the storage block), the backup storage block is also overwritten. This is the reason why the game varies on how long it takes to save. Thus, either general block can be linked with either storage block, and the current pair is identified using the footer information. Small block offsets Adventure Started - 0x34 Unsigned 32bit integer. Number of seconds since 1/1/2000 00:00:00 Pokémon League Champ Date - 0x3C Unsigned 32bit integer. Number of seconds since 1/1/2000 00:00:00 Trainer Name - 0x64 8 unsigned 16bit integers. Each word represents a character in the game's character table. Trainer ID - 0x74 Random unsigned 16bit integer The visible identification number of a trainer Determines ownership of Pokémon. Secret ID - 0x76 Random unsigned 16bit integer The hidden identification number of a trainer Determines ownership of Pokémon. Determines variation in the game. Money - 0x78 Unsigned 32bit integer. Limited to 0xF423F (999,999) Trainer Gender - 0x7C 0 if male, 1 if female. Determines ownership of Pokémon. Country of Origin - 0x7D Unsigned 8bit integer. Determines whether or not Pokémon get an outsider EXP bonus. 0x1 = 日本語 (Japan) 0x2 = English (US/UK/AU) 0x3 = Français (France/Québec) 0x4 = Italiano (Italy) 0x5 = Deutsch (Germany) 0x7 = Español (Spain/Latin Americas) 0x8 = 한국어 (South Korea) Badges - 0x7E Unsigned 8bit bitfield Determines what PokéMart items are for sale, what level outsider Pokémon will obey until, and flags certain in-game events. 0x01 = Coal Badge 0x02 = Forest Badge 0x04 = Cobble Badge 0x08 = Fen Badge 0x10 = Relic Badge 0x20 = Mine Badge 0x40 = Icicle Badge 0x80 = Beacon Badge Multiplayer Avatar - 0x7F Unsigned 8bit integer. Determines the sprite seen by other players in a multiplayer environment such as the Union Room. 0x00 = None 0x03 = School Kid 0x05 = Bug Catcher 0x06 = Lass 0x07 = Battle Girl 0x0B = Ace Trainer Male 0x0D = Beauty 0x0E = Ace Trainer Female 0x0F = Roughneck 0x1F = Pop Idol 0x23 = Social 0x25 = Cowgirl 0x2A = Ruin Maniac 0x32 = Black Belt 0x3E = Rich Boy 0x3F = Lady 0x46 = Psychic Total Playtime - 0x86 Hours = unsigned 16bit integer. Minutes = unsigned 8bit integer. Seconds = unsigned 8bit integer. Number of Current Party Pokémon - 0x94 Unsigned 8bit integer. Party Pokémon - 0x98 The Pokémon in the trainer's party. 6 blocks of 236byte structures Main article: Pokemon NDS Structure General Items - 0x624 Main article: Other items The items in the Trainer's general Items bag pocket. 165 blocks of 4 byte structures (two bytes for item index, two bytes for quantity) Key Items - 0x8B8 Main article: Key items The items in the Trainer's Key Items bag pocket. 50 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). TMs & HMs - 0x980 Main article: TMs and HMs The items in the Trainer's TMs & HMs bag pocket. 100 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). TMs & HMs are auto-sorted by item index in ascending order. Mail - 0xB10 Main article: Mail The items in the Trainer's Mail bag pocket. 12 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Medicine - 0xB40 Main article: Medicine The items in the Trainer's Medicine bag pocket. 40 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Berries - 0xBE0 Main article: Berries The items in the Trainer's Berries bag pocket. 64 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Berries are auto-sorted by item index in ascending order. Balls - 0xCE0 Main article: Pokéballs The items in the Trainer's Balls bag pocket. 15 blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Battle Items - 0xD1C Main article: Battle items The items in the Trainer's Battle Items bag pocket. 56 (?) blocks of 4 byte structures (two bytes for item index, two bytes for quantity). Starter Pokémon - 0xDFC The Pokédex number of the starter chosen. Unsigned 16bit integer. Lotto number - 0xE14 Unsigned 16bit integer. Fly Locations - 0x1112 9byte bit field Has obtained lotto prize - 0x1131 1 if obtained, 0 if not yet obtained Pokétch Enabled (?) - 0x114C 0x00 if disabled, can be 0x03 or 0x07 if enabled Number of Pokétch Apps Enabled - 0x114D Max number = 25 (0x19) Currently Selected Pokétch App - 0x114E Pokétch app currently viewed in DS bottom screen. Pokétch apps are ordered like so: 0x00 = Digital Watch 0x01 = Calculator 0x02 = Memo Pad 0x03 = Pedometer 0x04 = Pokémon List 0x05 = Friendship Checker 0x06 = Dowsing Machine 0x07 = Berry Searcher 0x08 = Day-Care Checker 0x09 = Pokémon History 0x0A = Counter 0x0B = Analog Watch 0x0C = Marking Map 0x0D = Link Searcher 0x0E = Coin Toss 0x0F = Move Tester 0x10 = Calendar 0x11 = Dot Artist 0x12 = Roulette 0x13 = Trainer Counter 0x14 = Kitchen Timer 0x15 = Color Changer 0x16 = Matchup Checker 0x17 = Stopwatch 0x18 = Alarm Clock Pokétch Apps Enabled - 0x114F 25 one byte flags, each corresponding to one Pokétch app (in the same order as above) 1 = enabled, 0 = disabled Map ID Number - 0x1238 Main article: List of Maps Unsigned 16bit integer. Sinnoh Pokédex Unlocked - 0x1414 1 if unlocked, 0 if not unlocked. National Pokédex Unlocked - 0x1415 1 if unlocked, 0 if not unlocked. Berry Trees - 0x1E84 128 blocks of 14byte structures List of Berry Tree locations Main article: Berry Trees Rival's Name - 0x25A8 8 unsigned 16bit integers. Each word represents a character in the game's character table. Map X Coordinate - 0x25FA Unsigned 16bit integer. Map Y Coordinate - 0x25FE Unsigned 16bit integer. Map Z Coordinate - 0x2602 Unsigned 16bit integer. Players Met Underground - 0x3A2C Unsigned 32bit integer Max value = 999999 (0xF423F) Spheres Obtained - 0x3A38 Unsigned 32bit integer Max value = 999999 (0xF423F) Fossils Obtained - 0x3A3C Unsigned 32bit integer Max value = 999999 (0xF423F) Gifts Given - 0x3A40 Unsigned 32bit integer Max value = 999999 (0xF423F) Traps Hit - 0x3A44 Unsigned 32bit integer Max value = 999999 (0xF423F) Traps Triggered - 0x3A48 Unsigned 32bit integer Max value = 999999 (0xF423F) Flags Captured - 0x3A60 Unsigned 32bit integer Max value = 999999 (0xF423F) Poffins - 0x5050 98 (?) blocks of 8byte structures 0x00: Poffin Type (Overall flavor?) 0x01: Spicy/Cool Level 0x02: Dry/Beauty Level 0x03: Sweet/Cute Level 0x04: Bitter/Smart Level 0x05: Sour/Tough Level 0x06: Smooth Level 0x07: value is 0 Trainer Card Signature - 0x5904 The signature on the back of the Trainer Card. 192 blocks of 8 byte structures The signature can be changed by speaking to the NPC behind the leftmost counter on the top floor of any Pokémon Center. It is created using the stylus. Main article: Trainer Card Signature Score - 0x5F08 A measure of the player's progress or performance in the game. Unsigned 32bit integer Max value = 999999 (0xF423F) Pokémon Caught - 0x5F2C Unsigned 32bit integer Max value = 999999 (0xF423F) Pokémon Met While Fishing - 0x5F30 Unsigned 32bit integer Max value = 999999 (0xF423F) Pokémon Eggs - 0x5F34 Unsigned 32bit integer Max value = 999999 (0xF423F) Pokémon Defeated - 0x5FAC Unsigned 32bit integer Max value = 999999 (0xF423F) Single Battle Wins - 0x5FCA Unsigned 16bit integer Max value = 9999 (0x270F) Consecutive Single Battle Wins - 0x5FCC Unsigned 16bit integer Max value = 9999 (0x270F) Double Battle Wins - 0x5FCE Unsigned 16bit integer Max value = 9999 (0x270F) Consecutive Double Battle Wins - 0x5FD0 Unsigned 16bit integer Max value = 9999 (0x270F) Multi Battle Wins - 0x5FD2 Unsigned 16bit integer Max value = 9999 (0x270F) Consecutive Multi Battle Wins - 0x5FD4 Unsigned 16bit integer Max value = 9999 (0x270F) Link Multi Battle Wins - 0x5FD6 Unsigned 16bit integer Max value = 9999 (0x270F) Consecutive Link Multi Battle Wins - 0x5FD8 Unsigned 16bit integer Max value = 9999 (0x270F) Wi-Fi Battle Wins - 0x5FDA Unsigned 16bit integer Max value = 9999 (0x270F) Consecutive Wi-Fi Battle Wins - 0x5FDC Unsigned 16bit integer Max value = 9999 (0x270F) Contests Won - 0x5FE2 Unsigned 16bit integer Max value = 9999 (0x270F) Ribbons - 0x5FE6 Unsigned 16bit integer Max value = 9999 (0x270F) Capsules in PC - 0x6050 12 blocks of 24 bytes structures. Battle Points - 0x65F8 Unsigned 16bit integer Max value = 9999 (0x270F) Safari Zone Pokémon - 0x72D0 Unsigned 32bit integer result from the ARNG. Four daily safari zone Pokémon Indexn = ( ARNG >> ( n * 0x5 ) ) & 0x1F List of Safari Zone Pokémon Notes: Both Safari Zone Pokémon and Swarm Pokémon have the same ARNG value. Swarm Pokémon - 0x72D4 Unsigned 32bit integer result from the ARNG. One daily swarm Pokémon Index = ARNG % 0x1C List of Swarm Pokémon Notes: Both Safari Zone Pokémon and Swarm Pokémon have the same ARNG value. Daily Trophy Pokémon Today - 0x72DC Unsigned 8bit integer First daily trophy garden Pokémon List of Daily Trophy Pokémon Daily Trophy Pokémon Yesterday - 0x72DE Unsigned 8bit integer Second daily trophy garden Pokémon List of Daily Trophy Pokémon Notes: Yesterday's Pokémon can be caught after beating the Elite 4 and receiving the National Pokédex upgrade. Honey Trees - 0x72E4 21 blocks of 8byte structures List of Honey Tree locations Main article: Honey Trees GTS Pokémon - 0x73E8 One Pokémon 1 block of 236byte structures The data for the Pokémon currently uploaded to the GTS (if any). Main article: Pokemon NDS Structure
  8. evandixon

    BW Save Structure

    Save Entry The primary save starts at 0x0. The backup save starts at 0x24000. Main Save File & Backup Start End Size Checksum Mirror Description 00000 003DF 3E0 003E2 23F00 Box Names 00400 013EF FF0 013F2 23F02 Box 1 01400 023EF FF0 023F2 23F04 Box 2 02400 033EF FF0 033F2 23F06 Box 3 03400 043EF FF0 043F2 23F08 Box 4 04400 053EF FF0 053F2 23F0A Box 5 05400 063EF FF0 063F2 23F0C Box 6 06400 073EF FF0 073F2 23F0E Box 7 07400 083EF FF0 083F2 23F10 Box 8 08400 093EF FF0 093F2 23F12 Box 9 09400 0A3EF FF0 0A3F2 23F14 Box 10 0A400 0B3EF FF0 0B3F2 23F16 Box 11 0B400 0C3EF FF0 0C3F2 23F18 Box 12 0C400 0D3EF FF0 0D3F2 23F1A Box 13 0D400 0E3EF FF0 0E3F2 23F1C Box 14 0E400 0F3EF FF0 0F3F2 23F1E Box 15 0F400 103EF FF0 103F2 23F20 Box 16 10400 113EF FF0 113F2 23F22 Box 17 11400 123EF FF0 123F2 23F24 Box 18 12400 133EF FF0 133F2 23F26 Box 19 13400 143EF FF0 143F2 23F28 Box 20 14400 153EF FF0 153F2 23F2A Box 21 15400 163EF FF0 163F2 23F2C Box 22 16400 173EF FF0 173F2 23F2E Box 23 17400 183EF FF0 183F2 23F30 Box 24 18400 18DBF 9C0 18DC2 23F32 Inventory 18E00 19333 534 19336 23F34 Party Pokemon 19400 19467 68 19469 23F36 Trainer Data 19500 1959B 9C 1959E 23F38 ??? 19600 1A937 1338 1A93A 23F3A ??? 1AA00 1B1C3 7C4 1B1C6 23F3C ??? 1B200 1BF53 D54 1BF56 23F3E ??? 1C000 1C02B 2C 1C02E 23F40 ??? 1C100 1C757 658 1C75A 23F42 ??? Gym badge data 1C800 1D293 A94 1D296 23F44 ??? 1D300 1D4AB 1AC 1D4AE 23F46 ??? 1D500 1D8EB 3EC 1D8EE 23F48 ??? 1D900 1D95B 5C 1D95E 23F4A ??? 1DA00 1DBDF 1E0 1DBE2 23F4C ??? 1DC00 1DCA7 A8 1DCAA 23F4E ??? 1DD00 1E15F 460 1E162 23F50 ??? 1E200 1F5FF 1400 1F602 23F52 ??? 1F700 1F9A3 2A4 1F9A6 23F54 ??? 1FA00 1FCDB 2DC 1FCDE 23F56 ??? 1FD00 2004B 34C 2004E 23F58 ??? 20100 204EB 3EC 204EE 23F5A ??? 20500 205F7 F8 205FA 23F5C ??? 20600 208FB 2FC 208FE 23F5E ??? 20900 20993 94 20996 23F60 ??? 20A00 20D5B 35C 20D5E 23F62 ??? 20E00 20FCB 1CC 20FCE 23F64 ??? 21000 21167 168 2116A 23F66 ??? 21200 212EB EC 212EE 23F68 ??? 21300 214AF 1B0 214B2 23F6A ??? 21500 2151B 1C 2151E 23F6C ??? 21600 21AD3 4D4 21AD6 23F6E ??? 21B00 21B33 34 21B36 23F70 ??? 21C00 21C3B 3C 21C3E 23F72 ??? 21D00 21EAB 1AC 21EAE 23F74 ??? 21F00 22A8F B90 22A92 23F76 ??? 22B00 22B9B 9C 22B9E 23F78 ??? 22C00 2344F 850 23452 23F7A Entralink Forest pokémon data 23500 23527 28 2352A 23F7C ??? 23600 23883 284 23886 23F7E ??? 23900 2390F 10 23912 23F80 ??? 23A00 23A5B 5C 23A5E 23F82 ??? 23B00 23C6B 16C 23C6E 23F84 ??? 23D00 23D3F 40 23D42 23F86 ??? 23E00 23EFB FC 23EFE 23F88 ??? 23F00 23F8B 8C 23F9A Checksum Block Start and End indexes are inclusive. note: sections might vary in lenght depending on how much data they store (this behavior has been seen at least in trainer data) Gym Badge Obtained Date Gym badge dates are stored starting 1C704 and 407004. Byte 1 is how many years after 2000, Byte 2 is the month, and Byte 3 is the day (Byte 4 is 0, don't know if it has any meaning or if it's part of the year).
  9. evandixon

    B2W2 Save Structure

    Save Entry The primary save starts at 0x0. The backup save starts at 0x26000. Main Save File & Backup Start End Checksum Mirror Description 00000 003DF 003E2 25F00 Box Names 00400 013EF 013F2 25F02 Box 1 01400 023EF 023F2 25F04 Box 2 02400 033EF 033F2 25F06 Box 3 03400 043EF 043F2 25F08 Box 4 04400 053EF 053F2 25F0A Box 5 05400 063EF 063F2 25F0C Box 6 06400 073EF 073F2 25F0E Box 7 07400 083EF 083F2 25F10 Box 8 08400 093EF 093F2 25F12 Box 9 09400 0A3EF 0A3F2 25F14 Box 10 0A400 0B3EF 0B3F2 25F16 Box 11 0B400 0C3EF 0C3F2 25F18 Box 12 0C400 0D3EF 0D3F2 25F1A Box 13 0D400 0E3EF 0E3F2 25F1C Box 14 0E400 0F3EF 0F3F2 25F1E Box 15 0F400 103EF 103F2 25F20 Box 16 10400 113EF 113F2 25F22 Box 17 11400 123EF 123F2 25F24 Box 18 12400 133EF 133F2 25F26 Box 19 13400 143EF 143F2 25F28 Box 20 14400 153EF 153F2 25F2A Box 21 15400 163EF 163F2 25F2C Box 22 16400 173EF 173F2 25F2E Box 23 17400 183EF 183F2 25F30 Box 24 18400 18DEB 18DEE 25F32 Inventory 18E00 19333 19336 25F34 Party Pokemon 19400 194AF 194B2 25F36 Trainer Data 19500 195A7 195AA 25F38 Trainer Position 19600 1A937 1A93A 25F3A Unity Tower and survey stuff 1AA00 1B1C3 1B1C6 25F3C Pal Pad Player Data (30d) 1B200 1BF53 1BF56 25F3E Pal Pad Friend Data 1C000 1C093 1C096 25F40 C-Gear 1C100 1C757 1C75A 25F42 Card Signature Block & ???? 1C800 1D293 1D296 25F44 Mystery Gift 1D300 1D4AB 1D4AE 25F46 Dream World Stuff (Catalog) 1D500 1D8EB 1D8EE 25F48 Chatter 1D900 1D95B 1D95E 25F4A Adventure data http://projectpokemon.org/forums/showthread.php?24589-B2W2-General-ROM-Info&p=167300&viewfull=1#post167300 1DA00 1DBDF 1DBE2 25F4C Trainer Card Records 1DC00 1DCA7 1DCAA 25F4E 1DD00 1E15F 1E162 25F50 (40d) 1E200 1F5FF 1F602 25F52 1F700 1F9A3 1F9A6 25F54 Contains flags and references for downloaded data (Musical) 1FA00 1FADF 1FAE2 25F56 Fused Reshiram/Zekrom Storage 1FB00 1FE4B 1FE4E 25F58 1FF00 203DF 203E2 25F5A Const Data Block and Event Flag Block (0x35E is the split) 20400 204F7 204FA 25F5C 20500 207FB 207FE 25F5E Tournament Block 20800 20893 20896 25F60 20900 20C5B 20C5E 25F62 Battle Box Block 20D00 20ED3 20ED6 25F64 Daycare Block (50d) 20F00 210DF 201E2 25F66 Strength Boulder Status Block 21100 211EF 211F2 25F68 Badge Flags, Money, Trainer Sayings 21200 213B3 213B6 25F6A Entralink (Level & Powers etc) 21400 218DB 218DE 25F6C Pokedex 21900 21933 21936 25F6E Swarm and other overworld info - 2C - swarm, 2D - repel steps, 2E repel type 21A00 21A3B 21A3E 25F70 21B00 21CAB 21CAE 25F72 21D00 2288F 22892 25F74 22900 229AB 229AE 25F76 Online Records 22A00 2324F 23252 25F78 Area NPC data - encrypted (60d) 23300 23583 23586 25F7A 23600 2360F 23612 25F7C 23700 237A7 237AA 25F7E 23800 2396B 2396E 25F80 23A00 23A7F 23A82 25F82 23B00 23BFB 23BFE 25F84 Hollow/Rival Block 23C00 252A7 252AA 25F86 Join Avenue Block 25300 25797 2579A 25F88 Medal data 25800 2585F 25862 25F8A Key-related data 25900 259FB 259FE 25F8C (70d) 25A00 25DE3 25DE6 25F8E 25E00 25EEF 25EF2 25F90 25F00 25F93 25FA2 Checksum Block (73d) Start and End index are inclusive. Download / Extra Content Start End Checksum Mirror Description 4C000 4D913 ~ ~ Battle Video (Native) 4DA00 4F313 ~ ~ Battle Video (1st Download) 4F400 50D13 ~ ~ Battle Video (2nd Download) 50E00 52713 ~ ~ Battle Video (3rd Download) 52800 54DFF 54E02 54F00 C-Gear Background 55800 6D3FF 6D342 6D500 Musical Download (narc download) 6D800 73A03 73A06 73B00 Pokedex Skin 74000 7555B 7555E 75600 Hall of Fame (Main); Extra Checksum 0x75600-0x75603 @ 0x75612 75800 76D5B 76D5E 76E00 Hall of Fame (Backup); Extra Checksum 0x76E00-0x76E03 @ 0x76E12 77000 77511 77512 - Unknown 7A000 7B213 7B216 7B300 PWT Download 1; Extra Checksum @ 0x7B312 7B400 7C613 7C616 7C700 PWT Download 2; Extra Checksum @ 0x7C712 7C800 7DA13 7DA16 7DB00 PWT Download 3; Extra Checksum @ 0x7DB12 7E000 7EA1F Memory Link Data (2 blocks of 0x400 length, extra data afterwards) 7F000 CRGF - GameFreak CRC table - Nintendo 3DS Link data Nintendo 3DS Link Data Start End Checksum Mirror Description 7F010 7F013 ~ ~ Unknown. Value that prevents receiving a Pokémon again? 7F014 7F093 7F094 ~ Nintendo 3DS Link data slots? 4 bytes each slot, can be item/pokémon
  10. evandixon

    PKM Structure

    Pokémon in the games Pokémon Diamond, Pearl, and Platinum are stored in a 136 byte or 236 byte structures. All unencrypted values are stored in little-endian format. The game encrypts the data when it is stored in the save file. Party Pokémon have additional values to hold current battle stats and conditions. The information below describes the Pokémon data format. Checksum The checksum serves two purposes: It validates the data after decryption, and It serves as the encryption key for the data. The checksum is calculated in three steps: Split the unencrypted data from offsets 0x08 to 0x87 into two-byte words, Take the sum of the words, and Truncate the sum to 16 bits. Block Shuffling The 128 bytes of Pokémon data are split into four 32-byte blocks for shuffling. The blocks are shuffled according to a shift value derived from the personality value. Given the personality value pv, the expression yielding the shift value is: ((pv & 0x3E000) >> 0xD) % 24 The right shifting (>> 0xD) is equivalent to a division of 8192. To shuffle the blocks, take the four blocks of unencrypted data, A, B, C, and D. The blocks shall be rearranged in the encrypted data according to the Block Order column of the following table. (To unshuffle, use the Inverse column.) Shift Value (decimal) Block Order Inverse 00 ABCD ABCD 01 ABDC ABDC 02 ACBD ACBD 03 ACDB ADBC 04 ADBC ACDB 05 ADCB ADCB 06 BACD BACD 07 BADC BADC 08 BCAD CABD 09 BCDA DABC 10 BDAC CADB 11 BDCA DACB 12 CABD BCAD 13 CADB BDAC 14 CBAD CBAD 15 CBDA DBAC 16 CDAB CDAB 17 CDBA DCAB 18 DABC BCDA 19 DACB BDCA 20 DBAC CBDA 21 DBCA DBCA 22 DCAB CDBA 23 DCBA DCBA Encryption The encryption uses the pseudorandom number generator (PRNG), a linear congruential generator. Elements of the PRNG can be described with the recursive function: X[n+1] = (0x41C64E6D * X[n] + 0x6073) To decrypt the data, given a function rand() which returns the upper 16 bits of consecutive results of the above given function: Seed the PRNG with the checksum (let X[n] be the checksum). Sequentially, for each 2-byte word Y from 0x08 to 0x87, apply the transformation: unencryptedByte = Y xor rand() Unshuffle the blocks using the block shuffling algorithm above. To encrypt the data: Shuffle the blocks using the block shuffling algorithm above. Seed the PRNG with the checksum (let X[n] be the checksum), Sequentially, for each 2-byte word Y from 0x08 to 0x87, apply the transformation: unencryptedByte = Y xor rand() Unencrypted bytes Offset Contents 0x00-0x03 Personality value (Also known as the PID) 0x04-0x05 Temporary Variable (Unused) 0x06-0x07 Checksum Encrypted bytes Block A Offset Contents 0x08-0x09 National Pokédex ID 0x0A-0x0B Held Item 0x0C-0x0D OT ID 0x0E-0x0F OT Secret ID 0x10-0x13 Experience points 0x14 Friendship (Steps to Hatch if an egg) 0x15 Ability 0x16 Markings 0x17 Original Language 0x18 HP Effort Value 0x19 Attack Effort Value 0x1A Defense Effort Value 0x1B Speed Effort Value 0x1C SP Attack Effort Value 0x1D SP Defense Effort Value 0x1E Cool Contest Value 0x1F Beauty Contest Value 0x20 Cute Contest Value 0x21 Smart Contest Value 0x22 Tough Contest Value 0x23 Sheen Contest Value 0x24-0x25 Sinnoh Ribbon Set 1 0x26-0x27 Sinnoh Ribbon Set 2 Block B Offset Contents 0x28-0x29 Move 1 ID 0x2A-0x2B Move 2 ID 0x2C-0x2D Move 3 ID 0x2E-0x2F Move 4 ID 0x30 Move 1 Current PP 0x31 Move 2 Current PP 0x32 Move 3 Current PP 0x33 Move 4 Current PP 0x34-0x37 Move PP Ups 0x38-0x3B Bits 0-29 - Individual Values HP ( [0-31] << 0 ) Attack ( [0-31] << 5 ) Defense ( [0-31] << 10 ) Speed ( [0-31] << 15 ) SP Attack ( [0-31] << 20 ) SP Defense ( [0-31] << 25 ) Bit 30 - IsEgg Flag Bit 31 - IsNicknamed Flag 0x3C-0x3D Hoenn Ribbon Set 1 0x3E-0x3F Hoenn Ribbon Set 2 0x40 Bit 0 - Fateful Encounter Flag Bit 1 - Female Bit 2 - Genderless Bit 3-7 - Alternate Forms 0x41 Shiny Leaves (HGSS) Bit 5 - Leaf Crown Bits 0–4 - Leaves A–E (bit 0 is leftmost) 0x42-0x43 Unused 0x44-0x45 Egg Location (Platinum) 0x46-0x47 Met at Location (Platinum) Block C Offset Contents 0x48-0x5D Nickname 0x5E Unused 0x5F Origin Game 0x60-0x61 Sinnoh Ribbon Set 3 0x62-0x63 Sinnoh Ribbon Set 4 0x64-0x67 Unused Block D Offset Contents 0x68-0x77 OT Name 0x78-0x7A Date Egg Received 0x7B-0x7D Date Met 0x7E-0x7F Egg Location (Diamond/Pearl) 0x80-0x81 Met At Location (Diamond/Pearl) 0x82 Pokérus 0x83 Poké Ball 0x84 Bit 0-6 - Met At Level Bit 7 - Female OT Gender 0x85 Encounter Type 0x86 HGSS Poké Ball 0x87 Unused Battle Stats The battle stats are encrypted in the same manner, however the seed is not the checksum, it is the PID, and the bytes are not shuffled. Encrypted Bytes Offset Contents 0x88 Bits 0-2 - Asleep (0-7 rounds) Bit 3 - Poisoned Bit 4 - Burned Bit 5 - Frozen Bit 6 - Paralyzed Bit 7 - Toxic 0x89 Unknown - Flags - Max Value 0xF0 0x8A-0x8B Unknown 0x8C Level 0x8D Capsule Index (Seals) 0x8E-0x8F Current HP 0x90-0x91 Max HP 0x92-0x93 Attack 0x94-0x95 Defense 0x96-0x97 Speed 0x98-0x99 Special Attack 0x9A-0x9B Special Defense 0x9C-0xD3 Unknown - Contains Trash Data 0xD4-0xEB Seal Coordinates Original Language Value Language 0x1 日本語 (Japan) 0x2 English (US/UK/AU) 0x3 Français (France/Québec) 0x4 Italiano (Italy) 0x5 Deutsch (Germany) 0x7 Español (Spain/Latin Americas) 0x8 한국어 (South Korea) Markings Bit Marking 0x01 Circle 0x02 Triangle 0x04 Square 0x08 Heart 0x10 Star 0x20 Diamond Alternate Forms Alternate forms are stored at offset 0x40 of the Pokemon structure. Each form follows the pattern of index << 3 where index starts at zero for the main form. Unown's Forms Bit Form Bit Form Bit Form Bit Form 0x00 A 0x38 H 0x70 O 0xA8 V 0x08 B 0x40 I 0x78 P 0xB0 W 0x10 C 0x48 J 0x80 Q 0xB8 X 0x18 D 0x50 K 0x88 R 0xC0 Y 0x20 E 0x58 L 0x90 S 0xC8 Z 0x28 F 0x60 M 0x98 T 0xD0 ! 0x30 G 0x68 N 0xA0 U 0xD8 ? Deoxy's Forms Bit Form 0x00 Normal 0x08 Attack 0x10 Defense 0x18 Speed Burmy's & Wormadam's Forms Bit Form 0x00 Plant 0x08 Sandy 0x10 Trash Shellos' & Gastrodon's Forms Bit Form 0x00 West 0x08 East Rotom's Forms Rotom's alternate forms will only be displayed in Pokemon Platinum. Rotom may be traded between Diamond, Pearl, and Platinum without losing the alternate form. Bit Form 0x00 Normal 0x08 Heat 0x10 Wash 0x18 Frost 0x20 Fan 0x28 Cut Giratina's Forms Giratina's Origin form will only be displayed in Pokemon Platinum. Bit Form 0x00 Altered 0x08 Origin Shaymin's Forms Shaymin's Sky form will only be displayed in Pokemon Platinum. Bit Form 0x00 Land 0x08 Sky Arceus' Forms Bit Form Bit Form Bit Form 0x00 Normal 0x30 Insect 0x60 Zap 0x08 Fist 0x38 Spooky 0x68 Mind 0x10 Sky 0x40 Iron 0x70 Icicle 0x18 Toxic 0x48 Flame 0x78 Draco 0x20 Earth 0x50 Splash 0x80 Dread 0x28 Stone 0x58 Meadow 0x4C Curse Encounter Types Value Country 0x0 Pal Park, Egg, Hatched, Special Event 0x2 Tall Grass 0x4 Dialga/Palkia In-Game Event 0x5 Cave, Hall of Origin 0x7 Surfing, Fishing 0x9 Building 0xA Great Marsh (Safari Zone) 0xC Starter, Fossil, Gift (Eevee) Ribbons Diamond, Pearl, and Platinum store the ribbon information as bitfields in 1-byte words. Given below are the bytewise representation of the ribbon bitfields. Sinnoh Ribbon Set 1 Bit Ribbon 0x24 & 0x01 Sinnoh Champ Ribbon 0x24 & 0x02 Ability Ribbon 0x24 & 0x04 Great Ability Ribbon 0x24 & 0x08 Double Ability Ribbon 0x24 & 0x10 Multi Ability Ribbon 0x24 & 0x20 Pair Ability Ribbon 0x24 & 0x40 World Ability Ribbon 0x24 & 0x80 Alert Ribbon 0x25 & 0x01 Shock Ribbon 0x25 & 0x02 Downcast Ribbon 0x25 & 0x04 Careless Ribbon 0x25 & 0x08 Relax Ribbon 0x25 & 0x10 Snooze Ribbon 0x25 & 0x20 Smile Ribbon 0x25 & 0x40 Gorgeous Ribbon 0x25 & 0x80 Royal Ribbon Sinnoh Ribbon Set 2 Bit Ribbon 0x26 & 0x01 Gorgeous Royal Ribbon 0x26 & 0x02 Footprint Ribbon 0x26 & 0x04 Record Ribbon 0x26 & 0x08 History Ribbon 0x26 & 0x10 Legend Ribbon 0x26 & 0x20 Red Ribbon 0x26 & 0x40 Green Ribbon 0x26 & 0x80 Blue Ribbon 0x27 & 0x01 Festival Ribbon 0x27 & 0x02 Carnival Ribbon 0x27 & 0x04 Classic Ribbon 0x27 & 0x08 Premier Ribbon Sinnoh Ribbon Set 3 Bit Ribbon 0x60 & 0x01 Cool Ribbon 0x60 & 0x02 Cool Ribbon Great 0x60 & 0x04 Cool Ribbon Ultra 0x60 & 0x08 Cool Ribbon Master 0x60 & 0x10 Beauty Ribbon 0x60 & 0x20 Beauty Ribbon Great 0x60 & 0x40 Beauty Ribbon Ultra 0x60 & 0x80 Beauty Ribbon Master 0x61 & 0x01 Cute Ribbon 0x61 & 0x02 Cute Ribbon Great 0x61 & 0x04 Cute Ribbon Ultra 0x61 & 0x08 Cute Ribbon Master 0x61 & 0x10 Smart Ribbon 0x61 & 0x20 Smart Ribbon Great 0x61 & 0x40 Smart Ribbon Ultra 0x61 & 0x80 Smart Ribbon Master Sinnoh Ribbon Set 4 Bit Ribbon 0x62 & 0x01 Tough Ribbon 0x62 & 0x02 Tough Ribbon Great 0x62 & 0x04 Tough Ribbon Ultra 0x62 & 0x08 Tough Ribbon Master Hoenn Ribbon Set 1 Bit Ribbon 0x3C & 0x01 Cool Ribbon 0x3C & 0x02 Cool Ribbon Super 0x3C & 0x04 Cool Ribbon Hyper 0x3C & 0x08 Cool Ribbon Master 0x3C & 0x10 Beauty Ribbon 0x3C & 0x20 Beauty Ribbon Super 0x3C & 0x40 Beauty Ribbon Hyper 0x3C & 0x80 Beauty Ribbon Master 0x3D & 0x01 Cute Ribbon 0x3D & 0x02 Cute Ribbon Super 0x3D & 0x04 Cute Ribbon Hyper 0x3D & 0x08 Cute Ribbon Master 0x3D & 0x10 Smart Ribbon 0x3D & 0x20 Smart Ribbon Super 0x3D & 0x40 Smart Ribbon Hyper 0x3D & 0x80 Smart Ribbon Master Hoenn Ribbon Set 2 Bit Ribbon 0x3E & 0x01 Tough Ribbon 0x3E & 0x02 Tough Ribbon Super 0x3E & 0x04 Tough Ribbon Hyper 0x3E & 0x08 Tough Ribbon Master 0x3E & 0x10 Champion Ribbon 0x3E & 0x20 Winning Ribbon 0x3E & 0x40 Victory Ribbon 0x3E & 0x80 Artist Ribbon 0x3F & 0x01 Effort Ribbon 0x3F & 0x02 Marine Ribbon 0x3F & 0x04 Land Ribbon 0x3F & 0x08 Sky Ribbon 0x3F & 0x10 Country Ribbon 0x3F & 0x20 National Ribbon 0x3F & 0x40 Earth Ribbon 0x3F & 0x80 World Ribbon Save File Location The party Pokémon are stored in the save file beginning at offset 0x00098 for the first small block, and 0x40098 for the second small block. In the first small save block, the first Daycare Pokémon is located at 0x0141C, and the second is located at 0x01508. In the second small block, the first Daycare Pokémon is located at 0x4141C, and the second is located at 0x41508. In the first small save block, the Pal Park Pokémon are stored beginning at 0x0BA28. In the second small save block, the Pal Park Pokémon are stored beginning at 0x4BA28. Each party, Daycare, and Pal Park Pokémon is 236 bytes in size. The PC storage Pokémon are stored in the save file from Box 1 to Box 18. The offset starts at 0x0C104 for the first big block and 0x4C104 for the second big block. Each PC stored Pokémon is 136 bytes in size.
  11. evandixon

    BW PK5 Structure

    Pokémon in the games Pokémon Black and White are stored in a 136 byte or 220 byte structures. All unencrypted values are stored in little-endian format. The game encrypts the data when it is stored in the save file. Party Pokémon have additional values to hold current battle stats and conditions. The information below describes the Pokémon data format. Checksum / Block Shuffling / Encryption Same as before, see Pokemon NDS Structure. Unencrypted bytes Offset Contents 0x00-0x03 Personality value (Also known as the PID) 0x04-0x05 Unused 0x06-0x07 Checksum Encrypted bytes Block A Offset Contents 0x08-0x09 National Pokédex ID 0x0A-0x0B Held Item 0x0C-0x0D OT ID 0x0E-0x0F OT Secret ID 0x10-0x13 Experience points 0x14 Friendship (Steps to Hatch if an egg) 0x15 Ability 0x16 Markings 0x17 Original Language 0x18 HP Effort Value 0x19 Attack Effort Value 0x1A Defense Effort Value 0x1B Speed Effort Value 0x1C SP Attack Effort Value 0x1D SP Defense Effort Value 0x1E Cool Contest Value 0x1F Beauty Contest Value 0x20 Cute Contest Value 0x21 Smart Contest Value 0x22 Tough Contest Value 0x23 Sheen Contest Value 0x24-0x25 Sinnoh Ribbon Set 1 0x26-0x27 Unova Ribbon Set Block B Offset Contents 0x28-0x29 Move 1 ID 0x2A-0x2B Move 2 ID 0x2C-0x2D Move 3 ID 0x2E-0x2F Move 4 ID 0x30 Move 1 Current PP 0x31 Move 2 Current PP 0x32 Move 3 Current PP 0x33 Move 4 Current PP 0x34-0x37 Move PP Ups 0x38-0x3B Bits 0-29 - Individual Values HP ( [0-31] << 0 ) Attack ( [0-31] << 5 ) Defense ( [0-31] << 10 ) Speed ( [0-31] << 15 ) SP Attack ( [0-31] << 20 ) SP Defense ( [0-31] << 25 ) Bit 30 - IsEgg Flag Bit 31 - IsNicknamed Flag 0x3C-0x3D Hoenn Ribbon Set 1 0x3E-0x3F Hoenn Ribbon Set 2 0x40 Bit 0 - Fateful Encounter Flag Bit 1 - Female Bit 2 - Genderless Bit 3-7 - Alternate Forms 0x41 Nature 0x42 0x1 - HasDreamWorldAbility flag, 0x2 - N's pokemon flag 0x43 Unused 0x44-0x47 Unknown Block C Offset Contents 0x48-0x5D Nickname 0x5E Unknown 0x5F Origin game 0x60-0x61 Sinnoh Ribbon Set 3 0x62-0x63 Sinnoh Ribbon Set 4 0x64-0x67 Unused Block D Offset Contents 0x68-0x77 OT Name 0x78-0x7A Date Egg Received 0x7B-0x7D Date Met 0x7E-0x7F Egg Location (Diamond/Pearl) 0x80-0x81 Met At Location (Diamond/Pearl) 0x82 Pokérus 0x83 Poké Ball 0x84 Bit 0-6 - Met At Level Bit 7 - Female OT Gender 0x85 Encounter Type 0x86 Unused 0x87 Unused Battle Stats The battle stats are encrypted in the same manner, however the seed is not the checksum, it is the PID, and the bytes are not shuffled. Encrypted Bytes Offset Contents 0x88 Bits 0-2 - Asleep (0-7 rounds) Bit 3 - Poisoned Bit 4 - Burned Bit 5 - Frozen Bit 6 - Paralyzed Bit 7 - Toxic 0x89 Unknown - Flags - Max Value 0xF0 0x8A-0x8B Unknown 0x8C Level 0x8D Capsule Index (Seals) 0x8E-0x8F Current HP 0x90-0x91 Max HP 0x92-0x93 Attack 0x94-0x95 Defense 0x96-0x97 Speed 0x98-0x99 Special Attack 0x9A-0x9B Special Defense 0x9C-0xD3 Mail message- fill-in-the-blank choices + OT name 0xD4-0xDB Unused Original Language Value Language 0x1 日本語 (Japan) 0x2 English (US/UK/AU) 0x3 Français (France/Québec) 0x4 Italiano (Italy) 0x5 Deutsch (Germany) 0x7 Español (Spain/Latin Americas) 0x8 한국어 (South Korea) Markings Bit Marking 0x01 Circle 0x02 Triangle 0x04 Square 0x08 Heart 0x10 Star 0x20 Diamond Alternate Forms Alternate forms are stored at offset 0x40 of the Pokemon structure. Each form follows the pattern of index << 3 where index starts at zero for the main form. Unown's Forms Bit Form Bit Form Bit Form Bit Form 0x00 A 0x38 H 0x70 O 0xA8 V 0x08 B 0x40 I 0x78 P 0xB0 W 0x10 C 0x48 J 0x80 Q 0xB8 X 0x18 D 0x50 K 0x88 R 0xC0 Y 0x20 E 0x58 L 0x90 S 0xC8 Z 0x28 F 0x60 M 0x98 T 0xD0 ! 0x30 G 0x68 N 0xA0 U 0xD8 ? Deoxy's Forms Bit Form 0x00 Normal 0x08 Attack 0x10 Defense 0x18 Speed Burmy's & Wormadam's Forms Bit Form 0x00 Plant 0x08 Sandy 0x10 Trash Shellos' & Gastrodon's Forms Bit Form 0x00 West 0x08 East Rotom's Forms Rotom's alternate forms will only be displayed in Pokemon Platinum. Rotom may be traded between Diamond, Pearl, and Platinum without losing the alternate form. Bit Form 0x00 Normal 0x08 Heat 0x10 Wash 0x18 Frost 0x20 Fan 0x28 Cut Giratina's Forms Giratina's Origin form will only be displayed in Pokemon Platinum. Bit Form 0x00 Altered 0x08 Origin Shaymin's Forms Shaymin's Sky form will only be displayed in Pokemon Platinum. Bit Form 0x00 Land 0x08 Sky Arceus' Forms Bit Form Bit Form Bit Form 0x00 Normal 0x30 Insect 0x60 Zap 0x08 Fist 0x38 Spooky 0x68 Mind 0x10 Sky 0x40 Iron 0x70 Icicle 0x18 Toxic 0x48 Flame 0x78 Draco 0x20 Earth 0x50 Splash 0x80 Dread 0x28 Stone 0x58 Meadow 0x4C Curse Nickname and OT Name Since generation 5, the nickname and OT name are encoded with Unicode instead of a game-specific character map. However, there are some exceptions, which are listed below. Note that unlike generation 4, the last two bytes of are always 0xFFFF, even if there already was a terminator before. Exceptions to this rule are the Roaming Pokémon, Starters, and various gifts and in game trades, in which the OT name does not have the escape sequence. There are no normally occurring trash bytes for generation 5 Pokémon, but the Poké Transfer will keep existing trash bytes (except the last two) even if the Pokémon evolves in generation 5. In the advent of a different language Pokémon evolving in another language game, characters not overwritten are left as trash bytes. Characters that can be replaced in Unicode In the game, those are half-width versions of existing Unicode characters used in non-japanese versions with long name support. Original character Unicode index Replace with Unicode index ⑽ 0x247d ☂ 0x2602 ⑻ 0x247b ☁ 0x2601 ⑺ 0x247a ☀ 0x2600 ⑹ 0x2479 ♪ 0x266a ⑸ 0x2478 ◇ 0x25c7 ⑷ 0x2477 △ 0x25b3 ⑶ 0x2476 □ 0x25a1 ⑵ 0x2475 ○ 0x25cb ⑴ 0x2474 ◎ 0x25ce ⑳ 0x2473 ★ 0x2605 ⑲ 0x2472 ♦ 0x2666 ⑱ 0x2471 ♥ 0x2665 ⑰ 0x2470 ♣ 0x2663 ⑯ 0x246f ♠ 0x2660 ⑮ 0x246e ♀ 0x2640 ⑭ 0x246d ♂ 0x2642 ⑬ 0x246c … 0x2026 ⑨ 0x2468 ÷ 0xf7 ⑧ 0x2467 × 0xd7 Pokémon exclusive characters Some game-exclusive characters do not exist in Unicode and should be replaced with bitmaps. Original character Unicode index Pokémon exclusive $ 0x24 ⇒ 0x21d2 ⇔ 0x21d4 ∀ 0x2200 ∃ 0x2203 ∧ 0x2227 ∨ 0x2228 ① 0x2460 ② 0x2461 ③ 0x2462 ④ 0x2463 ⑤ 0x2464 ⑥ 0x2465 ⑦ 0x2466 ⑩ 0x2469 ⑪ 0x246a ⑫ 0x246b ⑾ 0x247e ⑿ 0x247f ⒀ 0x2480 ⒁ 0x2481 ⒂ 0x2482 ⒃ 0x2483 ⒄ 0x2484 ⒅ 0x2485 ⒆ 0x2486 ⒇ 0x2487 ¬ 0xffe2 Encounter Types Encounter types are not used in Black and White. Pokeshifted Pokemon keep their Encounter Type hex. Value Country 0x0 Pal Park, Egg, Hatched, Special Event 0x2 Tall Grass 0x4 Dialga/Palkia In-Game Event 0x5 Cave, Hall of Origin 0x7 Surfing, Fishing 0x9 Building 0xA Great Marsh (Safari Zone) 0xC Starter, Fossil, Gift (Eevee) Ribbons Diamond, Pearl, and Platinum store the ribbon information as bitfields in 1-byte words. Given below are the bytewise representation of the ribbon bitfields. Sinnoh Ribbon Set 1 Bit Ribbon 0x24 & 0x01 Sinnoh Champ Ribbon 0x24 & 0x02 Ability Ribbon 0x24 & 0x04 Great Ability Ribbon 0x24 & 0x08 Double Ability Ribbon 0x24 & 0x10 Multi Ability Ribbon 0x24 & 0x20 Pair Ability Ribbon 0x24 & 0x40 World Ability Ribbon 0x24 & 0x80 Alert Ribbon 0x25 & 0x01 Shock Ribbon 0x25 & 0x02 Downcast Ribbon 0x25 & 0x04 Careless Ribbon 0x25 & 0x08 Relax Ribbon 0x25 & 0x10 Snooze Ribbon 0x25 & 0x20 Smile Ribbon 0x25 & 0x40 Gorgeous Ribbon 0x25 & 0x80 Royal Ribbon Unova Ribbon Set Bit Ribbon 0x26 & 0x01 Gorgeous Royal Ribbon 0x26 & 0x02 Footprint Ribbon 0x26 & 0x04 Record Ribbon 0x26 & 0x08 Event Ribbon 0x26 & 0x10 Legend Ribbon 0x26 & 0x20 World Champion Ribbon 0x26 & 0x40 Birthday Ribbon 0x26 & 0x80 Special Ribbon 0x27 & 0x01 Souvenir Ribbon 0x27 & 0x02 Wishing Ribbon 0x27 & 0x04 Classic Ribbon 0x27 & 0x08 Premier Ribbon Sinnoh Ribbon Set 3 Bit Ribbon 0x60 & 0x01 Cool Ribbon 0x60 & 0x02 Cool Ribbon Great 0x60 & 0x04 Cool Ribbon Ultra 0x60 & 0x08 Cool Ribbon Master 0x60 & 0x10 Beauty Ribbon 0x60 & 0x20 Beauty Ribbon Great 0x60 & 0x40 Beauty Ribbon Ultra 0x60 & 0x80 Beauty Ribbon Master 0x61 & 0x01 Cute Ribbon 0x61 & 0x02 Cute Ribbon Great 0x61 & 0x04 Cute Ribbon Ultra 0x61 & 0x08 Cute Ribbon Master 0x61 & 0x10 Smart Ribbon 0x61 & 0x20 Smart Ribbon Great 0x61 & 0x40 Smart Ribbon Ultra 0x61 & 0x80 Smart Ribbon Master Sinnoh Ribbon Set 4 Bit Ribbon 0x62 & 0x01 Tough Ribbon 0x62 & 0x02 Tough Ribbon Great 0x62 & 0x04 Tough Ribbon Ultra 0x62 & 0x08 Tough Ribbon Master Hoenn Ribbon Set 1 Bit Ribbon 0x3C & 0x01 Cool Ribbon 0x3C & 0x02 Cool Ribbon Super 0x3C & 0x04 Cool Ribbon Hyper 0x3C & 0x08 Cool Ribbon Master 0x3C & 0x10 Beauty Ribbon 0x3C & 0x20 Beauty Ribbon Super 0x3C & 0x40 Beauty Ribbon Hyper 0x3C & 0x80 Beauty Ribbon Master 0x3D & 0x01 Cute Ribbon 0x3D & 0x02 Cute Ribbon Super 0x3D & 0x04 Cute Ribbon Hyper 0x3D & 0x08 Cute Ribbon Master 0x3D & 0x10 Smart Ribbon 0x3D & 0x20 Smart Ribbon Super 0x3D & 0x40 Smart Ribbon Hyper 0x3D & 0x80 Smart Ribbon Master Hoenn Ribbon Set 2 Bit Ribbon 0x3E & 0x01 Tough Ribbon 0x3E & 0x02 Tough Ribbon Super 0x3E & 0x04 Tough Ribbon Hyper 0x3E & 0x08 Tough Ribbon Master 0x3E & 0x10 Champion Ribbon 0x3E & 0x20 Winning Ribbon 0x3E & 0x40 Victory Ribbon 0x3E & 0x80 Artist Ribbon 0x3F & 0x01 Effort Ribbon 0x3F & 0x02 Battle Champion Ribbon 0x3F & 0x04 Regional Champion Ribbon 0x3F & 0x08 National Champion Ribbon 0x3F & 0x10 Country Ribbon 0x3F & 0x20 National Ribbon 0x3F & 0x40 Earth Ribbon 0x3F & 0x80 World Ribbon Save File Location The party Pokémon are stored in the save file beginning at offset 0x18e08. In the first small save block, the first Daycare Pokémon is located at 0x0141C, and the second is located at 0x01508. In the second small block, the first Daycare Pokémon is located at 0x4141C, and the second is located at 0x41508. In the first small save block, the Pal Park Pokémon are stored beginning at 0x0BA28. In the second small save block, the Pal Park Pokémon are stored beginning at 0x4BA28. Each party and Daycare Pokémon is 220 bytes in size. The PC storage Pokémon are stored in the save file from Box 1 to Box 24. The offset starts at 0x24400. Each Pokémon stored in the PC is 136 bytes in size.
  12. evandixon

    PKM File Fields

    PKM files have been ripped from saved and traded online for roughly the last 5 years or so by players [as of 2012]. Pulling them out of games is very easy and makes trading, legal checking specific bits of data, or giving out pokemon to friends a simple task. When GameFreak needs to get or set specific data from a pokemon file, they do it using a switch statement and a series of fields. They do it like so: (starting from 0, obviously) typedef enum PkmField { FIELD_PID, FIELD_PARTY_DECRYPT, FIELD_BOX_DECRYPT, FIELD_EGG_SPECIES, FIELD_SUM, FIELD_SPECIES, FIELD_ITEM, FIELD_ID, FIELD_EXP, FIELD_HAPPY, -and so forth- }; When they need to write data to the pkm file, they use this function: void setPkmStat(void* pPkm, PkmField field, int data) and when they need to retrieve data from a PKM file, they use this: u32 getPkmStat(void* pPkm, PkmField field, int data) (data is basically always 0 in the "get" function- unless they're retrieving a string, in which case it's a string buffer pointer) So to get a piece of data from a pokemon, say if the pokemon is an egg(0x4C), it would look something like this: getPkmStat(pkm_pointer, IS_EGG, 0); The switch statements for these functions are large. In B2W2 a pkm file has 180 fields. In BW pkm files had 176 fields. The following is a partial list of field values for these functions: (all are in hexadecimal) 0x0 pid 0x1 (sanity) pkm party data is decrypted 0x2 (sanity) pkm box data is decrypted 0x3 (sanity) is pkm species egg 0x4 checksum 0x5 species 0x6 item 0x7 sidtid 0x8 exp 0x9 happiness 0xA, 10 ability 0xB, 11 markings 0xC, 12 region 0xD, 13 hp ev 0xE, 14 atk ev 0xF, 15 def ev 0x10, 16 spe ev 0x11, 17 spa ev 0x12, 18 spd ev 0x13, 19 cool contest 0x14, 20 beauty contest 0x15, 21 cute contest 0x16, 22 smart contest 0x17, 23 tough contest 0x18, 24 sheen contest 0x19, 25 sinnoh champ ribbon 0x1A, 26 ability ribbon 0x1B, 27 great ability ribbon 0x1C, 28 double ability ribbon 0x1D, 29 multi ability ribbon 0x1E, 30 pair ability ribbon 0x1F, 31 world ability ribbon 0x20, 32 alert ribbon 0x21, 33 shock ribbon 0x22, 34 downcast ribbon 0x23, 35 careless ribbon 0x24, 36 relax ribbon 0x25, 37 snooze ribbon 0x26, 38 smile ribbon 0x27, 39 gorgeous ribbon 0x28, 40 royal ribbon 0x29, 41 gorgeous royal ribbon 0x2A, 42 footprint ribbon 0x2B, 43 record ribbon 0x2C, 44 history ribbon 0x2D, 45 legend ribbon 0x2E, 46 red ribbon 0x2F, 47 green ribbon 0x30, 48 blue ribbon 0x31, 49 festival ribbon 0x32, 50 carnival ribbon 0x33, 51 classic ribbon 0x34, 52 premier ribbon 0x35, 53 ribbon 0x36, 54 move1 0x37, 55 move2 0x38, 56 move3 0x39, 57 move4 0x3A, 58 move1 current pp 0x3B, 59 move2 current pp 0x3C, 60 move3 current pp 0x3D, 61 move4 current pp 0x3E, 62 move1 ppup count 0x3F, 63 move2 ppup count 0x40, 64 move3 ppup count 0x41, 65 move4 ppup count 0x42, 66 move1 max pp 0x43, 67 move2 max pp 0x44, 68 move3 max pp 0x45, 69 move4 max pp 0x46, 70 hp iv 0x47, 71 atk iv 0x48, 72 def iv 0x49, 73 spe iv 0x4A, 74 spa iv 0x4B, 75 spd iv 0x4C, 76 is egg 0x4D, 77 cool ribbon 0x4E, 78 cool ribbon super 0x4F, 79 cool ribbon hyper 0x50, 80 cool ribbon master 0x51, 81 beauty ribbon 0x52, 82 beauty ribbon super 0x53, 83 beauty ribbon hyper 0x54, 84 beauty ribbon master 0x55, 85 cute ribbon 0x56, 86 cute ribbon super 0x57, 87 cute ribbon hyper 0x58, 88 cute ribbon master 0x59, 89 smart ribbon 0x5A, 90 smart ribbon super 0x5B, 91 smart ribbon hyper 0x5C, 92 smart ribbon master 0x5D, 93 tough ribbon 0x5E, 94 tough ribbon super 0x5F, 95 tough ribbon hyper 0x60, 96 tough ribbon master 0x61, 97 champion ribbon 0x62, 98 winning ribbon 0x63, 99 victory ribbon 0x64, 100 artist ribbon 0x65, 101 effort ribbon 0x66, 102 marine ribbon 0x67, 103 land ribbon 0x68, 104 sky ribbon 0x69, 105 country ribbon 0x6A, 106 national ribbon 0x6B, 107 earth ribbon 0x6C, 108 world ribbon 0x6D, 109 fateful encounter 0x6E, 110 gender(0 male, 1 female) 0x6F, 111 form 0x70, 112 nature 0x71, 113 has dw abil 0x72, 114 0x73, 115 name 0x74, 116 nickname 0x75, 117 is nicknamed 0x76, 118 0x77, 119 game of origin 0x78, 120 0x79, 121 0x7A, 122 0x7B, 123 0x7C, 124 0x7D, 125 0x7E, 126 0x7F, 127 0x80, 128 0x81, 129 0x82, 130 0x83, 131 0x84, 132 0x85, 133 0x86, 134 0x87, 135 0x88, 136 0x89, 137 0x8A, 138 0x8B, 139 0x8C, 140 0x8D, 141 OT name in 0x8E, 142 OT name out 0x8F, 143 year egg received (0-99) 0x90, 144 month egg received(1-12) 0x91, 145 day egg received(1-end of month) 0x92, 146 year met/egg hatched(0-99) 0x93, 147 month met/egg hatched(1-12) 0x94, 148 day met/egg hatched(1-end of month) 0x95, 149 location met/egg received 0x96, 150 egg hatch location 0x97, 151 pokerus 0x98, 152 poke ball 0x99, 153 met at level 0x9A, 154 set if OT gender is female 0x9B, 155 0x9C, 156 0x9D, 157 0x9E, 158 level 0x9F, 159 capsule seal index 0xA0, 160 current hp 0xA1, 161 max hp 0xA2, 162 attack 0xA3, 163 defense 0xA4, 164 speed 0xA5, 165 spa 0xA6, 166 spd 0xA7, 167 mail 0xA8, 168 0xA9, 169 is slot filled 0xAA, 170 is egg(both sanity bits) 0xAB, 171 get species if filled slot is egg(ret 0 otherwise) 0xAC, 172 get IVs as u32, no is_egg or is_nicknamed included 0xAD, 173 is species NOT nido F/M 0xAE, 174 pkm type 0xAF, 175 pkm type 0xB0, 176 0xB1, 177 0xB2, 178 N's poke
  13. evandixon

    PGT File

    PGT is the Gift data stored in a Wondercard. The Data format is mapped out below: Offset Description 0x0 Data Type 0x2 Corresponding Card slot (1-3) 0x3 Data Specific 0x8 PKM DATA (Encrypted) 0xF4 Unknown Data Types Number Type Data Specific Details 0x0 None 0x1 Pokemon If 0, recipient is OT 0x2 Pokemon Egg If 0, recipient is OT 0x3 Item Item index number 0x4 Rule (What... is a rule??) <-See left 0x5 Seal Seal Index?? 0x6 Accessory Accessory Number 0x7 Manaphy Egg Unused 0x8 Member Card Unused 0x9 Oak's Letter Unused 0xA Azure Flute Unused 0xB Poketch App (DP) App index?? 0xC Secret Key Unused 0xD 0xE PokeWalker Area Area index??
  14. evandixon

    HGSS: Overworld Sprites

    0000 Gold 0100 Little Boy 0200 Little Girl 0300 Bugged Gold after Fly 0400 Youngster Male 0500 Bug catcher 0600 Lady 1 0700 Lady 2 0800 Lady 3 0900 Boy 1 0A00 Electrician 0BOO Cooltrainer Male 0C00 Mum? 0D00 Beauty 0E00 Cooltrainer Female 0F00 Man 1000 Mart Clerk 1100 Old man 1200 Old lady 1300 Fat man 1400 Hiker 1500 Gold on bici 1600 Journalist 1700 Cameramen 1800
  15. evandixon

    Notable Breakpoints

    This page contains RAM addresses to various interesting and useful processes of GBA and DS Pokemon games. Breakpoints can be set at these addresses. Inspiration This page is inspired by tsanth's thread with the same name on GameFAQs: [1] Pokemon DPP (U) DP RAM Address Pl RAM Address Description Discovered by 02000C54 02000C88 Main() Bond697 020064F0 02006AA4 Load from NARC (r1=archive_id, r2=file_id) Alpha 02000FB0 02001034 Begin Seed Calculation Routine mingot, arcee 02005FDC 02006590 Load Overlay (r0=overlay_id) Alpha 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 02050958 Run item routines Mikelan98 020535E8 Use of Journal item entrypoint Mikelan98 02068884 Use of Bicycle item entrypoint Mikelan98 0205EABC Load player's X coord to r0 Mikelan98 0205EAC8 Load player's Y coord to r0 Mikelan98 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 02069820 Determines the 4 grassy patches that will move in Pokeradar and determines whether they are in a tall grass tile or not Mikelan98 02069A00 Use of Pokeradar item entrypoint Mikelan98 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 0207CF48 Use item and load item data Mikelan98 020EBC80 020E1F6C Division routine; R0= R0 / R1, R1=R0%R1 tsanth, SCV 020F355C 020EAC58 Pointer to Begin Routine for Script Command 0000 SCV 020EB974 Pointer to Begin Routine for Script Command 0347 SCV 020F0CCA Item data slots Mikelan98 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 0224190A - ESV calc 02241B28 - nature calc (probably) Pokémon HGSS (U) RAM Address Description Discovered by 02000CA4 Main() Bond697 02007508 Load from NARC (r0=offset, r1=archive_id, r2=file_id) Alpha 0201FD44 PRNG advancement routine Bond697 0201FD68 Alternate(simpler) PRNG Bond697 0203FE24 Script Handler - Read parameter of command (parameter saved in r0) Mikelan98 0204036C Script Handler - Read RAM offset of variable in r1 (offset saved in r0) Mikelan98 020403A4 Script Handler - Read value of variable in r1 (value saved in r0) Mikelan98 0204BFF0 Wondercard pokemon generation- full routine Bond697 02050544 Run item routines Mikelan98 02061E2A NPC movement arcee 0206C9D8 International shiny PID generation Bond697 02070068 Shiny check Bond697 020D34B0 Make wondercard PID Bond697 020D3A38 Disable slow IRQ Bond697 020D3A4C Enable slow IRQ Bond697 020F2998 Signed divmod() ? 020F2BA4 Unsigned divmod() ? 020F6BC8 Map headers table (Wild, Tileset, X-coord, Y-coord, Matrix, Scripts, Level scripts, Texts, Music 1, Music 2, Events, Name, Name style, Weather, Camera, ?, Allowed actions) Mikelan98 02100182 Item data slots Mikelan98 0210F6CC Mersenne Twister lookup table counter Bond697 021D15A8 PRNG State Kazo 021D15AC Mersenne Twister lookup table Kazo 021E19DC Upper half of wondercard PID Bond697 022074A2 Overworld Sprite Control Table Alpha 022440A0 Pickup / Honey Gather handler magical 02246B24 Start of Water (Fishing) Encounter Table Lookup Handler [2] mingot 02246FCC Fishing decision arcee 02247228 Pokéball catching routine magical 022475F2 Partial encounter calc- movement modifier arcee 0224767A Partial encounter calc- ability/item modifier arcee 02247698 Encounter slots arcee 02247720 Start of Water (Sweet Scent/Surfing) Encounter Table Lookup Handler [3] mingot 022477C0 Headbutt tree encounter slots (Post-National Dex) magical 022483C4 Partial encounter calc- roamer modifier arcee 02108514 Starter species in RAM(in the decompressed arm9 @ 108514) Bond697 0226CC7C Type Effectiveness Table (overlay 0012) Alpha Pokémon BW (U) 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 Input handler 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 handler 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 02088A98 Date/time switch statement- used to grab pieces of the date and time and convert them to hex Bond697 02088E74 Convert BCD->hex, for RTC Bond697 020946AC Metrowerks ARM-provided lib rand- used for DS-to-DS handshake XFR,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 020A1B50 Model/texture definitions/positioning data Bond697 020AA1C4 RNG state pointer Bond697 02146292 Pokemon to be encountered Bond697 02146974 Pointer to the struct for the current heap being used Bond697 02146A18 Mersenne Twister seed table pointer Bond697 02146A2C u32 date_time[8] (in hex) Bond697 02150920 SVC mode stack location for card reads/writes Bond697 02151260 SWI/SVC mode stack 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 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 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 021AA41C Battle test/decision Bond697 021AA43A Battle test Bond697 021AA44C White Forest Battle Decision Routine- return 0 if no battle, 1 if there's a battle Bond697 021AA700 ((rand() * 0xFFFF) >> 32) /0x290 -> seems to only be used for battle tests Bond697 021BC4F8 Player setup on new game Bond697 021BC50A Make IDs Bond697 021C0A6C Battle routine(setup) Bond697 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 0221BBD0 Start of save data in RAM(when saving, all relevant data is written here, then cart RAM, then .sav) Bond697 022394E0 Date/time in hex - uint array Bond697 0223C9D0 Daycare pokemon 1 Bond697 0223CAB4 Daycare pokemon 2 Bond697 0223D8CC BP Counter Bond697 0224120C Wifi RNG 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 02017638 Pokemon creation routine(makePKM) Bond697 02019AB8 PKM checksum generation Bond697 02019C54 PKM block shuffling Bond697 0203F3A0 Encrypt SAV, battle video, mystery gift Bond697, Codr, XFR 02150E6C Graphics bank assignment struct Bond697 0214EA70 Sound archive info struct Bond697 02006984 Play PKM cry- in battle and otherwise Bond697 02011298 Script handler Bond697 0224FED4 Expanded heap memory allocation struct Bond697 02169024 Runs everything that has to happen after midnight Bond697 0200D440 Swarm calculation and storage Bond697 02151350 Tick system Bond697 0272E9E8 DSi library overlay Bond697 021E6184 Moonlight modifier picker Bond697 Pokémon BW (J) RAM Address Description Discovered by 02005124 Main() Bond697 022151D4 Mersenne Twister Lookup Table OmegaDonut 02215B94 Mersenne Twister Lookup Table Counter Kaphotics 022160A8 PRNG State Kazo 02FFFC3C Delay OmegaDonut 02FFFDE8 Date OmegaDonut (All offsets are White offsets. Black offsets are White offset minus 0x20) Pokémon Emerald (J) RAM Address Description Discovered by 02024664 Frame Counter Kaphotics 03005AE0 PRNG State Kaphotics 08000248 IRQ setup Bond697 080003A4 Main loop Bond697 080005E4 Keypress handler Bond697 08000758 VBlank interrupt Bond697 0806F050 PRNG Advancement Routine Kaphotics 080B413A Feebas setup routine on finding a Feebas tile Bond697 08295E87 Signed division magical 08296518 Modulus routine- r0 % r1, return result in r0 Bond697 08297D6C memset magical Pokémon Emerald (U) RAM Address Description Discovered by 02020000 Timer1 storage on TID creation Bond697 020249C0 Main RNG Frame counter mingot 03000DC0 RTC array buffer(char rtc[8]) Bond697 03000E20 Directional movement counters(possibly per frame) Bond697 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 080B49E2 Feebas setup routine on finding a Feebas tile Bond697 080B4AC8 Encounter Slot Bond697 080B4C74 Set level Bond697 080B4E2A Sync (bool) Bond697 080B4E4C Nature Setup/Decision (skip "if(sync())") Bond697 080B5144 Battle Test Bond697 08067BF8 Roamer creation start Bond697 08067E96 PKM Building Routine (test temp PIDs, make IVs on success) Bond697 0806D088 Get nature from tempPID(pass tempPID as an arg, return nature value) Bond697 0806F5CC PRNG Advancement Routine mingot 0817759E ARNG Bond697 082E7BE0 Modulus routine- r0 % r1, return result in r0 Bond697 082E7B68 Division routine- r0 / r1, return result in r0 Bond697 082E7540 Division routine- r0 / r1, return result in r0 Bond697 08070AC4 Make bred pokemon Bond697 080701E0 Make bred PID Bond697 020241F0 Damage storage- base dmg, etc Bond697 08070266 Inheritance- bugged to not prevent inheriting the same IV multiple times Bond697 08070218 Inheritance check- make sure the same IV isn't inherited multiple times- bugged due to the wrong argument being passed to it Bond697 0806AD9C Set PKM data field Bond697 0806A674 Read PKM data field Bond697 0806A518 Get PKM data field Bond697 0806ACAC Write PKM data field Bond697 0806DCB4 Pokerus handler Bond697 0806DEC4 Pokerus spread Bond697 03004134 IME store Bond697 Pokémon Ruby / Sapphire (U) RAM Address Description Discovered by 02024D1C Quick Claw Determination FractalFusion 020287E4 Egg Creation Step Counter Kaphotics 03004818 PRNG State Multiple 03000460 RTC Bond697 0800024C Main loop Bond697 080003E4 Initial seed creation Bond697 08000428 Keypress handler Bond697 0803AADC PID creation routine Bond697 08040048 Pokerus handler Bond697 08040EA4 Seed set routine, post creation Bond697 08040E84 rand() Bond697 08084AA6 Feebas decision Bond697 081E0770 Interrupts/SWIs Bond697 080421B0 Make bred PKM Bond697 080418F0 Build bred PID Bond697 081E0E20 Division r0/r1, result in r0 Bond697 081E0E98 Modulus r0%r1, result in r0 Bond697 08041960 Inheritance check- insure no duplicate IVs Bond697 Pokémon FireRed / LeafGreen (U) RAM Address Description Discovered by 02020000 Timer1 storage on initial seed creation flovv, Bond697 03005000 PRNG State Bond697 08000558 Turn on Timer1 @ TM1CNT_H = 0x80 Bond697 08000564 Grab and return the value of Timer1 for use in seeding Bond697 08000570 Turn off Timer1 @ TM1CNT_H = 0x0 and store the grabbed value to 0x02020000 Bond697 0803DA54 Make PKM Bond697 08044EC8 PRNG Advancement Routine Bond697 02023D50 Damage store Bond697 Pokémon Ruby Debug Version (G) RAM Address Description Discovered by 02024F54 P1 successive Protects 030043D3 Turns in battle 030046F0 CPU Active Sleep counter 030048F8 PRNG state Bond697 08045324 PRNG Advancement Routine(rand()) Bond697 08085CEC ARNG Advancement Routine Bond697 08220E5E Protect success rates Pokémon B2W2 (J) RAM Address Description Discovered by 02005124 TwlMain Bond697 02005748 RNG advancement routine 1 Bond697 02005784 RNG advancement routine 2 Bond697 020158E8 Script handler Bond697 02043BE8 Mersenne Twister setup Bond697 02043C38 Mersenne Twister handler Bond697 02043DA4 Seed building function Bond697 021A0E30 Create wild PID Bond697 021FE6E8 Mersenne Twister table Bond697 0276FA88 DSi Mersenne Twister table Bond697 021FF0A8 Mersenne Twister table counter Bond697 021FF5D8 RNG state Bond697 02770978 DSi RNG state Bond697 021707DC Probability table Bond697 0216FCE0 Probability loop Bond697 0216FCFC Inside probability loop Bond697 0223B188 Encounter slots in RAM Bond697 021DD22C Battle RNG state Bond697 0221D3A4 Item slots in RAM Bond697 022268D1 Repel counter Bond697 022260A4 Cash Bond697 022229A4 Total steps Bond697 0223AEB4 Current game(loaded save) step counter Bond697 0208D574 Unsigned divmod Bond697 0208D368 Signed divmod Bond697 0209D46C RNG pointer Bond697 021A0E9A 0x80000000 PID-OR decision Bond697 021A1994 Shaking patch generation Bond697 0219FAE4 Hardcoded trainer name length Bond697 0219CB1C Hardcoded wild pokemon name length Bond697 021D9DEC Data entry setup Bond697 021BF190 Hardcoded starter pokemon name length Bond697 02249BD0 Script info struct Bond697 020825B8 Abort on bad allocation Bond697 021BDA68 Breeding- normal/Shiny Charm/Masuda Method Bond697 021412C0 Mersenne Twister table pointer Bond697 02153100 Scripting system- memory allocation/setup Bond697 022581F4 Wild pokemon PID storage Bond697 02181E80 Hollow pokemon generation Bond697 02228B70 Hollow pokemon data array(u16 hollow[20]) Bond697 0200F84C Is hollow filled Bond697 021C8938 Hollow fill decisions Bond697 0214BE7C SVC stack Bond697 0200F8B4 Get hollow Bond697 0200F8BC Set hollow Bond697 02228B98 Current hollow number Bond697 0221DDAC Slot 1 PID Bond697 0221DE88 Slot 2 PID Bond697 0221DF64 Slot 3 PID Bond697 0221E040 Slot 4 PID Bond697 0221E11C Slot 5 PID Bond697 0221E1F8 Slot 6 PID Bond697 0207A998 DSi check Bond697 0214DC24 Mic status Bond697 0200F898 Set hollow gender Bond697 0200F830 Enable hollow Bond697 0200F818 Set subslot Bond697 0200F800 Set slot Bond697 0205780C Build seed - wifi Bond697 02241970 Wifi RNG state Bond697 021BCAC0 Battle rand Bond697 021A5318 Damage formula Bond697 021BCC58 Base damage Bond697 021BCC80 Damage type modifier Bond697 02005234 Vblank calback Bond697 0201C4E0 PKM creation Bond697 0201CDC0 Shiny check Bond697 0201D6E0 PID creation Bond697 0203D988 Input handler Bond697 021BD21C Breeding Bond697 02156410 Create scripted pokemon Bond697 02140B1E Current special pokemon being created Bond697 0201D644 Special PID creation Bond697 02026858 HM check Bond697 0223B3E4 Expanded heap memory allocation struct Bond697 02141324 G3D info struct Bond697 0214340C G3D global state Bond697 022263A4 Pokedex data in RAM Bond697 02162A14 Runs everything that has to happen after midnight Bond697 0200DD20 Swarm calculation and storage Bond697 02141440 VRAM transfer task array Bond697 0214BF70 Tick System Bond697 02258454 Decrypted battle video allocation Bond697 (All offsets are White offsets.) Pokémon B2W2 (U) RAM Address Description Discovered by 02005124 TwlMain Bond697 02005748 RNG advancement routine 1 Bond697 02005784 RNG advancement routine 2 Bond697 0201592C Script handler Bond697 020191D8 Read event flag Bond697 02019204 Update event flag Bond697 0201922C Set event flag Bond697 0201D688 Create special PID (N's pokemon, etc) Bond697 0201D724 Create wild PID Bond697 02026B44 Check for a hidden machine move Bond697 02043F08 Mersenne Twister setup Bond697 02043F58 Mersenne Twister handler Bond697 020440C4 Seed building function Bond697 0209DAC0 Current music Bond697 0214185C Game Freak's memory allocator Bond697 0214C5B0 Tick system Bond697 02153748 Scripting system- virtual machine pointer list and count Bond697 02153978 execute script Bond697 021A2428 EV handler Bond697 021BDA74 Breeding Bond697 021DD88C Battle RNG state Bond697 021FED68 Mersenne Twister table Bond697 021FF728 Mersenne Twister table counter Bond697 021FFC58 RNG state Bond697 02205244 Save data info Bond697 0220528C Save data block list (12 bytes per block: blknum, size, start) Bond697 02205624 Save data in RAM Bond697 02223024 Total steps Bond697 02225882 Const data storage in RAM Bond697 02225524 Event flag storage in RAM Bond697 02226328 Daycare poke 1 Bond697 0222640C Daycare poke 2 Bond697 022264F0 Egg seed Bond697 02226724 Money Bond697 022291F0 Hollow pokemon data array Bond697 0223B534 Current game step counter Bond697 02FE35C8 Egg data local array in RAM(u32 eggData[34]) Bond697 021FFB00 Overlays currently loaded list, 1 list each for EWRAM, ITCM, and DTCM Bond697 0203CED0 Overlay inspector Bond697 0203CE38 Overlay loader Bond697 021D01C0 N's pokemon Bond697 021D0230 Swarm pokemon Bond697 021D0190 Encounter slots Bond697 021D014C Item percentages Bond697 021D0B6C Move tutor Bond697 021D0310 Dust cloud rewards Bond697 021D0420 Field effect lookup Bond697 021C9F90 Fog table Bond697 021C9F34 Edge color table Bond697 021D21B0 Incense breeding lookup Bond697 0208F18C Save block action lookup Bond697 0208F948 Form lookup (u16 pkmFormSet[21][2]) Bond697 0208FA58 Key system keys Bond697 02090394 Rotom special moves Bond697 020903A0 Lookup table for adjusting stats for nature (u8 stat_nature_adjust[25][5]) Bond697 020904A0 Lookup table for pkm block shuffling (u8 pkm_blk_shuf[32][4]) Bond697 02091C42 State list Bond697 02091B58 Sweden county list Bond697 02090CB0 TM List(tm1-92, hm1-6, tm93-95) Bond697 02090B78 Berries Bond697 021BD100 Battle rand Bond697 021A5958 Damage formula Bond697 02141914 Main rtc date - year, month, day, week Bond697 02141924 Main rtc time - hour, minute, second Bond697 020492E8 Get resource and resource type: bva, bma, bca, btp, bmd, btx Bond697 020493B0 Load 3d gfx from narc(from already loaded narc) Bond697 02049370 Load 3d gfx from file(load narc then file from narc) Bond697 020493F0 Load 3d gfx from file path(from path to narc) Bond697 0223B484 Map number Bond697 0223B48A X pos Bond697 0223B48E Z pos Bond697 0223B492 Y pos Bond697 0223B49D Direction facing Bond697 02246830 Area data(zonedata) Bond697 0209DAA4 VRAM transfer manager counter for successful transfer Bond697 021D7540 Type-effectiveness chart(0- no effect, 2- .5x dmg, 4- 1x dmg, 8- 2x dmg) Bond697 021BD1A0 Determine type effectiveness for the current attack Bond697 020308EC Set up opposing trainers and their pokes for battle Bond697 0209D780 Start of .sbss Bond697 0214F540 End of .sbss Bond697 Pokémon X / Y (U) RAM Address Description Location Discovered by 00119C4C Mersenne Twister generate unsigned int ExeFS Bond697 0011E52C Seeding function for TinyMT ExeFS Bond697 0011E550 Generate seed for RNG ExeFS Bond697 0011E5C8 Seeding function for Mersenne Twister ExeFS Bond697 0015E958 Unsigned 32-bit divmod ExeFS magical 00163CC4 TinyMT PRNG ExeFS magical 00168660 Decrypt pokemon ExeFS Bond697 001685F0 Encrypt pokemon ExeFS Bond697 0016B358 Get pkm block 0 pointer after shuffle ExeFS Bond697 0016B3D4 Get pkm block 1 pointer after shuffle ExeFS Bond697 00176168 Get pkm block 2 pointer after shuffle ExeFS Bond697 001761E8 Get pkm block 3 pointer after shuffle ExeFS Bond697 0018FB50 powf ExeFS magical 002C67A0 LCRNG, generate random unsigned int ExeFS Bond697 003C71D8 Do pickup and honey gather ExeFS magical 004455A8 Pickup item table ExeFS magical 0002EFC0 Capture routine DllBattle.cro magical 000D12A8 Type effectiveness table DllBattle.cro Bond697 (All offsets are X offsets.) (CRO locations are offset, not address.) Pokémon Omega Ruby / Alpha Sapphire (U) RAM Address Description Location Discovered by 00168EC0 Decrypt pokemon ExeFS Bond697 00168E50 Encrypt pokemon ExeFS Bond697 0016BC84 Get block 0 pointer after shuffle ExeFS Bond697 0016BD00 Get block 1 pointer after shuffle ExeFS Bond697 00176EFC Get block 2 pointer after shuffle ExeFS Bond697 0016BD80 Get block 3 pointer after shuffle ExeFS Bond697 004872FC Pickup item table ExeFS Kaphotics 004960F8 Move Tutor List ExeFS Kaphotics 004A67EE TM/HM Move List ExeFS Kaphotics 000DB428 Type effectiveness table DllBattle.cro Bond697 (All offsets are Omega Ruby offsets.) (CRO locations are offset, not address.)
  16. evandixon

    Map Matrix

    The map_matrix contains the data that associates the graphically generated maps to the map values. File location Pokemon DPPt- root/fielddata/mapmatrix/map_matrix.narc Pokemon HGSS- root/a/0/4/1 Data Structure Data Offset Size Description 0x00 Uint8 Width of Global Map 0x01 Uint8 Height of Global Map 0x04 Uint8 Number of Characters of Map Prefix 0x05 Char* Map Prefix Name Next UInt16** Data * Length determined by 0x04 ** Length of data is Height X Width Data In Use Let Height = 3, Width = 3, Data = ABCDEFGHI, Map Prefix = ExMap (so prefix length is 5) [[A B C] [D E F] [G H I]] This illustrates that the value at B goes with the map named ExMap00_01c because B is (0,1) in the above matrix. The map names are declared within the proper land_data[_release] files. The value of B is the map value, that is, the value of the index of the map (where 411 is Twinleaf Town in DPPt and 60 is New Bark Town in HGSS).
  17. Balls 0x0001 = Master Ball 0x0002 = Ultra Ball 0x0003 = Great Ball 0x0004 = Poké Ball 0x0005 = Safari Ball 0x0006 = Net Ball 0x0007 = Dive Ball 0x0008 = Nest Ball 0x0009 = Repeat Ball 0x000A = Timer Ball 0x000B = Luxury Ball 0x000C = Premier Ball 0x000D = Dusk Ball 0x000E = Heal Ball 0x000F = Quick Ball 0x0010 = Cherish Ball Medicine 0x0011 = Potion 0x0012 = Antidote 0x0013 = Burn Heal 0x0014 = Ice Heal 0x0015 = Awakening 0x0016 = Parlyz Heal 0x0017 = Full Restore 0x0018 = Max Potion 0x0019 = Hyper Potion 0x001A = Super Potion 0x001B = Full Heal 0x001C = Revive 0x001D = Max Revive 0x001E = Fresh Water 0x001F = Soda Pop 0x0020 = Lemonade 0x0021 = Moomoo Milk 0x0022 = EnergyPowder 0x0023 = Energy Root 0x0024 = Heal Powder 0x0025 = Revival Herb 0x0026 = Ether 0x0027 = Max Ether 0x0028 = Elixir 0x0029 = Max Elixir 0x002A = Lava Cookie 0x002B = Berry Juice 0x002C = Sacred Ash 0x002D = HP Up 0x002E = Protein 0x002F = Iron 0x0030 = Carbos 0x0031 = Calcium 0x0032 = Rare Candy 0x0033 = PP Up 0x0034 = Zinc 0x0035 = PP Max 0x0036 = Old Gateau Battle Items 0x0037 = Guard Spec. 0x0038 = Dire Hit 0x0039 = X Attack 0x003A = X Defend 0x003B = X Speed 0x003C = X Accuracy 0x003D = X Special 0x003E = X Sp. Def 0x003F = Poké Doll 0x0040 = Fluffy Tail 0x0041 = Blue Flute 0x0042 = Yellow Flute 0x0043 = Red Flute 0x0044 = Black Flute 0x0045 = White Flute General Items 1 0x0046 = Shoal Salt 0x0047 = Shoal Shell 0x0048 = Red Shard 0x0049 = Blue Shard 0x004A = Yellow Shard 0x004B = Green Shard 0x004C = Super Repel 0x004D = Max Repel 0x004E = Escape Rope 0x004F = Repel 0x0050 = Sun Stone 0x0051 = Moon Stone 0x0052 = Fire Stone 0x0053 = Thunderstone 0x0054 = Water Stone 0x0055 = Leaf Stone 0x0056 = TinyMushroom 0x0057 = Big Mushroom 0x0058 = Pearl 0x0059 = Big Pearl 0x005A = Stardust 0x005B = Star Piece 0x005C = Nugget 0x005D = Heart Scale 0x005E = Honey 0x005F = Growth Mulch 0x0060 = Damp Mulch 0x0061 = Stable Mulch 0x0062 = Gooey Mulch 0x0063 = Root Fossil 0x0064 = Claw Fossil 0x0065 = Helix Fossil 0x0066 = Dome Fossil 0x0067 = Old Amber 0x0068 = Armor Fossil 0x0069 = Skull Fossil 0x006A = Rare Bone 0x006B = Shiny Stone 0x006C = Dusk Stone 0x006D = Dawn Stone 0x006E = Oval Stone 0x006F = Odd Keystone 0x0070 = Griseous Orb (Platinum only) 0x0087 = Adamant Orb 0x0088 = Lustrous Orb Mail 0x0089 = Grass Mail 0x008A = Flame Mail 0x008B = Bubble Mail 0x008C = Bloom Mail 0x008D = Tunnel Mail 0x008E = Steel Mail 0x008F = Heart Mail 0x0090 = Snow Mail 0x0091 = Space Mail 0x0092 = Air Mail 0x0093 = Mosaic Mail 0x0094 = Brick Mail Berries 0x0095 = Cheri Berry 0x0096 = Chesto Berry 0x0097 = Pecha Berry 0x0098 = Rawst Berry 0x0099 = Aspear Berry 0x009A = Leppa Berry 0x009B = Oran Berry 0x009C = Persim Berry 0x009D = Lum Berry 0x009E = Sitrus Berry 0x009F = Figy Berry 0x00A0 = Wiki Berry 0x00A1 = Mago Berry 0x00A2 = Aguav Berry 0x00A3 = Iapapa Berry 0x00A4 = Razz Berry 0x00A5 = Bluk Berry 0x00A6 = Nanab Berry 0x00A7 = Wepear Berry 0x00A8 = Pinap Berry 0x00A9 = Pomeg Berry 0x00AA = Kelpsy Berry 0x00AB = Qualot Berry 0x00AC = Hondew Berry 0x00AD = Grepa Berry 0x00AE = Tamato Berry 0x00AF = Cornn Berry 0x00B0 = Magost Berry 0x00B1 = Rabuta Berry 0x00B2 = Nomel Berry 0x00B3 = Spelon Berry 0x00B4 = Pamtre Berry 0x00B5 = Watmel Berry 0x00B6 = Durin Berry 0x00B7 = Belue Berry 0x00B8 = Occa Berry 0x00B9 = Passho Berry 0x00BA = Wacan Berry 0x00BB = Rindo Berry 0x00BC = Yache Berry 0x00BD = Chople Berry 0x00BE = Kebia Berry 0x00BF = Shuca Berry 0x00C0 = Coba Berry 0x00C1 = Payapa Berry 0x00C2 = Tanga Berry 0x00C3 = Charti Berry 0x00C4 = Kasib Berry 0x00C5 = Haban Berry 0x00C6 = Colbur Berry 0x00C7 = Babiri Berry 0x00C8 = Chilan Berry 0x00C9 = Liechi Berry 0x00CA = Ganlon Berry 0x00CB = Salac Berry 0x00CC = Petaya Berry 0x00CD = Apicot Berry 0x00CE = Lansat Berry 0x00CF = Starf Berry 0x00D0 = Enigma Berry 0x00D1 = Micle Berry 0x00D2 = Custap Berry 0x00D3 = Jaboca Berry 0x00D4 = Rowap Berry General Items 2 (Held Items) 0x00D5 = BrightPowder 0x00D6 = White Herb 0x00D7 = Macho Brace 0x00D8 = Exp. Share 0x00D9 = Quick Claw 0x00DA = Soothe Bell 0x00DB = Mental Herb 0x00DC = Choice Band 0x00DD = King's Rock 0x00DE = SilverPowder 0x00DF = Amulet Coin 0x00E0 = Cleanse Tag 0x00E1 = Soul Dew 0x00E2 = DeepSeaTooth 0x00E3 = DeepSeaScale 0x00E4 = Smoke Ball 0x00E5 = Everstone 0x00E6 = Focus Band 0x00E7 = Lucky Egg 0x00E8 = Scope Lens 0x00E9 = Metal Coat 0x00EA = Leftovers 0x00EB = Dragon Scale 0x00EC = Light Ball 0x00ED = Soft Sand 0x00EE = Hard Stone 0x00EF = Miracle Seed 0x00F0 = BlackGlasses 0x00F1 = Black Belt 0x00F2 = Magnet 0x00F3 = Mystic Water 0x00F4 = Sharp Beak 0x00F5 = Poison Barb 0x00F6 = NeverMeltIce 0x00F7 = Spell Tag 0x00F8 = TwistedSpoon 0x00F9 = Charcoal 0x00FA = Dragon Fang 0x00FB = Silk Scarf 0x00FC = Up-Grade 0x00FD = Shell Bell 0x00FE = Sea Incense 0x00FF = Lax Incense 0x0100 = Lucky Punch 0x0101 = Metal Powder 0x0102 = Thick Club 0x0103 = Stick 0x0104 = Red Scarf 0x0105 = Blue Scarf 0x0106 = Pink Scarf 0x0107 = Green Scarf 0x0108 = Yellow Scarf 0x0109 = Wide Lens 0x010A = Muscle Band 0x010B = Wise Glasses 0x010C = Expert Belt 0x010D = Light Clay 0x010E = Life Orb 0x010F = Power Herb 0x0110 = Toxic Orb 0x0111 = Flame Orb 0x0112 = Quick Powder 0x0113 = Focus Sash 0x0114 = Zoom Lens 0x0115 = Metronome 0x0116 = Iron Ball 0x0117 = Lagging Tail 0x0118 = Destiny Knot 0x0119 = Black Sludge 0x011A = Icy Rock 0x011B = Smooth Rock 0x011C = Heat Rock 0x011D = Damp Rock 0x011E = Grip Claw 0x011F = Choice Scarf 0x0120 = Sticky Barb 0x0121 = Power Bracer 0x0122 = Power Belt 0x0123 = Power Lens 0x0124 = Power Band 0x0125 = Power Anklet 0x0126 = Power Weight 0x0127 = Shed Shell 0x0128 = Big Root 0x0129 = Choice Specs 0x012A = Flame Plate 0x012B = Splash Plate 0x012C = Zap Plate 0x012D = Meadow Plate 0x012E = Icicle Plate 0x012F = Fist Plate 0x0130 = Toxic Plate 0x0131 = Earth Plate 0x0132 = Sky Plate 0x0133 = Mind Plate 0x0134 = Insect Plate 0x0135 = Stone Plate 0x0136 = Spooky Plate 0x0137 = Draco Plate 0x0138 = Dread Plate 0x0139 = Iron Plate 0x013A = Odd Incense 0x013B = Rock Incense 0x013C = Full Incense 0x013D = Wave Incense 0x013E = Rose Incense 0x013F = Luck Incense 0x0140 = Pure Incense 0x0141 = Protector 0x0142 = Electirizer 0x0143 = Magmarizer 0x0144 = Dubious Disc 0x0145 = Reaper Cloth 0x0146 = Razor Claw 0x0147 = Razor Fang TMs & HMs 0x0148 = TM01 0x0149 = TM02 0x014A = TM03 0x014B = TM04 0x014C = TM05 0x014D = TM06 0x014E = TM07 0x014F = TM08 0x0150 = TM09 0x0151 = TM10 0x0152 = TM11 0x0153 = TM12 0x0154 = TM13 0x0155 = TM14 0x0156 = TM15 0x0157 = TM16 0x0158 = TM17 0x0159 = TM18 0x015A = TM19 0x015B = TM20 0x015C = TM21 0x015D = TM22 0x015E = TM23 0x015F = TM24 0x0160 = TM25 0x0161 = TM26 0x0162 = TM27 0x0163 = TM28 0x0164 = TM29 0x0165 = TM30 0x0166 = TM31 0x0167 = TM32 0x0168 = TM33 0x0169 = TM34 0x016A = TM35 0x016B = TM36 0x016C = TM37 0x016D = TM38 0x016E = TM39 0x016F = TM40 0x0170 = TM41 0x0171 = TM42 0x0172 = TM43 0x0173 = TM44 0x0174 = TM45 0x0175 = TM46 0x0176 = TM47 0x0177 = TM48 0x0178 = TM49 0x0179 = TM50 0x017A = TM51 0x017B = TM52 0x017C = TM53 0x017D = TM54 0x017E = TM55 0x017F = TM56 0x0180 = TM57 0x0181 = TM58 0x0182 = TM59 0x0183 = TM60 0x0184 = TM61 0x0185 = TM62 0x0186 = TM63 0x0187 = TM64 0x0188 = TM65 0x0189 = TM66 0x018A = TM67 0x018B = TM68 0x018C = TM69 0x018D = TM70 0x018E = TM71 0x018F = TM72 0x0190 = TM73 0x0191 = TM74 0x0192 = TM75 0x0193 = TM76 0x0194 = TM77 0x0195 = TM78 0x0196 = TM79 0x0197 = TM80 0x0198 = TM81 0x0199 = TM82 0x019A = TM83 0x019B = TM84 0x019C = TM85 0x019D = TM86 0x019E = TM87 0x019F = TM88 0x01A0 = TM89 0x01A1 = TM90 0x01A2 = TM91 0x01A3 = TM92 0x01A4 = HM01 0x01A5 = HM02 0x01A6 = HM03 0x01A7 = HM04 0x01A8 = HM05 0x01A9 = HM06 0x01AA = HM07 0x01AB = HM08 Key Items 0x01AC = Explorer Kit 0x01AD = Loot Sack 0x01AE = Rule Book 0x01AF = Poké Radar 0x01B0 = Point Card 0x01B1 = Journal 0x01B2 = Seal Case 0x01B3 = Fashion Case 0x01B4 = Seal Bag 0x01B5 = Pal Pad 0x01B6 = Works Key 0x01B7 = Old Charm 0x01B8 = Galactic Key 0x01B9 = Red Chain 0x01BA = Town Map 0x01BB = Vs. Seeker 0x01BC = Coin Case 0x01BD = Old Rod 0x01BE = Good Rod 0x01BF = Super Rod 0x01C0 = Sprayduck 0x01C1 = Poffin Case 0x01C2 = Bicycle 0x01C3 = Suite Key 0x01C4 = Oak's Letter 0x01C5 = Lunar Wing 0x01C6 = Member Card 0x01C7 = Azure Flute 0x01C8 = S.S. Ticket 0x01C9 = Contest Pass 0x01CA = Magma Stone 0x01CB = Parcel 0x01CC = Coupon 1 0x01CD = Coupon 2 0x01CE = Coupon 3 0x01CF = Storage Key 0x01D0 = SecretPotion 0x01D1 = Vs. Recorder (Platinum only) 0x01D2 = Gracidea Flower (Platinum only) 0x01D3 = Secret Key (Platinum only) HeartGold and SoulSilver Exclusive Balls x01EC = Fast Ball 0x01ED = Level Ball 0x01EE = Lure Ball 0x01EF = Heavy Ball 0x01F0 = Love Ball 0x01F1 = Friend Ball 0x01F2 = Moon Ball 0x01F3 = Competition Ball 0x01F4 = Park Ball HeartGold and SoulSilver Exclusive Key Items 0x01D4 = ぼんぐりケース (Apricorn Case) 0x01D5 = アンノーンノート (Unown Notebook) 0x01D6 = きのみプランター (Berry Planter) 0x01D7 = ダウジングマシン (Dowsing Machine) 0x01D8 = ブルーカード (Blue Card) 0x01D9 = おいしいシッポ (Slowpoke Tail) 0x01DA = とうめいなスズ (Clear Bell) 0x01DB = カードキー (Card Key) 0x01DC = ちかのかぎ (Basement Key) 0x01DD = ゼニガメじょうろ (Squirtbottle) 0x01DE = あかいウロコ (Red Scale) 0x01DF = おとしもの (Lost Property) 0x01E0 = リニアパス (Linear Pass) 0x01E1 = きかいのぶひん (Weird Part) 0x01E2 = ぎんいろのはね (Silver Wing) 0x01E3 = にじいろのはね (Rainbow Wing) 0x01E4 = ふしぎなタマゴ (Mystery Egg) 0x01E5 = Red Apricorn 0x01E6 = Yellow Apricorn 0x01E7 = Blue Apricorn 0x01E8 = Green Apricorn 0x01E9 = Pink Apricorn 0x01EA = White Apricorn 0x01EB = Black Apricorn 0x01F5 = フォトアルバム (Photo Album) 0x01F6 = GBプレイヤー (GB Player) 0x01F7 = うみなりのスズ (Sea Bell) 0x01F8 = いかりまんじゅう (Manju Anchor?) 0x01F9 = データカード01 (Date Card 01) 0x01FA = データカード02 (Date Card 02) 0x01FB = データカード03 (Date Card 03) 0x01FC = データカード04 (Date Card 04) 0x01FD = データカード05 (Date Card 05) 0x01FE = データカード06 (Date Card 06) 0x01FF = データカード07 (Date Card 07) 0x0200 = データカード08 (Date Card 08) 0x0201 = データカード09 (Date Card 09) 0x0202 = データカード10 (Date Card 10) 0x0203 = データカード11 (Date Card 11) 0x0204 = データカード12 (Date Card 12) 0x0205 = データカード13 (Date Card 13) 0x0206 = データカード14 (Date Card 14) 0x0207 = データカード15 (Date Card 15) 0x0208 = データカード16 (Date Card 16) 0x0209 = データカード17 (Date Card 17) 0x020A = データカード18 (Date Card 18) 0x020B = データカード19 (Date Card 19) 0x020C = データカード20 (Date Card 20) 0x020D = データカード21 (Date Card 21) 0x020E = データカード22 (Date Card 22) 0x020F = データカード23 (Date Card 23) 0x0210 = データカード24 (Date Card 24) 0x0211 = データカード25 (Date Card 25) 0x0212 = データカード26 (Date Card 26) 0x0213 = データカード27 (Date Card 27) 0x0214 = もえぎいろのたま (Green Orb) 0x0215 = ロックカプセル (Rock Capsule) 0x0216 = べにいろのたま (Red Orb) 0x0217 = あいいろのたま (Blue Orb) 0x0218 = なぞのすいしょう (Crystal Puzzle)
  18. evandixon

    HGSS File System

    HGSS File System Credits to Poryhack for the initial list. 0 0 0-Similar to waza_seq.narc 1-Similar to sub_seq.narc 2-Pokemon info (equivalent of personal) 3-Growtbl.narc 4-Pokemon battle sprites 5-Similar to height.narc 6-Trainer backsprites 7-Battle graphic(LZ compressed) 8-Battle screen graphics 9- 1 0-Similar to we.arc 1-Similar to waza_tbl 2-Script 3-Scr_msg 4-Menu graphics(LZ compressed) 5-Bag graphics 6-Font? 7-Similar to item_data 8-Item icons 9-Box graphics(LZ compressed) 2 0-Pokemon icons 1-Summary screen graphics 2-Wechar 3-Wepltt 4-Wecell 5-Wecellanim 6-Imageclip 7-Message file 8-Underg_radar 9-Similar to waza_particle 3 0-Similar to be_seq 1-Namein 2-Event file 3-Level-up moves info (equivalent of wotbl) 4-Evolution data 5-Font data 6-Sign graphics (equivalent of field_board) 7-Encounter data (hg or ss?) 8-Message box graphics 9-Pst_gra 4 0-Bm_field 1-Similar to map_matrix 2-Similar to area_data 3-Similar to area_build 4-Similar to area_map_texset 5-Ugeffect_obj_graphic 6-Title screen graphics 7- 8-Ug_trap 9-Trainer's card graphics 5 0-Ug_fossil 1-Ntag_gra 2-Tradelist 3-Ug_parts 4-Opening 5-Trainer data (equivalent of trdata) 6-Trainer pokemon data (equivalent of trpoke) 7-Similar to trtbl.narc 8-Trainer sprite 9-similar to particledata 6 0-Pokemart graphics 1-Similar to we_sub 2-Ug_anim 3-Weather_sys 4-Ug_menu 5-Land_data 6-Nuts_data 7-Old Pokedex graphics(LZ compressed) 8-New Pokedex graphics (LZ compressed) 9-Pokefoot 7 0-BTX file. 1-In-battle pokemon menus 2-Options menu graphics 3-Pokedex research graphic? 4-Pokedex height/weight, scale, and ordering info (equivalent of zukan_data) 5- 6-Word entry menu 7-In-battle bag menu graphics 8-Oekaki 9-Mail Back graphics 8 0-Mail Back? 1-Overworld sprites 2-Starter selection graphics 3-Fld_comact 4-Apricorn shaker? 5-Pal pad graphics 6-Contest_data 7-Pokeball seal menu graphics 8-Wifip2pmatch 9-Demo_trade 9 0-Sprite animation data (equivalent of poke_anim) 1-Trainer card signing graphics 2-Similar to move_model_list 3-Field_cutin 4-Demo_climax 5-Similar to ball_particle 6-Similar to pl_etc_particle 7-Hall of fame graphics 8-Similar to wifi_earth_place 9-Similar to tr_ai_seq 1 0 0-Wii message board? 1-graphic 2-Misc. encounter data (equivalent of encdata_ex) 3-Misc. terrain model. 4-Vs_demo_gra 5-pokezukan.narc 6-Misc texture animation. 7- 8- 9-Battle transition scene graphics 1 0-Beginning adventure graphics 1-Pokeanm.narc 2- 3-Mystery gift graphics 4-Alt form sprites 5-Egg_data 6-Egg_demo_particle 7- 8-battle frontier 9-shinka_demo_particle 2 0-Intro 1-Similar to intro tv 2-platinum? 3-wifi_earth 4-ranking 5-ppark 6-completion certificate graphics 7-slot machine graphics 8-btdtr 9-btdpm 3 0-old red gyrados TV graphics 1- 2-poke_yofs 3-pokedex encounter data (equivalent of zukan_enc_x) 4- 5-poke_shadow 6-encounter data (hg or ss?) 7-poke_shadow_ofx 8- 9-fldtanime 4 0- 1- 2-unused beta pokegear graphics? 3-pokegear skin graphics 4-pokegear map etc graphics 5-pokegear skin selection graphics 6-pokegear phone graphics 7-pokegear radio graphics 8-bm_room 9-has flying lugia from the intro-no palettes 5 0-area graphics 1-pokewalker pokemon selection graphics 2-yes/no button graphics -3-pokeathalon -4-pokethalon 5- -6-pokeathalon 7- 8- 9- 6 -0-pokeathalon 1- 2-pokemon summary graphics 3-location dropdown frame graphics 4-pointing hand graphics 5- -6-safari zone -7-pokeathalon -8-pokeathalon 9- 7 0- 1-photo album graphics 2-ruins of alph sliding puzzle graphics 3- -4-ruins of alph 5- 6- 7- -8-pokeathalon 9-overworld character sprites 8 0-similar to pl_poke_data 1-d_test 2-similar to fr_script -3-battle frontier 4- 5-pl_cb_data 6-wifi_unionobj 7-guru2 8-frontier_particle 9-bucket 9 0-codein_gra 1- 2-worldtimer 3-manene 4-dp_height 5-dp_height_o 6-lobby_news 7-email_gra 8-wlmngm_tool 9-balloon_gra 2 0 0-Wflby_map 1-Wifi_lobby 2-Pl_btdtr 3-Pl_btdpm 4-Pl_bsdpm 5-Graphic file... 6-Pokelist_particle 7-Wifi_lobby_other 8-Footprint_board 9-Zukan_enc_platinum 1 0-ballslow_data 1-pl_etc_particle 2-pms_aikotoba 3-overworld head-on sprites 4- -5-poffin 6-berry planter graphics -7-pokeathalon 8-poke_icon 9-kowaza 2 0-235 file 600 bytes 1-1022 file 32 bytes 2-107 files 80 bytes 3- 4-Pokeathlon Flag Game 5-19 files 6- 7- 8-old pokemon icons? 9- 3 0- 1- 2- 3- -4-pokeathalon 5- 6- 7-touchscreen confirmation menu graphics 8- 9-unown report graphics 4 0- 1- 2- 3- 4- 5- 6- 7- 8- 9- 5 0-Mailbox graphics 1-Dowsing machine graphics 2- 3- 4- 5- 6- 7- 8- 9-Graphic 6 0-graphic 1-Crosshairs graphic 2-Intro graphics 3-Credits graphics ì
  19. evandixon

    GTS Protocol

    Communication with the GTS is done over regular HTTP with http://gamestats2.gs.nintendowifi.net/. The same protocol is used for all five Gen IV games. HTTP headers The games don't seem to care about these at all. The GTS sends back a bunch of boilerplate response headers, but the game happily accepts a response with only a Content-Length. Protocol All requests to the server are GET requests of the form page.asp?pid=pid followed by page.asp?pid=pid&hash=hash&data=data. The hash variable in the latter, is a hash of the string returned by the former, as described bellow. pid The pid is an unsigned 32-bit integer that appears to uniquely identify a game cartridge. Although this has not been confirmed entirely: Your PID is generated when you get your friendcode for the first time and is set to: friendcode & 0x7fffffff When you change the device and are forced to change your friendcode with it, your PID doesn't change but you get a new friendcode. Your new Friend Code appears to be set by appending a random byte (likely sent from Nintendo's servers) to the end of your PID. For example, nicholas's Soul Silver PID is 258303618 (0x8266650f)and his Friend Code is 4297 5503 3218 (0xf8266650f64) taking endianness into account. Challenge/response Before each "real" request, the game sends a request of the form page.asp?pid=pid and the server responds with a 32-byte challenge token. The game computes sha1("sAdeqWo3voLeC5r16DYv" + token) and uses that as the hash value which it sends to the server. The data parameter is encrypted, as explained further down. For 5th gen GTS, the hash is instead, generated by sha1("HZEdGCzcGGLvguqUEKQN" + token) That is, each request looks like the following: Game requests GET /pokemondpds/page.asp?pid=pid Server responds with token Game requests GET /pokemondpds/page.asp?pid=pid&hash=sha1(...)&data=data Server responds with payload Data The data sent to the server consists of a checksum, your pid, and a payload. The 5th gen GTS also adds the length of the payload, after the pid. In generation 5, the server must append to all its responses a footer generated by sha1("HZEdGCzcGGLvguqUEKQN"+urlsafe_base64(response)+"HZEdGCzcGGLvguqUEKQN"). Checksum The checksum is a 32-bit integer, computed by simply taking the sum of every byte of the pid and payload. It is the first four bytes of the data, xor-ed with 0x4a3b2c1d (0x2db842b2 for 5th gen) and packed in network byte order (big-endian). Payload The pid and payload are encrypted with a stream cipher in for the 4th gen protocol. This encryption algorithm, like others used in the game, uses a Linear Congruential Generator (not a very strong choice). The multiplicative constant is 0x45, and the additive constant is 0x1111. It appears that the game uses a signed dword to store the seed, which doesn't really matter; it shouldn't affect anything. (It means that the modulus is effectively 0x80000000.) GRNG[n+1] = (GRNG[n] * 0x45 + 0x1111) & 0x7fffffff The GRNG is seeded with the checksum, like so: GRNG[0] = checksum | (checksum << 16) The keystream is composed of the lower byte of the high word of successive GRNG values. keystream[n] = (GRNG[n] >> 16) & 0xff Xor the keystream with the plaintext to get the ciphertext. Xor the keystream with the ciphertext to get the plaintext. The entire data string is then encoded with urlsafe-base64. Conversation The first request the game makes is to /pokemondpds/worldexchange/info.asp. The server responds with 0x0001. Platinum, Heart Gold, and Soul Silver will then make a request to /pokemondpds/common/setProfile.asp. The server responds with eight NULs (0x00000000 0x00000000). After the above step(s) or performing any of the tasks below other than searching, the game makes a request to /pokemondpds/worldexchange/result.asp. If the game has had a Pokémon sent to it via a trade, the server responds with the entire encrypted Pokémon save struct. Otherwise, if there is a Pokémon deposited in the GTS, it responds with 0x0004; if not, it responds with 0x0005. Receiving a traded Pokémon If the game receives a Pokémon from a successful trade as a response from result.asp, it next requests /pokemondpds/worldexchange/delete.asp. The server responds with 0x0001. A note on sendpkm.py After doing the above, some Platinum, Heart Gold, and Soul Silver games will report a communication error and dump the player back to the title screen. The Pokémon is still successfully received. At least one person with HG/SS has received a Pokémon from a fake server without getting the error, and Diamond/Pearl have never been reported to have the problem. Depositing a Pokémon Pokémon are offered on the GTS by requesting /pokemondpds/worldexchange/post.asp. If the Pokémon is rejected by the server, the response is 0x000c; otherwise, if the deposit is successful, 0x0001. Note that in generation 5, some tests are performed on a pokémon before it is deposited. If the pokémon is rejected at this stage (a problem was detected or one of the OT name or nickname is inappropriate) it is NOT sent to the GTS and error 13267 is displayed. The game then saves. After the save is complete, it issues a request to /pokemondpds/worldexchange/post_finish.asp. In generation 5, the sent data is 444 bytes long as follows: Offset Contents 0x00-0x03 Checksum (sum of all bytes xor 0x2db842b2) 0x04-0x07 pid 0x08-0x09 Data length (minus the 12 bytes of header) 0x0A-0x0B Unknown / Zero 0x0C-0xE7 Encrypted party pokemon data structure 0xE8-0xF7 Unknown / Zero 0xF8-0xF9 Nat. Dex ID 0xFA Gender 0xFB Level 0xFC-0xFD Requested Nat. Dex ID 0xFE Requested Gender 0xFF Requested Min Level 0x100 Requested Max Level 0x101 Unknown / Always 0 0x102 Trainer gender 0x103 Trainer nature 0x104-0x107 Always 0? 0x108-0x117 Timestamp placeholder, always 0 (set by server) 0x118-0x119 Trainer ID 0x11A-0x11B Secret ID 0x11C-0x12B OT Name (Unicode, must end with 0xFFFF) 0x12C Country 0x12D City 0x12E Trainer class/sprite 0x12F Is Exchanged Flag (Always 0) 0x130 Game version 0x131 Region/language 0x132 Unknown (0 to 8) 0x133 Unlocked floors in Unity Tower 0x134-0x137 Unused 0x138-0x1B7 Signature of pokémon struct 0x1B8-0x1BB Terminator (0x80000000) In generation 4, the sent data is 296 bytes long and as follows: Offset Contents 0x00-0x04 PID 0x04-0xEF Encrypted party pokemon data structure 0xF0-0xF1 Nat. Dex ID 0xF2 Gender 0xF3 Level 0xF4-Fx05 Requested Nat. Dex ID 0xF6 Requested Gender 0xF7 Requested Min Level 0xF8 Requested Max Level 0x09 Always 0 0x0A Trainer's Gender 0xF9-0x109 Zero / Timestamps and PID placeholders 0x110-0x11F Trainer's Name 0x120-0x121 Trainer's OT ID 0x122 Country 0x123 City 0x124 Trainer's Sprite 0x125 Is Exchanged Flag 0x126 Game Version 0x127 Language Retrieving the deposited Pokémon Checking on the deposited Pokémon is apparently done by /pokemondpds/worldexchange/get.asp. The response appears to be a Pokémon save struct. Retrieving the deposited Pokémon is done by /pokemondpds/worldexchange/return.asp. The response is merely 0x0001; the actual Pokémon data is taken from the get.asp request. Searching Searching is done through /pokemondpds/worldexchange/search.asp. The sent data is either 15 or 16 bytes long. The server responds with a full 292-byte Pokémon struct for each result. If there are n results, the response will be 292 * n bytes long. If there are no results, the server will give an empty response (0 bytes). Pokémon struct The Pokémon data for the Generation IV GTS is 292 bytes—56 bytes larger than a party Pokémon struct. The extra 56 bytes are GTS-specific data, such as the player's name & country, and what Pokémon they are requesting. In Generation IV, the trainer name is encoded with the Pokémon character table, while in Generation V, the trainer name is Unicode encoded. They are as follows: Generation IV Encrypted Bytes Offset Contents 0x00-0x01 Nat. Dex ID 0x02 Gender 0x03 Level 0x04-0x05 Requested Nat. Dex ID 0x06 Requested Gender 0x07 Requested Min Level 0x08 Requested Max Level 0x09 Unknown - always 0? 0x0A Trainer's Gender 0x0B Unknown - always 0? 0x0C-0x13 Timestamp - deposited time 0x14-0x1B Timestamp - time traded? 0x1C-0x1F PID 0x20-0x2F Trainer's Name 0x30-0x31 Trainer's OT ID 0x32 Country 0x33 City 0x34 Trainer's Sprite 0x35 Is Exchanged Flag 0x36 Game Version 0x37 Language The data for the Generation V GTS is 296 bytes (16 bytes of padding in between the encrypted party data and the GTS data) and adds the trainer's secret ID, an additional two unknown bytes at the end, and shifts the position of the trainer name to after the trainer and secret IDs. Generation V Encrypted Bytes Offset Contents 0x00-0x01 Nat. Dex ID 0x02 Gender 0x03 Level 0x04-0x05 Requested Nat. Dex ID 0x06 Requested Gender 0x07 Requested Min Level 0x08 Requested Max Level 0x09 Unknown - always 0? 0x0A Trainer's Gender 0x0B Unknown - always 0? 0x0C-0x13 Timestamp - deposited time 0x14-0x1B Timestamp - time traded? 0x1C-0x1F PID 0x20-0x21 Trainer's OT ID 0x22-0x23 Trainer's Secret ID 0x24-0x33 Trainer's Name 0x34 Country 0x35 City 0x36 Trainer's Sprite 0x37 Is Exchanged Flag 0x38 Game Version 0x39 Language 0x3A-0x3B Unknown Pokémon Gender Value Type 0x01 Male 0x02 Female 0x03 Either/neither Trainer Gender Value Type 0x00 Male 0x01 Female Timestamp Format The timestamps are set by the server, and are always PST (UTC-8). Offset Contents 0x00-0x01 Year 0x02 Month 0x03 Day 0x04 Hour 0x05 Minute 0x06 Second 0x07 Unknown - always 0? Trainer Class (for generation 5) Value Class 0x00 Youngster 0x01 Ace Trainer 0x02 Pokémon Ranger 0x03 Pokémon Breeder 0x04 Researcher 0x05 Hiker 0x06 Skinhead 0x07 Day-Care student 0x08 Lass 0x09 Ace Trainer (female) 0x0a Pokémon Ranger (female) 0x0b Pokémon Breeder (female) 0x0c Researcher (female) 0x0d Parasol Lady 0x0e Nurse 0x0f Day-Care student (female) Game Version Value Version 0x0A Diamond 0x0B Pearl 0x0C Platinum 0x07 HeartGold 0x08 SoulSilver 0x15 Black 0x14 White
  20. evandixon

    Event Structure

    Event Structure We consider events all the Overwords, Warps and Signpost into a map. Events are located in fielddata/eventdata/zone_event_release.narc(zone_event.narc in Platinum) Each event file is divided into three parts. Overwords Overwords are showed in a sequence of 32 bytes. 1.1-2nd bytes rapresented the number linked with overworld 2.3-4th rapresented the sprite of the Ov. 3.5-6th rapresented the movement of the Ov. 4.9-10th rapresented the flag of the Ov. 5.11-12th rapresented the script of the 0v. 6.25th x coordinates of the Ov into map 7.27th y coordinates of the 0v into map
  21. evandixon

    HGSS: Event Overworlds

    About this Document This document provides a list of Overworld Sprites for events within the ROM. The list will become outdated once a general trend occurs and can be mapped out completely. HGSS Overworlds Decimal Sprite Name Ex. Map used in HGSS Overworld NARC file * Little Boy 113 101 M/F counterpart T20 146 School Kid (M) T02R0301 2? 319 Lass T02R0201 117 324 Ace Trainer (M) T02R0301 122 327 Ace Trainer (F) T02R0301 125 328 Man T02R0201 126 341 Gentleman T02R0301 137 427 Receptionist T02R0301 993 Arceus (alt forme) * Bulbasaur 280 994 Butterfree 292 995 Pidgey 296 996 Rattata T02R0201 299 997 Spearow T02R0201 301 998 Fearow 1025 Zapdos 1029 Mewtwo 1030 Bayleef 1032 Marrill T20 1040 Latios T03 1041 Latias T03 *Used to start HGSS sprite reference within overworld NARC.
  22. evandixon

    DPP Script Commands

    This page will contain the script commands for DPP. Movement commands used in the scripts will also be listed. Please include an example of which script file the command is used in so we can double check DPP Script Commands Hex Value (decimal) Parameters Descriptions Example map Number 0000 No operation 0001 No operation 0002 Finish script 0003 XXXX YYYY Stop script for XXXX millisecond 0011 XXXX YYYY Compare variable XXXX to YYYY 0012 XXXX YYYY Compare variable XXXX to YYYY 0014 XX YY Calls standard function number YY, see DPP Scripting: Standard Functions for values of YY 0015 Exit from standard function 0016 XXXXXXXX Jump at offset XXXXXXXXX (relative to actual position in script file). 001A XXXXXXXX Call routine at offset XXXXXXXX (relative), pushing the calling command position. 001B Kill Script, pop back to calling command 001C XX YYYYYYYY Compare last result to XX if true goto + YYYYYYYY (relative) 001D XX YYYYYYYY Compare Last Result to XX, if true go + YYYYYYYY (relative), pushing the callind command position 001E XXXX Set Flag XXXX. 001F XXXX Clear Flag XXXX. 0020 XXXX Store Flag XXXX status as last result 0022 XXXX 0023 XXXX Disable trainer with XXXX Id, so you cannot rebattle. 0024 XXXX Active trainer with XXXX Id. 0025 XXXX Store trainer XXXX status as last result. 0026 XXXX YYYY Add YYYY to XXXX variable (storing result on XXXX) 0027 XXXX YYYY Substract YYYY to XXXX variable (storing result on XXXX) 0028 XXXX YYYY Set value of variable XXXX to YYYY 0029 XXXX yyyy Set value of variable XXXX to YYYY 002B XX Show Message Box with string XX (corresponding to text id in text file associated with script) 002C XX Show Message Box with string XX (corresponding to text id in text file associated with script) 002D XXXX Show Message Box with string XXXX (corresponding to text id in text file associated with script) 002E XXXX Show Message Box with string XXXX (corresponding to text id in text file associated with script) 002F XX Show Message Box with string XX (corresponding to text id in text file associated with script) 0030 0031 Wait For Button Press (arrows, A, B, X, Y) 0033 Wait for Button Press (A, B) 0034 Close Message after Button Press 0035 Freeze Message Box 0036 XXXX YYYY ZZZZ Call Message Box with text XXXX, type YYYY. Saving calling result on ZZZZ. 0037 XX YYYY Set color XX of Message Box 00 Brown 01 Green 02 03 Grey 04 Blacked Out 0038 XX Set type of Message Box 02 No border 03 With Border 0039 No Map in Message Box 003A XX YYYY Call Message Box with text ID XX. Saving calling result on YYYY 003B XXXX 003C Open Menu 003E XXXX Show Yes/No Box. Saving choice on XXXX 003F XXXX Wait for XXXX, then continue. 0040 XX YY ZZ WW TTTT Show a list of choices for the player to make, saving choice on TTTT.(XX = X Screen Coordinates, YY = Y Screen Coordinates; ZZ = Cursor position; WW = Determine if B=Cancel) 0041 XX YY ZZ WW TTTT Show a list of choices for the player to make, saving choice on TTTT.(XX = X Screen Coordinates, YY = Y Screen Coordinates; ZZ = Cursor position; WW = Determine if B=Cancel) 0042 XXXX YYYY Set choice entry after previous commands (One for each choice), with Text Id XXXX, and Choice Id YYYY. 0044 XX YY ZZ WW TTTT Show a list of choices for the player to make, saving choice on TTTT.(XX = X Screen Coordinates, YY = Y Screen Coordinates; ZZ = Cursor position; WW = Determine if B=Cancel) 0045 XX YY ZZ WW TTTT Show a list of choices for the player to make, saving choice on TTTT.(XX = X Screen Coordinates, YY = Y Screen Coordinates; ZZ = Cursor position; WW = Determine if B=Cancel) 0046 XXXX YYYY ZZZZ Similar to 0x42, set choice entry after previous commands (One for each choice), with Text Id XXXX, Message Box Id YYYY, and Choice Id ZZZZ. 0047 Close generally previous Multi Box 0048 XX Set the number of row XX used in Multi Box 0049 XXXX Play a sound XXXX as fanfare 004A XXXX Play a sound XXXX as fanfare 004B XXXX Wait sound XXXX finish 004C XXXX YYYY Plays Pokemon Cry(XXXX = Number Pokemon) 004D Wait Pokemon Cry 004E XXXX Play music XXXX 004F Return to default music map 0050 XXXX Play music XXXX 0051 XXXX Stop music XXXX 0052 Restart music 0054 XXXX YYYY Change music volume (XXXX = Decibel?) 0055 XXXX Set previous music volume (XXXX = Volume) 0057 XXXX Play music XXXX 0059 XXXX Check if you have registered something previously with microphone. Storing result on XXXX 005A XXXX Check if you talk on microphone. Storing result on XXXX 005B Enable microphone 005C Disable microphone 005D 005E XXXX YYYYYYYY Move NPC XXXX acording to movement at YYYYYYY(relative). 255 YYYYYYYY Hero 005F Wait NPC moving. 0060 Lock all NPC into map 0061 Release all NPC into map 0062 XXXX Lock NPC XXXX 0063 XXXX Release NPC XXXX 0064 XXXX Add NPC XXXX (You can add only NPC already defined in event file) 0065 XXXX Remove NPC XXXX (Same note as above) 0066 XXXX YYYY Move camera in (XXXX,YYYY) coordinates. 0067 Zoom camera 0068 Force NPC to facing player 0069 XXXX YYYY Get position of hiro and storing X on XXXX and Y on YYYY 006A XXXX YYYY ZZZZ Get position of NPC XXXX and storing on YYYY-ZZZZ 006C XXXX YY Allow NPC XXXX to follow hero when you change the map. 006D XXXX YYYY Set NPC XXXX orientation during follow? 006F XXXX YYYY Give XXXX amount of money to player. Storing result on YYYY Givemoney 0070 XXXX YYYY Take XXXX amount of money from player. Storing result on YYYY 124 0071 XXXX YYYY ZZZZ Check if possible to take YYYY amount of money. Storing result on XXXX 0072 XXXX YYYY Show money box with XXXX and YYYY coordinates 0073 Hide money box 0074 Update money box 0075 XXXX YYYY Show coins box with XXXX and YYYY coordinates 0076 Hide coins box 0077 Update coins box 0078 XXXX YYYY ZZZZ Check if is possible to give XXXX coins with YYYY quantity and store into ZZZZ. 0079 XXXX Give XXXX amount of coins to player 007A XXXX Take XXXX amount of coins to player 007B XXXX YYYY ZZZZ Give YYYY quantity of XXXX item. Storing result on ZZZZ 007C XXXX YYYY ZZZZ Take YYYY quantity of XXXX item. Storing result on ZZZZ 007D XXXX YYYY ZZZZ Check if possible to give item XXXX, YYYY of them. Storing result on ZZZZ 007E XXXX YYYY ZZZZ Check if you have item number YYYY of item XXXX. Storing result on ZZZZ 007F XXXX YYYY Get item XXXX amount. Storing on YYYY 0080 XXXX YYYY Get item XXXX bag location. Storing on YYYY. 0083 XXXX YYYY ZZZZ Give underground Item XXXX, YYYY number. Storing result on ZZZZ. S=211 0085 XXXX YYYY ZZZZ Check if you have number YYYY of item XXXX into Underground Pc. Storing result on ZZZZ 0087 XXXX YYYY ZZZZ Give underground Item XXXX, YYYY number. Storing result on ZZZZ. S=211 0083 XXXX YYYY ZZZZ Give underground Gem XXXX, YYYY number. Storing result on ZZZZ. S=211 0093 XXXX YYYY Store Seal XXXX number in YYYY. 0094 XXXX YYYY Give number YYYY of seal XXXX. 0095 XXXX YYYY Get Pokèmon XXXX form. Storing result on YYYY. 0096 XXXX YYYY ZZZZ WWWW Give Pokemon XXXX at YYYY level with ZZZZ item. Storing result on WWWW. 0097 XXXX YYYY Give Egg of Pokèmon XXXX at level YYYY. 0099 XXXX YYYY ZZZZ Check if party pokemon ZZZZ knows move YYYY. Storing result on XXXX. 009A XXXX YYYY Check if party Pokèmon knowns move YYYY. Storing Id on XXXX. 00A1 Used at end of call screen commands 00A3 Start Nintendo Wi-fi connection 00A5 Start Interview 00A6 XXXX YYYY ZZZZ Start wearing Pokemon XXXX. Storing result on YYYY. (ZZZZ can be 0 or 1, Need to Investigate) 00A7 XXXX YYYY Display YYYY dressed Pokemon in XXXX picture 00A8 XXXX YYYY Display YYYY contest winner Pokemon in XXXX picture 00A9 Open Capsule Editor 00AA Open Sinnoh Maps 00AB XX Show Box Storage Pokemon (XX Function Box) 00 Deposite Pokemon 01 Withdraw Pokemon 02 Move Pokemon 03 Move Item 04 Compare Pokemon 00AC Open Draw function into Union Room 00AD Show Trainer Case into Union Room 00AE Trade into Union Room 00AF Exchange Records into Union Room 00B0 Game Ending 00B1 Hall of fame memorial 00B2 XXXX YYYY 00B3 XXXX Start Nintendo Wi-fi Connection 00B4 Choose starter pokemon 00B5 Start starter battle 00B6 XXXX Get Battle Id? Storing result on XXXX. 00B7 XXXX 80YY 00B8 80XX 00B9 XXXX 80YY 00BA XXXX 80YY Choose player name ChoosePlayerName 00BB XXXX 80YY Choose pokemon nickname ChoosePokmnName 00BC XXXX YYYY ZZZZ WWWW Fadescreen Fadescreen 00BD Resetscreen 50,72 Resetscreen 00BE II II 00 00 XX xx YY yy PP PP Warp to a map(XX: X Coordinates into map. xx=X Coordinates in word map, same for YY.PP=People sprite position) in PPRE 006 0xM 0x0 0xX 0xY 0xZ: M=Map 0=not yet known X=X coordinates Y=Y coordinates Z=Z coordinates 1035 Warp 00BF XXXX Use Rock Climb RockClimbAnimation 00C0 XXXX Use Surf SurfAnimation 00C1 XXXX Use Waterfall WaterfallAnimation 00C2 XXXX Use Fly FlyAnimation 00C4 S=409 00C5 80XX Arrange 80XX for 029E animation 375 00C6 Change to tuxedo 00C7 80XX Check if hero is onto bike and store in 80XX 00C8 XX Set hero XX bike(00=on,01=off) 205 00C9 XX 00CB XXXX 00CD XX Set Text Var XX = Hero 342 00CE XX Set Text Var XX = Rival 342 00CF XX Set Text Var XX = Male\Female alter ego. 342 00D0 XX 80YY Set text var XX to name of pokemon number 80YY 458 00D1 XX 80YY Get the name for item number = value of variable 80YY and store it in text variable XX 72 00D2 XX 80YY S=408 00D3 XX 80YY Get attack corresponding to item number = value of variable 80YY store in text variable XX 72 00D4 XX 0000 Set text var XX to an attack 00D5 XX 0000 Set text var XX to a number 00D6 XX YYYY Set text var XX to a pokemon nickname in team 00D7 XX YYYY Set text var XX to an object? 00D8 XX YYYY Set text var XX to a type of trainer 00D9 XX 00DA XX 40YY ZZZZ WWWW 00DB XX Set text var AA to Starter Hiro 00DC XX Set text var XX to Starter Rival 00DD XX Set text var XX to Starter Alter ego. 00DE 80XX Store Pokemon Starter into 80XX 00DF XX 80YY 00E0 XX 80YY S=211 00E1 XX 80YY S=211 00E2 XX 40YY 00E3 40XX 40YY 00E4 80XX 00E5 XXXX YYYY Start Battle XXXX 50,72 00E6 80XX 80YY End Trainer Battle 80XX 50,72 00E7 80XX 80YY 80ZZ 00E8 80XX 80YY 80ZZ 00E9 80XX 00EA 80XX 00EB Lost battle go to pokemon center. 50,72 00EC 80XX Check if lost battle, store result in variable 80XX 50,72 00ED 80XX 00EE 80XX S=236,400 00EF Repeat Last Battle? 00F2 XXXX 80YY 80ZZ 80WW Open Choose Friend for Wireless Trade screen 00F3 Open Wireless Battle Waiting 00F6 S=213 00F7 Start Pokemon Contest 00F8 XXXX S=212 00F9 XXXX S=212 00FA 80XX 80YY 80ZZ 40WW 00FB 40XX 00FD 80XX YYYY S=212 00FE 80XX YYYY 00FF 80XX YYYY 0102 XX YY 0103 XX YY 0104 XXXX S=212 0106 XXXX S=212 0107 80XX 0108 80XX S=212 0109 80XX 010A XXXX 40YY S=212 010B XXXX 80YY S=212 010C 40XX S=212 010E S=212 0110 80XX 80YY 80ZZ 40WW S=212 0111 XXXX Some Flash into the scene S=212 0112 Stop 0111 command S=212 0113 Fade screen as a curtain S=212 0114 40XX 40YY S=212 0115 80XX 80YY S=212 0116 Show Link Contest Record Box 0117 S=212 0119 80XX S=211 011B XXXX YYYY Set Warp for a Elevator(XXXX=map YYYY=coordinates 011C 40XX Check Floor in a Elevator and Store into 40XX 011E 80XX 0121 80XX S=411 0123 XXXX 80YY S=411 0124 XXXX YYYY ZZZZ Start Wild Battle (XXXX=Pokemon Numeber YYYY=Level ZZZZ=Item) 0125 XXXX YYYY ZZZZ WWWW Starter Battle 0126 First Wild Battle Explanation 0127 XXXX YYYY ZZZZ Honey Tree Battle 0128 80XX S=211 0129 Random Wurmple Battle(Change Level) 012A S=211 012B Show Write Autograph Scene 012C 80XX S=211 012D 80XX YYYY Save Game Data S=205,211,362,372,378,379 012E XXXX 80YY Check if is stored a dressed pokemon picture? 0130 80XX 0131 Give Poketch First time 0132 80XX Check if Poketch is activated and stored into 80XX 0133 XXXX Give Poketch Application XXXX 0134 XXXX 80YY Store Poketch Application XXXX to 80YY 0135 XXXX S=362,372,379 0136 S=362,372,379 0138 80XX 0139 XXXX 013B XXXX 013C XXXX 013F XXXX 80YY 0140 80XX 0141 80XX 0142 XXXX 0146 80XX 80YY 0147 XXXX Show Pokemart with XXXX items 0148 XXXX Show Pokemart 2 with XXXX items 0149 XXXX Show Pokemart 3 with XXXX items 014A AAAA Show Pokemart 4 with AAAA items 014B Player defeated go to Pc 014C XXXX 014D 80XX 014E Player Pokemon are healed 0150 S=213,379,426 0151 S=213,399 0152 XXXX 0153 Player go to Union Room 0155 80XX 80YY 0156 80XX 015B AA 80BB Check if obtained badge AA and store result in variable 0x80BB 50, 72, 411 015C AA Set obtained badge AA to true 50, 72 015D AA Set badge AA to false 0160 80XX S=409 0161 S=427 0162 S=351,427 0164 S=427 0166 40XX S=285,456 0168 XXXX YYYY ZZZZ WWWW 4D 016A 4D 016B 4D 016C 4D 0173 Change solidity of object? 0175 XXXX YYYY ZZZZ 0176 XXXX YYYY 0177 80XX Check Pokemon Party quantity and store into 80XX 0178 Open Berry Pouch 0179 80XX S=413 017A XXXX 80YY S=413 017B XXXX YYYY ZZZZ S=413 017C XX 80YY 017D 80XX S=413 017E 80XX S=413 017F 80XX S=413 0181 80XX S=413 0182 80XX S=413 0183 80XX S=413 0184 XXXX S=413 0185 S=413 0186 XXXX YYYY 80ZZ Move Owerword XXXX, on YYYY-ZZZZ coordinates into map ChangeOwPosition 0188 XXXX YYYY Change Overword XXXX default movement to YYYY movement. 0189 XXXX YYYY Reset attributes for Overworld XXXX 018A XXXX YYYY ZZZZ 018B XXXX YYYY ZZZZ 018C XXXX YYYY S=236 018D Show little clock while save game S=205 018E Hide little clock while save game S=205 018F 80XX S=211 0190 XXXX S=367 0191 Choose Pokemon Menu, store number as last result 458 0192 Choose Pokemon for Battle Tower (everyone banned) 0193 80XX Store Last Result in 80XX, 80XX=00FF means no pokemon was chosen 458 0194 80XX 80YY 80ZZ WWWW Choose Pokemon everyone able 0195 40XX 80YY 0196 80XX Open Pokemon Info 0197 80XX 0198 80XX 80YY Store the pokemon number of party pokemon 80XX, in 80YY If the pokemon is an egg the value is 0000. 458 0199 80XX 80YY 019A 80XX 019B 80XX YYYY S=211,417 019D 80XX 019E XXXX 80YY 019F XXXX 01A3 80XX S=148,277,448 01AB 80XX YYYY S=148 01AC Egg animation 205 01B1 XXXX S=213,370 01B2 XXXX S=213,370 01B3 Open Mailbox 01B4 80XX S=211 01B5 XXXX Open Record List AA 01B6 80XX Check time and stored into 80XX 01B7 80XX YYYY 01B8 80XX YYYY S=417 01B9 80XX 80YY Store happiness of pokemon 80YY into 80XX 458 01BA XXXX 40YY 01BD 80XX 01BF 40XX 01C0 80XX 01C1 80XX 80YY 01C2 80XX 01C3 XXXX YYYY 80ZZ 01C4 XXXX YYYY 01C5 XXXX YYYY 01C6 XXXX Open Battle Moves of Pokemon AA in the party 01C7 80XX Store data move in AA80 01C8 80XX 80YY S=83,458 01C9 XXXX YYYY Delete move chosen in 01C6 01CA 80XX 80YY 80ZZ S=83,458 01CB XXXX YYYY ZZZZ 01CD XXXX 80YY ZZZZ WWWW QQQQ S=409 01CF Variable S=409 01D0 XXXX S=409 01D1 XXXX S=409 01D2 80XX 80YY S=211 01D3 80XX 80YY 80ZZ S=274,479 01D5 80XX S=211 01D6 80XX 80YY S=479 01D7 Open Berry Pouch for Poffin S=426 01D8 80XX S=426 01D9 80XX 80YY Open Battle Room Result 01DA S=367 01DB XXXX YYYY S=367 01DC S=371,372 01DD XXXX 40YY ZZZZ S=371,372,373 01DE 40XX YYYY 80ZZ 80WW S=373 01DF 40XX 01E0 40XX 01E1 XXXX YYYY 80ZZ S=367,372 01E2 XXXX 40YY S=367,372 01E3 XXXX 01E4 80XX S=367 01E5 XXXX S=379 01E8 80XX Check if have completed Sinnoh pokedex and store into 80XX 01E9 80XX Check if have completed National pokedex and store into 80XX 01EA XXXX Show Sinnoh Pokedex Sheet 01EB XXXX Show National Pokedex Sheet 01EC S=456 01ED 80XX S=456 01F1 80XX 01F4 40XX 80YY 01F5 80XX 80YY ZZZZ 01F6 80XX YYYY 01F7 80XX 80YY S=211 01F8 S=368,379,423 01F9 80XX S=211,236,423 01FB 80XX 80YY S=408 01FE XX S=372 01FF XXXX YYYY ZZZZ S=379 0200 40XX 0201 40XX S=211,400,409,423 0202 XXXX S=497 0203 XXXX YYYY 80ZZ QQQQ PPPP S=213 0204 Warp to last elevator 0205 Open Geonet 0206 Great Marsh Bynocule Pokemon 0207 40XX S=213,370,372 0208 XXXX YYYY Show box with Pokemon XXXX sprite 0209 Hide box showed with 0208 020A 80XX S=498 020C S=211 020D XXXX 80YY S=237 020E S=497 020F 80XX YYYY S=497 0210 XXXX 80YY S=497 0211 XX S=497 0212 80XX 80YY 0213 80XX YYYY 0214 80XX 0215 S=274 0216 80XX S=274 0217 40XX 40YY S=274 0218 80XX 021A 80XX 021C XXXX S=282 021D Variable S=406 021F 80XX 80YY 0221 XXXX Remember Move for Pokemon XXXX in the party 0223 80XX 0224 80XX 80YY Teach Pokemon 80XX move 80YY 458 0225 80XX Store check whether 0224 resulted in teaching the new move, if not let 80XX = 00FF 458 0226 XXXX 0228 80XX Check Pokemon for trade and store into 80XX 0229 80XX Trade Pokemon stored into 80XX 022A Stop trade? 458 022C S=476 022D XXXX 80YY 022D 0x1 0x800c gives National Dex. Stores that info in 800c (a commonly used variable that varies from map to map and use to use) 0x2 0x4000 checks to see if the National Dex is acquired. M=422, M=220 022F 80XX 022F 0x8004 stores the amount of Ribbons on current Pokemon party in 0x8004. M=461 0230 80XX 80YY ZZZZ S=461 0231 80XX XXXX S=461 0232 XXXX YYYY 0233 80XX 80YY 0234 40XX S=216,400 0235 Variable 0236 80XX S=408 0237 XXXX 80YY 80ZZ 80WW 0238 XXXX 40YY 0239 XXXX Rules decide in Battle Link 023A 80XX 80YY 80ZZ S=461 023B XXXX Do healing animation in Pokecenter(XXXX=Number of Pokeball) 023C 80XX YYYY 023D XXXX YYYY ZZZZ WWWW Do a XXXX animation for a ship(00=Ship sail under 01=Ship sail up 02=Ship sail left 03=Canalave ship) 023E Variable S=408 0243 XXXX 80YY 80ZZ Show Phrase Box(1 Word) 0244 XXXX 80YY 80ZZ Show Phrase Box(2 Word) 0245 XXXX 80YY 0246 80XX S=236 0247 80XX 0248 80XX 80YY 40ZZ S=450 0249 80XX 80YY 80ZZ 80WW 80PP 024A 80XX 024B Prepare Pc in Pokemon Center for animation 205 024C Do Pc Animation in Pokemon Center(When opening) 205 024D Do Pc Animation in Pokemon Center(When closing) 205 024E 80XX Check Loto ticket number and stored into 80XX 11 024F 80XX 80YY 80ZZ 80WW Compare 80WW loto number with 80XX 80YY 80ZZ. 11 0250 XX YYYY 0251 XX 80YY 0252 80XX 0253 XXXX S=273 0254 80XX S=479 0255 S=479 0256 XXXX 80YY S=479 0257 Exchange Berries for Accessories 999 0258 Change Sprite Position while save game 205 0259 Return to Original Overword Sprite after 0258 command 205 025A 80XX 025B S=330 025C S=330 025D 40XX S=195 025E S=347 0260 XXXX S=211,419 0261 XX YYYY 0263 XXXX 0264 80XX 0267 Start Pokecasino 0268 40XX S=456 0269 XXXX YYYY S=317 026A XXXX YYYY ZZZZ S=282 026B 80XX 026C 80XX 026D XXXX Open Unown Text Box 026E 80XX S=479 0270 XXXX YYYY S=198,281,362,389,485 0271 80XX Open Thank Who? Name Insert S=485 0272 XXXX S=485 0273 XXXX 80YY S=211 0275 80XX 0276 80XX YYYY ZZZZ 0277 80XX S=480 0278 80XX 80YY S=480 027A Show View of League Castle 027C XXXX 80YY S=274 027D 80XX 027E 80XX 027F 80XX 0280 XXXX 80YY ZZZZ WWWW 0281 80XX YYYY 80ZZ 0282 80XX 0283 XXXX 0284 80XX S=321,466,467 0285 XXXX YYYY S=308,309 0286 80XX 0287 80XX 0288 80XX 0289 80XX 80YY 80ZZ 80WW 80PP 80QQ 80TT S=148 028A 80XX 028B XX 40YY Checks for Mystery Gift trade. (Directly related to Nintendo Wi-Fi events.) S=83,310,363 028C XXXX Show XXXX Party Sprite Pokemon in Box 028F 80XX 0292 XXXX 40YY S=339 0293 80XX 0294 XX YY Show Battle Points Box 0295 Hide Battle Points Box 0296 S=499 0299 XXXX S=499 029A XXXX 80YY 029C 80XX 80YY 029D XXXX YYYY 029E XXXX 80YY Apply effect XXXX 00 Cut effect 01 Rock Smash effect 029F XXXX Camera Bump Effect 02A0 80XX YYYY ZZZZ Start Double Battle 02A1 AA BBBB Move AA person with BBBB Movement 02A2 80XX S=404 02A3 80XX S=423 02A4 80XX S=423 02A5 Choose a Pokemon for a Trade 02A6 80XX 80YY 80ZZ 02A7 80XX 80YY S=404,408 02A8 80XX YYYY 02A9 80XX 80YY 02AA 80XX 80YY 80ZZ 80WW 80QQ 02AB 80XX S=211 02AD 80XX 80YY 02B1 S=212 02B3 XXXX 80YY 02B5 XXXX YYYY ZZZZ 02B6 XXXX YYYY S=329 02B7 80XX 02B8 80XX 02BA 80XX 02BB S=212 02BC 80XX 02BD XXXX YYYY ZZZZ Start Wild Battle with XXXXPKMN, at YYYY Level and ZZZZ object 02BE 80XX S=211 02BF Mount Hiro on the Bike 02C0 80XX or XXXX 02C1 Show Save Box 02C2 Hide Save Box 205 02C4 XX S=368,377,379 02C5 40XX 40YY S=376 02C7 80XX 02C8 80XX 80YY 80ZZ 02CA(Platinum) Floral clock animation 02CB 80XX YYYY S=83 02CC XXXX 80YY 80ZZ S=377 02CF 40XX 80YY S=377 02D0 40XX 40YY 02D1 40XX S=377 02D2 XXXX 40YY 80ZZ S=378 02D3 80XX 80YY 80ZZ S=378 02D4 40XX 40YY 40ZZ S=378 02D5 40XX 02D6 S=211 02D7 80XX S=211 XX S=365 02D9 XXXX 40YY 80ZZ S=379 02DA 80XX 80YY 80ZZ S=379 02DB 40XX 40YY 40ZZ S=379 02DC 40XX S=379 02DD 80XX YYYY S=83 02DE 80XX 80YY 80ZZ 80WW 80QQ 02DF 40XX S=274 02E0 40XX 80YY S=274 02E1 40XX 80YY S=274 02E2 Dysplay Card Game Scratch S=499 02E3 Close Card Game Scratch S=499 02E4 XXXX 40YY 40ZZ Choose Cards in Card Game S=499 02E5 80XX YYYY 80ZZ S=458 02E6 80XX YYYY 80ZZ S=458 02E7 80XX 80YY S=83,458 02E8 80XX S=83,458 02E9 80XX 80YY 80ZZ S=458 02EA 80XX 80YY S=458 02EB 80XX S=458 02EC XXXX 80YY 80ZZ S=211 02ED S=211 02EE 80XX 80YY 80ZZ 80WW S=367 02F2 S=388,389,390 02F3 XXXX 80YY S=454 02F4 40XX 40YY 40ZZ 40WW 02F5 XXXX YYYY ZZZZ WWWW S=1112 02F6 80XX 80YY 80ZZ S=211 02F7 80XX S=410 02F9 80XX S=1112 02FA 80XX 02FC 80XX S=1112 02FD XX 80XX 02FE XXXX 80XX S=221 02FF 80XX 80YY 0302 40XX 40YY 40ZZ 40WW 40PP S=83 0303 80XX 80YY S=83 0304 80XX 80YY 80ZZ 80WW S=83 0305 80XX 80YY S=83 0306 80XX 80YY S=500 0307 80XX S=148 0309 S=428 030A XXXX S=379 030B S=211,428 030D 80XX S=1112 030E 80XX S=28 030F XXXX 80YY S=1112 0311 XXXX S=380,381,383,389 0312 XXXX S=380,381,383,387,388,389 0313 XXXX S=377,379 0314 80XX S=389 0315 80XX S=459 0317 80XX 80YY 80ZZ S=382 0318 XXXX YYYY Starts a simpler wild Battle than Wildbattle2. XXXX = Pokemon, YYYY = Level. S=310;M=267 0319 XXXX YYYY S=389 031A XXXX S=236 031B 40XX S=129 031C 80XX S=1068 031D 80XX S=213,423 031E 40XX 80YY S=377,379 031F S=389 0320 S=237 0321 XXXX S=380 0322 S=380 0323 80XX S=423 0324 XXXX YYYY 40ZZ 80WW S=377 0325 40XX or 80XX S=377 0326 40XX S=377 0327 XXXX S=377 0328 XXXX S=380 0329 40XX 40YY 40ZZ 40WW S=374 032A 40XX S=377 032B 80XX Checks whether an Event Regigigas is in the party and stores it in 80XX (0 or 1) M=592 032C 40XX YYYY 80ZZ 80WW S=392,396 032D S=201,274 032E S=201,274 032F XXXX 40YY S=231 0332 S=428 0333 XXXX S=485 0334 S=148,440,448 0335 XXXX YYYY ZZZZ S=1109 0336 80XX S=211 0337 S=456 0338 S=274 0339 S=274 033A XX S=423,426 033C XX 80YY S=404,408,441 033D XX 80YY S=211,274,499 033E XX 80YY S=211 0341 XX 80YY ZZZZ WW S=373 0342 XX S=1064 0343 XX 80YY Set var as Pokemon stored into 80YY S=12 0344 XX 80YY Copy var as Wi-fi Sprite stored from 80YY to XX 53 Copyvarwi-fisprite 0345 XX 80YY Copy var as Seal store from 80YY to XX S=1085;M= SetvarSealStored2 0346 XX Set var as Wi-fi Sprite Id(XX) S=413,441;M=No Setvarwi-fisprite 0347 XXXX In a elevator, display into box XXXX Floor S=18;M=18 DysplayFloor DPP Movements Commands[edit] Hex Value (decimal) Parameters 0000 See up 0001 See down 0002 See left 0003 See right 0004 Walk slowly up 0005 Walk slowly down 0006 Walk slowly left 0007 Walk slowly right 0008 Walk normal up 0009 Walk normal down 000A Walk normal left 000B Walk normal right 000C Walk fast up 000D Walk fast down 000E Walk fast left 000F Walk fast right 0010 Walk very fast up 0011 Walk very fast down 0012 Walk very fast left 0013 Walk very fast right 0014 Run up 0015 Run down 0016 Run left 0017 Run right 0018 Move up slowly on site 0019 Move down slowly on site 001A Move left slownly on site 001B Move right slowly on site 001C Move up normal on site 001D Move down normal on site 001E Move left normal on site 001F Move right normal on site 0020 Move up fast on site 0021 Move down fast on site 0022 Move left fast on site 0023 Move right fast on site 0024 Move up very fast on site 0025 Move down very fast on site 0026 Move left very fast on site 0027 Move right very fast on site 0028 Run up on site 0029 Run down on site 002A Run left on site 002B Run right on site 002C Jump up slowly on site 002D Jump down slowly on site 002E Jump left slowly on site 002F Jump right slowly on site 0030 Jump up normal on site 0031 Jump down normal on site 0032 Jump left normal on site 0033 Jump right normal on site 0034 Jump up one step 0035 Jump down one step 0036 Jump left one step 0037 Jump right one step 0038 Jump up two step 0039 Jump down two step 003A Jump left two step 003B Jump right two step 003C Nothing 003D Nothing 003E Nothing 003F Nothing 0045 Wait, then disappear 004B Display exclamation mark 004C Wait for a little, then walk slowly up 004D Wait for a little,then walk slowly down 004E Wait for a little, then walk slowly left 004F Wait for a little, then walk slowly right 0050 Wait for a little,then walk normal up 0051 Wait for a little,then walk normal down 0052 Wait for a little,then walk normal left 0053 Wait for a little,then walk normal right 0054 Wait for a little,then move Overword sprite up 0055 Wait for a little,then move Overword sprite down 0056 Wait for a little,then move Overword sprite left 0057 Wait for a little,then move Overword sprite right 0058 Wait for a little,then walk backward up 0059 Wait for a little,then walk backward down 005A Wait for a little,then walk backward left 005B Wait for a little,then walk backward right 005C Wait for a little,then jump left one step 005D Wait for a little,then jump right one step 005E Wait for a little,then jump left two step 005F Wait for a little,then jump right two step 0060 Wait for a little,then walk normal up 0061 Wait for a little,then walk normal down 0062 Wait for a little,then walk normal left 0063 Wait for a little,then walk normal right 0064 Wait for a little,then move on site 0065 Wait for a little,then jump on site 0066 Nothing 0067 Wait for a little,then show two exclamation mark 0068 Wait for a little,then move on site forever 0069-to 00FF Rom crashed Platinum Known Flags Flag Descriptions Example PPRE map Number 01 Flag will active if you don't go outside after a certain script 02 Flag will active when 414 6E Flag will active when Rival go out from his home 412 70 Flag will active when you choose Wi-fi Sprite 48 75 Flag will active when you received 193 item 47 76 Flag will active when you received the Tm Recycle 79 7A Flag will active when you talked with Gym Leader into Mine 7B Flag will active when you use Defog 361 7C Flag will active when you received the EE item 52 7E Flag will active when you received the 27 81 Flag will active when you beat Team Galactic in Eterna City 61 82 Flag will active when you received the Bicy 71 84 Flag will active when you received Super Rod 389 85 Flag will active after trade 54 86 Flag will active after trade 76 87 Flag will active when you go down first 414 8A Flag will active when the Leader was into Coal Mine 45 8C Flag will active when you received the FD item 104 8D Flag will active when you go into Pokemon Fan Club 106 8E Flag will active when you start a Legendary Battle 510,316 8F Flag will active when you received the Parcel 414 90 Flag will active when you received the Pokedex 422 92 Flag will active when you receive 1A2 object 35 97 Flag will active when you beat Galactic on Veilstone 147 A1 Flag will active when you received F7 item 361 A2 Flag will active when you received 356 AB Flag will active when you complete Sinnoh Pokedex 339 AC Flag will active when you complete National Pokedex 339 AD Flag will active when you beated Grunt 499 B5 Flag will active when you received Porygon 147 BC Flag will active when you received Coin Case 145 BE Flag will active when you talk first with Victory Man into Battle Castle 563 BF Flag will active when you received the Quick Claw 24 C0 Flag will active when you received the Dusk Ball 51 C1 Flag will active when you show a Geodude to man 55 C4 Flag will active when you talk with Hidden Power Man 144 C6 Flag will active when you received the Tm 366 C7 Flag will active when you received 17A item 414 C9 Flag will active when you received the Tm Skill Swap 41 CA Flag will active when you received the Tm Trick Room 378 CB Flag will active when you received the Tm Facade 455 CD Flag will active when you received the Tm Payback 382 CE Flag will active when you received the Tm Fling 395 D0 Flag will active when you beat Dialga 584 D1 Flag will active when you beat Palkia 585 D5 Flag will active when you received E8 item 191 D9 Flag will active when you received A1 item 498 DE Flag will active when you received the Icicle Plate 386 DF Flag will active when you joined with Marley 247 E0 Flag will active when you joined with Mira 284 E1 Flag will active when you joined with Riley 293 E2 Flag will active when you don't have enough space for Riley's Egg 293 E4 Flag will active when Mira go out 284 ED Flag will active when you receive First Coupon 2 EE Flag will active when you receive Second Coupon 2 EF Flag will active when you receive Third Coupon 2 F0 Flag will active when you talk with alter's sister after Nat.Pkdx 423 F1 Flag will active when you finish talking with Rival 29 F3 Flag will active when you active Poketch(2) 2 F5 Flag will active after trade 499 F6 Flag will active when you talk for the first time with the Master 499 F9 Flag will active when you talk for the first time with the FootMan 375 FB Flag will active after Manaphy pic 370 100 Flag will active when you talk for the first time with Grandma Wilma 365 105 Flag will active when you receive Sticky Barb 141 107 Flag will active when you give SecretPotion to Psyduck 149 108 Flag will active when talk first with Move Man 502 109 Flag will active when you receive 1A item 54 10C Flag will active after beating right trainer 29 10D Flag will active after beating left trainer 29 10E Flag will active when you use the Storage Key 143 10F Flag will active when you use the Works Key 200 112 Flag will active when you receive the Potion 29 116 Flag will active when you received E0 item 361 11C Flag will active when you give the Coombe 128 11D Flag will active when you received E9 item from Byron 514 11E Flag will active after Arceus Battle 510 126 Flag will active after Azelf Battle 390 129 Flag will active when you received Accessories 137 12E Flag will active when you received 20 coins from Man 136 12F Flag will active when you received 32 coins from Man 136 131 Flag will active when you talked first with Bebe 24 139 Flag will active when you received DA item 369 13A Flag will active when you received White Flute 338 13B Flag will active when you received Spell Tag 387 13D Flag will active when you receive Accessories 12 13E Flag will active when you beated team Galactic in Verity Lakefront 334 13F Flag will active when you received 6F Item 354 149 Flag will active when you beated Rotom 300 15C Flag will active when you talk after League with Mum without NatPkdx 414 15D Flag will active when you talk after League with Mum with NatPkdx 414 181 Flag will active when you active Poketch 2 196 Flag will active when you don't have Pokeball 311 198 Flag will active when you receive a Badge 47,141 19C Flag will active when you decide to battle with alter against Grunts 2 1A3 Flag will active when you beated Galactic on Valley Windworks 201 1DF Flag will active when Mesprit flew up 313 1E5 Flag will active when you give receive egg from Riley 293 1EC-1ED-1EE-1EF-1F0 Flag are linked with Battle Tower 493 21C Flag will active when you received National Pokedex 390 224 Flag will active when you use Galactic Key 305 225 Flag will active when you use Galactic Key 307 226 Flag will active when you use Galacric Key 308 227 Flag will active when you use Galactic Key 310 24E Flag used for Arceus Battle 510 260 to 267 Flag will active linked with clock time 367 26C to 26F Flag will active linked with clock time 79 270-271 Flag will active linked with clock time 362 27D Flag will active when you talk with Rowan when U.A.M. returned into cave 422 290-291 Flag used when enter first in Battle Frontier 560 294 Flag will active when you talk with Oak in Rowan's lab 422 2A1 Flag will active when you choose a Pokemon during Amity Square 253 2A7 to 2B9 Flag linked with Gym Leader Rebattle 1122(Script) 2BB-2BC-2BD-2BE-2BF Flag linked with Rotom Change Room 571 2C1 Flag will active when you enter in Battle Castle 563 2C3 Flag will active when you enter first into Battle Frontier 559 2CB Flag will active when you enter into Battle Frontier 559 964 Flag used for League Victory 165 97D Flag will active when you save Azelf,Mesprit,Uxie 494 97E Flag will active when you received Eeeve from Bebe 24 98E Flag will active when you beat Mars 312 9CC Flag will active when you enter into Amiry Square 253 AA3 Flag will active when you received a Berry 127 AA9 Flag will active when you pick up a Loto Ticket 11 AAC Flag will active when you already massage your Pokemon 148 AAE Flag will active when you received Belt from Man 394 AB0 Flag will active when you clicking on Tv in Old Chateau 300 AB3 Flag will active when you pick up a Loro Prize 11 AB4 Flag will active when you receive Shards on Great Marsh 509 AB5 Flag will active when you receive an Item from Amity Man 253 Heart Gold/Soul Silver Known Flags Flag Descriptions Example PPRE map Number 69 Flag set at the start of Union Function 2 2CA Flag set when register Morty Number 2
  23. evandixon

    B2W2 File System

    /a/0/0/0 connection strength icons /a/0/0/1 unused (underground etc) /a/0/0/2 text 1 -- http://stuff.veekun.com/pokemon-black-2-text-dump-part1-ja.bz2 /a/0/0/3 text 2 -- http://stuff.veekun.com/pokemon-black-2-text-dump-part2-ja.bz2 /a/0/0/4 sprites (pokegra) /a/0/0/5 basic boxes and arrow /a/0/0/6 move effects /a/0/0/7 Pokemon icons /a/0/0/8 models /a/0/0/9 (416 * various, small) /a/0/1/0 ?? 1 file ?? /a/0/1/1 battle backgrounds, generic map textures, battle UI /a/0/1/2 zonedata (map association table) /a/0/1/3 not a narc, just data (?) /a/0/1/4 textures /a/0/1/5 edge color tables /a/0/1/6 personal.narc (file index information below) /a/0/1/7 (Pt copy) growtbl /a/0/1/8 level up moves /a/0/1/9 evolves into /a/0/2/0 child pokemon /a/0/2/1 move data /a/0/2/2 light blue window (communications lost with other player) /a/0/2/3 fonts /a/0/2/4 item data /a/0/2/5 item sprites http://turnipmints.mooo.com/~andrew/pokemon/black2_itemgra.7z /a/0/2/6 title screen (version, nintendo/pc logo too) /a/0/2/7 ui background for something /a/0/2/8 trading interface /a/0/2/9 IR/wifi etc interface backgrounds /a/0/3/0 overworld hero sprites /a/0/3/1 overorld sprites for certain NPCs /a/0/3/2 wireless communication interaction & backgrounds /a/0/3/3 mystery gift interfaces /a/0/3/4 mainmenu continue background and interface /a/0/3/5 entralink ui sprites and background /a/0/3/6 ?? 1 file ?? /a/0/3/7 ?? 1 file ?? /a/0/3/8 more entralink related sprites and backgrounds /a/0/3/9 badges /a/0/4/0 unused? blank sprites /a/0/4/1 ?? 1 file ?? /a/0/4/2 shared trainer profile sprites and background /a/0/4/3 simple shapes, likely dev & unused /a/0/4/4 musical prop sprites /a/0/4/5 musical generic sprites/background /a/0/4/6 musical in-musical sprites /a/0/4/7 same sort of thing as a/2/0/8- pokemon species and forms split up into actual index numbers /a/0/4/8 overworld sprites /a/0/4/9 cgear top bar sprites /a/0/5/0 single color sprites, unused /a/0/5/1 copy of bw1 sprites /a/0/5/2 (19 * various) /a/0/5/3 item browsing UI backsplash /a/0/5/4 status/type/contact sprites (battle) /a/0/5/5 weather particle sprites (effects?) /a/0/5/6 in-game scripts /a/0/5/7 (25 * various, script related?) - load 28 bytes at a time, /a/0/5/8 pal pad entry sprites /a/0/5/9 3d camera config file /a/0/6/0 (200 * 780 bytes) /a/0/6/1 (10 * 780 bytes) /a/0/6/2 pal pad background sprites /a/0/6/3 trainer sendout pokeball throw sprites /a/0/6/4 dev alphanumeric unused /a/0/6/5 move anim scripts /a/0/6/6 btl anim scripts /a/0/6/7 dev camera UI tiles /a/0/6/8 material/material srt anims /a/0/6/9 (8 * various) /a/0/7/0 start/X menu sprites (save/party etc) /a/0/7/1 trainer front sprites (trfgra) /a/0/7/2 trainer back sprites (trbgra) /a/0/7/3 BMD0 - shadow4_test /a/0/7/4 overworld ambient textures (grass+) /a/0/7/5 matrixy background and buttons /a/0/7/6 musical? background for some window /a/0/7/7 pokemon stats summary + ribbons /a/0/7/8 (50 * various) /a/0/7/9 ?? 1 file ?? /a/0/8/0 (30 * various) /a/0/8/1 (1 * 780 bytes, another 0 byte blank) /a/0/8/2 UI tiles, PC box tiles, type sprites /a/0/8/3 small shield sprites with numbers /a/0/8/4 map layout tiles /a/0/8/5 ?? 1 file ?? /a/0/8/6 ?? 1 file ?? - background music-related /a/0/8/7 inventory buttons and icons for item types /a/0/8/8 link tiles /a/0/8/9 text-related /a/0/9/0 text-related /a/0/9/1 trainer data /a/0/9/2 trainer poke /a/0/9/3 musical (?) model and background/stuff /a/0/9/4 move backgrounds /a/0/9/5 gts search room sprites/etc /a/0/9/6 (2 files, large and small) /a/0/9/7 (10 files, various) /a/0/9/8 item quality boxes, kinda like wondercards /a/0/9/9 various backgrounds (large skewed pokeball) /a/1/0/0 pokewood logos and ui backgrounds /a/1/0/1 speech bubbles and battle background (black pokeball) /a/1/0/2 ?? 1 file ?? 800 bytes /a/1/0/3 gts negotiations sprites /a/1/0/4 trading sub-animation for pokeball effects /a/1/0/5 some kind of red aurora /a/1/0/6 (38 * 188) /a/1/0/7 jigglypuff singing sprites /a/1/0/8 protaganist textures (professor intro) /a/1/0/9 (444 * 28 bytes, few bigger) /a/1/1/0 (25 * 4 bytes) /a/1/1/1 museum's book textures /a/1/1/2 sound/song for something musical /a/1/1/3 sound/song for something musical /a/1/1/4 sound/song for something musical /a/1/1/5 sound/song for something musical /a/1/1/6 large key item textures (magma stone, mirror, lunar wing), also mugshot backgrounds (fiery/icy winds etc), keldeo form change(281), NPC fly action animations(59,67) /a/1/1/7 PC box backgrounds /a/1/1/8 (117 * 36 bytes) /a/1/1/9 wifi tournament ui backgrounds? /a/1/2/0 bw2 keyboard layouts /a/1/2/1 pikachu & pachirisu wallpaper /a/1/2/2 breaking box texture /a/1/2/3 earth/water/fire mini texture /a/1/2/4 copy of bw1 egg moves (/a/1/2/3) /a/1/2/5 something with linking and unused stuff /a/1/2/6 overworlds (616) /a/1/2/7 encounters (135) /a/1/2/8 subway texture /a/1/2/9 registered item popup overlay /a/1/3/0 dev screenshots, useless /a/1/3/1 TV gelboard /a/1/3/2 xtransciever NPC sprites, contains a few new people https://dl.dropbox.com/u/12206225/a132.zip /a/1/3/3 isshu city system /a/1/3/4 link sprites, nothing /a/1/3/5 cocoon textures /a/1/3/6 isshu zone system /a/1/3/7 battle recorder tiles /a/1/3/8 clay & protagonist textures /a/1/3/9 DS/DSi connectivity screen? /a/1/4/0 poketransfer sseq /a/1/4/1 PCbox bottom screen layout /a/1/4/2 poketransfer textures/tiles /a/1/4/3 dream world cutscene stuff /a/1/4/4 gts sprites /a/1/4/5 wireless connection screen /a/1/4/6 isshu dungeon system /a/1/4/7 isshu route/area switch system /a/1/4/8 moving car textures /a/1/4/9 (1 file, 40 bytes) /a/1/5/0 seasons splash /a/1/5/1 (3 * various xKB files) /a/1/5/2 wood/metal/ice textures /a/1/5/3 mail backgrounds /a/1/5/4 (48 * 1052 bytes) /a/1/5/5 textures gold/blue (insignificant) /a/1/5/6 (8 * various <1KB files) /a/1/5/7 pokedex tiles /a/1/5/8 more overworld sprites, boat textures, cutscene textures, map textures? /a/1/5/9 "POCKET MONSTERS BLACK/WHITE VERSION 2" tilemaps (intro cutscene / credits?) /a/1/6/0 dragon gym textures /a/1/6/1 (7 * 44 bytes) /a/1/6/2 bootup credits / unused copyright notice /a/1/6/3 in-game trades /a/1/6/4 (8 * 36 bytes) /a/1/6/5 footprint sprites (cgear?) /a/1/6/6 (Pt copy) pl_btdtr /a/1/6/7 (Pt copy) pl_btdpm /a/1/6/8 professor intro animation /a/1/6/9 trainer AI scripting /a/1/7/0 xtransceiver ui and static bg /a/1/7/1 player interaction sprites /a/1/7/2 (25 * 124 bytes) /a/1/7/3 (2 * 36 bytes) /a/1/7/4 map textures /a/1/7/5 more map textures /a/1/7/6 (684 * 345 bytes, 01 flags) /a/1/7/7 (60 * 64 bytes) /a/1/7/8 online win loss messages /a/1/7/9 less of ^ /a/1/8/0 egg_cursor, spiral sphere /a/1/8/1 ??https://dl.dropbox.com/u/12206225/screen.png ?? Seems like Mixing records screen in Union Room, wireless communications playersprites /a/1/8/2 isshu 3d sys /a/1/8/3 (6 * 50 bytes, 1 * 80 bytes) /a/1/8/4 closeup backgrounds when people are talking /a/1/8/5 vs recorder, battle point /a/1/8/6 demo_sinka2, white screen with black topbottom /a/1/8/7 water textures /a/1/8/8 yellowgreen ui /a/1/8/9 more yellowgreen ui, player interactivity sprites /a/1/9/0 unity tower /a/1/9/1 (685 * 4 bytes) definitely pokemon-related /a/1/9/2 itemfinder UI /a/1/9/3 https://dl.dropbox.com/u/12206225/anotherunk.png ?? /a/1/9/4 (Pt copy) wifi_earth /a/1/9/5 https://dl.dropbox.com/u/12206225/what.png /a/1/9/6 more interactive UIs similar to above /a/1/9/7 saving game notebook animation /a/1/9/8 battle institute record paper /a/1/9/9 dex complete paper? https://dl.dropbox.com/u/12206225/dexcomplete.png https://dl.dropbox.com/u/12206225/dexcomplete2.png /a/2/0/0 (6 * various >1KB files) /a/2/0/1 animated pokeball small /a/2/0/2 starter sprites /a/2/0/3 battle subway map /a/2/0/4 out25 bushes and flowers textures /a/2/0/5 ITEM_STD items split into type groups by file: 5_0: battle items, 5_1: , 5_2: , 5_3: , 5_4: /a/2/0/6 8 byte members- stadium trainers(last 2 bytes of member is trainer class) /a/2/0/7 rainbow/sparkle textures /a/2/0/8 index of pokemon and forms used to look up a poke's "real" index number- they're listed separated by form, though some have 2 listings even with 1 form(venusaur, meganium) /a/2/0/9 camera click sound.. /a/2/1/0 some kind of trainer record /a/2/1/1 copy of bw1 subpoke /a/2/1/2 copy of bw1 subtr /a/2/1/3 hall of fame sprites /a/2/1/4 dream mist poof /a/2/1/5 ending picture montage /a/2/1/6 (7 * various >1KB). /a/2/1/7 car/truck textures /a/2/1/8 some UI /a/2/1/9 (4 * 36 bytes). /a/2/2/0 gamefreak logo movie (bw1 /a/2/2/5) http://turnipmints.mooo.com/~andrew/tmp/bw-gamefreak.avi /a/2/2/1 bw1 intro movie (/a/1/3/4) (15fps) http://turnipmints.mooo.com/~andrew/tmp/bw-movie.avi /a/2/2/2 intro movie (seems to be 15fps) http://turnipmints.mooo.com/~andrew/tmp/black2-movie.avi http://turnipmints.mooo.com/~andrew/tmp/white2-movie.avi /a/2/2/3 min pokemon levels (0-649) /a/2/2/4 pidove/woobat flying pokemon animation /a/2/2/5 (70 * large files) AB files /a/2/2/6 (93 * large files) AB files /a/2/2/7 (86 * 98304 compressed) screenshots? http://turnipmints.mooo.com/~andrew/tmp/black2-help.7z http://turnipmints.mooo.com/~andrew/tmp/white2-help.7z /a/2/2/8 battle_pocket.dat /a/2/2/9 small footprints without pallete /a/2/3/0 black error message (error has occured?) /a/2/3/1 (23 * pallete&?? files) /a/2/3/2 test effect textures /a/2/3/3 stage (musical?) /a/2/3/4 (8 * various <50b files). /a/2/3/5 medal /a/2/3/6 medal case background /a/2/3/7 medal case checkerflag background /a/2/3/8 achievement medals https://dl.dropbox.com/u/12206225/fesmedals.rar /a/2/3/9 ?? 1 file ?? /a/2/4/0 ?? 1 file ?? /a/2/4/1 ?? 1 file ?? /a/2/4/2 green&yellow-orange background for something /a/2/4/3 score bonus time up tiles /a/2/4/4 (13 * various files) /a/2/4/5 world tournament brackets sprites /a/2/4/6 world tournament poster~https://dl.dropbox.com/u/12206225/worldtournament.bmp /a/2/4/7 ?? 1 file ?? /a/2/4/8 (120 * 6 byte files) frontier 1 pokemon allowance? /a/2/4/9 (120 * <16 byte files) multiple pokemon, double? /a/2/5/0 1000 files, pokemon sets pretty much filled /a/2/5/1 (120 * 6 byte files) ... /a/2/5/2 (120 * <16 byte files) ... /a/2/5/3 pwtpoke2 - 1000 files, first bunch are for PWT (second set) /a/2/5/4 pwttr1, 68 files - world tournament trainer pkm choices 1v1 /a/2/5/5 pwttr6, 68 files - world tournament trainer pkm choices 6v6 /a/2/5/6 pwtpoke - world tournament pkm sets (first set) /a/2/5/7 1000 files, pokemon sets pretty much filled ~still diff /a/2/5/8 pwt vgc top4 event /a/2/5/9 https://dl.dropbox.com/u/12206225/a259.png /a/2/6/0 elevator/gate textures /a/2/6/1 1000 files, only 370 with data (pkm sets) /a/2/6/2 661 files, 44/24/10 bytes ~ pkm choices from above sets ^? /a/2/6/3 wbt textures (battle tournament) /a/2/6/4 homika (roxie)'s gym speaker texture /a/2/6/5 world tournament backgrounds /a/2/6/6 more world tournament bg /a/2/6/7 trainer mugshots /a/2/6/8 (117 * various <100b files) /a/2/6/9 (41 * 1688 bytes, +1 1536 byte) /a/2/7/0 ~new record, timed people interaction? hexagonal background+ /a/2/7/1 pokewood /a/2/7/2 (41 * ~100b files) /a/2/7/3 hidden hollows /a/2/7/4 pokewood animated cell movies /a/2/7/5 (185 * various files) /a/2/7/6 shibu/hasu/nami textures (insignificant) /a/2/7/7 IR battle tiles /a/2/7/8 aku_fire, aku_kage, aku_tume textures (insignificant) /a/2/7/9 starry night textures /a/2/8/0 shauntal room textures (fires) /a/2/8/1 marshal room textures /a/2/8/2 (32 * various, 48 0b) /a/2/8/3 ?? 1 file ?? /a/2/8/4 more texture tiles /a/2/8/5 c-gear people background /a/2/8/6 small insignificant textures /a/2/8/7 c-gear textures and default background /a/2/8/8 stairwell textures /a/2/8/9 lists of pokemon by type~pokedex search by type /a/2/9/0 champion's room textures, and mark-medals? /a/2/9/1 trfgra (trainer battle sprites) /a/2/9/2 elesa gym textures /a/2/9/3 multicolor pokewood logo poster /a/2/9/4 pokewood mini posters for each unique character /a/2/9/5 textures of water pokemon caricatures /a/2/9/6 in-pokedex route encounter lists? /a/2/9/7 undersea tunnel overview and poster /a/2/9/8 insignificant texture (really not) /a/2/9/9 N riding zekrom/reshiram /a/3/0/0 weather particles (leaf/flake/flower/leaf) /a/3/0/1 regi floor textures /a/3/0/2 copy of bw1 personal.narc (/a/0/1/6) /a/3/0/3 firework texture /a/3/0/4 glowing virizion/terrakion/cobalion textures /a/3/0/5 2 effect texture, another 13640b file) /a/3/0/6 (copy of bw1 /a/2/1/9) (legendary stone effect & pokeball)
  24. The WAN file format is used in Pokémon Mystery Dungeon: Explorers of Time/Darkness/Sky to store animated character sprites along with map props, and even some UI elements. This format is always wrapped by a SIR0 container, and it doesn't possess its own magic number. However, it does have its own header and structure. Its one of the most complex formats used in the game. It can have a different file extension, depending on the type of sprite it contains. So far, WAN and WAT are both suffixes used for WAN sprites. General Information The file is read from bottom to the top. This is likely because of the way the content of the file is organized, and how the files are meant to be loaded into memory and used as data structures right away. The content of the file is split in 5 categories. Meta-Frames The meta-frames are basically the virtual image that the animations are referring to. They're essentially an abstraction layer above the actual images, and contain data about these ranging from which image in the image pointer table a meta-frame refers to, the actual image's resolution, whether the image should be flipped vertically or horizontally, and even more. Meta-frames can be "grouped" together in a sequence, with the last meta-frame in a group being indicated by as special bit flag. This allows the game to combine several small images together, to assemble a bigger one. The Offsets stored in the meta-frame allow positioning the images to properly assemble them. The animations refer to each meta frame, even single ones, as a meta-frame group, via index. The location of the first meta-frame of a group is stored in the Meta-Frame Groups Reference Table. Image Data The actual images are stored as pixel strips, followed with an assembly table. The table contains a list of entries indicating how to rebuild the image. The main reason the images are stored that way seems to be to remove needless zeroes that normally make the bulk of most images. The table indicates in what order to insert either a pixel strip of a certain length, or to insert the specified amount of zeroes. All the lengths of the strips of pixels, or the amount of zero to insert is always divisible by 16. The format of the image data can be either 4 bpp or 8bpp, as indicated in the WAN Header. Animations Each animation is made up of 3 things, a group, some sequences, and some frames. The groups itself is the "handle" of the animation. You can label them with an action, like "Run" for example. For character sprites(non-character sprites or special sprites follow different rules), each groups has 8 slots, each slot refers to a sequence. One for each of the 8 directions of movement. Groups may refer to the same sequence in all their slots. In character sprites, specific groups across all sprites/characters of the same type, have all the same use. For example, all character sprites' first group in the list is always the running animation! Each sequence is a list of animation frames one after the other, terminated with a null frame. Each frames contains a display duration, the index of the meta-frame group to be displayed, an offset to move slightly the image relative to the logical center of the sprite, and an offset for the shadow blob displayed under the character. Particle Offsets Not much is known about those. They're a very long list of 16 bits signed integers, meant to be read 2 by 2. They indicate the offset to display particles, like sweat drops, along with exclamation marks and etc.. For now, its unknown how the game knows which is the correct one to pick for what. Color Data This contains the palette used by all the images in the sprite. It also contains details as to where to store the palette in video memory. Still not much is known about how exactly it all works, besides the actual color palette. Overview Here's an overview of how a WAN file is laid out. Offset Length Name Description 0x00 16 SIR0 Header The SIR0 container's header. The first pointer points to the WAN Header. The second to the SIR0 Encoded Pointer Offsets List. 0x10 Varies Meta-Frame Groups Block This contains all the meta-frames groups. After Meta-Frame Groups Block Varies Animation Sequences Block Contains all the animation sequences, and the frames that makes them up. After Animation Sequences Block Varies 0xAA Padding Bytes (If needed) Some padding to align the next block on an offset divisible by 4. After Padding Bytes Varies Image Data Block Contains all the image data. After Image Data Block Varies Color Data Block Contains the palette, along with some other color information. After Color Data Block Varies Meta-Frames Reference Table A list of 4 bytes pointers, containing the offset of the first meta-frame of every meta-frame groups located inside the Meta-Frame Groups Block. After Meta-Frames Reference Table Varies Particle Offset Table A list of made of pairs of 16 bits signed integers indicating offsets to display particle effects at. After Particle Offset Table Varies Animation Groups' Sequences Reference Table Several lists of 4 bytes pointers to animation sequences inside the Animation Sequences Block. Each list is pointed to by an entry in the Animation Groups Table. After Animation Groups' Sequences Reference Table Varies Animation Groups Table A list made up of a pair of 32 bits integers, one a pointer to a list of sequence in Animation Groups' Sequences Reference Table, the other a number indicating the length of that list. After Animation Groups Table Varies Image Data Pointer Table A list of 4 bytes pointers to the assembly table of every images in the Image Data Block. After Image Data Pointer Table Varies Animation Info Structure Contains info on, and pointers to the animation data. After Animation Info Structure Varies Image Info Structure Contains info on, and pointers to the Image Data Pointer Table, and Color Data Block. After Image Info Structure Varies WAN Header Contains 2 pointers to the the 2 structures above, along with a boolean indicating whether this is a prop, or an 8 way animated sprite. After WAN Header Varies 0xAA Padding Bytes (If needed) Some padding bytes to make sure the next block starts on an offset divisible by 16. After Padding Bytes Varies SIR0 Encoded Pointer Offsets List A compressed list of every pointer pointer offsets in the file. Used to translate file-relative pointers to NDS memory relative pointers. After SIR0 Encoded Pointer Offsets List Varies 0xAA End Of File Padding Bytes (If needed) Some padding bytes to make sure the file ends on an offset divisible by 16. WAN Header The header is made up of 3 parts. The first part is just a little chunk of 12 bytes with two pointers to the 2 main parts of the header. It also contains a boolean that indicates whether the sprite follows the same format as character sprites or not. The animation info block contains various information related to how to animate the sprite, and where the various required elements to animate the sprite are located in the file. The image data info block contains details on the format of the image data stored in the file, along with the color data that all images in this sprite uses. Main Header WAN main header. (Total length 12 bytes) Offset Length Endianness Type Name Description 0x0 4 little uint32 Ptr to Anim Info A 4 bytes pointer to the part of the WAN header containing data on the sprite's animations. 0x4 4 little uint32 Ptr to Image Data Info A 4 bytes pointer to the part of the WAN header containing data on the sprite's images data. 0x8 2 little uint16 Sprite Type A 2 bytes integer value to indicate what kind of sprite this is. Known values are 0,1,3. Or Props/UI, Characters, and Unknonw, respectively. 0xA 2 little uint16 Unknown #12 Unknown purpose. Referred to as Unknown #12 for now. Animation Info Animation info block. (Total length 24 bytes) Offset Length Endianness Type Name Description 0x0 4 little uint32 Pointer to Meta-Frames Reference Table A 4 bytes pointer to the Meta-Frames Reference Table. 0x4 4 little uint32 Pointer to Particle Offset Table A 4 bytes pointer to the Particle Offset Table. This can be a null pointer, only for type 0 sprites! (UI sprites, and props) If a type 1(character sprite) sprite has no particle offsets, the pointer's value points to the end of the Meta-frame table. 0x8 4 little uint32 Pointer to Animation Groups Table A 4 bytes pointer to the Animation Groups Table. 0xA 2 little uint16 Amount of animation groups The amount of animation groups in the Animation Groups Table. 0xC 2 little uint16 Unknown #6 (Uncertain)Possibly the amount of blocks(groups of 4 tiles, possibly ?) allocated for the image in video memory. 0xE 2 little uint16 Unknown #7 Unknonw purpose. 0x10 2 little uint16 Unknown #8 Unknonw purpose. 0x12 2 little uint16 Unknown #9 Unknonw purpose. 0x14 2 little uint16 Unknown #10 Unknonw purpose. Image Data Info Image Data Info block. (Total length 16 bytes) Offset Length Endianness Type Name Description 0x0 4 little uint32 Pointer to Image Data Pointer Table A 4 bytes pointer to the Image Data Pointer Table. 0x4 4 little uint32 Pointer to Color Data Block A 4 bytes pointer to the Color Data Block. 0x8 2 little uint16 Unknown #13 (uncertain) If 1, load the first row of tiles of each images one after the other, the the second, and so on. Seems to be for very large animated sprites! 0xA 2 little uint16 Is 256 colors 8bpp A boolean value indicating whether the sprite's images should be written to video memory as 8bpp, 256 colors images. If its 0, the images are written to memory as 4bpp, 16 colors. The game can write a 4bpp image as a 8bpp to video memory properly, but the palette needs to be moved to the extended palette area, possibly by messing around with other values. Another value in the color info block needs to be set for any of this to work properly! 0xC 2 little uint16 Unknow #11 (Uncertain) Seems to move the palette around palette slots in the video memory. 0xE 2 little uint16 Amount of images The number of images in the Image Data Pointer Table. Image Data Pointer Table This is a very simple list of 4 bytes pointers to the assembly table of every image in the file. The amount of pointer in this table is specified in the Image Data Info block. Animation Groups Table A list of entries, each representing an animation group or "action". For characters, this table is usually 13 entries long, for hero/partner characters, it is at least 35 entries long. For non-character sprites, the length varies. Each entry is 8 bytes long, and made up of 2 values. The first is a 4 bytes pointer to the beginning of the list of sequence slots for this particular group in the Animation Groups' Sequences Reference Table. The Second value is a 4 bytes unsigned integer indicating the number of slots in the list, pointed to by the first value, for this particular group. Entries may be completely null, and if that's the case, there must be a corresponding null pointer in the Animation Groups' Sequences Reference Table. For example here's a typical group table( converted to big endian, as 4 bytes values, and displayed 1 entry per line! ): 0x00004AEC, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004B20, 0x00000008, 0x00004B40, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004B70, 0x00000008, And the corresponding sequence table( laid out to better where are the sequence lists for each of the groups in the group table above starts and ends ): 0x000002D6, 0x00000312, 0x0000034E, 0x0000038A, 0x000003C6, 0x00000402, 0x0000043E, 0x0000047A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000004B6, 0x000004DA, 0x000004FE, 0x00000522, 0x00000546, 0x0000056A, 0x0000058E, 0x000005B2, 0x000005D6, 0x000005FA, 0x0000061E, 0x00000642, 0x00000666, 0x0000068A, 0x000006AE, 0x000006D2, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000006F6, 0x0000076E, 0x000007E6, 0x0000085E, 0x000008D6, 0x0000094E, 0x000009C6, 0x00000A3E, Notice how each null groups in the group table has a single corresponding null pointer in the sequence table below. Animation Groups' Sequences Reference Table As mentioned above this is simply a list containing pointers to animation sequences. Each entries can be though of as a slot assigned to one of the groups in the animation group table. The length of this table is determined by adding up the amount of animation sequence slots for each entries in the animation groups table. Taking care to count completely null groups as 1! Particle Offset Table Not much is known about this part. It can be completely omitted in non-character sprites. It basically contains coordinates, offsets from the center of the sprite where to display particle effects. Things like sweat drops, exclamation marks, or battle effects. The length of this block varies indiscriminately from pokemon to pokemon. Hero/Partner pokemon have more entries than other pokemon. Its unknown how the game finds what coordinate to use for what. It might be stored in another location in the game's file system. Meta-Frames Groups Reference Table This is another very simple pointer list, pointing to the first meta-frame of every meta-frame groups in the file. Color Data Block Image Data Block Animation Sequences Block Meta-Frame Groups Block Credits Thanks to TruePikachu for finding out the link between the various parts of the file format!
  25. psy_commando

    DSE SWDL Format

    General Information SWDL containers are used to contain sample and programs/presets information for any accompanying SEDL or SMDL files. They can be used in a few ways. To accompany a SMDL, and contain both the samples it uses and the data for the programs it uses. To accompany a SMDL, and contain only the program/preset data while referring to a main sample bank for the samples it uses. As a sample bank. When used in the second manner, it allows the game to only load the samples it actually uses from the main bank, and it keeps redundancy to a minimum. SWDLs also seems to override some of the data they contains. So, if a sample has its rootkey set to 60 in the main bank, and it was set to 80 in another SWDL referring to it, the rootkey actually used after loading that last SWDL would be 80. This works with a lot more parameters however. File Structure The file format is based around chunks, a bit like the RIFF file format. There doesn't seem to be a particular order to the chunks other than the header and the eod chunk. Overview[edit] Offset Length Name Description 0x0 80 SWDLHeader The container's header. - Varies wavi Chunk Contains details on all the samples contained, or referred to by the SWDL container. - Varies prgi Chunk The prgi chunk contains the programs/presets used by the SMDL files. (It may be omitted in SWDL purely for storing sample data.) - Varies kgrp Chunk The kgrp chunk contains information on every keygroups used in the SWDL by the programs/presets. (It may be omitted in SWDL purely for storing sample data.) - Varies pcmd Chunk The pcmd chunk contains the raw sample data for every samples contained in the file. (It may be omitted if the SWDL refers to a main bank for its sample data.) - 16 End of Data Chunk This empty chunk marks the end of the SWDL container. SWDL Header Total length 80 bytes Offset Length Type Name Description 0x00 4 char[4] magicn The 4 characters "swdl" {0x73, 0x77, 0x64, 0x6C} 0x04 4 - unk18 4 bytes of zeroes. 0x08 4 uint32 flen File length in bytes. 0x0C 2 uint16 version? Version number? ( 0x1504 ) 0x0E 1 uint8 unk1 Unknown. 0x0F 1 uint8 unk2 Unknown. 0x10 4 - unk3 4 bytes of zeroes. 0x14 4 - unk4 4 bytes of zeroes. 0x18 2 uint16 year Year the file was last modified. 0x1A 1 uint8 month Month the file was last modified. 0x1B 1 uint8 day Day the file was last modified. 0x1C 1 uint8 hour Hour the file was last modified. 0x1D 1 uint8 minute Minute the file was last modified. 0x1E 1 uint8 second Second the file was last modified. 0x1F 1 uint8 centisecond? Could possibly be the centisecond that the file was last modified. 0x20 16 char[16] fname Filename, ASCII null terminated string. Any extra space after the 0 on the total 16 bytes, is padded with 0xAA. 0x30 4 uint32 unk10 Always 0x00AA AAAA 0x34 4 uint32 unk11 4 bytes of zeroes. 0x38 4 uint32 unk12 4 bytes of zeroes. 0x3C 4 uint32 unk13 So far always 0x10 0x40 4 uint32 pcmdlen Length of "pcmd" chunk if there is one. If not, is null! If set to 0xAAAA0000 (The 0000 may contains something else), the file refers to samples inside an external "pcmd" chunk, inside another SWDL ! 0x44 4 uint32 unk14 4 bytes of zeroes. 0x46 2 uint16 nbwavislots Numbers of sample pointer slots, empty or not, in the "wavi" chunk's "WavTable". 0x48 2 uint16 nbprgislots Numbers of presets pointer slots , empty or not, in the "prgi" chunk's "TablA". 0x4A 2 uint16 unk17 Unknown 0x4C 4 uint32 wavilen Length of "wavi" chunk. wavi Chunk The wavi chunk contains information on all the samples. Its what links the prgi chunk to the sample data within the local or external pcmd chunk. Its made up of two main parts: A pointer table, with a slot for every samples used globally. A table of sample information. Each non-null pointers in the first table points to a single sample information entry in the second table. Null pointers indicate unused, or missing samples, depending on the context. Offset Length Type Name Description 0x00 4 char[4] label "wavi" {0x77, 0x61, 0x76, 0x69} 0x04 2 uint16 unk1 Always 0. 0x06 2 uint16 unk2 Always 0x1504. 0x08 4 uint32 chunkbeg Seems to always be 0x10, possibly the start of the chunk data. 0x0C 4 uint32 chunklen Length of the chunk data. Begins counting right after this field 0x10 Varies - WabTable Array containing 2 bytes offsets from the beginning offset of WavTable to an entry in the SampleInfoTbl table! It may be null. After WavTable 0-15 - Padding Bytes 0xAA padding bytes to align the next part on 16 bytes. After Padding varies - SampleInfoTbl This table contains details on each sample entries in the "WavTable". WavTable The table of pointers to the sample info. Each pointers is 16 bits, and may be null. The nb of entries is set in the SWDL header. SampleInfoTb The table made up of sample info entries. Each entries are 64 bytes, thus no padding is ever needed between entries. Here's the format of a sample info entry: Offset Length Type Name Description 0x00 2 uint16 unk1 Entry marker? Always 0x01AA. 0x02 2 uint16 ID Index number from WavTable. Empty/null entries in WavTable are counted! 0x04 1 int8 ftune The pitch fine tuning in cents(?). 0x05 1 int8 ctune Coarse tuning, possibly in semitones(?). Default is -7. 0x06 1 int8 rootkey The MIDI note associated to the sample. (The note that the instrument sampled is playing) It doesn't seems to have any effect in the game. 0x07 1 int8 ktps Key Transpose. Is basically the difference between rootkey and 60. 0x08 1 int8 volume The volume of the sample. (0-127) 0x09 1 int8 pan The pan of the sample. (0-64-127) 0x0A 1 uint8 unk5 Possibly Keygroup parameter for the sample. Always 0x00. 0x0B 1 uint8 unk58 Unknown. Always 0x02. 0x0C 2 uint16 unk6 Always 0x0000. 0x0E 2 - unk7 0xAA padding. 0x10 2 uint16 unk59 Always 0x1504. 0x12 2 uint16 smplfmt Sample format. 0x0000 : Possibly 8 bits PCM 0x0100 : 16 bits PCM 0x0200 : 4 bits ADPCM 0x0300 : Possibly PSG ? 0x14 1 uint8 unk9 Often 0x09 0x15 1 uint8 smplloop Flag indicating whether the sample should be looped or not ! (1 = looped, 0 = not looped) 0x16 2 uint16 unk10 Often 0x0108 0x18 2 uint16 unk11 Often 0004. 0x1A 2 uint16 unk12 Often 0x0101. 0x1C 4 - unk13 Often 0x0000 0000. 0x20 4 uint32 smplrate Sample rate in hertz. 0x24 4 uint32 smplpos The offset of the sound sample in the "pcmd" chunk when there is one. Otherwise, possibly offset of the exact sample among all the sample data loaded in memory? (The value usually doesn't match the main bank's) 0x28 4 uint32 loopbeg The position in bytes divided by 4, the loop begins at, from smplpos. ( multiply by 4 to get size in bytes ) Adding loopbeg + looplen gives the sample's length ! (For ADPCM samples, the 4 bytes preamble is counted in the loopbeg!) 0x2C 4 uint32 looplen The length of the loop in bytes, divided by 4. ( multiply by 4 to get size in bytes ) Adding loopbeg + looplen gives the sample's length ! 0x30 1 uint8 envon If not == 0, the volume envelope is processed. Otherwise its ignored. 0x31 1 uint8 envmult If not == 0, is used as multiplier for envelope paramters, and the 16bits lookup table is used for parameter durations. If 0, the 32bits duration lookup table is used instead. This value has no effects on volume parameters, like sustain, and atkvol. 0x32 1 uint8 unk19 Unknown. Usually 0x1 0x33 1 uint8 unk20 Unknown. Usually 0x3 0x34 2 uint16 unk21 Unknown. Usually 0x03FF ( Little endian -253) 0x36 2 uint16 unk22 Unknown. Usually 0xFFFF 0x38 1 int8 atkvol Sample volume envelope Attack Level.(0 to 127) Higher values towards 0x7F means the volume at which the attack phase begins at is louder. Doesn't shorten the attack time. 0x39 1 int8 attack Sample volume envelope Attack.(0 to 127) Higher values towards 0x7F means the attack phase takes longer to reach full volume! 126 is ~10 seconds. 0x3A 1 int8 decay Sample volume envelope Decay. (0 to 127) The duration the note has to be held until the volume is smoothly decreased to the value of "Sustain Volume". Higher values towards 0x7F means it takes longer before the held note's volume changes to "Sustain Volume". 0x3B 1 int8 sustain Sample volume envelope Sustain.(0 to 127) The volume at which the held note will stay at. (Default 0x7F) 0x3C 1 int8 hold Sample volume envelope Hold (0 to 127). Higher values towards 0x7F means the note is held at full volume longer after the attack phase. 126 is ~10 seconds. 0x7F, does the same as 0. 0x3D 1 int8 decay2 Sample volume envelope Decay2 (0 to 127). Higher values towards 0x7F means longer fade-out. 0x7F means never fade-out. (Default 0x7F) At 0x7E, it takes ~8 seconds for the volume to reach 0. 0x3E 1 int8 release Sample volume envelope Release parameter(0 to 127). Higher values towards 0x7F means longer release. Negative values mirror positive range. (Default is 0x28(40)) 0x3F 1 int8 unk57 Unknown. Usually 0xFF. prgi Chunk The prgi chunk contains programs/presets that the SMDL music sequences use as instrument presets in their tracks. Its made up of : A table of pointers to all the programs info entries. Some may be null. A table containing program info entries. The pointer table works in the exact same way as it does in the wavi chunk. 16 bits offsets from the beginning of the table to a program info entry. Offset Length Type Name Description 0x00 4 char[4] label "prgi" {0x70, 0x72, 0x67, 0x69} 0x04 2 uint16 unk1 Always 0. 0x06 2 uint16 unk2 Always 0x1504. 0x08 4 uint32 chunkbeg Seems to always be 0x10, possibly the start of the chunk data. 0x0C 4 uint32 chunklen Length of the chunk data. Begins counting right after this field 0x10 (nbprgislots * 2) + padding - ProgramPtrTbl A table of 16 bits pointers to entries in the ProgramInfoTbl. Some may be null. It usually has 128 slots. Like General Midi. If the nb of presets were to change, its possible there would be a need for padding bytes, seeing how the wavi chunk works. After ProgramPtrTbl Varies ProgramInfo[nbprgislots] ProgramInfoTbl A table containing information on all the presets available in the current SWDL. ProgramInfoTbl This table contains entries for every single presets available in the SWDL. Each entry is pointed to by a pointer in the ProgramPtrTbl. It contains ProgramInfo entries: ProgramInfo A ProgramInfo entry is minimum 144 bytes long. Its made of 3 parts: The program info header. The LFO table. The split table. The program info header contains details for identifying the preset, and the size of the LFO and split table. Offset Length Type Name Description 0x00 2 uint16 ID Index of the pointer in "TableA" that points to this entry. Also correspond to the program ID used in the corresponding SMDL file! 0x02 2 uint16 nbsplits Nb of samples mapped to this presets, in the split table. 0x04 1 int8 prgvol Volume of the entire program. 0x05 1 int8 prgpan Pan of the entire program. (0-127, 64 is middle, 127 is full right, 0 is full left ) 0x06 1 uint8 unk3 Most of the time 0x00. 0x07 1 uint8 thatFbyte Most of the time 0x0F. 0x08 2 uint16 unk4 Most of the time is 0x200. 0x0A 1 uint8 unk5 Most of the time is 0x00. 0x0B 1 uint8 nblfos Nb of entries in the LFO Table. 0x0C 1 uint8 PadByte Most of the time is 0xAA, or 0x0. The value here is used as the delimiter and padding ! 0x0D 1 uint8 unk7 Most of the time is 0x0. 0x0E 1 uint8 unk8 Most of the time is 0x0. 0x0F 1 uint8 unk9 Most of the time is 0x0. 0x10 (nblfos * 16) LFOEntry[nblfos] LFOTbl Table that contains details on how to use the 4 LFOs with this preset. After LFOTbl 16 - Delimiter 16 bytes of "PadByte" padding bytes, possibly to delimit the start of the section below. Uses the value of PadByte as padding value! After Delimiter (nbsplits * 48) SplitEntry[nbsplits] SplitsTbl Table of samples splits mapped to this program. LFOEntry These determine how to configure the 4 Low Frquency Oscillators (LFO) linked to this program. It allows to set the shape of the waveform/the function that generate the value. The output of the LFO, its frequency, depth, delay, fade-out. And possibly more. Here's the structure of an entry: Total Length 16 bytes Offset Length Type Name Description 0x00 1 uint8 unk34 Unknown, usually 0x00. It does seems to have an effect with a certain combination of other values in the other parameters. 0x01 1 uint8 unk52 Unknown, usually 0x00. Most of the time, this value is 1 when the LFO is in use. 0x02 1 uint8 dest The destination of the LFO's output. 0x0 : none/disabled 0x1 : pitch 0x2 : volume 0x3 : pan 0x4 : lowpass/cutoff filter? 0x03 1 uint8 wshape The shape/function of the waveform. (When the LFO is disabled, its always 1) Square Triangle? Sinus? ? Saw? Noise? Random 0x04 2 uint16 rate Rate at which the LFO "oscillate". May or may not be in Hertz. 0x06 2? uint16? unk29 Changing the value seems to induce feedback or resonance. (Or perhaps its because it ended up corrupting the sound engine state when messing with the parameter?) 0x08 2 uint16 depth The depth parameter of the LFO. 0x0A 2 uint16 delay Delay in milliseconds before the LFO effect is applied after the sample begins playing. 0x0C 2 uint16 unk32 Unknown, usually 0x0000. Possibly fade-out in milliseconds. 0x0E 2 uint16 unk33 Unknown, usually 0x0000. Possibly an extra parameter? Or a cutoff/lowpass filter's frequency cutoff? SplitEntry This represents a sample mapped to the preset. Those are played depending on certain conditions when a playnote event is received by the sequencer for that particular preset/program. Some samples may be played only for a certain range of keys or velocities for example. Offset Length Type Name Description 0x00 1 - unk10 A leading 0. 0x01 1 uint8 id The Index of the sample in the SplitsTbl! 0x02 1 uint8 unk11 Unknown. Is always the same value as offset 0x1A below ! (Possibly "bend range" according to assumptions made from the DSE screenshots) 0x03 1 uint8 unk25 Unknown. Possibly a boolean. 0x04 1 int8 lowkey Usually 0x00. Lowest MIDI Key this sample can play on. 0x05 1 int8 hikey Usually 0x7F. Highest MIDI Key this sample can play on. 0x06 1 int8 lowkey2 A copy of lowkey, for unknown purpose. 0x07 1 int8 hikey2 A copy of hikey, for unknown purpose. 0x08 1 int8 lovel Lowest note velocity the sample is played on.(0 - 127) 0x09 1 int8 hivel Highest note velocity the sample is played on.(0 - 127) 0x0A 1 int8 lovel2 A copy of lovel, for unknown purpose. Usually 0x00. 0x0B 1 int8 hivel2 A copy of hivel, for unknown purpose. Usually 0x7F. 0x0C 4 - unk16 Usually the same value as "PadByte", or 0. Possibly padding ? 0x10 2 - unk17 Usually the same value as "PadByte", or 0. Possibly padding ? 0x12 2 uint16 SmplID The ID/index of sample in the "wavi" chunk's lookup table. 0x14 1 int8 ftune Fine tune. The fine tune in cents. 0x15 1 int8 ctune Coarse tuning. Default is -7. 0x16 1 int8 rootkey Note at which the sample is sampled at ! 0x17 1 int8 ktps Key Transpose. Is basically the difference between rootkey and 60. 0x18 1 int8 smplvol Volume of the sample. 0x19 1 int8 smplpan Pan of the sample. 0x1A 1 uint8 kgrpid Keygroup ID of the keygroup this split belongs to! 0x1B 1 uint8 unk22 Unknown, possibly a flag. Usually 0x02. 0x1C 2 uint16 unk23 Unknown, usually 0000. 0x1E 2 - unk24 Usually the same value as "PadByte", or 0. Possibly padding ? Those last 16 bytes are for the volume envelope. They override the sample's original volume envelope! 0x20 1 uint8 envon If not == 0, the volume envelope is processed. Otherwise its ignored. 0x21 1 uint8 envmult If not == 0, is used as multiplier for envelope paramters, and the 16bits lookup table is used for parameter durations. If 0, the 32bits duration lookup table is used instead. This value has no effects on volume parameters, like sustain, and atkvol. 0x22 1 uint8 unk37 Unknown. 0x23 1 uint8 unk38 Unknown. 0x24 2 uint16 unk39 Unknown. 0x26 2 uint16 unk40 Unknown. 0x28 1 int8 atkvol Sample volume envelope Attack Level.(0 to 127) Higher values towards 0x7F means the volume at which the attack phase begins at is louder. Doesn't shorten the attack time. 0x29 1 int8 attack Sample volume envelope Attack.(0 to 127) Higher values towards 0x7F means the attack phase takes longer to reach full volume! 126 is ~10 seconds. 0x2A 1 int8 decay Sample volume envelope Decay. (0 to 127) The duration the note has to be held until the volume is smoothly decreased to the value of "Sustain Volume". Higher values towards 0x7F means it takes longer before the held note's volume changes to "Sustain Volume". 0x2B 1 int8 sustain Sample volume envelope Sustain.(0 to 127) The volume at which the held note will stay at. (Default 0x7F) 0x2C 1 int8 hold Sample volume envelope Hold (0 to 127). Higher values towards 0x7F means the note is held at full volume longer after the attack phase. 126 is ~10 seconds. 0x7F, does the same as 0. 0x2D 1 int8 decay2 Sample volume envelope Decay2 (0 to 127). Higher values towards 0x7F means longer fade-out. 0x7F means never fade-out. (Default 0x7F) At 0x7E, it takes ~10 seconds for the volume to reach 0. 0x2E 1 int8 release Sample volume envelope Release parameter(0 to 127). Higher values towards 0x7F means longer release. Negative values mirror positive range. (Default is 0x28(40)) 0x2F 1 int8 unk53 Usually 0xFF. kgrp Chunk The kgrp chunk contains a list of all the keygroups in use in this SWDL. Keygroups are used to allow finer control on how the audio engine allocates the limited amount of voices to the presets. They define a per group priority and a range of voice channel available to each, along with the maximum number of simultaneous voice channels each can used. Offset Length Type Name Description 0x00 4 char[4] label "kgrp" {0x6B, 0x67, 0x72, 0x70} 0x04 2 uint16 unk1 Always 0. 0x06 2 uint16 unk2 Always 0x1504. 0x08 4 uint32 chunkbeg Seems to always be 0x10, possibly the start of the chunk data. 0x0C 4 uint32 chunklen Length of the chunk data. Begins counting right after this field 0x10 Varies Keygroup[] Keygroups A table containing all the keygroups used in the SWDL. The first entry is usually the global Keygroup, of which most splits are part of. After Keygroups 0 or 8 - Padding? When there is an odd number of Keygroup entry, it appears there is some garbage(?) inserted here to make the next chunk start on an offset divisible by 16. Keygroup A single entry in the Keygroups table. This is meant to mitigate issues with the limited polyphony of the NDS. Basically, this is used to tell what sets of instruments gets to play notes over the others. (Wikipedia has an excellent article on synthesizer polyphony here: https://en.wikipedia.org/wiki/Polyphony_and_monophony_in_instruments ) The polyphony parameter allows to set how many simultaneous voices a member of the keygroup may use. The vc high and vc low parameters defines the range out of all the available voice channels that members of the group may use. The priority parameter is meant to tell which keygroups has priority over using a voice channel. For example, lets say that a split "splitA" is a member of a priority 1 keygroup, and another split "splitB" of a priority 15 keygroups, and there is no voice channel available to use as they're all being used. SplitB needs to play a note, but splitA is currently playing one. Then SplitA will be cut abruptly, and its voice channel will be reassigned to splitB so it can play its note! Keygroup 0 is the global keygroup everything uses by default, and its always there. Total Length 8 bytes Offset Length Type Name Description 0x00 2 uint16 ID Index/ID of the keygroup. 0x02 1 uint8 poly Polyphony. AKA max number of simultaneous notes played. 0 to 15. -1 means disabled. 0x03 1 uint8 priority Priority over the assignment of a voice channel for the members of this group. A value from 0 to possibly 99. Default is 8. Lower values means lower priority, while higher means higher priority. 0x04 1 uint8 vclow Lowest voice channel of the range this group may use. Usually between 0 to 15. 0x05 1 uint8 vchigh Highest voice channel this group may use. Usually between 0 to 15. 0x06 1 uint8 unk50 Unknown. 0x07 1 uint8 unk51 Unknown. pcmd Chunk The pcmd chunk contains the sample data for every samples. Each samples is stored one after the other, regardless of the sample type or sample rate, without headers or delimiters of any sort! Each samples is located by using the sample entries in the wavi chunk. Offset Length Type Name Description 0x00 4 char[4] label "pcmd" {0x70, 0x63, 0x6D, 0x64} 0x04 2 uint16 unk1 Always 0. 0x06 2 uint16 unk2 Always 0x1504. 0x08 4 uint32 chunkbeg Seems to always be 0x10, possibly the start of the chunk data. 0x0C 4 uint32 chunklen Length of the chunk data. Begins counting right after this field 0x10 Varies - SampleDataBlob Contains the sample data for all the samples used in the SWDL. The data can be stored in any of the compatible formats: The NDS's 4 bits IMA ADPCM encoding (Same as official IMA ADPCM. Even uses the same tables. only the way sample values are clamped when converting back to PCM16 differ a tiny bit, which might not even be noticeable.) raw PCM16 samples. raw PCM8 samples. Possibly PSG or something else ? Note About ADPCM: Each ADPCM sample begins with the initial value of the "predictor" on 16 bits. Then the "step index", also on 16 bits. Afterwards, comes the actual sample data. The ADPCM preamble is included in the value of the "loopbeg" parameter of the sample! Eod Chunk This chunk marks the the end of the SWDL container/file. There is nothing past the chunk header! Total Length 16 bytes Offset Length Type Name Description 0x00 4 char[4] label "eod\20" {0x65, 0x6F, 0x64, 0x20} 0x04 2 uint16 unk1 Always 0. 0x06 2 uint16 unk2 Always 0x1504. 0x08 4 uint32 chunkbeg Seems to always be 0x10, possibly the start of the chunk data. 0x0C 4 uint32 chunklen Length of the chunk data. Begins counting right after this field. Always 0 for eod chunk! Volume Envelopes Here is some more information on how volume envelopes are parsed. In PMD2 Explorers of Sky, the north american version, here are the routines at runtime in memory that handle parsing the envelopes: 0x02074E0C : Code that picks an envelope's starting phase. 0x02074F54 : Code that handles updating the envelope's state. 0x02074D58 : Code handling lerping the volume values for any of the envelope parameters indicating a duration. The parameters indicating a duration in the envelopes are used as indices in one of 2 lookup tables to get an actual duration. If the "envmult" parameter of the envelope is not 0, the 16 bits lookup table is used, while if its 0, the 32 bits lookup table is used. Here's a heavily commented and re-organized assembly snippet to demonstrate how the duration lookup tables are used, and how a single parameter is parsed: Fun_02074D58( R0(SplitEnvelopeAddress), R1(TargetVolume), R2(EnvelopeParam) ) { 02074D58 E92D4038 push r3-r5,r14 02074D5C E1A05000 mov r5,r0 02074D60 E1A04001 mov r4,r1 02074D64 E352007F cmp r2,7Fh //See if the envelope parameter is == 0x7F 02074D68 1A000004 bne 02074D80 if( EnvelopeParam != 0x7F ) { 02074D80 E5C5401D strb r4,[r5,1Dh] //Put the TargetVolume here 02074D84 E5D53001 ldrb r3,[r5,1h] //Load envmult 02074D88 E3530000 cmp r3,0h 02074D8C 1A000007 bne 02074DB0 if( envmult != 0 ) { 02074DB0 E59F0050 ldr r0,=20B0F50h //16 bits lookup table for durations 02074DB4 E1A01082 mov r1,r2,lsl 1h //R1 = EnvelopeParam << 1 (Basically, multiply by 2 the envelope param, so that we get a byte offset in a 16bits integer array) 02074DB8 E19020B1 ldrh r2,[r0,r1] //Get the duration from the table 02074DBC E59F1040 ldr r1,=22B7330h //That's the static address of DSE driver's memory 02074DC0 E3A00FFA mov r0,3E8h 02074DC4 E0020293 mul r2,r3,r2 //We multiply the duration with envmult (the envelope duration multiplier) 02074DC8 E0000092 mul r0,r2,r0 //We multiply our duration by 1000 02074DCC E1D112F8 ldrsh r1,[r1,28h] //This address always contains the value 10000 02074DD0 EB006C33 bl 0208FEA4 //(Division signed R0 = R0 / R1) //Continues to 02074DD4.. } else { 02074D90 E59F0068 ldr r0,=20B1050h //32 bits lookup table for durations 02074D94 E59F1068 ldr r1,=22B7330h //That's the static address of DSE driver's memory 02074D98 E7902102 ldr r2,[r0,r2,lsl 2h] //Multiply the EnvelopeParam by 4( EnvelopeParam << 2 ) to get the byte offset in a int32 array 02074D9C E3A00FFA mov r0,3E8h 02074DA0 E0000092 mul r0,r2,r0 //We multiply our duration by 1000 02074DA4 E1D112F8 ldrsh r1,[r1,28h] //This address always contains the value 10000 02074DA8 EB006CC0 bl 020900B0 //(Unsigned division R0 = R0 / R1) 02074DAC EA000008 b 02074DD4 //Continues to 02074DD4.. } 02074DD4 E5850018 str r0,[r5,18h] //Put EnvelopePhaseTimeLeft here 02074DD8 E5951018 ldr r1,[r5,18h] //Read it back into R1 02074DDC E3510000 cmp r1,0h if( EnvelopePhaseTimeLeft == 0 ) { 02074DE0 03A00000 moveq r0,0h 02074DE4 05850014 streq r0,[r5,14h] //Set VolumeIncrement to 0 02074DE8 08BD8038 popeq r3-r5,r15 //Return } 02074DEC E5950010 ldr r0,[r5,10h] //Load EnvPhaseCurrentVolume 02074DF0 E0600B84 rsb r0,r0,r4,lsl 17h // (TargetVolume << 0x17) - EnvPhaseCurrentVolume, or (2^23 * TargetVolume) - EnvPhaseCurrentVolume 02074DF4 EB006C2A bl 0208FEA4 //(Division signed R0 = R0 / R1) Divide volume difference between TargetVolume and EnvPhaseCurrentVolume by the EnvelopePhaseTimeLeft 02074DF8 E5850014 str r0,[r5,14h] //Set VolumeIncrement 02074DFC E8BD8038 pop r3-r5,r15 } else { //Envelope param disabled 02074D6C E3A00000 mov r0,0h 02074D70 E5850014 str r0,[r5,14h] //Set the VolumeIncrement to 0 02074D74 E2400106 sub r0,r0,80000001h //This basically puts 0x7FFFFFFF into R0 (Aka the maximum signed, positive value for a signed 16bits integer ) 02074D78 E5850018 str r0,[r5,18h] //Put 0x7FFFFFFF as EnvelopePhaseTimeLeft 02074D7C E8BD8038 pop r3-r5,r15 } } Duration Lookup Tables The durations in the tables are in milliseconds, conveniently! 16 bits table located at 0x020B0F50: const int16_t Lookup_Table_20B0F50 [128] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0023, 0x0028, 0x002D, 0x0033, 0x0039, 0x0040, 0x0048, 0x0050, 0x0058, 0x0062, 0x006D, 0x0078, 0x0083, 0x0090, 0x009E, 0x00AC, 0x00BC, 0x00CC, 0x00DE, 0x00F0, 0x0104, 0x0119, 0x012F, 0x0147, 0x0160, 0x017A, 0x0196, 0x01B3, 0x01D2, 0x01F2, 0x0214, 0x0238, 0x025E, 0x0285, 0x02AE, 0x02D9, 0x0307, 0x0336, 0x0367, 0x039B, 0x03D1, 0x0406, 0x0442, 0x047E, 0x04C4, 0x0500, 0x0546, 0x058C, 0x0622, 0x0672, 0x06CC, 0x071C, 0x0776, 0x07DA, 0x0834, 0x0898, 0x0906, 0x096A, 0x09D8, 0x0A50, 0x0ABE, 0x0B40, 0x0BB8, 0x0C3A, 0x0CBC, 0x0D48, 0x0DDE, 0x0E6A, 0x0F00, 0x0FA0, 0x1040, 0x10EA, 0x1194, 0x123E, 0x12F2, 0x13B0, 0x146E, 0x1536, 0x15FE, 0x16D0, 0x17A2, 0x187E, 0x195A, 0x1A40, 0x1B30, 0x1C20, 0x1D1A, 0x1E1E, 0x1F22, 0x2030, 0x2148, 0x2260, 0x2382, 0x2710, 0x7FFF }; 32 bits table located at 0x20B1050: const int32_t Lookup_Table_20B1050 [128] = { 0x00000000, 0x00000004, 0x00000007, 0x0000000A, 0x0000000F, 0x00000015, 0x0000001C, 0x00000024, 0x0000002E, 0x0000003A, 0x00000048, 0x00000057, 0x00000068, 0x0000007B, 0x00000091, 0x000000A8, 0x00000185, 0x000001BE, 0x000001FC, 0x0000023F, 0x00000288, 0x000002D6, 0x0000032A, 0x00000385, 0x000003E5, 0x0000044C, 0x000004BA, 0x0000052E, 0x000005A9, 0x0000062C, 0x000006B5, 0x00000746, 0x00000BCF, 0x00000CC0, 0x00000DBD, 0x00000EC6, 0x00000FDC, 0x000010FF, 0x0000122F, 0x0000136C, 0x000014B6, 0x0000160F, 0x00001775, 0x000018EA, 0x00001A6D, 0x00001BFF, 0x00001DA0, 0x00001F51, 0x00002C16, 0x00002E80, 0x00003100, 0x00003395, 0x00003641, 0x00003902, 0x00003BDB, 0x00003ECA, 0x000041D0, 0x000044EE, 0x00004824, 0x00004B73, 0x00004ED9, 0x00005259, 0x000055F2, 0x000059A4, 0x000074CC, 0x000079AB, 0x00007EAC, 0x000083CE, 0x00008911, 0x00008E77, 0x000093FF, 0x000099AA, 0x00009F78, 0x0000A56A, 0x0000AB80, 0x0000B1BB, 0x0000B81A, 0x0000BE9E, 0x0000C547, 0x0000CC17, 0x0000FD42, 0x000105CB, 0x00010E82, 0x00011768, 0x0001207E, 0x000129C4, 0x0001333B, 0x00013CE2, 0x000146BB, 0x000150C5, 0x00015B02, 0x00016572, 0x00017015, 0x00017AEB, 0x000185F5, 0x00019133, 0x0001E16D, 0x0001EF07, 0x0001FCE0, 0x00020AF7, 0x0002194F, 0x000227E6, 0x000236BE, 0x000245D7, 0x00025532, 0x000264CF, 0x000274AE, 0x000284D0, 0x00029536, 0x0002A5E0, 0x0002B6CE, 0x0002C802, 0x000341B0, 0x000355F8, 0x00036A90, 0x00037F79, 0x000394B4, 0x0003AA41, 0x0003C021, 0x0003D654, 0x0003ECDA, 0x000403B5, 0x00041AE5, 0x0004326A, 0x00044A45, 0x00046277, 0x00047B00, 0x7FFFFFFF };
×
×
  • Create New...