From 249bad9551b1c9c29fd64bc36486eb6612427c3b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 13 Jul 2015 00:16:35 -0400 Subject: Replace EVENT_ALWAYS_THERE with -1 --- engine/spawn_points.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/spawn_points.asm') diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index ce96b0ce5..874faabd7 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 -- cgit v1.2.3 From 39524cdb766660a7bf6d60379040349652cecc04 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 15 Jul 2015 15:48:44 -0400 Subject: More enumeration of constants, more annotations of scripts. --- engine/spawn_points.asm | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'engine/spawn_points.asm') diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index 874faabd7..dba86c582 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -41,22 +41,22 @@ 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 +const_value = -1 + spawn N_A, N_A, -1, -1 - db -1, -1, -1, -1 - - const NUM_SPAWNS +NUM_SPAWNS EQU const_value 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 + add_n_times hl, hl, 2 ; multiply hl by 4 ld de, SpawnPoints add hl, de ld a, [hli] @@ -67,7 +67,7 @@ LoadSpawnPoint: ; 1531f ld [XCoord], a ld a, [hli] ld [YCoord], a -.asm_15341 +.spawn_n_a pop de pop hl ret @@ -75,32 +75,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 -- cgit v1.2.3 From 60cd04b02300c288a01a2f78a44cb39cbe6861d1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 18 Jul 2015 23:45:39 -0400 Subject: Trainer data structure and field move functions Trainer data in map scripts is now a macro-defined structure. Field move functions in main.asm are now nearly completely annotated, with local references. Trailing white space deleted. --- engine/spawn_points.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/spawn_points.asm') diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index dba86c582..09c66fa54 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -41,10 +41,10 @@ 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 -NUM_SPAWNS EQU const_value LoadSpawnPoint: ; 1531f -- cgit v1.2.3 From d9300a9becc9aa699b7191f87d8b493a93139ba2 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 20 Jul 2015 11:28:05 -0400 Subject: Fix unnecessary white space and retire add_n_times --- engine/spawn_points.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine/spawn_points.asm') diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index 09c66fa54..eb42ab0d1 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -56,7 +56,9 @@ LoadSpawnPoint: ; 1531f jr z, .spawn_n_a ld l, a ld h, 0 - add_n_times hl, hl, 2 ; multiply hl by 4 +rept 2 ; multiply hl by 4 + add hl,hl +endr ld de, SpawnPoints add hl, de ld a, [hli] -- cgit v1.2.3