Prefix wram labels with w, part 1.

Handle edge cases first.
This commit is contained in:
luckytyphlosion
2018-01-23 16:45:34 -05:00
parent c60f1331fe
commit f2ae74079f
41 changed files with 452 additions and 452 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -66,23 +66,23 @@ NUM_CHANNELS EQU const_value
const NOTE_REST ; 5 const NOTE_REST ; 5
const NOTE_VIBRATO_OVERRIDE ; 6 const NOTE_VIBRATO_OVERRIDE ; 6
; Volume: ; wVolume
VOLUME_SO1_F EQU 3 VOLUME_SO1_F EQU 3
VOLUME_SO2_F EQU 7 VOLUME_SO2_F EQU 7
VOLUME_SO1_LEVEL EQU %00000111 VOLUME_SO1_LEVEL EQU %00000111
VOLUME_SO2_LEVEL EQU %01110000 VOLUME_SO2_LEVEL EQU %01110000
MAX_VOLUME EQU $77 MAX_VOLUME EQU $77
; SoundInput: ; SoundInput
SOUND_INPUT_CH1_F EQU 0 SOUND_INPUT_CH1_F EQU 0
SOUND_INPUT_CH2_F EQU 1 SOUND_INPUT_CH2_F EQU 1
SOUND_INPUT_CH3_F EQU 2 SOUND_INPUT_CH3_F EQU 2
SOUND_INPUT_CH4_F EQU 3 SOUND_INPUT_CH4_F EQU 3
SOUND_INPUT_GLOBAL_F EQU 7 SOUND_INPUT_GLOBAL_F EQU 7
; Danger: ; wLowHealthAlarm
DANGER_PITCH_F EQU 4 DANGER_PITCH_F EQU 4
DANGER_ON_F EQU 7 DANGER_ON_F EQU 7
; MusicFade: ; MusicFade
MUSIC_FADE_IN_F EQU 7 MUSIC_FADE_IN_F EQU 7

View File

@@ -214,7 +214,7 @@ SUBSTATUS_CURLED EQU 0
enum SCREENS_UNUSED enum SCREENS_UNUSED
enum SCREENS_SPIKES enum SCREENS_SPIKES
; Weather values ; values in wBattleWeather
const_def const_def
const WEATHER_NONE const WEATHER_NONE
const WEATHER_RAIN const WEATHER_RAIN

View File

@@ -28,4 +28,4 @@ EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * TILE_WIDTH ; pixels
const SPRITEOAMSTRUCT_TILE_ID ; 2 const SPRITEOAMSTRUCT_TILE_ID ; 2
const SPRITEOAMSTRUCT_ATTRIBUTES ; 3 const SPRITEOAMSTRUCT_ATTRIBUTES ; 3
SPRITEOAMSTRUCT_LENGTH EQU const_value SPRITEOAMSTRUCT_LENGTH EQU const_value
NUM_SPRITE_OAM_STRUCTS EQU 40 ; see Sprites NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wVirtualOAM

View File

@@ -1288,7 +1288,7 @@ UnknownText_0x1c5c5e::
UnknownText_0x1c5c7b:: UnknownText_0x1c5c7b::
text "Coins:" text "Coins:"
line "@" line "@"
deciram Coins, 2, 4 deciram wCoins, 2, 4
db "@@" db "@@"
Text_RaiseThePPOfWhichMove:: Text_RaiseThePPOfWhichMove::

View File

@@ -135,7 +135,7 @@ AI_Redundant: ; 2c41a
ret ret
.Sandstorm: ; 2c4f5 .Sandstorm: ; 2c4f5
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SANDSTORM cp WEATHER_SANDSTORM
jr z, .Redundant jr z, .Redundant
jr .NotRedundant jr .NotRedundant
@@ -153,13 +153,13 @@ AI_Redundant: ; 2c41a
ret ret
.RainDance: ; 2c512 .RainDance: ; 2c512
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_RAIN cp WEATHER_RAIN
jr z, .Redundant jr z, .Redundant
jr .NotRedundant jr .NotRedundant
.SunnyDay: ; 2c51b .SunnyDay: ; 2c51b
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SUN cp WEATHER_SUN
jr z, .Redundant jr z, .Redundant
jr .NotRedundant jr .NotRedundant

View File

@@ -2842,7 +2842,7 @@ AI_Smart_Solarbeam: ; 3920b
; 80% chance to encourage this move when it's sunny. ; 80% chance to encourage this move when it's sunny.
; 90% chance to discourage this move when it's raining. ; 90% chance to discourage this move when it's raining.
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SUN cp WEATHER_SUN
jr z, .asm_3921e jr z, .asm_3921e
@@ -2870,7 +2870,7 @@ AI_Smart_Solarbeam: ; 3920b
AI_Smart_Thunder: ; 39225 AI_Smart_Thunder: ; 39225
; 90% chance to discourage this move when it's sunny. ; 90% chance to discourage this move when it's sunny.
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SUN cp WEATHER_SUN
ret nz ret nz

View File

@@ -4,7 +4,7 @@ DoBattle: ; 3c000
xor a xor a
ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsNotFainted], a
ld [wBattleParticipantsIncludingFainted], a ld [wBattleParticipantsIncludingFainted], a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ld [BattleEnded], a ld [BattleEnded], a
inc a inc a
ld [wBattleHasJustStarted], a ld [wBattleHasJustStarted], a
@@ -455,7 +455,7 @@ DetermineMoveOrder: ; 3c314
jr z, .use_move jr z, .use_move
sub BATTLEACTION_SWITCH1 sub BATTLEACTION_SWITCH1
jr c, .use_move jr c, .use_move
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
cp $2 cp $2
jr nz, .switch jr nz, .switch
ld a, [hSerialConnectionStatus] ld a, [hSerialConnectionStatus]
@@ -480,7 +480,7 @@ DetermineMoveOrder: ; 3c314
jp .enemy_first jp .enemy_first
.use_move .use_move
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
and a and a
jp nz, .player_first jp nz, .player_first
call CompareMovePriority call CompareMovePriority
@@ -623,7 +623,7 @@ ParsePlayerAction: ; 3c434
jr .encored jr .encored
.not_encored .not_encored
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
cp $2 cp $2
jr z, .reset_rage jr z, .reset_rage
and a and a
@@ -920,7 +920,7 @@ Battle_EnemyFirst: ; 3c5fe
jp z, HandlePlayerMonFaint jp z, HandlePlayerMonFaint
call RefreshBattleHuds call RefreshBattleHuds
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ret ret
; 3c664 ; 3c664
@@ -970,7 +970,7 @@ Battle_PlayerFirst: ; 3c664
jp z, HandleEnemyMonFaint jp z, HandleEnemyMonFaint
call RefreshBattleHuds call RefreshBattleHuds
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ret ret
; 3c6cf ; 3c6cf
@@ -1716,7 +1716,7 @@ HandleScreens: ; 3cb36
; 3cb9e ; 3cb9e
HandleWeather: ; 3cb9e HandleWeather: ; 3cb9e
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_NONE cp WEATHER_NONE
ret z ret z
@@ -1727,7 +1727,7 @@ HandleWeather: ; 3cb9e
ld hl, .WeatherMessages ld hl, .WeatherMessages
call .PrintWeatherMessage call .PrintWeatherMessage
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SANDSTORM cp WEATHER_SANDSTORM
ret nz ret nz
@@ -1790,11 +1790,11 @@ HandleWeather: ; 3cb9e
ld hl, .WeatherEndedMessages ld hl, .WeatherEndedMessages
call .PrintWeatherMessage call .PrintWeatherMessage
xor a xor a
ld [Weather], a ld [wBattleWeather], a
ret ret
.PrintWeatherMessage: .PrintWeatherMessage:
ld a, [Weather] ld a, [wBattleWeather]
dec a dec a
ld c, a ld c, a
ld b, 0 ld b, 0
@@ -2099,18 +2099,18 @@ HandleEnemyMonFaint: ; 3cd55
jp c, WildFled_EnemyFled_LinkBattleCanceled jp c, WildFled_EnemyFled_LinkBattleCanceled
ld a, $1 ld a, $1
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call HandleEnemySwitch call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled jp z, WildFled_EnemyFled_LinkBattleCanceled
jr DoubleSwitch jr DoubleSwitch
.player_mon_not_fainted .player_mon_not_fainted
ld a, $1 ld a, $1
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call HandleEnemySwitch call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled jp z, WildFled_EnemyFled_LinkBattleCanceled
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ret ret
; 3cdca ; 3cdca
@@ -2140,7 +2140,7 @@ DoubleSwitch: ; 3cdca
.done .done
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ret ret
; 3ce01 ; 3ce01
@@ -2173,7 +2173,7 @@ UpdateBattleStateAndExperienceAfterEnemyFaint: ; 3ce01
.wild2 .wild2
call StopDangerSound call StopDangerSound
ld a, $1 ld a, $1
ld [wDanger], a ld [wBattleLowHealthAlarm], a
.trainer .trainer
ld hl, BattleMonHP ld hl, BattleMonHP
@@ -2293,7 +2293,7 @@ IsAnyMonHoldingExpShare: ; 3ceaa
StopDangerSound: ; 3ceec StopDangerSound: ; 3ceec
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
ret ret
; 3cef1 ; 3cef1
@@ -2394,7 +2394,7 @@ EnemyPartyMonEntrance: ; 3cf78
call SpikesDamage call SpikesDamage
xor a xor a
ld [wEnemyMoveStruct + MOVE_ANIM], a ld [wEnemyMoveStruct + MOVE_ANIM], a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
inc a inc a
ret ret
; 3cfa4 ; 3cfa4
@@ -2403,7 +2403,7 @@ WinTrainerBattle: ; 3cfa4
; Player won the battle ; Player won the battle
call StopDangerSound call StopDangerSound
ld a, $1 ld a, $1
ld [wDanger], a ld [wBattleLowHealthAlarm], a
ld [BattleEnded], a ld [BattleEnded], a
ld a, [wLinkMode] ld a, [wLinkMode]
and a and a
@@ -2705,7 +2705,7 @@ HandlePlayerMonFaint: ; 3d14e
and a and a
ret nz ret nz
ld a, $1 ld a, $1
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call HandleEnemySwitch call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled jp z, WildFled_EnemyFled_LinkBattleCanceled
jp DoubleSwitch jp DoubleSwitch
@@ -2720,7 +2720,7 @@ PlayerMonFaintHappinessMod: ; 3d1aa
ld hl, EnemySubStatus3 ld hl, EnemySubStatus3
res SUBSTATUS_IN_LOOP, [hl] res SUBSTATUS_IN_LOOP, [hl]
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
ld hl, PlayerDamageTaken ld hl, PlayerDamageTaken
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
@@ -2788,12 +2788,12 @@ ForcePlayerMonChoice: ; 3d227
and a and a
jr z, .skip_link jr z, .skip_link
ld a, $1 ld a, $1
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call LinkBattleSendReceiveAction call LinkBattleSendReceiveAction
.skip_link .skip_link
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call CheckMobileBattleError call CheckMobileBattleError
jr c, .enemy_fainted_mobile_error jr c, .enemy_fainted_mobile_error
ld hl, EnemyMonHP ld hl, EnemyMonHP
@@ -3229,7 +3229,7 @@ EnemySwitch: ; 3d4e1
xor a xor a
ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsNotFainted], a
ld [wBattleParticipantsIncludingFainted], a ld [wBattleParticipantsIncludingFainted], a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
inc a inc a
ld [wEnemyIsSwitching], a ld [wEnemyIsSwitching], a
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
@@ -3883,7 +3883,7 @@ TryToRunAwayFromBattle: ; 3d8b3
cp b cp b
jr nc, .can_escape jr nc, .can_escape
ld a, $1 ld a, $1
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ld hl, BattleText_CantEscape2 ld hl, BattleText_CantEscape2
jr .print_inescapable_text jr .print_inescapable_text
@@ -3909,7 +3909,7 @@ TryToRunAwayFromBattle: ; 3d8b3
jr z, .fled jr z, .fled
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ld a, $f ld a, $f
ld [CurMoveNum], a ld [CurMoveNum], a
xor a xor a
@@ -4769,7 +4769,7 @@ CheckDanger: ; 3df9e
ld a, [hli] ld a, [hli]
or [hl] or [hl]
jr z, .no_danger jr z, .no_danger
ld a, [wDanger] ld a, [wBattleLowHealthAlarm]
and a and a
jr nz, .done jr nz, .done
ld a, [PlayerHPPal] ld a, [PlayerHPPal]
@@ -4777,12 +4777,12 @@ CheckDanger: ; 3df9e
jr z, .danger jr z, .danger
.no_danger .no_danger
ld hl, Danger ld hl, wLowHealthAlarm
res DANGER_ON_F, [hl] res DANGER_ON_F, [hl]
jr .done jr .done
.danger .danger
ld hl, Danger ld hl, wLowHealthAlarm
set DANGER_ON_F, [hl] set DANGER_ON_F, [hl]
.done .done
@@ -5116,7 +5116,7 @@ BattleMenu_Pack: ; 3e1c7
jr z, .contest jr z, .contest
farcall BattlePack farcall BattlePack
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
and a and a
jr z, .didnt_use_item jr z, .didnt_use_item
jr .got_item jr .got_item
@@ -5329,7 +5329,7 @@ TryPlayerSwitch: ; 3e358
ld a, [CurBattleMon] ld a, [CurBattleMon]
ld [LastPlayerMon], a ld [LastPlayerMon], a
ld a, $2 ld a, $2
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call ClearPalettes call ClearPalettes
call DelayFrame call DelayFrame
call ClearSprites call ClearSprites
@@ -5464,7 +5464,7 @@ BattleMenu_Run: ; 3e489
ld a, $0 ld a, $0
ld [wFailedToFlee], a ld [wFailedToFlee], a
ret c ret c
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
and a and a
ret nz ret nz
jp BattleMenu jp BattleMenu
@@ -5955,7 +5955,7 @@ ParseEnemyAction: ; 3e7c1
jr z, .not_linked jr z, .not_linked
call EmptyBattleTextBox call EmptyBattleTextBox
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
and a and a
call z, LinkBattleSendReceiveAction call z, LinkBattleSendReceiveAction
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
@@ -8560,7 +8560,7 @@ ExitBattle: ; 3f69e
CleanUpBattleRAM: ; 3f6d0 CleanUpBattleRAM: ; 3f6d0
call BattleEnd_HandleRoamMons call BattleEnd_HandleRoamMons
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
ld [wBattleMode], a ld [wBattleMode], a
ld [BattleType], a ld [BattleType], a
ld [AttackMissed], a ld [AttackMissed], a

View File

@@ -1,7 +1,7 @@
DoPlayerTurn: ; 34000 DoPlayerTurn: ; 34000
call SetPlayerTurn call SetPlayerTurn
ld a, [wPlayerAction] ld a, [wBattlePlayerAction]
and a and a
ret nz ret nz
@@ -1908,7 +1908,7 @@ BattleCommand_CheckHit: ; 34d32
cp EFFECT_THUNDER cp EFFECT_THUNDER
ret nz ret nz
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_RAIN cp WEATHER_RAIN
ret ret
@@ -5394,7 +5394,7 @@ BattleCommand_FreezeTarget: ; 36102
ld a, [TypeModifier] ld a, [TypeModifier]
and $7f and $7f
ret z ret z
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SUN cp WEATHER_SUN
ret z ret z
call CheckMoveTypeMatchesTarget ; Don't freeze an Ice-type call CheckMoveTypeMatchesTarget ; Don't freeze an Ice-type
@@ -9046,7 +9046,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
ret z ret z
ld a, 1 ld a, 1
ld [wPlayerAction], a ld [wBattlePlayerAction], a
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
ld hl, LinkBattleSendReceiveAction ld hl, LinkBattleSendReceiveAction
@@ -9054,7 +9054,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
call CloseWindow call CloseWindow
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ret ret
; 37a82 ; 37a82
@@ -9310,15 +9310,15 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e
; Don't factor in time of day in link battles. ; Don't factor in time of day in link battles.
ld a, [wLinkMode] ld a, [wLinkMode]
and a and a
jr nz, .Weather jr nz, .checkWeather
ld a, [TimeOfDay] ld a, [TimeOfDay]
cp b cp b
jr z, .Weather jr z, .checkWeather
dec c ; double dec c ; double
.Weather: .checkWeather:
ld a, [Weather] ld a, [wBattleWeather]
and a and a
jr z, .Heal jr z, .Heal
@@ -9384,7 +9384,7 @@ BattleCommand_HiddenPower: ; 37be8
BattleCommand_StartRain: ; 37bf4 BattleCommand_StartRain: ; 37bf4
; startrain ; startrain
ld a, WEATHER_RAIN ld a, WEATHER_RAIN
ld [Weather], a ld [wBattleWeather], a
ld a, 5 ld a, 5
ld [WeatherCount], a ld [WeatherCount], a
call AnimateCurrentMove call AnimateCurrentMove
@@ -9397,7 +9397,7 @@ BattleCommand_StartRain: ; 37bf4
BattleCommand_StartSun: ; 37c07 BattleCommand_StartSun: ; 37c07
; startsun ; startsun
ld a, WEATHER_SUN ld a, WEATHER_SUN
ld [Weather], a ld [wBattleWeather], a
ld a, 5 ld a, 5
ld [WeatherCount], a ld [WeatherCount], a
call AnimateCurrentMove call AnimateCurrentMove
@@ -9588,7 +9588,7 @@ BattleCommand_DoubleMinimizeDamage: ; 37ce6
BattleCommand_SkipSunCharge: ; 37d02 BattleCommand_SkipSunCharge: ; 37d02
; mimicsuncharge ; mimicsuncharge
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SUN cp WEATHER_SUN
ret nz ret nz
ld b, charge_command ld b, charge_command
@@ -9690,7 +9690,7 @@ BattleCommand_ThunderAccuracy: ; 37d94
ld a, BATTLE_VARS_MOVE_TYPE ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVarAddr call GetBattleVarAddr
inc hl inc hl
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_RAIN cp WEATHER_RAIN
jr z, .rain jr z, .rain
cp WEATHER_SUN cp WEATHER_SUN

View File

@@ -1,12 +1,12 @@
BattleCommand_StartSandstorm: ; 376f8 BattleCommand_StartSandstorm: ; 376f8
; startsandstorm ; startsandstorm
ld a, [Weather] ld a, [wBattleWeather]
cp WEATHER_SANDSTORM cp WEATHER_SANDSTORM
jr z, .failed jr z, .failed
ld a, WEATHER_SANDSTORM ld a, WEATHER_SANDSTORM
ld [Weather], a ld [wBattleWeather], a
ld a, 5 ld a, 5
ld [WeatherCount], a ld [WeatherCount], a
call AnimateCurrentMove call AnimateCurrentMove

View File

@@ -53,7 +53,7 @@ GetPlayerBackpicCoords: ; fbd9d (3e:7d9d)
DoWeatherModifiers: ; fbda4 DoWeatherModifiers: ; fbda4
ld de, .WeatherTypeModifiers ld de, .WeatherTypeModifiers
ld a, [Weather] ld a, [wBattleWeather]
ld b, a ld b, a
ld a, [wd265] ; move type ld a, [wd265] ; move type
ld c, a ld c, a

View File

@@ -150,7 +150,7 @@ PlayBattleMusic: ; 2ee6c
ClearBattleRAM: ; 2ef18 ClearBattleRAM: ; 2ef18
xor a xor a
ld [wPlayerAction], a ld [wBattlePlayerAction], a
ld [wBattleResult], a ld [wBattleResult], a
ld hl, wPartyMenuCursor ld hl, wPartyMenuCursor

View File

@@ -271,8 +271,8 @@ endr
ret ret
.delete .delete
ld hl, Sprites ld hl, wVirtualOAM
ld c, SpritesEnd - Sprites ld c, SpritesEnd - wVirtualOAM
xor a xor a
.loop2 .loop2
ld [hli], a ld [hli], a
@@ -1499,7 +1499,7 @@ BattleAnim_UpdateOAM_All: ; cc96e
jr nz, .loop jr nz, .loop
ld a, [wBattleAnimOAMPointerLo] ld a, [wBattleAnimOAMPointerLo]
ld l, a ld l, a
ld h, HIGH(Sprites) ld h, HIGH(wVirtualOAM)
.loop2 .loop2
ld a, l ld a, l
cp LOW(SpritesEnd) cp LOW(SpritesEnd)

View File

@@ -106,7 +106,7 @@ BattleAnimOAMUpdate: ; cca09
ld l, a ld l, a
ld a, [wBattleAnimOAMPointerLo] ld a, [wBattleAnimOAMPointerLo]
ld e, a ld e, a
ld d, HIGH(Sprites) ld d, HIGH(wVirtualOAM)
.loop .loop
ld a, [wBattleAnimTempYCoord] ld a, [wBattleAnimTempYCoord]
ld b, a ld b, a

View File

@@ -126,9 +126,9 @@ _CardFlip: ; e00ee (38:40ee)
; 0xe01d2 ; 0xe01d2
.DeductCoins: ; e01d2 .DeductCoins: ; e01d2
ld a, [Coins] ld a, [wCoins]
ld h, a ld h, a
ld a, [Coins + 1] ld a, [wCoins + 1]
ld l, a ld l, a
ld a, h ld a, h
and a and a
@@ -146,9 +146,9 @@ _CardFlip: ; e00ee (38:40ee)
ld de, -3 ld de, -3
add hl, de add hl, de
ld a, h ld a, h
ld [Coins], a ld [wCoins], a
ld a, l ld a, l
ld [Coins + 1], a ld [wCoins + 1], a
ld de, SFX_TRANSACTION ld de, SFX_TRANSACTION
call PlaySFX call PlaySFX
xor a xor a
@@ -535,7 +535,7 @@ CardFlip_PrintCoinBalance: ; e049c
ld de, .CoinStr ld de, .CoinStr
call PlaceString call PlaceString
hlcoord 15, 16 hlcoord 15, 16
ld de, Coins ld de, wCoins
lb bc, PRINTNUM_LEADINGZEROS | 2, 4 lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum call PrintNum
ret ret
@@ -1174,29 +1174,29 @@ CardFlip_CheckWinCondition: ; e0637
; 0xe081b ; 0xe081b
.AddCoinPlaySFX: ; e081b .AddCoinPlaySFX: ; e081b
ld a, [Coins] ld a, [wCoins]
ld h, a ld h, a
ld a, [Coins + 1] ld a, [wCoins + 1]
ld l, a ld l, a
inc hl inc hl
ld a, h ld a, h
ld [Coins], a ld [wCoins], a
ld a, l ld a, l
ld [Coins + 1], a ld [wCoins + 1], a
ld de, SFX_PAY_DAY ld de, SFX_PAY_DAY
call PlaySFX call PlaySFX
ret ret
; e0833 ; e0833
.IsCoinCaseFull: ; e0833 .IsCoinCaseFull: ; e0833
ld a, [Coins] ld a, [wCoins]
cp HIGH(MAX_COINS) cp HIGH(MAX_COINS)
jr c, .less jr c, .less
jr z, .check_low jr z, .check_low
jr .more jr .more
.check_low .check_low
ld a, [Coins + 1] ld a, [wCoins + 1]
cp LOW(MAX_COINS) cp LOW(MAX_COINS)
jr c, .less jr c, .less

View File

@@ -1029,7 +1029,7 @@ Function81f5e: ; 81f5e
ld [hl], $ed ld [hl], $ed
ld b, $70 ld b, $70
ld c, $5 ld c, $5
ld hl, Sprites ld hl, wVirtualOAM
ld de, wc608 + 10 ld de, wc608 + 10
call .asm_81fb7 call .asm_81fb7
ld de, wc608 + 11 ld de, wc608 + 11

View File

@@ -1,8 +1,8 @@
InitDecorations: ; 26751 (9:6751) InitDecorations: ; 26751 (9:6751)
ld a, DECO_FEATHERY_BED ld a, DECO_FEATHERY_BED
ld [Bed], a ld [wDecoBed], a
ld a, DECO_TOWN_MAP ld a, DECO_TOWN_MAP
ld [Poster], a ld [wDecoPoster], a
ret ret
_KrisDecorationMenu: ; 0x2675c _KrisDecorationMenu: ; 0x2675c
@@ -645,62 +645,62 @@ DecoAction_nothing: ; 26ce3
; 26ce5 ; 26ce5
DecoAction_setupbed: ; 26ce5 DecoAction_setupbed: ; 26ce5
ld hl, Bed ld hl, wDecoBed
jp DecoAction_TrySetItUp jp DecoAction_TrySetItUp
; 26ceb ; 26ceb
DecoAction_putawaybed: ; 26ceb DecoAction_putawaybed: ; 26ceb
ld hl, Bed ld hl, wDecoBed
jp DecoAction_TryPutItAway jp DecoAction_TryPutItAway
; 26cf1 ; 26cf1
DecoAction_setupcarpet: ; 26cf1 DecoAction_setupcarpet: ; 26cf1
ld hl, Carpet ld hl, wDecoCarpet
jp DecoAction_TrySetItUp jp DecoAction_TrySetItUp
; 26cf7 ; 26cf7
DecoAction_putawaycarpet: ; 26cf7 DecoAction_putawaycarpet: ; 26cf7
ld hl, Carpet ld hl, wDecoCarpet
jp DecoAction_TryPutItAway jp DecoAction_TryPutItAway
; 26cfd ; 26cfd
DecoAction_setupplant: ; 26cfd DecoAction_setupplant: ; 26cfd
ld hl, Plant ld hl, wDecoPlant
jp DecoAction_TrySetItUp jp DecoAction_TrySetItUp
; 26d03 ; 26d03
DecoAction_putawayplant: ; 26d03 DecoAction_putawayplant: ; 26d03
ld hl, Plant ld hl, wDecoPlant
jp DecoAction_TryPutItAway jp DecoAction_TryPutItAway
; 26d09 ; 26d09
DecoAction_setupposter: ; 26d09 DecoAction_setupposter: ; 26d09
ld hl, Poster ld hl, wDecoPoster
jp DecoAction_TrySetItUp jp DecoAction_TrySetItUp
; 26d0f ; 26d0f
DecoAction_putawayposter: ; 26d0f DecoAction_putawayposter: ; 26d0f
ld hl, Poster ld hl, wDecoPoster
jp DecoAction_TryPutItAway jp DecoAction_TryPutItAway
; 26d15 ; 26d15
DecoAction_setupconsole: ; 26d15 DecoAction_setupconsole: ; 26d15
ld hl, Console ld hl, wDecoConsole
jp DecoAction_TrySetItUp jp DecoAction_TrySetItUp
; 26d1b ; 26d1b
DecoAction_putawayconsole: ; 26d1b DecoAction_putawayconsole: ; 26d1b
ld hl, Console ld hl, wDecoConsole
jp DecoAction_TryPutItAway jp DecoAction_TryPutItAway
; 26d21 ; 26d21
DecoAction_setupbigdoll: ; 26d21 DecoAction_setupbigdoll: ; 26d21
ld hl, BigDoll ld hl, wDecoBigDoll
jp DecoAction_TrySetItUp jp DecoAction_TrySetItUp
; 26d27 ; 26d27
DecoAction_putawaybigdoll: ; 26d27 DecoAction_putawaybigdoll: ; 26d27
ld hl, BigDoll ld hl, wDecoBigDoll
jp DecoAction_TryPutItAway jp DecoAction_TryPutItAway
; 26d2d ; 26d2d
@@ -935,8 +935,8 @@ DecoAction_AskWhichSide: ; 26e70
; 26e9a ; 26e9a
QueryWhichSide: ; 26e9a QueryWhichSide: ; 26e9a
ld hl, RightOrnament ld hl, wDecoRightOrnament
ld de, LeftOrnament ld de, wDecoLeftOrnament
ld a, [Buffer2] ld a, [Buffer2]
cp 1 cp 1
ret z ret z
@@ -1072,7 +1072,7 @@ DescribeDecoration:: ; 26f59
; 26f69 ; 26f69
DecorationDesc_Poster: ; 26f69 DecorationDesc_Poster: ; 26f69
ld a, [Poster] ld a, [wDecoPoster]
ld hl, DecorationDesc_PosterPointers ld hl, DecorationDesc_PosterPointers
ld de, 3 ld de, 3
call IsInArray call IsInArray
@@ -1148,15 +1148,15 @@ DecorationDesc_NullPoster: ; 26fb8
; 26fb9 ; 26fb9
DecorationDesc_LeftOrnament: ; 26fb9 DecorationDesc_LeftOrnament: ; 26fb9
ld a, [LeftOrnament] ld a, [wDecoLeftOrnament]
jr DecorationDesc_OrnamentOrConsole jr DecorationDesc_OrnamentOrConsole
DecorationDesc_RightOrnament: ; 26fbe DecorationDesc_RightOrnament: ; 26fbe
ld a, [RightOrnament] ld a, [wDecoRightOrnament]
jr DecorationDesc_OrnamentOrConsole jr DecorationDesc_OrnamentOrConsole
DecorationDesc_Console: ; 26fc3 DecorationDesc_Console: ; 26fc3
ld a, [Console] ld a, [wDecoConsole]
jr DecorationDesc_OrnamentOrConsole jr DecorationDesc_OrnamentOrConsole
DecorationDesc_OrnamentOrConsole: ; 26fc8 DecorationDesc_OrnamentOrConsole: ; 26fc8
@@ -1196,18 +1196,18 @@ DecorationDesc_GiantOrnament: ; 26fdd
Special_ToggleMaptileDecorations: ; 26feb Special_ToggleMaptileDecorations: ; 26feb
lb de, 0, 4 lb de, 0, 4
ld a, [Bed] ld a, [wDecoBed]
call SetDecorationTile call SetDecorationTile
lb de, 7, 4 lb de, 7, 4
ld a, [Plant] ld a, [wDecoPlant]
call SetDecorationTile call SetDecorationTile
lb de, 6, 0 lb de, 6, 0
ld a, [Poster] ld a, [wDecoPoster]
call SetDecorationTile call SetDecorationTile
call SetPosterVisibility call SetPosterVisibility
lb de, 0, 0 lb de, 0, 0
call PadCoords_de call PadCoords_de
ld a, [Carpet] ld a, [wDecoCarpet]
and a and a
ret z ret z
call _GetDecorationSprite call _GetDecorationSprite
@@ -1227,7 +1227,7 @@ Special_ToggleMaptileDecorations: ; 26feb
SetPosterVisibility: ; 27027 SetPosterVisibility: ; 27027
ld b, SET_FLAG ld b, SET_FLAG
ld a, [Poster] ld a, [wDecoPoster]
and a and a
jr nz, .ok jr nz, .ok
ld b, RESET_FLAG ld b, RESET_FLAG
@@ -1251,19 +1251,19 @@ SetDecorationTile: ; 27037
Special_ToggleDecorationsVisibility: ; 27043 Special_ToggleDecorationsVisibility: ; 27043
ld de, EVENT_KRISS_HOUSE_2F_CONSOLE ld de, EVENT_KRISS_HOUSE_2F_CONSOLE
ld hl, VariableSprites + SPRITE_CONSOLE - SPRITE_VARS ld hl, VariableSprites + SPRITE_CONSOLE - SPRITE_VARS
ld a, [Console] ld a, [wDecoConsole]
call ToggleDecorationVisibility call ToggleDecorationVisibility
ld de, EVENT_KRISS_HOUSE_2F_DOLL_1 ld de, EVENT_KRISS_HOUSE_2F_DOLL_1
ld hl, VariableSprites + SPRITE_DOLL_1 - SPRITE_VARS ld hl, VariableSprites + SPRITE_DOLL_1 - SPRITE_VARS
ld a, [LeftOrnament] ld a, [wDecoLeftOrnament]
call ToggleDecorationVisibility call ToggleDecorationVisibility
ld de, EVENT_KRISS_HOUSE_2F_DOLL_2 ld de, EVENT_KRISS_HOUSE_2F_DOLL_2
ld hl, VariableSprites + SPRITE_DOLL_2 - SPRITE_VARS ld hl, VariableSprites + SPRITE_DOLL_2 - SPRITE_VARS
ld a, [RightOrnament] ld a, [wDecoRightOrnament]
call ToggleDecorationVisibility call ToggleDecorationVisibility
ld de, EVENT_KRISS_HOUSE_2F_BIG_DOLL ld de, EVENT_KRISS_HOUSE_2F_BIG_DOLL
ld hl, VariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS ld hl, VariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS
ld a, [BigDoll] ld a, [wDecoBigDoll]
call ToggleDecorationVisibility call ToggleDecorationVisibility
ret ret
; 27074 ; 27074

View File

@@ -44,7 +44,7 @@ EvolutionAnimation: ; 4e5e1
call Request2bpp call Request2bpp
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
call WaitBGMap call WaitBGMap
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a

View File

@@ -106,8 +106,8 @@ ResetWRAM: ; 5ba7
_ResetWRAM: ; 5bae _ResetWRAM: ; 5bae
ld hl, Sprites ld hl, wVirtualOAM
ld bc, Options - Sprites ld bc, Options - wVirtualOAM
xor a xor a
call ByteFill call ByteFill
@@ -196,8 +196,8 @@ _ResetWRAM: ; 5bae
ld [wJohtoBadges], a ld [wJohtoBadges], a
ld [wKantoBadges], a ld [wKantoBadges], a
ld [Coins], a ld [wCoins], a
ld [Coins + 1], a ld [wCoins + 1], a
if START_MONEY >= $10000 if START_MONEY >= $10000
ld a, HIGH(START_MONEY >> 8) ld a, HIGH(START_MONEY >> 8)

View File

@@ -1658,7 +1658,7 @@ RevivePokemon: ; f0d6
.skip_to_revive .skip_to_revive
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
ld a, [CurItem] ld a, [CurItem]
cp REVIVE cp REVIVE
jr z, .revive_half_hp jr z, .revive_half_hp
@@ -1701,7 +1701,7 @@ FullRestore: ; f128
.FullRestore: ; f144 .FullRestore: ; f144
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
call ReviveFullHP call ReviveFullHP
ld a, MON_STATUS ld a, MON_STATUS
call GetPartyParamLocation call GetPartyParamLocation
@@ -1798,7 +1798,7 @@ ItemRestoreHP: ; f1a9 (3:71a9)
ret nc ret nc
xor a xor a
ld [Danger], a ld [wLowHealthAlarm], a
call GetHealingItemAmount call GetHealingItemAmount
call RestoreHealth call RestoreHealth
call BattlemonRestoreHealth call BattlemonRestoreHealth
@@ -2357,7 +2357,7 @@ PokeFlute: ; f50c
ld hl, .PlayedTheFlute ld hl, .PlayedTheFlute
call PrintText call PrintText
ld a, [Danger] ld a, [wLowHealthAlarm]
and 1 << DANGER_ON_F and 1 << DANGER_ON_F
jr nz, .dummy2 jr nz, .dummy2
.dummy2 .dummy2

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