Move more code from home.asm into home/

This commit is contained in:
Rangi
2018-04-05 00:35:14 -04:00
parent 1e1bbbbf8c
commit 99df17d571
18 changed files with 1349 additions and 1361 deletions

33
home/region.asm Normal file
View File

@@ -0,0 +1,33 @@
IsInJohto:: ; 2f17
; Return 0 if the player is in Johto, and 1 in Kanto.
ld a, [wMapGroup]
ld b, a
ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp FAST_SHIP
jr z, .Johto
cp SPECIAL_MAP
jr nz, .CheckRegion
ld a, [wBackupMapGroup]
ld b, a
ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
.CheckRegion:
cp KANTO_LANDMARK
jr nc, .Kanto
.Johto:
xor a
ret
.Kanto:
ld a, 1
ret
; 2f3e