jep-hack/home/region.asm
Llinos Evans a8546f60c9 Nihon + Silent Hills Groundwork
Currently doesn't build due to a weird error

```
rgbasm -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1  -o data/maps/map_data.o data/maps/map_data.asm
error: data/maps/map_data.asm(3) -> data/maps/maps.asm(544) -> macros/asserts.as
m::assert_table_length(14):
    Expected constant expression: 'NUM_SILENT_HILLS_MAP' is not constant at asse
mbly time
error: data/maps/map_data.asm(3) -> data/maps/maps.asm(544) -> macros/asserts.as
m::assert_table_length(16):
    Assertion failed: MapGroup_SilentHills: expected 0 entries, each 9 bytes
error: Assembly aborted (2 errors)!
make: *** [Makefile:119: data/maps/map_data.o] Error 1
```
2023-10-20 06:23:47 +01:00

39 lines
513 B
NASM

IsInJohto::
; 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 LANDMARK_FAST_SHIP
jr z, .Johto
cp LANDMARK_SPECIAL
jr nz, .CheckRegion
ld a, [wBackupMapGroup]
ld b, a
ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
.CheckRegion:
cp NIHON_LANDMARK
jr z, .Nihon
cp KANTO_LANDMARK
jr nc, .Kanto
.Johto:
xor a ; JOHTO_REGION
ret
.Kanto:
ld a, KANTO_REGION
ret
.Nihon:
ld a, NIHON_REGION
ret