diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index fd949405090..8f4bbab9a8b 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -91,6 +91,12 @@ DEF RIGHT_MASK EQU 1 << RIGHT shift_const FACE_RIGHT ; 1 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:: DEF PC_WITHDRAW EQU 0 DEF PC_DEPOSIT EQU 1 diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm index 6e4f8983e3b..582bb10d6a0 100644 --- a/engine/events/celebi.asm +++ b/engine/events/celebi.asm @@ -8,10 +8,10 @@ INCBIN "gfx/tilesets/forest-tree/4.2bpp" CelebiShrineEvent: call DelayFrame - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a call LoadCelebiGFX depixel 0, 10, 7, 0 ld a, SPRITE_ANIM_OBJ_CELEBI @@ -49,7 +49,7 @@ CelebiShrineEvent: .done pop af - ld [wVramState], a + ld [wStateFlags], a call .RestorePlayerSprite_DespawnLeaves call CelebiEvent_SetBattleType ret diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index f7f6dea248f..27e7ab563ce 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -298,10 +298,10 @@ Cut_Headbutt_GetPixelFacing: FlyFromAnim: call DelayFrame - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a call FlyFunction_InitGFX depixel 10, 10, 4, 0 ld a, SPRITE_ANIM_OBJ_RED_WALK @@ -327,15 +327,15 @@ FlyFromAnim: .exit pop af - ld [wVramState], a + ld [wStateFlags], a ret FlyToAnim: call DelayFrame - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a call FlyFunction_InitGFX depixel 31, 10, 4, 0 ld a, SPRITE_ANIM_OBJ_RED_WALK @@ -364,7 +364,7 @@ FlyToAnim: .exit pop af - ld [wVramState], a + ld [wStateFlags], a call .RestorePlayerSprite_DespawnLeaves ret diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm index d2c687b8aa1..8a160a184cb 100644 --- a/engine/events/halloffame.asm +++ b/engine/events/halloffame.asm @@ -43,7 +43,7 @@ RedCredits:: ld [wMusicFade], a farcall FadeOutToWhite xor a - ld [wVramState], a + ld [wStateFlags], a ldh [hMapAnims], a farcall InitDisplayForRedCredits ld c, 8 @@ -65,7 +65,7 @@ HallOfFame_FadeOutMusic: ld [wMusicFade], a farcall FadeOutToWhite xor a - ld [wVramState], a + ld [wStateFlags], a ldh [hMapAnims], a farcall InitDisplayForHallOfFame ld c, 100 diff --git a/engine/menus/menu.asm b/engine/menus/menu.asm index a3c25e97afb..8f01d27e36e 100644 --- a/engine/menus/menu.asm +++ b/engine/menus/menu.asm @@ -693,8 +693,8 @@ _ExitMenu:: ret RestoreOverworldMapTiles: ; unreferenced - ld a, [wVramState] - bit 0, a + ld a, [wStateFlags] + bit SPRITE_UPDATES_DISABLED_F, a ret z xor a ; sScratch call OpenSRAM diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index aaea1f7fd57..06ad656a0fe 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -9,10 +9,10 @@ const TRAINERCARDSTATE_QUIT ; 6 TrainerCard: - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a ld hl, wOptions ld a, [hl] push af @@ -35,7 +35,7 @@ TrainerCard: pop af ld [wOptions], a pop af - ld [wVramState], a + ld [wStateFlags], a ret .InitRAM: diff --git a/engine/movie/trade_animation.asm b/engine/movie/trade_animation.asm index 616380c5365..6e1a82a2fa6 100644 --- a/engine/movie/trade_animation.asm +++ b/engine/movie/trade_animation.asm @@ -128,10 +128,10 @@ RunTradeAnimScript: push af xor a ldh [hMapAnims], a - ld hl, wVramState + ld hl, wStateFlags ld a, [hl] push af - res 0, [hl] + res SPRITE_UPDATES_DISABLED_F, [hl] ld hl, wOptions ld a, [hl] push af @@ -148,7 +148,7 @@ RunTradeAnimScript: pop af ld [wOptions], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ldh [hMapAnims], a ret diff --git a/engine/overworld/init_map.asm b/engine/overworld/init_map.asm index efd6cc90b18..9e6c23f3c83 100644 --- a/engine/overworld/init_map.asm +++ b/engine/overworld/init_map.asm @@ -17,8 +17,8 @@ ReanchorBGMap_NoOAMUpdate:: pop af ldh [hOAMUpdate], a - ld hl, wVramState - set 6, [hl] + ld hl, wStateFlags + set TEXT_STATE_F, [hl] ret .ReanchorBGMap: diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index 44e547db788..7a0f307a64f 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -2167,8 +2167,8 @@ CopyTempObjectData: ret UpdateAllObjectsFrozen:: - ld a, [wVramState] - bit 0, a + ld a, [wStateFlags] + bit SPRITE_UPDATES_DISABLED_F, a ret z ld bc, wObjectStructs xor a @@ -2728,8 +2728,8 @@ ResetObject: db SPRITEMOVEDATA_STANDING_RIGHT _UpdateSprites:: - ld a, [wVramState] - bit 0, a + ld a, [wStateFlags] + bit SPRITE_UPDATES_DISABLED_F, a ret z xor a ldh [hUsedSpriteIndex], a @@ -2744,8 +2744,8 @@ _UpdateSprites:: ret .fill - ld a, [wVramState] - bit 1, a + ld a, [wStateFlags] + bit LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, a ld b, NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH jr z, .ok ld b, (NUM_SPRITE_OAM_STRUCTS - 12) * SPRITEOAMSTRUCT_LENGTH diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 3129e186ee1..c8b111f32bc 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -205,8 +205,8 @@ Movement_step_end: add hl, bc ld [hl], $0 - ld hl, wVramState - res 7, [hl] + ld hl, wStateFlags + res SCRIPTED_MOVEMENT_STATE_F, [hl] ld hl, OBJECT_STEP_TYPE add hl, bc @@ -232,8 +232,8 @@ Movement_48: add hl, bc ld [hl], STEP_TYPE_SLEEP - ld hl, wVramState - res 7, [hl] + ld hl, wStateFlags + res SCRIPTED_MOVEMENT_STATE_F, [hl] ret Movement_remove_object: @@ -245,8 +245,8 @@ Movement_remove_object: ld [hl], -1 .not_leading - ld hl, wVramState - res 7, [hl] + ld hl, wStateFlags + res SCRIPTED_MOVEMENT_STATE_F, [hl] ret Movement_4b: @@ -258,8 +258,8 @@ Movement_4b: add hl, bc ld [hl], STEP_TYPE_STANDING - ld hl, wVramState - res 7, [hl] + ld hl, wStateFlags + res SCRIPTED_MOVEMENT_STATE_F, [hl] ret Movement_step_sleep_1: diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm index 1ee4cc79a8f..c3b376f39a0 100644 --- a/engine/overworld/player_object.asm +++ b/engine/overworld/player_object.asm @@ -153,8 +153,8 @@ CopyObjectStruct:: ld d, h ld e, l call CopyMapObjectToObjectStruct - ld hl, wVramState - bit 7, [hl] + ld hl, wStateFlags + bit SCRIPTED_MOVEMENT_STATE_F, [hl] ret z ld hl, OBJECT_FLAGS2 diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index c927eb6b0cf..9b4fc8edb35 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -44,8 +44,8 @@ WaitScript: WaitScriptMovement: call StopScript - ld hl, wVramState - bit 7, [hl] + ld hl, wStateFlags + bit SCRIPTED_MOVEMENT_STATE_F, [hl] ret nz farcall UnfreezeAllObjects @@ -925,8 +925,8 @@ ApplyObjectFacing: pop de ld a, e call SetSpriteDirection - ld hl, wVramState - bit 6, [hl] + ld hl, wStateFlags + bit TEXT_STATE_F, [hl] jr nz, .text_state call .DisableTextTiles .text_state diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index 4a58e144e47..501f1088229 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -226,9 +226,9 @@ EnterMapWarp: ret LoadMapTimeOfDay: - ld hl, wVramState - res 6, [hl] - ld a, $1 + ld hl, wStateFlags + res TEXT_STATE_F, [hl] + ld a, TRUE ld [wSpriteUpdatesEnabled], a farcall ReplaceTimeOfDayPals farcall UpdateTimeOfDayPal @@ -321,8 +321,8 @@ RefreshMapSprites: ld hl, wPlayerSpriteSetupFlags bit PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl] jr nz, .skip - ld hl, wVramState - set 0, [hl] + ld hl, wStateFlags + set SPRITE_UPDATES_DISABLED_F, [hl] call SafeUpdateSprites .skip ld a, [wPlayerSpriteSetupFlags] diff --git a/engine/phone/phonering_copytilemapatonce.asm b/engine/phone/phonering_copytilemapatonce.asm index 029c2958cf4..0f222547a35 100644 --- a/engine/phone/phonering_copytilemapatonce.asm +++ b/engine/phone/phonering_copytilemapatonce.asm @@ -3,7 +3,7 @@ PhoneRing_CopyTilemapAtOnce: and a jp z, WaitBGMap ld a, [wSpriteUpdatesEnabled] - cp $0 + cp FALSE jp z, WaitBGMap ; The following is a modified version of _CopyTilemapAtOnce diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 063803cb813..3295fbfe48e 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -30,10 +30,10 @@ Pokedex: ld a, [hl] push af set NO_TEXT_SCROLL, [hl] - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a ldh a, [hInMenu] push af ld a, $1 @@ -64,7 +64,7 @@ Pokedex: pop af ldh [hInMenu], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ld [wOptions], a pop af diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index d75c7493174..004cb51073c 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -33,10 +33,10 @@ PokeGear: push af ld a, $1 ldh [hInMenu], a - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a call .InitTilemap call DelayFrame .loop @@ -55,7 +55,7 @@ PokeGear: call PlaySFX call WaitSFX pop af - ld [wVramState], a + ld [wStateFlags], a pop af ldh [hInMenu], a pop af @@ -1764,10 +1764,10 @@ _TownMap: ld a, $1 ldh [hInMenu], a - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a call ClearBGPalettes call ClearTilemap @@ -1819,7 +1819,7 @@ _TownMap: .resume pop af - ld [wVramState], a + ld [wStateFlags], a pop af ldh [hInMenu], a pop af diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 8103b38e0a8..64bfb4ad133 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -3,10 +3,10 @@ _DepositPKMN: ld a, [hl] push af set NO_TEXT_SCROLL, [hl] - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a ldh a, [hInMenu] push af ld a, $1 @@ -30,7 +30,7 @@ _DepositPKMN: pop af ldh [hInMenu], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ld [wOptions], a ret @@ -259,10 +259,10 @@ _WithdrawPKMN: ld a, [hl] push af set NO_TEXT_SCROLL, [hl] - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a ldh a, [hInMenu] push af ld a, $1 @@ -286,7 +286,7 @@ _WithdrawPKMN: pop af ldh [hInMenu], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ld [wOptions], a ret @@ -497,10 +497,10 @@ _MovePKMNWithoutMail: ld a, [hl] push af set NO_TEXT_SCROLL, [hl] - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a ldh a, [hInMenu] push af ld a, $1 @@ -527,7 +527,7 @@ _MovePKMNWithoutMail: pop af ldh [hInMenu], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ld [wOptions], a ret diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm index 40796f47701..232cbc7e0ac 100644 --- a/engine/pokemon/breeding.asm +++ b/engine/pokemon/breeding.asm @@ -358,8 +358,8 @@ HatchEggs: ; Huh? @ @ text_far Text_BreedHuh text_asm - ld hl, wVramState - res 0, [hl] + ld hl, wStateFlags + res SPRITE_UPDATES_DISABLED_F, [hl] push hl push de push bc diff --git a/engine/rtc/timeset.asm b/engine/rtc/timeset.asm index bc42f409605..f42b9d63200 100644 --- a/engine/rtc/timeset.asm +++ b/engine/rtc/timeset.asm @@ -8,7 +8,7 @@ InitClock: ld a, $1 ldh [hInMenu], a - ld a, $0 + ld a, FALSE ld [wSpriteUpdatesEnabled], a ld a, $10 ld [wMusicFade], a diff --git a/home/map.asm b/home/map.asm index cd6c66d1400..2d0519c8137 100644 --- a/home/map.asm +++ b/home/map.asm @@ -1941,7 +1941,7 @@ FinishExitMenu:: ReturnToMapWithSpeechTextbox:: push af - ld a, $1 + ld a, TRUE ld [wSpriteUpdatesEnabled], a call ClearBGPalettes call ClearSprites @@ -1949,8 +1949,8 @@ ReturnToMapWithSpeechTextbox:: hlcoord 0, 12 lb bc, 4, 18 call Textbox - ld hl, wVramState - set 0, [hl] + ld hl, wStateFlags + set SPRITE_UPDATES_DISABLED_F, [hl] call UpdateSprites call WaitBGMap2 ld b, SCGB_MAPPALS diff --git a/home/map_objects.asm b/home/map_objects.asm index 328556596e2..48ee5b0585b 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -412,8 +412,8 @@ LoadMovementDataPointer:: add hl, bc ld [hl], STEP_TYPE_RESET - ld hl, wVramState - set 7, [hl] + ld hl, wStateFlags + set SCRIPTED_MOVEMENT_STATE_F, [hl] and a ret @@ -574,19 +574,19 @@ _GetMovementIndex:: ld a, h ret -SetVramState_Bit0:: ; unreferenced - ld hl, wVramState - set 0, [hl] +SetVramState_SpriteUpdatesDisabled:: ; unreferenced + ld hl, wStateFlags + set SPRITE_UPDATES_DISABLED_F, [hl] ret -ResetVramState_Bit0:: ; unreferenced - ld hl, wVramState - res 0, [hl] +ResetVramState_SpriteUpdatesDisabled:: ; unreferenced + ld hl, wStateFlags + res SPRITE_UPDATES_DISABLED_F, [hl] ret UpdateSprites:: - ld a, [wVramState] - bit 0, a + ld a, [wStateFlags] + bit SPRITE_UPDATES_DISABLED_F, a ret z farcall UpdateAllObjectsFrozen diff --git a/home/scrolling_menu.asm b/home/scrolling_menu.asm index 5e6373953d7..ee302609edb 100644 --- a/home/scrolling_menu.asm +++ b/home/scrolling_menu.asm @@ -17,8 +17,8 @@ ScrollingMenu:: ret .UpdatePalettes: - ld hl, wVramState - bit 0, [hl] + ld hl, wStateFlags + bit SPRITE_UPDATES_DISABLED_F, [hl] jp nz, UpdateTimePals jp SetDefaultBGPAndOBP diff --git a/home/sprite_updates.asm b/home/sprite_updates.asm index e070a2bbe1c..64088fb45d8 100644 --- a/home/sprite_updates.asm +++ b/home/sprite_updates.asm @@ -1,19 +1,19 @@ DisableSpriteUpdates:: xor a ldh [hMapAnims], a - ld a, [wVramState] - res 0, a - ld [wVramState], a - ld a, $0 + ld a, [wStateFlags] + res SPRITE_UPDATES_DISABLED_F, a + ld [wStateFlags], a + ld a, FALSE ld [wSpriteUpdatesEnabled], a ret EnableSpriteUpdates:: - ld a, $1 + ld a, TRUE ld [wSpriteUpdatesEnabled], a - ld a, [wVramState] - set 0, a - ld [wVramState], a - ld a, $1 + ld a, [wStateFlags] + set SPRITE_UPDATES_DISABLED_F, a + ld [wStateFlags], a + ld a, TRUE ldh [hMapAnims], a ret diff --git a/home/tilemap.asm b/home/tilemap.asm index 5afee25cc7f..4f87e02d52d 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -37,7 +37,7 @@ ApplyTilemap:: jr z, .dmg ld a, [wSpriteUpdatesEnabled] - cp 0 + cp FALSE jr z, .dmg ld a, 1 diff --git a/home/time_palettes.asm b/home/time_palettes.asm index 7dc4e776ad4..c5ae40f16f4 100644 --- a/home/time_palettes.asm +++ b/home/time_palettes.asm @@ -3,14 +3,14 @@ UpdateTimeAndPals:: ; rtc enabled? ld a, [wSpriteUpdatesEnabled] - cp 0 + cp FALSE ret z call UpdateTime ; obj update on? - ld a, [wVramState] - bit 0, a ; obj update + ld a, [wStateFlags] + bit SPRITE_UPDATES_DISABLED_F, a ; obj update ret z TimeOfDayPals:: diff --git a/home/window.asm b/home/window.asm index 7fc5ddc8bf9..87406924918 100644 --- a/home/window.asm +++ b/home/window.asm @@ -23,8 +23,8 @@ CloseText:: pop af ldh [hOAMUpdate], a - ld hl, wVramState - res 6, [hl] + ld hl, wStateFlags + res TEXT_STATE_F, [hl] ret .CloseText: diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index 8f05f329ab3..feb7e73ffa2 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -143,12 +143,12 @@ Function891fe: ret Mobile_EnableSpriteUpdates: - ld a, 1 + ld a, TRUE ld [wSpriteUpdatesEnabled], a ret Mobile_DisableSpriteUpdates: - ld a, 0 + ld a, FALSE ld [wSpriteUpdatesEnabled], a ret diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index 496c51114e1..9fab36646a8 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -40,15 +40,15 @@ Function100022: farcall Stubbed_Function106462 farcall Function106464 ; load broken gfx farcall Function11615a ; init RAM - ld hl, wVramState - set 1, [hl] + ld hl, wStateFlags + set LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, [hl] ret Function100057: call DisableMobile call ReturnToMapFromSubmenu - ld hl, wVramState - res 1, [hl] + ld hl, wStateFlags + res LAST_12_SPRITE_OAM_STRUCTS_RESERVED_F, [hl] ret SetRAMStateForMobile: diff --git a/mobile/mobile_42.asm b/mobile/mobile_42.asm index bd469ea7e37..0685b2de734 100644 --- a/mobile/mobile_42.asm +++ b/mobile/mobile_42.asm @@ -95,10 +95,10 @@ RunMobileTradeAnim_Frontpics: push af xor a ldh [hMapAnims], a - ld hl, wVramState + ld hl, wStateFlags ld a, [hl] push af - res 0, [hl] + res SPRITE_UPDATES_DISABLED_F, [hl] ld hl, wOptions ld a, [hl] push af @@ -110,7 +110,7 @@ RunMobileTradeAnim_Frontpics: pop af ld [wOptions], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ldh [hMapAnims], a ret @@ -124,7 +124,7 @@ RunMobileTradeAnim_NoFrontpics: push af xor a ldh [hMapAnims], a - ld hl, wVramState + ld hl, wStateFlags ld a, [hl] push af res 0, [hl] @@ -139,7 +139,7 @@ RunMobileTradeAnim_NoFrontpics: pop af ld [wOptions], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ldh [hMapAnims], a ret diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index 4acb0722635..7ad21574416 100644 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -463,10 +463,10 @@ BattleTowerRoomMenu_InitRAM: ld [wc3ed], a ld [wc3ee], a ld [wc3ef], a - ld hl, wVramState + ld hl, wStateFlags ld a, [hl] 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) ldh [rIE], a ld a, $1 @@ -508,7 +508,7 @@ BattleTowerRoomMenu_Cleanup: ldh [rIE], a ei ld a, [wcd7f] - ld [wVramState], a + ld [wStateFlags], a ld a, [wMobileErrorCodeBuffer] ld [wScriptVar], a ret @@ -5535,10 +5535,10 @@ Function11ac51: ld a, [hl] push af set 4, [hl] - ld a, [wVramState] + ld a, [wStateFlags] push af xor a - ld [wVramState], a + ld [wStateFlags], a ldh a, [hInMenu] push af ld a, $1 @@ -5571,7 +5571,7 @@ Function11ac51: pop af ldh [hInMenu], a pop af - ld [wVramState], a + ld [wStateFlags], a pop af ld [wOptions], a ret diff --git a/ram/wram.asm b/ram/wram.asm index f72c7065758..539434dd042 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -2304,12 +2304,11 @@ wBattlePlayerAction:: wSolvedUnownPuzzle:: db -wVramState:: +wStateFlags:: ; bit 0: overworld sprite updating on/off -; bit 1: something to do with sprite updates -; bit 6: something to do with text -; bit 7: on when surf initiates -; flickers when climbing waterfall +; bit 1: last 12 sprite OAM structs reserved +; bit 6: in text state +; bit 7: in scripted movement db wBattleResult::