;================================================================================ ; RAM Labels & Assertions ;-------------------------------------------------------------------------------- ; This module is primarily concerned with labeling WRAM addresses used by the ; randomizer and documenting their usage. ; ; See the JP 1.0 disassembly for reference as well ; (https://github.com/spannerisms/jpdasm/ - 31/10/2022) ;-------------------------------------------------------------------------------- pushpc org 0 ;================================================================================ ; Direct Page ;-------------------------------------------------------------------------------- base $7E0000 Scrap: Scrap00: skip 1 ; Used as short-term scratch space. If you need some short-term Scrap01: skip 1 ; RAM, you can often use these. Double check that the next use Scrap02: skip 1 ; of the addresses you want to use is a write. Scrap03: skip 1 ; Scrap04: skip 1 ; Scrap05: skip 1 ; Scrap06: skip 1 ; Scrap07: skip 1 ; Scrap08: skip 1 ; Scrap09: skip 1 ; Scrap0A: skip 1 ; Scrap0B: skip 1 ; Scrap0C: skip 1 ; Scrap0D: skip 1 ; Scrap0E: skip 1 ; Scrap0F: skip 1 ; LinkPosY = $7E0020 ; 2 bytes LinkPosX = $7E0022 ; 2 bytes ;================================================================================ ; Bank 7E ;-------------------------------------------------------------------------------- ;================================================================================ ; Mirrored WRAM ;-------------------------------------------------------------------------------- ; Pages 0x00–0x1F of Bank7E are mirrored to every program bank ALTTP uses. ;-------------------------------------------------------------------------------- CurrentMSUTrack = $7E010B CurrentVolume = $7E0127 TargetVolume = $7E0129 CurrentControlRequest = $7E0133 ; Last thing written to MusicControlRequest MusicControl = $7E012B MusicControlRequest = $7E012C ItemReceiptID = $7E02D8 SpritePosYLow = $7E0D00 ; all $10 bytes SpritePosXLow = $7E0D10 SpritePosYHigh = $7E0D20 SpritePosXHigh = $7E0D30 SpriteAuxTable = $7E0DA0 ; 0x1F bytes SpriteAITable = $7E0DD0 SpriteTypeTable = $7E0E20 SpriteDirectionTable = $7E0EB0 ToastBuffer = $7E1E0E ; 2 bytes DoToast ScratchBufferNV = $7E1E70 ; Callee preserved, not ok to clobber ScratchBufferV = $7E1E80 ; Caller preserved, okay to clobber ;1E90 ClockHours = $7E1E90 ; Clock Hours ClockMinutes = $7E1E94 ; Clock Minutes ClockSeconds = $7E1E98 ; Clock Seconds ClockBuffer = $7E1E9C ; Clock Temporary ;1EA0 ;1EB0 ;1EC0 ;1ED0 ;1EE0 ;1EF0 ;================================================================================ ; UNMIRRORED WRAM ; Addresses from here on can only be accessed with long addressing ; or absolute addressing with the appropriate data bank set ;-------------------------------------------------------------------------------- TileUploadBuffer = $7EA180 ; 0x300 bytes SpriteOAM = $7EC025 ; ; $7EC700 - Tile map buffer for HUD HUDKeyIcon = $7EC726 HUDGoalIndicator = $7EC72A HUDPrizeIcon = $7EC742 HUDRupees = $7EC750 HUDBombCount = $7EC75A HUDArrowCount = $7EC760 HUDKeyDigits = $7EC764 BigRAM = $7EC900 ; Big buffer of free ram (0x1F00) ;================================================================================ ; Bank 7F ;-------------------------------------------------------------------------------- RedrawFlag = $7F5000 SpriteSkipEOR = $7F5008 MSReceived = $7F5031 ; GanonWarpChain = $7F5032 ForceHeartSpawn = $7F5033 SkipHeartSave = $7F5034 AltTextFlag = $7F5035 ; two bytes, next must be zero. 0=disable BossKills = $7F5037 LagTime = $7F5038 RupeesCollected = $7F503C ; 2 bytes NonChestCounter = $7F503E TileUploadOffsetOverride = $7F5042 NMIAux = $7F5044 ShopId = $7F5050 ShopType = $7F5051 ShopInventory = $7F5052 ; 0x0C ShopState = $7F505F ShopCapacity = $7F5060 ShopScratch = $7F5061 ShopSRAMIndex = $7F5062 ShopMerchant = $7F5063 ; ShopDMATimer = $7F5064 unused ShopPriceColumn = $7F5066 ; two bytes OneMindId = $7F5072 OneMindTimerRAM = $7F5073 ClockStatus = $7F507E ; 2 bytes ; ---- --dn ; d - dnf ; n - negative RNGLockIn = $7F5090 ; RNG Item BusyItem = $7F5091 BusyHealth = $7F5092 BusyMagic = $7F5093 DialogOffsetPointer = $7F5094 ; 2 bytes DialogReturnPointer = $7F5096 ; 2 bytes StalfosBombDamage = $7F509D ValidKeyLoaded = $7F509E SwordModifier = $7F50C0 ShieldModifier = $7F50C1 ; not implemented ArmorModifier = $7F50C2 MagicModifier = $7F50C3 LightConeModifier = $7F50C4 CuccoStormer = $7F50C5 ; non-zero write causes storm, needs to be zeroed OldManDash = $7F50C6 IceModifier = $7F50C7 InfiniteArrows = $7F50C8 InfiniteBombs = $7F50C9 InfiniteMagic = $7F50CA DPadInverter = $7F50CB ; fill in values OHKOFlag = $7F50CC SpriteSwapper = $7F50CD BootsModifier = $7F50CE ; $7F50D0 - $7F50FF - Block Cypher Parameters ; $7F5100 - $7F51FF - Block Cypher Buffer ; Crypto buffer ($7F50D0 - $7F51FF) KeyBase = $7F50D0 y = $7F50E0 z = $7F50E4 Sum = $7F50E8 p = $7F50EC e = $7F50F0 CryptoScratch = $7F50F2 CryptoBuffer = $7F5100 v = $7F5100 RNGPointers = $7F5200 ; $FF bytes RxBuffer = $7F5300 ; $00-$5F buffer $60-7E reserved RxStatus = $7F537F ; 1 byte TxBuffer = $7F5380 ; $80 - $EF buffer $F0 - $FE reserved TxStatus = $7F53FF ; $F0 - $FE MSUFallbackTable = $7F5460 ; 8 bytes MSUDelayedCommand = $7F5469 MSUPackCount = $7F546A MSUPackCurrent = $7F546B MSUPackRequest = $7F546C MSULoadedTrack = $7F546D ; 2 bytes MSUResumeTrack = $7F546F MSUResumeTime = $7F5470 ; 4 bytes MSUResumeControl = $7F5474 CompassTotalsWRAM = $7F5410 DialogBuffer = $7F5700 ; $FF bytes ;================================================================================ ; RAM Assertions ;-------------------------------------------------------------------------------- macro assertRAM(label, address) assert