;============================================================================ ; Faxanadu (U).nes ; ; ZEROPAGE ($0000 - $00ff) ;============================================================================.segment "ZEROPAGE" .reloc;============================================================================ ; Temporary variables used throughout the game. ; ; Some of these are used for specific purposes (e.g., addresses), and some ; are more generally-used. ; ; MOD NOTES: ; These should be safe for custom code to use outside ; of referenced code paths. ; ; XREFS: ; BScript_Action_FacePlayerX ; BScript_Action_FacePlayerY ; CurrentSprite_CheckHitPlayer ; Player_CheckShieldHitByMagic ; Player_DrawShield ; Player_DrawWeapon ; Player_HitEnemyWithMagic ; Player_HitSpriteWithWeapon ; SpriteBehavior_EnemyUnused18__9991 ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_Pakukame__9d78 ; SpriteBehavior_Unknown_29 ; SpriteBehavior_Zorugeriru__9df7 ; SpriteBehavior_Zorugeriru__9e13 ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_LightningBall20 ; Sprite_CheckHitByCastMagic ; Sprite_RunDeathDropHandler ; Sprites_CalcYFromGravity ; Sprites_IsSpriteOutOfWeaponRange ; Area_ConvertPixelsToBlockPos ; Area_HandleBreakableFloor ; Area_LoadBlockProperties ; Area_SetBlocks ; Area_SetBlocks_SetAttributes ; CastMagic_FinishHandler_HitWallEffect ; CastMagic_FinishHandler_TilteAfterFirstHit ; DEADCODE_FUN_PRG15_MIRROR__c033 ; FUN_PRG15_MIRROR__ec58 ; Maybe_IsSpriteEntityNotOnScreen ; Player_DrawBody ; Player_DrawSprite ; Player_DrawSpriteImmediately ; Player_HandleKnockback ; Player_LoadArmorTilesToPPU ; Player_LoadShieldTilesToPPU ; Player_LoadWeaponTilesToPPU ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_HasSpritesNotOfType ; Sprites_LoadCommon ; Sprites_LoadImageForCurrentSprite ;============================================================================; ; Generic temporary variable for 1-byte values. ; ; ; XREFS: ; BScript_Action_FacePlayerX ; BScript_Action_FacePlayerY ; CurrentSprite_CheckHitPlayer ; Player_CheckShieldHitByMagic ; Player_DrawShield ; Player_DrawWeapon ; Player_HitEnemyWithMagic ; Player_HitSpriteWithWeapon ; SpriteBehavior_EnemyUnused18__9991 ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_Pakukame__9d78 ; SpriteBehavior_Unknown_29 ; SpriteBehavior_Zorugeriru__9df7 ; SpriteBehavior_Zorugeriru__9e13 ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_LightningBall20 ; Sprite_CheckHitByCastMagic ; Sprite_RunDeathDropHandler ; Sprites_CalcYFromGravity ; Sprites_IsSpriteOutOfWeaponRange ; Area_ConvertPixelsToBlockPos ; Area_HandleBreakableFloor ; Area_LoadBlockProperties ; Area_SetBlocks ; Area_SetBlocks_SetAttributes ; CastMagic_FinishHandler_HitWallEffect ; CastMagic_FinishHandler_TilteAfterFirstHit ; DEADCODE_FUN_PRG15_MIRROR__c033 ; FUN_PRG15_MIRROR__ec58 ; Maybe_IsSpriteEntityNotOnScreen ; Player_DrawBody ; Player_DrawSprite ; Player_DrawSpriteImmediately ; Player_HandleKnockback ; Player_LoadArmorTilesToPPU ; Player_LoadShieldTilesToPPU ; Player_LoadWeaponTilesToPPU ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_HasSpritesNotOfType ; Sprites_LoadCommon ; Sprites_LoadImageForCurrentSprite ;[0000]Temp_00:; [$0000] [0000].byte $00; [$0000] byte; ; Generic temporary variable for 1-byte values. ; ; ; XREFS: ; Player_HitEnemyWithMagic ; Sprite_CheckHitByCastMagic ; Sprite_RunDeathDropHandler ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[0001]Temp_01:; [$0001] [0001].byte $00; [$0001] byte; ; Temporary variable used for address reads. ; ; ; XREFS: ; BScript_Op_AddToSpriteData ; Player_ApplyDamage ; Player_DrawWeapon ; Player_HitEnemyWithMagic ; Sprite_GetBounds ; Area_LoadScrollDataRight ; Area_SetBlocks_SetAttributes ; Area_SetStateFromDoorDestination ; CurrentSprite_LoadTilesInfo ; DEADCODE_FUN_PRG15_MIRROR__c033 ; Game_LoadAreaTable ; IScripts_DrawPortraitTileToPPU ; IScripts_LoadPortraitTilesAddress ; LAB_PRG15_MIRROR__e852 [$PRG15_MIRROR::e852] ; LAB_PRG15_MIRROR__ea13 [$PRG15_MIRROR::ea13] ; Player_CheckSwitchScreen ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_LoadArmorTile ; Player_LoadShieldTile ; Player_LoadWeaponTile ; Screen_LoadAllScreenInfo ; Sprite_Draw ; Sprite_DrawPortraitPartAppearance ; Sprite_Draw_FlippedHoriz ; Sprite_SetAppearanceAddrFromOffset ; Sprite_SetPlayerAppearanceAddr ; Sprites_LoadCommon ;[0002]Temp_Addr_L:; [$0002] [0002].byte $00; [$0002] byte; ; XREFS: ; BScript_Op_AddToSpriteData ; Player_ApplyDamage ; Player_DrawWeapon ; Sprite_GetBounds ; Area_LoadScrollDataRight ; Area_SetBlocks_SetAttributes ; Area_SetStateFromDoorDestination ; CurrentSprite_LoadTilesInfo ; Game_LoadAreaTable ; IScripts_LoadPortraitTilesAddress ; Player_CheckSwitchScreen ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_LoadArmorTile ; Player_LoadShieldTile ; Player_LoadWeaponTile ; Screen_LoadAllScreenInfo ; Sprite_DrawPortraitPartAppearance ; Sprite_SetAppearanceAddrFromOffset ; Sprite_SetPlayerAppearanceAddr ; Sprites_LoadCommon ;[0003]Temp_Addr_U:; [$0003] [0003].byte $00; [$0003] byte; ; XREFS: ; Player_ApplyDamage ; Player_CalcValueAndFFForNeg ; Player_DrawWeapon ; FUN_PRG15_MIRROR__ec58 ; IScripts_DrawPortraitTileToPPU ; Player_LoadWeaponTile ; Sprite_Draw_FlippedHoriz ;[0004]Temp_04:; [$0004] [0004].byte $00; [$0004] byte; ; XREFS: ; Player_ApplyDamage ; Player_CalcValueAndFFForNeg ; Player_DrawWeapon ; FUN_PRG15_MIRROR__ec58 ; IScripts_DrawPortraitTileToPPU ; Player_LoadWeaponTile ; Sprite_Draw_FlippedHoriz ;[0005]Temp_05:; [$0005] [0005].byte $00; [$0005] byte; ; XREFS: ; Area_SetBlocks_SetAttributes ; PPUBuffer_DrawCommand_RemoveVerticalLines ; PPUBuffer_DrawCommand_RotateTilesRight1Pixel ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Screen_RunWriteScrollDataHandler ;[0006]Temp_06:; [$0006] [0006].byte $00; [$0006] byte; ; Temporary variable used only for vertical line removal. ; ; This is used by ; PPUBuffer_DrawCommand_RemoveVerticalLines, ; which is used during the player death animation. ; ; Outside of that, it's unused by Faxanadu. ; ; ; XREFS: ; PPUBuffer_DrawCommand_RemoveVerticalLines ;[0007]Temp_07:; [$0007] [0007].byte $00; [$0007] byte; ; XREFS: ; Area_LoadBlocks ; Area_LoadNextCompressedScreenBit ; Area_LoadTiles ; PPUBuffer_DrawCommand_RemoveVerticalLines ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Screen_LoadSpritePalette ; Screen_LoadUIPalette ; Screen_SetFadeOutPalette ; Screen_SetPaletteData ;[0008]Temp_08:; [$0008] [0008].byte $00; [$0008] byte; ; XREFS: ; Area_LoadBlocks ; Area_LoadTiles ; Palette_IndexToROMOffset16 ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Screen_LoadSpritePalette ; Screen_LoadUIPalette ; Screen_SetFadeOutPalette ;[0009]Temp_09:; [$0009] [0009].byte $00; [$0009] byte;============================================================================ ; Saved flags for PPUCTRL. ; ; These are set here so that the intended flags can be applied whenever ; necessary. ; ; XREFS: ; Game_InitScreenAndMusic ; PPUBuffer_Draw ; PPU_HandleOnInterrupt ; PPU_InitVBlank ; PPU_SetVRAMIncrementAdd1Across ; Screen_WriteScrollHorizPPUTileData ; Screen_WriteScrollVertPPUTileData ;============================================================================; ; XREFS: ; Game_InitScreenAndMusic ; PPUBuffer_Draw ; PPU_HandleOnInterrupt ; PPU_InitVBlank ; PPU_SetVRAMIncrementAdd1Across ; Screen_WriteScrollHorizPPUTileData ; Screen_WriteScrollVertPPUTileData ;[000a]PPU_ControlFlags:; [$000a] [000a].byte $00; [$000a] PPUCtrlFlags;============================================================================ ; The color mode of the screen. ; ; 0 = Color ; 1 = Grayscale ; ; XREFS: ; Player_HitEnemyWithMagic ; Player_HitSpriteWithWeapon ; SpriteBehavior_FlashScreenHitPlayer ; Game_InitScreenAndMusic ; PPU_HandleOnInterrupt ; Screen_ClearSprites ;============================================================================; ; XREFS: ; Player_HitEnemyWithMagic ; Player_HitSpriteWithWeapon ; SpriteBehavior_FlashScreenHitPlayer ; Game_InitScreenAndMusic ; PPU_HandleOnInterrupt ; Screen_ClearSprites ;[000b]PPU_Mask:; [$000b] [000b].byte $00; [$000b] PPUMaskFlags;============================================================================ ; X delta in pixels used during scrolling. ; ; This controls the PPU scroll overlay when switching ; between screens 0 and 1. ; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenRight ; Game_InitScreenAndMusic ; Game_InitStateForSpawn ; PPU_HandleOnInterrupt ; Screen_HandleScrollLeft ; Screen_HandleScrollRight ; Screen_UpdateForScroll ; Sprite_Draw ;============================================================================; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenRight ; Game_InitScreenAndMusic ; Game_InitStateForSpawn ; PPU_HandleOnInterrupt ; Screen_HandleScrollLeft ; Screen_HandleScrollRight ; Screen_UpdateForScroll ; Sprite_Draw ;[000c]PPU_ScrollX:; [$000c] [000c].byte $00; [$000c] byte;============================================================================ ; X delta in screens used during scrolling. ; ; This is used to swap between the PPU scroll screens. ; The even/odd flag will be used to dictate the current ; screen. ; ; XREFS: ; TextBox_FillBackground ; Area_LoadScrollDataRight ; Area_ScrollScreenRight ; Area_SetBlocks_SetAttributes ; Area_SetPPUAddrForBlockIndex ; Game_InitScreenAndMusic ; Game_InitStateForSpawn ; PPU_HandleOnInterrupt ; PPU_SetAddrForTextBoxPos ; Screen_HandleScrollLeft ; Screen_HandleScrollRight ;============================================================================; ; XREFS: ; TextBox_FillBackground ; Area_LoadScrollDataRight ; Area_ScrollScreenRight ; Area_SetBlocks_SetAttributes ; Area_SetPPUAddrForBlockIndex ; Game_InitScreenAndMusic ; Game_InitStateForSpawn ; PPU_HandleOnInterrupt ; PPU_SetAddrForTextBoxPos ; Screen_HandleScrollLeft ; Screen_HandleScrollRight ;[000d]PPU_ScrollScreen:; [$000d] [000d].byte $00; [$000d] byte;============================================================================ ; The ready state for the screen. ; ; This has two states: ; ; 0 = Ready ; 1 = Not Ready (Game not yet playable) ; ; NOTE: ; Some code checks against alternative states: 1 and 5. ; ; These do not seem to be used, and appear to be ; remnants of an older design. ; ; XREFS: ; Game_DrawScreenInFrozenState ; Game_InitStateForSpawn ; Player_DrawBody ; Player_HandleDeath ; Screen_SetupSprites ;============================================================================; ; XREFS: ; Game_DrawScreenInFrozenState ; Game_InitStateForSpawn ; Player_DrawBody ; Player_HandleDeath ; Screen_SetupSprites ;[000e]Screen_ReadyState:; [$000e] [000e].byte $00; [$000e] ScreenReadyState;============================================================================ ; MOD NOTES: 1 unused byte of RAM. ;============================================================================[000f].byte $00; [$000f] undefined;============================================================================ ; A latch managing interrupt handling logic. ; ; This is set to 1 when interrupt handlers have been run. ; That includes: ; ; * PPU handling ; * OAM reset ; * Audio/sound playback ; * Input handling. ; * Advancing InterruptCounter ; ; If already 1, PRG15_MIRROR:c999 won't run handlers again. ; ; Callers can set to 0 to request running interrupt handlers. ; ; XREFS: ; Game_InitScreenAndMusic ; OnInterrupt ; WaitForNextFrame ;============================================================================[0010]Game_InterruptsHandledLatch:; [$0010] [0010].byte $00; [$0010] bool;============================================================================ ; The previous PRG ROM bank saved before switching to a new bank. ; ; This allows for pushing to a new bank and then popping ; back to this bank. ; ; XREFS: ; Game_InitMMCAndBank ; MMC1_RestorePrevROMBank ; MMC1_SaveROMBankAndUpdateTo ;============================================================================[0011]SavedPRGBank:; [$0011] [0011].byte $00; [$0011] ROMBank;============================================================================ ; State used to help synchronize MMC1 operations. ; ; 0 = Idle ; 1 = Writing to MMC1 (switching banks). ; > 1 = MMC1 is re-initializing. ; ; XREFS: ; Game_InitMMCAndBank ; MMC1_EnsurePRG ; MMC1_UpdateROMBank ;============================================================================[0012]MMC1_ShiftSync:; [$0012] [0012].byte $00; [$0012] byte;============================================================================ ; Whether to process standard behavior on interrupts. ; ; If 1, then the interrupt handler will manage game ; state, audio, and read button inputs. ; ; If 0, this will all be paused. ; ; XREFS: ; DEADCODE_FUN_PRG15_MIRROR__cb1f ; Game_InitScreenAndMusic ; OnInterrupt ; PPU_WaitUntilFlushed ; Screen_ResetForGamePlay ; Screen_ResetForNonGame ;============================================================================; ; XREFS: ; DEADCODE_FUN_PRG15_MIRROR__cb1f ; Game_InitScreenAndMusic ; OnInterrupt ; PPU_WaitUntilFlushed ; Screen_ResetForGamePlay ; Screen_ResetForNonGame ;[0013]Game_InterruptHandlersEnabled:; [$0013] [0013].byte $00; [$0013] bool;============================================================================ ; Counter tracking state for temporary pausing of interrupt handlers. ; ; When interrupt handlers are paused (by setting ; Game_InterruptHandlersEnabled to 0), this will be ; incremented up to a value of 2. ; ; PPU_WaitUntilFlushed will wait for this to hit 2 ; before returning, ensuring there's time for the PPU to ; flush before returning to the caller. ; ; XREFS: ; OnInterrupt ; PPU_WaitUntilFlushed ;============================================================================; ; XREFS: ; OnInterrupt ; PPU_WaitUntilFlushed ;[0014]PauseInterruptCounter:; [$0014] [0014].byte $00; [$0014] byte;============================================================================ ; MOD NOTES: 1 unused byte of RAM. ;============================================================================[0015].byte $00; [$0015] byte;============================================================================ ; Controller port and button state management. ; ; XREFS: ; PasswordScreen_GetDPadBits ; Maybe_Player_CalcAnimFrame ; Player_CastMagic ; EndGame_MovePlayerTowardKing ; GameLoop_CheckUseCurrentItem ; Game_UpdatePlayerOnScroll ; GetRandom ; Input_HandleOnInterrupt ; Player_CheckHandleClimb ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleJump ; Player_CheckPushingBlock ; Player_GetBodySpriteFrameOffset ; Player_UpdateAcceleration ;============================================================================; ; Buttons last pressed by the player in controller port 1. ; ; Bit 0: Right ; Bit 1: Left ; Bit 2: Down ; Bit 3: Up ; Bit 4: Start ; Bit 5: Select ; Bit 6: B ; Bit 7: A ; ; ; XREFS: ; PasswordScreen_GetDPadBits ; Maybe_Player_CalcAnimFrame ; Player_CastMagic ; EndGame_MovePlayerTowardKing ; GameLoop_CheckUseCurrentItem ; Game_UpdatePlayerOnScroll ; GetRandom ; Input_HandleOnInterrupt ; Player_CheckHandleClimb ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleJump ; Player_CheckPushingBlock ; Player_GetBodySpriteFrameOffset ; Player_UpdateAcceleration ;[0016]Joy1_ButtonMask:; [$0016] [0016].byte $00; [$0016] ButtonBitmask; ; Buttons last pressed by the player in controller port 2. ; ; Bit 0: Right ; Bit 1: Left ; Bit 2: Down ; Bit 3: Up ; Bit 4: Start ; Bit 5: Select ; Bit 6: B ; Bit 7: A ; ; ; XREFS: ; Debug_ChooseArea ; Input_HandleOnInterrupt ;[0017]Joy2_ButtonMask:; [$0017] [0017].byte $00; [$0017] ButtonBitmask; ; Buttons previously pressed before the latest button presses. ; ; This is used to restore any movement or actions invoked ; before a screen scroll or similar. ; ; Bit 0: Right ; Bit 1: Left ; Bit 2: Down ; Bit 3: Up ; Bit 4: Start ; Bit 5: Select ; Bit 6: B ; Bit 7: A ; ; ; XREFS: ; Game_UpdatePlayerOnScroll ; Input_HandleOnInterrupt ;[0018]Joy1_PrevButtonMask:; [$0018] [0018].byte $00; [$0018] ButtonBitmask; ; Button bits changed since the last interrupt. ; ; Bit 0: Right ; Bit 1: Left ; Bit 2: Down ; Bit 3: Up ; Bit 4: Start ; Bit 5: Select ; Bit 6: B ; Bit 7: A ; ; ; XREFS: ; IScriptAction_AddInventoryItem ; IScriptAction_ShowBuySellMenu ; IScriptAction_ShowPassword ; IScripts_WaitForMenuInput ; Menu_UpdateAndDraw ; PasswordScreen_DrawAndHandleInputLoop ; PasswordScreen_GetDPadBits ; PasswordScreen_HandleWrongPasswordAndWaitForInput ; PlayerMenu_HandleInventoryMenuInput ; PlayerMenu_Show ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; StartScreen_CheckHandleInput ; TextBox_CheckForDismiss ; TextBox_CheckShouldContinue ; TextBox_CheckShouldContinueOrDismissMessage ; TextBox_CheckShouldContinueOrDismissQuestion ; TextBox_IsBPressed ; Player_CastMagic ; Player_CheckHandlePressUpOnNPC ; Area_CheckCanClimbAdjacent ; EndGame_MovePlayerTowardKing ; GameLoop_CheckPauseGame ; GameLoop_CheckShowPlayerMenu ; GameLoop_CheckUseCurrentItem ; Game_ShowStartScreen ; Input_HandleOnInterrupt ; Player_CheckHandleAttack ; Player_CheckHandleEnterDoor ; Player_ContinueHandleClimbOrJump ;[0019]Joy1_ChangedButtonMask:; [$0019] [0019].byte $00; [$0019] ButtonBitmask;============================================================================ ; Additional interrupt handling state. ; ; XREFS: ; IScripts_PlayFillingSound ; IScripts_PlayGoldChangeSound ; IScripts_UpdatePortraitAnimation ; PasswordScreen_DrawPasswordFieldCursor ; PasswordScreen_WriteWrongPassword ; SplashAnimation_RunOutro ; SplashAnimation_UpdateOutro ; TextBox_DrawDownArrowTerminatorSymbol ; TextBox_DrawQuestionMarkTerminatorSymbol ; TextBox_DrawUpArrowTerminatorSymbol ; SpriteBehavior_Something_850d ; Area_ScrollTo ; CastMagic_FinishHandler_Death ; CastMagic_FinishHandler_Deluge ; CastMagic_FinishHandler_Fire ; CastMagic_FinishHandler_Thunder ; CastMagic_FinishHandler_Tilte ; Game_DecGloveDuration ; Game_DecHourGlassDuration ; Game_DecOintmentDuration ; Game_DecWingBootsDuration ; Game_WaitForOAMReset ; OnInterrupt ; Player_CheckOnBreakableBlock ; Player_DrawDeathAnimation ; WaitForInterrupt ;============================================================================; ; A running counter tracking the number of interrupt handlers ; run. ; ; ; XREFS: ; IScripts_PlayFillingSound ; IScripts_PlayGoldChangeSound ; IScripts_UpdatePortraitAnimation ; PasswordScreen_DrawPasswordFieldCursor ; PasswordScreen_WriteWrongPassword ; SplashAnimation_RunOutro ; SplashAnimation_UpdateOutro ; TextBox_DrawDownArrowTerminatorSymbol ; TextBox_DrawQuestionMarkTerminatorSymbol ; TextBox_DrawUpArrowTerminatorSymbol ; SpriteBehavior_Something_850d ; Area_ScrollTo ; CastMagic_FinishHandler_Death ; CastMagic_FinishHandler_Deluge ; CastMagic_FinishHandler_Fire ; CastMagic_FinishHandler_Thunder ; CastMagic_FinishHandler_Tilte ; Game_DecGloveDuration ; Game_DecHourGlassDuration ; Game_DecOintmentDuration ; Game_DecWingBootsDuration ; Game_WaitForOAMReset ; OnInterrupt ; Player_CheckOnBreakableBlock ; Player_DrawDeathAnimation ; WaitForInterrupt ;[001a]InterruptCounter:; [$001a] [001a].byte $00; [$001a] byte; ; Whether the OAM needs to be reset at the next ; interrupt handler. ; ; ; XREFS: ; Game_WaitForOAMReset ; OnInterrupt ;[001b]Game_NeedOAMReset:; [$001b] [001b].byte $00; [$001b] bool [001c]Sprites_StartSlotRange:; [$001c] [001c].byte $00; [$001c] byte;============================================================================ ; State for animating the fog in the area of Mist. ; ; XREFS: ; Fog_OnTick ; Fog_UpdateTiles ;============================================================================; ; Tile offset for a fog tile to animate in Mist. ; ; ; XREFS: ; Fog_OnTick ; Fog_UpdateTiles ;[001d]Fog_TileIndex:; [$001d] [001d].byte $00; [$001d] byte; ; State index used to determine when to animate fog tiles ; and when to compute new starting tile indexes. ; ; ; XREFS: ; Fog_OnTick ; Fog_UpdateTiles ;[001e]Fog_StateIndex:; [$001e] [001e].byte $00; [$001e] byte;============================================================================ ; PPU ring buffer state. ; ; This is used to schedule draws, utilizing a ring buffer. ; Contents may either be a length count and data up to that ; length to draw, or one or more draw commands up with ; arguments. ; ; See PPUBuffer_Draw. ; ; XREFS: ; Game_InitStateForSpawn ; PPUBuffer_Clear ; PPUBuffer_Draw ; PPUBuffer_DrawAll ; PPUBuffer_DrawCommand_RemoveVerticalLines ; PPUBuffer_DrawCommand_RotateTilesRight1Pixel ; PPUBuffer_HasCapacity ; PPUBuffer_WaitUntilClear ; PPU_WaitUntilFlushed ;============================================================================; ; Current offset within the buffer to begin adding to or ; drawing from. ; ; ; XREFS: ; Game_InitStateForSpawn ; PPUBuffer_Clear ; PPUBuffer_Draw ; PPUBuffer_DrawAll ; PPUBuffer_DrawCommand_RemoveVerticalLines ; PPUBuffer_DrawCommand_RotateTilesRight1Pixel ; PPUBuffer_HasCapacity ; PPUBuffer_WaitUntilClear ; PPU_WaitUntilFlushed ;[001f]PPUBuffer_ReadOffset:; [$001f] [001f].byte $00; [$001f] byte; ; Current upper bounds of the ring buffer. ; ; This may wrap from 0xFF -> 0. ; ; Drawing occurs until the offset meets the upper bounds. ; ; ; XREFS: ; DEADCODE_FUN_PRG12__9041 ; IScriptAction_AddInventoryItem_ClearTextBox ; PasswordScreen_DrawMessage ; PasswordScreen_WriteCharTile ; TextBox_Close ; TextBox_DrawItemImage ; TextBox_FillBackground ; TextBox_Open ; UI_DrawString ; Area_SetBlocks_SetAttributes ; Area_SetBlocks_WriteBlockData12 ; Area_SetBlocks_WriteBlockData34 ; DEADCODE_FUN_PRG15_MIRROR__c033 ; Fog_UpdateTiles ; Game_InitStateForSpawn ; IScripts_DrawPortraitTileToPPU ; PPUBuffer_Clear ; PPUBuffer_Draw ; PPUBuffer_DrawAll ; PPUBuffer_HasCapacity ; PPUBuffer_QueueCommandOrLength ; PPUBuffer_WaitUntilClear ; PPUBuffer_WritePalette ; PPUBuffer_WriteValueMany ; PPU_WaitUntilFlushed ; Player_DrawDeathAnimation ; Player_LoadWeaponTile ; Sprites_LoadImageForCurrentSprite ; TextBox_FillPlaceholderTextAtLineWithStartChar ; TextBox_LoadItemSourceTiles ; TextBox_WriteChar ; UI_ClearSelectedItemPic ; UI_DrawDigitsZeroPadded ;[0020]PPUBuffer_WriteOffset:; [$0020] [0020].byte $00; [$0020] byte; ; Temporary state used when drawing from the PPU buffer. ; ; MOD NOTES: ; This is clobbered by PPUBuffer_Draw, but is ; otherwise unused and can be reused in self-contained code. ; ; ; XREFS: ; PPUBuffer_Draw ;[0021]PPUBuffer_Temp_PendingEntryCount:; [$0021] [0021].byte $00; [$0021] byte; ; Temporary state used when drawing from the PPU buffer. ; ; MOD NOTES: ; This is clobbered by PPUBuffer_Draw, but is ; otherwise unused and can be reused in self-contained code. ; ; ; XREFS: ; PPUBuffer_Draw ;[0022]PPUBuffer_Temp_TotalByteLength:; [$0022] [0022].byte $00; [$0022] byte;============================================================================ ; Temporary value used when populating the PPU nametable. ; ; MOD NOTES: ; This is clobbered by ; PPU_InitAttributeAndNameTables, ; but is otherwise unused and can be reused in ; self-contained code. ; ; XREFS: ; PPU_InitAttributeAndNameTables ;============================================================================; ; XREFS: ; PPU_InitAttributeAndNameTables ;[0023]Temp_PPU_NameTableValue:; [$0023] [0023].byte $00; [$0023] byte;============================================================================ ; The current area the player is in. ; ; $00 = Eolis ; $01 = Apolune ; $02 = Forepaw ; $03 = Mascon ; $04 = Victim ; $05 = Conflate ; $06 = Daybreak ; $07 = Evil Fortress ; ; XREFS: ; PlayerMenu_HandleInventoryMenuInput ; SpriteBehavior_EnemyUnused18__9991 ; Area_SetStateFromDoorDestination ; FUN_PRG15_MIRROR__daf6 ; Fog_OnTick ; GameLoop_CheckShowPlayerMenu ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_ExitBuilding ; Game_InitStateForStartScreen ; Game_LoadAreaTable ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_SetupAndLoadOutsideArea ; Game_SpawnInTemple ; Player_CheckSwitchScreen ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_EnterDoorToInside ; Player_SetWeapon ; Player_UseMattock ; Screen_LoadAllScreenInfo ;============================================================================; ; XREFS: ; PlayerMenu_HandleInventoryMenuInput ; SpriteBehavior_EnemyUnused18__9991 ; Area_SetStateFromDoorDestination ; FUN_PRG15_MIRROR__daf6 ; Fog_OnTick ; GameLoop_CheckShowPlayerMenu ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_ExitBuilding ; Game_InitStateForStartScreen ; Game_LoadAreaTable ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_SetupAndLoadOutsideArea ; Game_SpawnInTemple ; Player_CheckSwitchScreen ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_EnterDoorToInside ; Player_SetWeapon ; Player_UseMattock ; Screen_LoadAllScreenInfo ;[0024]Area_CurrentArea:; [$0024] [0024].byte $00; [$0024] Area;============================================================================ ; The next sprite slot. ; ; This will alternate between putting sprites in ranges 0-31 ; and 32-63. ; ; If either range is filled with sprites, Sprites_SlotsFull ; will be set to 1. No new sprite slots will be allocated. ; This takes place in Sprites_IncNextSpriteSlot. ; ; XREFS: ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_IncNextSpriteSlot ; Sprites_Reset ;============================================================================; ; XREFS: ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_IncNextSpriteSlot ; Sprites_Reset ;[0025]Sprites_SpriteSlot:; [$0025] [0025].byte $00; [$0025] byte;============================================================================ ; Current sprite state. ; ; XREFS: ; SUB_PRG14__ba48 [$PRG14::ba48] ; Something_SetDAT26 [$PRG14::8c7f] ; SpriteUpdateHandler_Invisible ; CastMagic_CalculateVisibility ; Sprite_Draw_Finish ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;============================================================================; ; Visibility state for the current sprite being processed. ; ; This tracks whether the current sprite is: ; ; $00 = Fully visible by foreground elements ; $01 = Obscured only on the trailing side of the sprite. ; $02 = Obscured only on the leading side of the sprite. ; $03 = Fully obscured ; ; The trailing and leading sides have to do with the direction ; the sprite is facing. ; ; ; XREFS: ; SUB_PRG14__ba48 [$PRG14::ba48] ; Something_SetDAT26 [$PRG14::8c7f] ; SpriteUpdateHandler_Invisible ; CastMagic_CalculateVisibility ; Sprite_Draw_Finish ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[0026]MovingSpriteVisibility:; [$0026] [0026].byte $00; [$0026] MovingSpriteVisibility; ; An argument to Sprite_EnterNextAppearancePhase. ; ; This specifies the X position of the sprite. ; ; ; XREFS: ; IScripts_SetPortraitSpriteXY ; CurrentSprite_UpdateState ; Player_CalculateVisibility ; Player_DrawShield ; Player_DrawWeapon ; SpriteUpdateHandler_Effect_LightningBall20 ; SpriteUpdateHandler_Enemy_Unused_SnakeRoundPart ; CastMagic_FinishHandler_TilteAfterFirstHit ; CastMagic_RunUpdateSpellHandler ; FUN_PRG15_MIRROR__ec58 ; Player_DrawBody ; Sprite_Draw ; UI_DrawPromptInputSymbol ;[0027]Arg_DrawSprite_PosX:; [$0027] [0027].byte $00; [$0027] byte; ; An argument to Sprite_EnterNextAppearancePhase. ; ; This specifies the Y position of the sprite. ; ; ; XREFS: ; IScripts_SetPortraitSpriteXY ; CurrentSprite_UpdateState ; Player_CalculateVisibility ; Player_DrawShield ; Player_DrawWeapon ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_LightningBall20 ; SpriteUpdateHandler_Enemy_Unused_SnakeRoundPart ; CastMagic_FinishHandler_HitWallEffect ; CastMagic_FinishHandler_TilteAfterFirstHit ; CastMagic_RunUpdateSpellHandler ; FUN_PRG15_MIRROR__ec58 ; Player_DrawBody ; Sprite_Draw ; UI_DrawPromptInputSymbol ;[0028]Arg_DrawSprite_PosY:; [$0028] [0028].byte $00; [$0028] byte;============================================================================ ; The current sprite's flip mask. ; ; This indicates if the sprite is flipped horizontally, ; utilizing only the Facing bit of a sprite or player's flags. ; ; The following values are allowed: ; ; $00 = Facing right (default) ; $40 = Facing left (flipped) ; ; XREFS: ; CurrentSprite_UpdateFlipMask ; Maybe_Player_CalcAnimFrame ; Player_DrawShield ; Player_DrawWeapon ; SpriteUpdateHandler_Bread ; SpriteUpdateHandler_Coin ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_Fountain ; SpriteUpdateHandler_Effect_LightningBall20 ; SpriteUpdateHandler_Enemy_Lamprey ; SpriteUpdateHandler_Item_Special ; SpriteUpdateHandler_Item_Standard ; SpriteUpdateHandler_Magic_81 ; SpriteUpdateHandler_Magic_83 ; SpriteUpdateHandler_NPC_ArmorSalesman ; SpriteUpdateHandler_NPC_Doctor ; SpriteUpdateHandler_NPC_KeySalesman_Others ; SpriteUpdateHandler_NPC_King ; CastMagic_FinishHandler_HitWallEffect ; CastMagic_FinishHandler_TilteAfterFirstHit ; CastMagic_UpdateSpriteDirection ; IScripts_DrawPortraitAnimationFrame ; Player_GetBodySpriteFrameOffset ; Player_SetFacingLeft ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; UI_DrawPromptInputSymbol ;============================================================================; ; XREFS: ; CurrentSprite_UpdateFlipMask ; Maybe_Player_CalcAnimFrame ; Player_DrawShield ; Player_DrawWeapon ; SpriteUpdateHandler_Bread ; SpriteUpdateHandler_Coin ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_Fountain ; SpriteUpdateHandler_Effect_LightningBall20 ; SpriteUpdateHandler_Enemy_Lamprey ; SpriteUpdateHandler_Item_Special ; SpriteUpdateHandler_Item_Standard ; SpriteUpdateHandler_Magic_81 ; SpriteUpdateHandler_Magic_83 ; SpriteUpdateHandler_NPC_ArmorSalesman ; SpriteUpdateHandler_NPC_Doctor ; SpriteUpdateHandler_NPC_KeySalesman_Others ; SpriteUpdateHandler_NPC_King ; CastMagic_FinishHandler_HitWallEffect ; CastMagic_FinishHandler_TilteAfterFirstHit ; CastMagic_UpdateSpriteDirection ; IScripts_DrawPortraitAnimationFrame ; Player_GetBodySpriteFrameOffset ; Player_SetFacingLeft ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; UI_DrawPromptInputSymbol ;[0029]CurrentSprite_FlipMask:; [$0029] [0029].byte $00; [$0029] byte; ; UNUSED: Y scroll position for a sprite. ; ; This is written to but never read from. ; ; ; XREFS: ; CurrentSprite_UpdateState ; CastMagic_RunUpdateSpellHandler ; Player_DrawBody ;[002a]Unused_Sprite_ScrollPosY:; [$002a] [002a].byte $00; [$002a] byte; ; UNUSED: X scroll position for a sprite. ; ; This is written to but never read from. ; ; ; XREFS: ; CurrentSprite_UpdateState ; CastMagic_RunUpdateSpellHandler ; Player_DrawBody ;[002b]Unused_Sprite_ScrollPosX:; [$002b] [002b].byte $00; [$002b] byte;============================================================================ ; MOD NOTES: 7 unused bytes of RAM. ;============================================================================[002c].byte $00,$00,$00,$00,$00,$00,$00; [$002c] undefined; ; XREFS: ; CurrentSprite_UpdateState ; Player_DrawShield ; Player_DrawWeapon ; SpriteUpdateHandler_Bread ; SpriteUpdateHandler_Effect_BossDeath ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_LightningBall20 ; SpriteUpdateHandler_Enemy_Unused_SnakeRoundPart ; SpriteUpdateHandler_Invisible ; IScripts_DrawPortraitAnimationFrame ; Sprite_Draw_Finish ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_Reset ;[0033]Sprites_PPUOffset:; [$0033] [0033].byte $00; [$0033] byte;============================================================================ ; UNUSED: The following 5 bytes are either unused or only ; written to, never read from. ; ; All but $0036 are unsafe to use. ; ; XREFS: ; Sprites_Reset ;============================================================================; ; XREFS: ; Sprites_Reset ;[0034]Sprites_Unused_0034:; [$0034] [0034].byte $00; [$0034] byte; ; XREFS: ; Sprites_Reset ;[0035]Sprites_Unused_0035:; [$0035] [0035].byte $00,$00; [$0035] byte; ; XREFS: ; Sprites_Reset ;[0037]Sprites_Unused_0037:; [$0037] [0037].byte $00; [$0037] byte; ; XREFS: ; Sprites_Reset ;[0038]Sprites_Unused_0038:; [$0038] [0038].byte $00; [$0038] byte;============================================================================ ; Whether sprites can currently be added. ; ; This is 0 when there's room for sprites, and 1 when the slots ; are full. ; ; XREFS: ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_IncNextSpriteSlot ; Sprites_Reset ;============================================================================; ; XREFS: ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ; Sprites_IncNextSpriteSlot ; Sprites_Reset ;[0039]Sprites_SlotsFull:; [$0039] [0039].byte $00; [$0039] bool; ; Temporary variable for the lower byte of a sprite's ; image data. ; ; ; XREFS: ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[003a]Sprite_TileInfo_ReadAddr_L:; [$003a] [003a].byte $00; [$003a] byte; ; Temporary variable for the upper byte of a sprite's ; image data. ; ; ; XREFS: ; Sprite_Draw ;[003b]Sprite_TileInfo_ReadAddr_U:; [$003b] [003b].byte $00; [$003b] byte; ; Temporary variable for the normalized X position of a sprite. ; ; ; XREFS: ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[003c]Temp_Sprites_NormXPos:; [$003c] [003c].byte $00; [$003c] byte; ; Temporary variable for the normalized Y position of a sprite. ; ; ; XREFS: ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[003d]Temp_Sprites_NormYPos:; [$003d] [003d].byte $00; [$003d] byte [003e]Sprite_TileInfo_OffsetX:; [$003e] [003e].byte $00; [$003e] byte [003f]Sprite_TileInfo_OffsetY:; [$003f] [003f].byte $00; [$003f] byte; ; Temporary variable for the number of sprite tile columns ; remaining to draw. ; ; ; XREFS: ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[0040]Temp_Sprites_ColsRemaining:; [$0040] [0040].byte $00; [$0040] byte; ; Temporary variable for the number of sprite tile rows ; remaining to draw. ; ; ; XREFS: ; Sprite_Draw ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[0041]Temp_Sprites_RowsRemaining:; [$0041] [0041].byte $00; [$0041] byte; ; Temporary variable for the current X tile offset to draw for ; the sprite. ; ; ; XREFS: ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[0042]Temp_Sprites_TileXOffset:; [$0042] [0042].byte $00; [$0042] byte; ; Temporary variable for the current Y tile offset to draw for ; the sprite. ; ; ; XREFS: ; Sprite_Draw_FlippedHoriz ; Sprite_Draw_Standard ;[0043]Temp_Sprites_TileYOffset:; [$0043] [0043].byte $00; [$0043] byte; ; A counter that increments or decrements when scrolling ; vertically. ; ; When scrolling from top to bottom, this will count up ; from 0 to 0xCF. ; ; When scrolling from bottom to top, this will count down ; from 0xCF to 0. ; ; ; XREFS: ; Screen_HandleScrollDown ; Screen_HandleScrollUp ; Screen_LoadBlockDataVert ; Screen_LoadBlocksDown ; Screen_LoadDataUp ;[0044]Screen_ScrollVertLoadCounter:; [$0044] [0044].byte $00; [$0044] byte; ; A counter that increments or decrements when scrolling ; horizontally. ; ; When scrolling from left to right, this will count up ; from 0x01 to 0xF9. ; ; When scrolling from right to left, this will count down ; from 0xFF to 0 and wrapping to 0xFE. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Screen_HandleScrollLeft ; Screen_HandleScrollRight ; Screen_LoadBlocksHoriz ; Screen_LoadDataLeft ; Screen_LoadDataRight ;[0045]Screen_ScrollHorizLoadCounter:; [$0045] [0045].byte $00; [$0045] byte; ; XREFS: ; Screen_LoadBlocksHoriz ;[0046]Screen_ScrollHorizLoadOffset:; [$0046] [0046].byte $00; [$0046] byte; ; XREFS: ; Area_ScrollScreenRight ; Screen_LoadBlocksHoriz ;[0047]Screen_Maybe_ScrollHorizDirection:; [$0047] [0047].byte $00; [$0047] byte; ; XREFS: ; Screen_LoadBlockDataVert ;[0048]Temp_Blocks_0048:; [$0048] [0048].byte $00; [$0048] byte; ; XREFS: ; Screen_LoadBlockDataVert ;[0049]Unused_Blocks_0049:; [$0049] [0049].byte $00; [$0049] byte; ; UNUSED: The next 2 bytes are unused by Faxanadu. ;[004a].byte $00,$00; [$004a] byte;============================================================================ ; PPU tilemap and attribute addresses used during screen scroll. ; ; XREFS: ; Screen_LoadBlocksHoriz ; Screen_WriteScrollHorizPPUTileData ;============================================================================; ; PPU tilemap address used when scrolling horizontally. ; ; ; XREFS: ; Screen_LoadBlocksHoriz ; Screen_WriteScrollHorizPPUTileData ;[004c]Screen_ScrollHorizBlocks_PPUTileMapAddr_L:; [$004c] [004c].byte $00; [$004c] byte; ; XREFS: ; Screen_LoadBlocksHoriz ; Screen_WriteScrollHorizPPUTileData ;[004d]Screen_ScrollHorizBlocks_PPUTileMapAddr_U:; [$004d] [004d].byte $00; [$004d] byte; ; PPU tilemap address used when scrolling vertically. ; ; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_WriteScrollVertPPUTileData ;[004e]Screen_ScrollVertBlocks_PPUTileMapAddr_L:; [$004e] [004e].byte $00; [$004e] byte; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_WriteScrollVertPPUTileData ;[004f]Screen_ScrollVertBlocks_PPUTileMapAddr_U:; [$004f] [004f].byte $00; [$004f] byte; ; PPU attribute address used when scrolling horizontally. ; ; ; XREFS: ; Screen_LoadBlocksHoriz ; Screen_WriteScrollHorizPPUAttrData ;[0050]Screen_ScrollHorizBlocks_PPUAttrAddr_L:; [$0050] [0050].byte $00; [$0050] byte; ; XREFS: ; Screen_LoadBlocksHoriz ; Screen_WriteScrollHorizPPUAttrData ;[0051]Screen_ScrollHorizBlocks_PPUAttrAddr_U:; [$0051] [0051].byte $00; [$0051] byte; ; PPU attribute address used when scrolling vertically. ; ; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_WriteScrollVertPPUAttrData ;[0052]Screen_ScrollVertBlocks_PPUAttrAddr_L:; [$0052] [0052].byte $00; [$0052] byte; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_WriteScrollVertPPUAttrData ;[0053]Screen_ScrollVertBlocks_PPUAttrAddr_U:; [$0053] [0053].byte $00; [$0053] byte;============================================================================ ; The screen scrolling direction. ; ; 0 = Left ; 1 = Right ; 2 = Up ; 3 = Down ; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenRight ; GameLoop_UpdatePlayer ; Game_MainLoop ; Game_MovePlayerOnScroll ; Player_CheckHandleJump ; Screen_HandleScroll ; Screen_StopScrollAndLoadBlockProperties ; Screen_UpdateForScroll ;============================================================================; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenRight ; GameLoop_UpdatePlayer ; Game_MainLoop ; Game_MovePlayerOnScroll ; Player_CheckHandleJump ; Screen_HandleScroll ; Screen_StopScrollAndLoadBlockProperties ; Screen_UpdateForScroll ;[0054]Screen_ScrollDirection:; [$0054] [0054].byte $00; [$0054] Direction;============================================================================ ; MOD NOTES: 2 unused bytes of RAM. ;============================================================================[0055].byte $00,$00; [$0055] undefined; ; The following are pending a deep-dive. A lot of these ; variables depend on each other. ; ; ; XREFS: ; Area_ScrollScreenRight ; Game_InitScreenAndMusic ; Screen_HandleScrollDown ; Screen_HandleScrollUp ; Screen_UpdateForScroll ;[0057]PPU_ScrollY:; [$0057] [0057].byte $00; [$0057] byte; ; XREFS: ; Player_DrawBody ; Player_SetInitialState ; Screen_HandleScrollDown ; Screen_HandleScrollUp ; Screen_LoadBlockDataVert ; Screen_SetupNew ;[0058]PPU_ScrollScreenVert:; [$0058] [0058].byte $00; [$0058] byte; ; XREFS: ; Area_LoadScrollDataRight ; Player_DrawBody ; Player_SetInitialState ; Screen_HandleScrollLeft ; Screen_HandleScrollRight ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Screen_SetupNew ;[0059]PPU_ScrollScreenHoriz:; [$0059] [0059].byte $00; [$0059] byte;============================================================================ ; Default mode for the initial sprite when resetting sprite slots. ; ; This supports the following values: ; ; 0xFF = Don't add a default sprite 0. ; 0x00 = Add a default sprite 0 at X=8, Y=23 (used in game) ; 0x01 = Add a default sprite 0 at X=0, Y=72 (not used) ; ; XREFS: ; DEADCODE_Sprites_ResetForDefaultsMode1 ; PPU_HandleOnInterrupt ; Screen_ResetSpritesForGamePlay ; Screen_ResetSpritesForNonGame ; Sprites_Reset ;============================================================================; ; XREFS: ; DEADCODE_Sprites_ResetForDefaultsMode1 ; PPU_HandleOnInterrupt ; Screen_ResetSpritesForGamePlay ; Screen_ResetSpritesForNonGame ; Sprites_Reset ;[005a]Sprites_Sprite0Mode:; [$005a] [005a].byte $00; [$005a] Sprite0Mode;============================================================================ ; Whether to force lower pattern tables when updating the PPU. ; ; XREFS: ; DEADCODE_Sprites_ResetForDefaultsMode1 ; Game_InitScreenAndMusic ; PPU_HandleOnInterrupt ; PPU_WaitUntilFlushed ; Screen_ResetSpritesForGamePlay ;============================================================================; ; XREFS: ; DEADCODE_Sprites_ResetForDefaultsMode1 ; Game_InitScreenAndMusic ; PPU_HandleOnInterrupt ; PPU_WaitUntilFlushed ; Screen_ResetSpritesForGamePlay ;[005b]PPU_ForceLowerPatternTables:; [$005b] [005b].byte $00; [$005b] bool;============================================================================ ; Screen block loading state. ; ; XREFS: ; Area_LoadBlocks ;============================================================================; ; Temporary variable used while loading blocks. ; ; ; XREFS: ; Area_LoadBlocks ;[005c]Temp_LoadedBlockValue:; [$005c] [005c].byte $00; [$005c] byte; ; Temporary variable used to store the loaded blocks count. ; ; ; XREFS: ; Area_LoadBlocks ;[005d]Temp_LoadedBlocksCount:; [$005d] [005d].byte $00; [$005d] byte; ; Current byte offset into the compressed screen data. ; ; ; XREFS: ; Area_LoadBlocks ; Area_LoadNextCompressedScreenBit ;[005e]LoadCompressedScreenData_ByteOffset:; [$005e] [005e].byte $00; [$005e] byte; ; Current bit offset into the current compressed screen byte. ; ; ; XREFS: ; Area_LoadBlocks ; Area_LoadNextCompressedScreenBit ;[005f]LoadCompressedScreenData_BitOffset:; [$005f] [005f].byte $00; [$005f] byte; ; Current compressed screen byte being loaded from. ; ; ; XREFS: ; Area_LoadNextCompressedScreenBit ;[0060]LoadCompressedScreenData_CurByte:; [$0060] [0060].byte $00; [$0060] byte;============================================================================ ; Player/equipment sprite addresses. ; ; This is used to store the address of each piece of ; equipment the player is wearing. That includes the ; player body/armor, the shield, and the weapon. ; ; XREFS: ; Player_LoadArmorSpriteTilesAddr ; Player_LoadShieldSpriteTileAddrs ; Player_LoadWeaponSpriteTileAddrs ; Player_LoadWeaponTile ;============================================================================; ; XREFS: ; Player_LoadArmorSpriteTilesAddr ; Player_LoadShieldSpriteTileAddrs ; Player_LoadWeaponSpriteTileAddrs ; Player_LoadWeaponTile ;[0061]Player_SpriteTileReadAddr_L:; [$0061] [0061].byte $00; [$0061] byte; ; XREFS: ; Player_LoadArmorSpriteTilesAddr ; Player_LoadShieldSpriteTileAddrs ; Player_LoadWeaponSpriteTileAddrs ;[0062]Player_SpriteTileReadAddr_U:; [$0062] [0062].byte $00; [$0062] byte;============================================================================ ; Area/screen information. ; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenDown ; Area_ScrollScreenUp ; Debug_ChooseArea ; EndGame_MoveToKingsRoom ; GameLoop_CheckShowPlayerMenu ; Game_DropLadderToMascon ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_SpawnInTemple ; Player_CheckHandleClimbUp ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_MoveDownScreen ; Player_TryMoveLeft ; Player_TryMoveRight ; Screen_LoadAllScreenInfo ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Screen_SetupNew ;============================================================================; ; The (outside) area the player is in. ; ; This is used to reference screens and other information, ; and to restore the appropriate area when exiting a ; building. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenDown ; Area_ScrollScreenUp ; Debug_ChooseArea ; EndGame_MoveToKingsRoom ; GameLoop_CheckShowPlayerMenu ; Game_DropLadderToMascon ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_SpawnInTemple ; Player_CheckHandleClimbUp ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_MoveDownScreen ; Player_TryMoveLeft ; Player_TryMoveRight ; Screen_LoadAllScreenInfo ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; Screen_SetupNew ;[0063]Area_CurrentScreen:; [$0063] [0063].byte $00; [$0063] byte; ; The index of the screen being loaded. ; ; ; XREFS: ; EndGame_MoveToKingsRoom ; Game_EnterAreaHandler ; Game_ExitBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_SpawnInTemple ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_EnterDoorToInside ; Player_EnterDoorToOutside ; Screen_SetupNew ;[0064]Area_LoadingScreenIndex:; [$0064] [0064].byte $00; [$0064] byte; ; TODO: The pallete for the current screen? ; ; Seems there's more to it than this. It might double as ; a building type in places. (Seems this is the case.) ; ; ; XREFS: ; EndGame_MoveToKingsRoom ; Game_ExitBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_SpawnInTemple ; Player_CheckHandleEnterDoor ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_EnterDoorToInside ; Screen_SetupNew ;[0065]Screen_DestPaletteOrIndex:; [$0065] [0065].byte $00; [$0065] Palette; ; Screen to the left of the currently-visible screen. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Player_TryMoveLeft ;[0066]Area_ScreenToTheLeft:; [$0066] [0066].byte $00; [$0066] byte; ; Screen to the right of the currently-visible screen. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Player_TryMoveRight ;[0067]Area_ScreenToTheRight:; [$0067] [0067].byte $00; [$0067] byte; ; Screen above the currently-visible screen. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenUp ; Player_CheckHandleClimbUp ;[0068]Area_ScreenAbove:; [$0068] [0068].byte $00; [$0068] byte; ; Screen below the currently-visible screen. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Area_ScrollScreenDown ; Player_MoveDownScreen ;[0069]Area_ScreenBelow:; [$0069] [0069].byte $00; [$0069] byte; ; Temporary variable used to store a block position. ; ; ; XREFS: ; Area_SetStateFromDoorDestination ;[006a]Temp_BlockPos:; [$006a] [006a].byte $00; [$006a] byte; ; Temporary variable used to store a block position. ; ; ; XREFS: ; Player_CheckHandleEnterDoor ;[006b]Temp_BlockPos2:; [$006b] [006b].byte $00; [$006b] byte; ; Starting position for a player when changing screens. ; ; This is in $YX position: ; ; Upper nibble = Y position ; Lower nibble = X position / 16 ; ; ; XREFS: ; EndGame_MoveToKingsRoom ; Game_ExitBuilding ; Game_LoadFirstLevel ; Game_SpawnInTemple ; Player_CheckSwitchScreen_SwitchAreaHoriz ; Player_EnterDoorToInside ; Screen_SetupNew ;[006c]Screen_StartPosYX:; [$006c] [006c].byte $00; [$006c] byte [006d]MaybeUnused_006d:; [$006d] [006d].byte $00; [$006d] byte; ; The current operational mode during the scrolling process. ; ; This is managed when scrolling the screen horizontally or ; vertically. It has the following supported values: ; ; 0x00: Load blocks from the area blocks data. ; ; 0x01: Draw blocks to the screen. ; ; ; XREFS: ; Screen_LoadAttrsHoriz ; Screen_LoadAttrsVert ; Screen_LoadBlockDataVert ; Screen_LoadBlocksDown ; Screen_LoadBlocksHoriz ; Screen_LoadDataLeft ; Screen_LoadDataRight ; Screen_LoadDataUp ;[006e]Screen_ScrollLoadMode:; [$006e] [006e].byte $00; [$006e] ScreenScrollLoadMode; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ;[006f]CurrentArea_BlockData1CurAddr:; [$006f] [006f].byte $00; [$006f] byte; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ;[0070]CurrentArea_BlockData2CurAddr:; [$0070] [0070].byte $00; [$0070] byte; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ;[0071]CurrentArea_BlockData3CurAddr:; [$0071] [0071].byte $00; [$0071] byte; ; XREFS: ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ;[0072]CurrentArea_BlockData4CurAddr:; [$0072] [0072].byte $00; [$0072] byte [0073]Screen_NeighborBlocksLoadedByDirection:; [$0073] [0073].byte $00; [0]:; ; XREFS: ; Area_ScrollScreenRight ; Screen_LoadBlocksHoriz ;[0074]Screen_ScrollHorizBlocksLoaded:; [$0074] [0074].byte $00; [1]:; ; XREFS: ; Area_ScrollScreenRight ; Screen_LoadBlockDataVert ;[0075]Screen_MaybeUnused_0075:; [$0075] [0075].byte $00; [2]:; ; XREFS: ; Area_ScrollScreenRight ; Screen_LoadBlocksHoriz ;[0076]Screen_ScrollHorizAttrsLoaded:; [$0076] [0076].byte $00; [3]:; ; XREFS: ; Area_ScrollScreenRight ; Screen_RunWriteScrollDataHandler ;[0077]Screen_LoadBlocksStage:; [$0077] [0077].byte $00; [0]: [0078].byte $00; [1]: [0079].byte $00; [2]:; ; XREFS: ; Area_LoadBlocks ; Game_LoadAreaTable ;[007a]Area_ScreenBlocksOffset:; [$007a] [007a].byte $00; [$007a] byte; ; XREFS: ; Game_LoadAreaTable ;[007b]Area_ScreenBlocksOffset_U:; [$007b] [007b].byte $00; [$007b] byte; ; XREFS: ; Game_LoadAreaTable ;[007c]CurrentArea_TableAddr:; [$007c] [007c].byte $00; [$007c] byte; ; XREFS: ; Game_LoadAreaTable ;[007d]CurrentArea_TableAddr_U:; [$007d] [007d].byte $00; [$007d] byte; ; XREFS: ; Area_SetBlocks_SetAttributes ; Game_LoadAreaTable ; Screen_LoadBlockDataVert ; Screen_LoadBlocksHoriz ; TextBox_GetBackingAttributeData ;[007e]CurrentArea_BlockAttributesAddr:; [$007e] [007e].byte $00,$00; [$007e] byte [0080]CurrentArea_BlockData1StartAddr:; [$0080] [0080].byte $00,$00; [$0080] byte [0082]CurrentArea_BlockData2StartAddr:; [$0082] [0082].byte $00,$00; [$0082] byte [0084]CurrentArea_BlockData3StartAddr:; [$0084] [0084].byte $00,$00; [$0084] byte [0086]CurrentArea_BlockData4StartAddr:; [$0086] [0086].byte $00,$00; [$0086] byte; ; XREFS: ; Area_LoadBlockProperties ; Game_LoadAreaTable ;[0088]CurrentArea_BlockPropertiesAddr:; [$0088] [0088].byte $00; [$0088] byte; ; XREFS: ; Game_LoadAreaTable ;[0089]CurrentArea_BlockPropertiesAddr_U:; [$0089] [0089].byte $00; [$0089] byte; ; XREFS: ; Area_LoadScrollDataRight ; Game_LoadAreaTable ;[008a]CurrentArea_ScrollingDataAddr:; [$008a] [008a].byte $00; [$008a] byte; ; XREFS: ; Area_LoadScrollDataRight ; Game_LoadAreaTable ;[008b]ScrollingData_U:; [$008b] [008b].byte $00; [$008b] byte; ; Current area's ROM bank. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_ExitBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ;[008c]CurrentArea_ROMBank:; [$008c] [008c].byte $00; [$008c] ROMBank; ; XREFS: ; Area_SetStateFromDoorDestination ; Game_LoadAreaTable ;[008d]CurrentArea_DoorLocationsAddr:; [$008d] [008d].byte $00; [$008d] byte; ; XREFS: ; Area_SetStateFromDoorDestination ; Game_LoadAreaTable ;[008e]CurrentArea_DoorLocationsAddr_U:; [$008e] [008e].byte $00; [$008e] byte; ; XREFS: ; Game_LoadAreaTable ;[008f]CurrentArea_DoorDestinationsAddr:; [$008f] [008f].byte $00; [$008f] byte; ; XREFS: ; Game_LoadAreaTable ;[0090]CurrentArea_DoorDestinationsAddr_U:; [$0090] [0090].byte $00; [$0090] byte;============================================================================ ; Upper and lower bytes of a PPU address for player sprite rendering. ; ; This is used during sprite loading and drawing. These form ; the address in the PPU where the player body, armor, ; shield, or weapon tiles will be loaded. ; ; XREFS: ; Player_LoadArmorTilesToPPU ; Player_LoadShieldTilesToPPU ; Player_LoadWeaponTile ; Player_LoadWeaponTilesToPPU ;============================================================================; ; XREFS: ; Player_LoadArmorTilesToPPU ; Player_LoadShieldTilesToPPU ; Player_LoadWeaponTile ; Player_LoadWeaponTilesToPPU ;[0091]Player_SpriteSegmentPPUAddr_L:; [$0091] [0091].byte $00; [$0091] byte; ; XREFS: ; Player_LoadArmorTilesToPPU ; Player_LoadShieldTilesToPPU ; Player_LoadWeaponTile ; Player_LoadWeaponTilesToPPU ;[0092]Player_SpriteSegmentPPUAddr_U:; [$0092] [0092].byte $00; [$0092] byte; ; XREFS: ; Area_LoadTiles ;[0093]Area_TilesReadAddress:; [$0093] [0093].word $0000; [$0093] ushort; ; XREFS: ; Area_LoadTiles ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_ExitBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ;[0095]Area_TilesIndex:; [$0095] [0095].byte $00; [$0095] byte;============================================================================ ; Image data addresses for the sprite being drawn. ; ; XREFS: ; CurrentSprite_LoadTilesInfo ; Sprites_LoadImageForCurrentSprite ;============================================================================; ; XREFS: ; CurrentSprite_LoadTilesInfo ; Sprites_LoadImageForCurrentSprite ;[0096]CurrentSprite_LoadTileAddr:; [$0096] [0096].byte $00; [$0096] byte; ; XREFS: ; CurrentSprite_LoadTilesInfo ; Sprites_LoadImageForCurrentSprite ;[0097]CurrentSprite_LoadTileAddr_U:; [$0097] [0097].byte $00; [$0097] byte;============================================================================ ; PPU target address to draw sprite tiles. ; ; XREFS: ; CurrentSprite_ResetPPUTileOffset ; Sprites_LoadImageForCurrentSprite ;============================================================================; ; XREFS: ; CurrentSprite_ResetPPUTileOffset ; Sprites_LoadImageForCurrentSprite ;[0098]CurrentSprite_TargetPPUTileAddr:; [$0098] [0098].byte $00; [$0098] byte; ; The PPU row of the next tile ; ; ; XREFS: ; CurrentSprite_ResetPPUTileOffset ; Sprites_LoadImageForCurrentSprite ;[0099]CurrentSprite_TargetPPUTileAddr_U:; [$0099] [0099].byte $00; [$0099] byte;============================================================================ ; PPU offset of the first tile in the sprite. ; ; This is used when loading a sprite. ; ; XREFS: ; GameLoop_LoadSpriteImages ; Sprites_LoadImageForCurrentSprite ;============================================================================; ; XREFS: ; GameLoop_LoadSpriteImages ; Sprites_LoadImageForCurrentSprite ;[009a]CurrentSprite_StartPPUTileOffset:; [$009a] [009a].byte $00; [$009a] byte;============================================================================ ; Number of PPU tiles remaining to draw for the current sprite. ; ; XREFS: ; CurrentSprite_LoadTilesInfo ; Sprites_LoadImageForCurrentSprite ;============================================================================; ; XREFS: ; CurrentSprite_LoadTilesInfo ; Sprites_LoadImageForCurrentSprite ;[009b]CurrentSprite_LoadTileCount:; [$009b] [009b].byte $00; [$009b] byte;============================================================================ ; MOD NOTES: 1 unused byte of RAM. ;============================================================================[009c]UNUSED_009C:; [$009c] [009c].byte $00; [$009c] undefined;============================================================================ ; Player information. ; ; XREFS: ; Player_TryMoveLeft ; Player_TryMoveRight ;============================================================================; ; X position of the player (fractional points). ; ; ; XREFS: ; Player_TryMoveLeft ; Player_TryMoveRight ;[009d]Player_PosX_Frac:; [$009d] [009d].byte $00; [$009d] byte; ; X position of the player (full points). ; ; MAYBE: Outside only? See Game_SpawnInTemple. ; ; ; XREFS: ; BScript_Action_FacePlayerX ; CurrentSprite_CheckHitPlayer ; FUN_PRG14__9aa1 ; Maybe_Player_CalcAnimFrame ; Player_CastMagic ; Player_DrawShield ; Player_DrawWeapon ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_Ishiisu ; SpriteBehavior_Magman ; SpriteBehavior_Nash ; SpriteBehavior_Zorugeriru__9e13 ; Sprite_CalcDistanceXToPlayer ; Sprite_Maybe_AddFacingPosX ; Area_CanMoveImmediatelyRight ; Area_CanPlayerMoveLeft ; Area_CanPlayerMoveRight ; Area_CanPlayerMoveUp ; Area_CheckCanClimbAdjacent ; Area_LoadScrollDataRight ; Area_SetStateFromDoorDestination ; EndGame_MovePlayerTowardKing ; FUN_PRG15_MIRROR__ec58 ; Game_EnterBuilding ; Game_MovePlayerOnScroll ; Game_MovePlayerOnScrollLeft ; Game_SpawnInTemple ; Player_CheckHandleClimb ; Player_CheckHandleJump ; Player_CheckIfOnLadder ; Player_CheckIfPassable ; Player_CheckOnBreakableBlock ; Player_CheckPushingBlock ; Player_CheckSwitchScreen ; Player_DrawBody ; Player_IsClimbing ; Player_SetPosAtRightEdge ; Player_TryMoveLeft ; Player_TryMoveRight ; Player_UseMattock ; Screen_SetupNew ;[009e]Player_PosX_Block:; [$009e] [009e].byte $00; [$009e] byte; ; MAYBE: Some kind of counter used when scrolling a screen. ; ; When scrolling to the right, this increments by 2 (via a ; manual increment and by adding carry from updating the ; player position). ; ; When scrolling to the left, this decrements by 1 (via ; subtracting carry from updating player position). ; ; ; XREFS: ; CurrentSprite_UpdateState ; Player_DrawWeapon ; CastMagic_RunUpdateSpellHandler ; Game_MovePlayerOnScroll ; Game_MovePlayerOnScrollLeft ; Player_DrawBody ; Player_SetInitialState ; Player_TryMoveRight ; Screen_SetupNew ;[009f]Screen_Maybe_ScrollXCounter:; [$009f] [009f].byte $00; [$009f] byte; ; XREFS: ; Player_CheckHandleClimbDown ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleClimbUp ;[00a0]BYTE_00a0:; [$00a0] [00a0].byte $00; [$00a0] byte; ; Y position of the player ; ; MAYBE: Outside only? See Game_SpawnInTemple. ; ; ; XREFS: ; TextBox_SetCoordsForNPC ; BScript_Action_FacePlayerY ; CurrentSprite_CheckHitPlayer ; Player_CastMagic ; Player_DrawShield ; Player_DrawWeapon ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_Magman ; Sprite_CalcDistanceYToPlayer ; Area_CanMoveUp ; Area_CanPlayerMoveAtY ; Area_CanPlayerMoveLeft ; Area_CanPlayerMoveUp ; Area_CheckCanClimbAdjacent ; Area_LoadScrollDataRight ; Area_ScrollScreenDown ; Area_ScrollScreenUp ; Area_SetStateFromDoorDestination ; FUN_PRG15_MIRROR__ec58 ; Game_EnterBuilding ; Game_SpawnInTemple ; LAB_PRG15_MIRROR__e49a [$PRG15_MIRROR::e49a] ; LAB_PRG15_MIRROR__e4a2 [$PRG15_MIRROR::e4a2] ; Maybe_SetPlayerForScrollUp ; Player_CheckHandleClimbDown ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleClimbUp ; Player_CheckIfOnLadder ; Player_CheckIfPassable ; Player_CheckOnBreakableBlock ; Player_CheckPushingBlock ; Player_CheckSwitchScreen ; Player_ContinueHandleClimbOrJump ; Player_DrawBody ; Player_MoveDownScreen ; Player_SetPosAtBottomEdge ; Player_UseMattock ; Screen_SetupNew ;[00a1]Player_PosY:; [$00a1] [00a1].byte $00; [$00a1] byte; ; XREFS: ; CurrentSprite_UpdateState ; Player_DrawWeapon ; Area_ScrollScreenDown ; Area_ScrollScreenUp ; CastMagic_RunUpdateSpellHandler ; Player_CheckHandleClimbUp ; Player_DrawBody ; Player_MoveDownScreen ; Player_SetInitialState ; Screen_SetupNew ;[00a2]Player_Something_ScrollPosY:; [$00a2] [00a2].byte $00; [$00a2] byte; ; Tick counter that updates only while moving horizontally. ; ; This will update regardless of whether the player ; is moving horizontally or vertically. ; ; ; XREFS: ; Maybe_Player_CalcAnimFrame ; Area_ScrollTo ; Player_CheckHandleClimbDown ; Player_CheckHandleClimbUp ; Player_CheckHandleJump ; Player_GetBodySpriteFrameOffset ; Player_HandleDeath ;[00a3]Player_MovementTick:; [$00a3] [00a3].byte $00; [$00a3] byte; ; Current player flags. ; ; Bit 0: Jumping ; Bit 1: Holding to Climb (from jump/move) ; Bit 2: Falling off ledge/ladder ; Bit 3: Can climb ; Bit 4: Climbing ; Bit 5: Moving (actively walking or climbing) ; Bit 6: Facing right (1) or left (0) ; Bit 7: Attacking ; ; ; XREFS: ; Maybe_Player_CalcAnimFrame ; Player_CalculateVisibility ; Player_CastMagic ; Player_DrawShield ; Player_DrawWeapon ; Player_HitSpriteWithWeapon ; Player_SetDamagedBySprite ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_Ishiisu ; SpriteBehavior_Magman ; SpriteBehavior_Nash ; SpriteBehavior_SirGawaineWolfman ; EndGame_MoveToKingsRoom ; FUN_PRG15_MIRROR__ec58 ; GameLoop_CheckUseCurrentItem ; Game_BeginExitBuilding ; Game_SpawnInTemple ; LAB_PRG15_MIRROR__e42c [$PRG15_MIRROR::e42c] ; Maybe_SetPlayerForScrollUp ; Player_CheckHandleAttack ; Player_CheckHandleClimb ; Player_CheckHandleClimbDown ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleClimbUp ; Player_CheckHandleJump ; Player_CheckIfOnLadder ; Player_CheckOnBreakableBlock ; Player_CheckPushingBlock ; Player_ClearJumpingAndHoldingToClimb ; Player_ContinueHandleClimbOrJump ; Player_EnterDoorToInside ; Player_GetBodySpriteFrameOffset ; Player_HandleDeath ; Player_HandleKnockback ; Player_IsClimbing ; Player_KnockbackHoriz ; Player_SetFacingLeft ; Player_SetInitialState ; Player_StayOnLadderAndContinue ; Player_TryMoveLeft ; Player_TryMoveRight ; Player_UpdateAcceleration ; Player_UseMattock ;[00a4]Player_Flags:; [$00a4] [00a4].byte $00; [$00a4] PlayerFlags; ; Player status bits. ; ; Bit 0: Is attacking ; Bit 1: In knockback ; Bit 7: Wing boots active ; ; ; XREFS: ; Maybe_Player_CalcAnimFrame ; Player_SetDamagedBySprite ; SpriteBehavior_FlashScreenHitPlayer ; Game_DecWingBootsDuration ; Game_DrawScreenInFrozenState ; Player_CheckHandleAttack ; Player_CheckHandleClimb ; Player_CheckHandleClimbDown ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleClimbUp ; Player_CheckHandleJump ; Player_GetBodySpriteFrameOffset ; Player_HandleDeath ; Player_HandleIFrames ; Player_SetInitialState ; Player_UpdateAcceleration ;[00a5]Player_StatusFlag:; [$00a5] [00a5].byte $00; [$00a5] PlayerStatusFlags; ; XREFS: ; Area_Something_IncDAT00a6 ; [$PRG15_MIRROR::e4b1] ; Player_CheckHandleClimbMaybeSide ; Player_ContinueHandleClimbOrJump ;[00a6]Something_Player_ClimbLadderCheckPos:; [$00a6] [00a6].byte $00; [$00a6] byte; ; XREFS: ; Player_DrawWeapon ; Player_LoadArmorTilesToPPU ;[00a7]Player_ArmorLookupIndex:; [$00a7] [00a7].byte $00; [$00a7] byte; ; XREFS: ; Player_DrawSprite ; Player_DrawSpriteImmediately ; Player_LoadArmorTilesToPPU ; Player_LoadShieldTilesToPPU ; Player_LoadWeaponTile ; Player_LoadWeaponTilesToPPU ; Player_SetInitialState ;[00a8]Player_DrawTileReadOffset:; [$00a8] [00a8].byte $00; [$00a8] byte; ; Player's walk/run aceleration. ; ; Seems to start around 0xC0, end around 0x180. ; ; ; XREFS: ; Player_SetInitialState ; Player_SetStandardAcceleration ; Player_TryMoveLeft ; Player_TryMoveRight ; Player_UpdateAcceleration ; Player_UpdatePosFromKnockback ;[00a9]Player_MoveAcceleration:; [$00a9] [00a9].byte $00; [$00a9] byte; ; XREFS: ; Player_SetStandardAcceleration ; Player_TryMoveLeft ; Player_TryMoveRight ; Player_UpdateAcceleration ; Player_UpdatePosFromKnockback ;[00aa]Player_MoveAcceleration_U:; [$00aa] [00aa].byte $00; [$00aa] byte; ; XREFS: ; Player_SetInitialState ;[00ab]Player_Unused_00ab:; [$00ab] [00ab].byte $00; [$00ab] byte; ; Time spent in the current attack phase. ; ; ; XREFS: ; Player_CheckHandleAttack ;[00ac]PlayerHitsPhaseTimer:; [$00ac] [00ac].byte $00; [$00ac] byte; ; Remaining time of invincibility after player was hit by enemy. ; ; ; XREFS: ; Player_HandleTouchEnemy ; Player_HandleTouchEnemyMagic ; Player_SetDamagedBySprite ; SpriteBehavior_FlashScreenHitPlayer ; Player_HandleDeath ; Player_HandleIFrames ; Player_SetInitialState ;[00ad]Player_InvincibilityPhase:; [$00ad] [00ad].byte $00; [$00ad] byte; ; Current attack phase of the player. ; ; ; XREFS: ; Maybe_Player_CalcAnimFrame ; Player_HitSpriteWithWeapon ; FUN_PRG15_MIRROR__ec58 ; Player_CheckHandleAttack ; Player_GetBodySpriteFrameOffset ;[00ae]PlayerHitsPhaseCounter:; [$00ae] [00ae].byte $00; [$00ae] byte;============================================================================ ; MOD NOTES: 2 unused bytes of RAM. ;============================================================================[00af].byte $00,$00; [$00af] undefined; ; XREFS: ; Player_CheckHandleClimbMaybeSide ; Player_StayOnLadderAndContinue ;[00b1]Maybe_ClimbLadderOffset:; [$00b1] [00b1].byte $00; [$00b1] byte; ; Player X position managed during screen scroll. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Game_MovePlayerOnScroll ; Game_MovePlayerOnScrollLeft ; Player_DrawBody ;[00b2]Maybe_PlayerX_ForScroll:; [$00b2] [00b2].byte $00; [$00b2] byte; ; Player Y position managed during screen scroll. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Game_MovePlayerOnScroll ; Player_DrawBody ;[00b3]Maybe_PlayerY_ForScroll:; [$00b3] [00b3].byte $00; [$00b3] byte; ; Counter incrementing while the screen scrolls. ; ; This is used to update the player position at different ; points during a screen scroll. ; ; ; XREFS: ; Area_LoadScrollDataRight ; Game_MovePlayerOnScroll ; Game_MovePlayerOnScrollLeft ; Game_UpdatePlayerOnScroll ; Player_TryMoveLeft ; Player_TryMoveRight ;[00b4]Screen_ScrollPlayerTransitionCounter:; [$00b4] [00b4].byte $00; [$00b4] byte;============================================================================ ; Arguments and results for block-related lookups. ; ; XREFS: ; CastMagic_CheckDirection_Left ; CastMagic_CheckDirection_Right ; CurrentSprite_CalculateVisibility ; CurrentSprite_CanMoveInDirection ; FUN_PRG14__86bd ; Player_CalculateVisibility ; SpriteBehavior_NecronAides ; Sprites_CheckPlacementInvalidAtY ; Sprites_MoveRight ; Area_CanMoveImmediatelyRight ; Area_CanPlayerMoveLeft ; Area_CanPlayerMoveRight ; Area_CheckCanClimbAdjacent ; Area_ConvertPixelsToBlockPos ; Area_SetStateFromDoorDestination ; CastMagic_CalculateVisibility ; Player_CheckIfOnLadder ; Player_CheckOnBreakableBlock ; Player_CheckPushingBlock ; Player_CheckSwitchScreen ; Player_UseMattock ;============================================================================; ; X coordinates of an object (see ; Area_ConvertPixelsToBlockPos). ; ; ; XREFS: ; CastMagic_CheckDirection_Left ; CastMagic_CheckDirection_Right ; CurrentSprite_CalculateVisibility ; CurrentSprite_CanMoveInDirection ; FUN_PRG14__86bd ; Player_CalculateVisibility ; SpriteBehavior_NecronAides ; Sprites_CheckPlacementInvalidAtY ; Sprites_MoveRight ; Area_CanMoveImmediatelyRight ; Area_CanPlayerMoveLeft ; Area_CanPlayerMoveRight ; Area_CheckCanClimbAdjacent ; Area_ConvertPixelsToBlockPos ; Area_SetStateFromDoorDestination ; CastMagic_CalculateVisibility ; Player_CheckIfOnLadder ; Player_CheckOnBreakableBlock ; Player_CheckPushingBlock ; Player_CheckSwitchScreen ; Player_UseMattock ;[00b5]Arg_PixelPosX:; [$00b5] [00b5].byte $00; [$00b5] byte; ; Y coordinates of an object (see ; Area_ConvertPixelsToBlockPos). ; ; ; XREFS: ; CastMagic_CheckDirection_CheckImpassable ; CurrentSprite_CalculateVisibility ; CurrentSprite_CanMoveInDirection ; Player_CalculateVisibility ; SpriteBehavior_NecronAides ; Sprites_CheckPlacementInvalidAtY ; Sprites_MoveRight__86c6 ; Area_CanPlayerMoveAtY ; Area_CanPlayerMoveUp ; Area_CheckCanClimbAdjacent ; Area_ConvertPixelsToBlockPos ; Area_SetStateFromDoorDestination ; CastMagic_CalculateVisibility ; Player_CheckIfOnLadder ; Player_CheckIfPassable ; Player_CheckOnBreakableBlock ; Player_CheckPushingBlock ; Player_CheckSwitchScreen ; Player_UseMattock ;[00b6]Arg_PixelPosY:; [$00b6] [00b6].byte $00; [$00b6] byte; ; Result from a block-related computation. ; ; This is used for many different types of operations. ; ; ; XREFS: ; CastMagic_CheckDirection ; CastMagic_CheckDirection_CheckImpassable ; CastMagic_SetShouldDisperse ; CastMagic_UpdateDeluge ; CastMagic_UpdateFire ; CurrentSprite_CanMoveInDirection ; CurrentSprite_HandleFall ; MoveSpriteHorizIfPossible ; MoveSpriteVerticalIfPossible ; Sprites_MoveRight__86c6 ; Sprites_SetBlockIsMovingResult ; Sprites_SetCurrentSpriteCanMove ; Area_CanMoveImmediatelyRight ; Area_CanMoveUp ; Area_CanPlayerMoveAtY ; Area_CanPlayerMoveLeft ; Area_CanPlayerMoveUp ; Area_CheckCanClimbAdjacent ; Area_HandleBreakableFloor ; Area_IsBlockClimbable ; Area_SetStateFromDoorDestination ; Area_StoreBlockIsAir ; Player_CheckHandleClimbMaybeSide ; Player_CheckHandleEnterDoor ; Player_CheckIfOnLadder ; Player_CheckIfPassable ; Player_CheckOnBreakableBlock ;[00b7]Blocks_Result:; [$00b7] [00b7].byte $00; [$00b7] byte;============================================================================ ; Sprite management. ; ; XREFS: ; CurrentSprite_CalculateVisibility ; Player_CalculateVisibility ; CastMagic_CalculateVisibility ;============================================================================; ; Visibility status of the currently-moving sprite. ; ; 0 = Fully visible ; 1 = Trailing side of sprite obscured ; 2 = Leading side of sprite obscured ; 3 = Sprite fully obscured ; ; ; XREFS: ; CurrentSprite_CalculateVisibility ; Player_CalculateVisibility ; CastMagic_CalculateVisibility ;[00b8]Temp_MovingSpriteVisibility:; [$00b8] [00b8].byte $00; [$00b8] MovingSpriteVisibility; ; XREFS: ; CurrentSprite_CanMoveInDirection ; Sprites_MoveRight__86c6 ;[00b9]Temp_HitBoxValue:; [$00b9] [00b9].byte $00; [$00b9] byte; ; X coordinates of the current 8 active sprites. ; ; ; XREFS: ; BScript_Action_CastMagic ; BScript_Action_FacePlayerX ; CastMagic_HitHandler_Deluge ; CurrentSprite_CalculateVisibility ; CurrentSprite_UpdateState ; FUN_PRG14__844b ; FUN_PRG14__9917 ; FUN_PRG14__9aa1 ; FUN_PRG14__a1cc ; Maybe_SpriteBody__99f3 ; MoveSpriteHorizIfPossible ; SpriteBehavior_BossDeath ; SpriteBehavior_EnemyUnused18__9991 ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_ExecutionHood__a0ad ; SpriteBehavior_Ishiisu ; SpriteBehavior_KingGrieve_9f65 ; SpriteBehavior_Magman ; SpriteBehavior_Nash ; SpriteBehavior_Pakukame ; SpriteBehavior_Ripasheiku_CastMagicOrUpdatePos ; SpriteBehavior_ShadowEura__a077 ; SpriteBehavior_ShadowEura__a12d ; SpriteBehavior_Something_850d ; SpriteBehavior_Zorugeriru__9e13 ; SpriteUpdateHandler_Effect_LightningBall20 ; Sprite_AddPosX ; Sprite_CalcDistanceXToPlayer ; Sprite_CastMagic ; Sprite_CheckHitByCastMagic ; Sprite_Maybe_AddFacingPosX ; Sprite_Maybe_TurnAroundIfAtScreenEdgeHoriz ; Sprite_RunDeathDropHandler ; Sprite_SubtractPosX ; Sprites_CheckPlacementInvalidAtY ;[00ba]CurrentSprites_XPos_Full:; [$00ba] [00ba].byte $00; [0]: [00bb].byte $00; [1]: [00bc].byte $00; [2]: [00bd].byte $00; [3]: [00be].byte $00; [4]: [00bf].byte $00; [5]: [00c0].byte $00; [6]:; ; XREFS: ; Sprites_PopulateNextAvailableSprite ;[00c1]CurrentSprites_XPos_Full_7_:; [$00c1] [00c1].byte $00; [7]:; ; Y coordinates of the current 8 active sprites. ; ; ; XREFS: ; BScript_Action_CastMagic ; BScript_Action_FacePlayerY ; CurrentSprite_CalculateVisibility ; CurrentSprite_HandleFall ; CurrentSprite_UpdateState ; DEADCODE_Sprites_CanMoveDownBelowHitbox ; FUN_PRG14__9917 ; FUN_PRG14__9ac6 ; FUN_PRG14__a0a0 ; FUN_PRG14__a1cc ; MoveSpriteVerticalIfPossible ; SpriteBehavior_BossDeath ; SpriteBehavior_EnemyUnused18__9991 ; SpriteBehavior_EnemyUnused43 ; SpriteBehavior_ExecutionHood__a093 ; SpriteBehavior_Garbled3 ; SpriteBehavior_GiantBees ; SpriteBehavior_KingGrieve_9f65 ; SpriteBehavior_KingGrieve_MoveDown ; SpriteBehavior_Magman ; SpriteBehavior_Pakukame ; SpriteBehavior_Ripasheiku ; SpriteBehavior_Ripasheiku_CastMagicOrUpdatePos ; SpriteBehavior_ShadowEura__a077 ; SpriteBehavior_ShadowEura__a12d ; SpriteBehavior_Zorugeriru__9e13 ; SpriteUpdateHandler_Effect_EnemyDeath ; SpriteUpdateHandler_Effect_LightningBall20 ; Sprite_CalcDistanceYToPlayer ; Sprite_CalculateNewVertPos ; Sprite_CapToBlockOppositeFalling ; Sprite_CastMagic ; Sprite_CheckHitByCastMagic ; Sprite_RunDeathDropHandler ; Sprites_CanMoveDownByHitbox ;[00c2]CurrentSprites_YPos:; [$00c2] [00c2].byte $00; [0]: [00c3].byte $00; [1]: [00c4].byte $00; [2]: [00c5].byte $00; [3]: [00c6].byte $00; [4]: [00c7].byte $00; [5]: [00c8].byte $00; [6]:; ; XREFS: ; GameLoop_LoadSpriteImages ; Sprites_PopulateNextAvailableSprite ;[00c9]CurrentSprites_YPos_7_:; [$00c9] [00c9].byte $00; [7]:; ; An address used to read sprite-related information. ; ; This is used for two purposes: ; ; 1. To store the address of the per-screen sprite ; information while loading sprites onto the screen. ; ; 2. To store the address of a sprite entity's behavior ; state when processing a sprite. ; ; ; XREFS: ; BScript_Op_AddToSpriteData ; BScript_Op_CheckDistanceToPlayer ; BScript_Op_GoTo ; BScript_Op_RunAction ; BScript_Op_SetPhase ; BScript_Op_SwitchBehavior ; BScripts_LoadNextOp ; SpriteBehavior_Hop ; SpriteBehavior_MoveTowardPlayer ; SpriteBehavior_MoveVertically ; SpriteBehavior_SomethingEyeball_17 ; SpriteBehavior_SomethingZoradohna_18 ; SpriteBehavior_WalkForward ; SpriteBehavior__a8d7 ; SpriteOp_CheckDistanceToPlayer_X ; SpriteOp_CheckDistanceToPlayer_Y ; Sprites_IncrementScriptAddr ; Sprites_MaybeDisableAndGoTo ; Sprites_UpdateBehavior ; Screen_LoadAllScreenInfo ; Screen_LoadSpriteInfo ;[00ca]Sprites_ReadInfoAddr:; [$00ca] [00ca].byte $00; [$00ca] byte; ; XREFS: ; BScript_Op_GoTo ; SpriteOp_CheckDistanceToPlayer_X ; SpriteOp_CheckDistanceToPlayer_Y ; Sprites_IncrementScriptAddr ; Sprites_MaybeDisableAndGoTo ; Sprites_UpdateBehavior ; Screen_LoadAllScreenInfo ; Screen_LoadSpriteInfo ;[00cb]Sprites_ReadInfoAddr_U:; [$00cb] [00cb].byte $00; [$00cb] byte [00cc]Screen_ExtraInfoAddr:; [$00cc] [00cc].byte $00; [$00cc] byte; ; XREFS: ; Screen_LoadAllScreenInfo ; Sprites_LoadSpriteValue ;[00cd]Screen_ExtraInfoAddr_U:; [$00cd] [00cd].byte $00; [$00cd] byte; ; XREFS: ; Player_DrawWeapon ; Sprites_IsSpriteOutOfWeaponRange ;[00ce]PlayerPosXPlus10:; [$00ce] [00ce].byte $00; [$00ce] byte; ; XREFS: ; Player_DrawWeapon ;[00cf]Maybe_Something_WeaponPosX:; [$00cf] [00cf].byte $00; [$00cf] byte; ; XREFS: ; Player_DrawWeapon ; Sprites_IsSpriteOutOfWeaponRange ;[00d0]Maybe_Something_WeaponPosY:; [$00d0] [00d0].byte $00; [$00d0] byte; ; XREFS: ; Player_DrawWeapon ;[00d1]DrawWeapon_Unused_00D1:; [$00d1] [00d1].byte $00; [$00d1] byte;============================================================================ ; Range of the currently-selected weapon ; ; XREFS: ; Player_DrawWeapon ; Sprites_IsSpriteOutOfWeaponRange ;============================================================================; ; XREFS: ; Player_DrawWeapon ; Sprites_IsSpriteOutOfWeaponRange ;[00d2]Maybe_WeaponRange_X:; [$00d2] [00d2].byte $00; [$00d2] byte; ; XREFS: ; Player_DrawWeapon ; Sprites_IsSpriteOutOfWeaponRange ;[00d3]Maybe_WeaponRange_Y:; [$00d3] [00d3].byte $00; [$00d3] byte;============================================================================ ; State for the blocked path to Mascon. ; ; This is normally completed by opening all fountains ; and clearing the final block, dropping down a ladder ; to Mascon. ; ; XREFS: ; Game_DropLadderToMascon ; Player_CheckPushingBlock ; ScreenEvents_HandlePathToMasconEvent ;============================================================================; ; Whether the path to Mascon is currently being opened. ; ; This is set when opening the path. It's never read or ; otherwise used. ; ; ; XREFS: ; Game_DropLadderToMascon ; Player_CheckPushingBlock ; ScreenEvents_HandlePathToMasconEvent ;[00d4]PathToMascon_Opening:; [$00d4] [00d4].byte $00; [$00d4] bool; ; The position of the fountain covering block before Mascon. ; ; This is in $YX byte form. ; ; ; XREFS: ; Game_OpenPathToMascon ; Player_CheckPushingBlock ; ScreenEvents_HandlePathToMasconEvent ;[00d5]PathToMascon_FountainCoverPos:; [$00d5] [00d5].byte $00; [$00d5] byte .byte $00; Unused;============================================================================ ; Counts for how long the player pushed against the block before Mascon ; ; XREFS: ; Player_CheckPushingBlock ;============================================================================; ; XREFS: ; Player_CheckPushingBlock ;[00d7]BlockPushCounter:; [$00d7] [00d7].byte $00; [$00d7] byte;============================================================================ ; State for animating the ladder on the path to Mascon. ; ; XREFS: ; Game_DropLadderToMascon ; Game_OpenPathToMascon ;============================================================================; ; The current block position for the ladder on the path to ; Mascon. ; ; ; XREFS: ; Game_DropLadderToMascon ; Game_OpenPathToMascon ;[00d8]PathToMascon_LadderPos:; [$00d8] [00d8].byte $00; [$00d8] byte; ; The number of ladder blocks remaining to place when dropping ; down the ladder to Mascon. ; ; ; XREFS: ; Game_DropLadderToMascon ; Game_OpenPathToMascon ;[00d9]PathToMascon_LadderBlocksRemaining:; [$00d9] [00d9].byte $00; [$00d9] byte;============================================================================ ; An offset into Bank 14 used to generate a random value. ; ; This is used by GetRandom to help generate ; pseudo-random values based on the first 256 bytes of bank 14 ; XOR'd with the controller 1 bitmask. ; ; XREFS: ; GetRandom ;============================================================================; ; XREFS: ; GetRandom ;[00da]Random_Offset:; [$00da] [00da].byte $00; [$00da] byte;============================================================================ ; IScript and cross-bank call invocation. ; ; XREFS: ; IScripts_Begin ; IScripts_JumpToNextAddr ; IScripts_LoadByte ; SplashAnimation_DrawScenery ; StartScreen_Draw ; PPU_WriteTilesFromCHRRAM ; UI_DrawHUDSprites ;============================================================================; ; The address of either the IScript being executed or CHR ; data being loaded/drawn. ; ; ; XREFS: ; IScripts_Begin ; IScripts_JumpToNextAddr ; IScripts_LoadByte ; SplashAnimation_DrawScenery ; StartScreen_Draw ; PPU_WriteTilesFromCHRRAM ; UI_DrawHUDSprites ;[00db]IScriptOrCHRAddr:; [$00db] [00db].byte $00; [$00db] byte; ; XREFS: ; IScripts_Begin ; IScripts_JumpToNextAddr ; IScripts_LoadByte ; SplashAnimation_DrawScenery ; StartScreen_Draw ; PPU_WriteTilesFromCHRRAM ; UI_DrawHUDSprites ;[00dc]IScriptOrCHRAddr_U:; [$00dc] [00dc].byte $00; [$00dc] byte; ; The current offset into the IScript being executed. ; ; ; XREFS: ; IScripts_Begin ; IScripts_JumpToNextAddr ; IScripts_LoadByte ;[00dd]IScriptOffset:; [$00dd] [00dd].byte $00; [$00dd] byte; ; Contents of the "A" register saved before performing a ; banked call for an IScript or other operation. ; ; ; XREFS: ; MMC1_LoadBankAndJump ;[00de]BankedCallSetup_SavedA:; [$00de] [00de].byte $00; [$00de] byte; ; Contents of the "X" register saved before performing a ; banked call for an IScript or other operation. ; ; ; XREFS: ; MMC1_LoadBankAndJump ;[00df]BankedCallSetup_SavedX:; [$00df] [00df].byte $00; [$00df] byte; ; Contents of the "Y" register saved before performing a ; banked call for an IScript or other operation. ; ; ; XREFS: ; MMC1_LoadBankAndJump ;[00e0]BankedCallSetup_SavedY:; [$00e0] [00e0].byte $00; [$00e0] byte;============================================================================ ; MOD NOTES: 7 unused bytes of RAM. ;============================================================================[00e1].byte $00,$00,$00,$00,$00,$00,$00; [$00e1] undefined;============================================================================ ; PPU drawing-related state. ; ; XREFS: ; PasswordScreen_DrawMessage ; PasswordScreen_WriteCharTile ; SplashAnimation_DrawScenery ; StartScreen_Draw ; TextBox_DrawItemImage ; TextBox_FillBackground ; Area_SetBlocks ; Area_SetBlocks_SetAttributes ; Area_SetPPUAddrForBlockIndex ; DEADCODE_FUN_PRG15_MIRROR__c033 ; IScripts_DrawPortraitTileToPPU ; IScripts_LoadPortraitTiles ; PPUBuffer_QueueCommandOrLength ; PPU_IncrementAddrBy ; PPU_SetAddrForTextBoxPos ; PPU_WriteTilesFromCHRRAM ; Player_LoadWeaponTile ; Player_SetItem ; Sprites_LoadImageForCurrentSprite ; TextBox_ClearTextTiles ; TextBox_ShowMessage_Fill4Lines ; TextBox_WriteChar ; UI_ClearSelectedItemPic ; UI_DrawGoldValue ; UI_DrawHUDSprites ; UI_DrawManaOrHPBar ; UI_DrawPlayerExperience ; UI_DrawTimeValue ;============================================================================; ; The target address in the PPU being drawn to. ; ; ; XREFS: ; PasswordScreen_DrawMessage ; PasswordScreen_WriteCharTile ; SplashAnimation_DrawScenery ; StartScreen_Draw ; TextBox_DrawItemImage ; TextBox_FillBackground ; Area_SetBlocks ; Area_SetBlocks_SetAttributes ; Area_SetPPUAddrForBlockIndex ; DEADCODE_FUN_PRG15_MIRROR__c033 ; IScripts_DrawPortraitTileToPPU ; IScripts_LoadPortraitTiles ; PPUBuffer_QueueCommandOrLength ; PPU_IncrementAddrBy ; PPU_SetAddrForTextBoxPos ; PPU_WriteTilesFromCHRRAM ; Player_LoadWeaponTile ; Player_SetItem ; Sprites_LoadImageForCurrentSprite ; TextBox_ClearTextTiles ; TextBox_ShowMessage_Fill4Lines ; TextBox_WriteChar ; UI_ClearSelectedItemPic ; UI_DrawGoldValue ; UI_DrawHUDSprites ; UI_DrawManaOrHPBar ; UI_DrawPlayerExperience ; UI_DrawTimeValue ;[00e8]PPU_TargetAddr:; [$00e8] [00e8].byte $00; [$00e8] byte; ; XREFS: ; PasswordScreen_DrawMessage ; PasswordScreen_WriteCharTile ; SplashAnimation_DrawScenery ; StartScreen_Draw ; TextBox_DrawItemImage ; TextBox_FillBackground ; Area_SetBlocks ; Area_SetBlocks_SetAttributes ; Area_SetPPUAddrForBlockIndex ; DEADCODE_FUN_PRG15_MIRROR__c033 ; IScripts_DrawPortraitTileToPPU ; IScripts_LoadPortraitTiles ; PPUBuffer_QueueCommandOrLength ; PPU_IncrementAddrBy ; PPU_SetAddrForTextBoxPos ; PPU_WriteTilesFromCHRRAM ; Player_LoadWeaponTile ; Player_SetItem ; Sprites_LoadImageForCurrentSprite ; TextBox_ClearTextTiles ; TextBox_ShowMessage_Fill4Lines ; TextBox_WriteChar ; UI_ClearSelectedItemPic ; UI_DrawGoldValue ; UI_DrawHUDSprites ; UI_DrawManaOrHPBar ; UI_DrawPlayerExperience ; UI_DrawTimeValue ;[00e9]PPU_TargetAddr_U:; [$00e9] [00e9].byte $00; [$00e9] byte; ; Tile X position where text or images will be drawn in a ; textbox. ; ; ; XREFS: ; DEADCODE_FUN_PRG12__9041 ; IScriptAction_AddInventoryItem ; IScriptAction_AddInventoryItem_ClearTextBox ; IScripts_PositionAndFillPlaceholderText ; PlayerMenu_DrawInventoryItems ; PlayerMenu_DrawStringLines ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; Shop_Draw ; SplashAnimation_FuncAA94 ; TextBox_Close ; TextBox_FillBackground ; TextBox_GetNextAttributeDataOffset ; TextBox_Open ; TextBox_SetNextAttributeData ; PPU_SetAddrForTextBoxPos ; TextBox_GetBackingAttributeData ; TextBox_ShowMessage_Fill4Lines ; Textbox_Maybe_GetAreaBehindTextbox ;[00ea]TextBox_ContentsX:; [$00ea] [00ea].byte $00; [$00ea] byte; ; Tile Y position where text or images will be drawn in a ; textbox. ; ; ; XREFS: ; IScriptAction_AddInventoryItem ; IScriptAction_AddInventoryItem_ClearTextBox ; IScripts_PositionAndFillPlaceholderText ; PlayerMenu_DrawInventoryItems ; PlayerMenu_DrawStringLines ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; Shop_Draw ; SplashAnimation_FuncAA94 ; TextBox_Close ; TextBox_FillBackground ; TextBox_GetNextAttributeDataOffset ; TextBox_Open ; TextBox_SetNextAttributeData ; PPU_SetAddrForTextBoxPos ; TextBox_GetBackingAttributeData ; TextBox_ShowMessage_Fill4Lines ; Textbox_Maybe_GetAreaBehindTextbox ;[00eb]TextBox_ContentsY:; [$00eb] [00eb].byte $00; [$00eb] byte;============================================================================ ; Additional temporary variables. ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowSellMenu ; IScriptAction_SpendGold ; IScripts_CheckEnoughMoney ; IScripts_ProgressivelyAddGold ; IScripts_ProgressivelySubtractGold ; IScripts_SellMenu_Something8704 ; Menu_UpdateAndDraw ; PasswordScreen_DrawMessage ; PasswordScreen_Show ; Password_DecodeValue ; Password_EncodeValue ; PlayerMenu_Show ; PlayerMenu_ShowInventoryMenu ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_Draw ; Shop_GetPlayerHasSelectedItem ; Shop_Populate ; SpashAnimation_SomethingOutro_aa20 ; SpashAnimation_SomethingOutro_aa46 ; SplashAnimation_A90F ; SplashAnimation_DrawScenery ; SplashAnimation_FuncAA94 ; SplashAnimation_Maybe_NextAnimState1 ; SplashAnimation_Maybe_NextAnimState2 ; StartScreen_Draw ; TextBox_DrawItemImage ; TextBox_DrawItemName ; TextBox_FillBackground ; TextBox_SetNextAttributeData ; UI_DrawString ; UI_DrawText ; Player_AddExperienceFromSprite ; MMC1_LoadBankAndJump ; Messages_Load ; PPUBuffer_WriteFromTemp ; PPU_LoadGlyphsForStrings ; PPU_WriteGlyphTile ; PPU_WriteTilesFromCHRRAM ; Player_Add100XP ; Player_AddGold ; Player_SubtractGold ; Player_UpdateExperience ; TextBox_DisplayMessage ; TextBox_GetBackingAttributeData ; TextBox_ShowMessage_HandleSpaceOrEndOfLine ; TextBox_ShowMessage_LoadMessage ; TextBox_ShowMessage_Pause ; TextBox_WriteChar ; Textbox_Maybe_GetAreaBehindTextbox ; UI_DrawDigitsZeroPadded ; UI_DrawGoldValue ; UI_DrawManaOrHPBar ; UI_DrawPlayerExperience ; UI_DrawSelectedItem ; UI_DrawTimeValue ; UI_GetValueForDigit ; UI_Maybe_GetItemSpritePPUTileAddr ;============================================================================; ; Temporary variable most often used for 24-bit values. ; ; This is not exclusive to 24-bit values. In some places, this ; is used for 16-bit values. In others, 8-bit values. ; ; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowSellMenu ; IScriptAction_SpendGold ; IScripts_CheckEnoughMoney ; IScripts_ProgressivelyAddGold ; IScripts_ProgressivelySubtractGold ; IScripts_SellMenu_Something8704 ; Menu_UpdateAndDraw ; PasswordScreen_DrawMessage ; PasswordScreen_Show ; Password_DecodeValue ; Password_EncodeValue ; PlayerMenu_Show ; PlayerMenu_ShowInventoryMenu ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_Draw ; Shop_GetPlayerHasSelectedItem ; Shop_Populate ; SpashAnimation_SomethingOutro_aa20 ; SpashAnimation_SomethingOutro_aa46 ; SplashAnimation_A90F ; SplashAnimation_DrawScenery ; SplashAnimation_FuncAA94 ; SplashAnimation_Maybe_NextAnimState1 ; SplashAnimation_Maybe_NextAnimState2 ; StartScreen_Draw ; TextBox_DrawItemImage ; TextBox_DrawItemName ; TextBox_FillBackground ; TextBox_SetNextAttributeData ; UI_DrawString ; UI_DrawText ; Player_AddExperienceFromSprite ; MMC1_LoadBankAndJump ; Messages_Load ; PPUBuffer_WriteFromTemp ; PPU_LoadGlyphsForStrings ; PPU_WriteGlyphTile ; PPU_WriteTilesFromCHRRAM ; Player_Add100XP ; Player_AddGold ; Player_SubtractGold ; Player_UpdateExperience ; TextBox_DisplayMessage ; TextBox_GetBackingAttributeData ; TextBox_ShowMessage_HandleSpaceOrEndOfLine ; TextBox_ShowMessage_LoadMessage ; TextBox_ShowMessage_Pause ; TextBox_WriteChar ; Textbox_Maybe_GetAreaBehindTextbox ; UI_DrawDigitsZeroPadded ; UI_DrawGoldValue ; UI_DrawManaOrHPBar ; UI_DrawPlayerExperience ; UI_DrawSelectedItem ; UI_DrawTimeValue ; UI_GetValueForDigit ; UI_Maybe_GetItemSpritePPUTileAddr ;[00ec]Temp_Int24:; [$00ec] [00ec].byte $00; [$00ec] byte; ; XREFS: ; IScriptAction_OpenShop ; IScriptAction_ShowSellMenu ; IScriptAction_SpendGold ; IScripts_CheckEnoughMoney ; IScripts_ProgressivelyAddGold ; IScripts_ProgressivelySubtractGold ; PasswordScreen_DrawMessage ; PasswordScreen_Show ; Password_EncodeValue ; PlayerMenu_Show ; PlayerMenu_ShowInventoryMenu ; PlayerMenu_ShowStatusMenu ; PlayerMenu_ShowSubmenu ; Player_AddToInventory ; Player_LacksItem ; Player_RemoveItem ; Shop_Draw ; Shop_GetPlayerHasSelectedItem ; SpashAnimation_SomethingOutro_aa20 ; SpashAnimation_SomethingOutro_aa46 ; SplashAnimation_DrawScenery ; SplashAnimation_FuncAA94 ; SplashAnimation_Maybe_NextAnimState1 ; SplashAnimation_Maybe_NextAnimState2 ; StartScreen_Draw ; TextBox_DrawItemName ; TextBox_GetNextAttributeDataOffset ; TextBox_SetNextAttributeData ; Player_AddExperienceFromSprite ; MMC1_LoadBankAndJump ; Messages_Load ; PPU_LoadGlyphsForStrings ; Player_Add100XP ; Player_AddGold ; Player_SubtractGold ; Player_UpdateExperience ; TextBox_ShowMessage_HandleSpaceOrEndOfLine ; TextBox_ShowMessage_LoadMessage ; TextBox_ShowMessage_Pause ; TextBox_WriteChar ; Textbox_Maybe_GetAreaBehindTextbox ; UI_DrawGoldValue ; UI_DrawPlayerExperience ; UI_DrawTimeValue ; UI_GetValueForDigit ; UI_Maybe_GetItemSpritePPUTileAddr ;[00ed]Temp_Int24_M:; [$00ed] [00ed].byte $00; [$00ed] byte; ; XREFS: ; IScriptAction_ShowSellMenu ; Password_DecodeValueList ; Password_EncodeGameState ; Password_EncodeValueList ; Password_Load ; PlayerMenu_ShowStatusMenu ; Player_AddToInventory ; Player_RemoveItem ; Shop_Draw ; SplashAnimation_FuncAA94 ; StartScreen_Draw ; UI_DrawString ; MMC1_LoadBankAndJump ; TextBox_LoadItemSourceTiles ; UI_DrawGoldValue ; UI_DrawManaOrHPBar ; UI_DrawPlayerExperience ; UI_DrawTimeValue ; UI_GetValueForDigit ;[00ee]Temp_Int24_U:; [$00ee] [00ee].byte $00; [$00ee] byte; ; XREFS: ; IScriptAction_ShowSellMenu ; Password_EncodeGameState ; Password_Load ; Player_RemoveItem ; MMC1_LoadBankAndJump ; TextBox_LoadItemSourceTiles ; UI_DrawManaOrHPBar ;[00ef]Maybe_Temp4:; [$00ef] [00ef].byte $00; [$00ef] byte;============================================================================ ; MOD NOTES: 2 unused bytes of RAM. ;============================================================================[00f0].byte $00,$00; [$00f0] undefined;============================================================================ ; Current msuic script address for all 4 channels. ; ; XREFS: ; MScript_Op_BeginLoop ; MScript_Op_End ; MScript_Op_EndLoop ; MScript_Op_JumpSubroutine ; MScript_Op_NextLoopIfNCompleted ; MScript_Op_RestartChannel ; MScript_Op_RestoreAddr ; MScript_Op_Return ; MScript_Op_SaveAddr_Store ;============================================================================; ; XREFS: ; MScript_Op_BeginLoop ; MScript_Op_End ; MScript_Op_EndLoop ; MScript_Op_JumpSubroutine ; MScript_Op_NextLoopIfNCompleted ; MScript_Op_RestartChannel ; MScript_Op_RestoreAddr ; MScript_Op_Return ; MScript_Op_SaveAddr_Store ;[00f2]Music_CurrentScriptAddrs:; [$00f2] [00f2].word $0000; [0]: [00f4].word $0000; [1]: [00f6].word $0000; [2]:; ; XREFS: ; Music_Load ;[00f8]Music_CurrentScriptAddrs_3_:; [$00f8] [00f8].word $0000; [3]:;============================================================================ ; The ID of the current music. ; ; If bit 7 (MSB) is set, then the music is currently ; playing. ; ; XREFS: ; SplashAnimation_RunIntro ; SplashAnimation_RunOutro ; StartScreen_Draw ; SpriteBehavior_ShadowEura ; Area_ScrollTo ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_ExitBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_ShowStartScreen ; Player_CheckHandleEnterDoor ; Player_HandleDeath ; Player_UseHourGlass ; ScreenEvents_HandleBoss ; ScreenEvents_HandleFinalBossKilled ; Audio_InitPlayingState ; Audio_ResetIfNothingSet ; MScript_Op_RestartChannel ; Music_HandleOnInterrupt ; Music_Load ; Music_PlayNext ;============================================================================; ; XREFS: ; SplashAnimation_RunIntro ; SplashAnimation_RunOutro ; StartScreen_Draw ; SpriteBehavior_ShadowEura ; Area_ScrollTo ; Game_EnterAreaHandler ; Game_EnterBuilding ; Game_ExitBuilding ; Game_LoadCurrentArea ; Game_LoadFirstLevel ; Game_ShowStartScreen ; Player_CheckHandleEnterDoor ; Player_HandleDeath ; Player_UseHourGlass ; ScreenEvents_HandleBoss ; ScreenEvents_HandleFinalBossKilled ; Audio_InitPlayingState ; Audio_ResetIfNothingSet ; MScript_Op_RestartChannel ; Music_HandleOnInterrupt ; Music_Load ; Music_PlayNext ;[00fa]Music_Current:; [$00fa] [00fa].byte $00; [$00fa] Music;============================================================================ ; The ID of the current sound effect. ; ; If bit 7 (MSB) is set, then the sound effect is currently ; playing. ; ; XREFS: ; SoundEffect_SetCurrent ; Audio_InitPlayingState ; SoundEffects_HandleOnInterrupt ;============================================================================[00fb]SoundEffect_Current:; [$00fb] [00fb].byte $00; [$00fb] byte;============================================================================ ; MOD NOTES: 4 unused bytes of RAM. ;============================================================================[00fc].byte $00,$00,$00; [$00fc] undefined [00ff]irq:; [$00ff] [00ff].byte $00; [$00ff] undefined