More engine flag constants

This commit is contained in:
Rangi 2018-01-22 14:34:55 -05:00
parent 125d51b3b2
commit 4d8528f903
27 changed files with 75 additions and 54 deletions

View File

@ -120,7 +120,7 @@
; wPlayerGender
const ENGINE_PLAYER_IS_FEMALE
; wCelebiEvent
const ENGINE_HAVE_EXAMINED_GS_BALL
const ENGINE_FOREST_IS_RESTLESS
; wDailyRematchFlags
const ENGINE_JACK
const ENGINE_HUEY

View File

@ -105,6 +105,16 @@ DARKNESS EQU 1 << DARKNESS_F
ANYTIME EQU MORN | DAY | NITE
; wPlayerSpriteSetupFlags:: ; d45b
PLAYERSPRITESETUP_FACING_MASK EQU %11
PLAYERSPRITESETUP_FEMALE_TO_MALE_F EQU 2
PLAYERSPRITESETUP_CUSTOM_FACING_F EQU 5
PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F EQU 6
PLAYERSPRITESETUP_RESET_ACTION_F EQU 7
; wPlayerGender:: ; d472
PLAYERGENDER_FEMALE_F EQU 0
; ScriptFlags:: ; d434
SCRIPT_RUNNING EQU 2
@ -185,12 +195,18 @@ PLAYER_SKATE EQU 2
PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8
; wCelebiEvent:: ; dbf3
CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2
; wBikeFlags:: ; dbf5
const_def
const BIKEFLAGS_STRENGTH_ACTIVE_F ; 0
const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1
const BIKEFLAGS_DOWNHILL_F ; 2
; wLuckyNumberShowFlag:: ; dc9d
LUCKYNUMBERSHOW_GAME_OVER_F EQU 0
; wDayCareMan:: ; def5
DAYCAREMAN_HAS_MON_F EQU 0
DAYCAREMAN_MONS_COMPATIBLE_F EQU 5

View File

@ -99,7 +99,7 @@ EngineFlags: ; 80462
engine_flag wVisitedSpawns, SPAWN_MT_SILVER
engine_flag wVisitedSpawns, NUM_SPAWNS ; unused
engine_flag wLuckyNumberShowFlag, 0 ; lucky number show
engine_flag wLuckyNumberShowFlag, LUCKYNUMBERSHOW_GAME_OVER_F
engine_flag wStatusFlags2, 3 ; ????
engine_flag wDailyFlags, 0 ; kurt making balls ; $50
@ -125,9 +125,9 @@ EngineFlags: ; 80462
engine_flag wGameTimerPause, 7 ; $62
engine_flag wPlayerGender, 0 ; player is female
engine_flag wPlayerGender, PLAYERGENDER_FEMALE_F
engine_flag wCelebiEvent, 2 ; have gs ball after kurt examined it
engine_flag wCelebiEvent, CELEBIEVENT_FOREST_IS_RESTLESS_F
; rematches
engine_flag wDailyRematchFlags, 0 ; jack
@ -191,7 +191,7 @@ EngineFlags: ; 80462
engine_flag wDailyPhoneTimeOfDayFlags, 22 ; parry
engine_flag wDailyPhoneTimeOfDayFlags, 23 ; erin
engine_flag wPlayerSpriteSetupFlags, 2 ; female player has been transformed into male
engine_flag wPlayerSpriteSetupFlags, PLAYERSPRITESETUP_FEMALE_TO_MALE_F
engine_flag wSwarmFlags, 2 ; dunsparce swarm ; $a0
engine_flag wSwarmFlags, 3 ; yanma swarm

View File

@ -9263,10 +9263,10 @@ GetTrainerBackpic: ; 3fbff
; What gender are we?
ld a, [wPlayerSpriteSetupFlags]
bit 2, a ; transformed to male
bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .Chris
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .Chris
; It's a girl.

View File

@ -194,7 +194,7 @@ SetBoxmonOrEggmonCaughtData: ; 4db53
call GetWorldMapLocation
ld b, a
ld a, [wPlayerGender]
rrca
rrca ; shift bit 0 (PLAYERGENDER_FEMALE_F) to bit 7 (CAUGHT_GENDER_MASK)
or b
ld [hl], a
ret

View File

@ -184,7 +184,7 @@ InitPartyMenuBGPal0: ; 8e9f
_CGB_PokegearPals: ; 8eb9
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld hl, FemalePokegearPals
jr .got_pals
@ -821,7 +821,7 @@ _CGB_PackPals: ; 93d3
jr z, .tutorial_male
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .tutorial_male
ld hl, .KrisPackPals

View File

@ -707,7 +707,7 @@ GetPlayerOrMonPalettePointer:
and a
jp nz, GetMonNormalOrShinyPalettePointer
ld a, [wPlayerSpriteSetupFlags]
bit 2, a ; transformed to male
bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .male
ld a, [wPlayerGender]
and a

View File

@ -6,7 +6,7 @@ LoadFishingGFX: ; b84b3
ld de, FishingGFX
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld de, KrisFishingGFX
.got_gender

View File

@ -327,7 +327,7 @@ MagnetTrain_Jumptable: ; 8cdf7
ld a, BANK(wPlayerGender)
ld [rSVBK], a
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_BLUE

View File

@ -812,7 +812,7 @@ NamePlayer: ; 0x6074
ld hl, PlayerName
ld de, .Chris
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .Male
ld de, .Kris
.Male:
@ -988,7 +988,7 @@ Intro_PlacePlayerSprite: ; 61cd
ld b, PAL_OW_RED
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld b, PAL_OW_BLUE
.male

View File

@ -2543,7 +2543,7 @@ RefreshPlayerSprite: ; 579d
.TryResetPlayerAction: ; 57bc
ld hl, wPlayerSpriteSetupFlags
bit 7, [hl]
bit PLAYERSPRITESETUP_RESET_ACTION_F, [hl]
jr nz, .ok
ret
@ -2555,10 +2555,10 @@ RefreshPlayerSprite: ; 579d
.SpawnInCustomFacing: ; 57ca
ld hl, wPlayerSpriteSetupFlags
bit 5, [hl]
bit PLAYERSPRITESETUP_CUSTOM_FACING_F, [hl]
ret z
ld a, [wPlayerSpriteSetupFlags]
and 3
and PLAYERSPRITESETUP_FACING_MASK
add a
add a
jr ContinueSpawnFacing

View File

@ -143,13 +143,13 @@ LoadObjectsRunCallback_02: ; 154d7
DelayClearingOldSprites: ; 154eb
ld hl, wPlayerSpriteSetupFlags
set 7, [hl]
set PLAYERSPRITESETUP_RESET_ACTION_F, [hl]
ret
; 154f1
DelayLoadingNewSprites: ; 154f1
ld hl, wPlayerSpriteSetupFlags
set 6, [hl]
set PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
ret
CheckReplaceKrisSprite: ; 154f7

View File

@ -62,10 +62,10 @@ GetPlayerSprite: ; 14183
; Get Chris or Kris's sprite.
ld hl, .Chris
ld a, [wPlayerSpriteSetupFlags]
bit 2, a
bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .go
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .go
ld hl, .Kris

View File

@ -1288,7 +1288,7 @@ DrawPackGFX: ; 1089d
cp BATTLETYPE_TUTORIAL
jr z, .male_dude
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr nz, .female
.male_dude
ld hl, PackGFXPointers

View File

@ -1,7 +1,7 @@
Unreferenced_Function88248: ; 88248
ld c, CAL
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .okay
ld c, KAREN
@ -58,7 +58,7 @@ MovePlayerPic: ; 88266
ShowPlayerNamingChoices: ; 88297
ld hl, ChrisNameMenuDataHeader
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .GotGender
ld hl, KrisNameMenuDataHeader
.GotGender:
@ -76,7 +76,7 @@ GetPlayerNameArray: ; 88318 This Function is never called
ld hl, PlayerName
ld de, MalePlayerNameArray
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .done
ld de, FemalePlayerNameArray
@ -92,7 +92,7 @@ GetPlayerIcon: ; 8832c
ld b, BANK(ChrisSpriteGFX)
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .done
; Female
@ -105,7 +105,7 @@ GetPlayerIcon: ; 8832c
GetCardPic: ; 8833e
ld hl, ChrisCardPic
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .GotClass
ld hl, KrisCardPic
.GotClass:
@ -131,7 +131,7 @@ INCBIN "gfx/trainer_card/trainer_card.2bpp"
GetPlayerBackpic: ; 88825
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, GetChrisBackpic
call GetKrisBackpic
ret
@ -150,7 +150,7 @@ HOF_LoadTrainerFrontpic: ; 88840
ld [hBGMapMode], a
ld e, 0
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .GotClass
ld e, 1
@ -159,7 +159,7 @@ HOF_LoadTrainerFrontpic: ; 88840
ld [TrainerClass], a
ld de, ChrisPic
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .GotPic
ld de, KrisPic
@ -179,7 +179,7 @@ DrawIntroPlayerPic: ; 88874
; Get class
ld e, CHRIS
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .GotClass
ld e, KRIS
.GotClass:
@ -189,7 +189,7 @@ DrawIntroPlayerPic: ; 88874
; Load pic
ld de, ChrisPic
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .GotPic
ld de, KrisPic
.GotPic:

View File

@ -31,10 +31,10 @@ SpawnPlayer: ; 8029
add hl, bc
ln e, PAL_NPC_RED, OBJECTTYPE_SCRIPT
ld a, [wPlayerSpriteSetupFlags]
bit 2, a
bit PLAYERSPRITESETUP_FEMALE_TO_MALE_F, a
jr nz, .ok
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .ok
ln e, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT

View File

@ -687,7 +687,7 @@ PokegearMap_InitPlayerIcon: ; 9106a
depixel 0, 0
ld b, SPRITE_ANIM_INDEX_RED_WALK
ld a, [wPlayerGender]
bit 0, a ; ENGINE_PLAYER_IS_FEMALE
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_BLUE_WALK
.got_gender
@ -2690,7 +2690,7 @@ Pokedex_GetArea: ; 91d11
push bc
ld c, PAL_OW_RED
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
inc c ; PAL_OW_BLUE
.male
@ -2917,7 +2917,7 @@ TownMapPlayerIcon: ; 91fa6
depixel 0, 0
ld b, SPRITE_ANIM_INDEX_RED_WALK ; Male
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_BLUE_WALK ; Female
.got_gender

View File

@ -2477,7 +2477,7 @@ Script_warpfacing:
maskbits NUM_DIRECTIONS
ld c, a
ld a, [wPlayerSpriteSetupFlags]
set 5, a
set PLAYERSPRITESETUP_CUSTOM_FACING_F, a
or c
ld [wPlayerSpriteSetupFlags], a
; fall through

View File

@ -350,7 +350,7 @@ Special_CheckPokerus: ; c419
Special_ResetLuckyNumberShowFlag: ; c422
farcall RestartLuckyNumberCountdown
ld hl, wLuckyNumberShowFlag
res 0, [hl]
res LUCKYNUMBERSHOW_GAME_OVER_F, [hl]
farcall LoadOrRegenerateLuckyIDNumber
ret
; c434

View File

@ -502,7 +502,7 @@ ForestTreeLeftAnimation: ; fc45c
; Only during the Celebi event.
ld a, [wCelebiEvent]
bit 2, a
bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc46c
ld hl, ForestTreeLeftFrames
jr .asm_fc47d
@ -544,7 +544,7 @@ ForestTreeRightAnimation: ; fc4c4
; Only during the Celebi event.
ld a, [wCelebiEvent]
bit 2, a
bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc4d4
ld hl, ForestTreeRightFrames
jr .asm_fc4eb
@ -579,7 +579,7 @@ ForestTreeLeftAnimation2: ; fc4f2
; Only during the Celebi event.
ld a, [wCelebiEvent]
bit 2, a
bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc502
ld hl, ForestTreeLeftFrames
jr .asm_fc515
@ -611,7 +611,7 @@ ForestTreeRightAnimation2: ; fc51c
; Only during the Celebi event.
ld a, [wCelebiEvent]
bit 2, a
bit CELEBIEVENT_FOREST_IS_RESTLESS_F, a
jr nz, .asm_fc52c
ld hl, ForestTreeRightFrames
jr .asm_fc545

View File

@ -322,7 +322,7 @@ RefreshMapSprites: ; 1047f0
farcall RefreshPlayerSprite
farcall CheckReplaceKrisSprite
ld hl, wPlayerSpriteSetupFlags
bit 6, [hl]
bit PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl]
jr nz, .skip
ld hl, VramState
set 0, [hl]

View File

@ -399,7 +399,7 @@ PlaceGenderedPlayerName:: ; 1252
ld h, b
ld l, c
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
ld de, KunSuffixText
jr z, PlaceCommandCharacter
ld de, ChanSuffixText

View File

@ -167,7 +167,7 @@ AzaleaTownCelebiScene:
waitbutton
verbosegiveitem GS_BALL
spriteface AZALEATOWN_KURT_OUTSIDE, LEFT
setflag ENGINE_HAVE_EXAMINED_GS_BALL
setflag ENGINE_FOREST_IS_RESTLESS
clearevent EVENT_ILEX_FOREST_LASS
setevent EVENT_ROUTE_34_ILEX_FOREST_GATE_LASS
setscene 0

View File

@ -464,7 +464,7 @@ MapIlexForestSignpost4Script:
pause 30
spriteface PLAYER, DOWN
pause 20
clearflag ENGINE_HAVE_EXAMINED_GS_BALL
clearflag ENGINE_FOREST_IS_RESTLESS
special Special_CelebiShrineEvent
loadwildmon CELEBI, 30
startbattle

View File

@ -315,7 +315,7 @@ asm_4828d: ; 4828d (12:428d)
ld a, [hli]
cp $50
jr nz, .asm_482e1
ld a, $1
ld a, 1 << PLAYERGENDER_FEMALE_F
ld [wPlayerGender], a
jr .asm_482f1
.asm_482ed
@ -800,7 +800,7 @@ Function4873c: ; 4873c (12:473c)
add B_BUTTON
ld [hli], a ; joypad filter
; ld a, [wPlayerGender]
; xor 1
; xor 1 << PLAYERGENDER_FEMALE_F
; inc a
ld a, [wPlayerGender]
and a

View File

@ -619,7 +619,7 @@ Function89481: ; 89481
Function89492: ; 89492 (22:5492)
ld d, 0
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
ret z
inc d
ret
@ -1269,7 +1269,7 @@ Function897d5: ; 897d5
Function89807: ; 89807 (22:5807)
ld hl, MobileAdapterGFX + $20 tiles
ld a, [wPlayerGender]
bit 0, a
bit PLAYERGENDER_FEMALE_F, a
jr z, .asm_89814
ld hl, MobileAdapterGFX + $43 tiles
.asm_89814

View File

@ -2285,7 +2285,9 @@ wXYComparePointer:: dw ; d453
wBattleScriptFlags:: dw ; d459
wPlayerSpriteSetupFlags:: ; d45b
; bit 7: if set, cancel PlayerAction
; bit 6: RefreshMapSprites doesn't reload player sprite
; bit 5: if set, set facing according to bits 0-1
; bit 2: female player has been transformed into male
; bits 0-1: direction facing
db
wMapReentryScriptQueueFlag:: db ; d45c MemScriptFlag
@ -2626,7 +2628,9 @@ wCurBox:: db ; db72
; 8 chars + $50
wBoxNames:: ds BOX_NAME_LENGTH * NUM_BOXES ; db75
wCelebiEvent:: db
wCelebiEvent:: ; dbf3
; bit 2: forest is restless
db
ds 1
@ -2720,7 +2724,8 @@ wPhoneList:: ds CONTACT_LIST_SIZE ; dc7c
; dc86
ds 23
wLuckyNumberShowFlag:: dw ; dc9d
wLuckyNumberShowFlag:: db ; dc9d
ds 1
wLuckyIDNumber:: dw ; dc9f
wRepelEffect:: db ; If a Repel is in use, it contains the nr of steps it's still active