mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
split code out of main.asm
This commit is contained in:
parent
10289bf7dd
commit
bf67f7174d
22 changed files with 2671 additions and 2675 deletions
33
engine/overworld/wild_mons.asm
Normal file
33
engine/overworld/wild_mons.asm
Normal file
|
|
@ -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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue