RAM map slice 1, generated state accessors, peek/poke by name #18
Loading…
Reference in a new issue
No description provided.
Delete branch "ram-map"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RAM map slice 1, generated state accessors, and peek/poke by RAM-map name.
Content
re/ram_map.toml: the reviewed draft (187 vars, 4 structs, regions, RAM code images), evidence kept. Format, generator rules and decisions are indocs/ram_map.md.$AB, so a new game is seeded too. With a blank SRAM,$307FF1= 0, so$1F6Dand$1FA1-$1FA5hold$0D(power-on seeds 0, 1, 2, 5; US and JP).<subsystem>_,saveusesgame_),bitsNgives bit accessors,text6is a 6-element byte value.$0630-$0632timing bytes), #16 (width doubts), #17 (documented entries, JP unverified entries).tools/gen_state.pygeneratescore/state/state_gen.h(static inline get/set accessors: 8/16/24/32-bit, signed, arrays, record fields, elements, bit sets, index constants,STATE_BY_VERSIONwhen US/JP addresses differ,STATE_CHECKasserts in debug builds) andcore/state/state_gen.c(name table). The generated files are committed, so a build needs no Python. ctesttools.gen_state.checkfails when they drift from the map. Storagestructis refused until it is implemented.core/state/state_battle.his removed:battle_random.cuses the generatedbattle_rng_index.ff6_debug_var_find(core, "characters[2].hp", &var),ff6_debug_var_count/name. Drive server:peek <name>returnsaddr,sizeandvalue=decoded with the element width;poke <name> <hex>[,...]. Raw offset access is unchanged. The MCP toolsff6_peek/ff6_pokeacceptname(andvalue).tools/draft.pyandtools/ff6sym.pycome from the workspace prototypes. They take paths from options or fromenvironment.toml(tools/ff6env.py). The draft printer prints RAM-map names for WRAM operands (rd8(g, vblank_flag),party_pos.y) and also accepts plain labels (battle Rand).tools/ram_map_check.pyis the map verifier, moved from the workspace.Validation
ctestrelease (all, slow included): 13/13 passed (rom.ports 307 s/308 s). Debug--fast: 10/10 passed.ff6cli --frames 9500 --input tests/inputs/newgame_first_battle.txt --port all=shadow: battle/Rand 13/13 US, 16/16 JP, 0 mismatch (unchanged).tools/tests/test_gen_state.py7/7.tools/tests/test_disasm_tools.pyall OK (skips without the disassembly).tools/mcp/tests/test_ff6_drive.pyALL OK, with the new name peek/poke checks.tools/ram_map_check.py: 187 vars, 0 errors, 0 warnings, 158 JP listing checks passed.Fixes #7
🤖 Generated with Claude Code
core/state/state_gen.{h,c} generated from re/ram_map.toml (wram storage, debug-build index checks); ff6_debug_var_find resolves name[i].field[j]. unit.state tests the accessors and the lookup on a fake WRAM. refs #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>