mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Identify more uses of wBuffer1-6
This commit is contained in:
parent
826e070f04
commit
c88c4a8340
@ -1,5 +1,5 @@
|
||||
AIChooseMove:
|
||||
; Score each move in wEnemyMonMoves starting from wBuffer1. Lower is better.
|
||||
; Score each move of wEnemyMonMoves in wEnemyAIMoveScores. Lower is better.
|
||||
; Pick the move with the lowest score.
|
||||
|
||||
; Wildmons attack at random.
|
||||
@ -17,7 +17,7 @@ AIChooseMove:
|
||||
|
||||
; The default score is 20. Unusable moves are given a score of 80.
|
||||
ld a, 20
|
||||
ld hl, wBuffer1
|
||||
ld hl, wEnemyAIMoveScores
|
||||
ld [hli], a
|
||||
ld [hli], a
|
||||
ld [hli], a
|
||||
@ -37,14 +37,14 @@ AIChooseMove:
|
||||
inc hl
|
||||
jr .CheckDisabledMove
|
||||
.ScoreDisabledMove:
|
||||
ld hl, wBuffer1
|
||||
ld hl, wEnemyAIMoveScores
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld [hl], 80
|
||||
|
||||
; Don't pick moves with 0 PP.
|
||||
.CheckPP:
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonPP
|
||||
ld b, 0
|
||||
.CheckMovePP:
|
||||
@ -117,7 +117,7 @@ AIChooseMove:
|
||||
|
||||
; Decrement the scores of all moves one by one until one reaches 0.
|
||||
.DecrementScores:
|
||||
ld hl, wBuffer1
|
||||
ld hl, wEnemyAIMoveScores
|
||||
ld de, wEnemyMonMoves
|
||||
ld c, NUM_MOVES
|
||||
|
||||
@ -152,7 +152,7 @@ AIChooseMove:
|
||||
cp NUM_MOVES + 1
|
||||
jr nz, .move_loop
|
||||
|
||||
ld hl, wBuffer1
|
||||
ld hl, wEnemyAIMoveScores
|
||||
ld de, wEnemyMonMoves
|
||||
ld c, NUM_MOVES
|
||||
|
||||
@ -182,7 +182,7 @@ AIChooseMove:
|
||||
|
||||
; Randomly choose one of the moves with a score of 1
|
||||
.ChooseMove:
|
||||
ld hl, wBuffer1
|
||||
ld hl, wEnemyAIMoveScores
|
||||
call Random
|
||||
maskbits NUM_MOVES
|
||||
ld c, a
|
||||
|
@ -6,7 +6,7 @@ AI_Basic:
|
||||
; -Using status-only moves if the player can't be statused
|
||||
; -Using moves that fail if they've already been used
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -73,7 +73,7 @@ AI_Setup:
|
||||
; 50% chance to greatly encourage stat-down moves during the first turn of player's Pokemon.
|
||||
; Almost 90% chance to greatly discourage stat-modifying moves otherwise.
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -147,7 +147,7 @@ AI_Types:
|
||||
; Discourage not very effective moves unless
|
||||
; all damaging moves are of the same type.
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -234,7 +234,7 @@ AI_Types:
|
||||
AI_Offensive:
|
||||
; Greatly discourage non-damaging moves.
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -261,7 +261,7 @@ AI_Offensive:
|
||||
AI_Smart:
|
||||
; Context-specific scoring.
|
||||
|
||||
ld hl, wBuffer1
|
||||
ld hl, wEnemyAIMoveScores
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -518,7 +518,7 @@ AI_Smart_LockOn:
|
||||
|
||||
.player_locked_on
|
||||
push hl
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld c, NUM_MOVES + 1
|
||||
|
||||
@ -2893,7 +2893,7 @@ AI_Opportunist:
|
||||
ret c
|
||||
|
||||
.lowhp
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld c, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -2987,7 +2987,7 @@ AI_Aggressive:
|
||||
jr z, .done
|
||||
|
||||
; Discourage moves that do less damage unless they're reckless too.
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, 0
|
||||
.checkmove2
|
||||
@ -3060,7 +3060,7 @@ AI_Cautious:
|
||||
and a
|
||||
ret z
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld c, NUM_MOVES + 1
|
||||
.loop
|
||||
@ -3098,7 +3098,7 @@ INCLUDE "data/battle/ai/residual_moves.asm"
|
||||
AI_Status:
|
||||
; Dismiss status moves that don't affect the player.
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld b, NUM_MOVES + 1
|
||||
.checkmove
|
||||
@ -3161,7 +3161,7 @@ AI_Risky:
|
||||
; Use any move that will KO the target.
|
||||
; Risky moves will often be an exception (see below).
|
||||
|
||||
ld hl, wBuffer1 - 1
|
||||
ld hl, wEnemyAIMoveScores - 1
|
||||
ld de, wEnemyMonMoves
|
||||
ld c, NUM_MOVES + 1
|
||||
.checkmove
|
||||
|
@ -5358,7 +5358,7 @@ MoveSelectionScreen:
|
||||
hlcoord 6, 17 - NUM_MOVES - 4
|
||||
.got_start_coord
|
||||
ld a, SCREEN_WIDTH
|
||||
ld [wBuffer1], a
|
||||
ld [wListMovesLineSpacing], a
|
||||
predef ListMoves
|
||||
|
||||
ld b, 5
|
||||
@ -6334,8 +6334,7 @@ LoadEnemyMon:
|
||||
ld [hli], a
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
; Make sure the predef knows this isn't a partymon
|
||||
ld [wEvolutionOldSpecies], a
|
||||
ld [wSkipMovesBeforeLevelUp], a
|
||||
; Fill moves based on level
|
||||
predef FillMoves
|
||||
|
||||
@ -7616,9 +7615,10 @@ SendOutMonText:
|
||||
and a
|
||||
jr z, .not_linked
|
||||
|
||||
ld hl, GoMonText ; If we're in a LinkBattle print just "Go <PlayerMon>"
|
||||
|
||||
ld a, [wBattleHasJustStarted] ; unless this (unidentified) variable is set
|
||||
; If we're in a LinkBattle print just "Go <PlayerMon>"
|
||||
; unless DoBattle already set [wBattleHasJustStarted]
|
||||
ld hl, GoMonText
|
||||
ld a, [wBattleHasJustStarted]
|
||||
and a
|
||||
jr nz, .skip_to_textbox
|
||||
|
||||
|
@ -47,7 +47,7 @@ ShowOTTrainerMonsRemaining:
|
||||
StageBallTilesData:
|
||||
ld a, [de]
|
||||
push af
|
||||
ld de, wBuffer1
|
||||
ld de, wBattleHUDTiles
|
||||
ld c, PARTY_LENGTH
|
||||
ld a, $34 ; empty slot
|
||||
.loop1
|
||||
@ -56,7 +56,8 @@ StageBallTilesData:
|
||||
dec c
|
||||
jr nz, .loop1
|
||||
pop af
|
||||
ld de, wBuffer1
|
||||
|
||||
ld de, wBattleHUDTiles
|
||||
.loop2
|
||||
push af
|
||||
call .GetHUDTile
|
||||
@ -200,7 +201,7 @@ LinkBattle_TrainerHuds:
|
||||
jp LoadTrainerHudOAM
|
||||
|
||||
LoadTrainerHudOAM:
|
||||
ld de, wBuffer1
|
||||
ld de, wBattleHUDTiles
|
||||
ld c, PARTY_LENGTH
|
||||
.loop
|
||||
ld a, [wPlaceBallsY]
|
||||
|
@ -616,8 +616,8 @@ DayCare_InitBreeding:
|
||||
xor a
|
||||
ld [wEggMonItem], a
|
||||
ld de, wEggMonMoves
|
||||
xor a
|
||||
ld [wBuffer1], a
|
||||
xor a ; FALSE
|
||||
ld [wSkipMovesBeforeLevelUp], a
|
||||
predef FillMoves
|
||||
farcall InitEggMoves
|
||||
ld hl, wEggMonID
|
||||
|
@ -17,19 +17,19 @@ HealMachineAnim:
|
||||
; 1: Left (Elm's Lab)
|
||||
; 2: Up (Hall of Fame)
|
||||
ld a, [wScriptVar]
|
||||
ld [wBuffer1], a
|
||||
ld [wHealMachineAnimType], a
|
||||
ldh a, [rOBP1]
|
||||
ld [wBuffer2], a
|
||||
ld [wHealMachineTempOBP1], a
|
||||
call .DoJumptableFunctions
|
||||
ld a, [wBuffer2]
|
||||
ld a, [wHealMachineTempOBP1]
|
||||
call DmgToCgbObjPal1
|
||||
ret
|
||||
|
||||
.DoJumptableFunctions:
|
||||
xor a
|
||||
ld [wBuffer3], a
|
||||
.jumpable_loop
|
||||
ld a, [wBuffer1]
|
||||
ld [wHealMachineAnimState], a
|
||||
.jumptable_loop
|
||||
ld a, [wHealMachineAnimType]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .Pointers
|
||||
@ -38,17 +38,17 @@ HealMachineAnim:
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, [wBuffer3]
|
||||
ld a, [wHealMachineAnimState]
|
||||
ld e, a
|
||||
inc a
|
||||
ld [wBuffer3], a
|
||||
ld [wHealMachineAnimState], a
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
cp HEALMACHINESTATE_FINISH
|
||||
jr z, .finish
|
||||
ld hl, .Jumptable
|
||||
rst JumpTable
|
||||
jr .jumpable_loop
|
||||
jr .jumptable_loop
|
||||
|
||||
.finish
|
||||
ret
|
||||
@ -237,7 +237,7 @@ INCLUDE "gfx/overworld/heal_machine.pal"
|
||||
|
||||
.PlaceHealingMachineTile:
|
||||
push bc
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wHealMachineAnimType]
|
||||
bcpixel 2, 4
|
||||
cp HEALMACHINE_ELMS_LAB
|
||||
jr z, .okay
|
||||
|
@ -125,7 +125,7 @@ CheckForLuckyNumberWinners:
|
||||
push hl
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld hl, wBuffer1
|
||||
ld hl, wMonIDDigitsBuffer
|
||||
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
|
||||
call PrintNum
|
||||
ld hl, wLuckyNumberDigitsBuffer
|
||||
@ -135,7 +135,7 @@ CheckForLuckyNumberWinners:
|
||||
ld b, 5
|
||||
ld c, 0
|
||||
ld hl, wLuckyNumberDigitsBuffer + 4
|
||||
ld de, wBuffer1 + 4
|
||||
ld de, wMonIDDigitsBuffer + 4
|
||||
.loop
|
||||
ld a, [de]
|
||||
cp [hl]
|
||||
|
@ -361,15 +361,15 @@ PlayerWithdrawItemMenu:
|
||||
|
||||
.withdraw
|
||||
ld a, [wItemQuantityChangeBuffer]
|
||||
ld [wBuffer1], a ; quantity
|
||||
ld [wPCItemQuantityChangeBuffer], a
|
||||
ld a, [wCurItemQuantity]
|
||||
ld [wBuffer2], a
|
||||
ld [wPCItemQuantity], a
|
||||
ld hl, wNumItems
|
||||
call ReceiveItem
|
||||
jr nc, .PackFull
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wPCItemQuantityChangeBuffer]
|
||||
ld [wItemQuantityChangeBuffer], a
|
||||
ld a, [wBuffer2]
|
||||
ld a, [wPCItemQuantity]
|
||||
ld [wCurItemQuantity], a
|
||||
ld hl, wNumPCItems
|
||||
call TossItem
|
||||
@ -490,15 +490,15 @@ PlayerDepositItemMenu:
|
||||
ret
|
||||
|
||||
.tossable
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wPCItemQuantityChangeBuffer]
|
||||
push af
|
||||
ld a, [wBuffer2]
|
||||
ld a, [wPCItemQuantity]
|
||||
push af
|
||||
call .DepositItem
|
||||
pop af
|
||||
ld [wBuffer2], a
|
||||
ld [wPCItemQuantity], a
|
||||
pop af
|
||||
ld [wBuffer1], a
|
||||
ld [wPCItemQuantityChangeBuffer], a
|
||||
ret
|
||||
|
||||
.DepositItem:
|
||||
@ -522,15 +522,15 @@ PlayerDepositItemMenu:
|
||||
|
||||
.ContinueDeposit:
|
||||
ld a, [wItemQuantityChangeBuffer]
|
||||
ld [wBuffer1], a
|
||||
ld [wPCItemQuantityChangeBuffer], a
|
||||
ld a, [wCurItemQuantity]
|
||||
ld [wBuffer2], a
|
||||
ld [wPCItemQuantity], a
|
||||
ld hl, wNumPCItems
|
||||
call ReceiveItem
|
||||
jr nc, .NoRoomInPC
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wPCItemQuantityChangeBuffer]
|
||||
ld [wItemQuantityChangeBuffer], a
|
||||
ld a, [wBuffer2]
|
||||
ld a, [wPCItemQuantity]
|
||||
ld [wCurItemQuantity], a
|
||||
ld hl, wNumItems
|
||||
call TossItem
|
||||
|
@ -197,11 +197,11 @@ NoTreeMon:
|
||||
|
||||
GetTreeScore:
|
||||
call .CoordScore
|
||||
ld [wBuffer1], a
|
||||
ld [wTreeMonCoordScore], a
|
||||
call .OTIDScore
|
||||
ld [wBuffer2], a
|
||||
ld [wTreeMonOTIDScore], a
|
||||
ld c, a
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wTreeMonCoordScore]
|
||||
sub c
|
||||
jr z, .rare
|
||||
jr nc, .ok
|
||||
|
@ -8,9 +8,9 @@ SelectQuantityToBuy:
|
||||
farcall GetItemPrice
|
||||
RooftopSale_SelectQuantityToBuy:
|
||||
ld a, d
|
||||
ld [wBuffer1], a
|
||||
ld [wBuySellItemPrice + 0], a
|
||||
ld a, e
|
||||
ld [wBuffer2], a
|
||||
ld [wBuySellItemPrice + 1], a
|
||||
ld hl, BuyItem_MenuHeader
|
||||
call LoadMenuHeader
|
||||
call Toss_Sell_Loop
|
||||
@ -19,9 +19,9 @@ RooftopSale_SelectQuantityToBuy:
|
||||
SelectQuantityToSell:
|
||||
farcall GetItemPrice
|
||||
ld a, d
|
||||
ld [wBuffer1], a
|
||||
ld [wBuySellItemPrice + 0], a
|
||||
ld a, e
|
||||
ld [wBuffer2], a
|
||||
ld [wBuySellItemPrice + 1], a
|
||||
ld hl, SellItem_MenuHeader
|
||||
call LoadMenuHeader
|
||||
call Toss_Sell_Loop
|
||||
@ -159,9 +159,9 @@ DisplaySellingPrice:
|
||||
BuySell_MultiplyPrice:
|
||||
xor a
|
||||
ldh [hMultiplicand + 0], a
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wBuySellItemPrice + 0]
|
||||
ldh [hMultiplicand + 1], a
|
||||
ld a, [wBuffer2]
|
||||
ld a, [wBuySellItemPrice + 1]
|
||||
ldh [hMultiplicand + 2], a
|
||||
ld a, [wItemQuantityChangeBuffer]
|
||||
ldh [hMultiplier], a
|
||||
|
@ -449,6 +449,7 @@ Gen2ToGen2LinkComms:
|
||||
ld [wOtherTrainerClass], a
|
||||
call ClearScreen
|
||||
farcall Link_WaitBGMap
|
||||
|
||||
ld hl, wOptions
|
||||
ld a, [hl]
|
||||
push af
|
||||
@ -460,8 +461,6 @@ Gen2ToGen2LinkComms:
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
call ReturnToMapFromSubmenu
|
||||
|
||||
; LET'S DO THIS
|
||||
ld a, [wDisableTextAcceleration]
|
||||
push af
|
||||
ld a, 1
|
||||
@ -478,6 +477,7 @@ Gen2ToGen2LinkComms:
|
||||
pop af
|
||||
ldh [rIF], a
|
||||
|
||||
; LET'S DO THIS
|
||||
predef StartBattle
|
||||
|
||||
ldh a, [rIF]
|
||||
@ -492,6 +492,7 @@ Gen2ToGen2LinkComms:
|
||||
ld [wDisableTextAcceleration], a
|
||||
pop af
|
||||
ld [wOptions], a
|
||||
|
||||
farcall LoadPokemonData
|
||||
jp ExitLinkCommunications
|
||||
|
||||
|
@ -206,9 +206,10 @@ StartMenu_PrintBugContestStatus:
|
||||
|
||||
FindApricornsInBag:
|
||||
; Checks the bag for Apricorns.
|
||||
ld hl, wBuffer1
|
||||
ld hl, wKurtApricornCount
|
||||
xor a
|
||||
ld [hli], a
|
||||
assert wKurtApricornCount + 1 == wKurtApricornItems
|
||||
dec a
|
||||
ld bc, 10
|
||||
call ByteFill
|
||||
@ -232,15 +233,15 @@ FindApricornsInBag:
|
||||
jr .loop
|
||||
|
||||
.done
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wKurtApricornCount]
|
||||
and a
|
||||
ret nz
|
||||
scf
|
||||
ret
|
||||
|
||||
.addtobuffer
|
||||
.addtobuffer:
|
||||
push hl
|
||||
ld hl, wBuffer1
|
||||
ld hl, wKurtApricornCount
|
||||
inc [hl]
|
||||
ld e, [hl]
|
||||
ld d, 0
|
||||
|
@ -10,17 +10,17 @@ _PlayerDecorationMenu:
|
||||
push af
|
||||
ld hl, .MenuHeader
|
||||
call LoadMenuHeader
|
||||
xor a
|
||||
ld [wBuffer5], a
|
||||
ld a, $1
|
||||
ld [wBuffer6], a
|
||||
xor a ; FALSE
|
||||
ld [wChangedDecorations], a
|
||||
ld a, $1 ; bed
|
||||
ld [wCurDecorationCategory], a
|
||||
.top_loop
|
||||
ld a, [wBuffer6]
|
||||
ld a, [wCurDecorationCategory]
|
||||
ld [wMenuCursorBuffer], a
|
||||
call .FindCategoriesWithOwnedDecos
|
||||
call DoNthMenu
|
||||
ld a, [wMenuCursorY]
|
||||
ld [wBuffer6], a
|
||||
ld [wCurDecorationCategory], a
|
||||
jr c, .exit_menu
|
||||
ld a, [wMenuSelection]
|
||||
ld hl, .pointers
|
||||
@ -31,7 +31,7 @@ _PlayerDecorationMenu:
|
||||
call ExitMenu
|
||||
pop af
|
||||
ld [wWhichIndexSet], a
|
||||
ld a, [wBuffer5]
|
||||
ld a, [wChangedDecorations]
|
||||
ld c, a
|
||||
ret
|
||||
|
||||
@ -71,7 +71,7 @@ _PlayerDecorationMenu:
|
||||
xor a
|
||||
ld [wWhichIndexSet], a
|
||||
call .ClearStringBuffer2
|
||||
call .FindOwndDecos
|
||||
call .FindOwnedDecos
|
||||
ld a, 7
|
||||
call .AppendToStringBuffer2
|
||||
ld hl, wStringBuffer2
|
||||
@ -98,7 +98,7 @@ _PlayerDecorationMenu:
|
||||
ld [hl], a
|
||||
ret
|
||||
|
||||
.FindOwndDecos:
|
||||
.FindOwnedDecos:
|
||||
ld hl, .dw
|
||||
.loop
|
||||
ld a, [hli]
|
||||
@ -642,12 +642,12 @@ DecoAction_putawaybigdoll:
|
||||
|
||||
DecoAction_TrySetItUp:
|
||||
ld a, [hl]
|
||||
ld [wBuffer1], a
|
||||
ld [wCurDecoration], a
|
||||
push hl
|
||||
call DecoAction_SetItUp
|
||||
jr c, .failed
|
||||
ld a, 1
|
||||
ld [wBuffer5], a
|
||||
ld a, TRUE
|
||||
ld [wChangedDecorations], a
|
||||
pop hl
|
||||
ld a, [wMenuSelection]
|
||||
ld [hl], a
|
||||
@ -661,7 +661,7 @@ DecoAction_TrySetItUp:
|
||||
|
||||
DecoAction_SetItUp:
|
||||
; See if there's anything of the same type already out
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wCurDecoration]
|
||||
and a
|
||||
jr z, .nothingthere
|
||||
; See if that item is already out
|
||||
@ -673,7 +673,7 @@ DecoAction_SetItUp:
|
||||
ld a, [wMenuSelection]
|
||||
ld hl, wStringBuffer4
|
||||
call GetDecorationName
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wCurDecoration]
|
||||
ld hl, wStringBuffer3
|
||||
call GetDecorationName
|
||||
ld hl, PutAwayAndSetUpText
|
||||
@ -699,16 +699,16 @@ DecoAction_SetItUp:
|
||||
DecoAction_TryPutItAway:
|
||||
; If there is no item of that type already set, there is nothing to put away.
|
||||
ld a, [hl]
|
||||
ld [wBuffer1], a
|
||||
ld [wCurDecoration], a
|
||||
xor a
|
||||
ld [hl], a
|
||||
ld a, [wBuffer1]
|
||||
ld a, [wCurDecoration]
|
||||
and a
|
||||
jr z, .nothingthere
|
||||
; Put it away.
|
||||
ld a, $1
|
||||
ld [wBuffer5], a
|
||||
ld a, [wBuffer1]
|
||||
ld a, TRUE
|
||||
ld [wChangedDecorations], a
|
||||
ld a, [wCurDecoration]
|
||||
ld [wMenuSelection], a
|
||||
ld hl, wStringBuffer3
|
||||
call GetDecorationName
|
||||
@ -729,8 +729,8 @@ DecoAction_setupornament:
|
||||
jr c, .cancel
|
||||
call DecoAction_SetItUp_Ornament
|
||||
jr c, .cancel
|
||||
ld a, $1
|
||||
ld [wBuffer5], a
|
||||
ld a, TRUE
|
||||
ld [wChangedDecorations], a
|
||||
jr DecoAction_FinishUp_Ornament
|
||||
|
||||
.cancel
|
||||
@ -816,8 +816,8 @@ DecoAction_PutItAway_Ornament:
|
||||
jr z, .nothingthere
|
||||
ld hl, wStringBuffer3
|
||||
call GetDecorationName
|
||||
ld a, $1
|
||||
ld [wBuffer5], a
|
||||
ld a, TRUE
|
||||
ld [wChangedDecorations], a
|
||||
xor a
|
||||
ld [wSelectedDecoration], a
|
||||
ld hl, PutAwayTheDecoText
|
||||
@ -843,9 +843,9 @@ DecoAction_AskWhichSide:
|
||||
call CopyMenuData
|
||||
jr c, .nope
|
||||
ld a, [wMenuCursorY]
|
||||
cp 3
|
||||
cp 3 ; cancel
|
||||
jr z, .nope
|
||||
ld [wBuffer2], a
|
||||
ld [wSelectedDecorationSide], a
|
||||
call QueryWhichSide
|
||||
ld a, [hl]
|
||||
ld [wSelectedDecoration], a
|
||||
@ -861,9 +861,10 @@ DecoAction_AskWhichSide:
|
||||
QueryWhichSide:
|
||||
ld hl, wDecoRightOrnament
|
||||
ld de, wDecoLeftOrnament
|
||||
ld a, [wBuffer2]
|
||||
cp 1
|
||||
ld a, [wSelectedDecorationSide]
|
||||
cp 1 ; right side
|
||||
ret z
|
||||
; left side, swap hl and de
|
||||
push hl
|
||||
ld h, d
|
||||
ld l, e
|
||||
|
@ -261,15 +261,15 @@ DoMysteryGiftIfDayHasPassed:
|
||||
call OpenSRAM
|
||||
ld hl, sMysteryGiftTimer
|
||||
ld a, [hli]
|
||||
ld [wBuffer1], a
|
||||
ld [wTempMysteryGiftTimer], a
|
||||
ld a, [hl]
|
||||
ld [wBuffer2], a
|
||||
ld [wTempMysteryGiftTimer + 1], a
|
||||
call CloseSRAM
|
||||
|
||||
ld hl, wBuffer1
|
||||
ld hl, wTempMysteryGiftTimer
|
||||
call CheckDayDependentEventHL
|
||||
jr nc, .not_timed_out
|
||||
ld hl, wBuffer1
|
||||
ld hl, wTempMysteryGiftTimer
|
||||
call InitOneDayCountdown
|
||||
call CloseSRAM
|
||||
farcall ResetDailyMysteryGiftLimitIfUnlocked
|
||||
@ -277,7 +277,7 @@ DoMysteryGiftIfDayHasPassed:
|
||||
.not_timed_out
|
||||
ld a, BANK(sMysteryGiftTimer)
|
||||
call OpenSRAM
|
||||
ld hl, wBuffer1
|
||||
ld hl, wTempMysteryGiftTimer
|
||||
ld a, [hli]
|
||||
ld [sMysteryGiftTimer], a
|
||||
ld a, [hl]
|
||||
|
@ -62,7 +62,7 @@ Phone_FindOpenSlot:
|
||||
|
||||
GetRemainingSpaceInPhoneList:
|
||||
xor a
|
||||
ld [wBuffer1], a
|
||||
ld [wRegisteredPhoneNumbers], a
|
||||
ld hl, PermanentNumbers
|
||||
.loop
|
||||
ld a, [hli]
|
||||
@ -76,7 +76,7 @@ GetRemainingSpaceInPhoneList:
|
||||
ld c, a
|
||||
call _CheckCellNum
|
||||
jr c, .permanent
|
||||
ld hl, wBuffer1
|
||||
ld hl, wRegisteredPhoneNumbers
|
||||
inc [hl]
|
||||
.permanent
|
||||
pop hl
|
||||
@ -87,7 +87,7 @@ GetRemainingSpaceInPhoneList:
|
||||
|
||||
.done
|
||||
ld a, CONTACT_LIST_SIZE
|
||||
ld hl, wBuffer1
|
||||
ld hl, wRegisteredPhoneNumbers
|
||||
sub [hl]
|
||||
ret
|
||||
|
||||
|
@ -509,7 +509,7 @@ FillMoves:
|
||||
ld a, [wCurPartyLevel]
|
||||
cp b
|
||||
jp c, .done
|
||||
ld a, [wEvolutionOldSpecies]
|
||||
ld a, [wSkipMovesBeforeLevelUp]
|
||||
and a
|
||||
jr z, .CheckMove
|
||||
ld a, [wPrevPartyLevel]
|
||||
|
@ -142,7 +142,7 @@ ForgetMove:
|
||||
call Textbox
|
||||
hlcoord 5 + 2, 2 + 2
|
||||
ld a, SCREEN_WIDTH * 2
|
||||
ld [wBuffer1], a
|
||||
ld [wListMovesLineSpacing], a
|
||||
predef ListMoves
|
||||
; w2DMenuData
|
||||
ld a, $4
|
||||
|
@ -322,7 +322,8 @@ InitMail:
|
||||
|
||||
; initialize wMailboxCount from sMailboxCount
|
||||
ld hl, wMailboxCount
|
||||
ld [hli], a ; now hl = wMailboxItems
|
||||
ld [hli], a
|
||||
assert wMailboxCount + 1 == wMailboxItems
|
||||
and a
|
||||
jr z, .done ; if no mail, we're done
|
||||
|
||||
|
@ -1,3 +1,17 @@
|
||||
; MailGFXPointers indexes
|
||||
; LoadMailPalettes.MailPals indexes (see gfx/mail/mail.pal)
|
||||
const_def
|
||||
const FLOWER_MAIL_INDEX ; 0
|
||||
const SURF_MAIL_INDEX ; 1
|
||||
const LITEBLUEMAIL_INDEX ; 2
|
||||
const PORTRAITMAIL_INDEX ; 3
|
||||
const LOVELY_MAIL_INDEX ; 4
|
||||
const EON_MAIL_INDEX ; 5
|
||||
const MORPH_MAIL_INDEX ; 6
|
||||
const BLUESKY_MAIL_INDEX ; 7
|
||||
const MUSIC_MAIL_INDEX ; 8
|
||||
const MIRAGE_MAIL_INDEX ; 9
|
||||
|
||||
ReadPartyMonMail:
|
||||
ld a, [wCurPartyMon]
|
||||
ld hl, sPartyMail
|
||||
@ -35,7 +49,7 @@ ReadAnyMail:
|
||||
call .LoadGFX
|
||||
call EnableLCD
|
||||
call WaitBGMap
|
||||
ld a, [wBuffer3]
|
||||
ld a, [wCurMailIndex]
|
||||
ld e, a
|
||||
farcall LoadMailPalettes
|
||||
call SetPalettes
|
||||
@ -72,13 +86,13 @@ ReadAnyMail:
|
||||
call OpenSRAM
|
||||
ld de, sPartyMon1MailAuthorID - sPartyMon1Mail
|
||||
add hl, de
|
||||
ld a, [hli] ; author id
|
||||
ld [wCurMailAuthorID], a
|
||||
ld a, [hli]
|
||||
ld [wBuffer1], a
|
||||
ld a, [hli]
|
||||
ld [wBuffer2], a
|
||||
ld a, [hli]
|
||||
ld [wCurMailAuthorID + 1], a
|
||||
ld a, [hli] ; species
|
||||
ld [wCurPartySpecies], a
|
||||
ld b, [hl]
|
||||
ld b, [hl] ; type
|
||||
call CloseSRAM
|
||||
ld hl, MailGFXPointers
|
||||
ld c, 0
|
||||
@ -99,7 +113,7 @@ ReadAnyMail:
|
||||
|
||||
.got_pointer
|
||||
ld a, c
|
||||
ld [wBuffer3], a
|
||||
ld [wCurMailIndex], a
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
@ -111,6 +125,7 @@ ReadAnyMail:
|
||||
ret
|
||||
|
||||
MailGFXPointers:
|
||||
; entries correspond to *MAIL_INDEX constants
|
||||
dbw FLOWER_MAIL, LoadFlowerMailGFX
|
||||
dbw SURF_MAIL, LoadSurfMailGFX
|
||||
dbw LITEBLUEMAIL, LoadLiteBlueMailGFX
|
||||
@ -121,7 +136,7 @@ MailGFXPointers:
|
||||
dbw BLUESKY_MAIL, LoadBlueSkyMailGFX
|
||||
dbw MUSIC_MAIL, LoadMusicMailGFX
|
||||
dbw MIRAGE_MAIL, LoadMirageMailGFX
|
||||
db -1
|
||||
db -1 ; end
|
||||
|
||||
LoadSurfMailGFX:
|
||||
push bc
|
||||
@ -697,12 +712,12 @@ MailGFX_PlaceMessage:
|
||||
ld a, [de]
|
||||
and a
|
||||
ret z
|
||||
ld a, [wBuffer3]
|
||||
ld a, [wCurMailIndex]
|
||||
hlcoord 8, 14
|
||||
cp $3 ; PORTRAITMAIL
|
||||
cp PORTRAITMAIL_INDEX
|
||||
jr z, .place_author
|
||||
hlcoord 6, 14
|
||||
cp $6 ; MORPH_MAIL
|
||||
cp MORPH_MAIL_INDEX
|
||||
jr z, .place_author
|
||||
hlcoord 5, 14
|
||||
|
||||
|
@ -1145,7 +1145,7 @@ SetUpMoveList:
|
||||
ld bc, NUM_MOVES
|
||||
call CopyBytes
|
||||
ld a, SCREEN_WIDTH * 2
|
||||
ld [wBuffer1], a
|
||||
ld [wListMovesLineSpacing], a
|
||||
hlcoord 2, 3
|
||||
predef ListMoves
|
||||
hlcoord 10, 4
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user