mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-04-03 15:40:04 -05:00
basic README to explain crystal.py
original-commit-id: 6fa7fbc357722bccbfe5d2756f1d4b6821b2e476
This commit is contained in:
parent
226a499414
commit
36e44c52ea
28
README.md
Normal file
28
README.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Pokémon Crystal utilities and extras
|
||||
==============================
|
||||
|
||||
`crystal.py` parsees 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.
|
||||
|
||||
```python
|
||||
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. Then to test whether or not the inserted ASM compiles use: `make clean && make`. This will complain very loudly if something is broken.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user