More engine bit flag constants

This commit is contained in:
Rangi 2018-01-22 13:57:44 -05:00
parent f75bfbeac3
commit 125d51b3b2
12 changed files with 132 additions and 80 deletions

View File

@ -13,7 +13,7 @@
const ENGINE_DAY_CARE_LADY_HAS_MON const ENGINE_DAY_CARE_LADY_HAS_MON
; wMomSavingMoney ; wMomSavingMoney
const ENGINE_MOM_SAVING_MONEY const ENGINE_MOM_SAVING_MONEY
const ENGINE_DST const ENGINE_MOM_ACTIVE
; wUnusedTwoDayTimerOn ; wUnusedTwoDayTimerOn
const ENGINE_0A const ENGINE_0A
; wStatusFlags ; wStatusFlags

View File

@ -276,5 +276,32 @@ NUM_POKEMON EQU const_value +- 1
const EGG ; fd const EGG ; fd
const MON_FE ; fe const MON_FE ; fe
; number of Unown forms ; Unown forms
NUM_UNOWN EQU 26 const_value set 1
const UNOWN_A ; 1
const UNOWN_B ; 2
const UNOWN_C ; 3
const UNOWN_D ; 4
const UNOWN_E ; 5
const UNOWN_F ; 6
const UNOWN_G ; 7
const UNOWN_H ; 8
const UNOWN_I ; 9
const UNOWN_J ; 10
const UNOWN_K ; 11
const UNOWN_L ; 12
const UNOWN_M ; 13
const UNOWN_N ; 14
const UNOWN_O ; 15
const UNOWN_P ; 16
const UNOWN_Q ; 17
const UNOWN_R ; 18
const UNOWN_S ; 19
const UNOWN_T ; 20
const UNOWN_U ; 21
const UNOWN_V ; 22
const UNOWN_W ; 23
const UNOWN_X ; 24
const UNOWN_Y ; 25
const UNOWN_Z ; 26
NUM_UNOWN EQU const_value +- 1 ; 26

View File

@ -132,6 +132,14 @@ SPAWN_RED EQU 2
PLAYER_OBJECT EQU 0 PLAYER_OBJECT EQU 0
NUM_OBJECTS EQU $10 NUM_OBJECTS EQU $10
; wMomSavingMoney:: ; d854
MOM_SAVING_SOME_MONEY_F EQU 0
MOM_SAVING_HALF_MONEY_F EQU 1
MOM_SAVING_ALL_MONEY_F EQU 2
MOM_ACTIVE_F EQU 7
MOM_SAVING_MONEY_MASK EQU (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F) | (1 << MOM_SAVING_ALL_MONEY_F)
; wJohtoBadges:: ; d857 ; wJohtoBadges:: ; d857
const_def const_def
const ZEPHYRBADGE const ZEPHYRBADGE
@ -177,6 +185,12 @@ PLAYER_SKATE EQU 2
PLAYER_SURF EQU 4 PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8 PLAYER_SURF_PIKA EQU 8
; wBikeFlags:: ; dbf5
const_def
const BIKEFLAGS_STRENGTH_ACTIVE_F ; 0
const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1
const BIKEFLAGS_DOWNHILL_F ; 2
; wDayCareMan:: ; def5 ; wDayCareMan:: ; def5
DAYCAREMAN_HAS_MON_F EQU 0 DAYCAREMAN_HAS_MON_F EQU 0
DAYCAREMAN_MONS_COMPATIBLE_F EQU 5 DAYCAREMAN_MONS_COMPATIBLE_F EQU 5

View File

@ -19,8 +19,8 @@ EngineFlags: ; 80462
engine_flag wDayCareMan, DAYCAREMAN_HAS_MON_F engine_flag wDayCareMan, DAYCAREMAN_HAS_MON_F
engine_flag wDayCareLady, DAYCARELADY_HAS_MON_F engine_flag wDayCareLady, DAYCARELADY_HAS_MON_F
engine_flag wMomSavingMoney, 0 ; mom saving money ; $8 engine_flag wMomSavingMoney, MOM_SAVING_SOME_MONEY_F ; $8
engine_flag wMomSavingMoney, 7 ; dst engine_flag wMomSavingMoney, MOM_ACTIVE_F
engine_flag wUnusedTwoDayTimerOn, 0 ; unused, possibly related to a 2-day timer engine_flag wUnusedTwoDayTimerOn, 0 ; unused, possibly related to a 2-day timer
@ -38,9 +38,9 @@ EngineFlags: ; 80462
engine_flag wStatusFlags2, 6 ; berry -> berry juice when trading? engine_flag wStatusFlags2, 6 ; berry -> berry juice when trading?
engine_flag wStatusFlags2, 7 ; rockets in mahogany engine_flag wStatusFlags2, 7 ; rockets in mahogany
engine_flag wBikeFlags, 0 ; strength active ; $18 engine_flag wBikeFlags, BIKEFLAGS_STRENGTH_ACTIVE_F ; $18
engine_flag wBikeFlags, 1 ; always on bike (cant surf) engine_flag wBikeFlags, BIKEFLAGS_ALWAYS_ON_BIKE_F
engine_flag wBikeFlags, 2 ; downhill (cycling road) engine_flag wBikeFlags, BIKEFLAGS_DOWNHILL_F
engine_flag wJohtoBadges, ZEPHYRBADGE engine_flag wJohtoBadges, ZEPHYRBADGE
engine_flag wJohtoBadges, HIVEBADGE engine_flag wJohtoBadges, HIVEBADGE
@ -60,15 +60,15 @@ EngineFlags: ; 80462
engine_flag wKantoBadges, VOLCANOBADGE engine_flag wKantoBadges, VOLCANOBADGE
engine_flag wKantoBadges, EARTHBADGE engine_flag wKantoBadges, EARTHBADGE
; unown sets ; unown sets (see data/wild/unlocked_unowns.asm)
engine_flag wUnlockedUnowns, 0 ; A-K engine_flag wUnlockedUnowns, 0 ; A-K
engine_flag wUnlockedUnowns, 1 ; L-R engine_flag wUnlockedUnowns, 1 ; L-R
engine_flag wUnlockedUnowns, 2 ; S-W engine_flag wUnlockedUnowns, 2 ; S-W
engine_flag wUnlockedUnowns, 3 ; X-Z engine_flag wUnlockedUnowns, 3 ; X-Z
engine_flag wUnlockedUnowns, 4 ; unused 5 engine_flag wUnlockedUnowns, 4 ; unused
engine_flag wUnlockedUnowns, 5 ; unused 6 ; $30 engine_flag wUnlockedUnowns, 5 ; unused ; $30
engine_flag wUnlockedUnowns, 6 ; unused 7 engine_flag wUnlockedUnowns, 6 ; unused
engine_flag wUnlockedUnowns, 7 ; unused 8 engine_flag wUnlockedUnowns, 7 ; unused
; fly ; fly
engine_flag wVisitedSpawns, SPAWN_HOME engine_flag wVisitedSpawns, SPAWN_HOME

View File

@ -1,20 +1,24 @@
unown_set: MACRO
rept _NARG
db UNOWN_\1
shift
endr
db -1
ENDM
UnlockedUnownLetterSets: UnlockedUnownLetterSets:
; entries correspond to wUnlockedUnowns bits ; entries correspond to wUnlockedUnowns bits
dw .Set1 ; ENGINE_UNLOCKED_UNOWNS_A_TO_K dw .Set_A_K ; ENGINE_UNLOCKED_UNOWNS_A_TO_K
dw .Set2 ; ENGINE_UNLOCKED_UNOWNS_L_TO_R dw .Set_L_R ; ENGINE_UNLOCKED_UNOWNS_L_TO_R
dw .Set3 ; ENGINE_UNLOCKED_UNOWNS_S_TO_W dw .Set_S_W ; ENGINE_UNLOCKED_UNOWNS_S_TO_W
dw .Set4 ; ENGINE_UNLOCKED_UNOWNS_X_TO_Z dw .Set_X_Z ; ENGINE_UNLOCKED_UNOWNS_X_TO_Z
.End .End
.Set1: .Set_A_K:
; A B C D E F G H I J K unown_set A, B, C, D, E, F, G, H, I, J, K
db 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, -1 .Set_L_R:
.Set2: unown_set L, M, N, O, P, Q, R
; L M N O P Q R .Set_S_W:
db 12, 13, 14, 15, 16, 17, 18, -1 unown_set S, T, U, V, W
.Set3: .Set_X_Z:
; S T U V W unown_set X, Y, Z
db 19, 20, 21, 22, 23, -1
.Set4:
; X Y Z
db 24, 25, 26, -1

View File

@ -2471,22 +2471,22 @@ WinTrainerBattle: ; 3cfa4
call nz, .DoubleReward call nz, .DoubleReward
call .CheckMaxedOutMomMoney call .CheckMaxedOutMomMoney
push af push af
ld a, $0 ld a, FALSE
jr nc, .okay jr nc, .okay
ld a, [wMomSavingMoney] ld a, [wMomSavingMoney]
and $7 and MOM_SAVING_MONEY_MASK
cp $3 cp (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F)
jr nz, .okay jr nz, .okay
inc a inc a ; TRUE
.okay .okay
ld b, a ld b, a
ld c, $4 ld c, 4
.loop .loop
ld a, b ld a, b
and a and a
jr z, .loop2 jr z, .loop2
call .SendMoneyToMom call .AddMoneyToMom
dec c dec c
dec b dec b
jr .loop jr .loop
@ -2505,7 +2505,7 @@ WinTrainerBattle: ; 3cfa4
pop af pop af
jr nc, .KeepItAll jr nc, .KeepItAll
ld a, [wMomSavingMoney] ld a, [wMomSavingMoney]
and $7 and MOM_SAVING_MONEY_MASK
jr z, .KeepItAll jr z, .KeepItAll
ld hl, .SentToMomTexts ld hl, .SentToMomTexts
dec a dec a
@ -2523,7 +2523,7 @@ WinTrainerBattle: ; 3cfa4
jp StdBattleTextBox jp StdBattleTextBox
; 3d081 ; 3d081
.SendMoneyToMom: ; 3d081 .AddMoneyToMom: ; 3d081
push bc push bc
ld hl, wBattleReward + 2 ld hl, wBattleReward + 2
ld de, wMomsMoney + 2 ld de, wMomsMoney + 2
@ -2557,9 +2557,9 @@ WinTrainerBattle: ; 3cfa4
; 3d0ab ; 3d0ab
.SentToMomTexts: ; 3d0ab .SentToMomTexts: ; 3d0ab
dw SentSomeToMomText dw SentSomeToMomText ; MOM_SAVING_SOME_MONEY_F
dw SentHalfToMomText dw SentHalfToMomText ; MOM_SAVING_HALF_MONEY_F
dw SentAllToMomText dw SentAllToMomText ; MOM_SAVING_ALL_MONEY_F
; 3d0b1 ; 3d0b1
.CheckMaxedOutMomMoney: ; 3d0b1 .CheckMaxedOutMomMoney: ; 3d0b1
@ -2574,7 +2574,7 @@ WinTrainerBattle: ; 3cfa4
; 3d0be ; 3d0be
AddBattleMoneyToAccount: ; 3d0be AddBattleMoneyToAccount: ; 3d0be
ld c, $3 ld c, 3
and a and a
push de push de
push hl push hl
@ -2653,7 +2653,7 @@ IsGymLeader: ; 0x3d128
IsGymLeaderCommon: IsGymLeaderCommon:
push de push de
ld a, [OtherTrainerClass] ld a, [OtherTrainerClass]
ld de, $1 ld de, 1
call IsInArray call IsInArray
pop de pop de
ret ret

View File

@ -46,9 +46,9 @@ Special_BankOfMom: ; 16218
.CheckIfBankInitialized: ; 16254 .CheckIfBankInitialized: ; 16254
ld a, [wMomSavingMoney] ld a, [wMomSavingMoney]
bit 7, a bit MOM_ACTIVE_F, a
jr nz, .savingmoneyalready jr nz, .savingmoneyalready
set 7, a set MOM_ACTIVE_F, a
ld [wMomSavingMoney], a ld [wMomSavingMoney], a
ld a, $1 ld a, $1
jr .done_0 jr .done_0
@ -68,11 +68,11 @@ Special_BankOfMom: ; 16218
jr c, .DontSaveMoney jr c, .DontSaveMoney
ld hl, UnknownText_0x1664e ld hl, UnknownText_0x1664e
call PrintText call PrintText
ld a, %10000001 ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_MONEY_F)
jr .done_1 jr .done_1
.DontSaveMoney: .DontSaveMoney:
ld a, %10000000 ld a, 1 << MOM_ACTIVE_F
.done_1 .done_1
ld [wMomSavingMoney], a ld [wMomSavingMoney], a
@ -145,7 +145,7 @@ Special_BankOfMom: ; 16218
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld a, $5 ld a, 5
ld [wMomBankDigitCursorPosition], a ld [wMomBankDigitCursorPosition], a
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
call Mom_SetUpDepositMenu call Mom_SetUpDepositMenu
@ -212,7 +212,7 @@ Special_BankOfMom: ; 16218
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld a, $5 ld a, 5
ld [wMomBankDigitCursorPosition], a ld [wMomBankDigitCursorPosition], a
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
call Mom_SetUpWithdrawMenu call Mom_SetUpWithdrawMenu
@ -276,7 +276,7 @@ Special_BankOfMom: ; 16218
call PrintText call PrintText
call YesNoBox call YesNoBox
jr c, .StopSavingMoney jr c, .StopSavingMoney
ld a, $81 ld a, (1 << MOM_ACTIVE_F) | (1 << MOM_SAVING_SOME_MONEY_F)
ld [wMomSavingMoney], a ld [wMomSavingMoney], a
ld hl, UnknownText_0x16685 ld hl, UnknownText_0x16685
call PrintText call PrintText
@ -285,7 +285,7 @@ Special_BankOfMom: ; 16218
ret ret
.StopSavingMoney: .StopSavingMoney:
ld a, $80 ld a, 1 << MOM_ACTIVE_F
ld [wMomSavingMoney], a ld [wMomSavingMoney], a
ld a, $7 ld a, $7
ld [wJumptableIndex], a ld [wJumptableIndex], a

View File

@ -358,7 +358,7 @@ SurfFunction: ; c909
call CheckBadge call CheckBadge
jr c, .asm_c956 jr c, .asm_c956
ld hl, wBikeFlags ld hl, wBikeFlags
bit 1, [hl] ; always on bike bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
jr nz, .cannotsurf jr nz, .cannotsurf
ld a, [PlayerState] ld a, [PlayerState]
cp PLAYER_SURF cp PLAYER_SURF
@ -520,7 +520,7 @@ TrySurfOW:: ; c9e7
jr c, .quit jr c, .quit
ld hl, wBikeFlags ld hl, wBikeFlags
bit 1, [hl] ; always on bike (can't surf) bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
jr nz, .quit jr nz, .quit
call GetSurfType call GetSurfType
@ -1008,7 +1008,7 @@ StrengthFunction: ; cce5
SetStrengthFlag: ; cd12 SetStrengthFlag: ; cd12
ld hl, wBikeFlags ld hl, wBikeFlags
set 0, [hl] set BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
ld a, [CurPartyMon] ld a, [CurPartyMon]
ld e, a ld e, a
ld d, 0 ld d, 0
@ -1086,7 +1086,7 @@ TryStrengthOW: ; cd78
jr c, .nope jr c, .nope
ld hl, wBikeFlags ld hl, wBikeFlags
bit 0, [hl] bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .already_using jr z, .already_using
ld a, 2 ld a, 2
@ -1683,7 +1683,7 @@ BikeFunction: ; d0b3
.GetOffBike: .GetOffBike:
ld hl, wBikeFlags ld hl, wBikeFlags
bit 1, [hl] bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
jr nz, .CantGetOffBike jr nz, .CantGetOffBike
ld hl, Script_GetOffBike ld hl, Script_GetOffBike
ld de, Script_GetOffBike_Register ld de, Script_GetOffBike_Register

View File

@ -169,7 +169,7 @@ CheckReplaceKrisSprite: ; 154f7
.CheckBiking: ; 1550c (5:550c) .CheckBiking: ; 1550c (5:550c)
and a and a
ld hl, wBikeFlags ld hl, wBikeFlags
bit 1, [hl] bit BIKEFLAGS_ALWAYS_ON_BIKE_F, [hl]
ret z ret z
ld a, PLAYER_BIKE ld a, PLAYER_BIKE
ld [PlayerState], a ld [PlayerState], a

View File

@ -140,7 +140,7 @@ MomPhoneNoGymQuestScript: ; 0xbcfac
MomPhoneLectureScript: ; 0xbcfb1 MomPhoneLectureScript: ; 0xbcfb1
setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
setflag ENGINE_DST setflag ENGINE_MOM_ACTIVE
specialphonecall SPECIALCALL_NONE specialphonecall SPECIALCALL_NONE
farwritetext MomPhoneLectureText farwritetext MomPhoneLectureText
yesorno yesorno

View File

@ -19,7 +19,7 @@ DoPlayerMovement:: ; 80000
; Standing downhill instead moves down. ; Standing downhill instead moves down.
ld hl, wBikeFlags ld hl, wBikeFlags
bit 2, [hl] ; downhill bit BIKEFLAGS_DOWNHILL_F, [hl]
ret z ret z
ld c, a ld c, a
@ -286,7 +286,7 @@ DoPlayerMovement:: ; 80000
jr nz, .walk jr nz, .walk
ld hl, wBikeFlags ld hl, wBikeFlags
bit 2, [hl] ; downhill bit BIKEFLAGS_DOWNHILL_F, [hl]
jr z, .fast jr z, .fast
ld a, [WalkingDirection] ld a, [WalkingDirection]
@ -673,7 +673,7 @@ DoPlayerMovement:: ; 80000
.CheckStrengthBoulder: ; 8036f .CheckStrengthBoulder: ; 8036f
ld hl, wBikeFlags ld hl, wBikeFlags
bit 0, [hl] ; using strength bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .not_boulder jr z, .not_boulder
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING

View File

@ -2338,7 +2338,9 @@ StartMinute:: db ; d4b8
StartSecond:: db ; d4b9 StartSecond:: db ; d4b9
wRTC:: ds 8 ; d4ba wRTC:: ds 8 ; d4ba
wDST:: db ; d4c2 wDST:: ; d4c2
; bit 7: dst
db
GameTime:: GameTime::
GameTimeCap:: db ; d4c3 GameTimeCap:: db ; d4c3
@ -2414,30 +2416,36 @@ CurTimeOfDay:: db ; d848
wSecretID:: dw wSecretID:: dw
wStatusFlags:: ; d84c wStatusFlags:: ; d84c
; 0 - pokedex ; bit 0: pokedex
; 1 - unown dex ; bit 1: unown dex
; 2 - ; bit 2: unused
; 3 - pokerus ; bit 3: pokerus
; 4 - rocket signal ; bit 4: rocket signal
; 5 - wild encounters on/off ; bit 5: wild encounters on/off
; 6 - hall of fame ; bit 6: hall of fame
; 7 - bug contest on ; bit 7: bug contest on
db db
wStatusFlags2:: ; d84d wStatusFlags2:: ; d84d
; 0 - rockets ; bit 0: rockets
; 1 - ; bit 1: unused
; 2 - bug contest timer ; bit 2: bug contest timer
; 3 - ; bit 3: unused
; 4 - bike shop call ; bit 4: bike shop call
; 5 - pokerus ; bit 5: pokerus
; 6 - berry juice? ; bit 6: berry juice
; 7 - rockets in mahogany ; bit 7: rockets in mahogany
db db
Money:: ds 3 ; d84e Money:: ds 3 ; d84e
wMomsMoney:: ds 3 ; d851 wMomsMoney:: ds 3 ; d851
wMomSavingMoney:: db ; d854
wMomSavingMoney:: ; d854
; bit 0: saving some money
; bit 1: saving half money (unused)
; bit 2: saving all money (unused)
; bit 7: active
db
Coins:: dw ; d855 Coins:: dw ; d855
@ -2627,8 +2635,7 @@ wBikeFlags:: ; dbf5
; bit 1: always on bike ; bit 1: always on bike
; bit 2: downhill ; bit 2: downhill
db db
ds 1 ; also cleared by ResetBikeFlags
ds 1
wCurrMapSceneScriptPointer:: dw ; dbf7 wCurrMapSceneScriptPointer:: dw ; dbf7