wVramState -> wStateFlags and define flag constants (from pokecrystal f72f078c0e68736adf81f6c45c84f0c1e127a231)

This commit is contained in:
xCrystal
2024-02-11 00:34:46 +01:00
parent b1fd8f941a
commit e44744c587
27 changed files with 88 additions and 82 deletions

View File

@@ -17,7 +17,7 @@ ReanchorBGMap_NoOAMUpdate::
pop af
ldh [hOAMUpdate], a
ld hl, wVramState
ld hl, wStateFlags
set 6, [hl]
ret

View File

@@ -2167,7 +2167,7 @@ CopyTempObjectData:
ret
UpdateAllObjectsFrozen::
ld a, [wVramState]
ld a, [wStateFlags]
bit 0, a
ret z
ld bc, wObjectStructs
@@ -2766,13 +2766,13 @@ SetObjectToRemainHidden:
ret
_UpdateActiveSpritesAfterOffset::
ld a, [wVramState]
ld a, [wStateFlags]
bit 0, a
ret z
jr _UpdateActiveSprites.go
_UpdateActiveSprites::
ld a, [wVramState]
ld a, [wStateFlags]
bit 0, a
ret z
xor a
@@ -2789,7 +2789,7 @@ _UpdateActiveSprites::
ret
.fill
ld a, [wVramState]
ld a, [wStateFlags]
bit 1, a
ld b, NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH
jr z, .ok
@@ -3095,7 +3095,7 @@ _UpdateSecondarySprites::
; which would require to displace primary (NPC) sprites in OAM.
; if it is detected that the size of secondary sprites has increased in the end,
; fall back to calling _UpdateActiveSprites to avoid corruption.
ld a, [wVramState]
ld a, [wStateFlags]
bit 0, a
ret z
ld a, [hUsedSpriteIndex]

View File

@@ -205,7 +205,7 @@ Movement_step_end:
add hl, bc
ld [hl], $0
ld hl, wVramState
ld hl, wStateFlags
res 7, [hl]
ld hl, OBJECT_STEP_TYPE
@@ -232,7 +232,7 @@ Movement_48:
add hl, bc
ld [hl], STEP_TYPE_SLEEP
ld hl, wVramState
ld hl, wStateFlags
res 7, [hl]
ret
@@ -245,7 +245,7 @@ Movement_remove_object:
ld [hl], -1
.not_leading
ld hl, wVramState
ld hl, wStateFlags
res 7, [hl]
ret
@@ -258,7 +258,7 @@ Movement_4b:
add hl, bc
ld [hl], STEP_TYPE_STANDING
ld hl, wVramState
ld hl, wStateFlags
res 7, [hl]
ret

View File

@@ -153,7 +153,7 @@ CopyObjectStruct::
ld d, h
ld e, l
call CopyMapObjectToObjectStruct
ld hl, wVramState
ld hl, wStateFlags
bit 7, [hl]
ret z

View File

@@ -44,7 +44,7 @@ WaitScript:
WaitScriptMovement:
call StopScript
ld hl, wVramState
ld hl, wStateFlags
bit 7, [hl]
ret nz
@@ -939,7 +939,7 @@ ApplyObjectFacing:
pop de
ld a, e
call SetSpriteDirection
ld hl, wVramState
ld hl, wStateFlags
bit 6, [hl]
jr nz, .text_state
call .DisableTextTiles

View File

@@ -213,7 +213,7 @@ EnterMapWarp:
ret
LoadMapTimeOfDay:
ld hl, wVramState
ld hl, wStateFlags
res 6, [hl]
ld a, $1
ld [wSpriteUpdatesEnabled], a
@@ -300,7 +300,7 @@ RefreshMapSprites:
ld hl, wPlayerSpriteSetupFlags
bit PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
jr nz, .skip
ld hl, wVramState
ld hl, wStateFlags
set 0, [hl]
call SafeUpdateSprites
.skip