diff options
Diffstat (limited to 'engine/spawn_points.asm')
-rw-r--r-- | engine/spawn_points.asm | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index ce96b0ce5..eb42ab0d1 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -18,7 +18,7 @@ ENDM spawn VIRIDIAN, VIRIDIAN_CITY, 23, 26 spawn PEWTER, PEWTER_CITY, 13, 26 spawn CERULEAN, CERULEAN_CITY, 19, 22 - spawn ROCK_TUNNEL, ROUTE_10A, 11, 2 + spawn ROCK_TUNNEL, ROUTE_10_NORTH, 11, 2 spawn VERMILION, VERMILION_CITY, 9, 6 spawn LAVENDER, LAVENDER_TOWN, 5, 6 spawn SAFFRON, SAFFRON_CITY, 9, 30 @@ -41,22 +41,24 @@ ENDM spawn BLACKTHORN, BLACKTHORN_CITY, 21, 30 spawn MT_SILVER, SILVER_CAVE_OUTSIDE, 23, 20 spawn FAST_SHIP, FAST_SHIP_CABINS_SW_SSW_NW, 6, 2 +NUM_SPAWNS EQU const_value +const_value = -1 + spawn N_A, N_A, -1, -1 - db -1, -1, -1, -1 - - const NUM_SPAWNS LoadSpawnPoint: ; 1531f + ; loads the spawn point in wd001 push hl push de ld a, [wd001] - cp -1 - jr z, .asm_15341 + cp SPAWN_N_A + jr z, .spawn_n_a ld l, a ld h, 0 - add hl, hl - add hl, hl +rept 2 ; multiply hl by 4 + add hl,hl +endr ld de, SpawnPoints add hl, de ld a, [hli] @@ -67,7 +69,7 @@ LoadSpawnPoint: ; 1531f ld [XCoord], a ld a, [hli] ld [YCoord], a -.asm_15341 +.spawn_n_a pop de pop hl ret @@ -75,32 +77,33 @@ LoadSpawnPoint: ; 1531f IsSpawnPoint: ; 15344 +; Checks if the map loaded in de is a spawn point. Returns carry if it's a spawn point. ld hl, SpawnPoints ld c, 0 -.asm_15349 +.loop ld a, [hl] - cp -1 - jr z, .asm_1535f + cp SPAWN_N_A + jr z, .nope cp d - jr nz, .asm_15356 + jr nz, .next inc hl ld a, [hld] cp e - jr z, .asm_15361 + jr z, .yes -.asm_15356 +.next push bc ld bc, 4 add hl, bc pop bc inc c - jr .asm_15349 + jr .loop -.asm_1535f +.nope and a ret -.asm_15361 +.yes scf ret ; 15363 |