Bryan Bishop 6d5360aa60 clarify a sentence
original-commit-id: b6122070d921f381df61b4caf8e985c98361b75a
2012-05-02 01:40:23 -05:00
2012-04-26 00:31:53 -05:00
2012-04-26 16:58:20 -05:00
2012-05-02 01:40:23 -05:00

Pokémon Crystal utilities and extras

crystal.py parses the ROM into classes and objects. It prmarily parses map headers, "second" map headers, map event headers, map script headers, map triggers, map "callbacks", map blockdata, xy triggers, warps, people-events, texts and scripts. The purpose of the file is to parse the ROM into python and then spit it back out with the global to_asm() method.

Simple ASM generation example

Note: throughout these examples it is possible to use reload(crystal) instead of import crystal. Once the module is loaded a first time, it must be reloaded if the file changes and the updates are desired.

import crystal

# parse the ROM
crystal.run_main()

# create a new dump
asm = crystal.Asm()

# insert the first 10 maps
x = 10
asm.insert_multiple_with_dependencies(crystal.all_map_headers[:x])

# dump to extras/output.txt
asm.dump()

After running those lines, cp extras/output.asm main.asm and run git diff main.asm to confirm that changes to main.asm have occurred. To test whether or not the newly inserted ASM compiles into the same ROM, use: make clean && make. This will complain very loudly if something is broken.

Description
Tools for building and disassembling Pokémon Red and Pokémon Crystal
Readme 2.8 MiB
Languages
Python 96.9%
Assembly 2.8%
C 0.3%