Rename wVramState to wStateFlags and use flag constants (#1078)
This commit is contained in:
@@ -91,6 +91,12 @@ DEF RIGHT_MASK EQU 1 << RIGHT
|
|||||||
shift_const FACE_RIGHT ; 1
|
shift_const FACE_RIGHT ; 1
|
||||||
DEF FACE_CURRENT EQU 0
|
DEF FACE_CURRENT EQU 0
|
||||||
|
|
||||||
|
; wStateFlags
|
||||||
|
DEF SPRITE_UPDATES_DISABLED_F EQU 0
|
||||||
|
DEF LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F EQU 1
|
||||||
|
DEF TEXT_STATE_F EQU 6
|
||||||
|
DEF SCRIPTED_MOVEMENT_STATE_F EQU 7
|
||||||
|
|
||||||
; wPokemonWithdrawDepositParameter::
|
; wPokemonWithdrawDepositParameter::
|
||||||
DEF PC_WITHDRAW EQU 0
|
DEF PC_WITHDRAW EQU 0
|
||||||
DEF PC_DEPOSIT EQU 1
|
DEF PC_DEPOSIT EQU 1
|
||||||
|
@@ -8,10 +8,10 @@ INCBIN "gfx/tilesets/forest-tree/4.2bpp"
|
|||||||
|
|
||||||
CelebiShrineEvent:
|
CelebiShrineEvent:
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
call LoadCelebiGFX
|
call LoadCelebiGFX
|
||||||
depixel 0, 10, 7, 0
|
depixel 0, 10, 7, 0
|
||||||
ld a, SPRITE_ANIM_OBJ_CELEBI
|
ld a, SPRITE_ANIM_OBJ_CELEBI
|
||||||
@@ -49,7 +49,7 @@ CelebiShrineEvent:
|
|||||||
|
|
||||||
.done
|
.done
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
call .RestorePlayerSprite_DespawnLeaves
|
call .RestorePlayerSprite_DespawnLeaves
|
||||||
call CelebiEvent_SetBattleType
|
call CelebiEvent_SetBattleType
|
||||||
ret
|
ret
|
||||||
|
@@ -298,10 +298,10 @@ Cut_Headbutt_GetPixelFacing:
|
|||||||
|
|
||||||
FlyFromAnim:
|
FlyFromAnim:
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
call FlyFunction_InitGFX
|
call FlyFunction_InitGFX
|
||||||
depixel 10, 10, 4, 0
|
depixel 10, 10, 4, 0
|
||||||
ld a, SPRITE_ANIM_OBJ_RED_WALK
|
ld a, SPRITE_ANIM_OBJ_RED_WALK
|
||||||
@@ -327,15 +327,15 @@ FlyFromAnim:
|
|||||||
|
|
||||||
.exit
|
.exit
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
FlyToAnim:
|
FlyToAnim:
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
call FlyFunction_InitGFX
|
call FlyFunction_InitGFX
|
||||||
depixel 31, 10, 4, 0
|
depixel 31, 10, 4, 0
|
||||||
ld a, SPRITE_ANIM_OBJ_RED_WALK
|
ld a, SPRITE_ANIM_OBJ_RED_WALK
|
||||||
@@ -364,7 +364,7 @@ FlyToAnim:
|
|||||||
|
|
||||||
.exit
|
.exit
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
call .RestorePlayerSprite_DespawnLeaves
|
call .RestorePlayerSprite_DespawnLeaves
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ RedCredits::
|
|||||||
ld [wMusicFade], a
|
ld [wMusicFade], a
|
||||||
farcall FadeOutToWhite
|
farcall FadeOutToWhite
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
farcall InitDisplayForRedCredits
|
farcall InitDisplayForRedCredits
|
||||||
ld c, 8
|
ld c, 8
|
||||||
@@ -65,7 +65,7 @@ HallOfFame_FadeOutMusic:
|
|||||||
ld [wMusicFade], a
|
ld [wMusicFade], a
|
||||||
farcall FadeOutToWhite
|
farcall FadeOutToWhite
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
farcall InitDisplayForHallOfFame
|
farcall InitDisplayForHallOfFame
|
||||||
ld c, 100
|
ld c, 100
|
||||||
|
@@ -693,8 +693,8 @@ _ExitMenu::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
RestoreOverworldMapTiles: ; unreferenced
|
RestoreOverworldMapTiles: ; unreferenced
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
bit 0, a
|
bit SPRITE_UPDATES_DISABLED_F, a
|
||||||
ret z
|
ret z
|
||||||
xor a ; sScratch
|
xor a ; sScratch
|
||||||
call OpenSRAM
|
call OpenSRAM
|
||||||
|
@@ -9,10 +9,10 @@
|
|||||||
const TRAINERCARDSTATE_QUIT ; 6
|
const TRAINERCARDSTATE_QUIT ; 6
|
||||||
|
|
||||||
TrainerCard:
|
TrainerCard:
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
@@ -35,7 +35,7 @@ TrainerCard:
|
|||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.InitRAM:
|
.InitRAM:
|
||||||
|
@@ -128,10 +128,10 @@ RunTradeAnimScript:
|
|||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 0, [hl]
|
res SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
@@ -148,7 +148,7 @@ RunTradeAnimScript:
|
|||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ret
|
ret
|
||||||
|
@@ -17,8 +17,8 @@ ReanchorBGMap_NoOAMUpdate::
|
|||||||
pop af
|
pop af
|
||||||
ldh [hOAMUpdate], a
|
ldh [hOAMUpdate], a
|
||||||
|
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
set 6, [hl]
|
set TEXT_STATE_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.ReanchorBGMap:
|
.ReanchorBGMap:
|
||||||
|
@@ -2167,8 +2167,8 @@ CopyTempObjectData:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
UpdateAllObjectsFrozen::
|
UpdateAllObjectsFrozen::
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
bit 0, a
|
bit SPRITE_UPDATES_DISABLED_F, a
|
||||||
ret z
|
ret z
|
||||||
ld bc, wObjectStructs
|
ld bc, wObjectStructs
|
||||||
xor a
|
xor a
|
||||||
@@ -2728,8 +2728,8 @@ ResetObject:
|
|||||||
db SPRITEMOVEDATA_STANDING_RIGHT
|
db SPRITEMOVEDATA_STANDING_RIGHT
|
||||||
|
|
||||||
_UpdateSprites::
|
_UpdateSprites::
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
bit 0, a
|
bit SPRITE_UPDATES_DISABLED_F, a
|
||||||
ret z
|
ret z
|
||||||
xor a
|
xor a
|
||||||
ldh [hUsedSpriteIndex], a
|
ldh [hUsedSpriteIndex], a
|
||||||
@@ -2744,8 +2744,8 @@ _UpdateSprites::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.fill
|
.fill
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
bit 1, a
|
bit LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, a
|
||||||
ld b, NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH
|
ld b, NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH
|
||||||
jr z, .ok
|
jr z, .ok
|
||||||
ld b, (NUM_SPRITE_OAM_STRUCTS - 12) * SPRITEOAMSTRUCT_LENGTH
|
ld b, (NUM_SPRITE_OAM_STRUCTS - 12) * SPRITEOAMSTRUCT_LENGTH
|
||||||
|
@@ -205,8 +205,8 @@ Movement_step_end:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], $0
|
ld [hl], $0
|
||||||
|
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 7, [hl]
|
res SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
|
|
||||||
ld hl, OBJECT_STEP_TYPE
|
ld hl, OBJECT_STEP_TYPE
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@@ -232,8 +232,8 @@ Movement_48:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_SLEEP
|
ld [hl], STEP_TYPE_SLEEP
|
||||||
|
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 7, [hl]
|
res SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Movement_remove_object:
|
Movement_remove_object:
|
||||||
@@ -245,8 +245,8 @@ Movement_remove_object:
|
|||||||
ld [hl], -1
|
ld [hl], -1
|
||||||
|
|
||||||
.not_leading
|
.not_leading
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 7, [hl]
|
res SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Movement_4b:
|
Movement_4b:
|
||||||
@@ -258,8 +258,8 @@ Movement_4b:
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_STANDING
|
ld [hl], STEP_TYPE_STANDING
|
||||||
|
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 7, [hl]
|
res SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Movement_step_sleep_1:
|
Movement_step_sleep_1:
|
||||||
|
@@ -153,8 +153,8 @@ CopyObjectStruct::
|
|||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
call CopyMapObjectToObjectStruct
|
call CopyMapObjectToObjectStruct
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
bit 7, [hl]
|
bit SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
ld hl, OBJECT_FLAGS2
|
ld hl, OBJECT_FLAGS2
|
||||||
|
@@ -44,8 +44,8 @@ WaitScript:
|
|||||||
WaitScriptMovement:
|
WaitScriptMovement:
|
||||||
call StopScript
|
call StopScript
|
||||||
|
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
bit 7, [hl]
|
bit SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
farcall UnfreezeAllObjects
|
farcall UnfreezeAllObjects
|
||||||
@@ -925,8 +925,8 @@ ApplyObjectFacing:
|
|||||||
pop de
|
pop de
|
||||||
ld a, e
|
ld a, e
|
||||||
call SetSpriteDirection
|
call SetSpriteDirection
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
bit 6, [hl]
|
bit TEXT_STATE_F, [hl]
|
||||||
jr nz, .text_state
|
jr nz, .text_state
|
||||||
call .DisableTextTiles
|
call .DisableTextTiles
|
||||||
.text_state
|
.text_state
|
||||||
|
@@ -226,9 +226,9 @@ EnterMapWarp:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
LoadMapTimeOfDay:
|
LoadMapTimeOfDay:
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 6, [hl]
|
res TEXT_STATE_F, [hl]
|
||||||
ld a, $1
|
ld a, TRUE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
farcall ReplaceTimeOfDayPals
|
farcall ReplaceTimeOfDayPals
|
||||||
farcall UpdateTimeOfDayPal
|
farcall UpdateTimeOfDayPal
|
||||||
@@ -321,8 +321,8 @@ RefreshMapSprites:
|
|||||||
ld hl, wPlayerSpriteSetupFlags
|
ld hl, wPlayerSpriteSetupFlags
|
||||||
bit PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
|
bit PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
|
||||||
jr nz, .skip
|
jr nz, .skip
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
set 0, [hl]
|
set SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
call SafeUpdateSprites
|
call SafeUpdateSprites
|
||||||
.skip
|
.skip
|
||||||
ld a, [wPlayerSpriteSetupFlags]
|
ld a, [wPlayerSpriteSetupFlags]
|
||||||
|
@@ -3,7 +3,7 @@ PhoneRing_CopyTilemapAtOnce:
|
|||||||
and a
|
and a
|
||||||
jp z, WaitBGMap
|
jp z, WaitBGMap
|
||||||
ld a, [wSpriteUpdatesEnabled]
|
ld a, [wSpriteUpdatesEnabled]
|
||||||
cp $0
|
cp FALSE
|
||||||
jp z, WaitBGMap
|
jp z, WaitBGMap
|
||||||
|
|
||||||
; The following is a modified version of _CopyTilemapAtOnce
|
; The following is a modified version of _CopyTilemapAtOnce
|
||||||
|
@@ -30,10 +30,10 @@ Pokedex:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
set NO_TEXT_SCROLL, [hl]
|
set NO_TEXT_SCROLL, [hl]
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh a, [hInMenu]
|
ldh a, [hInMenu]
|
||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@@ -64,7 +64,7 @@ Pokedex:
|
|||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
pop af
|
pop af
|
||||||
|
@@ -33,10 +33,10 @@ PokeGear:
|
|||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
call .InitTilemap
|
call .InitTilemap
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
.loop
|
.loop
|
||||||
@@ -55,7 +55,7 @@ PokeGear:
|
|||||||
call PlaySFX
|
call PlaySFX
|
||||||
call WaitSFX
|
call WaitSFX
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
@@ -1764,10 +1764,10 @@ _TownMap:
|
|||||||
ld a, $1
|
ld a, $1
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
|
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
|
|
||||||
call ClearBGPalettes
|
call ClearBGPalettes
|
||||||
call ClearTilemap
|
call ClearTilemap
|
||||||
@@ -1819,7 +1819,7 @@ _TownMap:
|
|||||||
|
|
||||||
.resume
|
.resume
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
|
@@ -3,10 +3,10 @@ _DepositPKMN:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
set NO_TEXT_SCROLL, [hl]
|
set NO_TEXT_SCROLL, [hl]
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh a, [hInMenu]
|
ldh a, [hInMenu]
|
||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@@ -30,7 +30,7 @@ _DepositPKMN:
|
|||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
ret
|
ret
|
||||||
@@ -259,10 +259,10 @@ _WithdrawPKMN:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
set NO_TEXT_SCROLL, [hl]
|
set NO_TEXT_SCROLL, [hl]
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh a, [hInMenu]
|
ldh a, [hInMenu]
|
||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@@ -286,7 +286,7 @@ _WithdrawPKMN:
|
|||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
ret
|
ret
|
||||||
@@ -497,10 +497,10 @@ _MovePKMNWithoutMail:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
set NO_TEXT_SCROLL, [hl]
|
set NO_TEXT_SCROLL, [hl]
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh a, [hInMenu]
|
ldh a, [hInMenu]
|
||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@@ -527,7 +527,7 @@ _MovePKMNWithoutMail:
|
|||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
ret
|
ret
|
||||||
|
@@ -358,8 +358,8 @@ HatchEggs:
|
|||||||
; Huh? @ @
|
; Huh? @ @
|
||||||
text_far Text_BreedHuh
|
text_far Text_BreedHuh
|
||||||
text_asm
|
text_asm
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 0, [hl]
|
res SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
|
@@ -8,7 +8,7 @@ InitClock:
|
|||||||
ld a, $1
|
ld a, $1
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
|
|
||||||
ld a, $0
|
ld a, FALSE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
ld a, $10
|
ld a, $10
|
||||||
ld [wMusicFade], a
|
ld [wMusicFade], a
|
||||||
|
@@ -1941,7 +1941,7 @@ FinishExitMenu::
|
|||||||
|
|
||||||
ReturnToMapWithSpeechTextbox::
|
ReturnToMapWithSpeechTextbox::
|
||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, TRUE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
call ClearBGPalettes
|
call ClearBGPalettes
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
@@ -1949,8 +1949,8 @@ ReturnToMapWithSpeechTextbox::
|
|||||||
hlcoord 0, 12
|
hlcoord 0, 12
|
||||||
lb bc, 4, 18
|
lb bc, 4, 18
|
||||||
call Textbox
|
call Textbox
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
set 0, [hl]
|
set SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
call WaitBGMap2
|
call WaitBGMap2
|
||||||
ld b, SCGB_MAPPALS
|
ld b, SCGB_MAPPALS
|
||||||
|
@@ -412,8 +412,8 @@ LoadMovementDataPointer::
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
ld [hl], STEP_TYPE_RESET
|
ld [hl], STEP_TYPE_RESET
|
||||||
|
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
set 7, [hl]
|
set SCRIPTED_MOVEMENT_STATE_F, [hl]
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -574,19 +574,19 @@ _GetMovementIndex::
|
|||||||
ld a, h
|
ld a, h
|
||||||
ret
|
ret
|
||||||
|
|
||||||
SetVramState_Bit0:: ; unreferenced
|
SetVramState_SpriteUpdatesDisabled:: ; unreferenced
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
set 0, [hl]
|
set SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
ResetVramState_Bit0:: ; unreferenced
|
ResetVramState_SpriteUpdatesDisabled:: ; unreferenced
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 0, [hl]
|
res SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
UpdateSprites::
|
UpdateSprites::
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
bit 0, a
|
bit SPRITE_UPDATES_DISABLED_F, a
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
farcall UpdateAllObjectsFrozen
|
farcall UpdateAllObjectsFrozen
|
||||||
|
@@ -17,8 +17,8 @@ ScrollingMenu::
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.UpdatePalettes:
|
.UpdatePalettes:
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
bit 0, [hl]
|
bit SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
jp nz, UpdateTimePals
|
jp nz, UpdateTimePals
|
||||||
jp SetDefaultBGPAndOBP
|
jp SetDefaultBGPAndOBP
|
||||||
|
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
DisableSpriteUpdates::
|
DisableSpriteUpdates::
|
||||||
xor a
|
xor a
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
res 0, a
|
res SPRITE_UPDATES_DISABLED_F, a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ld a, $0
|
ld a, FALSE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EnableSpriteUpdates::
|
EnableSpriteUpdates::
|
||||||
ld a, $1
|
ld a, TRUE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
set 0, a
|
set SPRITE_UPDATES_DISABLED_F, a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ld a, $1
|
ld a, TRUE
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ret
|
ret
|
||||||
|
@@ -37,7 +37,7 @@ ApplyTilemap::
|
|||||||
jr z, .dmg
|
jr z, .dmg
|
||||||
|
|
||||||
ld a, [wSpriteUpdatesEnabled]
|
ld a, [wSpriteUpdatesEnabled]
|
||||||
cp 0
|
cp FALSE
|
||||||
jr z, .dmg
|
jr z, .dmg
|
||||||
|
|
||||||
ld a, 1
|
ld a, 1
|
||||||
|
@@ -3,14 +3,14 @@ UpdateTimeAndPals::
|
|||||||
|
|
||||||
; rtc enabled?
|
; rtc enabled?
|
||||||
ld a, [wSpriteUpdatesEnabled]
|
ld a, [wSpriteUpdatesEnabled]
|
||||||
cp 0
|
cp FALSE
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
call UpdateTime
|
call UpdateTime
|
||||||
|
|
||||||
; obj update on?
|
; obj update on?
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
bit 0, a ; obj update
|
bit SPRITE_UPDATES_DISABLED_F, a ; obj update
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
TimeOfDayPals::
|
TimeOfDayPals::
|
||||||
|
@@ -23,8 +23,8 @@ CloseText::
|
|||||||
|
|
||||||
pop af
|
pop af
|
||||||
ldh [hOAMUpdate], a
|
ldh [hOAMUpdate], a
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 6, [hl]
|
res TEXT_STATE_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.CloseText:
|
.CloseText:
|
||||||
|
@@ -143,12 +143,12 @@ Function891fe:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
Mobile_EnableSpriteUpdates:
|
Mobile_EnableSpriteUpdates:
|
||||||
ld a, 1
|
ld a, TRUE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Mobile_DisableSpriteUpdates:
|
Mobile_DisableSpriteUpdates:
|
||||||
ld a, 0
|
ld a, FALSE
|
||||||
ld [wSpriteUpdatesEnabled], a
|
ld [wSpriteUpdatesEnabled], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -40,15 +40,15 @@ Function100022:
|
|||||||
farcall Stubbed_Function106462
|
farcall Stubbed_Function106462
|
||||||
farcall Function106464 ; load broken gfx
|
farcall Function106464 ; load broken gfx
|
||||||
farcall Function11615a ; init RAM
|
farcall Function11615a ; init RAM
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
set 1, [hl]
|
set LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Function100057:
|
Function100057:
|
||||||
call DisableMobile
|
call DisableMobile
|
||||||
call ReturnToMapFromSubmenu
|
call ReturnToMapFromSubmenu
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
res 1, [hl]
|
res LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
SetRAMStateForMobile:
|
SetRAMStateForMobile:
|
||||||
|
@@ -95,10 +95,10 @@ RunMobileTradeAnim_Frontpics:
|
|||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 0, [hl]
|
res SPRITE_UPDATES_DISABLED_F, [hl]
|
||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
@@ -110,7 +110,7 @@ RunMobileTradeAnim_Frontpics:
|
|||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ret
|
ret
|
||||||
@@ -124,7 +124,7 @@ RunMobileTradeAnim_NoFrontpics:
|
|||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 0, [hl]
|
res 0, [hl]
|
||||||
@@ -139,7 +139,7 @@ RunMobileTradeAnim_NoFrontpics:
|
|||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ldh [hMapAnims], a
|
ldh [hMapAnims], a
|
||||||
ret
|
ret
|
||||||
|
@@ -463,10 +463,10 @@ BattleTowerRoomMenu_InitRAM:
|
|||||||
ld [wc3ed], a
|
ld [wc3ed], a
|
||||||
ld [wc3ee], a
|
ld [wc3ee], a
|
||||||
ld [wc3ef], a
|
ld [wc3ef], a
|
||||||
ld hl, wVramState
|
ld hl, wStateFlags
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcd7f], a
|
ld [wcd7f], a
|
||||||
set 1, [hl]
|
set LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, [hl]
|
||||||
ld a, (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
|
ld a, (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
|
||||||
ldh [rIE], a
|
ldh [rIE], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@@ -508,7 +508,7 @@ BattleTowerRoomMenu_Cleanup:
|
|||||||
ldh [rIE], a
|
ldh [rIE], a
|
||||||
ei
|
ei
|
||||||
ld a, [wcd7f]
|
ld a, [wcd7f]
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ld a, [wMobileErrorCodeBuffer]
|
ld a, [wMobileErrorCodeBuffer]
|
||||||
ld [wScriptVar], a
|
ld [wScriptVar], a
|
||||||
ret
|
ret
|
||||||
@@ -5535,10 +5535,10 @@ Function11ac51:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
set 4, [hl]
|
set 4, [hl]
|
||||||
ld a, [wVramState]
|
ld a, [wStateFlags]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
ldh a, [hInMenu]
|
ldh a, [hInMenu]
|
||||||
push af
|
push af
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@@ -5571,7 +5571,7 @@ Function11ac51:
|
|||||||
pop af
|
pop af
|
||||||
ldh [hInMenu], a
|
ldh [hInMenu], a
|
||||||
pop af
|
pop af
|
||||||
ld [wVramState], a
|
ld [wStateFlags], a
|
||||||
pop af
|
pop af
|
||||||
ld [wOptions], a
|
ld [wOptions], a
|
||||||
ret
|
ret
|
||||||
|
@@ -2304,12 +2304,11 @@ wBattlePlayerAction::
|
|||||||
wSolvedUnownPuzzle::
|
wSolvedUnownPuzzle::
|
||||||
db
|
db
|
||||||
|
|
||||||
wVramState::
|
wStateFlags::
|
||||||
; bit 0: overworld sprite updating on/off
|
; bit 0: overworld sprite updating on/off
|
||||||
; bit 1: something to do with sprite updates
|
; bit 1: last 12 sprite OAM structs reserved
|
||||||
; bit 6: something to do with text
|
; bit 6: in text state
|
||||||
; bit 7: on when surf initiates
|
; bit 7: in scripted movement
|
||||||
; flickers when climbing waterfall
|
|
||||||
db
|
db
|
||||||
|
|
||||||
wBattleResult::
|
wBattleResult::
|
||||||
|
Reference in New Issue
Block a user