Identify more WRAM labels, and start a <X>_DummyFunction label convention

This commit is contained in:
Rangi 2020-10-28 13:35:39 -04:00
parent 6d333bed5f
commit ea426a8879
42 changed files with 255 additions and 208 deletions

View File

@ -184,7 +184,7 @@ Sfx_Tingle_Ch5:
duty_cycle 1 duty_cycle 1
transpose 0, 11 transpose 0, 11
note_type 1, 11, 1 note_type 1, 11, 1
Sfx_Tingle_branch_17996c: .loop1:
octave 5 octave 5
note C_, 3 note C_, 3
octave 6 octave 6
@ -192,7 +192,7 @@ Sfx_Tingle_branch_17996c:
octave 5 octave 5
note C_, 3 note C_, 3
rest 2 rest 2
sound_loop 2, Sfx_Tingle_branch_17996c sound_loop 2, .loop1
note C_, 2 note C_, 2
volume_envelope 10, 1 volume_envelope 10, 1
note G_, 13 note G_, 13

View File

@ -115,7 +115,7 @@
; wSwarmFlags ; wSwarmFlags
const ENGINE_BUENAS_PASSWORD_2 const ENGINE_BUENAS_PASSWORD_2
const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
; wGameTimerPause ; wGameTimerPaused
const ENGINE_62 const ENGINE_62
; wPlayerGender ; wPlayerGender
const ENGINE_PLAYER_IS_FEMALE const ENGINE_PLAYER_IS_FEMALE

View File

@ -21,9 +21,13 @@ AUTO_INPUT EQU $ff
const TEMPMON ; 3 const TEMPMON ; 3
const WILDMON ; 4 const WILDMON ; 4
; wGameTimerPause:: ; wGameTimerPaused::
GAMETIMERPAUSE_TIMER_PAUSED_F EQU 0 GAME_TIMER_PAUSED_F EQU 0
GAMETIMERPAUSE_MOBILE_7_F EQU 7 GAME_TIMER_MOBILE_F EQU 7
; wJoypadDisable::
JOYPAD_DISABLE_MON_FAINT_F EQU 6
JOYPAD_DISABLE_SGB_TRANSFER_F EQU 7
; wOptions:: ; wOptions::
TEXT_DELAY_MASK EQU %111 TEXT_DELAY_MASK EQU %111

View File

@ -125,7 +125,7 @@ EngineFlags:
engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F
engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F
engine_flag wGameTimerPause, GAMETIMERPAUSE_MOBILE_7_F engine_flag wGameTimerPaused, GAME_TIMER_MOBILE_F
engine_flag wPlayerGender, PLAYERGENDER_FEMALE_F engine_flag wPlayerGender, PLAYERGENDER_FEMALE_F

View File

@ -55,8 +55,8 @@ SpecialsPointers::
add_special UnownPuzzle add_special UnownPuzzle
add_special SlotMachine add_special SlotMachine
add_special CardFlip add_special CardFlip
add_special DummyNonfunctionalGameCornerGame add_special UnusedDummyGame ; unused
add_special ClearBGPalettesBufferScreen add_special ClearBGPalettesBufferScreen ; unused
add_special FadeOutPalettes add_special FadeOutPalettes
add_special BattleTowerFade add_special BattleTowerFade
add_special FadeBlackQuickly add_special FadeBlackQuickly
@ -65,21 +65,21 @@ SpecialsPointers::
add_special ReloadSpritesNoPalettes ; bank 0 add_special ReloadSpritesNoPalettes ; bank 0
add_special ClearBGPalettes ; bank 0 add_special ClearBGPalettes ; bank 0
add_special UpdateTimePals ; bank 0 add_special UpdateTimePals ; bank 0
add_special ClearTilemap ; bank 0 add_special ClearTilemap ; bank 0; unused as special
add_special UpdateSprites ; bank 0 add_special UpdateSprites ; bank 0
add_special UpdatePlayerSprite ; bank 0 add_special UpdatePlayerSprite ; bank 0
add_special GameCornerPrizeMonCheckDex add_special GameCornerPrizeMonCheckDex
add_special UnusedSetSeenMon add_special UnusedSetSeenMon ; unused
add_special WaitSFX ; bank 0 add_special WaitSFX ; bank 0
add_special PlayMapMusic ; bank 0 add_special PlayMapMusic ; bank 0
add_special RestartMapMusic ; bank 0 add_special RestartMapMusic ; bank 0
add_special HealMachineAnim add_special HealMachineAnim
add_special SurfStartStep add_special SurfStartStep
add_special FindPartyMonAboveLevel add_special FindPartyMonAboveLevel ; unused
add_special FindPartyMonAtLeastThatHappy add_special FindPartyMonAtLeastThatHappy ; unused
add_special FindPartyMonThatSpecies add_special FindPartyMonThatSpecies
add_special FindPartyMonThatSpeciesYourTrainerID add_special FindPartyMonThatSpeciesYourTrainerID
add_special UnusedCheckUnusedTwoDayTimer add_special UnusedCheckUnusedTwoDayTimer ; unused
add_special DayCareMon1 add_special DayCareMon1
add_special DayCareMon2 add_special DayCareMon2
add_special SelectRandomBugContestContestants add_special SelectRandomBugContestContestants
@ -134,7 +134,7 @@ SpecialsPointers::
add_special Function170114 add_special Function170114
add_special BattleTowerBattle add_special BattleTowerBattle
add_special Function1704e1 add_special Function1704e1
add_special DummySpecial_17021d add_special UnusedBattleTowerDummySpecial1
add_special LoadOpponentTrainerAndPokemonWithOTSprite add_special LoadOpponentTrainerAndPokemonWithOTSprite
add_special Function11ba38 add_special Function11ba38
add_special CheckForBattleTowerRules add_special CheckForBattleTowerRules
@ -166,7 +166,7 @@ SpecialsPointers::
add_special BeastsCheck add_special BeastsCheck
add_special MonCheck add_special MonCheck
add_special SetPlayerPalette add_special SetPlayerPalette
add_special DummySpecial_170bd2 add_special UnusedBattleTowerDummySpecial2
add_special Mobile_SelectThreeMons add_special Mobile_SelectThreeMons
add_special Function1037eb add_special Function1037eb
add_special Function10383c add_special Function10383c
@ -181,4 +181,4 @@ SpecialsPointers::
add_special UnusedFindItemInPCOrBag add_special UnusedFindItemInPCOrBag
add_special InitialSetDSTFlag add_special InitialSetDSTFlag
add_special InitialClearDSTFlag add_special InitialClearDSTFlag
add_special DummySpecial_c224 add_special UnusedDummySpecial ; unused

View File

@ -258,7 +258,7 @@ StartTrainerBattle_NextScene:
StartTrainerBattle_SetUpBGMap: StartTrainerBattle_SetUpBGMap:
call StartTrainerBattle_NextScene call StartTrainerBattle_NextScene
xor a xor a
ld [wcf64], a ld [wBattleTransitionCounter], a
ldh [hBGMapMode], a ldh [hBGMapMode], a
ret ret
@ -272,7 +272,7 @@ StartTrainerBattle_Flash:
ld a, [wTimeOfDayPalset] ld a, [wTimeOfDayPalset]
cp DARKNESS_PALSET cp DARKNESS_PALSET
jr z, .done jr z, .done
ld hl, wcf64 ld hl, wBattleTransitionCounter
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
srl a srl a
@ -290,7 +290,7 @@ StartTrainerBattle_Flash:
.done .done
xor a xor a
ld [wcf64], a ld [wBattleTransitionCounter], a
scf scf
ret ret
@ -322,12 +322,12 @@ StartTrainerBattle_SetUpForWavyOutro:
ld a, $90 ld a, $90
ldh [hLYOverrideEnd], a ldh [hLYOverrideEnd], a
xor a xor a
ld [wcf64], a ld [wBattleTransitionCounter], a
ld [wcf65], a ld [wBattleTransitionSineWaveOffset], a
ret ret
StartTrainerBattle_SineWave: StartTrainerBattle_SineWave:
ld a, [wcf64] ld a, [wBattleTransitionCounter]
cp $60 cp $60
jr nc, .end jr nc, .end
call .DoSineWave call .DoSineWave
@ -339,10 +339,10 @@ StartTrainerBattle_SineWave:
ret ret
.DoSineWave: .DoSineWave:
ld hl, wcf65 ld hl, wBattleTransitionSineWaveOffset
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
ld hl, wcf64 ld hl, wBattleTransitionCounter
ld d, [hl] ld d, [hl]
add [hl] add [hl]
ld [hl], a ld [hl], a
@ -372,13 +372,13 @@ StartTrainerBattle_SetUpForSpinOutro:
ldh [rSVBK], a ldh [rSVBK], a
call StartTrainerBattle_NextScene call StartTrainerBattle_NextScene
xor a xor a
ld [wcf64], a ld [wBattleTransitionCounter], a
ret ret
StartTrainerBattle_SpinToBlack: StartTrainerBattle_SpinToBlack:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld a, [wcf64] ld a, [wBattleTransitionCounter]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .spin_quadrants ld hl, .spin_quadrants
@ -388,13 +388,13 @@ endr
ld a, [hli] ld a, [hli]
cp -1 cp -1
jr z, .end jr z, .end
ld [wcf65], a ld [wBattleTransitionSineWaveOffset], a
call .load call .load
ld a, 1 ld a, 1
ldh [hBGMapMode], a ldh [hBGMapMode], a
call DelayFrame call DelayFrame
call DelayFrame call DelayFrame
ld hl, wcf64 ld hl, wBattleTransitionCounter
inc [hl] inc [hl]
ret ret
@ -464,7 +464,7 @@ ENDM
inc de inc de
.loop1 .loop1
ld [hl], BATTLETRANSITION_BLACK ld [hl], BATTLETRANSITION_BLACK
ld a, [wcf65] ld a, [wBattleTransitionSineWaveOffset]
bit RIGHT_QUADRANT_F, a bit RIGHT_QUADRANT_F, a
jr z, .leftside jr z, .leftside
inc hl inc hl
@ -475,7 +475,7 @@ ENDM
dec c dec c
jr nz, .loop1 jr nz, .loop1
pop hl pop hl
ld a, [wcf65] ld a, [wBattleTransitionSineWaveOffset]
bit LOWER_QUADRANT_F, a bit LOWER_QUADRANT_F, a
ld bc, SCREEN_WIDTH ld bc, SCREEN_WIDTH
jr z, .upper jr z, .upper
@ -490,7 +490,7 @@ ENDM
jr z, .loop jr z, .loop
ld c, a ld c, a
.loop2 .loop2
ld a, [wcf65] ld a, [wBattleTransitionSineWaveOffset]
bit RIGHT_QUADRANT_F, a bit RIGHT_QUADRANT_F, a
jr z, .leftside2 jr z, .leftside2
dec hl dec hl
@ -514,13 +514,13 @@ StartTrainerBattle_SetUpForRandomScatterOutro:
ldh [rSVBK], a ldh [rSVBK], a
call StartTrainerBattle_NextScene call StartTrainerBattle_NextScene
ld a, $10 ld a, $10
ld [wcf64], a ld [wBattleTransitionCounter], a
ld a, 1 ld a, 1
ldh [hBGMapMode], a ldh [hBGMapMode], a
ret ret
StartTrainerBattle_SpeckleToBlack: StartTrainerBattle_SpeckleToBlack:
ld hl, wcf64 ld hl, wBattleTransitionCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done

View File

@ -3006,10 +3006,11 @@ PlayerMonFaintedAnimation:
jp MonFaintedAnimation jp MonFaintedAnimation
MonFaintedAnimation: MonFaintedAnimation:
ld a, [wcfbe] ld a, [wJoypadDisable]
push af push af
set 6, a set JOYPAD_DISABLE_MON_FAINT_F, a
ld [wcfbe], a ld [wJoypadDisable], a
ld b, 7 ld b, 7
.OuterLoop: .OuterLoop:
@ -3052,7 +3053,7 @@ MonFaintedAnimation:
jr nz, .OuterLoop jr nz, .OuterLoop
pop af pop af
ld [wcfbe], a ld [wJoypadDisable], a
ret ret
.Spaces: .Spaces:
@ -4639,7 +4640,7 @@ CheckDanger:
PrintPlayerHUD: PrintPlayerHUD:
ld de, wBattleMonNick ld de, wBattleMonNick
hlcoord 10, 7 hlcoord 10, 7
call ret_3e138 call Battle_DummyFunction
call PlaceString call PlaceString
push bc push bc
@ -4725,7 +4726,7 @@ DrawEnemyHUD:
call GetBaseData call GetBaseData
ld de, wEnemyMonNick ld de, wEnemyMonNick
hlcoord 1, 0 hlcoord 1, 0
call ret_3e138 call Battle_DummyFunction
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
@ -4854,7 +4855,8 @@ UpdateHPPal:
ret z ret z
jp FinishBattleAnim jp FinishBattleAnim
ret_3e138: Battle_DummyFunction:
; called before placing either battler's nickname in the HUD
ret ret
BattleMenu: BattleMenu:

View File

@ -929,13 +929,13 @@ DebugColor_FillBoxWithByte:
ret ret
DebugColor_PushSGBPals: DebugColor_PushSGBPals:
ld a, [wcfbe] ld a, [wJoypadDisable]
push af push af
set 7, a set JOYPAD_DISABLE_SGB_TRANSFER_F, a
ld [wcfbe], a ld [wJoypadDisable], a
call _DebugColor_PushSGBPals call _DebugColor_PushSGBPals
pop af pop af
ld [wcfbe], a ld [wJoypadDisable], a
ret ret
_DebugColor_PushSGBPals: _DebugColor_PushSGBPals:

View File

@ -183,7 +183,7 @@ BattleTowerBattle:
call _BattleTowerBattle call _BattleTowerBattle
ret ret
DummySpecial_17021d: UnusedBattleTowerDummySpecial1:
ret ret
InitBattleTowerChallengeRAM: InitBattleTowerChallengeRAM:
@ -1008,11 +1008,11 @@ BattleTowerAction_SetExplanationRead:
BattleTowerAction_SetByteToQuickSaveChallenge: BattleTowerAction_SetByteToQuickSaveChallenge:
ld c, BATTLETOWER_SAVED_AND_LEFT ld c, BATTLETOWER_SAVED_AND_LEFT
jr asm_17079f jr SetBattleTowerChallengeState
BattleTowerAction_SetByteToCancelChallenge: BattleTowerAction_SetByteToCancelChallenge:
ld c, BATTLETOWER_NO_CHALLENGE ld c, BATTLETOWER_NO_CHALLENGE
asm_17079f: SetBattleTowerChallengeState:
ld a, BANK(sBattleTowerChallengeState) ld a, BANK(sBattleTowerChallengeState)
call OpenSRAM call OpenSRAM
ld a, c ld a, c
@ -1447,11 +1447,11 @@ Function1709bb: ; BattleTowerAction $10
Function170a9c: Function170a9c:
ld c, FALSE ld c, FALSE
jr asm_170aa2 jr Set_s5_aa8d
Function170aa0: Function170aa0:
ld c, TRUE ld c, TRUE
asm_170aa2: Set_s5_aa8d:
ld a, BANK(s5_aa8d) ld a, BANK(s5_aa8d)
call OpenSRAM call OpenSRAM
ld a, c ld a, c
@ -1576,7 +1576,7 @@ LoadOpponentTrainerAndPokemonWithOTSprite:
INCLUDE "data/trainers/sprites.asm" INCLUDE "data/trainers/sprites.asm"
DummySpecial_170bd2: UnusedBattleTowerDummySpecial2:
ret ret
CheckForBattleTowerRules: CheckForBattleTowerRules:

View File

@ -100,7 +100,7 @@ CelebiEvent_CountDown:
ret ret
CelebiEvent_SpawnLeaf: ; unreferenced CelebiEvent_SpawnLeaf: ; unreferenced
ld hl, wcf65 ld hl, wFrameCounter2
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
and $7 and $7

View File

@ -426,7 +426,7 @@ FlyFunction_FrameTimer:
ret ret
.SpawnLeaf: .SpawnLeaf:
ld hl, wcf65 ld hl, wFrameCounter2
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
and $7 and $7

View File

@ -56,11 +56,12 @@ NPCTrade::
call DisableSpriteUpdates call DisableSpriteUpdates
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
push af push af
ld a, [wcf64] ; wTradeDialog aliases wFrameCounter, which TradeAnimation uses
ld a, [wTradeDialog]
push af push af
predef TradeAnimation predef TradeAnimation
pop af pop af
ld [wcf64], a ld [wTradeDialog], a
pop af pop af
ld [wJumptableIndex], a ld [wJumptableIndex], a
call ReturnToMapWithSpeechTextbox call ReturnToMapWithSpeechTextbox
@ -107,7 +108,7 @@ Trade_GetDialog:
ld e, NPCTRADE_DIALOG ld e, NPCTRADE_DIALOG
call GetTradeAttribute call GetTradeAttribute
ld a, [hl] ld a, [hl]
ld [wcf64], a ld [wTradeDialog], a
ret ret
DoNPCTrade: DoNPCTrade:
@ -392,7 +393,7 @@ PrintTradeText:
ld bc, 2 * 4 ld bc, 2 * 4
ld hl, TradeTexts ld hl, TradeTexts
call AddNTimes call AddNTimes
ld a, [wcf64] ld a, [wTradeDialog]
ld c, a ld c, a
add hl, bc add hl, bc
add hl, bc add hl, bc

View File

@ -9,7 +9,7 @@ RotateUnownFrontpic:
push bc push bc
push hl push hl
push bc push bc
ld de, wd002 ld de, wPrintedUnownTileSource
call .Copy call .Copy
call .Rotate call .Rotate
ld hl, UnownPrinter_GBPrinterRectangle ld hl, UnownPrinter_GBPrinterRectangle
@ -19,10 +19,10 @@ RotateUnownFrontpic:
ld a, [hli] ld a, [hli]
ld e, a ld e, a
ld d, [hl] ld d, [hl]
ld hl, wd012 ld hl, wPrintedUnownTileDest
call .Copy call .Copy
pop hl pop hl
ld bc, $10 ld bc, LEN_2BPP_TILE
add hl, bc add hl, bc
pop bc pop bc
inc c inc c
@ -44,7 +44,7 @@ RotateUnownFrontpic:
ret ret
.Copy: .Copy:
ld c, $10 ld c, LEN_2BPP_TILE
.loop_copy .loop_copy
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -54,12 +54,12 @@ RotateUnownFrontpic:
ret ret
.Rotate: .Rotate:
ld hl, wd012 ld hl, wPrintedUnownTileDest
ld e, %10000000 ld e, %10000000
ld d, 8 ld d, 8
.loop_decompress .loop_decompress
push hl push hl
ld hl, wd002 ld hl, wPrintedUnownTileSource
call .CountSetBit call .CountSetBit
pop hl pop hl
ld a, b ld a, b

View File

@ -15,7 +15,7 @@ Special::
INCLUDE "data/events/special_pointers.asm" INCLUDE "data/events/special_pointers.asm"
DummySpecial_c224: UnusedDummySpecial:
ret ret
SetPlayerPalette: SetPlayerPalette:
@ -207,7 +207,7 @@ CardFlip:
call StartGameCornerGame call StartGameCornerGame
ret ret
DummyNonfunctionalGameCornerGame: UnusedDummyGame:
call CheckCoinsAndCoinCase call CheckCoinsAndCoinCase
ret c ret c
ld a, BANK(_DummyGame) ld a, BANK(_DummyGame)

View File

@ -133,11 +133,11 @@ endr
.next_try .next_try
dec [hl] dec [hl]
xor a xor a
ld [wcf64], a ld [wDummyGameCardChoice], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
.PickCard1: .PickCard1:
ld a, [wcf64] ld a, [wDummyGameCardChoice]
and a and a
ret z ret z
dec a dec a
@ -155,13 +155,13 @@ endr
call DummyGame_Card2Coord call DummyGame_Card2Coord
call DummyGame_PlaceCard call DummyGame_PlaceCard
xor a xor a
ld [wcf64], a ld [wDummyGameCardChoice], a
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
ret ret
.PickCard2: .PickCard2:
ld a, [wcf64] ld a, [wDummyGameCardChoice]
and a and a
ret z ret z
dec a dec a
@ -527,7 +527,7 @@ DummyGame_InterpretJoypad_AnimateCursor:
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
inc a inc a
ld [wcf64], a ld [wDummyGameCardChoice], a
ret ret
.pressed_left .pressed_left

View File

@ -249,7 +249,7 @@ DebugPrintSlotBias: ; unreferenced
AnimateSlotReelIcons: ; unreferenced AnimateSlotReelIcons: ; unreferenced
; This animation was present in pokegold-spaceworld. ; This animation was present in pokegold-spaceworld.
ld hl, wcf66 ld hl, wUnusedSlotReelIconDelay
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
and $7 and $7

View File

@ -43,7 +43,7 @@ LoadSGBLayoutCGB:
dw _CGB_PartyMenu dw _CGB_PartyMenu
dw _CGB_Evolution dw _CGB_Evolution
dw _CGB_GSTitleScreen dw _CGB_GSTitleScreen
dw _CGB0d dw _CGB_Unused0D
dw _CGB_MoveList dw _CGB_MoveList
dw _CGB_BetaPikachuMinigame dw _CGB_BetaPikachuMinigame
dw _CGB_PokedexSearchOption dw _CGB_PokedexSearchOption
@ -60,7 +60,7 @@ LoadSGBLayoutCGB:
dw _CGB_TradeTube dw _CGB_TradeTube
dw _CGB_TrainerOrMonFrontpicPals dw _CGB_TrainerOrMonFrontpicPals
dw _CGB_MysteryGift dw _CGB_MysteryGift
dw _CGB1e dw _CGB_Unused1E
_CGB_BattleGrayscale: _CGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale + 1 ld hl, PalPacket_BattleGrayscale + 1
@ -321,7 +321,7 @@ _CGB_BillsPC:
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a
ret ret
Function9009: ; unreferenced _CGB_Unknown: ; unreferenced
ld hl, BillsPCOrangePalette ld hl, BillsPCOrangePalette
call LoadHLPaletteIntoDE call LoadHLPaletteIntoDE
jr .GotPalette jr .GotPalette
@ -595,7 +595,7 @@ _CGB_GSTitleScreen:
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a
ret ret
_CGB0d: _CGB_Unused0D:
ld hl, PalPacket_Diploma + 1 ld hl, PalPacket_Diploma + 1
call CopyFourPalettes call CopyFourPalettes
call WipeAttrmap call WipeAttrmap
@ -911,7 +911,7 @@ _CGB_PlayerOrMonFrontpicPals:
call ApplyPals call ApplyPals
ret ret
_CGB1e: _CGB_Unused1E:
ld de, wBGPals1 ld de, wBGPals1
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
call GetMonPalettePointer call GetMonPalettePointer

View File

@ -136,6 +136,7 @@ SGB_ApplyPartyMenuHPPals:
Intro_LoadMagikarpPalettes: ; unreferenced Intro_LoadMagikarpPalettes: ; unreferenced
call CheckCGB call CheckCGB
ret z ret z
; CGB only ; CGB only
ld hl, .BGPal ld hl, .BGPal
ld de, wBGPals1 ld de, wBGPals1
@ -789,13 +790,13 @@ endr
ret ret
PushSGBPals: PushSGBPals:
ld a, [wcfbe] ld a, [wJoypadDisable]
push af push af
set 7, a set JOYPAD_DISABLE_SGB_TRANSFER_F, a
ld [wcfbe], a ld [wJoypadDisable], a
call _PushSGBPals call _PushSGBPals
pop af pop af
ld [wcfbe], a ld [wJoypadDisable], a
ret ret
_PushSGBPals: _PushSGBPals:
@ -841,12 +842,14 @@ _PushSGBPals:
InitSGBBorder: InitSGBBorder:
call CheckCGB call CheckCGB
ret nz ret nz
; SGB/DMG only ; SGB/DMG only
di di
ld a, [wcfbe] ld a, [wJoypadDisable]
push af push af
set 7, a set JOYPAD_DISABLE_SGB_TRANSFER_F, a
ld [wcfbe], a ld [wJoypadDisable], a
xor a xor a
ldh [rJOYP], a ldh [rJOYP], a
ldh [hSGB], a ldh [hSGB], a
@ -866,13 +869,14 @@ InitSGBBorder:
.skip .skip
pop af pop af
ld [wcfbe], a ld [wJoypadDisable], a
ei ei
ret ret
InitCGBPals:: InitCGBPals::
call CheckCGB call CheckCGB
ret z ret z
; CGB only ; CGB only
ld a, BANK(vTiles3) ld a, BANK(vTiles3)
ldh [rVBK], a ldh [rVBK], a

View File

@ -132,7 +132,7 @@ Function49420::
MG_Mobile_Layout01: MG_Mobile_Layout01:
call MG_Mobile_Layout_LoadPals call MG_Mobile_Layout_LoadPals
ld de, wBGPals1 palette PAL_BG_TEXT ld de, wBGPals1 palette PAL_BG_TEXT
ld hl, .Palette_49478 ld hl, .TextPalette
ld bc, 1 palettes ld bc, 1 palettes
ld a, BANK(wBGPals1) ld a, BANK(wBGPals1)
call FarCopyWRAM call FarCopyWRAM
@ -149,19 +149,18 @@ MG_Mobile_Layout01:
bit 6, a bit 6, a
jr z, .asm_49464 jr z, .asm_49464
call Function49480 call Function49480
jr .asm_49467 jr .done
.asm_49464 .asm_49464
call Function49496 call Function49496
.done
.asm_49467
farcall ApplyAttrmap farcall ApplyAttrmap
farcall ApplyPals farcall ApplyPals
ld a, TRUE ld a, TRUE
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a
ret ret
.Palette_49478: .TextPalette:
RGB 31, 31, 31 RGB 31, 31, 31
RGB 26, 31, 00 RGB 26, 31, 00
RGB 20, 16, 03 RGB 20, 16, 03
@ -194,7 +193,7 @@ Function49496:
INCLUDE "engine/tilesets/tileset_palettes.asm" INCLUDE "engine/tilesets/tileset_palettes.asm"
MG_Mobile_Layout02: MG_Mobile_Layout02:
ld hl, .Palette_49732 ld hl, .BGPalette
ld de, wBGPals1 ld de, wBGPals1
ld bc, 1 palettes ld bc, 1 palettes
ld a, BANK(wBGPals1) ld a, BANK(wBGPals1)
@ -202,20 +201,20 @@ MG_Mobile_Layout02:
farcall ApplyPals farcall ApplyPals
call MG_Mobile_Layout_WipeAttrmap call MG_Mobile_Layout_WipeAttrmap
farcall ApplyAttrmap farcall ApplyAttrmap
ld hl, .Palette_4973a ld hl, .OBPalette
ld de, wOBPals1 ld de, wOBPals1
ld bc, 1 palettes ld bc, 1 palettes
ld a, BANK(wOBPals1) ld a, BANK(wOBPals1)
call FarCopyWRAM call FarCopyWRAM
ret ret
.Palette_49732: .BGPalette:
RGB 31, 31, 31 RGB 31, 31, 31
RGB 23, 16, 07 RGB 23, 16, 07
RGB 23, 07, 07 RGB 23, 07, 07
RGB 03, 07, 20 RGB 03, 07, 20
.Palette_4973a: .OBPalette:
RGB 00, 00, 00 RGB 00, 00, 00
RGB 07, 05, 31 RGB 07, 05, 31
RGB 14, 18, 31 RGB 14, 18, 31

View File

@ -35,7 +35,7 @@ LoadSGBLayout:
dw .SGB_PartyMenu dw .SGB_PartyMenu
dw .SGB_Evolution dw .SGB_Evolution
dw .SGB_GSTitleScreen dw .SGB_GSTitleScreen
dw .SGB0d dw .SGB_Unused0D
dw .SGB_MoveList dw .SGB_MoveList
dw .SGB_BetaPikachuMinigame dw .SGB_BetaPikachuMinigame
dw .SGB_PokedexSearchOption dw .SGB_PokedexSearchOption
@ -52,7 +52,7 @@ LoadSGBLayout:
dw .SGB_TradeTube dw .SGB_TradeTube
dw .SGB_TrainerOrMonFrontpicPals dw .SGB_TrainerOrMonFrontpicPals
dw .SGB_MysteryGift dw .SGB_MysteryGift
dw .SGB1e dw .SGB_Unused1E
.SGB_BattleGrayscale: .SGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale ld hl, PalPacket_BattleGrayscale
@ -397,7 +397,7 @@ endr
ld de, BlkPacket_AllPal0 ld de, BlkPacket_AllPal0
ret ret
.SGB0d: .SGB_Unused0D:
.SGB_TrainerCard: .SGB_TrainerCard:
ld hl, PalPacket_Diploma ld hl, PalPacket_Diploma
ld de, BlkPacket_AllPal0 ld de, BlkPacket_AllPal0
@ -437,7 +437,7 @@ endr
ld de, wSGBPals + PALPACKET_LENGTH ld de, wSGBPals + PALPACKET_LENGTH
ret ret
.SGB1e: .SGB_Unused1E:
ld hl, PalPacket_Pal01 ld hl, PalPacket_Pal01
ld de, wSGBPals ld de, wSGBPals
ld bc, PALPACKET_LENGTH ld bc, PALPACKET_LENGTH
@ -450,7 +450,7 @@ endr
add hl, hl add hl, hl
ld de, PokemonPalettes ld de, PokemonPalettes
add hl, de add hl, de
ld a, [wcf65] ld a, [wUnusedSGB1eColorOffset]
and 3 and 3
sla a sla a
sla a sla a

View File

@ -357,7 +357,7 @@ AnimSeq_SlotsGolem:
AnimSeq_SlotsChansey: AnimSeq_SlotsChansey:
callfar Slots_AnimateChansey callfar Slots_AnimateChansey
ld hl, wcf64 ld hl, wSlotsDelay
ld a, [hl] ld a, [hl]
cp $2 cp $2
ret nz ret nz
@ -382,7 +382,7 @@ AnimSeq_SlotsChanseyEgg:
jr c, .move_right jr c, .move_right
call DeinitializeSprite call DeinitializeSprite
ld a, $4 ld a, $4
ld [wcf64], a ld [wSlotsDelay], a
ld de, SFX_PLACE_PUZZLE_PIECE_DOWN ld de, SFX_PLACE_PUZZLE_PIECE_DOWN
call PlaySFX call PlaySFX
ret ret
@ -819,7 +819,7 @@ AnimSeq_IntroUnown:
ret ret
AnimSeq_IntroUnownF: AnimSeq_IntroUnownF:
ld a, [wcf64] ld a, [wSlotsDelay]
cp $40 cp $40
ret nz ret nz
ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F_2 ld a, SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F_2

View File

@ -44,9 +44,9 @@ InitList:
ld a, h ld a, h
ld [wListPointer + 1], a ld [wListPointer + 1], a
ld a, e ld a, e
ld [wUnusedD102], a ld [wUnusedNamesPointer], a
ld a, d ld a, d
ld [wUnusedD102 + 1], a ld [wUnusedNamesPointer + 1], a
ld bc, ItemAttributes ld bc, ItemAttributes
ld a, c ld a, c
ld [wItemAttributesPtr], a ld [wItemAttributesPtr], a

View File

@ -165,9 +165,9 @@ Gen2ToGen1LinkComms:
ld hl, wTimeCapsulePlayerData ld hl, wTimeCapsulePlayerData
call Function2868a call Function2868a
ld a, LOW(wOTPartyMonOT) ld a, LOW(wOTPartyMonOT)
ld [wUnusedD102], a ld [wUnusedNamesPointer], a
ld a, HIGH(wOTPartyMonOT) ld a, HIGH(wOTPartyMonOT)
ld [wUnusedD102 + 1], a ld [wUnusedNamesPointer + 1], a
ld de, MUSIC_NONE ld de, MUSIC_NONE
call PlayMusic call PlayMusic
ldh a, [hSerialConnectionStatus] ldh a, [hSerialConnectionStatus]
@ -407,9 +407,9 @@ Gen2ToGen2LinkComms:
ld bc, wOTPartyDataEnd - wOTPartyMons ld bc, wOTPartyDataEnd - wOTPartyMons
call CopyBytes call CopyBytes
ld a, LOW(wOTPartyMonOT) ld a, LOW(wOTPartyMonOT)
ld [wUnusedD102], a ld [wUnusedNamesPointer], a
ld a, HIGH(wOTPartyMonOT) ld a, HIGH(wOTPartyMonOT)
ld [wUnusedD102 + 1], a ld [wUnusedNamesPointer + 1], a
ld de, MUSIC_NONE ld de, MUSIC_NONE
call PlayMusic call PlayMusic
ldh a, [hSerialConnectionStatus] ldh a, [hSerialConnectionStatus]

View File

@ -465,9 +465,9 @@ FinishContinueFunction:
xor a xor a
ld [wDontPlayMapMusicOnReload], a ld [wDontPlayMapMusicOnReload], a
ld [wLinkMode], a ld [wLinkMode], a
ld hl, wGameTimerPause ld hl, wGameTimerPaused
set GAMETIMERPAUSE_TIMER_PAUSED_F, [hl] set GAME_TIMER_PAUSED_F, [hl]
res GAMETIMERPAUSE_MOBILE_7_F, [hl] res GAME_TIMER_MOBILE_F, [hl]
ld hl, wEnteredMapFromContinue ld hl, wEnteredMapFromContinue
set 1, [hl] set 1, [hl]
farcall OverworldLoop farcall OverworldLoop

View File

@ -31,8 +31,8 @@ MainMenu:
ld b, SCGB_DIPLOMA ld b, SCGB_DIPLOMA
call GetSGBLayout call GetSGBLayout
call SetPalettes call SetPalettes
ld hl, wGameTimerPause ld hl, wGameTimerPaused
res GAMETIMERPAUSE_TIMER_PAUSED_F, [hl] res GAME_TIMER_PAUSED_F, [hl]
call MainMenu_GetWhichMenu call MainMenu_GetWhichMenu
ld [wWhichIndexSet], a ld [wWhichIndexSet], a
call MainMenu_PrintCurrentTimeAndDay call MainMenu_PrintCurrentTimeAndDay

View File

@ -20,7 +20,7 @@ ENDM
TradeAnimation: TradeAnimation:
xor a xor a
ld [wcf66], a ld [wUnusedTradeAnimPlayEvolutionMusic], a
ld hl, wPlayerTrademonSenderName ld hl, wPlayerTrademonSenderName
ld de, wOTTrademonSenderName ld de, wOTTrademonSenderName
call LinkTradeAnim_LoadTradePlayerNames call LinkTradeAnim_LoadTradePlayerNames
@ -71,7 +71,7 @@ TradeAnimation:
TradeAnimationPlayer2: TradeAnimationPlayer2:
xor a xor a
ld [wcf66], a ld [wUnusedTradeAnimPlayEvolutionMusic], a
ld hl, wOTTrademonSenderName ld hl, wOTTrademonSenderName
ld de, wPlayerTrademonSenderName ld de, wPlayerTrademonSenderName
call LinkTradeAnim_LoadTradePlayerNames call LinkTradeAnim_LoadTradePlayerNames
@ -137,7 +137,7 @@ RunTradeAnimScript:
push af push af
set NO_TEXT_SCROLL, [hl] set NO_TEXT_SCROLL, [hl]
call .TradeAnimLayout call .TradeAnimLayout
ld a, [wcf66] ld a, [wUnusedTradeAnimPlayEvolutionMusic]
and a and a
jr nz, .anim_loop jr nz, .anim_loop
ld de, MUSIC_EVOLUTION ld de, MUSIC_EVOLUTION
@ -225,7 +225,7 @@ DoTradeAnimation:
jr nz, .finished jr nz, .finished
call .DoTradeAnimCommand call .DoTradeAnimCommand
callfar PlaySpriteAnimations callfar PlaySpriteAnimations
ld hl, wcf65 ld hl, wFrameCounter2
inc [hl] inc [hl]
call DelayFrame call DelayFrame
and a and a
@ -273,8 +273,8 @@ DoTradeAnimation:
add_tradeanim TradeAnim_TextboxScrollStart ; 1e add_tradeanim TradeAnim_TextboxScrollStart ; 1e
add_tradeanim TradeAnim_ScrollOutRight ; 1f add_tradeanim TradeAnim_ScrollOutRight ; 1f
add_tradeanim TradeAnim_ScrollOutRight2 ; 20 add_tradeanim TradeAnim_ScrollOutRight2 ; 20
add_tradeanim TradeAnim_Wait80 ; 21 add_tradeanim TradeAnim_Wait80 ; 21
add_tradeanim TradeAnim_Wait40 ; 22 add_tradeanim TradeAnim_Wait40 ; 22
add_tradeanim TradeAnim_RockingBall ; 23 add_tradeanim TradeAnim_RockingBall ; 23
add_tradeanim TradeAnim_DropBall ; 24 add_tradeanim TradeAnim_DropBall ; 24
add_tradeanim TradeAnim_WaitAnim ; 25 add_tradeanim TradeAnim_WaitAnim ; 25
@ -285,9 +285,9 @@ DoTradeAnimation:
add_tradeanim TradeAnim_GetTrademonSFX ; 2a add_tradeanim TradeAnim_GetTrademonSFX ; 2a
add_tradeanim TradeAnim_End ; 2b add_tradeanim TradeAnim_End ; 2b
add_tradeanim TradeAnim_AnimateFrontpic ; 2c add_tradeanim TradeAnim_AnimateFrontpic ; 2c
add_tradeanim TradeAnim_Wait96 ; 2d add_tradeanim TradeAnim_Wait96 ; 2d
add_tradeanim TradeAnim_Wait80IfOTEgg ; 2e add_tradeanim TradeAnim_Wait80IfOTEgg ; 2e
add_tradeanim TradeAnim_Wait180IfOTEgg ; 2f add_tradeanim TradeAnim_Wait180IfOTEgg ; 2f
TradeAnim_IncrementJumptableIndex: TradeAnim_IncrementJumptableIndex:
ld hl, wJumptableIndex ld hl, wJumptableIndex
@ -1333,7 +1333,7 @@ LinkTradeAnim_LoadTradeMonSpecies:
ret ret
TradeAnim_FlashBGPals: TradeAnim_FlashBGPals:
ld a, [wcf65] ld a, [wFrameCounter2]
and $7 and $7
ret nz ret nz
ldh a, [rBGP] ldh a, [rBGP]

View File

@ -812,7 +812,7 @@ PlayerMovement:
CheckMenuOW: CheckMenuOW:
xor a xor a
ldh [hMenuReturn], a ldh [hMenuReturn], a
ldh [hUnusedFFA1], a ldh [hUnusedByte], a
ldh a, [hJoyPressed] ldh a, [hJoyPressed]
bit SELECT_F, a bit SELECT_F, a

View File

@ -458,11 +458,11 @@ Script_verbosegiveitem:
ld de, GiveItemScript ld de, GiveItemScript
jp ScriptCall jp ScriptCall
ret_96f76: GiveItemScript_DummyFunction:
ret ret
GiveItemScript: GiveItemScript:
callasm ret_96f76 callasm GiveItemScript_DummyFunction
writetext .ReceivedItemText writetext .ReceivedItemText
iffalse .Full iffalse .Full
waitsfx waitsfx
@ -2316,13 +2316,13 @@ Script_endall:
ret ret
Script_halloffame: Script_halloffame:
ld hl, wGameTimerPause ld hl, wGameTimerPaused
res GAMETIMERPAUSE_TIMER_PAUSED_F, [hl] res GAME_TIMER_PAUSED_F, [hl]
farcall StubbedTrainerRankings_HallOfFame farcall StubbedTrainerRankings_HallOfFame
farcall StubbedTrainerRankings_HallOfFame2 farcall StubbedTrainerRankings_HallOfFame2
farcall HallOfFame farcall HallOfFame
ld hl, wGameTimerPause ld hl, wGameTimerPaused
set GAMETIMERPAUSE_TIMER_PAUSED_F, [hl] set GAME_TIMER_PAUSED_F, [hl]
jr ReturnFromCredits jr ReturnFromCredits
Script_credits: Script_credits:

View File

@ -91,7 +91,7 @@ InitPokedex:
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wPrevDexEntryJumptableIndex], a ld [wPrevDexEntryJumptableIndex], a
ld [wPrevDexEntryBackup], a ld [wPrevDexEntryBackup], a
ld [wcf66], a ld [wUnusedPokedexByte], a
call Pokedex_CheckUnlockedUnownMode call Pokedex_CheckUnlockedUnownMode

View File

@ -92,7 +92,7 @@ PokeGear:
ld [wJumptableIndex], a ; POKEGEARSTATE_CLOCKINIT ld [wJumptableIndex], a ; POKEGEARSTATE_CLOCKINIT
ld [wPokegearCard], a ; POKEGEARCARD_CLOCK ld [wPokegearCard], a ; POKEGEARCARD_CLOCK
ld [wPokegearMapRegion], a ; JOHTO_REGION ld [wPokegearMapRegion], a ; JOHTO_REGION
ld [wcf66], a ld [wUnusedPokegearByte], a
ld [wPokegearPhoneScrollPosition], a ld [wPokegearPhoneScrollPosition], a
ld [wPokegearPhoneCursorPosition], a ld [wPokegearPhoneCursorPosition], a
ld [wPokegearPhoneSelectedPerson], a ld [wPokegearPhoneSelectedPerson], a
@ -2038,7 +2038,7 @@ _FlyMap:
lb bc, BANK(FlyMapLabelBorderGFX), 6 lb bc, BANK(FlyMapLabelBorderGFX), 6
call Request1bpp call Request1bpp
call FlyMap call FlyMap
call ret_91c8f call Pokegear_DummyFunction
ld b, SCGB_POKEGEAR_PALS ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout call GetSGBLayout
call SetPalettes call SetPalettes
@ -2243,7 +2243,7 @@ HasVisitedSpawn:
INCLUDE "data/maps/flypoints.asm" INCLUDE "data/maps/flypoints.asm"
ret_91c8f: Pokegear_DummyFunction:
ret ret
FlyMap: FlyMap:

View File

@ -782,9 +782,9 @@ BillsPC_InitRAM:
call ByteFill call ByteFill
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wcf64], a ld [wUnusedBillsPCData], a
ld [wcf65], a ld [wUnusedBillsPCData+1], a
ld [wcf66], a ld [wUnusedBillsPCData+2], a
ld [wBillsPC_CursorPosition], a ld [wBillsPC_CursorPosition], a
ld [wBillsPC_ScrollPosition], a ld [wBillsPC_ScrollPosition], a
ret ret

View File

@ -33,7 +33,7 @@ StatsScreenInit_gotaddress:
push af push af
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
ld b, a ld b, a
ld a, [wcf64] ld a, [wStatsScreenFlags]
ld c, a ld c, a
push bc push bc
@ -52,7 +52,7 @@ StatsScreenInit_gotaddress:
ld a, b ld a, b
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld a, c ld a, c
ld [wcf64], a ld [wStatsScreenFlags], a
pop af pop af
ld [wBoxAlignment], a ld [wBoxAlignment], a
pop af pop af
@ -63,11 +63,11 @@ StatsScreenMain:
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
; ??? ; ???
ld [wcf64], a ld [wStatsScreenFlags], a
ld a, [wcf64] ld a, [wStatsScreenFlags]
and $ff ^ STAT_PAGE_MASK and $ff ^ STAT_PAGE_MASK
or PINK_PAGE ; first_page or PINK_PAGE ; first_page
ld [wcf64], a ld [wStatsScreenFlags], a
.loop .loop
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
and $ff ^ (1 << 7) and $ff ^ (1 << 7)
@ -83,11 +83,11 @@ StatsScreenMobile:
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
; ??? ; ???
ld [wcf64], a ld [wStatsScreenFlags], a
ld a, [wcf64] ld a, [wStatsScreenFlags]
and $ff ^ STAT_PAGE_MASK and $ff ^ STAT_PAGE_MASK
or PINK_PAGE ; first_page or PINK_PAGE ; first_page
ld [wcf64], a ld [wStatsScreenFlags], a
.loop .loop
farcall Mobile_SetOverworldDelay farcall Mobile_SetOverworldDelay
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
@ -115,7 +115,7 @@ StatsScreenPointerTable:
dw StatsScreen_Exit dw StatsScreen_Exit
StatsScreen_WaitAnim: StatsScreen_WaitAnim:
ld hl, wcf64 ld hl, wStatsScreenFlags
bit 6, [hl] bit 6, [hl]
jr nz, .try_anim jr nz, .try_anim
bit 5, [hl] bit 5, [hl]
@ -126,10 +126,10 @@ StatsScreen_WaitAnim:
.try_anim .try_anim
farcall SetUpPokeAnim farcall SetUpPokeAnim
jr nc, .finish jr nc, .finish
ld hl, wcf64 ld hl, wStatsScreenFlags
res 6, [hl] res 6, [hl]
.finish .finish
ld hl, wcf64 ld hl, wStatsScreenFlags
res 5, [hl] res 5, [hl]
farcall HDMATransferTilemapToWRAMBank3 farcall HDMATransferTilemapToWRAMBank3
ret ret
@ -147,7 +147,7 @@ StatsScreen_Exit:
ret ret
MonStatsInit: MonStatsInit:
ld hl, wcf64 ld hl, wStatsScreenFlags
res 6, [hl] res 6, [hl]
call ClearBGPalettes call ClearBGPalettes
call ClearTilemap call ClearTilemap
@ -157,7 +157,7 @@ MonStatsInit:
cp EGG cp EGG
jr z, .egg jr z, .egg
call StatsScreen_InitUpperHalf call StatsScreen_InitUpperHalf
ld hl, wcf64 ld hl, wStatsScreenFlags
set 4, [hl] set 4, [hl]
ld h, 4 ld h, 4
call StatsScreen_SetJumptableIndex call StatsScreen_SetJumptableIndex
@ -217,7 +217,7 @@ if DEF(_DEBUG)
ld de, .HatchSoonString ld de, .HatchSoonString
hlcoord 8, 17 hlcoord 8, 17
call PlaceString call PlaceString
ld hl, wcf64 ld hl, wStatsScreenFlags
set 5, [hl] set 5, [hl]
pop hl pop hl
pop de pop de
@ -232,7 +232,7 @@ endc
StatsScreen_LoadPage: StatsScreen_LoadPage:
call StatsScreen_LoadGFX call StatsScreen_LoadGFX
ld hl, wcf64 ld hl, wStatsScreenFlags
res 4, [hl] res 4, [hl]
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
inc a inc a
@ -314,7 +314,7 @@ StatsScreen_GetJoypad:
StatsScreen_JoypadAction: StatsScreen_JoypadAction:
push af push af
ld a, [wcf64] ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES maskbits NUM_STAT_PAGES
ld c, a ld c, a
pop af pop af
@ -393,10 +393,10 @@ StatsScreen_JoypadAction:
ret ret
.set_page .set_page
ld a, [wcf64] ld a, [wStatsScreenFlags]
and $ff ^ STAT_PAGE_MASK and $ff ^ STAT_PAGE_MASK
or c or c
ld [wcf64], a ld [wStatsScreenFlags], a
ld h, 4 ld h, 4
call StatsScreen_SetJumptableIndex call StatsScreen_SetJumptableIndex
ret ret
@ -530,7 +530,7 @@ StatsScreen_LoadGFX:
call .ClearBox call .ClearBox
call .PageTilemap call .PageTilemap
call .LoadPals call .LoadPals
ld hl, wcf64 ld hl, wStatsScreenFlags
bit 4, [hl] bit 4, [hl]
jr nz, .place_frontpic jr nz, .place_frontpic
call SetPalettes call SetPalettes
@ -541,7 +541,7 @@ StatsScreen_LoadGFX:
ret ret
.ClearBox: .ClearBox:
ld a, [wcf64] ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES maskbits NUM_STAT_PAGES
ld c, a ld c, a
call StatsScreen_LoadPageIndicators call StatsScreen_LoadPageIndicators
@ -551,17 +551,17 @@ StatsScreen_LoadGFX:
ret ret
.LoadPals: .LoadPals:
ld a, [wcf64] ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES maskbits NUM_STAT_PAGES
ld c, a ld c, a
farcall LoadStatsScreenPals farcall LoadStatsScreenPals
call DelayFrame call DelayFrame
ld hl, wcf64 ld hl, wStatsScreenFlags
set 5, [hl] set 5, [hl]
ret ret
.PageTilemap: .PageTilemap:
ld a, [wcf64] ld a, [wStatsScreenFlags]
maskbits NUM_STAT_PAGES maskbits NUM_STAT_PAGES
dec a dec a
ld hl, .Jumptable ld hl, .Jumptable
@ -848,7 +848,7 @@ StatsScreen_PlaceFrontpic:
ret ret
.AnimateMon: .AnimateMon:
ld hl, wcf64 ld hl, wStatsScreenFlags
set 5, [hl] set 5, [hl]
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
cp UNOWN cp UNOWN
@ -890,7 +890,7 @@ StatsScreen_PlaceFrontpic:
ld d, $0 ld d, $0
ld e, ANIM_MON_MENU ld e, ANIM_MON_MENU
predef LoadMonAnimation predef LoadMonAnimation
ld hl, wcf64 ld hl, wStatsScreenFlags
set 6, [hl] set 6, [hl]
ret ret
@ -1033,7 +1033,7 @@ endc
.picked .picked
hlcoord 1, 9 hlcoord 1, 9
call PlaceString call PlaceString
ld hl, wcf64 ld hl, wStatsScreenFlags
set 5, [hl] set 5, [hl]
call SetPalettes ; pals call SetPalettes ; pals
call DelayFrame call DelayFrame
@ -1099,7 +1099,7 @@ StatsScreen_AnimateEgg:
hlcoord 0, 0 hlcoord 0, 0
ld d, $0 ld d, $0
predef LoadMonAnimation predef LoadMonAnimation
ld hl, wcf64 ld hl, wStatsScreenFlags
set 6, [hl] set 6, [hl]
ret ret

View File

@ -447,9 +447,11 @@ CheckCancelPrint:
ret ret
.pressed_b .pressed_b
ld a, [wca80] ld a, [wUnusedGameboyPrinterSafeCancelFlag]
cp $0c cp $0c
jr nz, .cancel jr nz, .cancel
; wait for printer activity to finish before canceling?
.loop .loop
ld a, [wPrinterOpcode] ld a, [wPrinterOpcode]
and a and a

View File

@ -32,8 +32,8 @@ GameTimer::
ret nz ret nz
; Is the timer paused? ; Is the timer paused?
ld hl, wGameTimerPause ld hl, wGameTimerPaused
bit GAMETIMERPAUSE_TIMER_PAUSED_F, [hl] bit GAME_TIMER_PAUSED_F, [hl]
ret z ret z
; Is the timer already capped? ; Is the timer already capped?

View File

@ -10,8 +10,8 @@ Reset::
ldh [rIE], a ldh [rIE], a
ei ei
ld hl, wcfbe ld hl, wJoypadDisable
set 7, [hl] set JOYPAD_DISABLE_SGB_TRANSFER_F, [hl]
ld c, 32 ld c, 32
call DelayFrames call DelayFrames
@ -50,7 +50,7 @@ Init::
ldh [rOBP1], a ldh [rOBP1], a
ldh [rTMA], a ldh [rTMA], a
ldh [rTAC], a ldh [rTAC], a
ld [wd000], a ld [wUnusedInitializedToZero], a
ld a, %100 ; Start timer at 4096Hz ld a, %100 ; Start timer at 4096Hz
ldh [rTAC], a ldh [rTAC], a

View File

@ -27,8 +27,8 @@ UpdateJoypad::
; hJoypadSum: pressed so far ; hJoypadSum: pressed so far
; Any of these three bits can be used to disable input. ; Any of these three bits can be used to disable input.
ld a, [wcfbe] ld a, [wJoypadDisable]
and %11010000 and (1 << JOYPAD_DISABLE_MON_FAINT_F) | (1 << JOYPAD_DISABLE_SGB_TRANSFER_F) | (1 << 4)
ret nz ret nz
; If we're saving, input is disabled. ; If we're saving, input is disabled.

View File

@ -56,9 +56,9 @@ GetName::
.done .done
ld a, e ld a, e
ld [wUnusedD102], a ld [wUnusedNamesPointer], a
ld a, d ld a, d
ld [wUnusedD102 + 1], a ld [wUnusedNamesPointer + 1], a
pop de pop de
pop bc pop bc

View File

@ -31,7 +31,7 @@ hVBlank:: db
hMapEntryMethod:: db hMapEntryMethod:: db
hMenuReturn:: db hMenuReturn:: db
hUnusedFFA1:: db hUnusedByte:: db
hJoypadReleased:: db hJoypadReleased:: db
hJoypadPressed:: db hJoypadPressed:: db

View File

@ -20,18 +20,18 @@ OpenSRAMBank4:
ret ret
Function89168: Function89168:
ld hl, wGameTimerPause ld hl, wGameTimerPaused
set GAMETIMERPAUSE_MOBILE_7_F, [hl] set GAME_TIMER_MOBILE_F, [hl]
ret ret
Function8916e: Function8916e:
ld hl, wGameTimerPause ld hl, wGameTimerPaused
res GAMETIMERPAUSE_MOBILE_7_F, [hl] res GAME_TIMER_MOBILE_F, [hl]
ret ret
Function89174: Function89174:
ld hl, wGameTimerPause ld hl, wGameTimerPaused
bit GAMETIMERPAUSE_MOBILE_7_F, [hl] bit GAME_TIMER_MOBILE_F, [hl]
ret ret
Function8917a: Function8917a:

View File

@ -2660,8 +2660,8 @@ Function1011f1:
call CloseSRAM call CloseSRAM
ld hl, wdc41 ld hl, wdc41
res 4, [hl] res 4, [hl]
ld hl, wGameTimerPause ld hl, wGameTimerPaused
bit GAMETIMERPAUSE_MOBILE_7_F, [hl] bit GAME_TIMER_MOBILE_F, [hl]
jr z, .skip jr z, .skip
ld hl, wdc41 ld hl, wdc41
set 4, [hl] set 4, [hl]
@ -4425,15 +4425,15 @@ Function101e98:
call ClearSprites call ClearSprites
farcall Function8adb3 farcall Function8adb3
ret c ret c
ld hl, wGameTimerPause ld hl, wGameTimerPaused
set GAMETIMERPAUSE_MOBILE_7_F, [hl] set GAME_TIMER_MOBILE_F, [hl]
ld hl, wdc41 ld hl, wdc41
set 4, [hl] set 4, [hl]
ret ret
Function101ead: Function101ead:
ld hl, wGameTimerPause ld hl, wGameTimerPaused
bit GAMETIMERPAUSE_MOBILE_7_F, [hl] bit GAME_TIMER_MOBILE_F, [hl]
jr nz, .asm_101ec8 jr nz, .asm_101ec8
ld hl, wdc41 ld hl, wdc41
bit 2, [hl] bit 2, [hl]

View File

@ -7,11 +7,11 @@ Function16c000: ; unreferenced
ldh a, [hSystemBooted] ldh a, [hSystemBooted]
and a and a
ret z ret z
; Set some flag, preserving the old state ; Disable the joypad during mobile setup
ld a, [wcfbe] ld a, [wJoypadDisable]
push af push af
set 7, a set JOYPAD_DISABLE_SGB_TRANSFER_F, a
ld [wcfbe], a ld [wJoypadDisable], a
; Do stuff ; Do stuff
call MobileSystemSplashScreen_InitGFX ; Load GFX call MobileSystemSplashScreen_InitGFX ; Load GFX
farcall SetRAMStateForMobile farcall SetRAMStateForMobile
@ -24,7 +24,7 @@ Function16c000: ; unreferenced
ldh [hSystemBooted], a ldh [hSystemBooted], a
; Restore the flag state ; Restore the flag state
pop af pop af
ld [wcfbe], a ld [wJoypadDisable], a
ret ret
.RunJumptable: .RunJumptable:

View File

@ -904,7 +904,7 @@ NEXTU
wGameboyPrinterRAM:: wGameboyPrinterRAM::
wGameboyPrinter2bppSource:: ds 40 tiles wGameboyPrinter2bppSource:: ds 40 tiles
wGameboyPrinter2bppSourceEnd:: wGameboyPrinter2bppSourceEnd::
wca80:: db wUnusedGameboyPrinterSafeCancelFlag:: db
wPrinterRowIndex:: db wPrinterRowIndex:: db
; Printer data ; Printer data
@ -1356,12 +1356,6 @@ wBattleTowerBattleEnded::
db db
UNION UNION
; unidentified
wcf64:: db
wcf65:: db
wcf66:: db
NEXTU
; intro data ; intro data
wIntroSceneFrameCounter:: db wIntroSceneFrameCounter:: db
wIntroSceneTimer:: db wIntroSceneTimer:: db
@ -1386,11 +1380,13 @@ else
wPrevDexEntryBackup:: wPrevDexEntryBackup::
wPokedexStatus:: db wPokedexStatus:: db
endc endc
wUnusedPokedexByte:: db
NEXTU NEXTU
; pokegear ; pokegear
wPokegearCard:: db wPokegearCard:: db
wPokegearMapRegion:: db wPokegearMapRegion:: db
wUnusedPokegearByte:: db
NEXTU NEXTU
; pack ; pack
@ -1405,11 +1401,21 @@ wTrainerCardBadgeTileID:: db
wTrainerCardBadgeAttributes:: db wTrainerCardBadgeAttributes:: db
NEXTU NEXTU
; card flip data ; slot machine
wSlotsDelay:: db
ds 1
wUnusedSlotReelIconDelay:: db
NEXTU
; card flip
wCardFlipCursorY:: db wCardFlipCursorY:: db
wCardFlipCursorX:: db wCardFlipCursorX:: db
wCardFlipWhichCard:: db wCardFlipWhichCard:: db
NEXTU
; dummy game
wDummyGameCardChoice:: db
NEXTU NEXTU
; magnet train ; magnet train
wMagnetTrainOffset:: db wMagnetTrainOffset:: db
@ -1422,6 +1428,16 @@ wHoldingUnownPuzzlePiece:: db
wUnownPuzzleCursorPosition:: db wUnownPuzzleCursorPosition:: db
wUnownPuzzleHeldPiece:: db wUnownPuzzleHeldPiece:: db
NEXTU
; battle transitions
wBattleTransitionCounter:: db
wBattleTransitionSineWaveOffset::
wBattleTransitionSpinQuadrant:: db
NEXTU
; bill's pc
wUnusedBillsPCData:: ds 3
NEXTU NEXTU
; debug mon color picker ; debug mon color picker
wDebugColorRGBJumptableIndex:: db wDebugColorRGBJumptableIndex:: db
@ -1434,22 +1450,35 @@ wDebugTilesetCurPalette:: db
wDebugTilesetRGBJumptableIndex:: db wDebugTilesetRGBJumptableIndex:: db
wDebugTilesetCurColor:: db wDebugTilesetCurColor:: db
NEXTU
; stats screen
wStatsScreenFlags:: db
NEXTU NEXTU
; battle tower ; battle tower
ds $2 wNrOfBeatenBattleTowerTrainers:: db
ds 1
wBattleTowerRoomMenuJumptableIndex:: db wBattleTowerRoomMenuJumptableIndex:: db
NEXTU NEXTU
; miscellaneous ; miscellaneous
wFrameCounter:: wFrameCounter::
wNrOfBeatenBattleTowerTrainers::
wMomBankDigitCursorPosition:: wMomBankDigitCursorPosition::
wNamingScreenLetterCase:: wNamingScreenLetterCase::
wHallOfFameMonCounter:: wHallOfFameMonCounter::
wSlotsDelay:: wTradeDialog::
db db
wFrameCounter2::
wPrinterQueueLength:: wPrinterQueueLength::
wUnusedSGB1eColorOffset::
db db
wUnusedTradeAnimPlayEvolutionMusic:: db
NEXTU
; mobile
wcf64:: db
wcf65:: db
wcf66:: db
ENDU ENDU
wRequested2bppSize:: db wRequested2bppSize:: db
@ -1553,18 +1582,18 @@ wFarCallBCBuffer:: dw
wcfbb:: db wcfbb:: db
wGameTimerPause:: wGameTimerPaused::
; bit 0: game timer paused ; bit 0: game timer paused
; bit 7: something mobile ; bit 7: something mobile
db db
ds 1 ds 1
wcfbe:: wJoypadDisable::
; bits 4, 6, or 7 can be used to disable joypad input ; bits 4, 6, or 7 can be used to disable joypad input
; bit 4 ; bit 4
; bit 6: mon fainted? ; bit 6: ongoing mon faint animation
; bit 7: SGB flag? ; bit 7: ongoing sgb data transfer
db db
ds 1 ds 1
@ -1635,7 +1664,7 @@ SECTION "WRAM 1", WRAMX
wGBCOnlyDecompressBuffer:: ; a $540-byte buffer that continues past this SECTION wGBCOnlyDecompressBuffer:: ; a $540-byte buffer that continues past this SECTION
wd000:: db wUnusedInitializedToZero:: db
wDefaultSpawnpoint:: db wDefaultSpawnpoint:: db
@ -1733,6 +1762,11 @@ wAddrOfBoxToPrint:: dw
wBankOfBoxToPrint:: db wBankOfBoxToPrint:: db
wWhichBoxToPrint:: db wWhichBoxToPrint:: db
NEXTU
; Unown printing
wPrintedUnownTileSource:: ds 1 tiles
wPrintedUnownTileDest:: ds 1 tiles
NEXTU NEXTU
; trainer HUD data ; trainer HUD data
ds 1 ds 1
@ -2017,7 +2051,8 @@ wMailboxItems:: ds MAILBOX_CAPACITY
ENDU ENDU
wListPointer:: dw wListPointer:: dw
wUnusedD102:: dw wUnusedNamesPointer:: dw
wItemAttributesPtr:: dw wItemAttributesPtr:: dw
wCurItem:: db wCurItem:: db