From d150f7f4f49e9dda08c52199159b30ae9b4f00e8 Mon Sep 17 00:00:00 2001 From: Yoann Fievez Date: Wed, 24 Jun 2026 20:43:48 +0200 Subject: Identify `wPikachuSpawnStateFlags` and `wPikachuMapScriptFlags` bits, and `PIKAMOVEMENT_*` constants (#158) - Rename `wd471` to` wPikachuSpawnStateFlags`, with `BIT_PIKACHU_SPAWN_*` bits - Rename `wd492` to `wPikachuMapScriptFlags`, with `BIT_PIKACHU_MAP_*` bits - Introduce `PIKAMOVEMENT_*` constants for `ApplyPikachuMovementData` - Refactor `BillsHouse` scripts and Pikachu/Bill movement data --- home/map_objects.asm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'home/map_objects.asm') diff --git a/home/map_objects.asm b/home/map_objects.asm index 3b1a1f08..2c275465 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -69,12 +69,12 @@ IsItemInBag:: ret IsSurfingPikachuInParty:: -; set bit 6 of wd471 if any Pikachu with Surf is in party -; set bit 7 of wd471 if starter Pikachu is in party (with or without Surf) +; set bit 6 of wPikachuSpawnStateFlags if any Pikachu with Surf is in party +; set bit 7 of wPikachuSpawnStateFlags if starter Pikachu is in party (with or without Surf) ; also performs a bankswitch to IsStarterPikachuAliveInOurParty - ld a, [wd471] - and $3f - ld [wd471], a + ld a, [wPikachuSpawnStateFlags] + and ~((1 << BIT_PIKACHU_SPAWN_STARTER) | (1 << BIT_PIKACHU_SPAWN_SURFING)) + ld [wPikachuSpawnStateFlags], a ld hl, wPartyMon1 ld c, PARTY_LENGTH ld b, SURF @@ -98,9 +98,9 @@ IsSurfingPikachuInParty:: cp b jr nz, .noSurf .hasSurf - ld a, [wd471] - set 6, a - ld [wd471], a + ld a, [wPikachuSpawnStateFlags] + set BIT_PIKACHU_SPAWN_SURFING, a + ld [wPikachuSpawnStateFlags], a .noSurf pop hl .notPikachu @@ -118,9 +118,9 @@ IsSurfingPikachuInParty:: pop bc pop hl ret nc - ld a, [wd471] - set 7, a - ld [wd471], a + ld a, [wPikachuSpawnStateFlags] + set BIT_PIKACHU_SPAWN_STARTER, a + ld [wPikachuSpawnStateFlags], a ret DisplayPokedex:: -- cgit v1.3.1-sl0p