named more variables

This commit is contained in:
YamaArashi 2015-08-12 22:14:31 -07:00
parent 64cfbcce7a
commit 132d036752
33 changed files with 185 additions and 142 deletions

View file

@ -76,11 +76,11 @@ GainExperience: ; 5524f (15:524f)
ld b, [hl] ld b, [hl]
ld a, [wPlayerID + 1] ld a, [wPlayerID + 1]
cp b cp b
ld a, $0 ld a, 0
jr z, .next jr z, .next
.tradedMon .tradedMon
call BoostExp ; traded mon exp boost call BoostExp ; traded mon exp boost
ld a, $1 ld a, 1
.next .next
ld [wGainBoostedExp], a ld [wGainBoostedExp], a
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]
@ -92,12 +92,12 @@ GainExperience: ; 5524f (15:524f)
; add the gained exp to the party mon's exp ; add the gained exp to the party mon's exp
ld b, [hl] ld b, [hl]
ld a, [H_QUOTIENT + 3] ld a, [H_QUOTIENT + 3]
ld [wcf4c], a ld [wExpAmountGained + 1], a
add b add b
ld [hld], a ld [hld], a
ld b, [hl] ld b, [hl]
ld a, [H_QUOTIENT + 2] ld a, [H_QUOTIENT + 2]
ld [wcf4b], a ld [wExpAmountGained], a
adc b adc b
ld [hl], a ld [hl], a
jr nc, .noCarry jr nc, .noCarry

View file

@ -836,7 +836,7 @@ TradeCenter_Trade:
call ClearScreen call ClearScreen
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
xor a xor a
ld [wcc5b], a ld [wUnusedCC5B], a
ld a, [hSerialConnectionStatus] ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK cp USING_EXTERNAL_CLOCK
jr z, .usingExternalClock jr z, .usingExternalClock

View file

@ -3,7 +3,7 @@ AbleToPlaySlotsCheck: ; 2ff09 (b:7f09)
and $8 and $8
jr z, .done ; not able jr z, .done ; not able
ld b, COIN_CASE ld b, COIN_CASE
predef IsItemInBag_ ; IsItemInBag_ predef GetQuantityOfItemInBag
ld a, b ld a, b
and a and a
ld b, (GameCornerCoinCaseText_id - TextPredefs) / 2 + 1 ld b, (GameCornerCoinCaseText_id - TextPredefs) / 2 + 1

View file

@ -243,7 +243,7 @@ HoFDisplayPlayerStats: ; 70377 (1c:4377)
call HoFPrintTextAndDelay call HoFPrintTextAndDelay
ld hl, DexRatingText ld hl, DexRatingText
call HoFPrintTextAndDelay call HoFPrintTextAndDelay
ld hl, wcc5d ld hl, wDexRatingText
HoFPrintTextAndDelay: ; 703e2 (1c:43e2) HoFPrintTextAndDelay: ; 703e2 (1c:43e2)
call PrintText call PrintText

View file

@ -1324,7 +1324,7 @@ ItemUseRock: ; df67 (3:5f67)
BaitRockCommon: ; df7f (3:5f7f) BaitRockCommon: ; df7f (3:5f7f)
ld [W_ANIMATIONID],a ld [W_ANIMATIONID],a
xor a xor a
ld [wcc5b],a ld [wAnimationType],a
ld [H_WHOSETURN],a ld [H_WHOSETURN],a
ld [de],a ; zero escape factor (for bait), zero bait factor (for rock) ld [de],a ; zero escape factor (for bait), zero bait factor (for rock)
.randomLoop ; loop until a random number less than 5 is generated .randomLoop ; loop until a random number less than 5 is generated

View file

@ -150,7 +150,7 @@ LinkMenu: ; 5c0a (1:5c0a)
ld de, CableClubOptionsText ld de, CableClubOptionsText
call PlaceString call PlaceString
xor a xor a
ld [wcd37], a ld [wUnusedCD37], a
ld [wd72d], a ld [wd72d], a
ld hl, wTopMenuItemY ld hl, wTopMenuItemY
ld a, $7 ld a, $7

View file

@ -13,7 +13,7 @@ AnimatePartyMon: ; 716ff (1c:56ff)
ld hl, wPartyMenuHPBarColors ld hl, wPartyMenuHPBarColors
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -42,7 +42,7 @@ GetAnimationSpeed: ; 7170a (1c:570a)
jp DelayFrame jp DelayFrame
.resetSprites .resetSprites
push bc push bc
ld hl, wcc5b ld hl, wMonPartySpritesSavedOAM
ld de, wOAMBuffer ld de, wOAMBuffer
ld bc, $60 ld bc, $60
call CopyData call CopyData
@ -86,7 +86,7 @@ GetAnimationSpeed: ; 7170a (1c:570a)
; that each frame lasts for green HP, yellow HP, and red HP in order. ; that each frame lasts for green HP, yellow HP, and red HP in order.
; On the naming screen, the yellow HP speed is always used. ; On the naming screen, the yellow HP speed is always used.
PartyMonSpeeds: ; 71769 (1c:5769) PartyMonSpeeds: ; 71769 (1c:5769)
db $05,$10,$20 db 5, 16, 32
LoadMonPartySpriteGfx: ; 7176c (1c:576c) LoadMonPartySpriteGfx: ; 7176c (1c:576c)
; Load mon party sprite tile patterns into VRAM during V-blank. ; Load mon party sprite tile patterns into VRAM during V-blank.
@ -372,7 +372,7 @@ UnusedPartyMonSpriteFunction: ; 71890 (1c:5890)
WriteMonPartySpriteOAM: ; 718c3 (1c:58c3) WriteMonPartySpriteOAM: ; 718c3 (1c:58c3)
; Write the OAM blocks for the first animation frame into the OAM buffer and ; Write the OAM blocks for the first animation frame into the OAM buffer and
; make a copy at wcc5b. ; make a copy at wMonPartySpritesSavedOAM.
push af push af
ld c, $10 ld c, $10
ld h, wOAMBuffer / $100 ld h, wOAMBuffer / $100
@ -392,7 +392,7 @@ WriteMonPartySpriteOAM: ; 718c3 (1c:58c3)
; we can flip back to it from the second frame by copying it back. ; we can flip back to it from the second frame by copying it back.
.makeCopy .makeCopy
ld hl, wOAMBuffer ld hl, wOAMBuffer
ld de, wcc5b ld de, wMonPartySpritesSavedOAM
ld bc, $60 ld bc, $60
jp CopyData jp CopyData

View file

@ -5,14 +5,14 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld a, A_BUTTON | B_BUTTON ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a ld [wMenuWatchedKeys], a
ld a, [wcd37] ld a, [wFilteredBagItemsCount]
dec a dec a
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
ld a, 2 ld a, 2
ld [wTopMenuItemY], a ld [wTopMenuItemY], a
ld a, 1 ld a, 1
ld [wTopMenuItemX], a ld [wTopMenuItemX], a
ld a, [wcd37] ld a, [wFilteredBagItemsCount]
dec a dec a
ld bc, 2 ld bc, 2
ld hl, 3 ld hl, 3
@ -29,9 +29,9 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
call HandleMenuInput call HandleMenuInput
bit 1, a ; pressed B? bit 1, a ; pressed B?
jr nz, .cancelledGivingFossil jr nz, .cancelledGivingFossil
ld hl, wcc5b ld hl, wFilteredBagItems
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld d, $0 ld d, 0
ld e, a ld e, a
add hl, de add hl, de
ld a, [hl] ld a, [hl]
@ -90,9 +90,9 @@ LabFossil_610bd: ; 610bd (18:50bd)
PrintFossilsInBag: ; 610c2 (18:50c2) PrintFossilsInBag: ; 610c2 (18:50c2)
; Prints each fossil in the player's bag on a separate line in the menu. ; Prints each fossil in the player's bag on a separate line in the menu.
ld hl, wcc5b ld hl, wFilteredBagItems
xor a xor a
ld [hFossilCounter], a ld [hItemCounter], a
.loop .loop
ld a, [hli] ld a, [hli]
cp $ff cp $ff
@ -101,12 +101,12 @@ PrintFossilsInBag: ; 610c2 (18:50c2)
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
coord hl, 2, 2 coord hl, 2, 2
ld a, [hFossilCounter] ld a, [hItemCounter]
ld bc, SCREEN_WIDTH * 2 ld bc, SCREEN_WIDTH * 2
call AddNTimes call AddNTimes
ld de, wcd6d ld de, wcd6d
call PlaceString call PlaceString
ld hl, hFossilCounter ld hl, hItemCounter
inc [hl] inc [hl]
pop hl pop hl
jr .loop jr .loop

View file

@ -51,7 +51,7 @@ HiddenItemBagFullText: ; 76794 (1d:6794)
HiddenCoins: ; 76799 (1d:6799) HiddenCoins: ; 76799 (1d:6799)
ld b, COIN_CASE ld b, COIN_CASE
predef IsItemInBag_ predef GetQuantityOfItemInBag
ld a, b ld a, b
and a and a
ret z ret z

View file

@ -18,7 +18,7 @@ OaksAideScript: ; 0x59035
.giveItem .giveItem
ld hl, OaksAideHereYouGoText ld hl, OaksAideHereYouGoText
call PrintText call PrintText
ld a, [hOaksAideItemReward] ld a, [hOaksAideRewardItem]
ld b, a ld b, a
ld c, 1 ld c, 1
call GiveItem call GiveItem

View file

@ -33,7 +33,7 @@ DisplayDexRating: ; 44169 (11:4169)
callba PlayPokedexRatingSfx callba PlayPokedexRatingSfx
jp WaitForTextScrollButtonPress jp WaitForTextScrollButtonPress
.hallOfFame .hallOfFame
ld de, wcc5b ld de, wDexRatingNumMonsSeen
ld a, [hDexRatingNumMonsSeen] ld a, [hDexRatingNumMonsSeen]
ld [de], a ld [de], a
inc de inc de

View file

@ -80,7 +80,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef LoadTilesetHeader add_predef LoadTilesetHeader
add_predef LearnMoveFromLevelUp add_predef LearnMoveFromLevelUp
add_predef LearnMove add_predef LearnMove
add_predef IsItemInBag_ add_predef GetQuantityOfItemInBag
dbw $03,CheckForHiddenObjectOrBookshelfOrCardKeyDoor ; for these two, the bank number is actually 0 dbw $03,CheckForHiddenObjectOrBookshelfOrCardKeyDoor ; for these two, the bank number is actually 0
dbw $03,GiveItem dbw $03,GiveItem
add_predef ChangeBGPalColor0_4Frames add_predef ChangeBGPalColor0_4Frames

View file

@ -21,7 +21,7 @@ DisplayElevatorFloorMenu: ; 1c9c6 (7:49c6)
ret c ret c
ld hl, wd126 ld hl, wd126
set 7, [hl] set 7, [hl]
ld hl, wcc5b ld hl, wElevatorWarpMaps
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
add a add a
ld d, 0 ld d, 0

View file

@ -644,7 +644,7 @@ SaveHallOfFameTeams: ; 73b0d (1c:7b0d)
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
ld hl, wcc5b ld hl, wHallOfFame
ld bc, HOF_TEAM ld bc, HOF_TEAM
jr HallOfFame_Copy jr HallOfFame_Copy
@ -653,7 +653,7 @@ SaveHallOfFameTeams: ; 73b0d (1c:7b0d)
ld de, sHallOfFame ld de, sHallOfFame
ld bc, HOF_TEAM * (HOF_TEAM_CAPACITY - 1) ld bc, HOF_TEAM * (HOF_TEAM_CAPACITY - 1)
call HallOfFame_Copy call HallOfFame_Copy
ld hl, wcc5b ld hl, wHallOfFame
ld de, sHallOfFame + HOF_TEAM * (HOF_TEAM_CAPACITY - 1) ld de, sHallOfFame + HOF_TEAM * (HOF_TEAM_CAPACITY - 1)
ld bc, HOF_TEAM ld bc, HOF_TEAM
jr HallOfFame_Copy jr HallOfFame_Copy
@ -663,7 +663,7 @@ LoadHallOfFameTeams: ; 73b3f (1c:7b3f)
ld bc, HOF_TEAM ld bc, HOF_TEAM
ld a, [wHoFTeamIndex] ld a, [wHoFTeamIndex]
call AddNTimes call AddNTimes
ld de, wcc5b ld de, wHallOfFame
ld bc, HOF_TEAM ld bc, HOF_TEAM
; fallthrough ; fallthrough

View file

@ -215,7 +215,7 @@ ENDC
ld [wNewSoundID], a ld [wNewSoundID], a
call PlaySound call PlaySound
xor a xor a
ld [wcc5b], a ld [wUnusedCC5B], a
; Keep scrolling in new mons indefinitely until the user performs input. ; Keep scrolling in new mons indefinitely until the user performs input.
.awaitUserInterruptionLoop .awaitUserInterruptionLoop

View file

@ -849,5 +849,5 @@ TradeforText: ; 41671 (10:5671)
Trade_ShowAnimation: ; 41676 (10:5676) Trade_ShowAnimation: ; 41676 (10:5676)
ld [W_ANIMATIONID], a ld [W_ANIMATIONID], a
xor a xor a
ld [wcc5b], a ld [wAnimationType], a
predef_jump MoveAnimation predef_jump MoveAnimation

View file

@ -2706,7 +2706,7 @@ IsItemInBag:: ; 3493 (0:3493)
; set zero flag if item isn't in player's bag ; set zero flag if item isn't in player's bag
; else reset zero flag ; else reset zero flag
; related to Pokémon Tower and ghosts ; related to Pokémon Tower and ghosts
predef IsItemInBag_ predef GetQuantityOfItemInBag
ld a,b ld a,b
and a and a
ret ret

View file

@ -269,7 +269,7 @@ hMovingBGTilesCounter1 EQU $FFD8
H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
hFossilCounter EQU $FFDB hItemCounter EQU $FFDB
hGymGateIndex EQU $FFDB hGymGateIndex EQU $FFDB
@ -285,7 +285,7 @@ hDexRatingNumMonsOwned EQU $FFDC
hOaksAideResult EQU $FFDB hOaksAideResult EQU $FFDB
hOaksAideRequirement EQU $FFDB ; required number of owned mons hOaksAideRequirement EQU $FFDB ; required number of owned mons
hOaksAideItemReward EQU $FFDC hOaksAideRewardItem EQU $FFDC
hOaksAideNumMonsOwned EQU $FFDD hOaksAideNumMonsOwned EQU $FFDD
hItemToRemoveID EQU $FFDB hItemToRemoveID EQU $FFDB

View file

@ -4508,21 +4508,23 @@ InitializeEmptyList:
ret ret
IsItemInBag_: ; f8a5 (3:78a5) GetQuantityOfItemInBag: ; f8a5 (3:78a5)
; In: b = item ID
; Out: b = how many of that item are in the bag
call GetPredefRegisters call GetPredefRegisters
ld hl, wNumBagItems ld hl, wNumBagItems
.asm_f8ab .loop
inc hl inc hl
ld a, [hli] ld a, [hli]
cp $ff cp $ff
jr z, .asm_f8b7 jr z, .notInBag
cp b cp b
jr nz, .asm_f8ab jr nz, .loop
ld a, [hl] ld a, [hl]
ld b, a ld b, a
ret ret
.asm_f8b7 .notInBag
ld b, $0 ld b, 0
ret ret
FindPathToPlayer: ; f8ba (3:78ba) FindPathToPlayer: ; f8ba (3:78ba)

View file

@ -35,7 +35,7 @@ CeladonMartElevatorScript_48631: ; 48631 (12:4631)
ld hl, CeladonMartElavatorFloors ld hl, CeladonMartElavatorFloors
call LoadItemList call LoadItemList
ld hl, CeldaonMartElevatorWarpMaps ld hl, CeldaonMartElevatorWarpMaps
ld de, wcc5b ld de, wElevatorWarpMaps
ld bc, CeldaonMartElevatorWarpMapsEnd - CeldaonMartElevatorWarpMaps ld bc, CeldaonMartElevatorWarpMapsEnd - CeldaonMartElevatorWarpMaps
jp CopyData jp CopyData

View file

@ -1,34 +1,35 @@
CeladonMartRoofScript: ; 483d5 (12:43d5) CeladonMartRoofScript: ; 483d5 (12:43d5)
jp EnableAutoTextBoxDrawing jp EnableAutoTextBoxDrawing
CeladonMartRoofScript_483d8: ; 483d8 (12:43d8) CeladonMartRoofScript_GetDrinksInBag: ; 483d8 (12:43d8)
; construct a list of all drinks in the player's bag
xor a xor a
ld [wcd37], a ld [wFilteredBagItemsCount], a
ld de, wcc5b ld de, wFilteredBagItems
ld hl, CeladonMartRoofDrinkList ld hl, CeladonMartRoofDrinkList
.asm_483e2 .loop
ld a, [hli] ld a, [hli]
and a and a
jr z, .asm_48404 jr z, .done
push hl push hl
push de push de
ld [wd11e], a ld [wd11e], a
ld b, a ld b, a
predef IsItemInBag_ predef GetQuantityOfItemInBag
pop de pop de
pop hl pop hl
ld a, b ld a, b
and a and a
jr z, .asm_483e2 jr z, .loop ; if the item isn't in the bag
ld a, [wd11e] ld a, [wd11e]
ld [de], a ld [de], a
inc de inc de
push hl push hl
ld hl, wcd37 ld hl, wFilteredBagItemsCount
inc [hl] inc [hl]
pop hl pop hl
jr .asm_483e2 jr .loop
.asm_48404 .done
ld a, $ff ld a, $ff
ld [de], a ld [de], a
ret ret
@ -39,7 +40,7 @@ CeladonMartRoofDrinkList: ; 48408 (12:4408)
db LEMONADE db LEMONADE
db $00 db $00
CeladonMartRoofScript_4840c: ; 4840c (12:440c) CeladonMartRoofScript_GiveDrinkToGirl: ; 4840c (12:440c)
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
ld hl, CeladonMartRoofText_484ee ld hl, CeladonMartRoofText_484ee
@ -48,83 +49,84 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c)
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld a, A_BUTTON | B_BUTTON ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a ld [wMenuWatchedKeys], a
ld a, [wcd37] ld a, [wFilteredBagItemsCount]
dec a dec a
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
ld a, $2 ld a, 2
ld [wTopMenuItemY], a ld [wTopMenuItemY], a
ld a, $1 ld a, 1
ld [wTopMenuItemX], a ld [wTopMenuItemX], a
ld a, [wcd37] ld a, [wFilteredBagItemsCount]
dec a dec a
ld bc, $2 ld bc, 2
ld hl, $3 ld hl, 3
call AddNTimes call AddNTimes
dec l dec l
ld b, l ld b, l
ld c, $c ld c, 12
coord hl, 0, 0 coord hl, 0, 0
call TextBoxBorder call TextBoxBorder
call UpdateSprites call UpdateSprites
call CeladonMartRoofScript_48532 call CeladonMartRoofScript_PrintDrinksInBag
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
call HandleMenuInput call HandleMenuInput
bit 1, a ; pressed b bit 1, a ; pressed b
ret nz ret nz
ld hl, wcc5b ld hl, wFilteredBagItems
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld d, $0 ld d, 0
ld e, a ld e, a
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [$ffdb], a ld [hItemToRemoveID], a
cp FRESH_WATER cp FRESH_WATER
jr z, .asm_484b6 jr z, .gaveFreshWater
cp SODA_POP cp SODA_POP
jr z, .asm_48492 jr z, .gaveSodaPop
; gave Lemonade
CheckEvent EVENT_GOT_TM49 CheckEvent EVENT_GOT_TM49
jr nz, .asm_484e0 jr nz, .alreadyGaveDrink
ld hl, CeladonMartRoofText_48515 ld hl, CeladonMartRoofText_48515
call PrintText call PrintText
call RemoveItemByIDBank12 call RemoveItemByIDBank12
lb bc, TM_49, 1 lb bc, TM_49, 1
call GiveItem call GiveItem
jr nc, .BagFull jr nc, .bagFull
ld hl, ReceivedTM49Text ld hl, ReceivedTM49Text
call PrintText call PrintText
SetEvent EVENT_GOT_TM49 SetEvent EVENT_GOT_TM49
ret ret
.asm_48492 .gaveSodaPop
CheckEvent EVENT_GOT_TM48 CheckEvent EVENT_GOT_TM48
jr nz, .asm_484e0 jr nz, .alreadyGaveDrink
ld hl, CeladonMartRoofText_48504 ld hl, CeladonMartRoofText_48504
call PrintText call PrintText
call RemoveItemByIDBank12 call RemoveItemByIDBank12
lb bc, TM_48, 1 lb bc, TM_48, 1
call GiveItem call GiveItem
jr nc, .BagFull jr nc, .bagFull
ld hl, CeladonMartRoofText_4850a ld hl, CeladonMartRoofText_4850a
call PrintText call PrintText
SetEvent EVENT_GOT_TM48 SetEvent EVENT_GOT_TM48
ret ret
.asm_484b6 .gaveFreshWater
CheckEvent EVENT_GOT_TM13 CheckEvent EVENT_GOT_TM13
jr nz, .asm_484e0 jr nz, .alreadyGaveDrink
ld hl, CeladonMartRoofText_484f3 ld hl, CeladonMartRoofText_484f3
call PrintText call PrintText
call RemoveItemByIDBank12 call RemoveItemByIDBank12
lb bc, TM_13, 1 lb bc, TM_13, 1
call GiveItem call GiveItem
jr nc, .BagFull jr nc, .bagFull
ld hl, CeladonMartRoofText_484f9 ld hl, CeladonMartRoofText_484f9
call PrintText call PrintText
SetEvent EVENT_GOT_TM13 SetEvent EVENT_GOT_TM13
ret ret
.BagFull .bagFull
ld hl, CeladonMartRoofText_48526 ld hl, CeladonMartRoofText_48526
jp PrintText jp PrintText
.asm_484e0 .alreadyGaveDrink
ld hl, CeladonMartRoofText_4852c ld hl, CeladonMartRoofText_4852c
jp PrintText jp PrintText
@ -181,11 +183,11 @@ CeladonMartRoofText_4852c: ; 4852c (12:452c)
db $0d db $0d
db "@" db "@"
CeladonMartRoofScript_48532: ; 48532 (12:4532) CeladonMartRoofScript_PrintDrinksInBag: ; 48532 (12:4532)
ld hl, wcc5b ld hl, wFilteredBagItems
xor a xor a
ld [$ffdb], a ld [hItemCounter], a
.asm_48538 .loop
ld a, [hli] ld a, [hli]
cp $ff cp $ff
ret z ret z
@ -193,15 +195,15 @@ CeladonMartRoofScript_48532: ; 48532 (12:4532)
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
coord hl, 2, 2 coord hl, 2, 2
ld a, [$ffdb] ld a, [hItemCounter]
ld bc, SCREEN_WIDTH * 2 ld bc, SCREEN_WIDTH * 2
call AddNTimes call AddNTimes
ld de, wcd6d ld de, wcd6d
call PlaceString call PlaceString
ld hl, $ffdb ld hl, hItemCounter
inc [hl] inc [hl]
pop hl pop hl
jr .asm_48538 jr .loop
CeladonMartRoofTextPointers: ; 4855b (12:455b) CeladonMartRoofTextPointers: ; 4855b (12:455b)
dw CeladonMartRoofText1 dw CeladonMartRoofText1
@ -217,24 +219,24 @@ CeladonMartRoofText1: ; 48567 (12:4567)
CeladonMartRoofText2: ; 4856c (12:456c) CeladonMartRoofText2: ; 4856c (12:456c)
TX_ASM TX_ASM
call CeladonMartRoofScript_483d8 call CeladonMartRoofScript_GetDrinksInBag
ld a, [wcd37] ld a, [wFilteredBagItemsCount]
and a and a
jr z, .asm_4858f jr z, .noDrinksInBag
ld a, $1 ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, CeladonMartRoofText4 ld hl, CeladonMartRoofText4
call PrintText call PrintText
call YesNoChoice call YesNoChoice
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jr nz, .asm_48595 jr nz, .done
call CeladonMartRoofScript_4840c call CeladonMartRoofScript_GiveDrinkToGirl
jr .asm_48595 jr .done
.asm_4858f .noDrinksInBag
ld hl, CeladonMartRoofText3 ld hl, CeladonMartRoofText3
call PrintText call PrintText
.asm_48595 .done
jp TextScriptEnd jp TextScriptEnd
CeladonMartRoofText3: ; 48598 (12:4598) CeladonMartRoofText3: ; 48598 (12:4598)

View file

@ -10,7 +10,7 @@ CeruleanHouseTrashedTextPointers: ; 1d689 (7:5689)
CeruleanHouseTrashedText1: ; 1d68f (7:568f) CeruleanHouseTrashedText1: ; 1d68f (7:568f)
TX_ASM TX_ASM
ld b, $e4 ld b, $e4
predef IsItemInBag_ predef GetQuantityOfItemInBag
and b and b
jr z, .asm_f8734 jr z, .asm_f8734
ld hl, CeruleanHouseTrashedText_1d6b0 ld hl, CeruleanHouseTrashedText_1d6b0

View file

@ -5,12 +5,11 @@ Lab4TextPointers: ; 75d34 (1d:5d34)
dw Lab4Text1 dw Lab4Text1
dw Lab4Text2 dw Lab4Text2
Lab4Script_75d38: ; 75d38 (1d:5d38) Lab4Script_GetFossilsInBag: ; 75d38 (1d:5d38)
; construct a list of all fossils in the player's bag ; construct a list of all fossils in the player's bag
xor a xor a
ld [wcd37], a ld [wFilteredBagItemsCount], a
ld de, wcc5b ld de, wFilteredBagItems
ld hl, FossilsList ld hl, FossilsList
.loop .loop
ld a, [hli] ld a, [hli]
@ -20,7 +19,7 @@ Lab4Script_75d38: ; 75d38 (1d:5d38)
push de push de
ld [wd11e], a ld [wd11e], a
ld b, a ld b, a
predef IsItemInBag_ predef GetQuantityOfItemInBag
pop de pop de
pop hl pop hl
ld a, b ld a, b
@ -32,7 +31,7 @@ Lab4Script_75d38: ; 75d38 (1d:5d38)
ld [de], a ld [de], a
inc de inc de
push hl push hl
ld hl, wcd37 ld hl, wFilteredBagItemsCount
inc [hl] inc [hl]
pop hl pop hl
jr .loop jr .loop
@ -53,8 +52,8 @@ Lab4Text1: ; 75d6c (1d:5d6c)
jr nz, .asm_75d96 jr nz, .asm_75d96
ld hl, Lab4Text_75dc6 ld hl, Lab4Text_75dc6
call PrintText call PrintText
call Lab4Script_75d38 call Lab4Script_GetFossilsInBag
ld a, [wcd37] ld a, [wFilteredBagItemsCount]
and a and a
jr z, .asm_75d8d jr z, .asm_75d8d
callba GiveFossilToCinnabarLab callba GiveFossilToCinnabarLab

View file

@ -449,13 +449,13 @@ OaksLabScript13: ; 1ce32 (7:4e32)
ld a, [W_XCOORD] ld a, [W_XCOORD]
cp $4 cp $4
; move left or right depending on where the player is standing ; move left or right depending on where the player is standing
jr nz, .asm_1ce5b jr nz, .moveLeft
ld a, $c0 ld a, NPC_MOVEMENT_RIGHT
jr .asm_1ce5d jr .next
.asm_1ce5b .moveLeft
ld a, $80 ld a, NPC_MOVEMENT_LEFT
.asm_1ce5d .next
ld [wcc5b], a ld [wNPCMovementDirections], a
ld a, $e ld a, $e
ld [W_OAKSLABCURSCRIPT], a ld [W_OAKSLABCURSCRIPT], a
@ -855,7 +855,7 @@ OaksLabScript_1d157: ; 1d157 (7:5157)
ld [hl], SPRITE_FACING_RIGHT ld [hl], SPRITE_FACING_RIGHT
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
predef StarterDex ; StarterDex predef StarterDex
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
call ReloadMapData call ReloadMapData

View file

@ -35,7 +35,7 @@ RocketHideoutElevatorScript_45741: ; 45741 (11:5741)
ld hl, RocketHideoutElavatorFloors ld hl, RocketHideoutElavatorFloors
call LoadItemList call LoadItemList
ld hl, RocketHideoutElevatorWarpMaps ld hl, RocketHideoutElevatorWarpMaps
ld de, wcc5b ld de, wElevatorWarpMaps
ld bc, RocketHideoutElevatorWarpMapsEnd - RocketHideoutElevatorWarpMaps ld bc, RocketHideoutElevatorWarpMapsEnd - RocketHideoutElevatorWarpMaps
call CopyData call CopyData
ret ret

View file

@ -22,12 +22,12 @@ Route11GateUpstairsText2: ; 4946c (12:546c)
ld a, 30 ; pokemon needed ld a, 30 ; pokemon needed
ld [hOaksAideRequirement], a ld [hOaksAideRequirement], a
ld a, ITEMFINDER ; oak's aide reward ld a, ITEMFINDER ; oak's aide reward
ld [hOaksAideItemReward], a ld [hOaksAideRewardItem], a
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
ld h, d ld h, d
ld l, e ld l, e
ld de, wcc5b ld de, wOaksAideRewardItemName
ld bc, $000d ld bc, $000d
call CopyData call CopyData
predef OaksAideScript predef OaksAideScript

View file

@ -12,11 +12,11 @@ Route15GateUpstairsText1: ; 49651 (12:5651)
ld a, 50 ; pokemon needed ld a, 50 ; pokemon needed
ld [hOaksAideRequirement], a ld [hOaksAideRequirement], a
ld a, EXP__ALL ; oak's aide reward ld a, EXP__ALL ; oak's aide reward
ld [hOaksAideItemReward], a ld [hOaksAideRewardItem], a
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
ld hl, wcd6d ld hl, wcd6d
ld de, wcc5b ld de, wOaksAideRewardItemName
ld bc, $000d ld bc, $000d
call CopyData call CopyData
predef OaksAideScript predef OaksAideScript

View file

@ -12,11 +12,11 @@ Route2GateText1: ; 5d5db (17:55db)
ld a, 10 ; pokemon needed ld a, 10 ; pokemon needed
ld [hOaksAideRequirement], a ld [hOaksAideRequirement], a
ld a, HM_05 ; oak's aide reward ld a, HM_05 ; oak's aide reward
ld [hOaksAideItemReward], a ld [hOaksAideRewardItem], a
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
ld hl, wcd6d ld hl, wcd6d
ld de, wcc5b ld de, wOaksAideRewardItemName
ld bc, $000d ld bc, $000d
call CopyData call CopyData
predef OaksAideScript predef OaksAideScript

View file

@ -35,7 +35,7 @@ SilphCoElevatorScript_457f1: ; 457f1 (11:57f1)
ld hl, SilphCoElavatorFloors ld hl, SilphCoElavatorFloors
call LoadItemList call LoadItemList
ld hl, SilphCoElevatorWarpMaps ld hl, SilphCoElevatorWarpMaps
ld de, wcc5b ld de, wElevatorWarpMaps
ld bc, SilphCoElevatorWarpMapsEnd - SilphCoElevatorWarpMaps ld bc, SilphCoElevatorWarpMapsEnd - SilphCoElevatorWarpMaps
call CopyData call CopyData
ret ret

View file

@ -53,7 +53,7 @@ VermilionCityScript0: ; 197e6 (6:57e6)
CheckEvent EVENT_SS_ANNE_LEFT CheckEvent EVENT_SS_ANNE_LEFT
jr nz, .asm_19810 jr nz, .asm_19810
ld b, S_S__TICKET ld b, S_S__TICKET
predef IsItemInBag_ predef GetQuantityOfItemInBag
ld a, b ld a, b
and a and a
ret nz ret nz
@ -171,7 +171,7 @@ VermilionCityText3: ; 198b1 (6:58b1)
ld hl, SSAnneWelcomeText9 ld hl, SSAnneWelcomeText9
call PrintText call PrintText
ld b, S_S__TICKET ld b, S_S__TICKET
predef IsItemInBag_ predef GetQuantityOfItemInBag
ld a, b ld a, b
and a and a
jr nz, .asm_198e9 jr nz, .asm_198e9

View file

@ -106,7 +106,7 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b)
xor a xor a
ld [rWY], a ld [rWY], a
ld [hWY], a ld [hWY], a
call VermilionDock_1dc94 call VermilionDock_EraseSSAnne
ld a, $90 ld a, $90
ld [hWY], a ld [hWY], a
ld a, $1 ld a, $1
@ -178,21 +178,29 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c)
jr z, .asm_1dc8e jr z, .asm_1dc8e
ret ret
VermilionDock_1dc94: ; 1dc94 (7:5c94) VermilionDock_EraseSSAnne: ; 1dc94 (7:5c94)
ld hl, wcc5b ; Fill the area the S.S. Anne occupies in BG map 0 with water tiles.
ld bc, SCREEN_WIDTH * 9 ld hl, wVermilionDockTileMapBuffer
ld a, $14 ld bc, (5 * 32) + SCREEN_WIDTH
ld a, $14 ; water tile
call FillMemory call FillMemory
ld hl, vBGMap0 + 10 * 32 ld hl, vBGMap0 + 10 * 32
ld de, wcc5b ld de, wVermilionDockTileMapBuffer
ld bc, $000c ld bc, (6 * 32) / 16
call CopyVideoData call CopyVideoData
ld hl, wOverworldMap + 10 + 7 * VERMILION_DOCK_WIDTH ; 10, 7
ld a, $d ; Replace the blocks of the lower half of the ship with water blocks. This
; leaves the upper half alone, but that doesn't matter because replacing any of
; the blocks is unnecessary because the blocks the ship occupies are south of
; the player and won't be redrawn when the player automatically walks north and
; exits the map. This code could be removed without affecting anything.
ld hl, wOverworldMap + (5 + 3) + (2 + 3) * (VERMILION_DOCK_WIDTH + 6) ; (5, 2)
ld a, $d ; water block
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld a, SFX_SS_ANNE_HORN ld a, SFX_SS_ANNE_HORN
call PlaySound call PlaySound
ld c, 120 ld c, 120

View file

@ -100,7 +100,7 @@ _OaksAideHiText:: ; 80143 (20:4143)
cont "I'm supposed to" cont "I'm supposed to"
cont "give you an" cont "give you an"
cont "@" cont "@"
TX_RAM wcc5b TX_RAM wOaksAideRewardItemName
text "!" text "!"
para "So, ", $52, "! Have" para "So, ", $52, "! Have"
@ -124,7 +124,7 @@ _OaksAideUhOhText:: ; 801e4 (20:41e4)
text " kinds" text " kinds"
line "if you want the" line "if you want the"
cont "@" cont "@"
TX_RAM wcc5b TX_RAM wOaksAideRewardItemName
text "." text "."
done done
@ -136,7 +136,7 @@ _OaksAideComeBackText:: ; 80250 (20:4250)
db $0 db $0
line "kinds, come back" line "kinds, come back"
cont "for @" cont "for @"
TX_RAM wcc5b TX_RAM wOaksAideRewardItemName
text "." text "."
done done
@ -154,7 +154,7 @@ _OaksAideHereYouGoText:: ; 8028c (20:428c)
_OaksAideGotItemText:: ; 802d9 (20:42d9) _OaksAideGotItemText:: ; 802d9 (20:42d9)
text $52, " got the" text $52, " got the"
line "@" line "@"
TX_RAM wcc5b TX_RAM wOaksAideRewardItemName
text "!@@" text "!@@"
_OaksAideNoRoomText:: ; 802ec (20:42ec) _OaksAideNoRoomText:: ; 802ec (20:42ec)
@ -162,7 +162,7 @@ _OaksAideNoRoomText:: ; 802ec (20:42ec)
line "don't have any" line "don't have any"
cont "room for the" cont "room for the"
cont "@" cont "@"
TX_RAM wcc5b TX_RAM wOaksAideRewardItemName
text "." text "."
done done
@ -363,10 +363,10 @@ _YeahText:: ; 88236 (22:4236)
_DexSeenOwnedText:: ; 8823e (22:423e) _DexSeenOwnedText:: ; 8823e (22:423e)
text "#DEX Seen:@" text "#DEX Seen:@"
TX_NUM wcc5b, 1, 3 TX_NUM wDexRatingNumMonsSeen, 1, 3
db $0 db $0
line " Owned:@" line " Owned:@"
TX_NUM wcc5c, 1, 3 TX_NUM wDexRatingNumMonsOwned, 1, 3
db "@" db "@"
_DexRatingText:: ; 88267 (22:4267) _DexRatingText:: ; 88267 (22:4267)
@ -1467,7 +1467,7 @@ _BoostedText:: ; 89be1 (22:5be1)
text "a boosted" text "a boosted"
cont "@@" cont "@@"
_ExpPointsText:: ; 89bee (22:5bee) _ExpPointsText:: ; 89bee (22:5bee)
TX_NUM wcf4b, 2, 4 TX_NUM wExpAmountGained, 2, 4
text " EXP. Points!" text " EXP. Points!"
prompt prompt

View file

@ -477,6 +477,26 @@ wNPCMovementScriptBank:: ; cc58
ds 2 ds 2
wUnusedCC5B:: ; cc5b
wVermilionDockTileMapBuffer:: ; cc5b
; 180 bytes
wOaksAideRewardItemName:: ; cc5b
wDexRatingNumMonsSeen:: ; cc5b
wFilteredBagItems:: ; cc5b
; List of bag items that has been filtered to a certain type of items,
; such as drinks or fossils.
wElevatorWarpMaps:: ; cc5b
wMonPartySpritesSavedOAM:: ; cc5b
; Saved copy of OAM for the first frame of the animation to make it easy to
; flip back from the second frame.
; $60 bytes
wTrainerCardBlkPacket:: ; cc5b wTrainerCardBlkPacket:: ; cc5b
; $40 bytes ; $40 bytes
@ -493,10 +513,13 @@ wAnimationType:: ; cc5b
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
wNPCMovementDirections:: ; cc5b wNPCMovementDirections:: ; cc5b
ds 1
wcc5b:: ds 1 ; these upcoming values below are miscellaneous storage values wDexRatingNumMonsOwned:: ; cc5c
wcc5c:: ds 1 ; used in pokedex evaluation as well ds 1
wcc5d:: ds 1 ; used in pokedex evaluation
wDexRatingText:: ; cc5d
ds 1
wSlotMachineSavedROMBank:: ; cc5e wSlotMachineSavedROMBank:: ; cc5e
; ROM back to return to when the player is done with the slot machine ; ROM back to return to when the player is done with the slot machine
@ -723,7 +746,11 @@ wInGameTradeReceiveMonSpecies::
wNPCMovementDirections2Index:: ; cd37 wNPCMovementDirections2Index:: ; cd37
wcd37:: ds 1 ; used in list menus, like the fossil lab menu or drink girl menu. Also used in link menu. wUnusedCD37:: ; cd37
wFilteredBagItemsCount:: ; cd37
; number of items in wFilteredBagItems list
ds 1
wSimulatedJoypadStatesIndex:: ; cd38 wSimulatedJoypadStatesIndex:: ; cd38
; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1 ; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
@ -1320,10 +1347,15 @@ wPartyMenuBlkPacket:: ; cf2e
; $30 bytes ; $30 bytes
ds 29 ds 29
wcf4b:: ds 1 ; storage buffer for various strings wExpAmountGained:: ; cf4b
wcf4c:: ds 1 ; used with displaying EXP value, probably also overflowed with wcf4b ; 2-byte big-endian number
; the total amount of exp a mon gained
wcf4b:: ds 2 ; storage buffer for various strings
wGainBoostedExp:: ; cf4d wGainBoostedExp:: ; cf4d
ds 1 ds 1
ds 17 ds 17
wGymCityName:: ; cf5f wGymCityName:: ; cf5f