diff options
| author | YamaArashi <shadow962@live.com> | 2016-12-31 17:23:54 -0800 |
|---|---|---|
| committer | YamaArashi <shadow962@live.com> | 2016-12-31 17:23:54 -0800 |
| commit | bf67f7174d8e3f1348c786618ee5a3a076d1eff8 (patch) | |
| tree | 41dfcd420ce30d4b077d2055e096ea40e4a229a5 /engine/overworld/wild_mons.asm | |
| parent | use hardware constants in pic.asm (diff) | |
| download | pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.tar.gz pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.tar.xz pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.zip | |
split code out of main.asm
Diffstat (limited to 'engine/overworld/wild_mons.asm')
| -rw-r--r-- | engine/overworld/wild_mons.asm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/engine/overworld/wild_mons.asm b/engine/overworld/wild_mons.asm new file mode 100644 index 00000000..6444ab7e --- /dev/null +++ b/engine/overworld/wild_mons.asm @@ -0,0 +1,33 @@ +LoadWildData: + ld hl,WildDataPointers + ld a,[wCurMap] + + ; get wild data for current map + ld c,a + ld b,0 + add hl,bc + add hl,bc + ld a,[hli] + ld h,[hl] + ld l,a ; hl now points to wild data for current map + ld a,[hli] + ld [wGrassRate],a + and a + jr z,.NoGrassData ; if no grass data, skip to surfing data + push hl + ld de,wGrassMons ; otherwise, load grass data + ld bc,$0014 + call CopyData + pop hl + ld bc,$0014 + add hl,bc +.NoGrassData + ld a,[hli] + ld [wWaterRate],a + and a + ret z ; if no water data, we're done + ld de,wWaterMons ; otherwise, load surfing data + ld bc,$0014 + jp CopyData + +INCLUDE "data/wild_mons.asm" |
