Optimize some HRAM usage

This commit is contained in:
xCrystal 2023-09-30 19:12:57 +02:00
parent 336b3e77af
commit e53ae0eac9
48 changed files with 254 additions and 258 deletions

View File

@ -72,8 +72,8 @@ DEF MONMENU_MENUOPTION EQU 1
DEF NUM_MONMENU_ITEMS EQU 8
; start/select menu return values
DEF HMENURETURN_SCRIPT EQU %10000000
DEF HMENURETURN_ASM EQU %11111111
DEF MENURETURN_SCRIPT EQU %10000000
DEF MENURETURN_ASM EQU %11111111
; PartyMenuQualityPointers indexes (see data/party_menu_qualities.asm)
const_def

View File

@ -1,5 +1,5 @@
; Special routines can be used with the "special" map script command.
; They often use wScriptVar for arguments and return values.
; They often use hScriptVar for arguments and return values.
MACRO add_special
\1Special::

View File

@ -2304,7 +2304,7 @@ This is a bug with `HaircutOrGrooming` in [engine/events/haircut.asm](https://gi
.ok
inc hl
ld a, [hli]
ld [wScriptVar], a
ldh [hScriptVar], a
ld c, [hl]
call ChangeHappiness
ret

View File

@ -102,7 +102,7 @@ $~~~~$*Exit overworld loop*
---
wMapStatus == MAPSTATUS_HANDLE: <c>the remainder of the code goes at this level</c>
> wOverworldDelay <= 2 <c>2 is *MaxOverworldDelay*</c>\
> hOverworldDelay <= 2 <c>2 is *MaxOverworldDelay*</c>\
> MapEventStatus == MAPEVENTS_ON:\
>$~~~~$*Get joypad* <c>update hJoyDown, hJoyReleased, hJoyPressed</c>\
>$~~~~$*Refresh pals*
@ -295,7 +295,7 @@ wMapStatus == MAPSTATUS_HANDLE: <c>the remainder of the code goes at this level<
>> **CheckObjectEnteringVisibleRange** (wPlayerStepFlags[PLAYERSTEP_STOP_F] == TRUE)
> DelayFrames(wOverworldDelay)
> DelayFrames(hOverworldDelay)
> <f>**HandleMapBackground**</f> <c>_UpdateSprites + ScrollScreen</c>

View File

@ -70,12 +70,12 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii
## `$15`: <code>setval <i>value</i></code>
<code>[wScriptVar] = <i>value</i></code>
<code>[hScriptVar] = <i>value</i></code>
## `$16`: <code>addval <i>value</i></code>
<code>[wScriptVar] += <i>value</i></code>
<code>[hScriptVar] += <i>value</i></code>
## `$17`: <code>random <i>value</i></code>
@ -86,12 +86,12 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii
## `$19`: <code>readmem <i>address</i></code>
<code>[wScriptVar] = [<i>address</i>]</code>
<code>[hScriptVar] = [<i>address</i>]</code>
## `$1A`: <code>writemem <i>address</i></code>
<code>[<i>address</i>] = [wScriptVar]</code>
<code>[<i>address</i>] = [hScriptVar]</code>
## `$1B`: <code>loadmem <i>address</i>, <i>value</i></code>
@ -101,12 +101,12 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii
## `$1C`: <code>readvar <i>variable</i></code>
<code>[wScriptVar] = GetVarAction(<i>variable</i>)</code>
<code>[hScriptVar] = GetVarAction(<i>variable</i>)</code>
## `$1D`: <code>writevar <i>variable</i></code>
<code>GetVarAction(<i>variable</i>) = [wScriptVar]</code>
<code>GetVarAction(<i>variable</i>) = [hScriptVar]</code>
## `$1E`: <code>loadvar <i>variable</i>, <i>value</i></code>
@ -216,21 +216,21 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii
## `$3F`: <code>getnum <i>string_buffer</i></code>
<code>GetStringBuffer(<i>string_buffer</i>) = PrintNum([wScriptVar])</code>
<code>GetStringBuffer(<i>string_buffer</i>) = PrintNum([hScriptVar])</code>
## `$40`: <code>getmonname <i>string_buffer</i>, <i>mon_id</i></code>
<code>GetStringBuffer(<i>string_buffer</i>) = GetPokemonName(<i>mon_id</i>)</code>
If <code><i>mon_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead.
If <code><i>mon_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[hScriptVar]` instead.
## `$41`: <code>getitemname <i>string_buffer</i>, <i>item_id</i></code>
<code>GetStringBuffer(<i>string_buffer</i>) = GetItemName(<i>item_id</i>)</code>
If <code><i>item_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead.
If <code><i>item_id</i></code> = `USE_SCRIPT_VAR`, then it uses `[hScriptVar]` instead.
## `$42`: <code>getcurlandmarkname <i>string_buffer</i></code>

View File

@ -193,9 +193,9 @@ BattleAnimDelayFrame:
; Like DelayFrame but wastes battery life.
ld a, 1
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
.wait
ld a, [wVBlankOccurred]
ldh a, [hVBlankOccurred]
and a
jr nz, .wait
ret

View File

@ -53,11 +53,11 @@ BoardMenuScript::
done
.SubmenuCallback:
; if submenu has requested a callback through hMenuReturn,
; if submenu has requested a callback through wMenuReturn,
; it has also taken care of queuing it into wQueuedScriptBank/wQueuedScriptAddr.
readmem hMenuReturn
ifequal HMENURETURN_SCRIPT, .CallbackScript
ifequal HMENURETURN_ASM, .CallbackAsm
readmem wMenuReturn
ifequal MENURETURN_SCRIPT, .CallbackScript
ifequal MENURETURN_ASM, .CallbackAsm
end
.CallbackScript:
@ -68,7 +68,7 @@ BoardMenuScript::
end
BoardMenu::
; returns the selected menu item (BOARDMENUITEM_*) in wScriptVar upon exit
; returns the selected menu item (BOARDMENUITEM_*) in hScriptVar upon exit
ld a, [wBoardMenuLastCursorPosition]
cp NUM_BOARD_MENU_ITEMS
jr c, .ok
@ -107,7 +107,7 @@ BoardMenu::
ld hl, wDisplaySecondarySprites
res SECONDARYSPRITES_BOARD_MENU_F, [hl]
ld a, [wBoardMenuCursorPosition]
ld [wScriptVar], a
ldh [hScriptVar], a
ret
DrawBoardMenuTilesAndClearPriorityAttr:
@ -217,13 +217,13 @@ DIE_MAX_NUMBER EQU 6
ld hl, wDisplaySecondarySprites
res SECONDARYSPRITES_DIE_ROLL_F, [hl]
xor a ; FALSE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.confirm_roll
call UpdateSprites
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
BoardMenu_BreakDieAnimation:
@ -341,8 +341,8 @@ BoardMenu_Party:
.quit
; if quitted party menu after using field move
call BoardMenu_CloseSubmenu
ld a, HMENURETURN_SCRIPT
ldh [hMenuReturn], a
ld a, MENURETURN_SCRIPT
ld [wMenuReturn], a
ret
BoardMenu_Pack:
@ -352,8 +352,8 @@ BoardMenu_Pack:
ld a, [wPackUsedItem]
and a
ret z
ld a, HMENURETURN_SCRIPT
ldh [hMenuReturn], a
ld a, MENURETURN_SCRIPT
ld [wMenuReturn], a
ret
BoardMenu_Pokegear:
@ -363,7 +363,7 @@ BoardMenu_Pokegear:
BoardMenu_OpenSubmenu:
xor a
ldh [hMenuReturn], a
ld [wMenuReturn], a
ldh [hBGMapMode], a
call LoadStandardMenuHeader
farcall FadeOutPalettesToWhite

View File

@ -24,7 +24,7 @@ BuenasPassword:
.wrong
ld a, b
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.MenuHeader:

View File

@ -5,7 +5,7 @@ AskRememberPassword:
ld a, $1
.okay
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.DoMenu:

View File

@ -88,12 +88,12 @@ ContestDropOffMons:
; ... and replacing it with the terminator byte
ld [hl], -1
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.fainted
ld a, $1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
ContestReturnMons:

View File

@ -303,12 +303,12 @@ CheckCaughtCelebi:
bit BATTLERESULT_CAUGHT_CELEBI, a
jr z, .false
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
jr .done
.false
xor a ; FALSE
ld [wScriptVar], a
ldh [hScriptVar], a
.done
ret

View File

@ -413,14 +413,14 @@ DayCareManOutside:
.Load0:
call PrintText1bpp
xor a ; FALSE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.PartyFull:
ld hl, .NoRoomForEggText
call PrintText1bpp
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.FoundAnEggText:

View File

@ -1,9 +1,9 @@
GiveDratini:
; if wScriptVar is 0 or 1, change the moveset of the last Dratini in the party.
; if hScriptVar is 0 or 1, change the moveset of the last Dratini in the party.
; 0: give it a special moveset with Extremespeed.
; 1: give it the normal moveset of a level 15 Dratini.
ld a, [wScriptVar]
ldh a, [hScriptVar]
cp $2
ret nc
ld bc, wPartyCount
@ -30,7 +30,7 @@ GiveDratini:
.GiveMoveset:
push hl
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld hl, .Movesets
ld bc, .Moveset1 - .Moveset0
call AddNTimes

View File

@ -50,7 +50,7 @@ CheckFruitTree:
ld b, 2
call GetFruitTreeFlag
ld a, c
ld [wScriptVar], a
ldh [hScriptVar], a
ret
PickedFruitTree:

View File

@ -2,14 +2,14 @@ BillsGrandfather:
farcall SelectMonFromParty
jr c, .cancel
ld a, [wCurPartySpecies]
ld [wScriptVar], a
ldh [hScriptVar], a
ld [wNamedObjectIndex], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
.cancel
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
OlderHaircutBrother:
@ -48,19 +48,19 @@ HaircutOrGrooming:
.ok
inc hl
ld a, [hli]
ld [wScriptVar], a
ldh [hScriptVar], a
ld c, [hl]
call ChangeHappiness
ret
.nope
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.egg
ld a, 1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
INCLUDE "data/events/happiness_probabilities.asm"

View File

@ -13,7 +13,7 @@ GetFirstPokemonHappiness:
.done
ld [wNamedObjectIndex], a
ld a, [hl]
ld [wScriptVar], a
ldh [hScriptVar], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
@ -26,7 +26,7 @@ CheckFirstMonIsEgg:
xor a
.egg
ld [wScriptVar], a
ldh [hScriptVar], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3

View File

@ -12,11 +12,11 @@ HealMachineAnim:
ld a, [wPartyCount]
and a
ret z
; The location of the healing machine relative to the player is stored in wScriptVar.
; The location of the healing machine relative to the player is stored in hScriptVar.
; 0: Up and left (Pokemon Center)
; 1: Left (Elm's Lab)
; 2: Up (Hall of Fame)
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld [wHealMachineAnimType], a
ldh a, [rOBP1]
ld [wHealMachineTempOBP1], a

View File

@ -30,7 +30,7 @@ SelectApricornForKurt:
ld [wMenuSelection], a
call Kurt_SelectApricorn
ld a, c
ld [wScriptVar], a
ldh [hScriptVar], a
and a
jr z, .done
ld [wCurItem], a

View File

@ -1,6 +1,6 @@
CheckForLuckyNumberWinners:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ld [wTempByteValue], a
ld a, [wPartyCount]
and a
@ -79,7 +79,7 @@ CheckForLuckyNumberWinners:
cp EGG
jr z, .SkipBoxMon
call .CompareLuckyNumberToMonID ; sets wScriptVar and wCurPartySpecies appropriately
call .CompareLuckyNumberToMonID ; sets hScriptVar and wCurPartySpecies appropriately
jr nc, .SkipBoxMon
ld a, TRUE
ld [wTempByteValue], a
@ -100,7 +100,7 @@ CheckForLuckyNumberWinners:
jr c, .BoxesLoop
call CloseSRAM
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
ret z ; found nothing
@ -167,7 +167,7 @@ CheckForLuckyNumberWinners:
.okay
inc b
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jr z, .bettermatch
cp b
@ -176,7 +176,7 @@ CheckForLuckyNumberWinners:
.bettermatch
dec b
ld a, b
ld [wScriptVar], a
ldh [hScriptVar], a
pop bc
ld a, b
ld [wCurPartySpecies], a

View File

@ -52,22 +52,22 @@ CheckMagikarpLength:
call SkipNames
call CopyBytes
ld a, MAGIKARPLENGTH_BEAT_RECORD
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.not_long_enough
ld a, MAGIKARPLENGTH_TOO_SHORT
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.declined
ld a, MAGIKARPLENGTH_REFUSED
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.not_magikarp
xor a ; MAGIKARPLENGTH_NOT_MAGIKARP
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.MagikarpGuruMeasureText:

View File

@ -1,5 +1,5 @@
MagnetTrain:
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jr nz, .ToGoldenrod
ld a, 1 ; forwards

View File

@ -37,7 +37,7 @@ FindItemInBallScript::
.TryReceiveItem:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ld a, [wItemBallItemID]
ld [wNamedObjectIndex], a
call GetItemName
@ -51,5 +51,5 @@ FindItemInBallScript::
call ReceiveItem
ret nc
ld a, $1
ld [wScriptVar], a
ldh [hScriptVar], a
ret

View File

@ -23,18 +23,18 @@ MoveTutor:
call CheckCanLearnMoveTutorMove
jr nc, .loop
xor a ; FALSE
ld [wScriptVar], a
ldh [hScriptVar], a
jr .quit
.cancel
ld a, -1
ld [wScriptVar], a
ldh [hScriptVar], a
.quit
call CloseSubmenu
ret
.GetMoveTutorMove:
ld a, [wScriptVar]
ldh a, [hScriptVar]
cp MOVETUTOR_FLAMETHROWER
jr z, .flamethrower
cp MOVETUTOR_THUNDERBOLT

View File

@ -678,12 +678,12 @@ Script_UsedWaterfall:
.CheckContinueWaterfall:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ld a, [wPlayerTile]
call CheckWaterfallTile
ret z
ld a, $1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.WaterfallStep:
@ -1070,7 +1070,7 @@ TryStrengthOW:
jr .done
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
WhirlpoolFunction:
@ -1409,7 +1409,7 @@ HasRockSmash:
xor a
jr .done
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
FishFunction:
@ -1570,7 +1570,7 @@ Fishing_CheckFacingUp:
xor a
.up
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_FishCastRod:
@ -1776,11 +1776,11 @@ AskCutScript:
.CheckMap:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call CheckMapForSomethingToCut
ret c
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
AskCutText:

View File

@ -1,5 +1,5 @@
PlaySlowCry:
ld a, [wScriptVar]
ldh a, [hScriptVar]
call LoadCry
jr c, .done

View File

@ -142,7 +142,7 @@ DoPoisonStep::
jr nz, .party_loop
predef CheckPlayerPartyForFitMon
ld a, d
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.PoisonFaintText:

View File

@ -57,12 +57,12 @@ GiveShuckle:
ld hl, wDailyFlags1
set DAILYFLAGS1_GOT_SHUCKIE_TODAY_F, [hl]
ld a, 1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.NotGiven:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
SpecialShuckleOT:
@ -123,20 +123,20 @@ ReturnShuckie:
callfar RemoveMonFromPartyOrBox
ld a, SHUCKIE_RETURNED
.HappyToStayWithYou:
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.refused
ld a, SHUCKIE_REFUSED
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.DontReturn:
xor a ; SHUCKIE_WRONG_MON
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.fainted
ld a, SHUCKIE_FAINTED
ld [wScriptVar], a
ldh [hScriptVar], a
ret

View File

@ -16,55 +16,55 @@ Special::
INCLUDE "data/events/special_pointers.asm"
SetPlayerPalette:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld d, a
farcall _SetPlayerPalette
ret
GameCornerPrizeMonCheckDex:
ld a, [wScriptVar]
ldh a, [hScriptVar]
dec a
call CheckCaughtMon
ret nz
ld a, [wScriptVar]
ldh a, [hScriptVar]
dec a
call SetSeenAndCaughtMon
call FadeToMenu
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld [wNamedObjectIndex], a
farcall NewPokedexEntry
call ExitAllMenus
ret
UnusedSetSeenMon:
ld a, [wScriptVar]
ldh a, [hScriptVar]
dec a
call SetSeenMon
ret
FindPartyMonAboveLevel:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld b, a
farcall _FindPartyMonAboveLevel
jr z, FoundNone
jr FoundOne
FindPartyMonAtLeastThatHappy:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld b, a
farcall _FindPartyMonAtLeastThatHappy
jr z, FoundNone
jr FoundOne
FindPartyMonThatSpecies:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld b, a
farcall _FindPartyMonThatSpecies
jr z, FoundNone
jr FoundOne
FindPartyMonThatSpeciesYourTrainerID:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld b, a
farcall _FindPartyMonThatSpeciesYourTrainerID
jr z, FoundNone
@ -72,12 +72,12 @@ FindPartyMonThatSpeciesYourTrainerID:
FoundOne:
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
FoundNone:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
NameRival:
@ -116,20 +116,20 @@ DisplayLinkRecord:
PlayersHousePC:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
farcall _PlayersHousePC
ld a, c
ld [wScriptVar], a
ldh [hScriptVar], a
ret
BugContestJudging:
farcall _BugContestJudging
ld a, b
ld [wScriptVar], a
ldh [hScriptVar], a
ret
MapRadio:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld e, a
farcall PlayRadio
ret
@ -138,7 +138,7 @@ UnownPuzzle:
call FadeToMenu
farcall _UnownPuzzle
ld a, [wSolvedUnownPuzzle]
ld [wScriptVar], a
ldh [hScriptVar], a
call ExitAllMenus
ret
@ -221,15 +221,15 @@ ClearBGPalettesBufferScreen:
ScriptReturnCarry:
jr c, .carry
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.carry
ld a, 1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
ActivateFishingSwarm:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld [wFishingSwarmFlag], a
ret
@ -272,7 +272,7 @@ SnorlaxAwake:
; next to Snorlax.
; outputs:
; wScriptVar is 1 if the conditions are met, otherwise 0.
; hScriptVar is 1 if the conditions are met, otherwise 0.
; check background music
ld a, [wMapMusic]
@ -305,7 +305,7 @@ SnorlaxAwake:
.nope
xor a
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.ProximityCoords:
@ -339,7 +339,7 @@ GameboyCheck:
.cgb
ld a, GBCHECK_CGB
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
FadeOutMusic:

View File

@ -48,12 +48,12 @@ SweetScentEncounter:
.start_battle
ld a, $1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.no_battle
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ld [wBattleType], a
ret

View File

@ -16,12 +16,12 @@ TreeMonEncounter:
ld a, BATTLETYPE_TREE
ld [wBattleType], a
ld a, 1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.no_battle
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
RockMonEncounter:

View File

@ -77,7 +77,7 @@ SpecialKabutoChamber:
ret
DisplayUnownWords:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld hl, MenuHeaders_UnownWalls
and a
jr z, .load
@ -102,7 +102,7 @@ DisplayUnownWords:
ld e, SCREEN_WIDTH
add hl, de
add hl, de
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld c, a
ld de, UnownWalls
and a

View File

@ -211,7 +211,7 @@ SlotsLoop:
ret
.matching_sevens
ld a, [wTextDelayFrames]
ldh a, [hTextDelayFrames]
and $7
ret nz
ldh a, [rBGP]
@ -1638,7 +1638,7 @@ Slots_InitBias:
and a
ret z
ld hl, .Normal
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jr z, .okay
ld hl, .Lucky

View File

@ -794,7 +794,7 @@ PuzzlePieceBorderData:
INCBIN "gfx/unown_puzzle/tile_borders.2bpp"
LoadUnownPuzzlePiecesGFX:
ld a, [wScriptVar]
ldh a, [hScriptVar]
maskbits NUM_UNOWN_PUZZLES
ld e, a
ld d, 0

View File

@ -206,7 +206,7 @@ Gen2ToGen2LinkComms:
call Link_PrepPartyData_Gen2
call FixDataForLinkTransfer
call CheckLinkTimeout_Gen2
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jp z, LinkTimeout
ldh a, [hSerialConnectionStatus]
@ -1574,8 +1574,6 @@ ExitLinkCommunications:
call GetCGBLayout
call WaitBGMap2
xor a
ld [wUnusedLinkCommunicationByte], a
xor a
ldh [rSB], a
ldh [hSerialSend], a
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
@ -2041,7 +2039,7 @@ INCLUDE "engine/movie/trade_animation.asm"
CheckTimeCapsuleCompatibility:
; Checks to see if your party is compatible with the Gen 1 games.
; Returns the following in wScriptVar:
; Returns the following in hScriptVar:
; 0: Party is okay
; 1: At least one Pokémon was introduced in Gen 2
; 2: At least one Pokémon has a move that was introduced in Gen 2
@ -2117,7 +2115,7 @@ CheckTimeCapsuleCompatibility:
ld a, $3
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
GetIncompatibleMonName:
@ -2299,12 +2297,12 @@ WaitForLinkedFriend:
ld c, 50
call DelayFrames
ld a, $1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.done
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
CheckLinkTimeout_Receptionist:
@ -2323,13 +2321,13 @@ CheckLinkTimeout_Receptionist:
call Link_CheckCommunicationError
xor a
ldh [hVBlank], a
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
ret nz
jp Link_ResetSerialRegistersAfterLinkClosure
CheckLinkTimeout_Gen2:
; if wScriptVar = 0 on exit, link connection is closed
; if hScriptVar = 0 on exit, link connection is closed
ld a, $5
ld [wPlayerLinkAction], a
ld hl, wLinkTimeoutFrames
@ -2343,7 +2341,7 @@ CheckLinkTimeout_Gen2:
call DelayFrame
call DelayFrame
call Link_CheckCommunicationError
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jr z, .exit
@ -2380,7 +2378,7 @@ endc
.timeout
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.exit
@ -2412,7 +2410,7 @@ Link_CheckCommunicationError:
ld a, TRUE
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ld hl, wLinkTimeoutFrames
xor a
ld [hli], a
@ -2470,7 +2468,7 @@ TryQuickSave:
vc_hook Wireless_TryQuickSave_block_input_2
xor a ; FALSE
.return_result
ld [wScriptVar], a
ldh [hScriptVar], a
ld c, 30
call DelayFrames
pop af
@ -2495,12 +2493,12 @@ CheckBothSelectedSameRoom:
xor a
ldh [hVBlank], a
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.fail
xor a ; FALSE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
TimeCapsule:
@ -2598,7 +2596,7 @@ CableClubCheckWhichChris:
dec a ; FALSE
.yes
ld [wScriptVar], a
ldh [hScriptVar], a
ret
GSLinkCommsBorderGFX: ; unreferenced

View File

@ -122,14 +122,14 @@ StartMenu::
.ExitMenuRunScript:
call ExitMenu
ld a, HMENURETURN_SCRIPT
ldh [hMenuReturn], a
ld a, MENURETURN_SCRIPT
ld [wMenuReturn], a
ret
.ExitMenuRunScriptCloseText:
call ExitMenu
ld a, HMENURETURN_SCRIPT
ldh [hMenuReturn], a
ld a, MENURETURN_SCRIPT
ld [wMenuReturn], a
jr .ReturnEnd2
.ExitMenuCallFuncCloseText:

View File

@ -100,7 +100,7 @@ CheckWildEncountersScriptFlag:
StartMap:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
xor a
ld [wScriptRunning], a
ld hl, wMapStatus
@ -179,11 +179,11 @@ MaxOverworldDelay:
ResetOverworldDelay:
ld a, [MaxOverworldDelay]
ld [wOverworldDelay], a
ldh [hOverworldDelay], a
ret
NextOverworldFrame:
ld a, [wOverworldDelay]
ldh a, [hOverworldDelay]
and a
ret z
ld c, a
@ -806,7 +806,7 @@ PlayerMovementPointers:
CheckMenuOW:
xor a
ldh [hMenuReturn], a
ld [wMenuReturn], a
ldh a, [hJoyPressed]
bit SELECT_F, a
@ -843,9 +843,9 @@ SelectMenuScript:
StartMenuCallback:
SelectMenuCallback:
readmem hMenuReturn
ifequal HMENURETURN_SCRIPT, .Script
ifequal HMENURETURN_ASM, .Asm
readmem wMenuReturn
ifequal MENURETURN_SCRIPT, .Script
ifequal MENURETURN_ASM, .Asm
end
.Script:

View File

@ -389,7 +389,7 @@ Script_yesorno:
jr c, .no
ld a, TRUE
.no
ld [wScriptVar], a
ldh [hScriptVar], a
vc_hook Unknown_yesorno_ret
ret
@ -413,7 +413,7 @@ Script_pokepic:
call GetScriptByte
and a
jr nz, .ok
ld a, [wScriptVar]
ldh a, [hScriptVar]
.ok
ld [wCurPartySpecies], a
farcall Pokepic
@ -431,7 +431,7 @@ Script_verticalmenu:
jr nc, .ok
xor a
.ok
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script__2dmenu:
@ -442,7 +442,7 @@ Script__2dmenu:
jr nc, .ok
xor a
.ok
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_battletowertext:
@ -490,7 +490,7 @@ Script_verbosegiveitemvar:
call GetScriptByte
cp ITEM_FROM_MEM
jr nz, .ok
ld a, [wScriptVar]
ldh a, [hScriptVar]
.ok
ld [wCurItem], a
call GetScriptByte
@ -503,7 +503,7 @@ Script_verbosegiveitemvar:
jr c, .ok2
xor a
.ok2
ld [wScriptVar], a
ldh [hScriptVar], a
call CurItemName
ld de, wStringBuffer1
ld a, STRING_BUFFER_4
@ -587,7 +587,7 @@ Script_pokemart:
Script_elevator:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld e, a
call GetScriptByte
@ -597,7 +597,7 @@ Script_elevator:
farcall Elevator
ret c
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_trade:
@ -636,7 +636,7 @@ Script_askforphonenumber:
call GetScriptByte
ld a, PHONE_CONTACT_REFUSED
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_describedecoration:
@ -690,7 +690,7 @@ Script_scripttalkafter:
Script_trainerflagaction:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ld hl, wTempTrainerEventFlag
ld e, [hl]
inc hl
@ -702,7 +702,7 @@ Script_trainerflagaction:
and a
ret z
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_winlosstext:
@ -726,12 +726,12 @@ Script_endifjustbattled:
Script_checkjustbattled:
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ld a, [wRunningTrainerBattleScript]
and a
ret nz
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_encountermusic:
@ -791,7 +791,7 @@ Script_cry:
pop af
and a
jr nz, .ok
ld a, [wScriptVar]
ldh a, [hScriptVar]
.ok
call PlayMonCry
ret
@ -1059,7 +1059,7 @@ Script_loademote:
call GetScriptByte
cp EMOTE_FROM_MEM
jr nz, .not_var_emote
ld a, [wScriptVar]
ldh a, [hScriptVar]
.not_var_emote
ld c, a
farcall LoadEmote
@ -1067,7 +1067,7 @@ Script_loademote:
Script_showemote:
call GetScriptByte
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
call GetScriptObject
cp LAST_TALKED
@ -1165,7 +1165,7 @@ Script_startbattle:
predef StartBattle
ld a, [wBattleResult]
and ~BATTLERESULT_BITMASK
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_catchtutorial:
@ -1308,33 +1308,33 @@ Script_memjump:
jp ScriptJump
Script_iffalse:
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jp nz, SkipTwoScriptBytes
jp Script_sjump
Script_iftrue:
ld a, [wScriptVar]
ldh a, [hScriptVar]
and a
jp nz, Script_sjump
jp SkipTwoScriptBytes
Script_ifequal:
call GetScriptByte
ld hl, wScriptVar
ld hl, hScriptVar
cp [hl]
jr z, Script_sjump
jr SkipTwoScriptBytes
Script_ifnotequal:
call GetScriptByte
ld hl, wScriptVar
ld hl, hScriptVar
cp [hl]
jr nz, Script_sjump
jr SkipTwoScriptBytes
Script_ifgreater:
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld b, a
call GetScriptByte
cp b
@ -1344,7 +1344,7 @@ Script_ifgreater:
Script_ifless:
call GetScriptByte
ld b, a
ld a, [wScriptVar]
ldh a, [hScriptVar]
cp b
jr c, Script_sjump
jr SkipTwoScriptBytes
@ -1404,12 +1404,12 @@ Script_sdefer:
Script_checkscene:
call CheckScenes
jr z, .no_scene
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.no_scene
ld a, $ff
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_checkmapscene:
@ -1422,12 +1422,12 @@ Script_checkmapscene:
or e
jr z, .no_scene
ld a, [de]
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.no_scene
ld a, $ff
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_setscene:
@ -1458,7 +1458,7 @@ Script_readmem:
call GetScriptByte
ld h, a
ld a, [hl]
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_writemem:
@ -1466,7 +1466,7 @@ Script_writemem:
ld l, a
call GetScriptByte
ld h, a
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld [hl], a
ret
@ -1481,19 +1481,19 @@ Script_loadmem:
Script_setval:
call GetScriptByte
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_addval:
call GetScriptByte
ld hl, wScriptVar
ld hl, hScriptVar
add [hl]
ld [hl], a
ret
Script_random:
call GetScriptByte
ld [wScriptVar], a
ldh [hScriptVar], a
and a
ret z
@ -1522,11 +1522,11 @@ Script_random:
.finish
push af
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld c, a
pop af
call SimpleDivide
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.Divide256byC:
@ -1545,13 +1545,13 @@ Script_readvar:
call GetScriptByte
call GetVarAction
ld a, [de]
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_writevar:
call GetScriptByte
call GetVarAction
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld [de], a
ret
@ -1569,7 +1569,7 @@ GetVarAction:
Script_checkver:
ld a, [.gs_version]
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.gs_version:
@ -1579,7 +1579,7 @@ Script_getmonname:
call GetScriptByte
and a
jr nz, .gotit
ld a, [wScriptVar]
ldh a, [hScriptVar]
.gotit
ld [wNamedObjectIndex], a
call GetPokemonName
@ -1603,7 +1603,7 @@ Script_getitemname:
call GetScriptByte
and a ; USE_SCRIPT_VAR
jr nz, .ok
ld a, [wScriptVar]
ldh a, [hScriptVar]
.ok
ld [wNamedObjectIndex], a
call GetItemName
@ -1671,7 +1671,7 @@ Script_getchips:
Script_getnum:
call ResetStringBuffer1
ld de, wScriptVar
ld de, hScriptVar
ld hl, wStringBuffer1
lb bc, PRINTNUM_LEFTALIGN | 1, 3
call PrintNum
@ -1728,7 +1728,7 @@ Script_giveitem:
call GetScriptByte
cp ITEM_FROM_MEM
jr nz, .ok
ld a, [wScriptVar]
ldh a, [hScriptVar]
.ok
ld [wCurItem], a
call GetScriptByte
@ -1737,16 +1737,16 @@ Script_giveitem:
call ReceiveItem
jr nc, .full
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.full
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_takeitem:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld [wCurItem], a
call GetScriptByte
@ -1757,19 +1757,19 @@ Script_takeitem:
call TossItem
ret nc
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_checkitem:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld [wCurItem], a
ld hl, wNumItems
call CheckItem
ret nc
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_givecoins:
@ -1800,7 +1800,7 @@ CompareCoinsAction:
.less
ld a, HAVE_LESS
.done
ld [wScriptVar], a
ldh [hScriptVar], a
ret
GetCoinsAccount:
@ -1850,60 +1850,60 @@ LoadChipAmountToMem:
Script_checktime:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
farcall CheckTime
call GetScriptByte
and c
ret z
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_checkpoke:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld hl, wPartySpecies
ld de, 1
call IsInArray
ret nc
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_addcellnum:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld c, a
farcall AddPhoneNumber
ret nc
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_delcellnum:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld c, a
farcall DelCellNum
ret nc
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_checkcellnum:
; returns false if the cell number is not in your phone
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld c, a
farcall CheckCellNum
ret nc
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_specialphonecall:
@ -1921,7 +1921,7 @@ Script_checkphonecall:
jr z, .ok
ld a, TRUE
.ok
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_givepoke:
@ -1946,14 +1946,14 @@ Script_givepoke:
.ok
farcall GivePoke
ld a, b
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_giveegg:
; if no room in the party, return 0 in wScriptVar; else, return 2
; if no room in the party, return 0 in hScriptVar; else, return 2
xor a ; PARTYMON
ld [wScriptVar], a
ldh [hScriptVar], a
ld [wMonType], a
call GetScriptByte
ld [wCurPartySpecies], a
@ -1962,7 +1962,7 @@ Script_giveegg:
farcall GiveEgg
ret nc
ld a, 2
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_setevent:
@ -1995,7 +1995,7 @@ Script_checkevent:
jr z, .false
ld a, TRUE
.false
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_setflag:
@ -2028,7 +2028,7 @@ Script_checkflag:
jr z, .false
ld a, TRUE
.false
ld [wScriptVar], a
ldh [hScriptVar], a
ret
_EngineFlagAction:
@ -2129,13 +2129,13 @@ Script_writecmdqueue:
Script_delcmdqueue:
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
call GetScriptByte
ld b, a
farcall DelCmdQueue ; no need to farcall
ret c
ld a, TRUE
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_changemapblocks:
@ -2354,12 +2354,12 @@ Script_wait:
Script_checksave:
farcall CheckSave
ld a, c
ld [wScriptVar], a
ldh [hScriptVar], a
ret
Script_checkver_duplicate: ; unreferenced
ld a, [.gs_version]
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.gs_version:

View File

@ -158,8 +158,8 @@ UseRegisteredItem:
cp 1
jr nz, ._cantuse
scf
ld a, HMENURETURN_SCRIPT
ldh [hMenuReturn], a
ld a, MENURETURN_SCRIPT
ld [wMenuReturn], a
ret
.CantUse:

View File

@ -818,12 +818,12 @@ RandomUnseenWildMon:
ld hl, .JustSawSomeRareMonText
call PrintText2bpp
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.done
ld a, $1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.JustSawSomeRareMonText:

View File

@ -80,7 +80,7 @@ CheckPartyFullAfterContest:
xor a
ld [wContestMonSpecies], a
and a ; BUGCONTEST_CAUGHT_MON
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.TryAddToBox:
@ -139,12 +139,12 @@ CheckPartyFullAfterContest:
xor a
ld [wContestMon], a
ld a, BUGCONTEST_BOXED_MON
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.DidntCatchAnything:
ld a, BUGCONTEST_NO_CATCH
ld [wScriptVar], a
ldh [hScriptVar], a
ret
GiveANickname_YesNo:

View File

@ -185,7 +185,7 @@ CheckPokeMail::
pop bc
.return
ld [wScriptVar], a
ldh [hScriptVar], a
ret
GivePokeMail::

View File

@ -1,52 +1,52 @@
BeastsCheck:
; Check if the player owns all three legendary beasts.
; They must exist in either party or PC, and have the player's OT and ID.
; Return the result in wScriptVar.
; Return the result in hScriptVar.
ld a, RAIKOU
ld [wScriptVar], a
ldh [hScriptVar], a
call CheckOwnMonAnywhere
jr nc, .notexist
ld a, ENTEI
ld [wScriptVar], a
ldh [hScriptVar], a
call CheckOwnMonAnywhere
jr nc, .notexist
ld a, SUICUNE
ld [wScriptVar], a
ldh [hScriptVar], a
call CheckOwnMonAnywhere
jr nc, .notexist
; they exist
ld a, 1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.notexist
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
MonCheck:
; Check if the player owns any Pokémon of the species in wScriptVar.
; Return the result in wScriptVar.
; Check if the player owns any Pokémon of the species in hScriptVar.
; Return the result in hScriptVar.
call CheckOwnMonAnywhere
jr c, .exists
; doesn't exist
xor a
ld [wScriptVar], a
ldh [hScriptVar], a
ret
.exists
ld a, 1
ld [wScriptVar], a
ldh [hScriptVar], a
ret
CheckOwnMonAnywhere:
; Check if the player owns any monsters of the species in wScriptVar.
; Check if the player owns any monsters of the species in hScriptVar.
; It must exist in either party or PC, and have the player's OT and ID.
; If there are no monsters in the party,
@ -182,13 +182,13 @@ CheckOwnMonAnywhere:
CheckOwnMon:
; Check if a Pokémon belongs to the player and is of a specific species.
; We compare the species we are looking for in [wScriptVar] to the species
; We compare the species we are looking for in [hScriptVar] to the species
; we have in [hl].
; inputs:
; hl, pointer to PartyMonNSpecies
; bc, pointer to PartyMonNOT
; wScriptVar should contain the species we're looking for
; hScriptVar should contain the species we're looking for
; outputs:
; sets carry if monster matches species, ID, and OT name.
@ -201,7 +201,7 @@ CheckOwnMon:
; check species
ld a, [wScriptVar]
ldh a, [hScriptVar]
ld b, [hl]
cp b
jr nz, .notfound

View File

@ -1,13 +1,13 @@
DelayFrame::
; Wait for one frame
ld a, 1
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
; Wait for the next VBlank, halting to conserve battery
.halt
halt
nop
ld a, [wVBlankOccurred]
ldh a, [hVBlankOccurred]
and a
jr nz, .halt
ret

View File

@ -295,11 +295,11 @@ JoyTextDelay::
and a
jr z, .checkframedelay
ld a, 15
ld [wTextDelayFrames], a
ldh [hTextDelayFrames], a
ret
.checkframedelay
ld a, [wTextDelayFrames]
ldh a, [hTextDelayFrames]
and a
jr z, .restartframedelay
xor a
@ -308,7 +308,7 @@ JoyTextDelay::
.restartframedelay
ld a, 5
ld [wTextDelayFrames], a
ldh [hTextDelayFrames], a
ret
WaitPressAorB_BlinkCursor::

View File

@ -44,7 +44,7 @@ PrintLetterDelay::
ld a, TEXT_DELAY_FAST
.updatedelay
ld [wTextDelayFrames], a
ldh [hTextDelayFrames], a
.checkjoypad
call GetJoypad
@ -68,7 +68,7 @@ PrintLetterDelay::
jr .end
.wait
ld a, [wTextDelayFrames]
ldh a, [hTextDelayFrames]
and a
jr nz, .checkjoypad

View File

@ -115,7 +115,7 @@ VBlank0::
; vblank-sensitive operations are done
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
; if hWindowHUDLY is active, enable interrupts so the LCD interrupt can trigger
ldh a, [hWindowHUDLY]
@ -141,18 +141,18 @@ VBlank0::
sbc b
ldh [hRandomSub], a
ld a, [wOverworldDelay]
ldh a, [hOverworldDelay]
and a
jr z, .ok
dec a
ld [wOverworldDelay], a
ldh [hOverworldDelay], a
.ok
ld a, [wTextDelayFrames]
ldh a, [hTextDelayFrames]
and a
jr z, .ok2
dec a
ld [wTextDelayFrames], a
ldh [hTextDelayFrames], a
.ok2
call UpdateJoypad
@ -199,7 +199,7 @@ VBlank2::
rst Bankswitch
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
ret
VBlank1::
@ -228,7 +228,7 @@ VBlank1::
.done
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
; get requested ints
ldh a, [rIF]
@ -296,7 +296,7 @@ VBlank3::
.done
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
ldh a, [rIF]
push af
@ -351,7 +351,7 @@ VBlank4::
call UpdateJoypad
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
call AskSerial
@ -385,7 +385,7 @@ VBlank5::
.done
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
call UpdateJoypad
@ -433,7 +433,7 @@ VBlank6::
.done
xor a
ld [wVBlankOccurred], a
ldh [hVBlankOccurred], a
ld a, BANK(_UpdateSound)
rst Bankswitch

View File

@ -7,12 +7,14 @@ hSRAMBank:: db
hVBlankCounter:: db
hOverworldDelay:: db
hTextDelayFrames:: db
hVBlankOccurred:: db
hROMBank:: db
hVBlank:: db
hMapEntryMethod:: db
hMenuReturn:: db
hJoypadReleased:: db
hJoypadPressed:: db
hJoypadDown:: db
@ -127,6 +129,8 @@ hBGMapTileCount:: db
hMapAnims:: db
hTileAnimFrame:: db
hScriptVar:: db
hLastTalked:: db
hRandomAdd:: db

View File

@ -140,8 +140,6 @@ wLinkMode::
; a LINK_* value for the link type
db
wScriptVar:: db
wPlayerNextMovement:: db
wPlayerMovement:: db
@ -1195,17 +1193,13 @@ wCursorCurrentTile:: dw
ds 3
wMoreMenuDataEnd::
wOverworldDelay:: db
wTextDelayFrames:: db
wVBlankOccurred:: db
wMenuReturn:: db
wPredefID:: db
wPredefHL:: dw
wPredefAddress:: dw
wFarCallBC:: dw
wUnusedLinkCommunicationByte:: db
wGameTimerPaused::
; bit 0: game timer paused
; bit 7: something mobile