# Conflicts:
#	audio/engine.asm
#	constants/gfx_constants.asm
#	constants/map_data_constants.asm
#	constants/pokemon_data_constants.asm
#	constants/sprite_constants.asm
#	constants/wram_constants.asm
#	data/maps/data.asm
#	engine/battle/ai/scoring.asm
#	engine/battle/core.asm
#	engine/battle/effect_commands.asm
#	engine/battle/misc.asm
#	engine/battle_anims/getpokeballwobble.asm
#	engine/breeding.asm
#	engine/buy_sell_toss.asm
#	engine/decorations.asm
#	engine/events/battle_tower/battle_tower.asm
#	engine/events/battle_tower/rules.asm
#	engine/events/buena.asm
#	engine/events/bug_contest/contest_2.asm
#	engine/events/daycare.asm
#	engine/events/dratini.asm
#	engine/events/halloffame.asm
#	engine/events/happiness_egg.asm
#	engine/events/kurt.asm
#	engine/events/lucky_number.asm
#	engine/events/magnet_train.asm
#	engine/events/overworld.asm
#	engine/events/pokerus/pokerus.asm
#	engine/events/print_unown.asm
#	engine/events/print_unown_2.asm
#	engine/events/unown_walls.asm
#	engine/item_effects.asm
#	engine/link.asm
#	engine/mon_menu.asm
#	engine/player_object.asm
#	engine/routines/playslowcry.asm
#	engine/scripting.asm
#	engine/search.asm
#	engine/search2.asm
#	engine/specials.asm
#	engine/start_menu.asm
#	engine/timeset.asm
#	home/battle_vars.asm
#	home/map.asm
#	maps/GoldenrodUndergroundSwitchRoomEntrances.asm
#	maps/IlexForest.asm
#	maps/KrissHouse2F.asm
#	maps/Route39Barn.asm
#	mobile/mobile_12_2.asm
#	mobile/mobile_40.asm
#	mobile/mobile_5f.asm
#	wram.asm
This commit is contained in:
Rangi
2018-02-03 18:21:53 -05:00
367 changed files with 8920 additions and 8922 deletions

View File

@@ -12,7 +12,7 @@ AI_SwitchOrTryItem: ; 38000
farcall CheckEnemyLockedIn
ret nz
ld a, [PlayerSubStatus5]
ld a, [wPlayerSubStatus5]
bit SUBSTATUS_CANT_RUN, a
jr nz, DontSwitch
@@ -21,11 +21,11 @@ AI_SwitchOrTryItem: ; 38000
jr nz, DontSwitch
ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH
ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers
ld a, [wInBattleTowerBattle] ; always load the first trainer class in wTrainerClass for BattleTower-Trainers
and a
jr nz, .ok
ld a, [TrainerClass]
ld a, [wTrainerClass]
dec a
ld bc, NUM_TRAINER_ATTRIBUTES
call AddNTimes
@@ -151,7 +151,7 @@ SwitchSometimes: ; 380c1
CheckSubstatusCantRun: ; 380ff
ld a, [EnemySubStatus5]
ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
; 38105
@@ -159,7 +159,7 @@ CheckSubstatusCantRun: ; 380ff
AI_TryItem: ; 38105
; items are not allowed in the BattleTower
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -172,7 +172,7 @@ AI_TryItem: ; 38105
call .IsHighestLevel
ret nc
ld a, [TrainerClass]
ld a, [wTrainerClass]
dec a
ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH
ld bc, NUM_TRAINER_ATTRIBUTES
@@ -226,29 +226,29 @@ AI_TryItem: ; 38105
inc a
ld [wEnemyGoesFirst], a
ld hl, EnemySubStatus3
ld hl, wEnemySubStatus3
res SUBSTATUS_BIDE, [hl]
xor a
ld [EnemyFuryCutterCount], a
ld [EnemyProtectCount], a
ld [wEnemyFuryCutterCount], a
ld [wEnemyProtectCount], a
ld [wEnemyRageCounter], a
ld hl, EnemySubStatus4
ld hl, wEnemySubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
ld [LastEnemyCounterMove], a
ld [wLastEnemyCounterMove], a
scf
ret
.IsHighestLevel: ; 38170
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
ld d, a
ld e, 0
ld hl, OTPartyMon1Level
ld hl, wOTPartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
.next
ld a, [hl]
@@ -260,8 +260,8 @@ AI_TryItem: ; 38105
dec d
jr nz, .next
ld a, [CurOTMon]
ld hl, OTPartyMon1Level
ld a, [wCurOTMon]
ld hl, wOTPartyMon1Level
call AddNTimes
ld a, [hl]
cp e
@@ -302,7 +302,7 @@ AI_Items: ; 39196
; 381ca
.Status: ; 381ca (e:41ca)
ld a, [EnemyMonStatus]
ld a, [wEnemyMonStatus]
and a
jp z, .DontUse
@@ -318,17 +318,17 @@ AI_Items: ; 39196
jp .DontUse
.StatusCheckContext:
ld a, [EnemySubStatus5]
ld a, [wEnemySubStatus5]
bit SUBSTATUS_TOXIC, a
jr z, .FailToxicCheck
ld a, [EnemyToxicCount]
ld a, [wEnemyToxicCount]
cp 4
jr c, .FailToxicCheck
call Random
cp 1 + 50 percent
jp c, .Use
.FailToxicCheck:
ld a, [EnemyMonStatus]
ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP
jp z, .DontUse
jp .Use
@@ -419,8 +419,8 @@ AI_Items: ; 39196
callfar AICheckEnemyMaxHP
jr c, .dont_use
push bc
ld de, EnemyMonMaxHP + 1
ld hl, EnemyMonHP + 1
ld de, wEnemyMonMaxHP + 1
ld hl, wEnemyMonHP + 1
ld a, [de]
sub [hl]
jr z, .check_40_percent
@@ -509,7 +509,7 @@ AI_Items: ; 39196
; 3834d
.XItem: ; 3834d (e:434d)
ld a, [EnemyTurnsTaken]
ld a, [wEnemyTurnsTaken]
and a
jr nz, .notfirstturnout
ld a, [bc]
@@ -571,37 +571,37 @@ EnemyUsedFullHeal: ; 383a3 (e:43a3)
EnemyUsedMaxPotion: ; 383ae (e:43ae)
ld a, MAX_POTION
ld [CurEnemyItem], a
ld [wCurEnemyItem], a
jr FullRestoreContinue
EnemyUsedFullRestore: ; 383b5 (e:43b5)
call AI_HealStatus
ld a, FULL_RESTORE
ld [CurEnemyItem], a
ld hl, EnemySubStatus3
ld [wCurEnemyItem], a
ld hl, wEnemySubStatus3
res SUBSTATUS_CONFUSED, [hl]
xor a
ld [EnemyConfuseCount], a
ld [wEnemyConfuseCount], a
FullRestoreContinue: ; 383c6
ld de, wCurHPAnimOldHP
ld hl, EnemyMonHP + 1
ld hl, wEnemyMonHP + 1
ld a, [hld]
ld [de], a
inc de
ld a, [hl]
ld [de], a
inc de
ld hl, EnemyMonMaxHP + 1
ld hl, wEnemyMonMaxHP + 1
ld a, [hld]
ld [de], a
inc de
ld [wCurHPAnimMaxHP], a
ld [EnemyMonHP + 1], a
ld [wEnemyMonHP + 1], a
ld a, [hl]
ld [de], a
ld [wCurHPAnimMaxHP + 1], a
ld [EnemyMonHP], a
ld [wEnemyMonHP], a
jr EnemyPotionFinish
; 383e8 (e:43e8)
@@ -620,8 +620,8 @@ EnemyUsedHyperPotion: ; 383f4 (e:43f4)
ld b, 200
EnemyPotionContinue: ; 383f8
ld [CurEnemyItem], a
ld hl, EnemyMonHP + 1
ld [wCurEnemyItem], a
ld hl, wEnemyMonHP + 1
ld a, [hl]
ld [wCurHPAnimOldHP], a
add b
@@ -638,7 +638,7 @@ EnemyPotionContinue: ; 383f8
inc hl
ld a, [hld]
ld b, a
ld de, EnemyMonMaxHP + 1
ld de, wEnemyMonMaxHP + 1
ld a, [de]
dec de
ld [wCurHPAnimMaxHP], a
@@ -671,9 +671,9 @@ EnemyPotionFinish: ; 38436
AI_TrySwitch: ; 3844b
; Determine whether the AI can switch based on how many Pokemon are still alive.
; If it can switch, it will.
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
ld c, a
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
ld d, 0
.SwitchLoop:
ld a, [hli]
@@ -701,20 +701,20 @@ AI_Switch: ; 3846c
ld a, $1
ld [wEnemyIsSwitching], a
ld [wEnemyGoesFirst], a
ld hl, EnemySubStatus4
ld hl, wEnemySubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
ld [hBattleTurn], a
callfar PursuitSwitch
push af
ld a, [CurOTMon]
ld hl, OTPartyMon1Status
ld a, [wCurOTMon]
ld hl, wOTPartyMon1Status
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
ld e, l
ld hl, EnemyMonStatus
ld hl, wEnemyMonStatus
ld bc, MON_MAXHP - MON_STATUS
call CopyBytes
pop af
@@ -728,7 +728,7 @@ AI_Switch: ; 3846c
ld [wBattleHasJustStarted], a
callfar NewEnemyMonStatus
callfar ResetEnemyStatLevels
ld hl, PlayerSubStatus1
ld hl, wPlayerSubStatus1
res SUBSTATUS_IN_LOVE, [hl]
farcall EnemySwitch
farcall ResetBattleParticipants
@@ -754,25 +754,25 @@ Function384d5: ; This appears to be unused
; 384e0
AI_HealStatus: ; 384e0
ld a, [CurOTMon]
ld hl, OTPartyMon1Status
ld a, [wCurOTMon]
ld hl, wOTPartyMon1Status
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
xor a
ld [hl], a
ld [EnemyMonStatus], a
ld [wEnemyMonStatus], a
; Bug: this should reset SUBSTATUS_NIGHTMARE too
; Uncomment the lines below to fix
; ld hl, EnemySubStatus1
; ld hl, wEnemySubStatus1
; res SUBSTATUS_NIGHTMARE, [hl]
ld hl, EnemySubStatus5
ld hl, wEnemySubStatus5
res SUBSTATUS_TOXIC, [hl]
ret
; 384f7
EnemyUsedXAccuracy: ; 384f7
call AIUsedItemSound
ld hl, EnemySubStatus4
ld hl, wEnemySubStatus4
set SUBSTATUS_X_ACCURACY, [hl]
ld a, X_ACCURACY
jp PrintText_UsedItemOn_AND_AIUpdateHUD
@@ -780,7 +780,7 @@ EnemyUsedXAccuracy: ; 384f7
EnemyUsedGuardSpec: ; 38504
call AIUsedItemSound
ld hl, EnemySubStatus4
ld hl, wEnemySubStatus4
set SUBSTATUS_MIST, [hl]
ld a, GUARD_SPEC
jp PrintText_UsedItemOn_AND_AIUpdateHUD
@@ -788,7 +788,7 @@ EnemyUsedGuardSpec: ; 38504
EnemyUsedDireHit: ; 38511
call AIUsedItemSound
ld hl, EnemySubStatus4
ld hl, wEnemySubStatus4
set SUBSTATUS_FOCUS_ENERGY, [hl]
ld a, DIRE_HIT
jp PrintText_UsedItemOn_AND_AIUpdateHUD
@@ -796,7 +796,7 @@ EnemyUsedDireHit: ; 38511
Function3851e: ; This appears to be unused
ld [hDivisor], a
ld hl, EnemyMonMaxHP
ld hl, wEnemyMonMaxHP
ld a, [hli]
ld [hDividend], a
ld a, [hl]
@@ -807,7 +807,7 @@ Function3851e: ; This appears to be unused
ld c, a
ld a, [hQuotient + 1]
ld b, a
ld hl, EnemyMonHP + 1
ld hl, wEnemyMonHP + 1
ld a, [hld]
ld e, a
ld a, [hl]
@@ -847,7 +847,7 @@ EnemyUsedXSpecial: ; 38553
; a = ITEM_CONSTANT
; b = BATTLE_CONSTANT (ATTACK, DEFENSE, SPEED, SP_ATTACK, SP_DEFENSE, ACCURACY, EVASION)
EnemyUsedXItem:
ld [CurEnemyItem], a
ld [wCurEnemyItem], a
push bc
call PrintText_UsedItemOn
pop bc
@@ -859,16 +859,16 @@ EnemyUsedXItem:
; Parameter
; a = ITEM_CONSTANT
PrintText_UsedItemOn_AND_AIUpdateHUD: ; 38568
ld [CurEnemyItem], a
ld [wCurEnemyItem], a
call PrintText_UsedItemOn
jp AIUpdateHUD
; 38571
PrintText_UsedItemOn: ; 38571
ld a, [CurEnemyItem]
ld a, [wCurEnemyItem]
ld [wd265], a
call GetItemName
ld hl, StringBuffer1
ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, ITEM_NAME_LENGTH
call CopyBytes

View File

@@ -1,5 +1,5 @@
AIChooseMove: ; 440ce
; Score each move in EnemyMonMoves starting from Buffer1. Lower is better.
; Score each move in wEnemyMonMoves starting from wBuffer1. Lower is better.
; Pick the move with the lowest score.
; Wildmons attack at random.
@@ -18,18 +18,18 @@ AIChooseMove: ; 440ce
; The default score is 20. Unusable moves are given a score of 80.
ld a, 20
ld hl, Buffer1
ld hl, wBuffer1
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
; Don't pick disabled moves.
ld a, [EnemyDisabledMove]
ld a, [wEnemyDisabledMove]
and a
jr z, .CheckPP
ld hl, EnemyMonMoves
ld hl, wEnemyMonMoves
ld c, 0
.CheckDisabledMove:
cp [hl]
@@ -38,20 +38,20 @@ AIChooseMove: ; 440ce
inc hl
jr .CheckDisabledMove
.ScoreDisabledMove:
ld hl, Buffer1
ld hl, wBuffer1
ld b, 0
add hl, bc
ld [hl], 80
; Don't pick moves with 0 PP.
.CheckPP:
ld hl, Buffer1 - 1
ld de, EnemyMonPP
ld hl, wBuffer1 - 1
ld de, wEnemyMonPP
ld b, 0
.CheckMovePP:
inc b
ld a, b
cp EnemyMonMovesEnd - EnemyMonMoves + 1
cp wEnemyMonMovesEnd - wEnemyMonMoves + 1
jr z, .ApplyLayers
inc hl
ld a, [de]
@@ -66,13 +66,13 @@ AIChooseMove: ; 440ce
.ApplyLayers:
ld hl, TrainerClassAttributes + TRNATTR_AI_MOVE_WEIGHTS
; If we have a battle in BattleTower just load the Attributes of the first TrainerClass (Falkner)
; If we have a battle in BattleTower just load the Attributes of the first trainer class in wTrainerClass (Falkner)
; so we have always the same AI, regardless of the loaded class of trainer
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
bit 0, a
jr nz, .battle_tower_skip
ld a, [TrainerClass]
ld a, [wTrainerClass]
dec a
ld bc, 7 ; Trainer2AI - Trainer1AI
call AddNTimes
@@ -119,9 +119,9 @@ AIChooseMove: ; 440ce
; Decrement the scores of all moves one by one until one reaches 0.
.DecrementScores:
ld hl, Buffer1
ld de, EnemyMonMoves
ld c, EnemyMonMovesEnd - EnemyMonMoves
ld hl, wBuffer1
ld de, wEnemyMonMoves
ld c, wEnemyMonMovesEnd - wEnemyMonMoves
.DecrementNextScore:
; If the enemy has no moves, this will infinite.
@@ -154,8 +154,8 @@ AIChooseMove: ; 440ce
cp NUM_MOVES + 1
jr nz, .move_loop
ld hl, Buffer1
ld de, EnemyMonMoves
ld hl, wBuffer1
ld de, wEnemyMonMoves
ld c, NUM_MOVES
; Give a score of 0 to a blank move
@@ -184,7 +184,7 @@ AIChooseMove: ; 440ce
; Randomly choose one of the moves with a score of 1
.ChooseMove:
ld hl, Buffer1
ld hl, wBuffer1
call Random
maskbits NUM_MOVES
ld c, a
@@ -194,9 +194,9 @@ AIChooseMove: ; 440ce
and a
jr z, .ChooseMove
ld [CurEnemyMove], a
ld [wCurEnemyMove], a
ld a, c
ld [CurEnemyMoveNum], a
ld [wCurEnemyMoveNum], a
ret
; 441af

View File

@@ -47,95 +47,95 @@ AI_Redundant: ; 2c41a
db -1
.LightScreen: ; 2c487
ld a, [EnemyScreens]
ld a, [wEnemyScreens]
bit SCREENS_LIGHT_SCREEN, a
ret
.Mist: ; 2c48d
ld a, [EnemySubStatus4]
ld a, [wEnemySubStatus4]
bit SUBSTATUS_MIST, a
ret
.FocusEnergy: ; 2c493
ld a, [EnemySubStatus4]
ld a, [wEnemySubStatus4]
bit SUBSTATUS_FOCUS_ENERGY, a
ret
.Confuse: ; 2c499
ld a, [PlayerSubStatus3]
ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret nz
ld a, [PlayerScreens]
ld a, [wPlayerScreens]
bit SCREENS_SAFEGUARD, a
ret
.Transform: ; 2c4a5
ld a, [EnemySubStatus5]
ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret
.Reflect: ; 2c4ab
ld a, [EnemyScreens]
ld a, [wEnemyScreens]
bit SCREENS_REFLECT, a
ret
.Substitute: ; 2c4b1
ld a, [EnemySubStatus4]
ld a, [wEnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
ret
.LeechSeed: ; 2c4b7
ld a, [PlayerSubStatus4]
ld a, [wPlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
ret
.Disable: ; 2c4bd
ld a, [PlayerDisableCount]
ld a, [wPlayerDisableCount]
and a
ret
.Encore: ; 2c4c2
ld a, [PlayerSubStatus5]
ld a, [wPlayerSubStatus5]
bit SUBSTATUS_ENCORED, a
ret
.Snore:
.SleepTalk: ; 2c4c8
ld a, [EnemyMonStatus]
ld a, [wEnemyMonStatus]
and SLP
jr z, .Redundant
jr .NotRedundant
.MeanLook: ; 2c4d1
ld a, [EnemySubStatus5]
ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
.Nightmare: ; 2c4d7
ld a, [BattleMonStatus]
ld a, [wBattleMonStatus]
and a
jr z, .Redundant
ld a, [PlayerSubStatus1]
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_NIGHTMARE, a
ret
.Spikes: ; 2c4e3
ld a, [PlayerScreens]
ld a, [wPlayerScreens]
bit SCREENS_SPIKES, a
ret
.Foresight: ; 2c4e9
ld a, [PlayerSubStatus1]
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_IDENTIFIED, a
ret
.PerishSong: ; 2c4ef
ld a, [PlayerSubStatus1]
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_PERISH, a
ret
.Sandstorm: ; 2c4f5
ld a, [Weather]
ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
jr z, .Redundant
jr .NotRedundant
@@ -143,40 +143,40 @@ AI_Redundant: ; 2c41a
.Attract: ; 2c4fe
farcall CheckOppositeGender
jr c, .Redundant
ld a, [PlayerSubStatus1]
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_IN_LOVE, a
ret
.Safeguard: ; 2c50c
ld a, [EnemyScreens]
ld a, [wEnemyScreens]
bit SCREENS_SAFEGUARD, a
ret
.RainDance: ; 2c512
ld a, [Weather]
ld a, [wBattleWeather]
cp WEATHER_RAIN
jr z, .Redundant
jr .NotRedundant
.SunnyDay: ; 2c51b
ld a, [Weather]
ld a, [wBattleWeather]
cp WEATHER_SUN
jr z, .Redundant
jr .NotRedundant
.DreamEater: ; 2c524
ld a, [BattleMonStatus]
ld a, [wBattleMonStatus]
and SLP
jr z, .Redundant
jr .NotRedundant
.Swagger: ; 2c52d
ld a, [PlayerSubStatus3]
ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret
.FutureSight: ; 2c533
ld a, [EnemyScreens]
ld a, [wEnemyScreens]
bit 5, a
ret

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e
push bc
ld a, 10
ld [wEnemyAISwitchScore], a
ld hl, PlayerUsedMoves
ld hl, wPlayerUsedMoves
ld a, [hl]
and a
jr z, .unknown_moves
@@ -27,7 +27,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e
inc hl
call GetMoveByte
ld hl, EnemyMonType
ld hl, wEnemyMonType
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1 ; 1.0 + 0.1
@@ -70,16 +70,16 @@ CheckPlayerMoveTypeMatchups: ; 3484e
jr .done
.unknown_moves
ld a, [BattleMonType1]
ld a, [wBattleMonType1]
ld b, a
ld hl, EnemyMonType1
ld hl, wEnemyMonType1
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1 ; 1.0 + 0.1
jr c, .ok
call .DecreaseScore
.ok
ld a, [BattleMonType2]
ld a, [wBattleMonType2]
cp b
jr z, .ok2
call CheckTypeMatchup
@@ -99,7 +99,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e
.CheckEnemyMoveMatchups: ; 348de
ld de, EnemyMonMoves
ld de, wEnemyMonMoves
ld b, NUM_MOVES + 1
ld c, 0
@@ -122,7 +122,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e
inc hl
call GetMoveByte
ld hl, BattleMonType1
ld hl, wBattleMonType1
call CheckTypeMatchup
ld a, [wTypeMatchup]
@@ -183,11 +183,11 @@ CheckAbleToSwitch: ; 34941
call FindAliveEnemyMons
ret c
ld a, [EnemySubStatus1]
ld a, [wEnemySubStatus1]
bit SUBSTATUS_PERISH, a
jr z, .no_perish
ld a, [EnemyPerishCount]
ld a, [wEnemyPerishCount]
cp 1
jr nz, .no_perish
@@ -229,7 +229,7 @@ CheckAbleToSwitch: ; 34941
cp 11
ret nc
ld a, [LastPlayerCounterMove]
ld a, [wLastPlayerCounterMove]
and a
jr z, .no_last_counter_move
@@ -296,7 +296,7 @@ CheckAbleToSwitch: ; 34941
FindAliveEnemyMons: ; 349f4
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
cp 2
jr c, .only_one
@@ -304,10 +304,10 @@ FindAliveEnemyMons: ; 349f4
ld e, 0
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
.loop
ld a, [CurOTMon]
ld a, [wCurOTMon]
cp e
jr z, .next
@@ -348,8 +348,8 @@ FindAliveEnemyMons: ; 349f4
FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
ld hl, OTPartyMon1
ld a, [OTPartyCount]
ld hl, wOTPartyMon1
ld a, [wOTPartyCount]
ld b, a
ld c, 1 << (PARTY_LENGTH - 1)
ld d, 0
@@ -357,7 +357,7 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
ld [wEnemyAISwitchScore], a
.loop
ld a, [CurOTMon]
ld a, [wCurOTMon]
cp d
push hl
jr z, .next
@@ -375,11 +375,11 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
jr z, .next
ld a, [hl]
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
; the player's last move is damaging...
ld a, [LastPlayerCounterMove]
ld a, [wLastPlayerCounterMove]
dec a
ld hl, Moves + MOVE_POWER
call GetMoveAttr
@@ -389,7 +389,7 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
; and the Pokemon is immune to it...
inc hl
call GetMoveByte
ld hl, BaseType
ld hl, wBaseType
call CheckTypeMatchup
ld a, [wTypeMatchup]
and a
@@ -417,9 +417,9 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
push bc
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
ld e, a
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
.loop
@@ -434,7 +434,7 @@ FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
.next
srl b
push bc
ld bc, PartyMon2HP - (PartyMon1HP + 1)
ld bc, wPartyMon2HP - (wPartyMon1HP + 1)
add hl, bc
pop bc
dec e
@@ -449,7 +449,7 @@ FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
ld a, -1
ld [wEnemyAISwitchScore], a
ld hl, OTPartyMon1Moves
ld hl, wOTPartyMon1Moves
ld b, 1 << (PARTY_LENGTH - 1)
ld d, 0
ld e, 0
@@ -480,7 +480,7 @@ FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
; check type matchups
inc hl
call GetMoveByte
ld hl, BattleMonType1
ld hl, wBattleMonType1
call CheckTypeMatchup
; if immune or not very effective: continue
@@ -556,7 +556,7 @@ FindEnemyMonsWithASuperEffectiveMove: ; 34aa7
FindEnemyMonsThatResistPlayer: ; 34b20
push bc
ld hl, OTPartySpecies
ld hl, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
@@ -566,9 +566,9 @@ FindEnemyMonsThatResistPlayer: ; 34b20
jr z, .done
push hl
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, [LastPlayerCounterMove]
ld a, [wLastPlayerCounterMove]
and a
jr z, .skip_move
@@ -583,16 +583,16 @@ FindEnemyMonsThatResistPlayer: ; 34b20
jr .check_type
.skip_move
ld a, [BattleMonType1]
ld hl, BaseType
ld a, [wBattleMonType1]
ld hl, wBaseType
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1
jr nc, .dont_choose_mon
ld a, [BattleMonType2]
ld a, [wBattleMonType2]
.check_type
ld hl, BaseType
ld hl, wBaseType
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1
@@ -618,10 +618,10 @@ FindEnemyMonsThatResistPlayer: ; 34b20
FindEnemyMonsWithAtLeastQuarterMaxHP: ; 34b77
push bc
ld de, OTPartySpecies
ld de, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
.loop
ld a, [de]

View File

@@ -275,10 +275,10 @@ HPBarAnim_UpdateHPRemaining: ; d784
ld [hld], a
dec hl
ld a, [wCurHPAnimOldHP]
ld [StringBuffer2 + 1], a
ld [wStringBuffer2 + 1], a
ld a, [wCurHPAnimOldHP + 1]
ld [StringBuffer2], a
ld de, StringBuffer2
ld [wStringBuffer2], a
ld de, wStringBuffer2
lb bc, 2, 3
call PrintNum
pop hl
@@ -311,7 +311,7 @@ HPBarAnim_BGMapUpdate: ; d7c9
jr z, .load_0
cp $1
jr z, .load_1
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
cp $3
jr nc, .bottom_half_of_screen
ld c, $0

View File

@@ -198,12 +198,12 @@ BattleTransitionJumptable: ; 8c314
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
; The screen flashes a different number of times depending on the level of
; your lead Pokemon relative to the opponent's.
; BUG: BattleMonLevel and EnemyMonLevel are not set at this point, so whatever
; BUG: wBattleMonLevel and wEnemyMonLevel are not set at this point, so whatever
; values happen to be there will determine the animation.
ld de, 0
ld a, [BattleMonLevel]
ld a, [wBattleMonLevel]
add 3
ld hl, EnemyMonLevel
ld hl, wEnemyMonLevel
cp [hl]
jr nc, .okay
set 0, e
@@ -298,7 +298,7 @@ StartTrainerBattle_Flash: ; 8c3ab (23:43ab)
StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)
farcall Function5602
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
call StartTrainerBattle_NextScene
@@ -334,8 +334,8 @@ StartTrainerBattle_SineWave: ; 8c408 (23:4408)
ld d, [hl]
add [hl]
ld [hl], a
ld a, LYOverridesEnd - LYOverrides
ld bc, LYOverrides
ld a, wLYOverridesEnd - wLYOverrides
ld bc, wLYOverrides
ld e, $0
.loop
@@ -356,7 +356,7 @@ StartTrainerBattle_SineWave: ; 8c408 (23:4408)
StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d)
farcall Function5602
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
call StartTrainerBattle_NextScene
xor a
@@ -498,7 +498,7 @@ ENDM
StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578)
farcall Function5602
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
call StartTrainerBattle_NextScene
ld a, $10
@@ -566,13 +566,13 @@ StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
ret
StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
and a
jp z, .nextscene ; don't need to be here if wild
xor a
ld [hBGMapMode], a
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
inc b
inc c
@@ -639,7 +639,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
.cgb
ld hl, .daypals
ld a, [TimeOfDayPal]
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp DARKNESS_F
jr nz, .daytime
@@ -699,7 +699,7 @@ INCLUDE "gfx/overworld/trainer_battle_nite.pal"
; 8c6b1
.loadpokeballgfx
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
ld de, PokeBallTransition
ret
@@ -724,12 +724,12 @@ PokeBallTransition:
WipeLYOverrides: ; 8c6d8
ld a, [rSVBK]
push af
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
ld hl, LYOverrides
ld hl, wLYOverrides
call .wipe
ld hl, LYOverridesBackup
ld hl, wLYOverridesBackup
call .wipe
pop af

View File

@@ -7,7 +7,7 @@ CheckBattleScene: ; 4ea44
cp LINK_MOBILE
jr z, .mobile
ld a, [Options]
ld a, [wOptions]
bit BATTLE_SCENE, a
jr nz, .off

View File

@@ -4,13 +4,13 @@ ConsumeHeldItem: ; 27192
push bc
ld a, [hBattleTurn]
and a
ld hl, OTPartyMon1Item
ld de, EnemyMonItem
ld a, [CurOTMon]
ld hl, wOTPartyMon1Item
ld de, wEnemyMonItem
ld a, [wCurOTMon]
jr z, .theirturn
ld hl, PartyMon1Item
ld de, BattleMonItem
ld a, [CurBattleMon]
ld hl, wPartyMon1Item
ld de, wBattleMonItem
ld a, [wCurBattleMon]
.theirturn
push hl

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,11 @@
HiddenPowerDamage: ; fbced
; Override Hidden Power's type and power based on the user's DVs.
ld hl, BattleMonDVs
ld hl, wBattleMonDVs
ld a, [hBattleTurn]
and a
jr z, .got_dvs
ld hl, EnemyMonDVs
ld hl, wEnemyMonDVs
.got_dvs

View File

@@ -1,9 +1,9 @@
DetermineLinkBattleResult: ; 2b930
farcall UpdateEnemyMonInParty
ld hl, PartyMon1HP
ld hl, wPartyMon1HP
call .CountMonsRemaining
push bc
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
call .CountMonsRemaining
ld a, c
pop bc
@@ -20,10 +20,10 @@ DetermineLinkBattleResult: ; 2b930
jr z, .victory
cp $2
jr z, .defeat
ld hl, PartyMon1HP
ld hl, wPartyMon1HP
call .CalcPercentHPRemaining
push de
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
call .CalcPercentHPRemaining
pop hl
ld a, d
@@ -118,16 +118,16 @@ DetermineLinkBattleResult: ; 2b930
ret
.BothSides_CheckNumberMonsAtFullHealth: ; 2b9e1
ld hl, PartyMon1HP
ld hl, wPartyMon1HP
call .CheckFaintedOrFullHealth
jr nz, .finish ; we have a pokemon that's neither fainted nor at full health
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
call .CheckFaintedOrFullHealth
ld e, $1
ret
.finish
ld hl, OTPartyMon1HP
ld hl, wOTPartyMon1HP
call .CheckFaintedOrFullHealth
ld e, $0
ret nz ; we both have pokemon that are neither fainted nor at full health

View File

@@ -53,7 +53,7 @@ GetPlayerBackpicCoords: ; fbd9d (3e:7d9d)
DoWeatherModifiers: ; fbda4
ld de, WeatherTypeModifiers
ld a, [Weather]
ld a, [wBattleWeather]
ld b, a
ld a, [wd265] ; move type
ld c, a
@@ -105,7 +105,7 @@ DoWeatherModifiers: ; fbda4
.ApplyModifier:
xor a
ld [hMultiplicand + 0], a
ld hl, CurDamage
ld hl, wCurDamage
ld a, [hli]
ld [hMultiplicand + 1], a
ld a, [hl]
@@ -138,9 +138,9 @@ DoWeatherModifiers: ; fbda4
.Update:
ld a, b
ld [CurDamage], a
ld [wCurDamage], a
ld a, c
ld [CurDamage + 1], a
ld [wCurDamage + 1], a
.done
ret
@@ -153,7 +153,7 @@ DoBadgeTypeBoosts: ; fbe24
and a
ret nz
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -189,10 +189,10 @@ DoBadgeTypeBoosts: ; fbe24
jr .CheckBadge
.ApplyBoost:
ld a, [CurDamage]
ld a, [wCurDamage]
ld h, a
ld d, a
ld a, [CurDamage + 1]
ld a, [wCurDamage + 1]
ld l, a
ld e, a
@@ -216,9 +216,9 @@ DoBadgeTypeBoosts: ; fbe24
.Update:
ld a, h
ld [CurDamage], a
ld [wCurDamage], a
ld a, l
ld [CurDamage + 1], a
ld [wCurDamage + 1], a
.done
pop bc

View File

@@ -1,6 +1,6 @@
BattleCommand_Attract: ; 377ce
; attract
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .failed
call CheckOppositeGender
@@ -28,12 +28,12 @@ CheckOppositeGender: ; 377f5
ld a, MON_SPECIES
call BattlePartyAttr
ld a, [hl]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, [CurBattleMon]
ld [CurPartyMon], a
ld a, [wCurBattleMon]
ld [wCurPartyMon], a
xor a
ld [MonType], a
ld [wMonType], a
farcall GetGender
jr c, .genderless_samegender
@@ -44,20 +44,20 @@ CheckOppositeGender: ; 377f5
.got_gender
push bc
ld a, [TempEnemyMonSpecies]
ld [CurPartySpecies], a
ld hl, EnemyMonDVs
ld a, [EnemySubStatus5]
ld a, [wTempEnemyMonSpecies]
ld [wCurPartySpecies], a
ld hl, wEnemyMonDVs
ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr z, .not_transformed
ld hl, wEnemyBackupDVs
.not_transformed
ld a, [hli]
ld [TempMonDVs], a
ld [wTempMonDVs], a
ld a, [hl]
ld [TempMonDVs + 1], a
ld [wTempMonDVs + 1], a
ld a, 3
ld [MonType], a
ld [wMonType], a
farcall GetGender
pop bc
jr c, .genderless_samegender

View File

@@ -90,7 +90,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
ret z
ld a, 1
ld [wPlayerAction], a
ld [wBattlePlayerAction], a
call LoadStandardMenuHeader
ld hl, LinkBattleSendReceiveAction
@@ -98,7 +98,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
call CloseWindow
xor a
ld [wPlayerAction], a
ld [wBattlePlayerAction], a
ret
; 37a82
@@ -113,7 +113,7 @@ BatonPass_LinkEnemySwitch: ; 37a82
ld hl, LinkBattleSendReceiveAction
call CallBattleCore
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
add BATTLEACTION_SWITCH1
ld b, a
ld a, [wBattleAction]
@@ -123,7 +123,7 @@ BatonPass_LinkEnemySwitch: ; 37a82
jr c, .switch
.baton_pass
ld a, [CurOTMon]
ld a, [wCurOTMon]
add BATTLEACTION_SWITCH1
ld [wBattleAction], a
.switch
@@ -157,11 +157,11 @@ ResetBatonPassStatus: ; 37ab1
call ResetActorDisable
; Attraction isn't passed.
ld hl, PlayerSubStatus1
ld hl, wPlayerSubStatus1
res SUBSTATUS_IN_LOVE, [hl]
ld hl, EnemySubStatus1
ld hl, wEnemySubStatus1
res SUBSTATUS_IN_LOVE, [hl]
ld hl, PlayerSubStatus5
ld hl, wPlayerSubStatus5
ld a, BATTLE_VARS_SUBSTATUS5
call GetBattleVarAddr
@@ -182,10 +182,10 @@ ResetBatonPassStatus: ; 37ab1
CheckAnyOtherAlivePartyMons: ; 37ae9
ld hl, PartyMon1HP
ld a, [PartyCount]
ld hl, wPartyMon1HP
ld a, [wPartyCount]
ld d, a
ld a, [CurBattleMon]
ld a, [wCurBattleMon]
ld e, a
jr CheckAnyOtherAliveMons
@@ -193,10 +193,10 @@ CheckAnyOtherAlivePartyMons: ; 37ae9
CheckAnyOtherAliveEnemyMons: ; 37af6
ld hl, OTPartyMon1HP
ld a, [OTPartyCount]
ld hl, wOTPartyMon1HP
ld a, [wOTPartyCount]
ld d, a
ld a, [CurOTMon]
ld a, [wCurOTMon]
ld e, a
; fallthrough

View File

@@ -5,27 +5,27 @@ BattleCommand_BeatUp: ; 35461
ld a, [hBattleTurn]
and a
jp nz, .enemy_beats_up
ld a, [PlayerSubStatus3]
ld a, [wPlayerSubStatus3]
bit SUBSTATUS_IN_LOOP, a
jr nz, .next_mon
ld c, 20
call DelayFrames
xor a
ld [PlayerRolloutCount], a
ld [wPlayerRolloutCount], a
ld [wd002], a
ld [wBeatUpHitAtLeastOnce], a
jr .got_mon
.next_mon
ld a, [PlayerRolloutCount]
ld a, [wPlayerRolloutCount]
ld b, a
ld a, [PartyCount]
ld a, [wPartyCount]
sub b
ld [wd002], a
.got_mon
ld a, [wd002]
ld hl, PartyMonNicknames
ld hl, wPartyMonNicknames
call GetNick
ld a, MON_HP
call GetBeatupMonLocation
@@ -34,11 +34,11 @@ BattleCommand_BeatUp: ; 35461
jp z, .beatup_fail ; fainted
ld a, [wd002]
ld c, a
ld a, [CurBattleMon]
ld a, [wCurBattleMon]
; BUG: this can desynchronize link battles
; Change "cp [hl]" to "cp c" to fix
cp [hl]
ld hl, BattleMonStatus
ld hl, wBattleMonStatus
jr z, .active_mon
ld a, MON_STATUS
call GetBeatupMonLocation
@@ -51,18 +51,18 @@ BattleCommand_BeatUp: ; 35461
ld [wBeatUpHitAtLeastOnce], a
ld hl, BeatUpAttackText
call StdBattleTextBox
ld a, [EnemyMonSpecies]
ld [CurSpecies], a
ld a, [wEnemyMonSpecies]
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseDefense]
ld a, [wBaseDefense]
ld c, a
push bc
ld a, MON_SPECIES
call GetBeatupMonLocation
ld a, [hl]
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseAttack]
ld a, [wBaseAttack]
pop bc
ld b, a
push bc
@@ -76,20 +76,20 @@ BattleCommand_BeatUp: ; 35461
ret
.enemy_beats_up
ld a, [EnemySubStatus3]
ld a, [wEnemySubStatus3]
bit SUBSTATUS_IN_LOOP, a
jr nz, .not_first_enemy_beatup
xor a
ld [EnemyRolloutCount], a
ld [wEnemyRolloutCount], a
ld [wd002], a
ld [wBeatUpHitAtLeastOnce], a
jr .enemy_continue
.not_first_enemy_beatup
ld a, [EnemyRolloutCount]
ld a, [wEnemyRolloutCount]
ld b, a
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
sub b
ld [wd002], a
.enemy_continue
@@ -101,14 +101,14 @@ BattleCommand_BeatUp: ; 35461
and a
jr nz, .link_or_tower
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
and a
jr nz, .link_or_tower
ld a, [wd002]
ld c, a
ld b, 0
ld hl, OTPartySpecies
ld hl, wOTPartySpecies
add hl, bc
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
@@ -117,10 +117,10 @@ BattleCommand_BeatUp: ; 35461
.link_or_tower
ld a, [wd002]
ld hl, OTPartyMonNicknames
ld hl, wOTPartyMonNicknames
ld bc, NAME_LENGTH
call AddNTimes
ld de, StringBuffer1
ld de, wStringBuffer1
call CopyBytes
.got_enemy_nick
ld a, MON_HP
@@ -130,9 +130,9 @@ BattleCommand_BeatUp: ; 35461
jp z, .beatup_fail
ld a, [wd002]
ld b, a
ld a, [CurOTMon]
ld a, [wCurOTMon]
cp b
ld hl, EnemyMonStatus
ld hl, wEnemyMonStatus
jr z, .active_enemy
ld a, MON_STATUS
@@ -147,7 +147,7 @@ BattleCommand_BeatUp: ; 35461
jr .finish_beatup
.wild
ld a, [EnemyMonSpecies]
ld a, [wEnemyMonSpecies]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, BeatUpAttackText
@@ -157,18 +157,18 @@ BattleCommand_BeatUp: ; 35461
.finish_beatup
ld hl, BeatUpAttackText
call StdBattleTextBox
ld a, [BattleMonSpecies]
ld [CurSpecies], a
ld a, [wBattleMonSpecies]
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseDefense]
ld a, [wBaseDefense]
ld c, a
push bc
ld a, MON_SPECIES
call GetBeatupMonLocation
ld a, [hl]
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseAttack]
ld a, [wBaseAttack]
pop bc
ld b, a
push bc
@@ -207,9 +207,9 @@ GetBeatupMonLocation: ; 355bd
ld b, 0
ld a, [hBattleTurn]
and a
ld hl, PartyMon1Species
ld hl, wPartyMon1Species
jr z, .got_species
ld hl, OTPartyMon1Species
ld hl, wOTPartyMon1Species
.got_species
ld a, [wd002]

View File

@@ -4,7 +4,7 @@ BattleCommand_BellyDrum: ; 37c1a
; before checking that it has enough HP to use the move.
; Swap the order of these two blocks to fix.
call BattleCommand_AttackUp2
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .failed

View File

@@ -6,11 +6,11 @@ BattleCommand_StoreEnergy: ; 36671
bit SUBSTATUS_BIDE, a
ret z
ld hl, PlayerRolloutCount
ld hl, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .check_still_storing_energy
ld hl, EnemyRolloutCount
ld hl, wEnemyRolloutCount
.check_still_storing_energy
dec [hl]
jr nz, .still_storing
@@ -26,30 +26,30 @@ BattleCommand_StoreEnergy: ; 36671
call GetBattleVarAddr
ld a, 1
ld [hl], a
ld hl, PlayerDamageTaken + 1
ld hl, wPlayerDamageTaken + 1
ld de, wPlayerCharging ; player
ld a, [hBattleTurn]
and a
jr z, .player
ld hl, EnemyDamageTaken + 1
ld hl, wEnemyDamageTaken + 1
ld de, wEnemyCharging ; enemy
.player
ld a, [hld]
add a
ld b, a
ld [CurDamage + 1], a
ld [wCurDamage + 1], a
ld a, [hl]
rl a
ld [CurDamage], a
ld [wCurDamage], a
jr nc, .not_maxed
ld a, $ff
ld [CurDamage], a
ld [CurDamage + 1], a
ld [wCurDamage], a
ld [wCurDamage + 1], a
.not_maxed
or b
jr nz, .built_up_something
ld a, 1
ld [AttackMissed], a
ld [wAttackMissed], a
.built_up_something
xor a
ld [hli], a
@@ -75,13 +75,13 @@ BattleCommand_StoreEnergy: ; 36671
BattleCommand_UnleashEnergy: ; 366e5
; unleashenergy
ld de, PlayerDamageTaken
ld bc, PlayerRolloutCount
ld de, wPlayerDamageTaken
ld bc, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .got_damage
ld de, EnemyDamageTaken
ld bc, EnemyRolloutCount
ld de, wEnemyDamageTaken
ld bc, wEnemyRolloutCount
.got_damage
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr

View File

@@ -1,17 +1,17 @@
BattleCommand_Conversion: ; 3707f
; conversion
ld hl, BattleMonMoves
ld de, BattleMonType1
ld hl, wBattleMonMoves
ld de, wBattleMonType1
ld a, [hBattleTurn]
and a
jr z, .got_moves
ld hl, EnemyMonMoves
ld de, EnemyMonType1
ld hl, wEnemyMonMoves
ld de, wEnemyMonType1
.got_moves
push de
ld c, 0
ld de, StringBuffer1
ld de, wStringBuffer1
.loop
push hl
ld b, 0
@@ -41,7 +41,7 @@ BattleCommand_Conversion: ; 3707f
inc de
ld [de], a
pop de
ld hl, StringBuffer1
ld hl, wStringBuffer1
.loop2
ld a, [hl]
cp -1
@@ -70,7 +70,7 @@ BattleCommand_Conversion: ; 3707f
maskbits NUM_MOVES
ld c, a
ld b, 0
ld hl, StringBuffer1
ld hl, wStringBuffer1
add hl, bc
ld a, [hl]
cp -1

View File

@@ -1,14 +1,14 @@
BattleCommand_Conversion2: ; 359e6
; conversion2
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .failed
ld hl, BattleMonType1
ld hl, wBattleMonType1
ld a, [hBattleTurn]
and a
jr z, .got_type
ld hl, EnemyMonType1
ld hl, wEnemyMonType1
.got_type
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar

View File

@@ -2,7 +2,7 @@ BattleCommand_Counter: ; 35813
; counter
ld a, 1
ld [AttackMissed], a
ld [wAttackMissed], a
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
and a
@@ -25,18 +25,18 @@ BattleCommand_Counter: ; 35813
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
dec a
ld de, StringBuffer1
ld de, wStringBuffer1
call GetMoveData
ld a, [StringBuffer1 + MOVE_POWER]
ld a, [wStringBuffer1 + MOVE_POWER]
and a
ret z
ld a, [StringBuffer1 + MOVE_TYPE]
ld a, [wStringBuffer1 + MOVE_TYPE]
cp SPECIAL
ret nc
ld hl, CurDamage
ld hl, wCurDamage
ld a, [hli]
or [hl]
ret z
@@ -54,7 +54,7 @@ BattleCommand_Counter: ; 35813
.capped
xor a
ld [AttackMissed], a
ld [wAttackMissed], a
ret
; 35864

View File

@@ -1,13 +1,13 @@
BattleCommand_Curse: ; 37588
; curse
ld de, BattleMonType1
ld bc, PlayerStatLevels
ld de, wBattleMonType1
ld bc, wPlayerStatLevels
ld a, [hBattleTurn]
and a
jr z, .go
ld de, EnemyMonType1
ld bc, EnemyStatLevels
ld de, wEnemyMonType1
ld bc, wEnemyStatLevels
.go

View File

@@ -1,17 +1,17 @@
BattleCommand_Disable: ; 36fed
; disable
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .failed
ld de, EnemyDisableCount
ld hl, EnemyMonMoves
ld de, wEnemyDisableCount
ld hl, wEnemyMonMoves
ld a, [hBattleTurn]
and a
jr z, .got_moves
ld de, PlayerDisableCount
ld hl, BattleMonMoves
ld de, wPlayerDisableCount
ld hl, wBattleMonMoves
.got_moves
ld a, [de]
@@ -35,9 +35,9 @@ BattleCommand_Disable: ; 36fed
ld a, [hBattleTurn]
and a
ld hl, EnemyMonPP
ld hl, wEnemyMonPP
jr z, .got_pp
ld hl, BattleMonPP
ld hl, wBattleMonPP
.got_pp
ld b, 0
add hl, bc
@@ -54,7 +54,7 @@ BattleCommand_Disable: ; 36fed
add c
ld [de], a
call AnimateCurrentMove
ld hl, DisabledMove
ld hl, wDisabledMove
ld a, [hBattleTurn]
and a
jr nz, .got_disabled_move_pointer

View File

@@ -1,13 +1,13 @@
BattleCommand_Encore: ; 35864
; encore
ld hl, EnemyMonMoves
ld de, EnemyEncoreCount
ld hl, wEnemyMonMoves
ld de, wEnemyEncoreCount
ld a, [hBattleTurn]
and a
jr z, .ok
ld hl, BattleMonMoves
ld de, PlayerEncoreCount
ld hl, wBattleMonMoves
ld de, wPlayerEncoreCount
.ok
ld a, BATTLE_VARS_LAST_MOVE_OPP
call GetBattleVar
@@ -26,12 +26,12 @@ BattleCommand_Encore: ; 35864
cp b
jr nz, .got_move
ld bc, BattleMonPP - BattleMonMoves - 1
ld bc, wBattleMonPP - wBattleMonMoves - 1
add hl, bc
ld a, [hl]
and PP_MASK
jp z, .failed
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jp nz, .failed
ld a, BATTLE_VARS_SUBSTATUS5_OPP
@@ -52,10 +52,10 @@ BattleCommand_Encore: ; 35864
jr z, .force_last_enemy_move
push hl
ld a, [LastPlayerMove]
ld a, [wLastPlayerMove]
ld b, a
ld c, 0
ld hl, BattleMonMoves
ld hl, wBattleMonMoves
.find_player_move
ld a, [hli]
cp b
@@ -73,9 +73,9 @@ BattleCommand_Encore: ; 35864
.got_player_move
pop hl
ld a, c
ld [CurMoveNum], a
ld [wCurMoveNum], a
ld a, b
ld [CurPlayerMove], a
ld [wCurPlayerMove], a
dec a
ld de, wPlayerMoveStruct
call GetMoveData
@@ -83,10 +83,10 @@ BattleCommand_Encore: ; 35864
.force_last_enemy_move
push hl
ld a, [LastEnemyMove]
ld a, [wLastEnemyMove]
ld b, a
ld c, 0
ld hl, EnemyMonMoves
ld hl, wEnemyMonMoves
.find_enemy_move
ld a, [hli]
cp b
@@ -104,9 +104,9 @@ BattleCommand_Encore: ; 35864
.got_enemy_move
pop hl
ld a, c
ld [CurEnemyMoveNum], a
ld [wCurEnemyMoveNum], a
ld a, b
ld [CurEnemyMove], a
ld [wCurEnemyMove], a
dec a
ld de, wEnemyMoveStruct
call GetMoveData

View File

@@ -1,13 +1,13 @@
BattleCommand_FalseSwipe: ; 35c94
; falseswipe
ld hl, EnemyMonHP
ld hl, wEnemyMonHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
ld hl, BattleMonHP
ld hl, wBattleMonHP
.got_hp
ld de, CurDamage
ld de, wCurDamage
ld c, 2
push hl
push de
@@ -28,11 +28,11 @@ BattleCommand_FalseSwipe: ; 35c94
dec a
ld [de], a
.okay
ld a, [CriticalHit]
ld a, [wCriticalHit]
cp 2
jr nz, .carry
xor a
ld [CriticalHit], a
ld [wCriticalHit], a
.carry
scf
ret

View File

@@ -1,7 +1,7 @@
BattleCommand_Foresight: ; 376a0
; foresight
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .failed

View File

@@ -2,11 +2,11 @@ BattleCommand_FrustrationPower: ; 3790e
; frustrationpower
push bc
ld hl, BattleMonHappiness
ld hl, wBattleMonHappiness
ld a, [hBattleTurn]
and a
jr z, .got_happiness
ld hl, EnemyMonHappiness
ld hl, wEnemyMonHappiness
.got_happiness
ld a, $ff
sub [hl]

View File

@@ -1,14 +1,14 @@
BattleCommand_FuryCutter: ; 37792
; furycutter
ld hl, PlayerFuryCutterCount
ld hl, wPlayerFuryCutterCount
ld a, [hBattleTurn]
and a
jr z, .go
ld hl, EnemyFuryCutterCount
ld hl, wEnemyFuryCutterCount
.go
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jp nz, ResetFuryCutterCount
@@ -26,7 +26,7 @@ BattleCommand_FuryCutter: ; 37792
ret z
; Double the damage
ld hl, CurDamage + 1
ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
@@ -45,11 +45,11 @@ ResetFuryCutterCount: ; 377be
push hl
ld hl, PlayerFuryCutterCount
ld hl, wPlayerFuryCutterCount
ld a, [hBattleTurn]
and a
jr z, .reset
ld hl, EnemyFuryCutterCount
ld hl, wEnemyFuryCutterCount
.reset
xor a

View File

@@ -19,9 +19,9 @@ BattleCommand_CheckFutureSight: ; 37d0d
ld [hl], 0
ld a, [de]
inc de
ld [CurDamage], a
ld [wCurDamage], a
ld a, [de]
ld [CurDamage + 1], a
ld [wCurDamage + 1], a
ld b, futuresight_command
jp SkipToBattleCommand
@@ -64,7 +64,7 @@ BattleCommand_FutureSight: ; 37d34
jr z, .StoreDamage
ld de, wEnemyFutureSightDamage
.StoreDamage:
ld hl, CurDamage
ld hl, wCurDamage
ld a, [hl]
ld [de], a
ld [hl], 0

View File

@@ -4,11 +4,11 @@ BattleCommand_HealBell: ; 35cc9
ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVarAddr
res SUBSTATUS_NIGHTMARE, [hl]
ld de, PartyMon1Status
ld de, wPartyMon1Status
ld a, [hBattleTurn]
and a
jr z, .got_status
ld de, OTPartyMon1Status
ld de, wOTPartyMon1Status
.got_status
ld a, BATTLE_VARS_STATUS
call GetBattleVarAddr

View File

@@ -1,7 +1,7 @@
BattleCommand_HiddenPower: ; 37be8
; hiddenpower
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
ret nz
farcall HiddenPowerDamage

View File

@@ -1,16 +1,16 @@
BattleCommand_LeechSeed: ; 36f9d
; leechseed
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .evaded
call CheckSubstituteOpp
jr nz, .evaded
ld de, EnemyMonType1
ld de, wEnemyMonType1
ld a, [hBattleTurn]
and a
jr z, .ok
ld de, BattleMonType1
ld de, wBattleMonType1
.ok
ld a, [de]

View File

@@ -4,7 +4,7 @@ BattleCommand_LockOn: ; 35a53
call CheckSubstituteOpp
jr nz, .fail
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .fail

View File

@@ -3,14 +3,14 @@ BattleCommand_Mimic: ; 36f46
call ClearLastMove
call BattleCommand_MoveDelay
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .fail
ld hl, BattleMonMoves
ld hl, wBattleMonMoves
ld a, [hBattleTurn]
and a
jr z, .player_turn
ld hl, EnemyMonMoves
ld hl, wEnemyMonMoves
.player_turn
call CheckHiddenOpponent
jr nz, .fail
@@ -38,7 +38,7 @@ BattleCommand_Mimic: ; 36f46
call GetBattleVar
ld [hl], a
ld [wNamedObjectIndexBuffer], a
ld bc, BattleMonPP - BattleMonMoves
ld bc, wBattleMonPP - wBattleMonMoves
add hl, bc
ld [hl], 5
call GetMoveName

View File

@@ -2,7 +2,7 @@ BattleCommand_MirrorCoat: ; 37c95
; mirrorcoat
ld a, 1
ld [AttackMissed], a
ld [wAttackMissed], a
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -26,18 +26,18 @@ BattleCommand_MirrorCoat: ; 37c95
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
dec a
ld de, StringBuffer1
ld de, wStringBuffer1
call GetMoveData
ld a, [StringBuffer1 + 2]
ld a, [wStringBuffer1 + 2]
and a
ret z
ld a, [StringBuffer1 + 3]
ld a, [wStringBuffer1 + 3]
cp SPECIAL
ret c
ld hl, CurDamage
ld hl, wCurDamage
ld a, [hli]
or [hl]
ret z
@@ -55,7 +55,7 @@ BattleCommand_MirrorCoat: ; 37c95
.capped
xor a
ld [AttackMissed], a
ld [wAttackMissed], a
ret
; 37ce6

View File

@@ -1,28 +1,28 @@
BattleCommand_PainSplit: ; 35926
; painsplit
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jp nz, .ButItFailed
call CheckSubstituteOpp
jp nz, .ButItFailed
call AnimateCurrentMove
ld hl, BattleMonMaxHP + 1
ld de, EnemyMonMaxHP + 1
ld hl, wBattleMonMaxHP + 1
ld de, wEnemyMonMaxHP + 1
call .PlayerShareHP
ld a, $1
ld [wWhichHPBar], a
hlcoord 10, 9
predef AnimateHPBar
ld hl, EnemyMonHP
ld hl, wEnemyMonHP
ld a, [hli]
ld [Buffer4], a
ld [wBuffer4], a
ld a, [hli]
ld [Buffer3], a
ld [wBuffer3], a
ld a, [hli]
ld [Buffer2], a
ld [wBuffer2], a
ld a, [hl]
ld [Buffer1], a
ld [wBuffer1], a
call .EnemyShareHP
xor a
ld [wWhichHPBar], a
@@ -36,28 +36,28 @@ BattleCommand_PainSplit: ; 35926
.PlayerShareHP:
ld a, [hld]
ld [Buffer1], a
ld [wBuffer1], a
ld a, [hld]
ld [Buffer2], a
ld [wBuffer2], a
ld a, [hld]
ld b, a
ld [Buffer3], a
ld [wBuffer3], a
ld a, [hl]
ld [Buffer4], a
ld [wBuffer4], a
dec de
dec de
ld a, [de]
dec de
add b
ld [CurDamage + 1], a
ld [wCurDamage + 1], a
ld b, [hl]
ld a, [de]
adc b
srl a
ld [CurDamage], a
ld a, [CurDamage + 1]
ld [wCurDamage], a
ld a, [wCurDamage + 1]
rr a
ld [CurDamage + 1], a
ld [wCurDamage + 1], a
inc hl
inc hl
inc hl
@@ -68,25 +68,25 @@ BattleCommand_PainSplit: ; 35926
.EnemyShareHP: ; 359ac
ld c, [hl]
dec hl
ld a, [CurDamage + 1]
ld a, [wCurDamage + 1]
sub c
ld b, [hl]
dec hl
ld a, [CurDamage]
ld a, [wCurDamage]
sbc b
jr nc, .skip
ld a, [CurDamage]
ld a, [wCurDamage]
ld b, a
ld a, [CurDamage + 1]
ld a, [wCurDamage + 1]
ld c, a
.skip
ld a, c
ld [hld], a
ld [Buffer5], a
ld [wBuffer5], a
ld a, b
ld [hli], a
ld [Buffer6], a
ld [wBuffer6], a
ret
; 359cd

View File

@@ -2,14 +2,14 @@ BattleCommand_PayDay: ; 3705c
; payday
xor a
ld hl, StringBuffer1
ld hl, wStringBuffer1
ld [hli], a
ld a, [hBattleTurn]
and a
ld a, [BattleMonLevel]
ld a, [wBattleMonLevel]
jr z, .ok
ld a, [EnemyMonLevel]
ld a, [wEnemyMonLevel]
.ok
add a

View File

@@ -2,8 +2,8 @@ BattleCommand_PerishSong: ; 376c2
; perishsong
ld hl, PlayerSubStatus1
ld de, EnemySubStatus1
ld hl, wPlayerSubStatus1
ld de, wEnemySubStatus1
bit SUBSTATUS_PERISH, [hl]
jr z, .ok
@@ -17,7 +17,7 @@ BattleCommand_PerishSong: ; 376c2
set SUBSTATUS_PERISH, [hl]
ld a, 4
ld [PlayerPerishCount], a
ld [wPlayerPerishCount], a
.enemy
ld a, [de]
@@ -27,7 +27,7 @@ BattleCommand_PerishSong: ; 376c2
set SUBSTATUS_PERISH, a
ld [de], a
ld a, 4
ld [EnemyPerishCount], a
ld [wEnemyPerishCount], a
.done
call AnimateCurrentMove

View File

@@ -20,7 +20,7 @@ BattleCommand_Present: ; 37874
ld a, [wTypeMatchup]
and a
jp z, AnimateFailedMove
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jp nz, AnimateFailedMove

View File

@@ -16,11 +16,11 @@ BattleCommand_Protect: ; 37618
ProtectChance: ; 3762c
ld de, PlayerProtectCount
ld de, wPlayerProtectCount
ld a, [hBattleTurn]
and a
jr z, .asm_37637
ld de, EnemyProtectCount
ld de, wEnemyProtectCount
.asm_37637
call CheckOpponentWentFirst

View File

@@ -1,8 +1,8 @@
BattleCommand_PsychUp: ; 37c55
; psychup
ld hl, EnemyStatLevels
ld de, PlayerStatLevels
ld hl, wEnemyStatLevels
ld de, wPlayerStatLevels
ld a, [hBattleTurn]
and a
jr z, .pointers_correct

View File

@@ -12,7 +12,7 @@ BattleCommand_Pursuit: ; 37b1d
and a
ret z
ld hl, CurDamage + 1
ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]

View File

@@ -1,9 +1,9 @@
BattleCommand_StartRain: ; 37bf4
; startrain
ld a, WEATHER_RAIN
ld [Weather], a
ld [wBattleWeather], a
ld a, 5
ld [WeatherCount], a
ld [wWeatherCount], a
call AnimateCurrentMove
ld hl, DownpourText
jp StdBattleTextBox

View File

@@ -10,12 +10,12 @@ BattleCommand_ClearHazards: ; 37b39
call StdBattleTextBox
.not_leeched
ld hl, PlayerScreens
ld hl, wPlayerScreens
ld de, wPlayerWrapCount
ld a, [hBattleTurn]
and a
jr z, .got_screens_wrap
ld hl, EnemyScreens
ld hl, wEnemyScreens
ld de, wEnemyWrapCount
.got_screens_wrap
bit SCREENS_SPIKES, [hl]

View File

@@ -1,11 +1,11 @@
BattleCommand_HappinessPower: ; 3784b
; happinesspower
push bc
ld hl, BattleMonHappiness
ld hl, wBattleMonHappiness
ld a, [hBattleTurn]
and a
jr z, .ok
ld hl, EnemyMonHappiness
ld hl, wEnemyMonHappiness
.ok
xor a
ld [hMultiplicand + 0], a

View File

@@ -4,11 +4,11 @@ MAX_ROLLOUT_COUNT EQU 5
BattleCommand_CheckCurl: ; 37718
; checkcurl
ld de, PlayerRolloutCount
ld de, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .ok
ld de, EnemyRolloutCount
ld de, wEnemyRolloutCount
.ok
ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVar
@@ -33,11 +33,11 @@ BattleCommand_RolloutPower: ; 37734
and SLP
ret nz
ld hl, PlayerRolloutCount
ld hl, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .got_rollout_count
ld hl, EnemyRolloutCount
ld hl, wEnemyRolloutCount
.got_rollout_count
ld a, [hl]
@@ -47,7 +47,7 @@ BattleCommand_RolloutPower: ; 37734
ld [wSomeoneIsRampaging], a
.skip_set_rampage
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr z, .hit
@@ -84,7 +84,7 @@ BattleCommand_RolloutPower: ; 37734
dec b
jr z, .done_damage
ld hl, CurDamage + 1
ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]

View File

@@ -1,13 +1,13 @@
BattleCommand_Safeguard: ; 37939
; safeguard
ld hl, PlayerScreens
ld de, PlayerSafeguardCount
ld hl, wPlayerScreens
ld de, wPlayerSafeguardCount
ld a, [hBattleTurn]
and a
jr z, .ok
ld hl, EnemyScreens
ld de, EnemySafeguardCount
ld hl, wEnemyScreens
ld de, wEnemySafeguardCount
.ok
bit SCREENS_SAFEGUARD, [hl]
jr nz, .failed

View File

@@ -1,14 +1,14 @@
BattleCommand_StartSandstorm: ; 376f8
; startsandstorm
ld a, [Weather]
ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
jr z, .failed
ld a, WEATHER_SANDSTORM
ld [Weather], a
ld [wBattleWeather], a
ld a, 5
ld [WeatherCount], a
ld [wWeatherCount], a
call AnimateCurrentMove
ld hl, SandstormBrewedText
jp StdBattleTextBox

View File

@@ -26,11 +26,11 @@ BattleCommand_Sketch: ; 35a74
ld d, h
ld e, l
; Get the battle move structs.
ld hl, BattleMonMoves
ld hl, wBattleMonMoves
ld a, [hBattleTurn]
and a
jr z, .get_last_move
ld hl, EnemyMonMoves
ld hl, wEnemyMonMoves
.get_last_move
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -69,7 +69,7 @@ BattleCommand_Sketch: ; 35a74
ld hl, Moves + MOVE_PP
call GetMoveAttr
pop hl
ld bc, BattleMonPP - BattleMonMoves
ld bc, wBattleMonPP - wBattleMonMoves
add hl, bc
ld [hl], a
pop bc

View File

@@ -2,17 +2,17 @@ BattleCommand_SleepTalk: ; 35b33
; sleeptalk
call ClearLastMove
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jr nz, .fail
ld a, [hBattleTurn]
and a
ld hl, BattleMonMoves + 1
ld a, [DisabledMove]
ld hl, wBattleMonMoves + 1
ld a, [wDisabledMove]
ld d, a
jr z, .got_moves
ld hl, EnemyMonMoves + 1
ld a, [EnemyDisabledMove]
ld hl, wEnemyMonMoves + 1
ld a, [wEnemyDisabledMove]
ld d, a
.got_moves
ld a, BATTLE_VARS_STATUS
@@ -79,10 +79,10 @@ BattleCommand_SleepTalk: ; 35b33
.check_has_usable_move
ld a, [hBattleTurn]
and a
ld a, [DisabledMove]
ld a, [wDisabledMove]
jr z, .got_move_2
ld a, [EnemyDisabledMove]
ld a, [wEnemyDisabledMove]
.got_move_2
ld b, a
ld a, BATTLE_VARS_MOVE

View File

@@ -6,7 +6,7 @@ BattleCommand_Snore: ; 359d0
ret nz
call ResetDamage
ld a, $1
ld [AttackMissed], a
ld [wAttackMissed], a
call FailMove
jp EndMoveEffect

View File

@@ -1,11 +1,11 @@
BattleCommand_Spikes: ; 37683
; spikes
ld hl, EnemyScreens
ld hl, wEnemyScreens
ld a, [hBattleTurn]
and a
jr z, .asm_3768e
ld hl, PlayerScreens
ld hl, wPlayerScreens
.asm_3768e
; Fails if spikes are already down!

View File

@@ -1,15 +1,15 @@
BattleCommand_Spite: ; 35c0f
; spite
ld a, [AttackMissed]
ld a, [wAttackMissed]
and a
jp nz, .failed
ld bc, PARTYMON_STRUCT_LENGTH ; ????
ld hl, EnemyMonMoves
ld hl, wEnemyMonMoves
ld a, [hBattleTurn]
and a
jr z, .got_moves
ld hl, BattleMonMoves
ld hl, wBattleMonMoves
.got_moves
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -28,7 +28,7 @@ BattleCommand_Spite: ; 35c0f
dec hl
ld b, 0
push bc
ld c, BattleMonPP - BattleMonMoves
ld c, wBattleMonPP - wBattleMonMoves
add hl, bc
pop bc
ld a, [hl]

View File

@@ -2,13 +2,13 @@ BattleCommand_Substitute: ; 36e7c
; substitute
call BattleCommand_MoveDelay
ld hl, BattleMonMaxHP
ld de, PlayerSubstituteHP
ld hl, wBattleMonMaxHP
ld de, wPlayerSubstituteHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
ld hl, EnemyMonMaxHP
ld de, EnemySubstituteHP
ld hl, wEnemyMonMaxHP
ld de, wEnemySubstituteHP
.got_hp
ld a, BATTLE_VARS_SUBSTATUS4
@@ -61,7 +61,7 @@ BattleCommand_Substitute: ; 36e7c
xor a
ld [wNumHits], a
ld [FXAnimID + 1], a
ld [wFXAnimID + 1], a
ld [wKickCounter], a
ld a, SUBSTITUTE
call LoadAnim

View File

@@ -1,9 +1,9 @@
BattleCommand_StartSun: ; 37c07
; startsun
ld a, WEATHER_SUN
ld [Weather], a
ld [wBattleWeather], a
ld a, 5
ld [WeatherCount], a
ld [wWeatherCount], a
call AnimateCurrentMove
ld hl, SunGotBrightText
jp StdBattleTextBox

View File

@@ -1,7 +1,7 @@
BattleCommand_Teleport: ; 36778
; teleport
ld a, [BattleType]
ld a, [wBattleType]
cp BATTLETYPE_SHINY
jr z, .failed
cp BATTLETYPE_TRAP
@@ -24,9 +24,9 @@ BattleCommand_Teleport: ; 36778
dec a
jr nz, .failed
; If your level is greater than the opponent's, you run without fail.
ld a, [CurPartyLevel]
ld a, [wCurPartyLevel]
ld b, a
ld a, [BattleMonLevel]
ld a, [wBattleMonLevel]
cp b
jr nc, .run_away
; Generate a number between 0 and (YourLevel + TheirLevel).
@@ -51,9 +51,9 @@ BattleCommand_Teleport: ; 36778
ld a, [wBattleMode]
dec a
jr nz, .failed
ld a, [BattleMonLevel]
ld a, [wBattleMonLevel]
ld b, a
ld a, [CurPartyLevel]
ld a, [wCurPartyLevel]
cp b
jr nc, .run_away
add b

View File

@@ -26,7 +26,7 @@ BattleCommand_Thief: ; 37492
farcall ItemIsMail
ret c
ld a, [EffectFailed]
ld a, [wEffectFailed]
and a
ret nz
@@ -74,7 +74,7 @@ BattleCommand_Thief: ; 37492
farcall ItemIsMail
ret c
ld a, [EffectFailed]
ld a, [wEffectFailed]
and a
ret nz
@@ -103,7 +103,7 @@ BattleCommand_Thief: ; 37492
call BattlePartyAttr
ld d, h
ld e, l
ld hl, BattleMonItem
ld hl, wBattleMonItem
ret
.enemyitem
@@ -111,6 +111,6 @@ BattleCommand_Thief: ; 37492
call OTPartyAttr
ld d, h
ld e, l
ld hl, EnemyMonItem
ld hl, wEnemyMonItem
ret
; 37517

View File

@@ -4,7 +4,7 @@ BattleCommand_ThunderAccuracy: ; 37d94
ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVarAddr
inc hl
ld a, [Weather]
ld a, [wBattleWeather]
cp WEATHER_RAIN
jr z, .rain
cp WEATHER_SUN

View File

@@ -11,7 +11,7 @@ BattleCommand_Transform: ; 371cd
jp nz, BattleEffect_ButItFailed
xor a
ld [wNumHits], a
ld [FXAnimID + 1], a
ld [wFXAnimID + 1], a
ld a, $1
ld [wKickCounter], a
ld a, BATTLE_VARS_SUBSTATUS4
@@ -28,15 +28,15 @@ BattleCommand_Transform: ; 371cd
call GetBattleVarAddr
set SUBSTATUS_TRANSFORMED, [hl]
call ResetActorDisable
ld hl, BattleMonSpecies
ld de, EnemyMonSpecies
ld hl, wBattleMonSpecies
ld de, wEnemyMonSpecies
ld a, [hBattleTurn]
and a
jr nz, .got_mon_species
ld hl, EnemyMonSpecies
ld de, BattleMonSpecies
ld hl, wEnemyMonSpecies
ld de, wBattleMonSpecies
xor a
ld [CurMoveNum], a
ld [wCurMoveNum], a
.got_mon_species
push hl
ld a, [hli]
@@ -64,7 +64,7 @@ BattleCommand_Transform: ; 371cd
ld [de], a
inc de
; move pointer to stats
ld bc, BattleMonStats - BattleMonPP
ld bc, wBattleMonStats - wBattleMonPP
add hl, bc
push hl
ld h, d
@@ -73,16 +73,16 @@ BattleCommand_Transform: ; 371cd
ld d, h
ld e, l
pop hl
ld bc, BattleMonStructEnd - BattleMonStats
ld bc, wBattleMonStructEnd - wBattleMonStats
call CopyBytes
; init the power points
ld bc, BattleMonMoves - BattleMonStructEnd
ld bc, wBattleMonMoves - wBattleMonStructEnd
add hl, bc
push de
ld d, h
ld e, l
pop hl
ld bc, BattleMonPP - BattleMonStructEnd
ld bc, wBattleMonPP - wBattleMonStructEnd
add hl, bc
ld b, NUM_MOVES
.pp_loop
@@ -102,12 +102,12 @@ BattleCommand_Transform: ; 371cd
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, EnemyStats
ld de, PlayerStats
ld hl, wEnemyStats
ld de, wPlayerStats
ld bc, 2 * 5
call BattleSideCopy
ld hl, EnemyStatLevels
ld de, PlayerStatLevels
ld hl, wEnemyStatLevels
ld de, wPlayerStatLevels
ld bc, 8
call BattleSideCopy
call _CheckBattleScene
@@ -129,7 +129,7 @@ BattleCommand_Transform: ; 371cd
.after_anim
xor a
ld [wNumHits], a
ld [FXAnimID + 1], a
ld [wFXAnimID + 1], a
ld a, $2
ld [wKickCounter], a
pop af

View File

@@ -4,7 +4,7 @@ BattleCommand_TripleKick: ; 346b2
ld a, [wKickCounter]
ld b, a
inc b
ld hl, CurDamage + 1
ld hl, wCurDamage + 1
ld a, [hld]
ld e, a
ld a, [hli]

View File

@@ -1,18 +1,18 @@
GetTrainerClassName: ; 3952d
ld hl, RivalName
ld hl, wRivalName
ld a, c
cp RIVAL1
jr z, .rival
ld [CurSpecies], a
ld [wCurSpecies], a
ld a, TRAINER_NAME
ld [wNamedObjectTypeBuffer], a
call GetName
ld de, StringBuffer1
ld de, wStringBuffer1
ret
.rival
ld de, StringBuffer1
ld de, wStringBuffer1
push de
ld bc, NAME_LENGTH
call CopyBytes
@@ -20,35 +20,35 @@ GetTrainerClassName: ; 3952d
ret
GetOTName: ; 39550
ld hl, OTPlayerName
ld hl, wOTPlayerName
ld a, [wLinkMode]
and a
jr nz, .ok
ld hl, RivalName
ld hl, wRivalName
ld a, c
cp RIVAL1
jr z, .ok
ld [CurSpecies], a
ld [wCurSpecies], a
ld a, TRAINER_NAME
ld [wNamedObjectTypeBuffer], a
call GetName
ld hl, StringBuffer1
ld hl, wStringBuffer1
.ok
ld bc, TRAINER_CLASS_NAME_LENGTH
ld de, OTClassName
ld de, wOTClassName
push de
call CopyBytes
pop de
ret
GetTrainerAttributes: ; 3957b
ld a, [TrainerClass]
ld a, [wTrainerClass]
ld c, a
call GetOTName
ld a, [TrainerClass]
ld a, [wTrainerClass]
dec a
ld hl, TrainerClassAttributes + TRNATTR_ITEM1
ld bc, NUM_TRAINER_ATTRIBUTES

View File

@@ -1,8 +1,8 @@
GetTrainerDVs: ; 270c4
; Return the DVs of OtherTrainerClass in bc
; Return the DVs of wOtherTrainerClass in bc
push hl
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
dec a
ld c, a
ld b, 0

View File

@@ -1,5 +1,5 @@
ReadTrainerParty: ; 39771
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
bit 0, a
ret nz
@@ -7,24 +7,24 @@ ReadTrainerParty: ; 39771
and a
ret nz
ld hl, OTPartyCount
ld hl, wOTPartyCount
xor a
ld [hli], a
dec a
ld [hl], a
ld hl, OTPartyMons
ld bc, OTPartyMonsEnd - OTPartyMons
ld hl, wOTPartyMons
ld bc, wOTPartyMonsEnd - wOTPartyMons
xor a
call ByteFill
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
cp CAL
jr nz, .not_cal2
ld a, [OtherTrainerID]
ld a, [wOtherTrainerID]
cp CAL2
jr z, .cal2
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
.not_cal2
dec a
@@ -37,7 +37,7 @@ ReadTrainerParty: ; 39771
ld h, [hl]
ld l, a
ld a, [OtherTrainerID]
ld a, [wOtherTrainerID]
ld b, a
.skip_trainer
dec b
@@ -98,11 +98,11 @@ TrainerType1: ; 397eb
cp $ff
ret z
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
ld a, [hli]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, OTPARTYMON
ld [MonType], a
ld [wMonType], a
push hl
predef TryAddMonToParty
pop hl
@@ -118,17 +118,17 @@ TrainerType2: ; 39806
cp $ff
ret z
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
ld a, [hli]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, OTPARTYMON
ld [MonType], a
ld [wMonType], a
push hl
predef TryAddMonToParty
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
dec a
ld hl, OTPartyMon1Moves
ld hl, wOTPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -145,9 +145,9 @@ TrainerType2: ; 39806
push hl
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
dec a
ld hl, OTPartyMon1Species
ld hl, wOTPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -195,16 +195,16 @@ TrainerType3: ; 39871
cp $ff
ret z
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
ld a, [hli]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, OTPARTYMON
ld [MonType], a
ld [wMonType], a
push hl
predef TryAddMonToParty
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
dec a
ld hl, OTPartyMon1Item
ld hl, wOTPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -224,18 +224,18 @@ TrainerType4: ; 3989d
cp $ff
ret z
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
ld a, [hli]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, OTPARTYMON
ld [MonType], a
ld [wMonType], a
push hl
predef TryAddMonToParty
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
dec a
ld hl, OTPartyMon1Item
ld hl, wOTPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -246,9 +246,9 @@ TrainerType4: ; 3989d
ld [de], a
push hl
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
dec a
ld hl, OTPartyMon1Moves
ld hl, wOTPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -265,9 +265,9 @@ TrainerType4: ; 3989d
push hl
ld a, [OTPartyCount]
ld a, [wOTPartyCount]
dec a
ld hl, OTPartyMon1
ld hl, wOTPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -315,7 +315,7 @@ ComputeTrainerReward: ; 3991b (e:591b)
ld [hli], a
ld a, [wEnemyTrainerBaseReward]
ld [hli], a
ld a, [CurPartyLevel]
ld a, [wCurPartyLevel]
ld [hl], a
call Multiply
ld hl, wBattleReward
@@ -329,14 +329,14 @@ ComputeTrainerReward: ; 3991b (e:591b)
Battle_GetTrainerName:: ; 39939
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
bit 0, a
ld hl, OTPlayerName
ld hl, wOTPlayerName
jp nz, CopyTrainerName
ld a, [OtherTrainerID]
ld a, [wOtherTrainerID]
ld b, a
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
ld c, a
GetTrainerName:: ; 3994c
@@ -380,7 +380,7 @@ GetTrainerName:: ; 3994c
jr .loop
CopyTrainerName: ; 39984
ld de, StringBuffer1
ld de, wStringBuffer1
push de
ld bc, NAME_LENGTH
call CopyBytes
@@ -390,7 +390,7 @@ CopyTrainerName: ; 39984
Function39990: ; 39990
; This function is useless.
ld de, StringBuffer1
ld de, wStringBuffer1
push de
ld bc, NAME_LENGTH
pop de

View File

@@ -1,7 +1,7 @@
_ReturnToBattle_UseBall: ; 2715c
call ClearBGPalettes
call ClearTileMap
ld a, [BattleType]
ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .gettutorialbackpic
farcall GetBattleMonBackpic

View File

@@ -1,7 +1,7 @@
BattleIntroSlidingPics: ; 4e980
ld a, [rSVBK]
push af
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
call .subfunction1
ld a, rSCX - $ff00
@@ -60,7 +60,7 @@ BattleIntroSlidingPics: ; 4e980
; 4e9d6
.subfunction3 ; 4e9d6
ld hl, Sprite01XCoord
ld hl, wVirtualOAMSprite00XCoord
ld c, $12 ; 18
ld de, SPRITEOAMSTRUCT_LENGTH
.loop3
@@ -73,7 +73,7 @@ BattleIntroSlidingPics: ; 4e980
; 4e9e5
.subfunction4 ; 4e9e5
ld hl, LYOverrides
ld hl, wLYOverrides
ld a, $90
ld bc, SCREEN_HEIGHT_PX
call ByteFill
@@ -81,7 +81,7 @@ BattleIntroSlidingPics: ; 4e980
; 4e9f1
.subfunction5 ; 4e9f1
ld hl, LYOverrides
ld hl, wLYOverrides
ld a, d
ld c, $3e ; 62
.loop4

View File

@@ -17,7 +17,7 @@ FindFirstAliveMonAndStartBattle: ; 2ee2f
ld [hMapAnims], a
call DelayFrame
ld b, 6
ld hl, PartyMon1HP
ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH - 1
.loop
@@ -32,7 +32,7 @@ FindFirstAliveMonAndStartBattle: ; 2ee2f
ld de, MON_LEVEL - MON_HP
add hl, de
ld a, [hl]
ld [BattleMonLevel], a
ld [wBattleMonLevel], a
predef DoBattleTransition
farcall _LoadBattleFontsHPBar
ld a, 1
@@ -52,13 +52,13 @@ PlayBattleMusic: ; 2ee6c
push bc
xor a
ld [MusicFade], a
ld [wMusicFade], a
ld de, MUSIC_NONE
call PlayMusic
call DelayFrame
call MaxVolume
ld a, [BattleType]
ld a, [wBattleType]
cp BATTLETYPE_SUICUNE
ld de, MUSIC_SUICUNE_BATTLE
jp z, .done
@@ -66,7 +66,7 @@ PlayBattleMusic: ; 2ee6c
jp z, .done
; Are we fighting a trainer?
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
and a
jr nz, .trainermusic
@@ -76,7 +76,7 @@ PlayBattleMusic: ; 2ee6c
jr nz, .kantowild
ld de, MUSIC_JOHTO_WILD_BATTLE
ld a, [TimeOfDay]
ld a, [wTimeOfDay]
cp NITE_F
jr nz, .done
ld de, MUSIC_JOHTO_WILD_BATTLE_NIGHT
@@ -111,13 +111,13 @@ PlayBattleMusic: ; 2ee6c
jr c, .done
ld de, MUSIC_RIVAL_BATTLE
ld a, [OtherTrainerClass]
ld a, [wOtherTrainerClass]
cp RIVAL1
jr z, .done
cp RIVAL2
jr nz, .othertrainer
ld a, [OtherTrainerID]
ld a, [wOtherTrainerID]
cp RIVAL2_2_CHIKORITA ; Rival in Indigo Plateau
jr c, .done
ld de, MUSIC_CHAMPION_BATTLE
@@ -150,7 +150,7 @@ PlayBattleMusic: ; 2ee6c
ClearBattleRAM: ; 2ef18
xor a
ld [wPlayerAction], a
ld [wBattlePlayerAction], a
ld [wBattleResult], a
ld hl, wPartyMenuCursor
@@ -160,25 +160,25 @@ ClearBattleRAM: ; 2ef18
ld [hl], a
ld [wMenuScrollPosition], a
ld [CriticalHit], a
ld [BattleMonSpecies], a
ld [wCriticalHit], a
ld [wBattleMonSpecies], a
ld [wBattleParticipantsNotFainted], a
ld [CurBattleMon], a
ld [wCurBattleMon], a
ld [wForcedSwitch], a
ld [TimeOfDayPal], a
ld [PlayerTurnsTaken], a
ld [EnemyTurnsTaken], a
ld [EvolvableFlags], a
ld [wTimeOfDayPal], a
ld [wPlayerTurnsTaken], a
ld [wEnemyTurnsTaken], a
ld [wEvolvableFlags], a
ld hl, PlayerHPPal
ld hl, wPlayerHPPal
ld [hli], a
ld [hl], a
ld hl, BattleMonDVs
ld hl, wBattleMonDVs
ld [hli], a
ld [hl], a
ld hl, EnemyMonDVs
ld hl, wEnemyMonDVs
ld [hli], a
ld [hl], a

View File

@@ -18,8 +18,8 @@ EnemySwitch_TrainerHud: ; 2c012
ShowPlayerMonsRemaining: ; 2c01c
call DrawPlayerPartyIconHUDBorder
ld hl, PartyMon1HP
ld de, PartyCount
ld hl, wPartyMon1HP
ld de, wPartyCount
call StageBallTilesData
; ldpixel wPlaceBallsX, 12, 12
ld a, 12 * 8
@@ -28,14 +28,14 @@ ShowPlayerMonsRemaining: ; 2c01c
ld [hl], a
ld a, 8
ld [wPlaceBallsDirection], a
ld hl, Sprite01
ld hl, wVirtualOAMSprite00
jp LoadTrainerHudOAM
; 2c03a
ShowOTTrainerMonsRemaining: ; 2c03a
call DrawEnemyHUDBorder
ld hl, OTPartyMon1HP
ld de, OTPartyCount
ld hl, wOTPartyMon1HP
ld de, wOTPartyCount
call StageBallTilesData
; ldpixel wPlaceBallsX, 9, 4
ld hl, wPlaceBallsX
@@ -44,14 +44,14 @@ ShowOTTrainerMonsRemaining: ; 2c03a
ld [hl], 4 * 8
ld a, -8
ld [wPlaceBallsDirection], a
ld hl, Sprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
jp LoadTrainerHudOAM
; 2c059
StageBallTilesData: ; 2c059
ld a, [de]
push af
ld de, Buffer1
ld de, wBuffer1
ld c, PARTY_LENGTH
ld a, $34 ; empty slot
.loop1
@@ -60,7 +60,7 @@ StageBallTilesData: ; 2c059
dec c
jr nz, .loop1
pop af
ld de, Buffer1
ld de, wBuffer1
.loop2
push af
call .GetHUDTile
@@ -147,7 +147,7 @@ DrawEnemyHUDBorder: ; 2c0c5
ld a, [wBattleMode]
dec a
ret nz
ld a, [TempEnemyMonSpecies]
ld a, [wTempEnemyMonSpecies]
dec a
call CheckCaughtMon
ret z
@@ -167,25 +167,25 @@ PlaceHUDBorderTiles: ; 2c0f1
ld [hl], a
ld bc, SCREEN_WIDTH
add hl, bc
ld a, [StartFlypoint]
ld a, [wStartFlypoint]
ld [hl], a
ld b, $8
.loop
add hl, de
ld a, [MovementBuffer]
ld a, [wMovementBuffer]
ld [hl], a
dec b
jr nz, .loop
add hl, de
ld a, [EndFlypoint]
ld a, [wEndFlypoint]
ld [hl], a
ret
; 2c10d
LinkBattle_TrainerHuds: ; 2c10d
call LoadBallIconGFX
ld hl, PartyMon1HP
ld de, PartyCount
ld hl, wPartyMon1HP
ld de, wPartyCount
call StageBallTilesData
ld hl, wPlaceBallsX
ld a, 10 * 8
@@ -193,22 +193,22 @@ LinkBattle_TrainerHuds: ; 2c10d
ld [hl], 8 * 8
ld a, $8
ld [wPlaceBallsDirection], a
ld hl, Sprite01
ld hl, wVirtualOAMSprite00
call LoadTrainerHudOAM
ld hl, OTPartyMon1HP
ld de, OTPartyCount
ld hl, wOTPartyMon1HP
ld de, wOTPartyCount
call StageBallTilesData
ld hl, wPlaceBallsX
ld a, 10 * 8
ld [hli], a
ld [hl], 13 * 8
ld hl, Sprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
jp LoadTrainerHudOAM
; 2c143
LoadTrainerHudOAM: ; 2c143
ld de, Buffer1
ld de, wBuffer1
ld c, PARTY_LENGTH
.loop
ld a, [wPlaceBallsY]
@@ -250,10 +250,10 @@ _ShowLinkBattleParticipants: ; 2c1b2
ld c, 14
call TextBox
hlcoord 4, 5
ld de, PlayerName
ld de, wPlayerName
call PlaceString
hlcoord 4, 10
ld de, OTPlayerName
ld de, wOTPlayerName
call PlaceString
hlcoord 9, 8
ld a, "<BOLD_V>"

View File

@@ -1,9 +1,9 @@
_UpdateBattleHUDs:
farcall DrawPlayerHUD
ld hl, PlayerHPPal
ld hl, wPlayerHPPal
call SetHPPal
farcall DrawEnemyHUD
ld hl, EnemyHPPal
ld hl, wEnemyHPPal
call SetHPPal
farcall FinishBattleAnim
ret

View File

@@ -46,7 +46,7 @@ UsedMoveText: ; 105db9
; everything except 'instead' made redundant in localization
; check obedience
ld a, [AlreadyDisobeyed]
ld a, [wAlreadyDisobeyed]
and a
ld hl, UsedMove2Text
ret nz
@@ -71,7 +71,7 @@ UsedMove2Text: ; 105e0b
start_asm
UsedMoveText_CheckObedience: ; 105e10
; check obedience
ld a, [AlreadyDisobeyed]
ld a, [wAlreadyDisobeyed]
and a
jr z, .GetMoveNameText
; print "instead,"
@@ -184,11 +184,11 @@ INCLUDE "data/moves/grammar.asm"
UpdateUsedMoves: ; 105ed0
; append move a to PlayerUsedMoves unless it has already been used
; append move a to wPlayerUsedMoves unless it has already been used
push bc
; start of list
ld hl, PlayerUsedMoves
ld hl, wPlayerUsedMoves
; get move id
ld b, a
; next count
@@ -210,7 +210,7 @@ UpdateUsedMoves: ; 105ed0
; if the list is full and the move hasn't already been used
; shift the list back one byte, deleting the first move used
; this can occur with struggle or a new learned move
ld hl, PlayerUsedMoves + 1
ld hl, wPlayerUsedMoves + 1
; 1 = 2
ld a, [hld]
ld [hli], a
@@ -224,7 +224,7 @@ UpdateUsedMoves: ; 105ed0
ld [hl], a
; 4 = new move
ld a, b
ld [PlayerUsedMoves + 3], a
ld [wPlayerUsedMoves + 3], a
jr .quit
.add

View File

@@ -5,7 +5,7 @@ PlayBattleAnim: ; cc0d6
ld a, [rSVBK]
push af
ld a, BANK(ActiveAnimObjects)
ld a, BANK(wActiveAnimObjects)
ld [rSVBK], a
call _PlayBattleAnim
@@ -56,7 +56,7 @@ _PlayBattleAnim: ; cc0e4
BattleAnimRunScript: ; cc11c
ld a, [FXAnimID + 1]
ld a, [wFXAnimID + 1]
and a
jr nz, .hi_byte
@@ -85,9 +85,9 @@ BattleAnimRunScript: ; cc11c
ld de, ANIM_MISS
add hl, de
ld a, l
ld [FXAnimID], a
ld [wFXAnimID], a
ld a, h
ld [FXAnimID + 1], a
ld [wFXAnimID + 1], a
.hi_byte
call WaitSFX
@@ -111,18 +111,18 @@ RunBattleAnimScript: ; cc163
call BattleAnimRequestPals
; Speed up Rollout's animation.
ld a, [FXAnimID + 1]
ld a, [wFXAnimID + 1]
or a
jr nz, .not_rollout
ld a, [FXAnimID]
ld a, [wFXAnimID]
cp ROLLOUT
jr nz, .not_rollout
ld a, $2e
ld b, 5
ld de, 4
ld hl, ActiveBGEffects
ld hl, wActiveBGEffects
.find
cp [hl]
jr z, .done
@@ -134,7 +134,7 @@ RunBattleAnimScript: ; cc163
call BattleAnimDelayFrame
.done
ld a, [BattleAnimFlags]
ld a, [wBattleAnimFlags]
bit 0, a
jr z, .playframe
@@ -163,7 +163,7 @@ BattleAnimRestoreHuds: ; cc1bb
ld a, [rSVBK]
push af
ld a, BANK(CurBattleMon) ; alternatively: BANK(TempMon), BANK(PartyMon1), several others
ld a, BANK(wCurBattleMon) ; alternatively: BANK(wTempMon), BANK(wPartyMon1), several others
ld [rSVBK], a
ld hl, UpdateBattleHuds
@@ -206,9 +206,9 @@ BattleAnimDelayFrame: ; cc1fb
; Like DelayFrame but wastes battery life.
ld a, 1
ld [VBlankOccurred], a
ld [wVBlankOccurred], a
.wait
ld a, [VBlankOccurred]
ld a, [wVBlankOccurred]
and a
jr nz, .wait
ret
@@ -253,11 +253,11 @@ Unreferenced_Functioncc220: ; cc220
BattleAnim_ClearCGB_OAMFlags: ; cc23d
ld a, [BattleAnimFlags]
ld a, [wBattleAnimFlags]
bit 3, a
jr z, .delete
ld hl, Sprite01Attributes
ld hl, wVirtualOAMSprite00Attributes
ld c, NUM_SPRITE_OAM_STRUCTS
.loop
ld a, [hl]
@@ -271,8 +271,8 @@ endr
ret
.delete
ld hl, Sprites
ld c, SpritesEnd - Sprites
ld hl, wVirtualOAM
ld c, wVirtualOAMEnd - wVirtualOAM
xor a
.loop2
ld [hli], a
@@ -289,12 +289,12 @@ RunBattleAnimCommand: ; cc25f
; cc267
.CheckTimer: ; cc267
ld a, [BattleAnimDuration]
ld a, [wBattleAnimDuration]
and a
jr z, .done
dec a
ld [BattleAnimDuration], a
ld [wBattleAnimDuration], a
and a
ret
@@ -311,7 +311,7 @@ RunBattleAnimCommand: ; cc25f
jr nz, .not_done_with_anim
; Return from a subroutine.
ld hl, BattleAnimFlags
ld hl, wBattleAnimFlags
bit 1, [hl]
jr nz, .do_anim
@@ -322,7 +322,7 @@ RunBattleAnimCommand: ; cc25f
cp $d0
jr nc, .do_anim
ld [BattleAnimDuration], a
ld [wBattleAnimDuration], a
ret
.do_anim
@@ -332,8 +332,8 @@ RunBattleAnimCommand: ; cc25f
; cc293
.DoCommand: ; cc293
; Execute battle animation command in [BattleAnimByte].
ld a, [BattleAnimByte]
; Execute battle animation command in [wBattleAnimByte].
ld a, [wBattleAnimByte]
sub $d0
ld e, a
@@ -408,13 +408,13 @@ BattleAnimCmd_ED: ; cc304 (33:4304)
ret
BattleAnimCmd_Ret: ; cc305 (33:4305)
ld hl, BattleAnimFlags
ld hl, wBattleAnimFlags
res 1, [hl]
ld hl, BattleAnimParent
ld hl, wBattleAnimParent
ld e, [hl]
inc hl
ld d, [hl]
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -426,20 +426,20 @@ BattleAnimCmd_Call: ; cc317 (33:4317)
call GetBattleAnimByte
ld d, a
push de
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
ld hl, BattleAnimParent
ld hl, wBattleAnimParent
ld [hl], e
inc hl
ld [hl], d
pop de
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
ld hl, BattleAnimFlags
ld hl, wBattleAnimFlags
set 1, [hl]
ret
@@ -448,7 +448,7 @@ BattleAnimCmd_Jump: ; cc339 (33:4339)
ld e, a
call GetBattleAnimByte
ld d, a
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -456,16 +456,16 @@ BattleAnimCmd_Jump: ; cc339 (33:4339)
BattleAnimCmd_Loop: ; cc348 (33:4348)
call GetBattleAnimByte
ld hl, BattleAnimFlags
ld hl, wBattleAnimFlags
bit 2, [hl]
jr nz, .continue_loop
and a
jr z, .perpetual
dec a
set 2, [hl]
ld [BattleAnimLoops], a
ld [wBattleAnimLoops], a
.continue_loop
ld hl, BattleAnimLoops
ld hl, wBattleAnimLoops
ld a, [hl]
and a
jr z, .return_from_loop
@@ -475,16 +475,16 @@ BattleAnimCmd_Loop: ; cc348 (33:4348)
ld e, a
call GetBattleAnimByte
ld d, a
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
ret
.return_from_loop
ld hl, BattleAnimFlags
ld hl, wBattleAnimFlags
res 2, [hl]
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -506,14 +506,14 @@ BattleAnimCmd_JumpUntil: ; cc383 (33:4383)
ld e, a
call GetBattleAnimByte
ld d, a
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
ret
.dont_jump
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -526,21 +526,21 @@ BattleAnimCmd_JumpUntil: ; cc383 (33:4383)
BattleAnimCmd_SetVar: ; cc3a6 (33:43a6)
call GetBattleAnimByte
ld [BattleAnimVar], a
ld [wBattleAnimVar], a
ret
BattleAnimCmd_IncVar: ; cc3ad (33:43ad)
ld hl, BattleAnimVar
ld hl, wBattleAnimVar
inc [hl]
ret
BattleAnimCmd_IfVarEqual: ; cc3b2 (33:43b2)
call GetBattleAnimByte
ld hl, BattleAnimVar
ld hl, wBattleAnimVar
cp [hl]
jr z, .jump
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -556,7 +556,7 @@ BattleAnimCmd_IfVarEqual: ; cc3b2 (33:43b2)
ld e, a
call GetBattleAnimByte
ld d, a
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -568,7 +568,7 @@ BattleAnimCmd_IfParamEqual: ; cc3d6 (33:43d6)
cp [hl]
jr z, .jump
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -584,7 +584,7 @@ BattleAnimCmd_IfParamEqual: ; cc3d6 (33:43d6)
ld e, a
call GetBattleAnimByte
ld d, a
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -597,7 +597,7 @@ BattleAnimCmd_IfParamAnd: ; cc3fa (33:43fa)
and e
jr nz, .jump
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -613,7 +613,7 @@ BattleAnimCmd_IfParamAnd: ; cc3fa (33:43fa)
ld e, a
call GetBattleAnimByte
ld d, a
ld hl, BattleAnimAddress
ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -670,7 +670,7 @@ BattleAnimCmd_ResetObp0: ; cc46c (33:446c)
ret
BattleAnimCmd_ClearObjs: ; cc479 (33:4479)
ld hl, ActiveAnimObjects
ld hl, wActiveAnimObjects
ld a, $a0
.loop
ld [hl], $0
@@ -684,7 +684,7 @@ BattleAnimCmd_2GFX:
BattleAnimCmd_3GFX:
BattleAnimCmd_4GFX:
BattleAnimCmd_5GFX: ; cc485 (33:4485)
ld a, [BattleAnimByte]
ld a, [wBattleAnimByte]
and $f
ld c, a
ld hl, wBattleAnimTileDict
@@ -707,7 +707,7 @@ rept 4
endr
ld de, vTiles0 tile $31
add hl, de
ld a, [BattleAnimByte]
ld a, [wBattleAnimByte]
call LoadBattleAnimObj
ld a, [wBattleAnimTemp0]
add c
@@ -721,12 +721,12 @@ endr
BattleAnimCmd_IncObj: ; cc4c0 (33:44c0)
call GetBattleAnimByte
ld e, 10
ld bc, ActiveAnimObjects
ld bc, wActiveAnimObjects
.loop
ld hl, BATTLEANIMSTRUCT_INDEX
add hl, bc
ld d, [hl]
ld a, [BattleAnimByte]
ld a, [wBattleAnimByte]
cp d
jr z, .found
ld hl, BATTLEANIMSTRUCT_LENGTH
@@ -746,12 +746,12 @@ BattleAnimCmd_IncObj: ; cc4c0 (33:44c0)
BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3)
call GetBattleAnimByte
ld e, 5
ld bc, ActiveBGEffects
ld bc, wActiveBGEffects
.loop
ld hl, $0
add hl, bc
ld d, [hl]
ld a, [BattleAnimByte]
ld a, [wBattleAnimByte]
cp d
jr z, .found
ld hl, 4
@@ -771,12 +771,12 @@ BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3)
BattleAnimCmd_SetObj: ; cc506 (33:4506)
call GetBattleAnimByte
ld e, 10
ld bc, ActiveAnimObjects
ld bc, wActiveAnimObjects
.loop
ld hl, BATTLEANIMSTRUCT_INDEX
add hl, bc
ld d, [hl]
ld a, [BattleAnimByte]
ld a, [wBattleAnimByte]
cp d
jr z, .found
ld hl, BATTLEANIMSTRUCT_LENGTH
@@ -907,7 +907,7 @@ BattleAnimCmd_PlayerHeadObj: ; cc57e (33:457e)
BattleAnimCmd_CheckPokeball: ; cc5d0 (33:45d0)
callfar GetPokeBallWobble
ld a, c
ld [BattleAnimVar], a
ld [wBattleAnimVar], a
ret
BattleAnimCmd_E7: ; cc5db (33:45db)
@@ -916,34 +916,34 @@ BattleAnimCmd_E7: ; cc5db (33:45db)
BattleAnimCmd_Transform: ; cc5dc (33:45dc)
ld a, [rSVBK]
push af
ld a, BANK(CurPartySpecies)
ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies
ld a, [wCurPartySpecies] ; CurPartySpecies
push af
ld a, [hBattleTurn]
and a
jr z, .player
ld a, [TempBattleMonSpecies] ; TempBattleMonSpecies
ld [CurPartySpecies], a ; CurPartySpecies
ld hl, BattleMonDVs ; BattleMonDVs
ld a, [wTempBattleMonSpecies] ; TempBattleMonSpecies
ld [wCurPartySpecies], a ; CurPartySpecies
ld hl, wBattleMonDVs ; BattleMonDVs
predef GetUnownLetter
ld de, vTiles0 tile $00
predef GetMonFrontpic
jr .done
.player
ld a, [TempEnemyMonSpecies] ; TempEnemyMonSpecies
ld [CurPartySpecies], a ; CurPartySpecies
ld hl, EnemyMonDVs ; EnemyMonDVs
ld a, [wTempEnemyMonSpecies] ; TempEnemyMonSpecies
ld [wCurPartySpecies], a ; CurPartySpecies
ld hl, wEnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter
ld de, vTiles0 tile $00
predef GetMonBackpic
.done
pop af
ld [CurPartySpecies], a ; CurPartySpecies
ld [wCurPartySpecies], a ; CurPartySpecies
pop af
ld [rSVBK], a
ret
@@ -1117,10 +1117,10 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735)
BattleAnimCmd_DropSub: ; cc750 (33:4750)
ld a, [rSVBK]
push af
ld a, BANK(CurPartySpecies)
ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies
ld a, [wCurPartySpecies] ; CurPartySpecies
push af
ld a, [hBattleTurn]
and a
@@ -1134,7 +1134,7 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750)
.done
pop af
ld [CurPartySpecies], a ; CurPartySpecies
ld [wCurPartySpecies], a ; CurPartySpecies
pop af
ld [rSVBK], a
ret
@@ -1142,33 +1142,33 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750)
BattleAnimCmd_BeatUp: ; cc776 (33:4776)
ld a, [rSVBK]
push af
ld a, BANK(CurPartySpecies)
ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
ld a, [CurPartySpecies] ; CurPartySpecies
ld a, [wCurPartySpecies] ; CurPartySpecies
push af
ld a, [wBattleAnimParam]
ld [CurPartySpecies], a ; CurPartySpecies
ld [wCurPartySpecies], a ; CurPartySpecies
ld a, [hBattleTurn]
and a
jr z, .player
ld hl, BattleMonDVs
ld hl, wBattleMonDVs
predef GetUnownLetter
ld de, vTiles2 tile $00
predef GetMonFrontpic
jr .done
.player
ld hl, EnemyMonDVs
ld hl, wEnemyMonDVs
predef GetUnownLetter
ld de, vTiles2 tile $31
predef GetMonBackpic
.done
pop af
ld [CurPartySpecies], a ; CurPartySpecies
ld [wCurPartySpecies], a ; CurPartySpecies
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
pop af
@@ -1186,7 +1186,7 @@ BattleAnimCmd_OAMOff: ; cc7bf (33:47bf)
ret
BattleAnimCmd_ClearSprites: ; cc7c4 (33:47c4)
ld hl, BattleAnimFlags
ld hl, wBattleAnimFlags
set 3, [hl]
ret
@@ -1207,7 +1207,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd)
ld [wSFXDuration], a
call .GetCryTrack
maskbits NUM_NOISE_CHANS
ld [CryTracks], a ; CryTracks
ld [wCryTracks], a ; CryTracks
ld e, a
ld d, 0
@@ -1253,7 +1253,7 @@ endr
ld a, [rSVBK]
push af
ld a, BANK(EnemyMon) ; BattleMon is in WRAM0, but EnemyMon is in WRAMX
ld a, BANK(wEnemyMon) ; wBattleMon is in WRAM0, but EnemyMon is in WRAMX
ld [rSVBK], a
ld a, [hBattleTurn]
@@ -1261,14 +1261,14 @@ endr
jr nz, .enemy
ld a, $f0
ld [CryTracks], a
ld a, [BattleMonSpecies]
ld [wCryTracks], a
ld a, [wBattleMonSpecies]
jr .done_cry_tracks
.enemy
ld a, $0f
ld [CryTracks], a
ld a, [EnemyMonSpecies]
ld [wCryTracks], a
ld a, [wEnemyMonSpecies]
.done_cry_tracks
push hl
@@ -1282,30 +1282,30 @@ endr
ld b, a
push hl
ld hl, CryPitch
ld hl, wCryPitch
ld a, [hli]
ld h, [hl]
ld l, a
add hl, bc
ld a, l
ld [CryPitch], a
ld [wCryPitch], a
ld a, h
ld [CryPitch + 1], a
ld [wCryPitch + 1], a
pop hl
ld a, [hli]
ld c, a
ld b, [hl]
ld hl, CryLength ; CryLength
ld hl, wCryLength ; CryLength
ld a, [hli]
ld h, [hl]
ld l, a
add hl, bc
ld a, l
ld [CryLength], a ; CryLength
ld [wCryLength], a ; CryLength
ld a, h
ld [CryLength + 1], a
ld [wCryLength + 1], a
ld a, 1
ld [wStereoPanningMask], a
@@ -1334,7 +1334,7 @@ PlayHitSound: ; cc881
ret nz
.okay
ld a, [TypeModifier]
ld a, [wTypeModifier]
and $7f
ret z
@@ -1382,8 +1382,8 @@ BattleAnimAssignPals: ; cc8a4
ClearBattleAnims: ; cc8d3
; Clear animation block
ld hl, LYOverrides
ld bc, wBattleAnimEnd - LYOverrides
ld hl, wLYOverrides
ld bc, wBattleAnimEnd - wLYOverrides
.loop
ld [hl], $0
inc hl
@@ -1392,7 +1392,7 @@ ClearBattleAnims: ; cc8d3
or b
jr nz, .loop
ld hl, FXAnimID
ld hl, wFXAnimID
ld e, [hl]
inc hl
ld d, [hl]
@@ -1476,7 +1476,7 @@ BattleAnim_SetOBPals: ; cc94b
BattleAnim_UpdateOAM_All: ; cc96e
ld a, $0
ld [wBattleAnimOAMPointerLo], a
ld hl, ActiveAnimObjects
ld hl, wActiveAnimObjects
ld e, 10
.loop
ld a, [hl]
@@ -1499,10 +1499,10 @@ BattleAnim_UpdateOAM_All: ; cc96e
jr nz, .loop
ld a, [wBattleAnimOAMPointerLo]
ld l, a
ld h, HIGH(Sprites)
ld h, HIGH(wVirtualOAM)
.loop2
ld a, l
cp LOW(SpritesEnd)
cp LOW(wVirtualOAMEnd)
jr nc, .done
xor a
ld [hli], a

View File

@@ -9,7 +9,7 @@
; BG effects for use in battle animations.
ExecuteBGEffects: ; c8000 (32:4000)
ld hl, ActiveBGEffects
ld hl, wActiveBGEffects
ld e, 5
.loop
ld a, [hl]
@@ -30,7 +30,7 @@ ExecuteBGEffects: ; c8000 (32:4000)
ret
QueueBGEffect: ; c801a (32:401a)
ld hl, ActiveBGEffects
ld hl, wActiveBGEffects
ld e, 5
.loop
ld a, [hl]
@@ -960,7 +960,7 @@ BattleBGEffect_Surf: ; c8545 (32:4545)
jr nz, .loop
pop af
ld [hl], a
ld de, LYOverridesBackup
ld de, wLYOverridesBackup
ld hl, wSurfWaveBGEffect
ld bc, $0
.loop2
@@ -1224,7 +1224,7 @@ BattleBGEffect_DoubleTeam: ; c8689 (32:4689)
xor $ff
inc a
ld d, a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, [hLYOverrideEnd]
@@ -1265,7 +1265,7 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709)
ld e, [hl]
ld d, 2
call Functionc8f2e
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideEnd]
ld l, a
ld [hl], $0
@@ -1276,7 +1276,7 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709)
.one
ld a, [hLYOverrideEnd]
ld l, a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld e, l
ld d, h
dec de
@@ -1539,10 +1539,10 @@ Tackle_BGEffect25_2d_two:
Functionc88a5: ; c88a5 (32:48a5)
push af
ld a, [FXAnimID + 1] ; FXAnimID + 1
ld a, [wFXAnimID + 1] ; FXAnimID + 1
or a
jr nz, .not_rollout
ld a, [FXAnimID] ; FXAnimID
ld a, [wFXAnimID] ; FXAnimID
cp ROLLOUT
jr z, .rollout
.not_rollout
@@ -1555,7 +1555,7 @@ Functionc88a5: ; c88a5 (32:48a5)
ld a, [hLYOverrideEnd]
sub d
ld d, a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld a, [hSCY]
or a
jr nz, .skip1
@@ -1847,7 +1847,7 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a)
ld [hLYOverrideEnd], a
ld a, [hLYOverrideStart]
ld l, a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
.loop
ld a, [hLYOverrideEnd]
cp l
@@ -1901,7 +1901,7 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a)
ld a, [hLYOverrideEnd]
sub l
srl a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
.loop2
ld [hl], e
inc hl
@@ -2044,7 +2044,7 @@ BattleBGEffect_1c: ; c8b00 (32:4b00)
ret
.DMG_LYOverrideLoads:
ld hl, LYOverridesBackup
ld hl, wLYOverridesBackup
.loop1
ld [hl], d
inc hl
@@ -2314,7 +2314,7 @@ BattleBGEffect_2e: ; c8ce1 (32:4ce1)
ld [hSCY], a
xor $ff
inc a
ld [AnimObject01YOffset], a
ld [wAnimObject01YOffset], a
ret
BattleBGEffect_1f: ; c8cf9 (32:4cf9)
@@ -2657,13 +2657,13 @@ BattleBGEffect_GetNextDMGPal: ; c8eb2 (32:4eb2)
BattleBGEffects_ClearLYOverrides: ; c8eca (32:4eca)
xor a
BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb)
ld hl, LYOverrides ; wListPointer
ld hl, wLYOverrides ; wListPointer
ld e, $99
.loop1
ld [hli], a
dec e
jr nz, .loop1
ld hl, LYOverridesBackup
ld hl, wLYOverridesBackup
ld e, $91
.loop2
ld [hli], a
@@ -2735,7 +2735,7 @@ Functionc8f2e: ; c8f2e (32:4f2e)
ld [wBattleAnimTemp2], a
ld a, $80
ld [wBattleAnimTemp3], a
ld bc, LYOverridesBackup
ld bc, wLYOverridesBackup
.loop
ld a, [hLYOverrideStart]
cp c
@@ -2796,7 +2796,7 @@ Functionc8f9a: ; c8f9a (32:4f9a)
ld a, d
ld [wBattleAnimTemp2], a
call .GetLYOverrideBackupAddrOffset
ld hl, LYOverridesBackup
ld hl, wLYOverridesBackup
add hl, de
ld c, l
ld b, h
@@ -2853,7 +2853,7 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef)
ld l, a
inc a
ld e, a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld d, h
ld a, [hLYOverrideEnd]
sub l
@@ -2876,7 +2876,7 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef)
BGEffect_FillLYOverridesBackup: ; c900b (32:500b)
push af
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, [hLYOverrideEnd]
@@ -2899,7 +2899,7 @@ BGEffect_DisplaceLYOverridesBackup: ; c901b (32:501b)
sub l
sub e
ld d, a
ld h, HIGH(LYOverridesBackup)
ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, $90
@@ -2930,12 +2930,12 @@ BGEffect_CheckFlyDigStatus: ; c9042 (32:5042)
and $1
xor [hl]
jr nz, .player
ld a, [EnemySubStatus3] ; EnemySubStatus3
ld a, [wEnemySubStatus3] ; EnemySubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret
.player
ld a, [PlayerSubStatus3] ; PlayerSubStatus3
ld a, [wPlayerSubStatus3] ; PlayerSubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret

View File

@@ -1,5 +1,5 @@
QueueBattleAnimation: ; cc9a1 (33:49a1)
ld hl, ActiveAnimObjects
ld hl, wActiveAnimObjects
ld e, 10
.loop
ld a, [hl]
@@ -106,7 +106,7 @@ BattleAnimOAMUpdate: ; cca09
ld l, a
ld a, [wBattleAnimOAMPointerLo]
ld e, a
ld d, HIGH(Sprites)
ld d, HIGH(wVirtualOAM)
.loop
ld a, [wBattleAnimTempYCoord]
ld b, a
@@ -249,10 +249,10 @@ InitBattleAnimBuffer: ; ccaaa
.check_kinesis_softboiled_milkdrink
sub d
push af
ld a, [FXAnimID + 1]
ld a, [wFXAnimID + 1]
or a
jr nz, .no_sub
ld a, [FXAnimID]
ld a, [wFXAnimID]
cp KINESIS
jr z, .kinesis
cp SOFTBOILED

View File

@@ -428,9 +428,9 @@ GetBallAnimPal: ; cd249 (33:5249)
ld hl, BallColors
ld a, [rSVBK]
push af
ld a, BANK(CurItem)
ld a, BANK(wCurItem)
ld [rSVBK], a
ld a, [CurItem]
ld a, [wCurItem]
ld e, a
pop af
ld [rSVBK], a
@@ -1611,7 +1611,7 @@ Functioncd913: ; cd913 (33:5913)
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld e, [hl]
ld hl, hPushOAM ; $ff80
ld hl, hTransferVirtualOAM ; $ff80
add hl, de
ld e, l
ld d, h
@@ -2105,7 +2105,7 @@ asm_cdbfa: ; cdbfa (33:5bfa)
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld e, [hl]
ld hl, hPushOAM ; $ff80
ld hl, hTransferVirtualOAM ; $ff80
add hl, de
ld e, l
ld d, h
@@ -3335,7 +3335,7 @@ Functionce306: ; ce306 (33:6306)
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld e, [hl]
ld hl, hPushOAM ; $ff80
ld hl, hTransferVirtualOAM ; $ff80
add hl, de
ld e, l
ld d, h

View File

@@ -8,12 +8,12 @@ GetPokeBallWobble: ; f971 (3:7971)
ld d, a
push de
ld a, BANK(Buffer2)
ld a, BANK(wBuffer2)
ld [rSVBK], a
ld a, [Buffer2]
ld a, [wBuffer2]
inc a
ld [Buffer2], a
ld [wBuffer2], a
; Wobble up to 3 times.
cp 3 + 1
@@ -25,7 +25,7 @@ GetPokeBallWobble: ; f971 (3:7971)
jr nz, .done
ld hl, WobbleProbabilities
ld a, [Buffer1]
ld a, [wBuffer1]
ld b, a
.loop
ld a, [hli]

View File

@@ -1,12 +1,12 @@
_DepositPKMN: ; e2391 (38:6391)
ld hl, Options
ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
ld a, [VramState]
ld a, [wVramState]
push af
xor a
ld [VramState], a
ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -30,9 +30,9 @@ _DepositPKMN: ; e2391 (38:6391)
pop af
ld [hInMenu], a
pop af
ld [VramState], a
ld [wVramState], a
pop af
ld [Options], a
ld [wOptions], a
ret
.RunJumptable: ; e23d5 (38:63d5)
@@ -61,7 +61,7 @@ _DepositPKMN: ; e2391 (38:6391)
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $ff
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
@@ -117,7 +117,7 @@ _DepositPKMN: ; e2391 (38:6391)
ld [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
@@ -177,7 +177,7 @@ BillsPCDepositFuncStats: ; e24c8 (38:64c8)
call ExitMenu
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@@ -202,7 +202,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0)
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
xor a
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
@@ -261,14 +261,14 @@ Unreferenced_BillsPCClearThreeBoxes: ; e2564
; e2583
_WithdrawPKMN: ; e2583 (38:6583)
ld hl, Options
ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
ld a, [VramState]
ld a, [wVramState]
push af
xor a
ld [VramState], a
ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -292,9 +292,9 @@ _WithdrawPKMN: ; e2583 (38:6583)
pop af
ld [hInMenu], a
pop af
ld [VramState], a
ld [wVramState], a
pop af
ld [Options], a
ld [wOptions], a
ret
.RunJumptable: ; e25c8 (38:65c8)
@@ -325,7 +325,7 @@ _WithdrawPKMN: ; e2583 (38:6583)
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $ff
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
@@ -380,7 +380,7 @@ _WithdrawPKMN: ; e2583 (38:6583)
ld [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
@@ -439,7 +439,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
call ExitMenu
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@@ -462,7 +462,7 @@ BillsPC_Withdraw: ; e2675 (38:6675)
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
@@ -504,14 +504,14 @@ BillsPC_Withdraw: ; e2675 (38:6675)
; 0xe2759
_MovePKMNWithoutMail: ; e2759
ld hl, Options
ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
ld a, [VramState]
ld a, [wVramState]
push af
xor a
ld [VramState], a
ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -538,9 +538,9 @@ _MovePKMNWithoutMail: ; e2759
pop af
ld [hInMenu], a
pop af
ld [VramState], a
ld [wVramState], a
pop af
ld [Options], a
ld [wOptions], a
ret
; e27a2
@@ -574,7 +574,7 @@ _MovePKMNWithoutMail: ; e2759
call BillsPC_MoveMonWOMail_BoxNameAndArrows
call PCMonInfo
ld a, $ff
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
@@ -640,7 +640,7 @@ _MovePKMNWithoutMail: ; e2759
ld [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
@@ -698,7 +698,7 @@ _MovePKMNWithoutMail: ; e2759
call ExitMenu
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@@ -1092,16 +1092,16 @@ PCMonInfo: ; e2ac6 (38:6ac6)
call BillsPC_LoadMonStats
ld a, [wd265]
ld [CurPartySpecies], a
ld [CurSpecies], a
ld hl, TempMonDVs
ld [wCurPartySpecies], a
ld [wCurSpecies], a
ld hl, wTempMonDVs
predef GetUnownLetter
call GetBaseData
ld de, vTiles2 tile $00
predef GetMonFrontpic
xor a
ld [wBillsPC_MonHasMail], a
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
ld [wd265], a
cp EGG
ret z
@@ -1114,7 +1114,7 @@ PCMonInfo: ; e2ac6 (38:6ac6)
call PrintLevel
ld a, $3
ld [MonType], a
ld [wMonType], a
farcall GetGender
jr c, .skip_gender
ld a, "♂"
@@ -1125,7 +1125,7 @@ PCMonInfo: ; e2ac6 (38:6ac6)
ld [hl], a
.skip_gender
ld a, [TempMonItem]
ld a, [wTempMonItem]
and a
ret z
@@ -1169,7 +1169,7 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d)
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonLevel], a
ld [wTempMonLevel], a
pop hl
push hl
ld bc, sBoxMon1Item - sBox
@@ -1178,14 +1178,14 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d)
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonItem], a
ld [wTempMonItem], a
pop hl
ld bc, sBoxMon1DVs - sBox
add hl, bc
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld de, TempMonDVs
ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -1195,23 +1195,23 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d)
ret
.party
ld hl, PartyMon1Level
ld hl, wPartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonLevel], a
ld hl, PartyMon1Item
ld [wTempMonLevel], a
ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonItem], a
ld hl, PartyMon1DVs
ld [wTempMonItem], a
ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld de, TempMonDVs
ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -1227,20 +1227,20 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d)
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonLevel], a
ld [wTempMonLevel], a
ld hl, sBoxMon1Item
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
ld [TempMonItem], a
ld [wTempMonItem], a
ld hl, sBoxMon1DVs
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld de, TempMonDVs
ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -1334,12 +1334,12 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c)
ld bc, MON_NAME_LENGTH
ld a, e
call AddNTimes
ld de, StringBuffer1
ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
call CloseSRAM
pop hl
ld de, StringBuffer1
ld de, wStringBuffer1
call PlaceString
ret
@@ -1350,21 +1350,21 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c)
.party
push hl
ld hl, PartySpecies
ld hl, wPartySpecies
ld d, $0
add hl, de
ld a, [hl]
and a
jr z, .partyfail
ld hl, PartyMonNicknames
ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
ld a, e
call AddNTimes
ld de, StringBuffer1
ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
pop hl
ld de, StringBuffer1
ld de, wStringBuffer1
call PlaceString
ret
@@ -1386,12 +1386,12 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c)
ld bc, MON_NAME_LENGTH
ld a, e
call AddNTimes
ld de, StringBuffer1
ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
call CloseSRAM
pop hl
ld de, StringBuffer1
ld de, wStringBuffer1
call PlaceString
ret
@@ -1465,7 +1465,7 @@ CopyBoxmonSpecies: ; e2d30 (38:6d30)
ret
.party
ld hl, PartySpecies
ld hl, wPartySpecies
copy_box_data 0
ret
@@ -1498,7 +1498,7 @@ BillsPC_UpdateSelectionCursor: ; e2e01 (38:6e01)
.place_cursor
ld hl, .OAM
ld de, Sprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1
@@ -1548,7 +1548,7 @@ endr
BillsPC_UpdateInsertCursor: ; e2e8c
ld hl, .OAM
ld de, Sprite01
ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1
@@ -1645,7 +1645,7 @@ BillsPC_CheckMail_PreventBlackout: ; e2f18 (38:6f18)
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
farcall CheckCurPartyMonFainted
jr c, .AllOthersFainted
ld a, [wBillsPC_MonHasMail]
@@ -1676,7 +1676,7 @@ BillsPC_CheckMail_PreventBlackout: ; e2f18 (38:6f18)
ret
BillsPC_IsMonAnEgg: ; e2f5f (38:6f5f)
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
and a
@@ -1697,7 +1697,7 @@ BillsPC_StatsScreen: ; e2f7e (38:6f7e)
call LowVolume
call BillsPC_CopyMon
ld a, $3
ld [MonType], a
ld [wMonType], a
predef StatsScreenInit
call BillsPC_InitGFX
call MaxVolume
@@ -1723,9 +1723,9 @@ StatsScreenDPad: ; e2f95 (38:6f95)
ld [wd265], a
call BillsPC_LoadMonStats
ld a, [wd265]
ld [CurPartySpecies], a
ld [CurSpecies], a
ld hl, TempMonDVs
ld [wCurPartySpecies], a
ld [wCurSpecies], a
ld hl, wTempMonDVs
predef GetUnownLetter
call GetBaseData
call BillsPC_CopyMon
@@ -1741,7 +1741,7 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6)
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
ld a, [wBillsPC_LoadedBox]
and a
jr z, .party
@@ -1757,7 +1757,7 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6)
call CopyOTNameToTemp
ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMon
ld bc, PARTYMON_STRUCT_LENGTH
@@ -1767,15 +1767,15 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6)
ret
.party
ld hl, PartySpecies
ld hl, wPartySpecies
call CopySpeciesToTemp
ld hl, PartyMonNicknames
ld hl, wPartyMonNicknames
call CopyNicknameToTemp
ld hl, PartyMonOT
ld hl, wPartyMonOT
call CopyOTNameToTemp
ld hl, PartyMon1
ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMon
ld bc, PARTYMON_STRUCT_LENGTH
@@ -1813,9 +1813,9 @@ DepositPokemon: ; e307c (38:707c)
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld hl, PartyMonNicknames
ld a, [CurPartyMon]
ld [wCurPartyMon], a
ld hl, wPartyMonNicknames
ld a, [wCurPartyMon]
call GetNick
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
@@ -1824,7 +1824,7 @@ DepositPokemon: ; e307c (38:707c)
xor a
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call PlayMonCry
hlcoord 0, 0
lb bc, 15, 8
@@ -1841,7 +1841,7 @@ DepositPokemon: ; e307c (38:707c)
call PlaceString
ld l, c
ld h, b
ld de, StringBuffer1
ld de, wStringBuffer1
call PlaceString
ld a, "!"
ld [bc], a
@@ -1865,10 +1865,10 @@ TryWithdrawPokemon: ; e30fa (38:70fa)
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
ld a, BANK(sBoxMonNicknames)
call GetSRAMBank
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
ld hl, sBoxMonNicknames
call GetNick
call CloseSRAM
@@ -1879,7 +1879,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa)
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call PlayMonCry
hlcoord 0, 0
lb bc, 15, 8
@@ -1896,7 +1896,7 @@ TryWithdrawPokemon: ; e30fa (38:70fa)
call PlaceString
ld l, c
ld h, b
ld de, StringBuffer1
ld de, wStringBuffer1
call PlaceString
ld a, $e7
ld [bc], a
@@ -1929,7 +1929,7 @@ ReleasePKMN_ByePKMN: ; e3180 (38:7180)
call TextBox
call WaitBGMap
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call GetCryIndex
jr c, .skip_cry
ld e, c
@@ -1937,7 +1937,7 @@ ReleasePKMN_ByePKMN: ; e3180 (38:7180)
call PlayCry
.skip_cry
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
hlcoord 1, 16
@@ -1954,7 +1954,7 @@ ReleasePKMN_ByePKMN: ; e3180 (38:7180)
ld l, c
ld h, b
inc hl
ld de, StringBuffer1
ld de, wStringBuffer1
call PlaceString
ld l, c
ld h, b
@@ -2099,7 +2099,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld a, [wBillsPC_BackupCursorPosition]
ld hl, wBillsPC_BackupScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
ld a, BANK(sBox)
call GetSRAMBank
ld hl, sBoxSpecies
@@ -2127,7 +2127,7 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
farcall InsertPokemonIntoBox
ret
; e3316
@@ -2136,14 +2136,14 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld a, [wBillsPC_BackupCursorPosition]
ld hl, wBillsPC_BackupScrollPosition
add [hl]
ld [CurPartyMon], a
ld hl, PartySpecies
ld [wCurPartyMon], a
ld hl, wPartySpecies
call CopySpeciesToTemp
ld hl, PartyMonNicknames
ld hl, wPartyMonNicknames
call CopyNicknameToTemp
ld hl, PartyMonOT
ld hl, wPartyMonOT
call CopyOTNameToTemp
ld hl, PartyMon1Species
ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call CopyMonToTemp
xor a
@@ -2156,23 +2156,23 @@ MovePKMNWitoutMail_InsertMon: ; e31e7
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
ld [CurPartyMon], a
ld [wCurPartyMon], a
farcall InsertPokemonIntoParty
ret
; e3357
CopySpeciesToTemp: ; e3357 (38:7357)
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
ld c, a
ld b, $0
add hl, bc
ld a, [hl]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ret
CopyNicknameToTemp: ; e3363 (38:7363)
ld bc, MON_NAME_LENGTH
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMonNick
ld bc, MON_NAME_LENGTH
@@ -2181,7 +2181,7 @@ CopyNicknameToTemp: ; e3363 (38:7363)
CopyOTNameToTemp: ; e3376 (38:7376)
ld bc, NAME_LENGTH
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMonOT
ld bc, NAME_LENGTH
@@ -2189,7 +2189,7 @@ CopyOTNameToTemp: ; e3376 (38:7376)
ret
CopyMonToTemp: ; e3389 (38:7389)
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMon
call CopyBytes
@@ -2357,7 +2357,7 @@ endr
.boxnames ; e3619
push de
ld a, [MenuSelection]
ld a, [wMenuSelection]
dec a
call GetBoxName
pop hl
@@ -2378,7 +2378,7 @@ BillsPC_PrintBoxCountAndCapacity: ; e3632
hlcoord 11, 7
lb bc, 5, 7
call TextBox
ld a, [MenuSelection]
ld a, [wMenuSelection]
cp -1
ret z
hlcoord 12, 9
@@ -2410,7 +2410,7 @@ BillsPC_PrintBoxCountAndCapacity: ; e3632
GetBoxCount: ; e366c (38:766c)
ld a, [wCurBox]
ld c, a
ld a, [MenuSelection]
ld a, [wMenuSelection]
dec a
cp c
jr z, .activebox
@@ -2508,7 +2508,7 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9)
jr z, .EmptyBox
ld e, l
ld d, h
ld a, [MenuSelection]
ld a, [wMenuSelection]
dec a
ld c, a
farcall PrintPCBox
@@ -2522,7 +2522,7 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9)
ret
.Switch:
ld a, [MenuSelection]
ld a, [wMenuSelection]
dec a
ld e, a
ld a, [wCurBox]
@@ -2538,7 +2538,7 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9)
call ClearTileMap
call LoadStandardFont
call LoadFontsBattleExtra
ld a, [MenuSelection]
ld a, [wMenuSelection]
dec a
call GetBoxName
ld e, l
@@ -2546,7 +2546,7 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9)
ld hl, wd002
ld c, BOX_NAME_LENGTH - 1
call InitString
ld a, [MenuSelection]
ld a, [wMenuSelection]
dec a
call GetBoxName
ld de, wd002

View File

@@ -6,7 +6,7 @@ _BillsPC: ; e3fd
jp .LogOut
.CheckCanUsePC: ; e40a (3:640a)
ld a, [PartyCount]
ld a, [wPartyCount]
and a
ret nz
ld hl, .Text_GottaHavePokemon
@@ -24,14 +24,14 @@ _BillsPC: ; e3fd
ld [hBGMapMode], a
call LoadStandardMenuHeader
call ClearPCItemScreen
ld hl, Options
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
ld hl, .Text_What
call PrintText
pop af
ld [Options], a
ld [wOptions], a
call LoadFontsBattleExtra
ret
@@ -58,7 +58,7 @@ _BillsPC: ; e3fd
jr c, .cancel
ld a, [wMenuCursorBuffer]
push af
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld hl, .Jumptable
rst JumpTable
pop bc
@@ -143,7 +143,7 @@ BillsPC_DepositMenu: ; e4fe (3:64fe)
ret
Unreferenced_Functione512:
ld a, [PartyCount]
ld a, [wPartyCount]
and a
jr z, .no_pkmn
cp 2
@@ -174,11 +174,11 @@ Unreferenced_Functione512:
db "@"
CheckCurPartyMonFainted: ; e538
ld hl, PartyMon1HP
ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH
ld b, $0
.loop
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
cp b
jr z, .skip
ld a, [hli]
@@ -188,7 +188,7 @@ CheckCurPartyMonFainted: ; e538
.skip
inc b
ld a, [PartyCount]
ld a, [wPartyCount]
cp b
jr z, .done
add hl, de
@@ -212,7 +212,7 @@ BillsPC_WithdrawMenu: ; e559 (3:6559)
ret
Unreferenced_Functione56d:
ld a, [PartyCount]
ld a, [wPartyCount]
cp PARTY_LENGTH
jr nc, .asm_e576
and a
@@ -255,11 +255,11 @@ ClearPCItemScreen: ; e58b
ret
CopyBoxmonToTempMon: ; e5bb
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
ld hl, sBoxMon1Species
ld bc, BOXMON_STRUCT_LENGTH
call AddNTimes
ld de, TempMonSpecies
ld de, wTempMonSpecies
ld bc, BOXMON_STRUCT_LENGTH
ld a, BANK(sBoxMon1Species)
call GetSRAMBank
@@ -309,7 +309,7 @@ Unreferenced_Functione5d9:
ld a, [hl]
ld [de], a
inc de
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
pop bc
pop hl
@@ -352,7 +352,7 @@ Unreferenced_Functione5d9:
swap a
or b
ld b, a
ld a, [BaseGender]
ld a, [wBaseGender]
cp b
ld a, $1
jr c, .okay2

View File

@@ -3,13 +3,13 @@ CheckBreedmonCompatibility: ; 16e1d
ld c, $0
jp nc, .done
ld a, [wBreedMon1Species]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, [wBreedMon1DVs]
ld [TempMonDVs], a
ld [wTempMonDVs], a
ld a, [wBreedMon1DVs + 1]
ld [TempMonDVs + 1], a
ld [wTempMonDVs + 1], a
ld a, TEMPMON
ld [MonType], a
ld [wMonType], a
predef GetGender
jr c, .genderless
ld b, $1
@@ -19,13 +19,13 @@ CheckBreedmonCompatibility: ; 16e1d
.breedmon2
push bc
ld a, [wBreedMon2Species]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, [wBreedMon2DVs]
ld [TempMonDVs], a
ld [wTempMonDVs], a
ld a, [wBreedMon2DVs + 1]
ld [TempMonDVs + 1], a
ld [wTempMonDVs + 1], a
ld a, $3
ld [MonType], a
ld [wMonType], a
predef GetGender
pop bc
jr c, .genderless
@@ -109,16 +109,16 @@ CheckBreedmonCompatibility: ; 16e1d
; If either mon is in the No Eggs group,
; they are not compatible.
ld a, [wBreedMon2Species]
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseEggGroups]
ld a, [wBaseEggGroups]
cp EGG_UNDISCOVERED * $11
jr z, .Incompatible
ld a, [wBreedMon1Species]
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseEggGroups]
ld a, [wBaseEggGroups]
cp EGG_UNDISCOVERED * $11
jr z, .Incompatible
@@ -127,9 +127,9 @@ CheckBreedmonCompatibility: ; 16e1d
ld a, [wBreedMon2Species]
cp DITTO
jr z, .Compatible
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, [BaseEggGroups]
ld a, [wBaseEggGroups]
push af
and $f
ld b, a
@@ -141,11 +141,11 @@ CheckBreedmonCompatibility: ; 16e1d
ld a, [wBreedMon1Species]
cp DITTO
jr z, .Compatible
ld [CurSpecies], a
ld [wCurSpecies], a
push bc
call GetBaseData
pop bc
ld a, [BaseEggGroups]
ld a, [wBaseEggGroups]
push af
and $f
ld d, a
@@ -176,8 +176,8 @@ CheckBreedmonCompatibility: ; 16e1d
; 16f3e
DoEggStep:: ; 16f3e
ld de, PartySpecies
ld hl, PartyMon1Happiness
ld de, wPartySpecies
ld hl, wPartyMon1Happiness
ld c, 0
.loop
ld a, [de]
@@ -210,10 +210,10 @@ OverworldHatchEgg:: ; 16f5e
; 16f70
HatchEggs: ; 16f70 (5:6f70)
ld de, PartySpecies
ld hl, PartyMon1Happiness
ld de, wPartySpecies
ld hl, wPartyMon1Happiness
xor a
ld [CurPartyMon], a
ld [wCurPartyMon], a
.loop ; 16f7a (5:6f7a)
ld a, [de]
@@ -233,16 +233,16 @@ HatchEggs: ; 16f70 (5:6f70)
farcall SetEggMonCaughtData
farcall StubbedTrainerRankings_EggsHatched
ld a, [CurPartyMon]
ld hl, PartyMon1Species
ld a, [wCurPartyMon]
ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
dec a
call SetSeenAndCaughtMon
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
cp TOGEPI
jr nz, .nottogepi
; set the event flag for hatching togepi
@@ -253,17 +253,17 @@ HatchEggs: ; 16f70 (5:6f70)
pop de
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
dec de
ld [de], a
ld [wd265], a
ld [CurSpecies], a
ld [wCurSpecies], a
call GetPokemonName
xor a
ld [wd26b], a
call GetBaseData
ld a, [CurPartyMon]
ld hl, PartyMon1
ld a, [wCurPartyMon]
ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
@@ -276,7 +276,7 @@ HatchEggs: ; 16f70 (5:6f70)
ld bc, MON_LEVEL
add hl, bc
ld a, [hl]
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
pop hl
push hl
ld bc, MON_STATUS
@@ -304,22 +304,22 @@ HatchEggs: ; 16f70 (5:6f70)
ld [hl], a
ld hl, MON_ID
add hl, bc
ld a, [PlayerID]
ld a, [wPlayerID]
ld [hli], a
ld a, [PlayerID + 1]
ld a, [wPlayerID + 1]
ld [hl], a
ld a, [CurPartyMon]
ld hl, PartyMonOT
ld a, [wCurPartyMon]
ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call AddNTimes
ld d, h
ld e, l
ld hl, PlayerName
ld hl, wPlayerName
call CopyBytes
ld hl, .Text_HatchEgg
call PrintText
ld a, [CurPartyMon]
ld hl, PartyMonNicknames
ld a, [wCurPartyMon]
ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call AddNTimes
ld d, h
@@ -334,22 +334,22 @@ HatchEggs: ; 16f70 (5:6f70)
ld a, $1
ld [wd26b], a
xor a
ld [MonType], a
ld [wMonType], a
push de
ld b, $0
farcall NamingScreen
pop hl
ld de, StringBuffer1
ld de, wStringBuffer1
call InitName
jr .next
.nonickname
ld hl, StringBuffer1
ld hl, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
.next ; 1707d (5:707d)
ld hl, CurPartyMon
ld hl, wCurPartyMon
inc [hl]
pop hl
ld de, PARTYMON_STRUCT_LENGTH
@@ -365,18 +365,18 @@ HatchEggs: ; 16f70 (5:6f70)
; Huh? @ @
text_jump UnknownText_0x1c0db0
start_asm
ld hl, VramState
ld hl, wVramState
res 0, [hl]
push hl
push de
push bc
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
push af
call EggHatch_AnimationSequence
ld hl, .ClearTextbox
call PrintText
pop af
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
pop bc
pop de
pop hl
@@ -580,32 +580,32 @@ GetHeritableMoves: ; 17197
ret
.ditto1
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
push af
ld a, [wBreedMon2Species]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, [wBreedMon2DVs]
ld [TempMonDVs], a
ld [wTempMonDVs], a
ld a, [wBreedMon2DVs + 1]
ld [TempMonDVs + 1], a
ld [wTempMonDVs + 1], a
ld a, TEMPMON
ld [MonType], a
ld [wMonType], a
predef GetGender
jr c, .inherit_mon2_moves
jr nz, .inherit_mon2_moves
jr .inherit_mon1_moves
.ditto2
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
push af
ld a, [wBreedMon1Species]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld a, [wBreedMon1DVs]
ld [TempMonDVs], a
ld [wTempMonDVs], a
ld a, [wBreedMon1DVs + 1]
ld [TempMonDVs + 1], a
ld [wTempMonDVs + 1], a
ld a, TEMPMON
ld [MonType], a
ld [wMonType], a
predef GetGender
jr c, .inherit_mon1_moves
jr nz, .inherit_mon1_moves
@@ -613,13 +613,13 @@ GetHeritableMoves: ; 17197
.inherit_mon2_moves
ld hl, wBreedMon2Moves
pop af
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ret
.inherit_mon1_moves
ld hl, wBreedMon1Moves
pop af
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ret
; 1720b
@@ -643,20 +643,20 @@ GetBreedmonMovePointer: ; 1720b
GetEggFrontpic: ; 17224 (5:7224)
push de
ld [CurPartySpecies], a
ld [CurSpecies], a
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call GetBaseData
ld hl, BattleMonDVs
ld hl, wBattleMonDVs
predef GetUnownLetter
pop de
predef_jump GetMonFrontpic
GetHatchlingFrontpic: ; 1723c (5:723c)
push de
ld [CurPartySpecies], a
ld [CurSpecies], a
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call GetBaseData
ld hl, BattleMonDVs
ld hl, wBattleMonDVs
predef GetUnownLetter
pop de
predef_jump GetAnimatedFrontpic
@@ -697,7 +697,7 @@ EggHatch_DoAnimFrame: ; 1727f (5:727f)
EggHatch_AnimationSequence: ; 1728f (5:728f)
ld a, [wd265]
ld [wJumptableIndex], a
ld a, [CurSpecies]
ld a, [wCurSpecies]
push af
ld de, MUSIC_NONE
call PlayMusic
@@ -775,17 +775,17 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
call Hatch_ShellFragmentLoop
call WaitSFX
ld a, [wJumptableIndex]
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
hlcoord 6, 3
ld d, $0
ld e, ANIM_MON_HATCH
predef AnimateFrontpic
pop af
ld [CurSpecies], a
ld [wCurSpecies], a
ret
Hatch_LoadFrontpicPal: ; 17363 (5:7363)
ld [PlayerHPPal], a
ld [wPlayerHPPal], a
ld b, SCGB_EVOLUTION
ld c, $0
jp GetSGBLayout
@@ -931,7 +931,7 @@ DayCareMon1Text: ; 0x17467
DayCareMonCompatibilityText: ; 1746c
push bc
ld de, StringBuffer1
ld de, wStringBuffer1
ld bc, NAME_LENGTH
call CopyBytes
call CheckBreedmonCompatibility

View File

@@ -9,9 +9,9 @@ SelectQuantityToBuy: ; 24fc9
farcall GetItemPrice
RooftopSale_SelectQuantityToBuy: ; 24fcf
ld a, d
ld [Buffer1], a
ld [wBuffer1], a
ld a, e
ld [Buffer2], a
ld [wBuffer2], a
ld hl, BuyItem_MenuHeader
call LoadMenuHeader
call Toss_Sell_Loop
@@ -21,9 +21,9 @@ RooftopSale_SelectQuantityToBuy: ; 24fcf
SelectQuantityToSell: ; 24fe1
farcall GetItemPrice
ld a, d
ld [Buffer1], a
ld [wBuffer1], a
ld a, e
ld [Buffer2], a
ld [wBuffer2], a
ld hl, SellItem_MenuHeader
call LoadMenuHeader
call Toss_Sell_Loop
@@ -167,9 +167,9 @@ DisplaySellingPrice: ; 2509f
BuySell_MultiplyPrice: ; 250a9
xor a
ld [hMultiplicand + 0], a
ld a, [Buffer1]
ld a, [wBuffer1]
ld [hMultiplicand + 1], a
ld a, [Buffer2]
ld a, [wBuffer2]
ld [hMultiplicand + 2], a
ld a, [wItemQuantityChangeBuffer]
ld [hMultiplier], a

View File

@@ -11,7 +11,7 @@ ret_e00ed: ; e00ed (38:40ed)
ret
_CardFlip: ; e00ee (38:40ee)
ld hl, Options
ld hl, wOptions
set 4, [hl]
call ClearBGPalettes
call ClearTileMap
@@ -70,7 +70,7 @@ _CardFlip: ; e00ee (38:40ee)
call PlaySFX
call WaitSFX
call ClearBGPalettes
ld hl, Options
ld hl, wOptions
res 4, [hl]
ret
@@ -126,9 +126,9 @@ _CardFlip: ; e00ee (38:40ee)
; 0xe01d2
.DeductCoins: ; e01d2
ld a, [Coins]
ld a, [wCoins]
ld h, a
ld a, [Coins + 1]
ld a, [wCoins + 1]
ld l, a
ld a, h
and a
@@ -146,9 +146,9 @@ _CardFlip: ; e00ee (38:40ee)
ld de, -3
add hl, de
ld a, h
ld [Coins], a
ld [wCoins], a
ld a, l
ld [Coins + 1], a
ld [wCoins + 1], a
ld de, SFX_TRANSACTION
call PlaySFX
xor a
@@ -485,7 +485,7 @@ CardFlip_DisplayCardFaceUp: ; e03ec
ret z
; Set the attributes
ld de, AttrMap - TileMap
ld de, wAttrMap - wTileMap
add hl, de
ld a, [wCardFlipFaceUpCard]
and 3
@@ -535,7 +535,7 @@ CardFlip_PrintCoinBalance: ; e049c
ld de, .CoinStr
call PlaceString
hlcoord 15, 16
ld de, Coins
ld de, wCoins
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
ret
@@ -601,7 +601,7 @@ CardFlip_CopyToBox: ; e04f7 (38:44f7)
; e0509 (38:4509)
CardFlip_CopyOAM: ; e0509
ld de, Sprite01
ld de, wVirtualOAMSprite00
ld a, [hli]
.loop
push af
@@ -1174,29 +1174,29 @@ CardFlip_CheckWinCondition: ; e0637
; 0xe081b
.AddCoinPlaySFX: ; e081b
ld a, [Coins]
ld a, [wCoins]
ld h, a
ld a, [Coins + 1]
ld a, [wCoins + 1]
ld l, a
inc hl
ld a, h
ld [Coins], a
ld [wCoins], a
ld a, l
ld [Coins + 1], a
ld [wCoins + 1], a
ld de, SFX_PAY_DAY
call PlaySFX
ret
; e0833
.IsCoinCaseFull: ; e0833
ld a, [Coins]
ld a, [wCoins]
cp HIGH(MAX_COINS)
jr c, .less
jr z, .check_low
jr .more
.check_low
ld a, [Coins + 1]
ld a, [wCoins + 1]
cp LOW(MAX_COINS)
jr c, .less
@@ -1625,32 +1625,32 @@ CardFlip_InitAttrPals: ; e0c37 (38:4c37)
and a
ret z
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
hlcoord 12, 1, AttrMap
hlcoord 12, 1, wAttrMap
lb bc, 2, 2
ld a, $1
call CardFlip_FillBox
hlcoord 14, 1, AttrMap
hlcoord 14, 1, wAttrMap
lb bc, 2, 2
ld a, $2
call CardFlip_FillBox
hlcoord 16, 1, AttrMap
hlcoord 16, 1, wAttrMap
lb bc, 2, 2
ld a, $3
call CardFlip_FillBox
hlcoord 18, 1, AttrMap
hlcoord 18, 1, wAttrMap
lb bc, 2, 2
ld a, $4
call CardFlip_FillBox
hlcoord 9, 0, AttrMap
hlcoord 9, 0, wAttrMap
lb bc, 12, 1
ld a, $1
call CardFlip_FillBox

View File

@@ -2,10 +2,10 @@ CheckPartyFullAfterContest: ; 4d9e5
ld a, [wContestMon]
and a
jp z, .DidntCatchAnything
ld [CurPartySpecies], a
ld [CurSpecies], a
ld [wCurPartySpecies], a
ld [wCurSpecies], a
call GetBaseData
ld hl, PartyCount
ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
jp nc, .TryAddToBox
@@ -16,11 +16,11 @@ CheckPartyFullAfterContest: ; 4d9e5
add hl, bc
ld a, [wContestMon]
ld [hli], a
ld [CurSpecies], a
ld [wCurSpecies], a
ld a, -1
ld [hl], a
ld hl, PartyMon1Species
ld a, [PartyCount]
ld hl, wPartyMon1Species
ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -29,50 +29,50 @@ CheckPartyFullAfterContest: ; 4d9e5
ld hl, wContestMon
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld hl, PartyMonOT
ld hl, wPartyMonOT
call SkipNames
ld d, h
ld e, l
ld hl, PlayerName
ld hl, wPlayerName
call CopyBytes
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
ld hl, StringBuffer1
ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
call GiveANickname_YesNo
jr c, .Party_SkipNickname
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld [CurPartyMon], a
ld [wCurPartyMon], a
xor a
ld [MonType], a
ld [wMonType], a
ld de, wMonOrItemNameBuffer
callfar InitNickname
.Party_SkipNickname:
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld hl, PartyMonNicknames
ld hl, wPartyMonNicknames
call SkipNames
ld d, h
ld e, l
ld hl, wMonOrItemNameBuffer
call CopyBytes
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld hl, PartyMon1Level
ld hl, wPartyMon1Level
call GetPartyLocation
ld a, [hl]
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
call SetCaughtData
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld hl, PartyMon1CaughtLocation
ld hl, wPartyMon1CaughtLocation
call GetPartyLocation
ld a, [hl]
and CAUGHT_GENDER_MASK
@@ -82,7 +82,7 @@ CheckPartyFullAfterContest: ; 4d9e5
xor a
ld [wContestMon], a
and a ; BUGCONTEST_CAUGHT_MON
ld [ScriptVar], a
ld [wScriptVar], a
ret
.TryAddToBox: ; 4daa3
@@ -94,24 +94,24 @@ CheckPartyFullAfterContest: ; 4d9e5
call CloseSRAM
jr nc, .BoxFull
xor a
ld [CurPartyMon], a
ld [wCurPartyMon], a
ld hl, wContestMon
ld de, wBufferMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
ld hl, PlayerName
ld hl, wPlayerName
ld de, wBufferMonOT
ld bc, NAME_LENGTH
call CopyBytes
callfar InsertPokemonIntoBox
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
call GiveANickname_YesNo
ld hl, StringBuffer1
ld hl, wStringBuffer1
jr c, .Box_SkipNickname
ld a, BOXMON
ld [MonType], a
ld [wMonType], a
ld de, wMonOrItemNameBuffer
callfar InitNickname
ld hl, wMonOrItemNameBuffer
@@ -128,7 +128,7 @@ CheckPartyFullAfterContest: ; 4d9e5
ld a, BANK(sBoxMon1Level)
call GetSRAMBank
ld a, [sBoxMon1Level]
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
call CloseSRAM
call SetBoxMonCaughtData
ld a, BANK(sBoxMon1CaughtLocation)
@@ -143,12 +143,12 @@ CheckPartyFullAfterContest: ; 4d9e5
xor a
ld [wContestMon], a
ld a, BUGCONTEST_BOXED_MON
ld [ScriptVar], a
ld [wScriptVar], a
ret
.DidntCatchAnything: ; 4db35
ld a, BUGCONTEST_NO_CATCH
ld [ScriptVar], a
ld [wScriptVar], a
ret
GiveANickname_YesNo: ; 4db3b
@@ -162,22 +162,22 @@ TextJump_GiveANickname: ; 0x4db44
db "@"
SetCaughtData: ; 4db49
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld hl, PartyMon1CaughtLevel
ld hl, wPartyMon1CaughtLevel
call GetPartyLocation
SetBoxmonOrEggmonCaughtData: ; 4db53
ld a, [TimeOfDay]
ld a, [wTimeOfDay]
inc a
rrca
rrca
ld b, a
ld a, [CurPartyLevel]
ld a, [wCurPartyLevel]
or b
ld [hli], a
ld a, [MapGroup]
ld a, [wMapGroup]
ld b, a
ld a, [MapNumber]
ld a, [wMapNumber]
ld c, a
cp MAP_POKECENTER_2F
jr nz, .NotPokecenter2F
@@ -185,9 +185,9 @@ SetBoxmonOrEggmonCaughtData: ; 4db53
cp GROUP_POKECENTER_2F
jr nz, .NotPokecenter2F
ld a, [BackupMapGroup]
ld a, [wBackupMapGroup]
ld b, a
ld a, [BackupMapNumber]
ld a, [wBackupMapNumber]
ld c, a
.NotPokecenter2F:
@@ -218,9 +218,9 @@ SetGiftBoxMonCaughtData: ; 4db92
ret
SetGiftPartyMonCaughtData: ; 4dba3
ld a, [PartyCount]
ld a, [wPartyCount]
dec a
ld hl, PartyMon1CaughtLevel
ld hl, wPartyMon1CaughtLevel
push bc
call GetPartyLocation
pop bc
@@ -234,14 +234,14 @@ SetGiftMonCaughtData: ; 4dbaf
ret
SetEggMonCaughtData: ; 4dbb8 (13:5bb8)
ld a, [CurPartyMon]
ld hl, PartyMon1CaughtLevel
ld a, [wCurPartyMon]
ld hl, wPartyMon1CaughtLevel
call GetPartyLocation
ld a, [CurPartyLevel]
ld a, [wCurPartyLevel]
push af
ld a, CAUGHT_EGG_LEVEL
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
call SetBoxmonOrEggmonCaughtData
pop af
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
ret

View File

@@ -10,7 +10,7 @@ LoadSGBLayoutCGB: ; 8d59
ld a, b
cp SCGB_RAM
jr nz, .not_ram
ld a, [SGBPredef]
ld a, [wSGBPredef]
.not_ram
cp SCGB_PARTY_MENU_HP_PALS
jp z, CGB_ApplyPartyMenuHPPals
@@ -89,7 +89,7 @@ _CGB_BattleColors: ; 8ddb
call GetEnemyFrontpicPalettePointer
push hl
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_ENEMY
ld a, [EnemyHPPal]
ld a, [wEnemyHPPal]
ld l, a
ld h, $0
add hl, hl
@@ -97,7 +97,7 @@ _CGB_BattleColors: ; 8ddb
ld bc, HPBarPals
add hl, bc
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_ENEMY_HP
ld a, [PlayerHPPal]
ld a, [wPlayerHPPal]
ld l, a
ld h, $0
add hl, hl
@@ -113,35 +113,35 @@ _CGB_BattleColors: ; 8ddb
pop hl
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_PLAYER
ld a, SCGB_BATTLE_COLORS
ld [SGBPredef], a
ld [wSGBPredef], a
call ApplyPals
_CGB_FinishBattleScreenLayout: ; 8e23
call InitPartyMenuBGPal7
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, PAL_BATTLE_BG_ENEMY_HP
call ByteFill
hlcoord 0, 4, AttrMap
hlcoord 0, 4, wAttrMap
lb bc, 8, 10
ld a, PAL_BATTLE_BG_PLAYER
call FillBoxCGB
hlcoord 10, 0, AttrMap
hlcoord 10, 0, wAttrMap
lb bc, 7, 10
ld a, PAL_BATTLE_BG_ENEMY
call FillBoxCGB
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 4, 10
ld a, PAL_BATTLE_BG_ENEMY_HP
call FillBoxCGB
hlcoord 10, 7, AttrMap
hlcoord 10, 7, wAttrMap
lb bc, 5, 10
ld a, PAL_BATTLE_BG_PLAYER_HP
call FillBoxCGB
hlcoord 10, 11, AttrMap
hlcoord 10, 11, wAttrMap
lb bc, 1, 9
ld a, PAL_BATTLE_BG_EXP
call FillBoxCGB
hlcoord 0, 12, AttrMap
hlcoord 0, 12, wAttrMap
ld bc, 6 * SCREEN_WIDTH
ld a, PAL_BATTLE_BG_TEXT
call ByteFill
@@ -212,8 +212,8 @@ _CGB_StatsScreenHPPals: ; 8edb
ld bc, HPBarPals
add hl, bc
call LoadPalette_White_Col1_Col2_Black ; hp palette
ld a, [CurPartySpecies]
ld bc, TempMonDVs
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black ; mon palette
ld hl, ExpBarPalette
@@ -225,27 +225,27 @@ _CGB_StatsScreenHPPals: ; 8edb
call FarCopyWRAM
call WipeAttrMap
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 8, SCREEN_WIDTH
ld a, $1 ; mon palette
call FillBoxCGB
hlcoord 10, 16, AttrMap
hlcoord 10, 16, wAttrMap
ld bc, 10
ld a, $2 ; exp palette
call ByteFill
hlcoord 13, 5, AttrMap
hlcoord 13, 5, wAttrMap
lb bc, 2, 2
ld a, $3 ; pink page palette
call FillBoxCGB
hlcoord 15, 5, AttrMap
hlcoord 15, 5, wAttrMap
lb bc, 2, 2
ld a, $4 ; green page palette
call FillBoxCGB
hlcoord 17, 5, AttrMap
hlcoord 17, 5, wAttrMap
lb bc, 2, 2
ld a, $5 ; blue page palette
call FillBoxCGB
@@ -270,7 +270,7 @@ _CGB_Pokedex: ; 8f70
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
call LoadHLPaletteIntoDE ; dex interface palette
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
cp $ff
jr nz, .is_pokemon
ld hl, .PokedexQuestionMarkPalette
@@ -282,7 +282,7 @@ _CGB_Pokedex: ; 8f70
call LoadPalette_White_Col1_Col2_Black ; mon palette
.got_palette
call WipeAttrMap
hlcoord 1, 1, AttrMap
hlcoord 1, 1, wAttrMap
lb bc, 7, 7
ld a, $1 ; green question mark palette
call FillBoxCGB
@@ -312,7 +312,7 @@ _CGB_BillsPC: ; 8fca
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
cp $ff
jr nz, .GetMonPalette
ld hl, .BillsPCOrangePalette
@@ -320,12 +320,12 @@ _CGB_BillsPC: ; 8fca
jr .Resume
.GetMonPalette:
ld bc, TempMonDVs
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
.Resume:
call WipeAttrMap
hlcoord 1, 4, AttrMap
hlcoord 1, 4, wAttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
@@ -343,12 +343,12 @@ _CGB_BillsPC: ; 8fca
jr .asm_901a
.unused
ld bc, TempMonDVs
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
.asm_901a
call WipeAttrMap
hlcoord 1, 1, AttrMap
hlcoord 1, 1, wAttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
@@ -369,11 +369,11 @@ _CGB_PokedexUnownMode: ; 903e
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call GetMonPalettePointer_
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
hlcoord 7, 5, AttrMap
hlcoord 7, 5, wAttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
@@ -392,43 +392,43 @@ _CGB_SlotMachine: ; 906e
ld a, BANK(wBGPals1)
call FarCopyWRAM
call WipeAttrMap
hlcoord 0, 2, AttrMap
hlcoord 0, 2, wAttrMap
lb bc, 10, 3
ld a, $2
call FillBoxCGB
hlcoord 17, 2, AttrMap
hlcoord 17, 2, wAttrMap
lb bc, 10, 3
ld a, $2
call FillBoxCGB
hlcoord 0, 4, AttrMap
hlcoord 0, 4, wAttrMap
lb bc, 6, 3
ld a, $3
call FillBoxCGB
hlcoord 17, 4, AttrMap
hlcoord 17, 4, wAttrMap
lb bc, 6, 3
ld a, $3
call FillBoxCGB
hlcoord 0, 6, AttrMap
hlcoord 0, 6, wAttrMap
lb bc, 2, 3
ld a, $4
call FillBoxCGB
hlcoord 17, 6, AttrMap
hlcoord 17, 6, wAttrMap
lb bc, 2, 3
ld a, $4
call FillBoxCGB
hlcoord 4, 2, AttrMap
hlcoord 4, 2, wAttrMap
lb bc, 2, 12
ld a, $1
call FillBoxCGB
hlcoord 3, 2, AttrMap
hlcoord 3, 2, wAttrMap
lb bc, 10, 1
ld a, $1
call FillBoxCGB
hlcoord 16, 2, AttrMap
hlcoord 16, 2, wAttrMap
lb bc, 10, 1
ld a, $1
call FillBoxCGB
hlcoord 0, 12, AttrMap
hlcoord 0, 12, wAttrMap
ld bc, $78
ld a, $7
call ByteFill
@@ -447,7 +447,7 @@ _CGB06: ; 90f8
ld a, PREDEFPAL_PACK
call GetPredefPal
call LoadHLPaletteIntoDE
hlcoord 0, 6, AttrMap
hlcoord 0, 6, wAttrMap
lb bc, 12, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
@@ -560,7 +560,7 @@ _CGB_Diploma: ; 91ad
_CGB_MapPals: ; 91c8
call LoadMapPals
ld a, SCGB_MAPPALS
ld [SGBPredef], a
ld [wSGBPredef], a
ret
; 91d1
@@ -585,13 +585,13 @@ _CGB_Evolution: ; 91e4
jr .got_palette
.pokemon
ld hl, PartyMon1DVs
ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
call AddNTimes
ld c, l
ld b, h
ld a, [PlayerHPPal]
ld a, [wPlayerHPPal]
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
ld hl, BattleObjectPals
@@ -621,7 +621,7 @@ _CGB_GSTitleScreen: ; 9228
ld a, BANK(wOBPals1)
call FarCopyWRAM
ld a, SCGB_DIPLOMA
ld [SGBPredef], a
ld [wSGBPredef], a
call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
@@ -690,7 +690,7 @@ _CGB_TrainerCard: ; 9289
call LoadHLPaletteIntoDE
; fill screen with opposite-gender palette for the card border
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, [wPlayerGender]
and a
@@ -700,7 +700,7 @@ _CGB_TrainerCard: ; 9289
.got_gender
call ByteFill
; fill trainer sprite area with same-gender palette
hlcoord 14, 1, AttrMap
hlcoord 14, 1, wAttrMap
lb bc, 7, 5
ld a, [wPlayerGender]
and a
@@ -710,33 +710,33 @@ _CGB_TrainerCard: ; 9289
.got_gender2
call FillBoxCGB
; top-right corner still uses the border's palette
hlcoord 18, 1, AttrMap
hlcoord 18, 1, wAttrMap
ld [hl], $1
hlcoord 2, 11, AttrMap
hlcoord 2, 11, wAttrMap
lb bc, 2, 4
ld a, $1 ; falkner
call FillBoxCGB
hlcoord 6, 11, AttrMap
hlcoord 6, 11, wAttrMap
lb bc, 2, 4
ld a, $2 ; bugsy
call FillBoxCGB
hlcoord 10, 11, AttrMap
hlcoord 10, 11, wAttrMap
lb bc, 2, 4
ld a, $3 ; whitney
call FillBoxCGB
hlcoord 14, 11, AttrMap
hlcoord 14, 11, wAttrMap
lb bc, 2, 4
ld a, $4 ; morty
call FillBoxCGB
hlcoord 2, 14, AttrMap
hlcoord 2, 14, wAttrMap
lb bc, 2, 4
ld a, $5 ; chuck
call FillBoxCGB
hlcoord 6, 14, AttrMap
hlcoord 6, 14, wAttrMap
lb bc, 2, 4
ld a, $6 ; jasmine
call FillBoxCGB
hlcoord 10, 14, AttrMap
hlcoord 10, 14, wAttrMap
lb bc, 2, 4
ld a, $7 ; pryce
call FillBoxCGB
@@ -745,7 +745,7 @@ _CGB_TrainerCard: ; 9289
and a
push af
jr z, .got_gender3
hlcoord 14, 14, AttrMap
hlcoord 14, 14, wAttrMap
lb bc, 2, 4
ld a, $1
call FillBoxCGB
@@ -756,7 +756,7 @@ _CGB_TrainerCard: ; 9289
inc c
.got_gender4
ld a, c
hlcoord 18, 1, AttrMap
hlcoord 18, 1, wAttrMap
ld [hl], a
call ApplyAttrMap
call ApplyPals
@@ -770,7 +770,7 @@ _CGB_MoveList: ; 9373
ld a, PREDEFPAL_GOLDENROD
call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [PlayerHPPal]
ld a, [wPlayerHPPal]
ld l, a
ld h, 0
add hl, hl
@@ -779,7 +779,7 @@ _CGB_MoveList: ; 9373
add hl, bc
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
hlcoord 11, 1, AttrMap
hlcoord 11, 1, wAttrMap
lb bc, 2, 9
ld a, $1
call FillBoxCGB
@@ -816,7 +816,7 @@ _CGB_PokedexSearchOption: ; 93ba
_CGB_PackPals: ; 93d3
; pack pals
ld a, [BattleType]
ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .tutorial_male
@@ -836,23 +836,23 @@ _CGB_PackPals: ; 93d3
ld a, BANK(wBGPals1)
call FarCopyWRAM
call WipeAttrMap
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 1, 10
ld a, $1
call FillBoxCGB
hlcoord 10, 0, AttrMap
hlcoord 10, 0, wAttrMap
lb bc, 1, 10
ld a, $2
call FillBoxCGB
hlcoord 7, 2, AttrMap
hlcoord 7, 2, wAttrMap
lb bc, 9, 1
ld a, $3
call FillBoxCGB
hlcoord 0, 7, AttrMap
hlcoord 0, 7, wAttrMap
lb bc, 3, 5
ld a, $4
call FillBoxCGB
hlcoord 0, 3, AttrMap
hlcoord 0, 3, wAttrMap
lb bc, 3, 5
ld a, $5
call FillBoxCGB
@@ -874,7 +874,7 @@ INCLUDE "gfx/pack/pack_f.pal"
_CGB_Pokepic: ; 9499
call _CGB_MapPals
ld de, SCREEN_WIDTH
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld a, [wMenuBorderTopCoord]
.loop
and a
@@ -910,11 +910,11 @@ _CGB13: ; 94d0
ld hl, PalPacket_SCGB_13 + 1
call CopyFourPalettes
call WipeAttrMap
hlcoord 0, 4, AttrMap
hlcoord 0, 4, wAttrMap
lb bc, 10, SCREEN_WIDTH
ld a, $2
call FillBoxCGB
hlcoord 0, 6, AttrMap
hlcoord 0, 6, wAttrMap
lb bc, 6, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
@@ -948,8 +948,8 @@ INCLUDE "gfx/splash/logo.pal"
_CGB_PlayerOrMonFrontpicPals: ; 9529
ld de, wBGPals1
ld a, [CurPartySpecies]
ld bc, TempMonDVs
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
@@ -960,7 +960,7 @@ _CGB_PlayerOrMonFrontpicPals: ; 9529
_CGB1e: ; 9542
ld de, wBGPals1
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call GetMonPalettePointer_
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
@@ -986,8 +986,8 @@ _CGB_TradeTube: ; 9555
_CGB_TrainerOrMonFrontpicPals: ; 9578
ld de, wBGPals1
ld a, [CurPartySpecies]
ld bc, TempMonDVs
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetFrontpicPalettePointer
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
@@ -1004,23 +1004,23 @@ _CGB_MysteryGift: ; 9591
call FarCopyWRAM
call ApplyPals
call WipeAttrMap
hlcoord 3, 7, AttrMap
hlcoord 3, 7, wAttrMap
lb bc, 8, 14
ld a, $1
call FillBoxCGB
hlcoord 1, 5, AttrMap
hlcoord 1, 5, wAttrMap
lb bc, 1, 18
ld a, $1
call FillBoxCGB
hlcoord 1, 16, AttrMap
hlcoord 1, 16, wAttrMap
lb bc, 1, 18
ld a, $1
call FillBoxCGB
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 17, 2
ld a, $1
call FillBoxCGB
hlcoord 18, 5, AttrMap
hlcoord 18, 5, wAttrMap
lb bc, 12, 1
ld a, $1
call FillBoxCGB

View File

@@ -20,13 +20,13 @@ endr
; 20015 (8:4015)
.WrapAroundTimes: ; 20015
dw Buffer4
dw wBuffer4
db 7, 4
dw Buffer5
dw wBuffer5
db 24, 12
dw Buffer6
dw wBuffer6
db 60, 15
; 20021
@@ -34,7 +34,7 @@ RestartClock: ; 20021 (8:4021)
; If we're here, we had an RTC overflow.
ld hl, .Text_ClockTimeMayBeWrong
call PrintText
ld hl, Options
ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -45,7 +45,7 @@ RestartClock: ; 20021 (8:4021)
call .SetClock
call ExitMenu
pop bc
ld hl, Options
ld hl, wOptions
ld [hl], b
ld c, a
ret
@@ -65,17 +65,17 @@ RestartClock: ; 20021 (8:4021)
.SetClock: ; 20051 (8:4051)
ld a, 1
ld [Buffer1], a ; which digit
ld [Buffer2], a
ld [wBuffer1], a ; which digit
ld [wBuffer2], a
ld a, 8
ld [Buffer3], a
ld [wBuffer3], a
call UpdateTime
call GetWeekday
ld [Buffer4], a
ld [wBuffer4], a
ld a, [hHours]
ld [Buffer5], a
ld [wBuffer5], a
ld a, [hMinutes]
ld [Buffer6], a
ld [wBuffer6], a
.loop
call .joy_loop
@@ -87,14 +87,14 @@ RestartClock: ; 20021 (8:4021)
call PrintText
call YesNoBox
jr c, .cancel
ld a, [Buffer4]
ld [StringBuffer2], a
ld a, [Buffer5]
ld [StringBuffer2 + 1], a
ld a, [Buffer6]
ld [StringBuffer2 + 2], a
ld a, [wBuffer4]
ld [wStringBuffer2], a
ld a, [wBuffer5]
ld [wStringBuffer2 + 1], a
ld a, [wBuffer6]
ld [wStringBuffer2 + 2], a
xor a
ld [StringBuffer2 + 3], a
ld [wStringBuffer2 + 3], a
call InitTime
call .PrintTime
ld hl, .Text_ClockReset
@@ -151,7 +151,7 @@ RestartClock: ; 20021 (8:4021)
ret
.pressed_up
ld a, [Buffer1]
ld a, [wBuffer1]
call ResetClock_GetWraparoundTime
ld a, [de]
inc a
@@ -163,7 +163,7 @@ RestartClock: ; 20021 (8:4021)
jr .done_scroll
.pressed_down
ld a, [Buffer1]
ld a, [wBuffer1]
call ResetClock_GetWraparoundTime
ld a, [de]
dec a
@@ -176,14 +176,14 @@ RestartClock: ; 20021 (8:4021)
jr .done_scroll
.pressed_left
ld hl, Buffer1
ld hl, wBuffer1
dec [hl]
jr nz, .done_scroll
ld [hl], $3
jr .done_scroll
.pressed_right
ld hl, Buffer1
ld hl, wBuffer1
inc [hl]
ld a, [hl]
cp $4
@@ -200,29 +200,29 @@ RestartClock: ; 20021 (8:4021)
ld c, 18
call TextBox
decoord 1, 8
ld a, [Buffer4]
ld a, [wBuffer4]
ld b, a
farcall PrintDayOfWeek
ld a, [Buffer5]
ld a, [wBuffer5]
ld b, a
ld a, [Buffer6]
ld a, [wBuffer6]
ld c, a
decoord 11, 8
farcall PrintHoursMins
ld a, [Buffer2]
ld a, [wBuffer2]
lb de, " ", " "
call .PlaceChars
ld a, [Buffer1]
ld a, [wBuffer1]
lb de, "▲", "▼"
call .PlaceChars
ld a, [Buffer1]
ld [Buffer2], a
ld a, [wBuffer1]
ld [wBuffer2], a
ret
; 20160 (8:4160)
; unused
.unreferenced ; 20160
ld a, [Buffer3]
ld a, [wBuffer3]
ld b, a
call Coord2Tile
ret
@@ -231,7 +231,7 @@ RestartClock: ; 20021 (8:4021)
.PlaceChars: ; 20168 (8:4168)
push de
call ResetClock_GetWraparoundTime
ld a, [Buffer3]
ld a, [wBuffer3]
dec a
ld b, a
call Coord2Tile

View File

@@ -239,13 +239,13 @@ Unreferenced_Function8b81:
ret
LoadTrainerClassPaletteAsNthBGPal:
ld a, [TrainerClass]
ld a, [wTrainerClass]
call GetTrainerPalettePointer
ld a, e
jr got_palette_pointer_8bd7
LoadMonPaletteAsNthBGPal:
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call GetMonPalettePointer
ld a, e
bit 7, a
@@ -278,14 +278,14 @@ Unreferenced_Function8bec:
ld a, [hCGB]
and a
jr nz, .cgb
ld hl, PlayerLightScreenCount
ld hl, wPlayerLightScreenCount
jp PushSGBPals_
.cgb
ld a, [EnemyLightScreenCount] ; col
ld a, [wEnemyLightScreenCount] ; col
ld c, a
ld a, [EnemyReflectCount] ; row
hlcoord 0, 0, AttrMap
ld a, [wEnemyReflectCount] ; row
hlcoord 0, 0, wAttrMap
ld de, SCREEN_WIDTH
.loop
and a
@@ -298,7 +298,7 @@ Unreferenced_Function8bec:
ld b, $0
add hl, bc
lb bc, 6, 4
ld a, [EnemySafeguardCount] ; value
ld a, [wEnemySafeguardCount] ; value
and $3
call FillBoxCGB
call CopyTilemapAtOnce
@@ -310,12 +310,12 @@ ApplyMonOrTrainerPals:
ld a, e
and a
jr z, .get_trainer
ld a, [CurPartySpecies]
ld a, [wCurPartySpecies]
call GetMonPalettePointer_
jr .load_palettes
.get_trainer
ld a, [TrainerClass]
ld a, [wTrainerClass]
call GetTrainerPalettePointer
.load_palettes
@@ -360,9 +360,9 @@ ApplyHPBarPals:
.PartyMenu:
ld e, c
inc e
hlcoord 11, 1, AttrMap
hlcoord 11, 1, wAttrMap
ld bc, 2 * SCREEN_WIDTH
ld a, [CurPartyMon]
ld a, [wCurPartyMon]
.loop
and a
jr z, .done
@@ -592,7 +592,7 @@ ResetBGPals:
ret
WipeAttrMap:
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
@@ -602,7 +602,7 @@ ApplyPals:
ld hl, wBGPals1
ld de, wBGPals2
ld bc, 16 palettes
ld a, BANK(wPals)
ld a, BANK(wGBCPalettes)
call FarCopyWRAM
ret
@@ -623,7 +623,7 @@ ApplyAttrMap:
ret
.UpdateVBank1:
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
debgcoord 0, 0
ld b, SCREEN_HEIGHT
ld a, $1
@@ -660,7 +660,7 @@ CGB_ApplyPartyMenuHPPals: ; 96f3
ld a, [de]
inc a
ld e, a
hlcoord 11, 2, AttrMap
hlcoord 11, 2, wAttrMap
ld bc, 2 * SCREEN_WIDTH
ld a, [wSGBPals]
.loop
@@ -688,7 +688,7 @@ GetBattlemonBackpicPalettePointer:
farcall GetPartyMonDVs
ld c, l
ld b, h
ld a, [TempBattleMonSpecies]
ld a, [wTempBattleMonSpecies]
call GetPlayerOrMonPalettePointer
pop de
ret
@@ -698,7 +698,7 @@ GetEnemyFrontpicPalettePointer:
farcall GetEnemyMonDVs
ld c, l
ld b, h
ld a, [TempEnemyMonSpecies]
ld a, [wTempEnemyMonSpecies]
call GetFrontpicPalettePointer
pop de
ret
@@ -716,13 +716,13 @@ GetPlayerOrMonPalettePointer:
ret
.male
ld hl, PlayerPalette
ld hl, wPlayerPalette
ret
GetFrontpicPalettePointer:
and a
jp nz, GetMonNormalOrShinyPalettePointer
ld a, [TrainerClass]
ld a, [wTrainerClass]
GetTrainerPalettePointer:
ld l, a
@@ -1230,7 +1230,7 @@ LoadMapPals:
ld h, [hl]
ld l, a
; Futher refine by time of day
ld a, [TimeOfDayPal]
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
add a
add a
@@ -1276,7 +1276,7 @@ LoadMapPals:
ld [rSVBK], a
.got_pals
ld a, [TimeOfDayPal]
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
ld bc, 8 palettes
ld hl, MapObjectPals
@@ -1292,7 +1292,7 @@ LoadMapPals:
cp ROUTE
ret nz
.outside
ld a, [MapGroup]
ld a, [wMapGroup]
ld l, a
ld h, 0
add hl, hl
@@ -1300,7 +1300,7 @@ LoadMapPals:
add hl, hl
ld de, RoofPals
add hl, de
ld a, [TimeOfDayPal]
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp NITE_F
jr c, .morn_day

View File

@@ -13,7 +13,7 @@ Credits:: ; 109847
ld a, [rSVBK]
push af
ld a, BANK(wPals)
ld a, BANK(wGBCPalettes)
ld [rSVBK], a
call ClearBGPalettes
@@ -63,7 +63,7 @@ Credits:: ; 109847
xor a
ld [wCreditsLYOverride], a
ld hl, LYOverrides
ld hl, wLYOverrides
ld bc, $100
xor a
call ByteFill
@@ -81,9 +81,9 @@ Credits:: ; 109847
ld [hInMenu], a
xor a
ld [hBGMapMode], a
ld [CreditsPos], a
ld [CreditsUnusedCD21], a
ld [CreditsTimer], a
ld [wCreditsPos], a
ld [wCreditsUnusedCD21], a
ld [wCreditsTimer], a
.execution_loop
call Credits_HandleBButton
@@ -122,7 +122,7 @@ Credits_HandleBButton: ; 109908
ld a, [wJumptableIndex]
bit 6, a
ret z
ld hl, CreditsPos
ld hl, wCreditsPos
ld a, [hli]
cp $d
jr nc, .okay
@@ -130,7 +130,7 @@ Credits_HandleBButton: ; 109908
and a
ret z
.okay
ld hl, CreditsTimer
ld hl, wCreditsTimer
ld a, [hl]
and a
ret z
@@ -187,20 +187,20 @@ Credits_PrepBGMapUpdate: ; 10995e (42:595e)
Credits_UpdateGFXRequestPath: ; 109964 (42:5964)
call Credits_LoadBorderGFX
ld a, l
ld [Requested2bppSource], a
ld [wRequested2bppSource], a
ld a, h
ld [Requested2bppSource + 1], a
ld [wRequested2bppSource + 1], a
ld a, LOW(vTiles2)
ld [Requested2bppDest], a
ld [wRequested2bppDest], a
ld a, HIGH(vTiles2)
ld [Requested2bppDest + 1], a
ld [wRequested2bppDest + 1], a
jr Credits_RequestGFX
Credits_RequestGFX: ; 10997b (42:597b)
xor a
ld [hBGMapMode], a
ld a, $8
ld [Requested2bpp], a
ld [wRequested2bpp], a
jp Credits_Next
Credits_LYOverride: ; 109986 (42:5986)
@@ -211,9 +211,9 @@ Credits_LYOverride: ; 109986 (42:5986)
dec a
dec a
ld [wCreditsLYOverride], a
ld hl, LYOverrides + $1f
ld hl, wLYOverrides + $1f
call .Fill
ld hl, LYOverrides + $87
ld hl, wLYOverrides + $87
call .Fill
jp Credits_Next
@@ -233,7 +233,7 @@ ParseCredits: ; 1099aa
jp nz, .done
; Wait until the timer has run out to parse the next command.
ld hl, CreditsTimer
ld hl, wCreditsTimer
ld a, [hl]
and a
jr z, .parse
@@ -349,13 +349,13 @@ ParseCredits: ; 1099aa
.wait2
; Wait for some amount of ticks.
call .get
ld [CreditsTimer], a
ld [wCreditsTimer], a
jr .done
.wait
; Wait for some amount of ticks, and do something else.
call .get
ld [CreditsTimer], a
ld [wCreditsTimer], a
xor a
ld [hBGMapThird], a
@@ -370,29 +370,29 @@ ParseCredits: ; 1099aa
ld hl, wJumptableIndex
set 7, [hl]
ld a, 32
ld [MusicFade], a
ld [wMusicFade], a
ld a, LOW(MUSIC_POST_CREDITS)
ld [MusicFadeID], a
ld [wMusicFadeID], a
ld a, HIGH(MUSIC_POST_CREDITS)
ld [MusicFadeID + 1], a
ld [wMusicFadeID + 1], a
ret
.get
; Get byte CreditsPos from CreditsScript
; Get byte wCreditsPos from CreditsScript
push hl
push de
ld a, [CreditsPos]
ld a, [wCreditsPos]
ld e, a
ld a, [CreditsPos+1]
ld a, [wCreditsPos+1]
ld d, a
ld hl, CreditsScript
add hl, de
inc de
ld a, e
ld [CreditsPos], a
ld [wCreditsPos], a
ld a, d
ld [CreditsPos+1], a
ld [wCreditsPos+1], a
ld a, [hl]
pop de
pop hl
@@ -424,22 +424,22 @@ ConstructCreditsTilemap: ; 109a95 (42:5a95)
ld a, $20
call DrawCreditsBorder
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, 4 * SCREEN_WIDTH
xor a
call ByteFill
hlcoord 0, 4, AttrMap
hlcoord 0, 4, wAttrMap
ld bc, SCREEN_WIDTH
ld a, $1
call ByteFill
hlcoord 0, 5, AttrMap
hlcoord 0, 5, wAttrMap
ld bc, 12 * SCREEN_WIDTH
ld a, $2
call ByteFill
hlcoord 0, 17, AttrMap
hlcoord 0, 17, wAttrMap
ld bc, SCREEN_WIDTH
ld a, $1
call ByteFill

View File

@@ -352,7 +352,7 @@ INCBIN "gfx/splash/logo2.1bpp"
CrystalIntro: ; e48ac
ld a, [rSVBK]
push af
ld a, BANK(wPals)
ld a, BANK(wGBCPalettes)
ld [rSVBK], a
ld a, [hInMenu]
push af
@@ -796,7 +796,7 @@ IntroScene9: ; e4c04 (39:4c04)
xor a
ld [hLCDCPointer], a
call ClearSprites
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
; first 12 rows have palette 1
ld bc, 12 * SCREEN_WIDTH
ld a, $1
@@ -1918,15 +1918,15 @@ Intro_RustleGrass: ; e546d (39:546d)
ld hl, .RustlingGrassPointers
add hl, de
ld a, [hli]
ld [Requested2bppSource], a
ld [wRequested2bppSource], a
ld a, [hli]
ld [Requested2bppSource + 1], a
ld [wRequested2bppSource + 1], a
ld a, LOW(vTiles2 tile $09)
ld [Requested2bppDest], a
ld [wRequested2bppDest], a
ld a, HIGH(vTiles2 tile $09)
ld [Requested2bppDest + 1], a
ld [wRequested2bppDest + 1], a
ld a, 4
ld [Requested2bppSize], a
ld [wRequested2bppSize], a
ret
; e5496 (39:5496)
@@ -2021,11 +2021,11 @@ Intro_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa)
Intro_ResetLYOverrides: ; e5516 (39:5516)
ld a, [rSVBK]
push af
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
ld hl, LYOverrides
ld bc, LYOverridesEnd - LYOverrides
ld hl, wLYOverrides
ld bc, wLYOverridesEnd - wLYOverrides
xor a
call ByteFill
@@ -2038,7 +2038,7 @@ Intro_ResetLYOverrides: ; e5516 (39:5516)
Intro_PerspectiveScrollBG: ; e552f (39:552f)
ld a, [rSVBK]
push af
ld a, BANK(LYOverrides)
ld a, BANK(wLYOverrides)
ld [rSVBK], a
; Scroll the grass every frame.
; Scroll the trees every other frame and at half speed.
@@ -2047,20 +2047,20 @@ Intro_PerspectiveScrollBG: ; e552f (39:552f)
and $1
jr z, .skip
; trees in the back
ld hl, LYOverrides
ld hl, wLYOverrides
ld a, [hl]
inc a
ld bc, $5f
call ByteFill
.skip
; grass in the front
ld hl, LYOverrides + $5f
ld hl, wLYOverrides + $5f
ld a, [hl]
inc a
inc a
ld bc, $31
call ByteFill
ld a, [LYOverrides + 0]
ld a, [wLYOverrides + 0]
ld [hSCX], a
pop af
ld [rSVBK], a

View File

@@ -2,7 +2,7 @@ GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile)
ld a, b
cp SCGB_RAM
jr nz, .not_ram
ld a, [SGBPredef]
ld a, [wSGBPredef]
.not_ram
push af
farcall ResetBGPals
@@ -46,7 +46,7 @@ MG_Mobile_Layout_FillBox: ; 49336
; 49346
MG_Mobile_Layout_WipeAttrMap: ; 49346 (12:5346)
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
@@ -74,7 +74,7 @@ MG_Mobile_Layout00: ; 4936e (12:536e)
ret
MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 4, 1
ld a, $1
call MG_Mobile_Layout_FillBox
@@ -84,7 +84,7 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
lb bc, 6, 1
ld a, $3
call MG_Mobile_Layout_FillBox
hlcoord 1, 0, AttrMap
hlcoord 1, 0, wAttrMap
ld a, $1
lb bc, 3, 18
call MG_Mobile_Layout_FillBox
@@ -94,7 +94,7 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
lb bc, 12, 18
ld a, $3
call MG_Mobile_Layout_FillBox
hlcoord 19, 0, AttrMap
hlcoord 19, 0, wAttrMap
lb bc, 4, 1
ld a, $1
call MG_Mobile_Layout_FillBox
@@ -104,7 +104,7 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
lb bc, 6, 1
ld a, $3
call MG_Mobile_Layout_FillBox
hlcoord 0, 12, AttrMap
hlcoord 0, 12, wAttrMap
ld bc, 6 * SCREEN_WIDTH
ld a, $7
call ByteFill
@@ -145,11 +145,11 @@ MG_Mobile_Layout01: ; 4942f
ld a, BANK(wBGPals1)
call FarCopyWRAM
call MG_Mobile_Layout_WipeAttrMap
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
hlcoord 0, 14, AttrMap
hlcoord 0, 14, wAttrMap
ld bc, 4 * SCREEN_WIDTH
ld a, $7
call ByteFill
@@ -178,27 +178,27 @@ MG_Mobile_Layout01: ; 4942f
; 49480
Function49480: ; 49480
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 4, SCREEN_WIDTH
ld a, $7
call MG_Mobile_Layout_FillBox
hlcoord 0, 2, AttrMap
hlcoord 0, 2, wAttrMap
ld a, $4
ld [hl], a
hlcoord 19, 2, AttrMap
hlcoord 19, 2, wAttrMap
ld [hl], a
ret
; 49496
Function49496: ; 49496
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 2, SCREEN_WIDTH
ld a, $7
call MG_Mobile_Layout_FillBox
hlcoord 0, 1, AttrMap
hlcoord 0, 1, wAttrMap
ld a, $4
ld [hl], a
hlcoord 19, 1, AttrMap
hlcoord 19, 1, wAttrMap
ld [hl], a
ret
; 494ac
@@ -251,43 +251,43 @@ INCLUDE "gfx/unknown/49757.pal"
; 49797
_InitMG_Mobile_LinkTradePalMap: ; 49797
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
lb bc, 16, 2
ld a, $4
call MG_Mobile_Layout_FillBox
ld a, $3
ldcoord_a 0, 1, AttrMap
ldcoord_a 0, 14, AttrMap
hlcoord 2, 0, AttrMap
ldcoord_a 0, 1, wAttrMap
ldcoord_a 0, 14, wAttrMap
hlcoord 2, 0, wAttrMap
lb bc, 8, 18
ld a, $5
call MG_Mobile_Layout_FillBox
hlcoord 2, 8, AttrMap
hlcoord 2, 8, wAttrMap
lb bc, 8, 18
ld a, $6
call MG_Mobile_Layout_FillBox
hlcoord 0, 16, AttrMap
hlcoord 0, 16, wAttrMap
lb bc, 2, SCREEN_WIDTH
ld a, $4
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
hlcoord 6, 1, AttrMap
hlcoord 6, 1, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
hlcoord 17, 1, AttrMap
hlcoord 17, 1, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
hlcoord 6, 9, AttrMap
hlcoord 6, 9, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
hlcoord 17, 9, AttrMap
hlcoord 17, 9, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $2
hlcoord 2, 16, AttrMap
hlcoord 2, 16, wAttrMap
ld [hli], a
ld a, $7
ld [hli], a
@@ -295,7 +295,7 @@ _InitMG_Mobile_LinkTradePalMap: ; 49797
ld [hli], a
ld a, $2
ld [hl], a
hlcoord 2, 17, AttrMap
hlcoord 2, 17, wAttrMap
ld a, $3
ld bc, 6
call ByteFill

View File

@@ -71,7 +71,7 @@ Function818f4: ; 818f4
ld hl, PokemonPalettes
Function818fd: ; 818fd
ld de, OverworldMap
ld de, wOverworldMap
ld c, NUM_POKEMON + 1
.asm_81902
push bc
@@ -87,7 +87,7 @@ Function818fd: ; 818fd
Function81911: ; 81911
ld hl, TrainerPalettes
ld de, OverworldMap
ld de, wOverworldMap
ld c, NUM_TRAINER_CLASSES
.asm_81919
push bc
@@ -138,7 +138,7 @@ Function81948: ; 81948
ld bc, sScratch - vTiles0
xor a
call ByteFill
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
@@ -320,7 +320,7 @@ Function81adb: ; 81adb
call Function81bf4
ld a, [wcf66]
inc a
ld [CurPartySpecies], a
ld [wCurPartySpecies], a
ld [wd265], a
hlcoord 0, 1
ld de, wd265
@@ -330,7 +330,7 @@ Function81adb: ; 81adb
and a
jr nz, .asm_81b7a
ld a, $1
ld [UnownLetter], a
ld [wUnownLetter], a
call GetPokemonName
hlcoord 4, 1
call PlaceString
@@ -364,15 +364,15 @@ Function81adb: ; 81adb
.asm_81b7a
ld a, [wd265]
ld [TrainerClass], a
ld [wTrainerClass], a
callfar GetTrainerAttributes
ld de, StringBuffer1
ld de, wStringBuffer1
hlcoord 4, 1
call PlaceString
ld de, vTiles2
callfar GetTrainerPic
xor a
ld [TempEnemyMonSpecies], a
ld [wTempEnemyMonSpecies], a
ld [hGraphicStartTile], a
hlcoord 2, 3
lb bc, 7, 7
@@ -390,15 +390,15 @@ String_81bb9: db DEBUGTEST_A, "きりかえ▶@" ; (A) switches
; 81bc0
Function81bc0: ; 81bc0
decoord 0, 11, AttrMap
decoord 0, 11, wAttrMap
hlcoord 2, 11
ld a, $1
call Function81bde
decoord 0, 13, AttrMap
decoord 0, 13, wAttrMap
hlcoord 2, 13
ld a, $2
call Function81bde
decoord 0, 15, AttrMap
decoord 0, 15, wAttrMap
hlcoord 2, 15
ld a, $3
@@ -424,7 +424,7 @@ Function81bf4: ; 81bf4
ld h, $0
add hl, hl
add hl, hl
ld de, OverworldMap
ld de, wOverworldMap
add hl, de
ld de, wc608
ld bc, 4
@@ -771,7 +771,7 @@ Function81df4: ; 81df4
call PlaceString
ld a, [wd004]
call Function81e55
ld [CurItem], a
ld [wCurItem], a
predef CanLearnTMHMMove
ld a, c
and a
@@ -876,7 +876,7 @@ Function81eca: ; 81eca
ld h, $0
add hl, hl
add hl, hl
ld de, OverworldMap
ld de, wOverworldMap
add hl, de
ld e, l
ld d, h
@@ -1029,7 +1029,7 @@ Function81f5e: ; 81f5e
ld [hl], $ed
ld b, $70
ld c, $5
ld hl, Sprites
ld hl, wVirtualOAM
ld de, wc608 + 10
call .asm_81fb7
ld de, wc608 + 11
@@ -1099,7 +1099,7 @@ TilesetColorTest:
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, DEBUGTEST_BLACK
call ByteFill
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, $7
call ByteFill
@@ -1130,7 +1130,7 @@ Function821d2: ; 821d2
Function821d8: ; 821d8
ld a, [wcf64]
hlcoord 0, 0, AttrMap
hlcoord 0, 0, wAttrMap
Function821de: ; 821de
add hl, de

View File

@@ -1,8 +1,8 @@
InitDecorations: ; 26751 (9:6751)
ld a, DECO_FEATHERY_BED
ld [Bed], a
ld [wDecoBed], a
ld a, DECO_TOWN_MAP
ld [Poster], a
ld [wDecoPoster], a
ret
_PlayerDecorationMenu: ; 0x2675c
@@ -11,18 +11,18 @@ _PlayerDecorationMenu: ; 0x2675c
ld hl, .MenuHeader
call LoadMenuHeader
xor a
ld [Buffer5], a
ld [wBuffer5], a
ld a, $1
ld [Buffer6], a
ld [wBuffer6], a
.top_loop
ld a, [Buffer6]
ld a, [wBuffer6]
ld [wMenuCursorBuffer], a
call .FindCategoriesWithOwnedDecos
call DoNthMenu
ld a, [wMenuCursorY]
ld [Buffer6], a
ld [wBuffer6], a
jr c, .exit_menu
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld hl, .pointers
call MenuJumptable
jr nc, .top_loop
@@ -31,7 +31,7 @@ _PlayerDecorationMenu: ; 0x2675c
call ExitMenu
pop af
ld [wWhichIndexSet], a
ld a, [Buffer5]
ld a, [wBuffer5]
ld c, a
ret
; 0x2679a
@@ -78,14 +78,14 @@ _PlayerDecorationMenu: ; 0x2675c
call .FindOwndDecos
ld a, 7
call .AppendToStringBuffer2
ld hl, StringBuffer2
ld hl, wStringBuffer2
ld de, wd002
ld bc, ITEM_NAME_LENGTH
call CopyBytes
ret
.ClearStringBuffer2: ; 26822 (9:6822)
ld hl, StringBuffer2
ld hl, wStringBuffer2
xor a
ld [hli], a
ld bc, ITEM_NAME_LENGTH - 1
@@ -94,7 +94,7 @@ _PlayerDecorationMenu: ; 0x2675c
ret
.AppendToStringBuffer2: ; 26830 (9:6830)
ld hl, StringBuffer2
ld hl, wStringBuffer2
inc [hl]
ld e, [hl]
ld d, 0
@@ -471,7 +471,7 @@ GetDecorationName: ; 269e7
; 269f3
DecorationMenuFunction: ; 269f3
ld a, [MenuSelection]
ld a, [wMenuSelection]
push de
call GetDecorationData
call GetDecoName
@@ -481,7 +481,7 @@ DecorationMenuFunction: ; 269f3
; 26a02
DoDecorationAction2: ; 26a02
ld a, [MenuSelection]
ld a, [wMenuSelection]
call GetDecorationData
ld de, 2 ; function 2
add hl, de
@@ -545,7 +545,7 @@ INCLUDE "data/decorations/names.asm"
GetDecoName: ; 26c72
ld a, [hli]
ld e, [hl]
ld bc, StringBuffer2
ld bc, wStringBuffer2
push bc
ld hl, .NameFunctions
rst JumpTable
@@ -645,75 +645,75 @@ DecoAction_nothing: ; 26ce3
; 26ce5
DecoAction_setupbed: ; 26ce5
ld hl, Bed
ld hl, wDecoBed
jp DecoAction_TrySetItUp
; 26ceb
DecoAction_putawaybed: ; 26ceb
ld hl, Bed
ld hl, wDecoBed
jp DecoAction_TryPutItAway
; 26cf1
DecoAction_setupcarpet: ; 26cf1
ld hl, Carpet
ld hl, wDecoCarpet
jp DecoAction_TrySetItUp
; 26cf7
DecoAction_putawaycarpet: ; 26cf7
ld hl, Carpet
ld hl, wDecoCarpet
jp DecoAction_TryPutItAway
; 26cfd
DecoAction_setupplant: ; 26cfd
ld hl, Plant
ld hl, wDecoPlant
jp DecoAction_TrySetItUp
; 26d03
DecoAction_putawayplant: ; 26d03
ld hl, Plant
ld hl, wDecoPlant
jp DecoAction_TryPutItAway
; 26d09
DecoAction_setupposter: ; 26d09
ld hl, Poster
ld hl, wDecoPoster
jp DecoAction_TrySetItUp
; 26d0f
DecoAction_putawayposter: ; 26d0f
ld hl, Poster
ld hl, wDecoPoster
jp DecoAction_TryPutItAway
; 26d15
DecoAction_setupconsole: ; 26d15
ld hl, Console
ld hl, wDecoConsole
jp DecoAction_TrySetItUp
; 26d1b
DecoAction_putawayconsole: ; 26d1b
ld hl, Console
ld hl, wDecoConsole
jp DecoAction_TryPutItAway
; 26d21
DecoAction_setupbigdoll: ; 26d21
ld hl, BigDoll
ld hl, wDecoBigDoll
jp DecoAction_TrySetItUp
; 26d27
DecoAction_putawaybigdoll: ; 26d27
ld hl, BigDoll
ld hl, wDecoBigDoll
jp DecoAction_TryPutItAway
; 26d2d
DecoAction_TrySetItUp: ; 26d2d
ld a, [hl]
ld [Buffer1], a
ld [wBuffer1], a
push hl
call DecoAction_SetItUp
jr c, .failed
ld a, 1
ld [Buffer5], a
ld [wBuffer5], a
pop hl
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld [hl], a
xor a
ret
@@ -726,20 +726,20 @@ DecoAction_TrySetItUp: ; 26d2d
DecoAction_SetItUp: ; 26d46
; See if there's anything of the same type already out
ld a, [Buffer1]
ld a, [wBuffer1]
and a
jr z, .nothingthere
; See if that item is already out
ld b, a
ld a, [MenuSelection]
ld a, [wMenuSelection]
cp b
jr z, .alreadythere
; Put away the item that's already out, and set up the new one
ld a, [MenuSelection]
ld hl, StringBuffer4
ld a, [wMenuSelection]
ld hl, wStringBuffer4
call GetDecorationName
ld a, [Buffer1]
ld hl, StringBuffer3
ld a, [wBuffer1]
ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_PutAwayAndSetUp
call MenuTextBoxBackup
@@ -747,8 +747,8 @@ DecoAction_SetItUp: ; 26d46
ret
.nothingthere
ld a, [MenuSelection]
ld hl, StringBuffer3
ld a, [wMenuSelection]
ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_SetUpTheDeco
call MenuTextBoxBackup
@@ -765,18 +765,18 @@ DecoAction_SetItUp: ; 26d46
DecoAction_TryPutItAway: ; 26d86
; If there is no item of that type already set, there is nothing to put away.
ld a, [hl]
ld [Buffer1], a
ld [wBuffer1], a
xor a
ld [hl], a
ld a, [Buffer1]
ld a, [wBuffer1]
and a
jr z, .nothingthere
; Put it away.
ld a, $1
ld [Buffer5], a
ld a, [Buffer1]
ld [MenuSelection], a
ld hl, StringBuffer3
ld [wBuffer5], a
ld a, [wBuffer1]
ld [wMenuSelection], a
ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_PutAwayTheDeco
call MenuTextBoxBackup
@@ -797,7 +797,7 @@ DecoAction_setupornament: ; 26db3
call DecoAction_SetItUp_Ornament
jr c, .cancel
ld a, $1
ld [Buffer5], a
ld [wBuffer5], a
jr DecoAction_FinishUp_Ornament
.cancel
@@ -829,16 +829,16 @@ DecoAction_SetItUp_Ornament: ; 26de3
and a
jr z, .nothingthere
ld b, a
ld a, [MenuSelection]
ld a, [wMenuSelection]
cp b
jr z, .failed
ld a, b
ld hl, StringBuffer3
ld hl, wStringBuffer3
call GetDecorationName
ld a, [MenuSelection]
ld hl, StringBuffer4
ld a, [wMenuSelection]
ld hl, wStringBuffer4
call GetDecorationName
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld [wSelectedDecoration], a
call .getwhichside
ld hl, DecoText_PutAwayAndSetUp
@@ -847,11 +847,11 @@ DecoAction_SetItUp_Ornament: ; 26de3
ret
.nothingthere
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld [wSelectedDecoration], a
call .getwhichside
ld a, [MenuSelection]
ld hl, StringBuffer3
ld a, [wMenuSelection]
ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_SetUpTheDeco
call MenuTextBoxBackup
@@ -866,7 +866,7 @@ DecoAction_SetItUp_Ornament: ; 26de3
; 26e33
.getwhichside ; 26e33
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld b, a
ld a, [wOtherDecoration]
cp b
@@ -886,10 +886,10 @@ DecoAction_PutItAway_Ornament: ; 26e46
ld a, [wSelectedDecoration]
and a
jr z, .nothingthere
ld hl, StringBuffer3
ld hl, wStringBuffer3
call GetDecorationName
ld a, $1
ld [Buffer5], a
ld [wBuffer5], a
xor a
ld [wSelectedDecoration], a
ld hl, DecoText_PutAwayTheDeco
@@ -920,7 +920,7 @@ DecoAction_AskWhichSide: ; 26e70
ld a, [wMenuCursorY]
cp 3
jr z, .nope
ld [Buffer2], a
ld [wBuffer2], a
call QueryWhichSide
ld a, [hl]
ld [wSelectedDecoration], a
@@ -935,9 +935,9 @@ DecoAction_AskWhichSide: ; 26e70
; 26e9a
QueryWhichSide: ; 26e9a
ld hl, RightOrnament
ld de, LeftOrnament
ld a, [Buffer2]
ld hl, wDecoRightOrnament
ld de, wDecoLeftOrnament
ld a, [wBuffer2]
cp 1
ret z
push hl
@@ -1009,7 +1009,7 @@ DecorationFlagAction_c: ; 26ef1
GetDecorationName_c: ; 26ef5 (9:6ef5)
ld a, c
call GetDecorationID
ld hl, StringBuffer1
ld hl, wStringBuffer1
push hl
call GetDecorationName
pop de
@@ -1072,7 +1072,7 @@ DescribeDecoration:: ; 26f59
; 26f69
DecorationDesc_Poster: ; 26f69
ld a, [Poster]
ld a, [wDecoPoster]
ld hl, DecorationDesc_PosterPointers
ld de, 3
call IsInArray
@@ -1148,20 +1148,20 @@ DecorationDesc_NullPoster: ; 26fb8
; 26fb9
DecorationDesc_LeftOrnament: ; 26fb9
ld a, [LeftOrnament]
ld a, [wDecoLeftOrnament]
jr DecorationDesc_OrnamentOrConsole
DecorationDesc_RightOrnament: ; 26fbe
ld a, [RightOrnament]
ld a, [wDecoRightOrnament]
jr DecorationDesc_OrnamentOrConsole
DecorationDesc_Console: ; 26fc3
ld a, [Console]
ld a, [wDecoConsole]
jr DecorationDesc_OrnamentOrConsole
DecorationDesc_OrnamentOrConsole: ; 26fc8
ld c, a
ld de, StringBuffer3
ld de, wStringBuffer3
call GetDecorationName_c_de
ld b, BANK(.OrnamentConsoleScript)
ld de, .OrnamentConsoleScript
@@ -1196,18 +1196,18 @@ DecorationDesc_GiantOrnament: ; 26fdd
ToggleMaptileDecorations: ; 26feb
lb de, 0, 4
ld a, [Bed]
ld a, [wDecoBed]
call SetDecorationTile
lb de, 7, 4
ld a, [Plant]
ld a, [wDecoPlant]
call SetDecorationTile
lb de, 6, 0
ld a, [Poster]
ld a, [wDecoPoster]
call SetDecorationTile
call SetPosterVisibility
lb de, 0, 0
call PadCoords_de
ld a, [Carpet]
ld a, [wDecoCarpet]
and a
ret z
call _GetDecorationSprite
@@ -1227,7 +1227,7 @@ ToggleMaptileDecorations: ; 26feb
SetPosterVisibility: ; 27027
ld b, SET_FLAG
ld a, [Poster]
ld a, [wDecoPoster]
and a
jr nz, .ok
ld b, RESET_FLAG
@@ -1250,20 +1250,20 @@ SetDecorationTile: ; 27037
ToggleDecorationsVisibility: ; 27043
ld de, EVENT_PLAYERS_HOUSE_2F_CONSOLE
ld hl, VariableSprites + SPRITE_CONSOLE - SPRITE_VARS
ld a, [Console]
ld hl, wVariableSprites + SPRITE_CONSOLE - SPRITE_VARS
ld a, [wDecoConsole]
call ToggleDecorationVisibility
ld de, EVENT_PLAYERS_HOUSE_2F_DOLL_1
ld hl, VariableSprites + SPRITE_DOLL_1 - SPRITE_VARS
ld a, [LeftOrnament]
ld hl, wVariableSprites + SPRITE_DOLL_1 - SPRITE_VARS
ld a, [wDecoLeftOrnament]
call ToggleDecorationVisibility
ld de, EVENT_PLAYERS_HOUSE_2F_DOLL_2
ld hl, VariableSprites + SPRITE_DOLL_2 - SPRITE_VARS
ld a, [RightOrnament]
ld hl, wVariableSprites + SPRITE_DOLL_2 - SPRITE_VARS
ld a, [wDecoRightOrnament]
call ToggleDecorationVisibility
ld de, EVENT_PLAYERS_HOUSE_2F_BIG_DOLL
ld hl, VariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS
ld a, [BigDoll]
ld hl, wVariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS
ld a, [wDecoBigDoll]
call ToggleDecorationVisibility
ret
; 27074

View File

@@ -61,12 +61,12 @@ _ResetClock: ; 4d3b1
ClockResetPassword: ; 4d41e
call .CalculatePassword
push de
ld hl, StringBuffer2
ld hl, wStringBuffer2
ld bc, 5
xor a
call ByteFill
ld a, $4
ld [StringBuffer2 + 5], a
ld [wStringBuffer2 + 5], a
ld hl, .pleaseenterpasswordtext
call PrintText
.loop
@@ -108,7 +108,7 @@ ClockResetPassword: ; 4d41e
.updateIDdisplay ; 4d468
hlcoord 14, 15
ld de, StringBuffer2
ld de, wStringBuffer2
ld c, 5
.loop3
ld a, [de]
@@ -122,7 +122,7 @@ ClockResetPassword: ; 4d41e
ld a, " "
call ByteFill
hlcoord 14, 16
ld a, [StringBuffer2 + 5]
ld a, [wStringBuffer2 + 5]
ld e, a
ld d, $0
add hl, de
@@ -145,19 +145,19 @@ ClockResetPassword: ; 4d41e
ret
.left
ld a, [StringBuffer2 + 5]
ld a, [wStringBuffer2 + 5]
and a
ret z
dec a
ld [StringBuffer2 + 5], a
ld [wStringBuffer2 + 5], a
ret
.right
ld a, [StringBuffer2 + 5]
ld a, [wStringBuffer2 + 5]
cp $4
ret z
inc a
ld [StringBuffer2 + 5], a
ld [wStringBuffer2 + 5], a
ret
.up
@@ -187,16 +187,16 @@ ClockResetPassword: ; 4d41e
ret
.getcurrentdigit ; 4d4d5
ld a, [StringBuffer2 + 5]
ld a, [wStringBuffer2 + 5]
ld e, a
ld d, $0
ld hl, StringBuffer2
ld hl, wStringBuffer2
add hl, de
ret
.ConvertDecIDToBytes: ; 4d4e0
ld hl, 0
ld de, StringBuffer2 + 4
ld de, wStringBuffer2 + 4
ld bc, 1
call .ConvertToBytes
ld bc, 10
@@ -222,13 +222,13 @@ ClockResetPassword: ; 4d41e
ld a, BANK(sPlayerData)
call GetSRAMBank
ld de, 0
ld hl, sPlayerData + (PlayerID - wPlayerData)
ld hl, sPlayerData + (wPlayerID - wPlayerData)
ld c, $2
call .ComponentFromNumber
ld hl, sPlayerData + (PlayerName - wPlayerData)
ld hl, sPlayerData + (wPlayerName - wPlayerData)
ld c, NAME_LENGTH_JAPANESE - 1
call .ComponentFromString
ld hl, sPlayerData + (Money - wPlayerData)
ld hl, sPlayerData + (wMoney - wPlayerData)
ld c, $3
call .ComponentFromNumber
call CloseSRAM

View File

@@ -22,7 +22,7 @@ PlaceDiplomaOnScreen: ; 1dd709
ld de, .EmptyString
hlcoord 15, 5
call PlaceString
ld de, PlayerName
ld de, wPlayerName
hlcoord 9, 5
call PlaceString
ld de, .Certification
@@ -68,12 +68,12 @@ PrintDiplomaPage2: ; 1dd7ae
hlcoord 3, 15
call PlaceString
hlcoord 12, 15
ld de, GameTimeHours
ld de, wGameTimeHours
lb bc, 2, 4
call PrintNum
ld [hl], $67 ; colon
inc hl
ld de, GameTimeMinutes
ld de, wGameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
ret

View File

@@ -3,7 +3,7 @@ HDMATransferAttrMapAndTileMapToWRAMBank3:: ; 104000
jp CallInSafeGFXMode
.Function:
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -40,7 +40,7 @@ HDMATransferAttrMapToWRAMBank3: ; 104047
jp CallInSafeGFXMode
.Function:
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
ld a, $1
@@ -55,7 +55,7 @@ ReloadMapPart:: ; 104061
jp CallInSafeGFXMode
.Function:
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -86,7 +86,7 @@ Mobile_ReloadMapPart: ; 104099
jp CallInSafeGFXMode
.Function:
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -156,10 +156,10 @@ OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 104110
jp CallInSafeGFXMode
.Function:
; Transfer AttrMap and Tilemap to BGMap
; Transfer wAttrMap and Tilemap to BGMap
; Fill vBGAttrs with $00
; Fill vBGTiles with " "
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -189,10 +189,10 @@ Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap: ; 104148 (41:4148)
jp CallInSafeGFXMode
.Function:
; Transfer AttrMap and Tilemap to BGMap
; Transfer wAttrMap and Tilemap to BGMap
; Fill vBGAttrs with $00
; Fill vBGTiles with $ff
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
ld c, $ff
@@ -588,7 +588,7 @@ HDMATransfer_OnlyTopFourRows: ; 104303
decoord 0, 0
call .Copy
ld hl, wScratchTileMap + $80
decoord 0, 0, AttrMap
decoord 0, 0, wAttrMap
call .Copy
ld a, $1
ld [rVBK], a

View File

@@ -5,12 +5,12 @@ SECTION "Events", ROMX
OverworldLoop:: ; 966b0
xor a
ld [MapStatus], a
ld [wMapStatus], a
.loop
ld a, [MapStatus]
ld a, [wMapStatus]
ld hl, .jumps
rst JumpTable
ld a, [MapStatus]
ld a, [wMapStatus]
cp 3 ; done
jr nz, .loop
.done
@@ -25,101 +25,101 @@ OverworldLoop:: ; 966b0
DisableEvents: ; 966cb
xor a
ld [ScriptFlags3], a
ld [wScriptFlags3], a
ret
; 966d0
EnableEvents:: ; 966d0
ld a, $ff
ld [ScriptFlags3], a
ld [wScriptFlags3], a
ret
; 966d6
CheckBit5_ScriptFlags3: ; 966d6
ld hl, ScriptFlags3
ld hl, wScriptFlags3
bit 5, [hl]
ret
; 966dc
DisableWarpsConnxns: ; 966dc
ld hl, ScriptFlags3
ld hl, wScriptFlags3
res 2, [hl]
ret
; 966e2
DisableCoordEvents: ; 966e2
ld hl, ScriptFlags3
ld hl, wScriptFlags3
res 1, [hl]
ret
; 966e8
DisableStepCount: ; 966e8
ld hl, ScriptFlags3
ld hl, wScriptFlags3
res 0, [hl]
ret
; 966ee
DisableWildEncounters: ; 966ee
ld hl, ScriptFlags3
ld hl, wScriptFlags3
res 4, [hl]
ret
; 966f4
EnableWarpsConnxns: ; 966f4
ld hl, ScriptFlags3
ld hl, wScriptFlags3
set 2, [hl]
ret
; 966fa
EnableCoordEvents: ; 966fa
ld hl, ScriptFlags3
ld hl, wScriptFlags3
set 1, [hl]
ret
; 96700
EnableStepCount: ; 96700
ld hl, ScriptFlags3
ld hl, wScriptFlags3
set 0, [hl]
ret
; 96706
EnableWildEncounters: ; 96706
ld hl, ScriptFlags3
ld hl, wScriptFlags3
set 4, [hl]
ret
; 9670c
CheckWarpConnxnScriptFlag: ; 9670c
ld hl, ScriptFlags3
ld hl, wScriptFlags3
bit 2, [hl]
ret
; 96712
CheckCoordEventScriptFlag: ; 96712
ld hl, ScriptFlags3
ld hl, wScriptFlags3
bit 1, [hl]
ret
; 96718
CheckStepCountScriptFlag: ; 96718
ld hl, ScriptFlags3
ld hl, wScriptFlags3
bit 0, [hl]
ret
; 9671e
CheckWildEncountersScriptFlag: ; 9671e
ld hl, ScriptFlags3
ld hl, wScriptFlags3
bit 4, [hl]
ret
; 96724
StartMap: ; 96724
xor a
ld [ScriptVar], a
ld [wScriptVar], a
xor a
ld [ScriptRunning], a
ld hl, MapStatus
ld bc, wMapStatusEnd - MapStatus
ld [wScriptRunning], a
ld hl, wMapStatus
ld bc, wMapStatusEnd - wMapStatus
call ByteFill
farcall InitCallReceiveDelay
call ClearJoypad
@@ -141,13 +141,13 @@ EnterMap: ; 9673e
cp MAPSETUP_RELOADMAP
jr nz, .dontresetpoison
xor a
ld [PoisonStepCount], a
ld [wPoisonStepCount], a
.dontresetpoison
xor a ; end map entry
ld [hMapEntryMethod], a
ld a, 2 ; HandleMap
ld [MapStatus], a
ld [wMapStatus], a
ret
; 9676d
@@ -164,7 +164,7 @@ HandleMap: ; 96773
call MapEvents
; Not immediately entering a connected map will cause problems.
ld a, [MapStatus]
ld a, [wMapStatus]
cp 2 ; HandleMap
ret nz
@@ -176,7 +176,7 @@ HandleMap: ; 96773
; 96795
MapEvents: ; 96795
ld a, [MapEventStatus]
ld a, [wMapEventStatus]
ld hl, .jumps
rst JumpTable
ret
@@ -203,12 +203,12 @@ MaxOverworldDelay: ; 967af
ResetOverworldDelay: ; 967b0
ld a, [MaxOverworldDelay]
ld [OverworldDelay], a
ld [wOverworldDelay], a
ret
; 967b7
NextOverworldFrame: ; 967b7
ld a, [OverworldDelay]
ld a, [wOverworldDelay]
and a
ret z
ld c, a
@@ -217,7 +217,7 @@ NextOverworldFrame: ; 967b7
; 967c1
HandleMapTimeAndJoypad: ; 967c1
ld a, [MapEventStatus]
ld a, [wMapEventStatus]
cp 1 ; no events
ret z
@@ -252,12 +252,12 @@ CheckPlayerState: ; 967f4
call EnableEvents
.events
ld a, 0 ; events
ld [MapEventStatus], a
ld [wMapEventStatus], a
ret
.noevents
ld a, 1 ; no events
ld [MapEventStatus], a
ld [wMapEventStatus], a
ret
; 96812
@@ -272,7 +272,7 @@ _CheckObjectEnteringVisibleRange: ; 96812
PlayerEvents: ; 9681f
xor a
; If there's already a player event, don't interrupt it.
ld a, [ScriptRunning]
ld a, [wScriptRunning]
and a
ret nz
@@ -304,9 +304,9 @@ PlayerEvents: ; 9681f
farcall EnableScriptMode
pop af
ld [ScriptRunning], a
ld [wScriptRunning], a
call DoPlayerEvent
ld a, [ScriptRunning]
ld a, [wScriptRunning]
cp PLAYEREVENT_CONNECTION
jr z, .ok2
cp PLAYEREVENT_JOYCHANGEFACING
@@ -379,7 +379,7 @@ CheckTileEvent: ; 96874
ret
.warp_tile
ld a, [PlayerStandingTile]
ld a, [wPlayerStandingTile]
call CheckPitTile
jr nz, .not_pit
ld a, PLAYEREVENT_FALL
@@ -463,13 +463,13 @@ endr
call GetMapScriptsBank
call CallScript
ld hl, ScriptFlags
ld hl, wScriptFlags
res 3, [hl]
farcall EnableScriptMode
farcall ScriptEvents
ld hl, ScriptFlags
ld hl, wScriptFlags
bit 3, [hl]
jr z, .nope
@@ -647,7 +647,7 @@ TryObjectEvent: ; 969b5
ld h, [hl]
ld l, a
call GetMapScriptsBank
ld de, EngineBuffer1
ld de, wEngineBuffer1
ld bc, 2
call FarCopyBytes
ld a, PLAYEREVENT_ITEMBALL
@@ -689,7 +689,7 @@ TryBGEvent: ; 96a38
ret
.is_bg_event:
ld a, [EngineBuffer3]
ld a, [wEngineBuffer3]
ld hl, .bg_events
rst JumpTable
ret
@@ -720,14 +720,14 @@ TryBGEvent: ; 96a38
jr .checkdir
.checkdir
ld a, [PlayerDirection]
ld a, [wPlayerDirection]
and %1100
cp b
jp nz, .dontread
.read
call PlayTalkObject
ld hl, EngineBuffer4
ld hl, wEngineBuffer4
ld a, [hli]
ld h, [hl]
ld l, a
@@ -741,7 +741,7 @@ TryBGEvent: ; 96a38
jp nz, .dontread
call PlayTalkObject
call GetMapScriptsBank
ld de, EngineBuffer1
ld de, wEngineBuffer1
ld bc, 3
call FarCopyBytes
ld a, BANK(HiddenItemScript)
@@ -754,7 +754,7 @@ TryBGEvent: ; 96a38
call CheckBGEventFlag
jr nz, .dontread
call GetMapScriptsBank
ld de, EngineBuffer1
ld de, wEngineBuffer1
ld bc, 3
call FarCopyBytes
jr .dontread
@@ -787,7 +787,7 @@ TryBGEvent: ; 96a38
; 96ad8
CheckBGEventFlag: ; 96ad8
ld hl, EngineBuffer4
ld hl, wEngineBuffer4
ld a, [hli]
ld h, [hl]
ld l, a
@@ -943,9 +943,9 @@ CountStep: ; 96b79
jr c, .doscript
; Count the step for poison and total steps
ld hl, PoisonStepCount
ld hl, wPoisonStepCount
inc [hl]
ld hl, StepCount
ld hl, wStepCount
inc [hl]
; Every 256 steps, increase the happiness of all your Pokemon.
jr nz, .skip_happiness
@@ -956,7 +956,7 @@ CountStep: ; 96b79
; Every 256 steps, offset from the happiness incrementor by 128 steps,
; decrease the hatch counter of all your eggs until you reach the first
; one that is ready to hatch.
ld a, [StepCount]
ld a, [wStepCount]
cp $80
jr nz, .skip_egg
@@ -968,7 +968,7 @@ CountStep: ; 96b79
farcall DayCareStep
; Every four steps, deal damage to all Poisoned Pokemon
ld hl, PoisonStepCount
ld hl, wPoisonStepCount
ld a, [hl]
cp 4
jr c, .skip_poison
@@ -1019,7 +1019,7 @@ DoRepelStep: ; 96bd7
; 96beb
DoPlayerEvent: ; 96beb
ld a, [ScriptRunning]
ld a, [wScriptRunning]
and a
ret z
@@ -1036,11 +1036,11 @@ DoPlayerEvent: ; 96beb
add hl, bc
add hl, bc
ld a, [hli]
ld [ScriptBank], a
ld [wScriptBank], a
ld a, [hli]
ld [ScriptPos], a
ld [wScriptPos], a
ld a, [hl]
ld [ScriptPos + 1], a
ld [wScriptPos + 1], a
ret
; 96c0c

View File

@@ -1,10 +1,10 @@
_BasementKey: ; 507b4
; Are we even in the right map to use this?
ld a, [MapGroup]
ld a, [wMapGroup]
cp GROUP_GOLDENROD_UNDERGROUND
jr nz, .nope
ld a, [MapNumber]
ld a, [wMapNumber]
cp MAP_GOLDENROD_UNDERGROUND
jr nz, .nope
; Are we on the tile in front of the door?

View File

@@ -96,9 +96,9 @@ Function170139: ; 170139
ld a, l
ld [wMisc + 1], a
ld hl, wBT_OTTempPkmn1DVs
ld a, [PlayerID]
ld a, [wPlayerID]
ld [hli], a
ld a, [PlayerID + 1]
ld a, [wPlayerID + 1]
ld [hli], a
ld a, [wSecretID]
ld [hli], a
@@ -106,23 +106,23 @@ Function170139: ; 170139
ld [hli], a
ld e, l
ld d, h
ld hl, PlayerName
ld hl, wPlayerName
ld bc, NAME_LENGTH_JAPANESE - 1
call CopyBytes
ld bc, PlayerID
ld bc, wPlayerID
ld de, wPlayerGender
farcall GetMobileOTTrainerClass
ld de, wBT_OTTempPkmn1CaughtGender
ld a, c
ld [de], a
inc de
ld a, LOW(PartyMons)
ld a, LOW(wPartyMons)
ld [wcd49], a
ld a, HIGH(PartyMons)
ld a, HIGH(wPartyMons)
ld [wcd4a], a
ld a, LOW(PartyMonNicknames)
ld a, LOW(wPartyMonNicknames)
ld [wcd4b], a
ld a, HIGH(PartyMonNicknames)
ld a, HIGH(wPartyMonNicknames)
ld [wcd4c], a
ld a, 3
.CopyLoop:
@@ -231,15 +231,15 @@ _BattleTowerBattle: ; 17022c
; 17024d
RunBattleTowerTrainer: ; 17024d
ld a, [Options]
ld a, [wOptions]
push af
ld hl, Options
ld hl, wOptions
set BATTLE_SHIFT, [hl] ; SET MODE
ld a, [InBattleTowerBattle]
ld a, [wInBattleTowerBattle]
push af
or $1
ld [InBattleTowerBattle], a
ld [wInBattleTowerBattle], a
xor a
ld [wLinkMode], a
@@ -253,7 +253,7 @@ RunBattleTowerTrainer: ; 17024d
farcall LoadPokemonData
farcall HealParty
ld a, [wBattleResult]
ld [ScriptVar], a
ld [wScriptVar], a
and a
jr nz, .lost
ld a, BANK(sNrOfBeatenBattleTowerTrainers)
@@ -261,7 +261,7 @@ RunBattleTowerTrainer: ; 17024d
ld a, [sNrOfBeatenBattleTowerTrainers]
ld [wNrOfBeatenBattleTowerTrainers], a
call CloseSRAM
ld hl, StringBuffer3
ld hl, wStringBuffer3
ld a, [wNrOfBeatenBattleTowerTrainers]
add "1"
ld [hli], a
@@ -270,9 +270,9 @@ RunBattleTowerTrainer: ; 17024d
.lost
pop af
ld [InBattleTowerBattle], a
ld [wInBattleTowerBattle], a
pop af
ld [Options], a
ld [wOptions], a
ld a, $1
ld [wBattleTowerBattleEnded], a
ret
@@ -334,7 +334,7 @@ ReadBTTrainerParty: ; 1702b7
ld [wBT_OTTempPkmn3NameEnd - 1], a ; $c68a + 57 = $c6c3
; Fix errors in the movesets
call CheckBTMonMovesForErrors
; Repair the trainer name if needed, then copy it to OTPlayerName
; Repair the trainer name if needed, then copy it to wOTPlayerName
ld de, wBT_OTTempName
ld c, NAME_LENGTH - 1
farcall CheckStringForErrors
@@ -346,7 +346,7 @@ ReadBTTrainerParty: ; 1702b7
ld hl, wBT_OTTempName ; 0xc608
.done_trainer_name
ld de, OTPlayerName
ld de, wOTPlayerName
ld bc, NAME_LENGTH - 1
call CopyBytes
ld a, "@"
@@ -354,15 +354,15 @@ ReadBTTrainerParty: ; 1702b7
ld hl, wBT_OTTempTrainerClass
ld a, [hli]
ld [OtherTrainerClass], a
ld a, LOW(OTPartyMonNicknames)
ld [BGMapBuffer], a
ld a, HIGH(OTPartyMonNicknames)
ld [BGMapBuffer + 1], a
ld [wOtherTrainerClass], a
ld a, LOW(wOTPartyMonNicknames)
ld [wBGMapBuffer], a
ld a, HIGH(wOTPartyMonNicknames)
ld [wBGMapBuffer + 1], a
; Copy Pkmn into Memory from the address in hl
ld de, OTPartyMon1Species
ld bc, OTPartyCount
ld de, wOTPartyMon1Species
ld bc, wOTPartyCount
ld a, BATTLETOWER_PARTY_LENGTH
ld [bc], a
inc bc
@@ -375,16 +375,16 @@ ReadBTTrainerParty: ; 1702b7
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
push de
ld a, [BGMapBuffer]
ld a, [wBGMapBuffer]
ld e, a
ld a, [BGMapBuffer + 1]
ld a, [wBGMapBuffer + 1]
ld d, a
ld bc, MON_NAME_LENGTH
call CopyBytes
ld a, e
ld [BGMapBuffer], a
ld [wBGMapBuffer], a
ld a, d
ld [BGMapBuffer + 1], a
ld [wBGMapBuffer + 1], a
pop de
pop bc
pop af
@@ -420,7 +420,7 @@ endr
ld [hl], a
.valid
ld [CurSpecies], a
ld [wCurSpecies], a
call GetBaseData
ld a, $5
call GetSRAMBank
@@ -442,7 +442,7 @@ endr
ld [hl], a
.dont_load
ld [CurPartyLevel], a
ld [wCurPartyLevel], a
ld hl, MON_MOVES
add hl, bc
ld d, NUM_MOVES - 1
@@ -574,13 +574,13 @@ INCLUDE "data/battle_tower/unknown_levels.asm"
CopyBTTrainer_FromBT_OT_TowBT_OTTemp: ; 1704a2
; copy the BattleTower-Trainer data that lies at 'BT_OTTrainer' to 'wBT_OTTemp'
; copy the BattleTower-Trainer data that lies at 'wBT_OTTrainer' to 'wBT_OTTemp'
ld a, [rSVBK]
push af
ld a, BANK(BT_OTTrainer)
ld a, BANK(wBT_OTTrainer)
ld [rSVBK], a
ld hl, BT_OTTrainer
ld hl, wBT_OTTrainer
ld de, wBT_OTTemp
ld bc, BATTLE_TOWER_STRUCT_LENGTH
call CopyBytes
@@ -669,7 +669,7 @@ Function1704e1: ; 1704e1
call GetSRAMBank
ld hl, $a89c
ld de, StringBuffer3
ld de, wStringBuffer3
ld bc, $16
call CopyBytes
@@ -680,13 +680,13 @@ Function1704e1: ; 1704e1
call CloseSRAM
hlcoord 1, 1
ld de, StringBuffer3
ld de, wStringBuffer3
call PlaceString
hlcoord 1, 3
ld de, .String_Mail
call PlaceString
hlcoord 4, 3
ld de, StringBuffer4
ld de, wStringBuffer4
call PlaceString
hlcoord 8, 3
ld de, .String_PastReaders
@@ -901,7 +901,7 @@ Function1704e1: ; 1704e1
; 170687
BattleTowerAction: ; 170687
ld a, [ScriptVar]
ld a, [wScriptVar]
ld e, a
ld d, 0
ld hl, .dw
@@ -972,13 +972,13 @@ BattleTower_GiveReward: ; 1706ee (5c:46ee) BattleTowerAction $1b
ld a, [sBattleTowerReward]
call CloseSRAM
ld [ScriptVar], a
ld hl, NumItems
ld [wScriptVar], a
ld hl, wNumItems
ld a, [hli]
cp MAX_ITEMS
ret c
ld b, MAX_ITEMS
ld a, [ScriptVar]
ld a, [wScriptVar]
ld c, a
.loop
ld a, [hli]
@@ -992,7 +992,7 @@ BattleTower_GiveReward: ; 1706ee (5c:46ee) BattleTowerAction $1b
dec b
jr nz, .loop
ld a, POTION
ld [ScriptVar], a
ld [wScriptVar], a
ret
Function17071b: ; 17071b (5c:471b) BattleTowerAction $1c
@@ -1038,7 +1038,7 @@ BattleTower_RandomlyChooseReward: ; 17073e (5c:473e) BattleTowerAction $1e
BattleTowerAction_CheckExplanationRead: ; 17075f (5c:475f) BattleTowerAction $00
call BattleTower_CheckSaveFileExistsAndIsYours
ld a, [ScriptVar]
ld a, [wScriptVar]
and a
ret z
@@ -1046,7 +1046,7 @@ BattleTowerAction_CheckExplanationRead: ; 17075f (5c:475f) BattleTowerAction $00
call GetSRAMBank
ld a, [sBattleTowerSaveFileFlags]
and $2
ld [ScriptVar], a
ld [wScriptVar], a
call CloseSRAM
ret
@@ -1055,7 +1055,7 @@ BattleTowerAction_GetChallengeState: ; 170778 (5c:4778) BattleTowerAction $02
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
ld a, [hl]
ld [ScriptVar], a
ld [wScriptVar], a
call CloseSRAM
ret
@@ -1088,7 +1088,7 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05
ld a, [$aa8c]
ld b, a
ld a, [$be46]
ld [ScriptVar], a
ld [wScriptVar], a
call CloseSRAM
and a
ret z
@@ -1103,7 +1103,7 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05
ld a, [$aa8b]
call CloseSRAM
ld c, a
ld a, [CurDay]
ld a, [wCurDay]
sub c
jr c, .asm_1707e5
cp $8
@@ -1113,7 +1113,7 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05
jr nz, .asm_1707ef
ret
.asm_1707e5
ld hl, CurDay
ld hl, wCurDay
ld a, $8c
sub c
add [hl]
@@ -1121,7 +1121,7 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05
ret c
.asm_1707ef
ld a, $8
ld [ScriptVar], a
ld [wScriptVar], a
Function1707f4: ; 1707f4 (5c:47f4) BattleTowerAction $06
ld a, $5
@@ -1137,7 +1137,7 @@ Function170807: ; 170807 (5c:4807) BattleTowerAction $16
call UpdateTime
ld a, $5
call GetSRAMBank
ld a, [CurDay]
ld a, [wCurDay]
ld [$b2f9], a
xor a
ld [$b2fa], a
@@ -1146,7 +1146,7 @@ Function170807: ; 170807 (5c:4807) BattleTowerAction $16
Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
xor a
ld [ScriptVar], a
ld [wScriptVar], a
ld a, $5
call GetSRAMBank
ld a, [$b2f9]
@@ -1159,7 +1159,7 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
push bc
call UpdateTime
pop bc
ld a, [CurDay]
ld a, [wCurDay]
sub c
jr c, .asm_170849
cp $b
@@ -1170,7 +1170,7 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
ret
.asm_170849
ld hl, CurDay
ld hl, wCurDay
ld a, 140
sub c
add [hl]
@@ -1178,7 +1178,7 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
ret c
.asm_170853
ld a, $1
ld [ScriptVar], a
ld [wScriptVar], a
ld a, $5
call GetSRAMBank
xor a
@@ -1228,14 +1228,14 @@ BattleTower_CheckSaveFileExistsAndIsYours: ; 17089a BattleTowerAction $09
ld a, $1
.nope
ld [ScriptVar], a
ld [wScriptVar], a
ret
; 1708b1
Function1708b1: ; 1708b1 (5c:48b1) BattleTowerAction $0a
xor a
ld [MusicFade], a
ld [wMusicFade], a
call MaxVolume
ret
@@ -1243,7 +1243,7 @@ CheckMobileEventIndex: ; 1708b9 (5c:48b9) BattleTowerAction $0b something to do
ld a, BANK(sMobileEventIndex)
call GetSRAMBank
ld a, [sMobileEventIndex]
ld [ScriptVar], a
ld [wScriptVar], a
call CloseSRAM
ret
@@ -1251,14 +1251,14 @@ Function1708c8: ; 1708c8 (5c:48c8) BattleTowerAction $0c
call UpdateTime
ld a, $5
call GetSRAMBank
ld a, [CurDay]
ld a, [wCurDay]
ld [$aa8b], a
xor a
ld [$aa8c], a
ld a, [$aa5d]
cp $2
jr nc, .asm_1708ec
ld a, [CurDay]
ld a, [wCurDay]
ld [$aa48], a
ld a, $1
ld [$aa47], a
@@ -1268,7 +1268,7 @@ Function1708c8: ; 1708c8 (5c:48c8) BattleTowerAction $0c
Function1708f0: ; 1708f0 (5c:48f0) BattleTowerAction $0d
xor a
ld [ScriptVar], a
ld [wScriptVar], a
call UpdateTime
ld a, $5
call GetSRAMBank
@@ -1278,7 +1278,7 @@ Function1708f0: ; 1708f0 (5c:48f0) BattleTowerAction $0d
call CloseSRAM
and a
ret z
ld hl, CurDay
ld hl, wCurDay
ld a, c
cp [hl]
jr nz, Function170923
@@ -1289,7 +1289,7 @@ Function1708f0: ; 1708f0 (5c:48f0) BattleTowerAction $0d
cp $5
ret c
ld a, $1
ld [ScriptVar], a
ld [wScriptVar], a
ret
@@ -1309,22 +1309,22 @@ Function170923: ; 170923
BattleTowerAction_EggTicket: ; 17093c (5c:493c) BattleTowerAction $0e
xor a
ld [ScriptVar], a
ld [wScriptVar], a
ld a, EGG_TICKET
ld [CurItem], a
ld hl, NumItems
ld [wCurItem], a
ld hl, wNumItems
call CheckItem
ret nc
ld a, [PartyCount]
ld a, [wPartyCount]
ld b, 0
ld c, a
ld hl, PartySpecies
ld hl, wPartySpecies
.loop
ld a, [hli]
cp EGG
jr nz, .not_egg
push hl
ld hl, PartyMonOT
ld hl, wPartyMonOT
ld de, NAME_LENGTH_JAPANESE
ld a, b
and a
@@ -1354,15 +1354,15 @@ endr
ld [hli], a
pop hl
ld a, EGG_TICKET
ld [CurItem], a
ld [wCurItem], a
ld a, 1
ld [wItemQuantityChangeBuffer], a
ld a, -1
ld [CurItemQuantity], a
ld hl, NumItems
ld [wCurItemQuantity], a
ld hl, wNumItems
call TossItem
ld a, $1
ld [ScriptVar], a
ld [wScriptVar], a
ret
.different
@@ -1384,14 +1384,14 @@ Function1709aa: ; 1709aa (5c:49aa) BattleTowerAction $0f
ld a, BANK(w3_d090)
ld [rSVBK], a
ld a, [w3_d090]
ld [ScriptVar], a
ld [wScriptVar], a
pop af
ld [rSVBK], a
ret
Function1709bb: ; 1709bb (5c:49bb) BattleTowerAction $10
xor a
ld [ScriptVar], a
ld [wScriptVar], a
ld a, $5
call GetSRAMBank
ld a, [$a800]
@@ -1452,7 +1452,7 @@ Jumptable_1709e7: ; 1709e7
farcall Function11b6b4
farcall Function17d0f3
ld a, $1
ld [ScriptVar], a
ld [wScriptVar], a
ret
; 170a33
@@ -1478,9 +1478,9 @@ Jumptable_1709e7: ; 1709e7
dec c
jr nz, .compare_loop
call CloseSRAM
ld a, [MapGroup]
ld a, [wMapGroup]
ld b, a
ld a, [MapNumber]
ld a, [wMapNumber]
ld c, a
call GetMapSceneID
ld a, d
@@ -1492,7 +1492,7 @@ Jumptable_1709e7: ; 1709e7
.no_scene
ld a, $1
ld [ScriptVar], a
ld [wScriptVar], a
ret
.different
@@ -1502,10 +1502,10 @@ Jumptable_1709e7: ; 1709e7
xor a
ld [$a800], a
call CloseSRAM
ld [ScriptVar], a
ld a, [MapGroup]
ld [wScriptVar], a
ld a, [wMapGroup]
ld b, a
ld a, [MapNumber]
ld a, [wMapNumber]
ld c, a
call GetMapSceneID
ld a, d
@@ -1536,13 +1536,13 @@ Function170aaf: ; 170aaf (5c:4aaf) BattleTowerAction $13
ld a, $5
call GetSRAMBank
ld a, [$aa8d]
ld [ScriptVar], a
ld [wScriptVar], a
call CloseSRAM
ret
Function170abe: ; 170abe (5c:4abe) BattleTowerAction $14
call BattleTower_CheckSaveFileExistsAndIsYours
ld a, [ScriptVar]
ld a, [wScriptVar]
and a
ret z
@@ -1550,7 +1550,7 @@ Function170abe: ; 170abe (5c:4abe) BattleTowerAction $14
call GetSRAMBank
ld a, [sBattleTowerSaveFileFlags]
and $1
ld [ScriptVar], a
ld [wScriptVar], a
call CloseSRAM
ret
@@ -1573,14 +1573,14 @@ BattleTowerAction_LevelCheck: ; 170ae8 (5c:4ae8) BattleTowerAction $18
ld a, b
ld [wcd4f], a
xor a
ld [ScriptVar], a
ld [wScriptVar], a
farcall BattleTower_LevelCheck ; level check
ret nc
ld a, $5
call GetSRAMBank
ld a, [$b2fb]
call CloseSRAM
ld [ScriptVar], a
ld [wScriptVar], a
ret
BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19
@@ -1593,14 +1593,14 @@ BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19
ld a, b
ld [wcd4f], a
xor a
ld [ScriptVar], a
ld [wScriptVar], a
farcall BattleTower_UbersCheck
ret nc
ld a, $5
call GetSRAMBank
ld a, [$b2fb]
call CloseSRAM
ld [ScriptVar], a
ld [wScriptVar], a
ret
LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
@@ -1609,7 +1609,7 @@ LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
push af
ld a, $3
ld [rSVBK], a
ld hl, BT_OTTrainerClass
ld hl, wBT_OTTrainerClass
ld a, [hl]
dec a
ld c, a
@@ -1623,7 +1623,7 @@ LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
; Load sprite of the opponent trainer
; because s/he is chosen randomly and appears out of nowhere
ld a, [ScriptVar]
ld a, [wScriptVar]
dec a
sla a
ld e, a
@@ -1633,12 +1633,12 @@ LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
ld c, a
ld b, 0
ld d, 0
ld hl, MapObjects
ld hl, wMapObjects
add hl, bc
inc hl
ld a, [wBTTempOTSprite]
ld [hl], a
ld hl, UsedSprites
ld hl, wUsedSprites
add hl, de
ld [hli], a
ld [hUsedSpriteIndex], a
@@ -1664,6 +1664,6 @@ CheckForBattleTowerRules: ; 170bd3
ld a, TRUE
.asm_170be0
ld [ScriptVar], a
ld [wScriptVar], a
ret
; 170be4

View File

@@ -1,23 +1,23 @@
Function_LoadOpponentTrainerAndPokemons: ; 1f8000
ld a, [rSVBK]
push af
ld a, BANK(BT_OTTrainer)
ld a, BANK(wBT_OTTrainer)
ld [rSVBK], a
; Fill BT_OTTrainer with zeros
; Fill wBT_OTTrainer with zeros
xor a
ld hl, BT_OTTrainer
ld bc, BT_OTTrainerEnd - BT_OTTrainer
ld hl, wBT_OTTrainer
ld bc, wBT_OTTrainerEnd - wBT_OTTrainer
call ByteFill
; Write $ff into the Item-Slots
ld a, $ff
ld [BT_OTPkmn1Item], a
ld [BT_OTPkmn2Item], a
ld [BT_OTPkmn3Item], a
ld [wBT_OTPkmn1Item], a
ld [wBT_OTPkmn2Item], a
ld [wBT_OTPkmn3Item], a
; Set BT_OTTrainer as start address to write the following data to
ld de, BT_OTTrainer
; Set wBT_OTTrainer as start address to write the following data to
ld de, wBT_OTTrainer
ld a, [hRandomAdd]
ld b, a
@@ -129,22 +129,22 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
ld b, a
ld a, [hld]
ld c, a
ld a, [BT_OTPkmn1]
ld a, [wBT_OTPkmn1]
cp b
jr z, .FindARandomBattleTowerPkmn
ld a, [BT_OTPkmn1Item]
ld a, [wBT_OTPkmn1Item]
cp c
jr z, .FindARandomBattleTowerPkmn
ld a, [BT_OTPkmn2]
ld a, [wBT_OTPkmn2]
cp b
jr z, .FindARandomBattleTowerPkmn
ld a, [BT_OTPkmn2Item]
ld a, [wBT_OTPkmn2Item]
cp c
jr z, .FindARandomBattleTowerPkmn
ld a, [BT_OTPkmn3]
ld a, [wBT_OTPkmn3]
cp b
jr z, .FindARandomBattleTowerPkmn
ld a, [BT_OTPkmn3Item]
ld a, [wBT_OTPkmn3Item]
cp c
jr z, .FindARandomBattleTowerPkmn
ld a, [sBTPkmnPrevTrainer1]
@@ -199,11 +199,11 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
ld [sBTPkmnPrevPrevTrainer2], a
ld a, [sBTPkmnPrevTrainer3]
ld [sBTPkmnPrevPrevTrainer3], a
ld a, [BT_OTPkmn1]
ld a, [wBT_OTPkmn1]
ld [sBTPkmnPrevTrainer1], a
ld a, [BT_OTPkmn2]
ld a, [wBT_OTPkmn2]
ld [sBTPkmnPrevTrainer2], a
ld a, [BT_OTPkmn3]
ld a, [wBT_OTPkmn3]
ld [sBTPkmnPrevTrainer3], a
call CloseSRAM
ret

View File

@@ -30,7 +30,7 @@ CheckForMobileBattleRules: ; 8b1e1
; 0x8b201
_CheckForBattleTowerRules: ; 8b201
ld hl, StringBuffer2
ld hl, wStringBuffer2
ld [hl], "3"
inc hl
ld [hl], "@"
@@ -212,13 +212,13 @@ BattleTower_ExecuteJumptable: ; 8b25b
; 8b2bb
BattleTower_CheckPartyLengthIs3: ; 8b2bb
ld a, [PartyCount]
ld a, [wPartyCount]
cp BATTLETOWER_PARTY_LENGTH
ret
; 8b2c1
BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1
ld hl, PartyCount
ld hl, wPartyCount
ld a, [hli]
ld b, $0
ld c, a
@@ -231,7 +231,7 @@ BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1
.egg
dec c
jr nz, .loop
ld a, [PartyCount]
ld a, [wPartyCount]
cp b
ret z
ld a, b
@@ -240,7 +240,7 @@ BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1
; 8b2da
Function_PartyCountEq3: ; 8b2da
ld a, [PartyCount]
ld a, [wPartyCount]
cp BATTLETOWER_PARTY_LENGTH
ret z
scf
@@ -248,13 +248,13 @@ Function_PartyCountEq3: ; 8b2da
; 8b2e2
Function_PartySpeciesAreUnique: ; 8b2e2
ld hl, PartyMon1Species
ld hl, wPartyMon1Species
call VerifyUniqueness
ret
; 8b2e9
VerifyUniqueness: ; 8b2e9
ld de, PartyCount
ld de, wPartyCount
ld a, [de]
inc de
dec a
@@ -318,13 +318,13 @@ VerifyUniqueness: ; 8b2e9
; 8b32a
Function_PartyItemsAreUnique: ; 8b32a
ld hl, PartyMon1Item
ld hl, wPartyMon1Item
call VerifyUniqueness
ret
; 8b331
Function_HasPartyAnEgg: ; 8b331
ld hl, PartyCount
ld hl, wPartyCount
ld a, [hli]
ld c, a
.loop

View File

@@ -1,14 +1,14 @@
BattleTowerText:: ; 11c000
; Print text c for trainer [BT_OTTrainerClass]
; Print text c for trainer [wBT_OTTrainerClass]
; 1: Intro text
; 2: Player lost
; 3: Player won
ld a, [rSVBK]
push af
ld a, BANK(BT_OTTrainerClass)
ld a, BANK(wBT_OTTrainerClass)
ld [rSVBK], a
if DEF(_CRYSTAL11)
ld hl, BT_OTTrainerClass
ld hl, wBT_OTTrainerClass
else
; BUG ALERT
; Instead of loading the Trainer Class, this routine
@@ -16,7 +16,7 @@ else
; uses it to get the gender of the trainer.
; As a consequence, the enemy trainer's dialog will
; always be sampled from the female array.
ld hl, BT_OTName + NAME_LENGTH_JAPANESE - 1
ld hl, wBT_OTName + NAME_LENGTH_JAPANESE - 1
endc
ld a, [hl]
dec a
@@ -53,11 +53,11 @@ endc
ld b, 0
dec c
jr nz, .restore
ld [BT_TrainerTextIndex], a
ld [wBT_TrainerTextIndex], a
jr .okay2
.restore
ld a, [BT_TrainerTextIndex]
ld a, [wBT_TrainerTextIndex]
.okay2
push af

View File

@@ -14,7 +14,7 @@ BuenasPassword: ; 8af6b
call DoNthMenu ; menu
farcall Buena_ExitMenu
ld b, $0
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld c, a
ld a, [wBuenasPassword]
maskbits NUM_PASSWORDS_PER_CATEGORY
@@ -24,7 +24,7 @@ BuenasPassword: ; 8af6b
.wrong
ld a, b
ld [ScriptVar], a
ld [wScriptVar], a
ret
; 8afa9
@@ -58,7 +58,7 @@ endr
ld a, [wBuenasPassword]
and $f0
ld c, a
ld a, [MenuSelection]
ld a, [wMenuSelection]
add c
ld c, a
farcall GetBuenasPassword
@@ -71,7 +71,7 @@ BuenaPrize: ; 8afd4
xor a
ld [wMenuScrollPosition], a
ld a, $1
ld [MenuSelection], a
ld [wMenuSelection], a
call Buena_PlacePrizeMenuBox
call Buena_DisplayBlueCardBalance
ld hl, .Text_AskWhichPrize
@@ -88,7 +88,7 @@ BuenaPrize: ; 8afd4
call PrintBlueCardBalance
call Buena_PrizeMenu
jr z, .done
ld [MenuSelectionQuantity], a
ld [wMenuSelectionQuantity], a
call Buena_getprize
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
@@ -98,7 +98,7 @@ BuenaPrize: ; 8afd4
call YesNoBox
jr c, .loop
ld a, [MenuSelectionQuantity]
ld a, [wMenuSelectionQuantity]
call Buena_getprize
inc hl
ld a, [hld]
@@ -109,10 +109,10 @@ BuenaPrize: ; 8afd4
ld a, [hli]
push hl
ld [CurItem], a
ld [wCurItem], a
ld a, $1
ld [wItemQuantityChangeBuffer], a
ld hl, NumItems
ld hl, wNumItems
call ReceiveItem
pop hl
jr nc, .BagFull
@@ -246,7 +246,7 @@ Buena_PlacePrizeMenuBox: ; 8b0d6
Buena_PrizeMenu: ; 8b0e2
ld hl, .MenuHeader
call CopyMenuHeader
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld [wMenuCursorBuffer], a
xor a
ld [wWhichIndexSet], a
@@ -254,10 +254,10 @@ Buena_PrizeMenu: ; 8b0e2
call InitScrollingMenu
call UpdateSprites
call ScrollingMenu
ld a, [MenuSelection]
ld a, [wMenuSelection]
ld c, a
ld a, [wMenuCursorY]
ld [MenuSelection], a
ld [wMenuSelection], a
ld a, [wMenuJoypad]
cp $2
jr z, .cancel
@@ -301,7 +301,7 @@ endr
; 8b134
.prizeitem ; 8b134
ld a, [MenuSelection]
ld a, [wMenuSelection]
call Buena_getprize
ld a, [hl]
push de
@@ -313,7 +313,7 @@ endr
; 8b147
.prizepoints ; 8b147
ld a, [MenuSelection]
ld a, [wMenuSelection]
call Buena_getprize
inc hl
ld a, [hl]

View File

@@ -5,7 +5,7 @@ AskRememberPassword: ; 4ae12
ld a, $1
.okay
ld [ScriptVar], a
ld [wScriptVar], a
ret
.DoMenu: ; 4ae1f

Some files were not shown because too many files have changed in this diff Show More