From fdac1f9f80295eb4ce7c347f3e7626897a67826d Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Tue, 24 May 2016 16:02:32 -0400 Subject: Itemfinder and hidden item coords --- engine/items/itemfinder.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/items') diff --git a/engine/items/itemfinder.asm b/engine/items/itemfinder.asm index d638b0b8..7b479462 100755 --- a/engine/items/itemfinder.asm +++ b/engine/items/itemfinder.asm @@ -1,4 +1,4 @@ -HiddenItemNear: ; 7481f (1d:481f) +HiddenItemNear: ; 7405c (1d:405c) ld hl, HiddenItemCoords ld b, 0 .loop @@ -43,7 +43,7 @@ HiddenItemNear: ; 7481f (1d:481f) scf ret -Sub5ClampTo0: ; 7486b (1d:486b) +Sub5ClampTo0: ; 740a8 (1d:40a8) ; subtract 5 but clamp to 0 sub 5 cp $f0 -- cgit v1.3.1-sl0p From 2792f51d733df0d0b6ee21fec72623c2a4235e5a Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 29 May 2016 10:55:45 -0400 Subject: Another chunk of bank 3c --- constants/hide_show_constants.asm | 184 +++++++++++++++-------------- engine/bank3c.asm | 147 +++-------------------- engine/bank3f.asm | 28 ++--- engine/items/items.asm | 2 +- engine/overworld/advance_player_sprite.asm | 2 +- home.asm | 115 +----------------- home/overworld.asm | 4 +- home/pikachu.asm | 113 ++++++++++++++++++ scripts/beach_house2.asm | 33 ++++++ scripts/billshouse2.asm | 158 +++++++++++++++++++++++++ scripts/oakslab.asm | 2 +- scripts/silphco11_2.asm | 76 ++++++++++++ scripts/ssanne9_2.asm | 35 ++++++ scripts/viridianforest2.asm | 8 ++ wram.asm | 2 +- 15 files changed, 551 insertions(+), 358 deletions(-) create mode 100755 home/pikachu.asm create mode 100755 scripts/beach_house2.asm create mode 100755 scripts/billshouse2.asm create mode 100755 scripts/silphco11_2.asm create mode 100755 scripts/ssanne9_2.asm (limited to 'engine/items') diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 9481466e..ffc4ea08 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -150,96 +150,98 @@ const_value SET $7c ; idk anymore lol const HS_ROCKET_HIDEOUT_4_ITEM_3 ; 88 const HS_ROCKET_HIDEOUT_4_ITEM_4 ; 89 XXX never (de)activated? const HS_ROCKET_HIDEOUT_4_ITEM_5 ; 8A - const HS_SILPH_CO_2F_1 ; 8B - const HS_SILPH_CO_2F_2 ; 8C - const HS_SILPH_CO_2F_3 ; 8D - const HS_SILPH_CO_2F_4 ; 8E - const HS_SILPH_CO_2F_5 ; 8F - const HS_SILPH_CO_3F_1 ; 90 X - const HS_SILPH_CO_3F_2 ; 91 - const HS_SILPH_CO_3F_ITEM ; 92 - const HS_SILPH_CO_4F_1 ; 93 - const HS_SILPH_CO_4F_2 ; 94 X - const HS_SILPH_CO_4F_3 ; 95 X - const HS_SILPH_CO_4F_ITEM_1 ; 96 X - const HS_SILPH_CO_4F_ITEM_2 ; 97 - const HS_SILPH_CO_4F_ITEM_3 ; 98 - const HS_SILPH_CO_5F_1 ; 99 - const HS_SILPH_CO_5F_2 ; 9A - const HS_SILPH_CO_5F_3 ; 9B X - const HS_SILPH_CO_5F_4 ; 9C X - const HS_SILPH_CO_5F_ITEM_1 ; 9D X - const HS_SILPH_CO_5F_ITEM_2 ; 9E - const HS_SILPH_CO_5F_ITEM_3 ; 9F - const HS_SILPH_CO_6F_1 ; A0 - const HS_SILPH_CO_6F_2 ; A1 X - const HS_SILPH_CO_6F_3 ; A2 X - const HS_SILPH_CO_6F_ITEM_1 ; A3 - const HS_SILPH_CO_6F_ITEM_2 ; A4 - const HS_SILPH_CO_7F_1 ; A5 - const HS_SILPH_CO_7F_2 ; A6 - const HS_SILPH_CO_7F_3 ; A7 - const HS_SILPH_CO_7F_4 ; A8 X - const HS_SILPH_CO_7F_RIVAL ; A9 X - const HS_SILPH_CO_7F_ITEM_1 ; AA XXX sprite doesn't exist - const HS_SILPH_CO_7F_ITEM_2 ; AB - const HS_SILPH_CO_7F_8 ; AC - const HS_SILPH_CO_8F_1 ; AD - const HS_SILPH_CO_8F_2 ; AE - const HS_SILPH_CO_8F_3 ; AF - const HS_SILPH_CO_9F_1 ; B0 - const HS_SILPH_CO_9F_2 ; B1 - const HS_SILPH_CO_9F_3 ; B2 - const HS_SILPH_CO_10F_1 ; B3 XXX never (de)activated? - const HS_SILPH_CO_10F_2 ; B4 X - const HS_SILPH_CO_10F_3 ; B5 X - const HS_SILPH_CO_10F_ITEM_1 ; B6 X - const HS_SILPH_CO_10F_ITEM_2 ; B7 - const HS_SILPH_CO_10F_ITEM_3 ; B8 - const HS_SILPH_CO_11F_1 ; B9 - const HS_SILPH_CO_11F_2 ; BA XXX sprite doesn't exist - const HS_SILPH_CO_11F_3 ; BB X - const HS_MAP_F4_1 ; BC X - const HS_MANSION_2_ITEM ; BD X - const HS_MANSION_3_ITEM_1 ; BE X - const HS_MANSION_3_ITEM_2 ; BF X - const HS_MANSION_4_ITEM_1 ; C0 X - const HS_MANSION_4_ITEM_2 ; C1 X - const HS_MANSION_4_ITEM_3 ; C2 X - const HS_MANSION_4_ITEM_4 ; C3 X - const HS_MANSION_4_ITEM_5 ; C4 X - const HS_SAFARI_ZONE_EAST_ITEM_1 ; C5 X - const HS_SAFARI_ZONE_EAST_ITEM_2 ; C6 X - const HS_SAFARI_ZONE_EAST_ITEM_3 ; C7 X - const HS_SAFARI_ZONE_EAST_ITEM_4 ; C8 X - const HS_SAFARI_ZONE_NORTH_ITEM_1 ; C9 X - const HS_SAFARI_ZONE_NORTH_ITEM_2 ; CA X - const HS_SAFARI_ZONE_WEST_ITEM_1 ; CB X - const HS_SAFARI_ZONE_WEST_ITEM_2 ; CC X - const HS_SAFARI_ZONE_WEST_ITEM_3 ; CD X - const HS_SAFARI_ZONE_WEST_ITEM_4 ; CE X - const HS_SAFARI_ZONE_CENTER_ITEM ; CF X - const HS_UNKNOWN_DUNGEON_2_ITEM_1 ; D0 X - const HS_UNKNOWN_DUNGEON_2_ITEM_2 ; D1 X - const HS_UNKNOWN_DUNGEON_2_ITEM_3 ; D2 X - const HS_MEWTWO ; D3 X - const HS_UNKNOWN_DUNGEON_3_ITEM_1 ; D4 X - const HS_UNKNOWN_DUNGEON_3_ITEM_2 ; D5 X - const HS_VICTORY_ROAD_1_ITEM_1 ; D6 - const HS_VICTORY_ROAD_1_ITEM_2 ; D7 - const HS_CHAMPIONS_ROOM_OAK ; D8 + +const_value SET $8d + const HS_SILPH_CO_2F_1 ; 8D + const HS_SILPH_CO_2F_2 ; 8E + const HS_SILPH_CO_2F_3 ; 8F + const HS_SILPH_CO_2F_4 ; 90 X + const HS_SILPH_CO_2F_5 ; 91 + const HS_SILPH_CO_3F_1 ; 92 + const HS_SILPH_CO_3F_2 ; 93 + const HS_SILPH_CO_3F_ITEM ; 94 X + const HS_SILPH_CO_4F_1 ; 95 X + const HS_SILPH_CO_4F_2 ; 96 X + const HS_SILPH_CO_4F_3 ; 97 + const HS_SILPH_CO_4F_ITEM_1 ; 98 + const HS_SILPH_CO_4F_ITEM_2 ; 99 + const HS_SILPH_CO_4F_ITEM_3 ; 9A + const HS_SILPH_CO_5F_1 ; 9B X + const HS_SILPH_CO_5F_2 ; 9C X + const HS_SILPH_CO_5F_3 ; 9D X + const HS_SILPH_CO_5F_4 ; 9E + const HS_SILPH_CO_5F_ITEM_1 ; 9F + const HS_SILPH_CO_5F_ITEM_2 ; A0 + const HS_SILPH_CO_5F_ITEM_3 ; A1 X + const HS_SILPH_CO_6F_1 ; A2 X + const HS_SILPH_CO_6F_2 ; A3 + const HS_SILPH_CO_6F_3 ; A4 + const HS_SILPH_CO_6F_ITEM_1 ; A5 + const HS_SILPH_CO_6F_ITEM_2 ; A6 + const HS_SILPH_CO_7F_1 ; A7 + const HS_SILPH_CO_7F_2 ; A8 X + const HS_SILPH_CO_7F_3 ; A9 X + const HS_SILPH_CO_7F_4 ; AA XXX sprite doesn't exist + const HS_SILPH_CO_7F_RIVAL ; AB + const HS_SILPH_CO_7F_ITEM_1 ; AC + const HS_SILPH_CO_7F_ITEM_2 ; AD + const HS_SILPH_CO_7F_8 ; AE + const HS_SILPH_CO_8F_1 ; AF + const HS_SILPH_CO_8F_2 ; B0 + const HS_SILPH_CO_8F_3 ; B1 + const HS_SILPH_CO_9F_1 ; B2 + const HS_SILPH_CO_9F_2 ; B3 XXX never (de)activated? + const HS_SILPH_CO_9F_3 ; B4 X + const HS_SILPH_CO_10F_1 ; B5 X + const HS_SILPH_CO_10F_2 ; B6 X + const HS_SILPH_CO_10F_3 ; B7 + const HS_SILPH_CO_10F_ITEM_1 ; B8 + const HS_SILPH_CO_10F_ITEM_2 ; B9 + const HS_SILPH_CO_10F_ITEM_3 ; BA XXX sprite doesn't exist + const HS_SILPH_CO_11F_1 ; BB X + const HS_SILPH_CO_11F_2 ; BC X + const HS_SILPH_CO_11F_3 ; BD X + const HS_MAP_F4_1 ; BE X + const HS_MANSION_2_ITEM ; BF X + const HS_MANSION_3_ITEM_1 ; C0 X + const HS_MANSION_3_ITEM_2 ; C1 X + const HS_MANSION_4_ITEM_1 ; C2 X + const HS_MANSION_4_ITEM_2 ; C3 X + const HS_MANSION_4_ITEM_3 ; C4 X + const HS_MANSION_4_ITEM_4 ; C5 X + const HS_MANSION_4_ITEM_5 ; C6 X + const HS_SAFARI_ZONE_EAST_ITEM_1 ; C7 X + const HS_SAFARI_ZONE_EAST_ITEM_2 ; C8 X + const HS_SAFARI_ZONE_EAST_ITEM_3 ; C9 X + const HS_SAFARI_ZONE_EAST_ITEM_4 ; CA X + const HS_SAFARI_ZONE_NORTH_ITEM_1 ; CB X + const HS_SAFARI_ZONE_NORTH_ITEM_2 ; CC X + const HS_SAFARI_ZONE_WEST_ITEM_1 ; CD X + const HS_SAFARI_ZONE_WEST_ITEM_2 ; CE X + const HS_SAFARI_ZONE_WEST_ITEM_3 ; CF X + const HS_SAFARI_ZONE_WEST_ITEM_4 ; D0 X + const HS_SAFARI_ZONE_CENTER_ITEM ; D1 X + const HS_UNKNOWN_DUNGEON_2_ITEM_1 ; D2 X + const HS_UNKNOWN_DUNGEON_2_ITEM_2 ; D3 X + const HS_UNKNOWN_DUNGEON_2_ITEM_3 ; D4 X + const HS_MEWTWO ; D5 X + const HS_UNKNOWN_DUNGEON_3_ITEM_1 ; D6 + const HS_UNKNOWN_DUNGEON_3_ITEM_2 ; D7 + const HS_VICTORY_ROAD_1_ITEM_1 ; D8 + const HS_VICTORY_ROAD_1_ITEM_2 ; D9 + const HS_CHAMPIONS_ROOM_OAK ; DA const_value SET $df - const HS_SEAFOAM_ISLANDS_1_BOULDER_1 ; D9 - const HS_SEAFOAM_ISLANDS_1_BOULDER_2 ; DA - const HS_SEAFOAM_ISLANDS_2_BOULDER_1 ; DB - const HS_SEAFOAM_ISLANDS_2_BOULDER_2 ; DC - const HS_SEAFOAM_ISLANDS_3_BOULDER_1 ; DD - const HS_SEAFOAM_ISLANDS_3_BOULDER_2 ; DE - const HS_SEAFOAM_ISLANDS_4_BOULDER_1 ; DF - const HS_SEAFOAM_ISLANDS_4_BOULDER_2 ; E0 - const HS_SEAFOAM_ISLANDS_4_BOULDER_3 ; E1 - const HS_SEAFOAM_ISLANDS_4_BOULDER_4 ; E2 - const HS_SEAFOAM_ISLANDS_5_BOULDER_1 ; E3 X - const HS_SEAFOAM_ISLANDS_5_BOULDER_2 ; E4 - const HS_ARTICUNO ; E5 + const HS_SEAFOAM_ISLANDS_1_BOULDER_1 ; DF + const HS_SEAFOAM_ISLANDS_1_BOULDER_2 ; E0 + const HS_SEAFOAM_ISLANDS_2_BOULDER_1 ; E1 + const HS_SEAFOAM_ISLANDS_2_BOULDER_2 ; E2 + const HS_SEAFOAM_ISLANDS_3_BOULDER_1 ; E3 + const HS_SEAFOAM_ISLANDS_3_BOULDER_2 ; E4 + const HS_SEAFOAM_ISLANDS_4_BOULDER_1 ; E5 + const HS_SEAFOAM_ISLANDS_4_BOULDER_2 ; E6 + const HS_SEAFOAM_ISLANDS_4_BOULDER_3 ; E7 + const HS_SEAFOAM_ISLANDS_4_BOULDER_4 ; E8 + const HS_SEAFOAM_ISLANDS_5_BOULDER_1 ; E9 + const HS_SEAFOAM_ISLANDS_5_BOULDER_2 ; EA + const HS_ARTICUNO ; EB diff --git a/engine/bank3c.asm b/engine/bank3c.asm index 8158d56f..01c3486b 100644 --- a/engine/bank3c.asm +++ b/engine/bank3c.asm @@ -95,12 +95,12 @@ PikachuCriesPointerTable: ; f008e (3c:408e) pikacry_def PikachuCry2 ; 21:491a pikacry_def PikachuCry3 ; 21:4fdc pikacry_def PikachuCry4 ; 21:59ee - + ; bank 22 pikacry_def PikachuCry5 ; 22:4000 pikacry_def PikachuCry6 ; 22:5042 pikacry_def PikachuCry7 ; 22:6254 - + ; bank 23 pikacry_def PikachuCry8 ; 23:4000 pikacry_def PikachuCry9 ; 23:50ca @@ -110,11 +110,11 @@ PikachuCriesPointerTable: ; f008e (3c:408e) pikacry_def PikachuCry11 ; 24:4000 pikacry_def PikachuCry12 ; 24:4722 pikacry_def PikachuCry13 ; 24:54a4 - + ; bank 25 pikacry_def PikachuCry14 ; 25:4000 pikacry_def PikachuCry15 ; 25:589a - + ; banks 31-34, in no particular order pikacry_def PikachuCry16 ; 31:4000 @@ -128,19 +128,19 @@ PikachuCriesPointerTable: ; f008e (3c:408e) pikacry_def PikachuCry24 ; 33:5632 pikacry_def PikachuCry25 ; 34:573c pikacry_def PikachuCry26 ; 33:725c - + ; bank 35 pikacry_def PikachuCry27 ; 35:4000 pikacry_def PikachuCry28 ; 35:4b5a pikacry_def PikachuCry29 ; 35:5da4 pikacry_def PikachuCry30 ; 35:69ce pikacry_def PikachuCry31 ; 35:6e80 - + ; bank 36 pikacry_def PikachuCry32 ; 36:4000 pikacry_def PikachuCry33 ; 36:458a pikacry_def PikachuCry34 ; 36:523c - + ; bank 37 pikacry_def PikachuCry35 ; 37:4000 pikacry_def PikachuCry36 ; 37:522a @@ -203,7 +203,7 @@ ResetStatusAndHalveMoneyOnBlackout:: ; f0274 (3c:4274) ld a, %11111111 ld [wJoyIgnore], a predef_jump HealParty - + Func_f02da:: ; f02da (3c:42da) ld a, [wCurMap] cp VERMILION_GYM ; ??? new thing about verm gym? @@ -262,7 +262,7 @@ BeachHouse_Block:: ; f0914 (3c:4914) Func_f0a54:: ; f0a54 (3c:4a54) ret - + Func_f0a55:: ; f0a55 (3c:4a55) ld hl, Pointer_f0a76 ; 3c:4a76 .loop @@ -359,130 +359,11 @@ BeachHouseBlockdata: ; f2388 (3c:6388) INCBIN "maps/beach_house.blk" INCLUDE "data/mapObjects/beach_house.asm" -Func_f23d0: ; f23d0 - call SaveScreenTilesToBuffer2 - xor a - ld [wUpdateSpritesEnabled], a - ld hl, wd730 - set 6, [hl] - callab Func_e8c5c - ld hl, wd730 - res 6, [hl] - call GBPalWhiteOutWithDelay3 - call ReloadTilesetTilePatterns - call RestoreScreenTilesAndReloadTilePatterns - call LoadScreenTilesFromBuffer2 - call Delay3 - call GBPalNormal - ld hl, Text_f2412 - ld a, [hOaksAideResult] - and a - jr nz, .asm_f2406 - ld hl, Text_f240c -.asm_f2406 - call PrintText - jp TextScriptEnd - -Text_f240c: - TX_FAR _BeachHousePrinterText5 - TX_SFX_ITEM2 - db "@" - -Text_f2412: - TX_FAR _BeachHousePrinterText6 - TX_SFX_ITEM2 - db "@" - -Func_f2418: - ld hl, BillsHouseText_f243b - call PrintText - call YesNoChoice - ld a, [wCurrentMenuItem] - and a - jr nz, .asm_f2433 -.asm_f2427 - ld hl, BillsHouseText_f2440 - call PrintText - ld a, $2 - ld [W_BILLSHOUSECURSCRIPT], a - ret - -.asm_f2433 - ld hl, BillsHouseText_f2445 - call PrintText - jr .asm_f2427 - -BillsHouseText_f243b: - TX_FAR _BillsHouseText_1e865 - db "@" - -BillsHouseText_f2440: - TX_FAR _BillsHouseText_1e86a - db "@" - -BillsHouseText_f2445: - TX_FAR _BillsHouseText_1e86f - db "@" - -Func_f244a: - CheckEvent EVENT_GOT_SS_TICKET - jr nz, .asm_f247e - ld hl, BillsHouseText_f248c - call PrintText - lb bc, S_S_TICKET, 1 - call GiveItem - jr nc, .asm_f2485 - ld hl, BillsHouseText_f2491 - call PrintText - SetEvent EVENT_GOT_SS_TICKET - ld a, HS_CERULEAN_GUARD_1 - ld [wMissableObjectIndex], a - predef ShowObject - ld a, HS_CERULEAN_GUARD_2 - ld [wMissableObjectIndex], a - predef HideObject -.asm_f247e - ld hl, BillsHouseText_f249d - call PrintText - ret - -.asm_f2485 - ld hl, BillsHouseText_f2498 - call PrintText - ret - -BillsHouseText_f248c: - TX_FAR _BillThankYouText - db "@" - -BillsHouseText_f2491: - TX_FAR _SSTicketReceivedText - TX_SFX_KEY_ITEM - TX_BUTTON_SOUND - db "@" - -BillsHouseText_f2498: - TX_FAR _SSTicketNoRoomText - db "@" - -BillsHouseText_f249d: - TX_FAR _BillsHouseText_1e8cb - db "@" - -Func_f24a2: - ld hl, BillsHouseText_f24a9 - call PrintText - ret - -BillsHouseText_f24a9: - TX_FAR _BillsHouseText_1e8da - db "@" - -Func_f24ae: ; f24ae - dr $f24ae, $f2528 - +INCLUDE "scripts/beach_house2.asm" +INCLUDE "scripts/billshouse2.asm" INCLUDE "scripts/viridianforest2.asm" - dr $f2564, $f25f8 +INCLUDE "scripts/ssanne9_2.asm" +INCLUDE "scripts/silphco11_2.asm" INCLUDE "engine/overworld/hidden_objects.asm" @@ -553,7 +434,7 @@ Func_f2d0c: ld a, [hl] ld [wSecondLockTrashCanIndex + 1], a ret - + GymTrashCans3a: ; f2d31 (3c:6d31) ; First byte: number of trashcan entries ; Following four byte pairs: indices for the second trash can. diff --git a/engine/bank3f.asm b/engine/bank3f.asm index 5cab9357..c8041a3a 100644 --- a/engine/bank3f.asm +++ b/engine/bank3f.asm @@ -4,26 +4,26 @@ INCLUDE "data/map_header_banks.asm" Func_fc4dd:: ; fc4dd (3f:44dd) ; possibly to test if pika should be out? - ld a, [wd430] + ld a, [wPikachuOverworldStateFlags] bit 5, a - jr nz, .asm_fc4f8 ; 3f:44f8 - ld a, [wd430] + jr nz, .hide ; 3f:44f8 + ld a, [wPikachuOverworldStateFlags] bit 7, a - jr nz, .asm_fc4f8 + jr nz, .hide call IsStarterPikachuInOurParty - jr nc, .asm_fc4f8 + jr nc, .hide ld a, [wWalkBikeSurfState] and a - jr nz, .asm_fc4f8 + jr nz, .hide scf ret -.asm_fc4f8 +.hide and a ret Func_fc4fa:: ; fc4fa (3f:44fa) - ld hl, wd430 + ld hl, wPikachuOverworldStateFlags bit 4, [hl] res 4, [hl] jr nz, .asm_fc515 @@ -316,14 +316,14 @@ Func_fc69a:: ; fc69a (3f:469a) Func_fc6c5:: ; fc6c5 (3f:46c5) push hl - ld hl, wd430 + ld hl, wPikachuOverworldStateFlags set 2, [hl] pop hl ret Func_fc6cd:: ; fc6cd (3f:46cd) push hl - ld hl, wd430 + ld hl, wPikachuOverworldStateFlags res 2, [hl] pop hl ret @@ -944,7 +944,7 @@ Func_fca7e: ; fca7e (3f:4a7e) ret Func_fca99: ; fca99 (3f:4a99) - ld a, [wd430] + ld a, [wPikachuOverworldStateFlags] bit 3, a jr nz, .asm_fcad1 ld hl, $10e @@ -1238,10 +1238,10 @@ Func_fcc08:: ; fcc08 (3f:4c08) ret Func_fcc23: ; fcc23 (3f:4c28) - ld a, [wd430] + ld a, [wPikachuOverworldStateFlags] bit 5, a jr nz, .asm_fcc40 - ld a, [wd430] + ld a, [wPikachuOverworldStateFlags] bit 7, a jr nz, .asm_fcc40 ld a, [wd472] @@ -1288,7 +1288,7 @@ Func_fcc42: ; fcc42 (3f:4c42) ret Func_fcc64: ; fcc64 (3f:4c64) - ld hl, wd430 + ld hl, wPikachuOverworldStateFlags bit 6, [hl] jr z, .asm_fcc6e res 6, [hl] diff --git a/engine/items/items.asm b/engine/items/items.asm index aa607911..5d76c37e 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -607,7 +607,7 @@ ItemUseSurfboard: ; d725 (3:5725) call .makePlayerMoveForward ld a,$3 ld [wd431], a - ld hl,wd430 + ld hl,wPikachuOverworldStateFlags set 5,[hl] ld hl,wd730 set 7,[hl] diff --git a/engine/overworld/advance_player_sprite.asm b/engine/overworld/advance_player_sprite.asm index e02fb129..758dd558 100644 --- a/engine/overworld/advance_player_sprite.asm +++ b/engine/overworld/advance_player_sprite.asm @@ -7,7 +7,7 @@ _AdvancePlayerSprite:: ; f010c (3c:410c) dec [hl] jr nz,.afterUpdateMapCoords ; if it's the end of the animation, update the player's map coordinates - ld hl, wd430 + ld hl, wPikachuOverworldStateFlags res 5, [hl] ld a,[wYCoord] add b diff --git a/home.asm b/home.asm index fd2e1b26..5f924a40 100644 --- a/home.asm +++ b/home.asm @@ -970,120 +970,7 @@ InterlaceMergeSpriteBuffers:: ; 14c7 (0:14c7) call CopyVideoData jp PrepareRTCDataAndDisableSRAM -Func_1510:: ; 1510 (0:1510) - push hl - ld hl, wd430 - set 7, [hl] - ld hl, wSpriteStateData1 + $f2 ; pikachu data? - ld [hl], $ff - pop hl - ret - -Func_151d:: ; 151d (0:151d) - push hl - ld hl, wd430 - res 7, [hl] - pop hl - ret - -Func_1525:: ; 1525 (0:1525) - push hl - ld hl, wd430 - res 3, [hl] - pop hl - ret - -Func_152d:: ; 152d (0:152d) - push hl - ld hl, wd430 - set 3, [hl] - ld hl, wSpriteStateData1 + $f2 ; pikachu data? - ld [hl], $ff - pop hl - ret - -Func_153a:: ; 153a (0:153a) - push hl - ld hl, wd430 - set 1, [hl] - pop hl - ret - -Func_1542:: ; 1542 (0:1542) - push hl - ld hl, wd430 - res 1, [hl] - pop hl - ret - -Func_154a:: ; 154a (0:154a) - push hl - ld hl, wd430 - bit 1, [hl] - pop hl - ret - -Func_1552:: ; 1552 (0:1552) - ld a, [hl] - dec a - swap a - ld [$ff93], a - homecall Func_fc6d5 ; 3f:46d5 - ret - -Func_1568:: ; 1568 (0:1568) - ld b, $0 - ld c, a -.asm_156b - inc b - ld a, [hli] - cp $ff - jr z, .asm_1578 - cp c - jr nz, .asm_156b - dec b - dec hl - scf - ret -.asm_1578 - dec b - dec hl - and a - ret - -Func_157c:: ; 157c (0:157c) - push hl - push bc - ld a, [H_LOADEDROMBANK] - push af - ld a, [wd44a] - call BankswitchCommon - ld hl, wd44b - ld c, [hl] - inc hl - ld b, [hl] - ld a, [bc] - inc bc - ld [hl], b - dec hl - ld [hl], c - ld c, a - pop af - call BankswitchCommon - ld a, c - pop bc - pop hl - ret - -Func_159b:: ; 159b (0:159b) - ld a, [H_LOADEDROMBANK] - ld b, a - push af - callbs Func_fd2a1 - pop af - call BankswitchCommon - ret - +INCLUDE "home/pikachu.asm" ;INCLUDE "data/collision.asm" INCLUDE "home/lcdc.asm" diff --git a/home/overworld.asm b/home/overworld.asm index 1f84597d..3a9708d9 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -638,7 +638,7 @@ CheckMapConnections:: ; 05db (0:05db) ld [wCurrentTileBlockMapViewPointer + 1],a .loadNewMap ; 06ce (0:06ce) ; load the connected map that was entered - ld hl,wd430 + ld hl,wPikachuOverworldStateFlags set 4,[hl] ld a,$2 ld [wd431],a @@ -1716,7 +1716,7 @@ CollisionCheckOnWater:: ; 0cca (0:0cca) .stopSurfing ; based game freak ld a,$3 ld [wd431],a - ld hl,wd430 + ld hl,wPikachuOverworldStateFlags set 5,[hl] xor a ld [wWalkBikeSurfState],a diff --git a/home/pikachu.asm b/home/pikachu.asm new file mode 100755 index 00000000..5239873c --- /dev/null +++ b/home/pikachu.asm @@ -0,0 +1,113 @@ +Func_1510:: ; 1510 (0:1510) + push hl + ld hl, wPikachuOverworldStateFlags + set 7, [hl] + ld hl, wSpriteStateData1 + $f2 ; pikachu data? + ld [hl], $ff + pop hl + ret + +Func_151d:: ; 151d (0:151d) + push hl + ld hl, wPikachuOverworldStateFlags + res 7, [hl] + pop hl + ret + +Func_1525:: ; 1525 (0:1525) + push hl + ld hl, wPikachuOverworldStateFlags + res 3, [hl] + pop hl + ret + +Func_152d:: ; 152d (0:152d) + push hl + ld hl, wPikachuOverworldStateFlags + set 3, [hl] + ld hl, wSpriteStateData1 + $f2 ; pikachu data? + ld [hl], $ff + pop hl + ret + +Func_153a:: ; 153a (0:153a) + push hl + ld hl, wPikachuOverworldStateFlags + set 1, [hl] + pop hl + ret + +Func_1542:: ; 1542 (0:1542) + push hl + ld hl, wPikachuOverworldStateFlags + res 1, [hl] + pop hl + ret + +Func_154a:: ; 154a (0:154a) + push hl + ld hl, wPikachuOverworldStateFlags + bit 1, [hl] + pop hl + ret + +Func_1552:: ; 1552 (0:1552) + ld a, [hl] + dec a + swap a + ld [hTilePlayerStandingOn], a + homecall Func_fc6d5 ; 3f:46d5 + ret + +Func_1568:: ; 1568 (0:1568) + ld b, $0 + ld c, a +.asm_156b + inc b + ld a, [hli] + cp $ff + jr z, .asm_1578 + cp c + jr nz, .asm_156b + dec b + dec hl + scf + ret +.asm_1578 + dec b + dec hl + and a + ret + +Func_157c:: ; 157c (0:157c) + push hl + push bc + ld a, [H_LOADEDROMBANK] + push af + ld a, [wd44a] + call BankswitchCommon + ld hl, wd44b + ld c, [hl] + inc hl + ld b, [hl] + ld a, [bc] + inc bc + ld [hl], b + dec hl + ld [hl], c + ld c, a + pop af + call BankswitchCommon + ld a, c + pop bc + pop hl + ret + +Func_159b:: ; 159b (0:159b) + ld a, [H_LOADEDROMBANK] + ld b, a + push af + callbs Func_fd2a1 + pop af + call BankswitchCommon + ret diff --git a/scripts/beach_house2.asm b/scripts/beach_house2.asm new file mode 100755 index 00000000..918334ab --- /dev/null +++ b/scripts/beach_house2.asm @@ -0,0 +1,33 @@ +Func_f23d0: ; f23d0 + call SaveScreenTilesToBuffer2 + xor a + ld [wUpdateSpritesEnabled], a + ld hl, wd730 + set 6, [hl] + callab Func_e8c5c + ld hl, wd730 + res 6, [hl] + call GBPalWhiteOutWithDelay3 + call ReloadTilesetTilePatterns + call RestoreScreenTilesAndReloadTilePatterns + call LoadScreenTilesFromBuffer2 + call Delay3 + call GBPalNormal + ld hl, Text_f2412 + ld a, [hOaksAideResult] + and a + jr nz, .asm_f2406 + ld hl, Text_f240c +.asm_f2406 + call PrintText + jp TextScriptEnd + +Text_f240c: + TX_FAR _BeachHousePrinterText5 + TX_SFX_ITEM2 + db "@" + +Text_f2412: + TX_FAR _BeachHousePrinterText6 + TX_SFX_ITEM2 + db "@" diff --git a/scripts/billshouse2.asm b/scripts/billshouse2.asm new file mode 100755 index 00000000..48205029 --- /dev/null +++ b/scripts/billshouse2.asm @@ -0,0 +1,158 @@ +Func_f2418: + ld hl, BillsHouseText_f243b + call PrintText + call YesNoChoice + ld a, [wCurrentMenuItem] + and a + jr nz, .asm_f2433 +.asm_f2427 + ld hl, BillsHouseText_f2440 + call PrintText + ld a, $2 + ld [W_BILLSHOUSECURSCRIPT], a + ret + +.asm_f2433 + ld hl, BillsHouseText_f2445 + call PrintText + jr .asm_f2427 + +BillsHouseText_f243b: + TX_FAR _BillsHouseText_1e865 + db "@" + +BillsHouseText_f2440: + TX_FAR _BillsHouseText_1e86a + db "@" + +BillsHouseText_f2445: + TX_FAR _BillsHouseText_1e86f + db "@" + +Func_f244a: + CheckEvent EVENT_GOT_SS_TICKET + jr nz, .asm_f247e + ld hl, BillsHouseText_f248c + call PrintText + lb bc, S_S_TICKET, 1 + call GiveItem + jr nc, .asm_f2485 + ld hl, BillsHouseText_f2491 + call PrintText + SetEvent EVENT_GOT_SS_TICKET + ld a, HS_CERULEAN_GUARD_1 + ld [wMissableObjectIndex], a + predef ShowObject + ld a, HS_CERULEAN_GUARD_2 + ld [wMissableObjectIndex], a + predef HideObject +.asm_f247e + ld hl, BillsHouseText_f249d + call PrintText + ret + +.asm_f2485 + ld hl, BillsHouseText_f2498 + call PrintText + ret + +BillsHouseText_f248c: + TX_FAR _BillThankYouText + db "@" + +BillsHouseText_f2491: + TX_FAR _SSTicketReceivedText + TX_SFX_KEY_ITEM + TX_BUTTON_SOUND + db "@" + +BillsHouseText_f2498: + TX_FAR _SSTicketNoRoomText + db "@" + +BillsHouseText_f249d: + TX_FAR _BillsHouseText_1e8cb + db "@" + +Func_f24a2: + ld hl, BillsHouseText_f24a9 + call PrintText + ret + +BillsHouseText_f24a9: + TX_FAR _BillsHouseText_1e8da + db "@" + +Func_f24ae: ; f24ae + ld a, [wCurMap] + cp BILLS_HOUSE + jr nz, .asm_f24d2 + call Func_154a + jr z, .asm_f24d2 + ld a, [W_BILLSHOUSECURSCRIPT] + cp $5 + ld e, $1b + ret z + cp $0 + ld e, $17 + ret z + CheckEventHL EVENT_MET_BILL_2 + ld e, $20 + ret z + ld e, $1f + ret + +.asm_f24d2 + ld e, $ff + ret + +Func_f24d5: + ld a, $ff + ld [wJoyIgnore], a + xor a + ld [wPlayerMovingDirection], a + call UpdateSprites + call UpdateSprites + ld hl, Data_f2505 + call Func_159b + ld a, $f ; pikachu + ld [wEmotionBubbleSpriteIndex], a + ld a, $1 + ld [wWhichEmotionBubble], a + predef EmotionBubble + call Func_153a + callab InitializePikachuTextID + ret + +Data_f2505: + db $00 + db $20 + db $20 + db $20 + db $1e + db $3f + +Func_f250b: + ld hl, Data_f251c + ld b, SPRITE_FACING_UP + call Func_f0a82 + ld hl, Data_f2521 + ld b, SPRITE_FACING_RIGHT + call Func_f0a82 + ret + +Data_f251c: + db $00 + db $1f + db $1d + db $38 + db $3f + +Data_f2521: + db $00 + db $1e + db $1f + db $1f + db $1d + db $38 + db $3f diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 63cec822..43464d77 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -798,7 +798,7 @@ OaksLabText_1c9a7: OaksLabScript_1c9ac: ld a, $1 - ld [wSavedPlayerScreenY], a + ld [wEmotionBubbleSpriteIndex], a xor a ld [wWhichEmotionBubble], a predef EmotionBubble diff --git a/scripts/silphco11_2.asm b/scripts/silphco11_2.asm new file mode 100755 index 00000000..e7b59757 --- /dev/null +++ b/scripts/silphco11_2.asm @@ -0,0 +1,76 @@ +Func_f25a0: + ld hl, MissableObjects_f25ce +.asm_f25a3 + ld a, [hli] + cp $ff + jr z, .asm_f25b4 + push hl + ld [wMissableObjectIndex], a + predef HideObject + pop hl + jr .asm_f25a3 + +.asm_f25b4 + ld hl, MissableObjects_f25c7 +.asm_f25b7 + ld a, [hli] + cp $ff + ret z + push hl + ld [wMissableObjectIndex], a + predef ShowObject + pop hl + jr .asm_f25b7 + +MissableObjects_f25c7: + db HS_SAFFRON_CITY_8 + db HS_SAFFRON_CITY_9 + db HS_SAFFRON_CITY_A + db HS_SAFFRON_CITY_B + db HS_SAFFRON_CITY_C + db HS_SAFFRON_CITY_D + db $FF + +MissableObjects_f25ce + db HS_SAFFRON_CITY_1 + db HS_SAFFRON_CITY_2 + db HS_SAFFRON_CITY_3 + db HS_SAFFRON_CITY_4 + db HS_SAFFRON_CITY_5 + db HS_SAFFRON_CITY_6 + db HS_SAFFRON_CITY_7 + db HS_SAFFRON_CITY_E + db HS_SAFFRON_CITY_F + db HS_SILPH_CO_2F_2 + db HS_SILPH_CO_2F_3 + db HS_SILPH_CO_2F_4 + db HS_SILPH_CO_2F_5 + db HS_SILPH_CO_3F_1 + db HS_SILPH_CO_3F_2 + db HS_SILPH_CO_4F_1 + db HS_SILPH_CO_4F_2 + db HS_SILPH_CO_4F_3 + db HS_SILPH_CO_5F_1 + db HS_SILPH_CO_5F_2 + db HS_SILPH_CO_5F_3 + db HS_SILPH_CO_5F_4 + db HS_SILPH_CO_6F_1 + db HS_SILPH_CO_6F_2 + db HS_SILPH_CO_6F_3 + db HS_SILPH_CO_7F_1 + db HS_SILPH_CO_7F_2 + db HS_SILPH_CO_7F_3 + db HS_SILPH_CO_7F_4 + db HS_SILPH_CO_8F_1 + db HS_SILPH_CO_8F_2 + db HS_SILPH_CO_8F_3 + db HS_SILPH_CO_9F_1 + db HS_SILPH_CO_9F_2 + db HS_SILPH_CO_9F_3 + db HS_SILPH_CO_10F_1 + db HS_SILPH_CO_10F_2 + db HS_SILPH_CO_11F_1 + db HS_SILPH_CO_11F_2 + db HS_SILPH_CO_11F_3 + db HS_MAP_F4_1 + db $ff \ No newline at end of file diff --git a/scripts/ssanne9_2.asm b/scripts/ssanne9_2.asm new file mode 100755 index 00000000..f856221c --- /dev/null +++ b/scripts/ssanne9_2.asm @@ -0,0 +1,35 @@ +Func_f2570: + ld hl, SSAnne9Text_f2577 + call PrintText + ret + +SSAnne9Text_f2577: + TX_FAR _SSAnne9Text_61c1f + db "@" + +Func_f257c: + ld hl, SSAnne9Text_f2583 + call PrintText + ret + +SSAnne9Text_f2583: + TX_FAR _SSAnne9Text_61c2e + db "@" + +Func_f2588: + ld hl, SSAnne9Text_f258f + call PrintText + ret + +SSAnne9Text_f258f: + TX_FAR _SSAnne9Text_61c3d + db "@" + +Func_f2594: + ld hl, SSAnne9Text_f259b + call PrintText + ret + +SSAnne9Text_f259b: + TX_FAR _SSAnne9Text_61c4c + db "@" diff --git a/scripts/viridianforest2.asm b/scripts/viridianforest2.asm index 41c81218..489db39c 100755 --- a/scripts/viridianforest2.asm +++ b/scripts/viridianforest2.asm @@ -43,3 +43,11 @@ Text_f255f: TX_FAR _ViridianForestText13 db "@" +Func_f2564: + ld hl, ViridianForestText_f256b + call PrintText + ret + +ViridianForestText_f256b: + TX_FAR _ViridianForestText14 + db "@" diff --git a/wram.asm b/wram.asm index 2c9b3d4e..64a394ed 100755 --- a/wram.asm +++ b/wram.asm @@ -2523,7 +2523,7 @@ wDestinationWarpID:: ; d42f ; if $ff, the player's coordinates are not updated when entering the map ds 1 -wd430:: ds 1 ; d42f +wPikachuOverworldStateFlags:: ds 1 ; d42f wd431:: ds 1 ; d430 wd432:: ds 1 ; d431 wd433:: ds 1 ; d432 -- cgit v1.3.1-sl0p From 9abb62033819774d7b256ee0222f7c6ece987bfe Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 29 May 2016 16:24:41 -0400 Subject: Pewter Pokecenter --- data/mapObjects/pewterpokecenter.asm | 6 ++- data/map_header_banks.asm | 2 +- data/map_header_pointers.asm | 2 +- engine/bank3c.asm | 5 ++- engine/bank3f.asm | 6 +-- engine/items/items.asm | 2 +- engine/menu/bills_pc.asm | 2 +- engine/menu/party_menu.asm | 2 +- engine/overworld/cable_club_npc.asm | 2 +- engine/overworld/pokecenter.asm | 8 ++-- engine/pikachu_pic_animation.asm | 10 ++--- home.asm | 2 +- home/overworld.asm | 2 +- home/pikachu.asm | 6 +-- main.asm | 12 ++++-- scripts/billshouse2.asm | 4 +- scripts/pewterpokecenter.asm | 80 ++++++++---------------------------- wram.asm | 4 ++ 18 files changed, 63 insertions(+), 94 deletions(-) (limited to 'engine/items') diff --git a/data/mapObjects/pewterpokecenter.asm b/data/mapObjects/pewterpokecenter.asm index 86757244..d3f87326 100755 --- a/data/mapObjects/pewterpokecenter.asm +++ b/data/mapObjects/pewterpokecenter.asm @@ -7,11 +7,13 @@ PewterPokecenterObject: ; 0x5c60d (size=44) db $0 ; signs - db $4 ; objects + db $6 ; objects object SPRITE_NURSE, $3, $1, STAY, DOWN, $1 ; person object SPRITE_GENTLEMAN, $b, $7, STAY, LEFT, $2 ; person - object SPRITE_CLEFAIRY, $1, $3, STAY, DOWN, $3 ; person + object SPRITE_JIGGLYPUFF, $1, $3, STAY, DOWN, $3 ; person object SPRITE_CABLE_CLUB_WOMAN, $b, $2, STAY, DOWN, $4 ; person + object SPRITE_LASS, $4, $3, STAY, UP, $5 ; person + object SPRITE_CHANSEY, $4, $1, STAY, DOWN, $6 ; person ; warp-to EVENT_DISP PEWTER_POKECENTER_WIDTH, $7, $3 diff --git a/data/map_header_banks.asm b/data/map_header_banks.asm index 0dd10719..c840cd82 100644 --- a/data/map_header_banks.asm +++ b/data/map_header_banks.asm @@ -58,7 +58,7 @@ MapHeaderBanks:: ; fc3e4 (3f:43e4) db BANK(PewterHouse1_h) db BANK(PewterMart_h) db BANK(PewterHouse2_h) - db $17 ; db BANK(PewterPokecenter_h) + db BANK(PewterPokecenter_h) db $12 ; db BANK(MtMoon1_h) db $14 ; db BANK(MtMoon2_h) db $12 ; db BANK(MtMoon3_h) diff --git a/data/map_header_pointers.asm b/data/map_header_pointers.asm index a7a0763d..cc700617 100644 --- a/data/map_header_pointers.asm +++ b/data/map_header_pointers.asm @@ -58,7 +58,7 @@ MapHeaderPointers:: ; fc1f2 (3f:41f2) dw PewterHouse1_h dw PewterMart_h dw PewterHouse2_h - dw $446e ; dw PewterPokecenter_h + dw PewterPokecenter_h dw $5953 ; dw MtMoon1_h dw $5a78 ; dw MtMoon2_h ;id=60 dw $5c7e ; dw MtMoon3_h diff --git a/engine/bank3c.asm b/engine/bank3c.asm index 097dfd3e..9274b8b7 100644 --- a/engine/bank3c.asm +++ b/engine/bank3c.asm @@ -352,7 +352,10 @@ INCLUDE "scripts/redshouse1f2.asm" INCLUDE "scripts/oakslab2.asm" INCLUDE "scripts/school2.asm" INCLUDE "scripts/museum1f2.asm" - dr $f1d98, $f220e +INCLUDE "scripts/pewterpokecenter2.asm" + +Func_f1e22: + dr $f1e22, $f220e INCLUDE "data/mapHeaders/beach_house.asm" INCLUDE "scripts/beach_house.asm" diff --git a/engine/bank3f.asm b/engine/bank3f.asm index c8041a3a..c31fc986 100644 --- a/engine/bank3f.asm +++ b/engine/bank3f.asm @@ -27,7 +27,7 @@ Func_fc4fa:: ; fc4fa (3f:44fa) bit 4, [hl] res 4, [hl] jr nz, .asm_fc515 - call Func_1542 + call ResetPikachuAsleep call Func_fc523 ld a, $ff ld [wSpriteStateData1 + $f2], a @@ -344,7 +344,7 @@ Func_fc6d5:: ; fc6d5 (3f:46d5) ld a, [wFontLoaded] bit 0, a jp nz, asm_fc76a - call Func_154a + call CheckPikachuAsleep jp nz, asm_fc76a ld a, [hl] and $7f @@ -408,7 +408,7 @@ asm_fc745: ; fc745 (3f:4745) ld hl, wSpriteStateData2 - wSpriteStateData1 add hl, bc ld [hl], a - call Func_154a + call CheckPikachuAsleep jr nz, .asm_fc75f ld a, [wSpriteStateData1 + $9] xor $4 diff --git a/engine/items/items.asm b/engine/items/items.asm index 5d76c37e..eca9eaef 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -1765,7 +1765,7 @@ ItemUsePokeflute: ; dfbd (3:5fbd) .notRoute16 cp a,PEWTER_POKECENTER jr nz,.noSnorlaxOrPikachuToWakeUp - call Func_154a + call CheckPikachuAsleep jr z,.noSnorlaxOrPikachuToWakeUp callab Func_fcb01 jr nc,.noSnorlaxOrPikachuToWakeUp diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index ce9ca5a8..97a65517 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -227,7 +227,7 @@ BillsPCDeposit: ; 2156d (8:556d) jp c, BillsPCMenu callab IsThisPartymonStarterPikachu_Party jr nc, .asm_215ad - call Func_154a + call CheckPikachuAsleep jr z, .asm_215ad ld hl, SleepingPikachuText2 call PrintText diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index 3ec0029e..8683d3cb 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -53,7 +53,7 @@ RedrawPartyMenu_: ; 11886 (4:5886) ld [wWhichPokemon],a callab IsThisPartymonStarterPikachu_Party jr nc, .regularMon - call Func_154a + call CheckPikachuAsleep jr z, .regularMon ld a, $ff ld [hPartyMonIndex], a diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index 8f279759..4170a936 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -1,7 +1,7 @@ CableClubNPC: ; 7035 (1:7035) ld hl, CableClubNPCWelcomeText call PrintText - call Func_154a + call CheckPikachuAsleep jr nz, .asm_7048 CheckEvent EVENT_GOT_POKEDEX jp nz, .receivedPokedex diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index 779d852c..3024ff7b 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -2,7 +2,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) ld a, [wCurMap] cp PEWTER_POKECENTER jr nz, .regularCenter - call Func_154a + call CheckPikachuAsleep jr z, .regularCenter ld hl, LooksContentText ; if pikachu is sleeping, don't heal call PrintText @@ -27,7 +27,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) call SetLastBlackoutMap callab IsStarterPikachuInOurParty jr nc, .notHealingPlayerPikachu - call Func_154a + call CheckPikachuAsleep jr nz, .notHealingPlayerPikachu call LoadCurrentMapView call Delay3 @@ -38,7 +38,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) call PrintText ld c, 64 call DelayFrames - call Func_154a + call CheckPikachuAsleep jr nz, .playerPikachuNotOnScreen call Func_152d callab IsStarterPikachuInOurParty @@ -58,7 +58,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) ld [wLastMusicSoundID], a ld [wNewSoundID], a call PlaySound - call Func_154a + call CheckPikachuAsleep jr nz, .doNotReturnPikachu callab IsStarterPikachuInOurParty call c, Func_6eaa diff --git a/engine/pikachu_pic_animation.asm b/engine/pikachu_pic_animation.asm index d95eb538..c16e3e5f 100755 --- a/engine/pikachu_pic_animation.asm +++ b/engine/pikachu_pic_animation.asm @@ -247,7 +247,7 @@ Func_fd05e: ; fd05e (3f:505e) bit 7, [hl] ld a, $1d jr z, .asm_fd0c9 - call Func_154a + call CheckPikachuAsleep ld a, $1e jr nz, .asm_fd0c9 jr .asm_fd096 @@ -255,7 +255,7 @@ Func_fd05e: ; fd05e (3f:505e) ld a, [wCurMap] cp PEWTER_POKECENTER jr nz, .notPewterPokecenter - call Func_154a + call CheckPikachuAsleep ld a, $1a jr nz, .asm_fd0c9 jr .asm_fd096 @@ -1636,7 +1636,7 @@ PikachuPewterPokecenterCheck: ; fd8d4 (3f:58d4) ld a, [wCurMap] cp PEWTER_POKECENTER ret nz - call Func_1542 + call ResetPikachuAsleep call Func_fcff2 ret @@ -1644,7 +1644,7 @@ PikachuFanClubCheck: ; fd8e1 (3f:58e1) ld a, [wCurMap] cp POKEMON_FAN_CLUB ret nz - call Func_1542 + call ResetPikachuAsleep call Func_fcff2 ret @@ -1652,7 +1652,7 @@ PikachuBillsHouseCheck: ; fd8ee (3f:58ee) ld a, [wCurMap] cp BILLS_HOUSE ret nz - call Func_1542 + call ResetPikachuAsleep ret Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3: ; fd8f8 (3f:58f8) diff --git a/home.asm b/home.asm index 5f924a40..6fb3e08b 100644 --- a/home.asm +++ b/home.asm @@ -477,7 +477,7 @@ HandlePartyMenuInput:: ; 1226 (0:1226) ld [wWhichPokemon], a callab IsThisPartymonStarterPikachu_Party ; 3f:4e18 jr nc, .asm_1258 - call Func_154a + call CheckPikachuAsleep jr nz, .asm_128f .asm_1258 pop af diff --git a/home/overworld.asm b/home/overworld.asm index 3a9708d9..bc7ae029 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1222,7 +1222,7 @@ CollisionCheckOnLand:: ; 0a1c (0:0a1c) ; if no sprite collision cp $f jr nz,.collision - call Func_154a + call CheckPikachuAsleep jr nz,.collision ld a,[hJoyHeld] and $2 diff --git a/home/pikachu.asm b/home/pikachu.asm index 5239873c..9e0ab541 100755 --- a/home/pikachu.asm +++ b/home/pikachu.asm @@ -30,21 +30,21 @@ Func_152d:: ; 152d (0:152d) pop hl ret -Func_153a:: ; 153a (0:153a) +SetPikachuAsleep:: ; 153a (0:153a) push hl ld hl, wPikachuOverworldStateFlags set 1, [hl] pop hl ret -Func_1542:: ; 1542 (0:1542) +ResetPikachuAsleep:: ; 1542 (0:1542) push hl ld hl, wPikachuOverworldStateFlags res 1, [hl] pop hl ret -Func_154a:: ; 154a (0:154a) +CheckPikachuAsleep:: ; 154a (0:154a) push hl ld hl, wPikachuOverworldStateFlags bit 1, [hl] diff --git a/main.asm b/main.asm index 3ba53669..33332dff 100755 --- a/main.asm +++ b/main.asm @@ -746,7 +746,6 @@ INCLUDE "data/mapObjects/lavendertown.asm" LavenderTownBlocks: INCBIN "maps/lavendertown.blk" ViridianPokecenterBlocks: -PewterPokecenterBlocks: CeruleanPokecenterBlocks: VermilionPokecenterBlocks: SaffronPokecenterBlocks: @@ -1059,7 +1058,9 @@ Museum1FBlocks: INCBIN "maps/museum1f.blk" Museum2FBlocks: INCBIN "maps/museum2f.blk" - dr $5c064,$5c090 +PewterPokecenterBlocks: +INCBIN "maps/pewterpokecenter.blk" + dr $5c080,$5c090 ViridianForestEntranceBlocks: ViridianForestExitBlocks: Route2GateBlocks: @@ -1083,7 +1084,12 @@ INCLUDE "scripts/pewtergym.asm" INCLUDE "data/mapObjects/pewtergym.asm" PewterGymBlocks: INCBIN "maps/pewtergym.blk" - dr $5c46e,$5d485 + +INCLUDE "data/mapHeaders/pewterpokecenter.asm" +INCLUDE "scripts/pewterpokecenter.asm" +INCLUDE "data/mapObjects/pewterpokecenter.asm" + + dr $5c4f5,$5d485 INCLUDE "data/mapHeaders/viridianforestexit.asm" INCLUDE "scripts/viridianforestexit.asm" diff --git a/scripts/billshouse2.asm b/scripts/billshouse2.asm index 48205029..6f62a79f 100755 --- a/scripts/billshouse2.asm +++ b/scripts/billshouse2.asm @@ -87,7 +87,7 @@ Func_f24ae: ; f24ae ld a, [wCurMap] cp BILLS_HOUSE jr nz, .asm_f24d2 - call Func_154a + call CheckPikachuAsleep jr z, .asm_f24d2 ld a, [W_BILLSHOUSECURSCRIPT] cp $5 @@ -120,7 +120,7 @@ Func_f24d5: ld a, $1 ld [wWhichEmotionBubble], a predef EmotionBubble - call Func_153a + call SetPikachuAsleep callab InitializePikachuTextID ret diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 46d4d509..90f5e2b9 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -1,12 +1,17 @@ PewterPokecenterScript: ; 5c587 (17:4587) + ld hl, wPreventBlackout + set 7, [hl] call Serial_TryEstablishingExternallyClockedConnection - jp EnableAutoTextBoxDrawing + call EnableAutoTextBoxDrawing + ret PewterPokecenterTextPointers: ; 5c58d (17:458d) dw PewterPokecenterText1 dw PewterPokecenterText2 dw PewterPokecenterText3 dw PewterPokecenterText4 + dw PewterPokecenterText5 + dw PewterPokecenterText6 PewterPokecenterText1: ; 5c595 (17:4595) db $ff @@ -17,69 +22,18 @@ PewterPokecenterText2: ; 5c596 (17:4596) PewterPokecenterText3: ; 5c59b (17:459b) TX_ASM - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, PewterPokecenterText5 - call PrintText - ld a, $ff - call PlaySound - ld c, 32 - call DelayFrames - ld hl, JigglypuffFacingDirections - ld de, wJigglypuffFacingDirections - ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections - call CopyData - - ld a, [wSpriteStateData1 + 3 * $10 + $2] - ld hl, wJigglypuffFacingDirections -.findMatchingFacingDirectionLoop - cp [hl] - inc hl - jr nz, .findMatchingFacingDirectionLoop - dec hl - push hl - ld c, BANK(Music_JigglypuffSong) - ld a, MUSIC_JIGGLYPUFF_SONG - call PlayMusic - pop hl -.loop - ld a, [hl] - ld [wSpriteStateData1 + 3 * $10 + $2], a - -; rotate the array - push hl - ld hl, wJigglypuffFacingDirections - ld de, wJigglypuffFacingDirections - 1 - ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections - call CopyData - ld a, [wJigglypuffFacingDirections - 1] - ld [wJigglypuffFacingDirections + 3], a - pop hl - - ld c, 24 - call DelayFrames - - ld a, [wChannelSoundIDs] - ld b, a - ld a, [wChannelSoundIDs + CH1] - or b - jr nz, .loop - - ld c, 48 - call DelayFrames - call PlayDefaultMusic + callba Func_f1da4 jp TextScriptEnd -PewterPokecenterText5: ; 5c603 (17:4603) - TX_FAR _PewterPokecenterText5 - db "@" - -JigglypuffFacingDirections: ; 5c608 (17:4608) - db $30 | SPRITE_FACING_DOWN - db $30 | SPRITE_FACING_LEFT - db $30 | SPRITE_FACING_UP - db $30 | SPRITE_FACING_RIGHT -JigglypuffFacingDirectionsEnd: - PewterPokecenterText4: ; 5c60c (17:460c) db $f6 + +PewterPokecenterText5: ; 5c603 (17:4603) + TX_ASM + callba Func_f1d98 + jp TextScriptEnd + +PewterPokecenterText6: + TX_ASM + callab Func_f0f12 + jp TextScriptEnd diff --git a/wram.asm b/wram.asm index 64a394ed..821c4957 100755 --- a/wram.asm +++ b/wram.asm @@ -960,6 +960,8 @@ wPlayerSpinWhileMovingUpOrDownAnimMaxY:: ; cd3e wHiddenObjectFunctionRomBank:: ; cd3e wTrainerEngageDistance:: ; cd3e + +wJigglypuffFacingDirections2:: ; cd3e ds 1 wHUDGraphicsTiles:: ; cd3f @@ -1040,6 +1042,8 @@ wHoFTeamNo:: ; cd42 wSlotMachineWheel1MiddleTile:: ; cd42 wFieldMovesLeftmostXCoord:: ; cd42 + +wcd42:: ; cd42 ds 1 wLastFieldMoveID:: ; cd43 -- cgit v1.3.1-sl0p