Merged in DR v1.4.1.6
This commit is contained in:
187
sram.asm
187
sram.asm
@@ -10,6 +10,7 @@
|
||||
;--------------------------------------------------------------------------------
|
||||
pushpc
|
||||
org 0 ; This module writes no bytes. Asar gives bank cross errors without this.
|
||||
SaveDataWRAM = $7EF000
|
||||
|
||||
;================================================================================
|
||||
; Room Data ($7EF000 - $7EF27F
|
||||
@@ -21,8 +22,14 @@ org 0 ; This module writes no bytes. Asar gives bank cross errors without this.
|
||||
; 2 (southwest), and 1 (southeast), which is the same as they are laid out on the screen from
|
||||
; left to right, top to bottom.
|
||||
;
|
||||
; The .l sub-label should be used when the accumulator is in 16-bit mode and we want to
|
||||
; load both bytes or store to both bytes at once. The .high and .low sub-labels should be used
|
||||
; when in 8-bit mode and we only want to load or store one byte
|
||||
;
|
||||
; Example: We can use RoomDataWRAM[$37].high to read or write the pot key in the first
|
||||
; floodable room in Swamp Palace ($04)
|
||||
; floodable room in Swamp Palace (bit $04). To check if a boss has been killed we can
|
||||
; take the room index for a boss room (e.g. $07 for Tower of Hera) and bitmask $FF00
|
||||
; like this: RoomDataWRAM[$07].l : AND.w #$FF00
|
||||
;--------------------------------------------------------------------------------
|
||||
; .high Byte: d d d d b k u t
|
||||
; .low Byte: s e h c q q q q
|
||||
@@ -128,8 +135,8 @@ MaximumHealth: skip 1 ; \ Max Health & Current Health
|
||||
CurrentHealth: skip 1 ; / Max value for both is $A0 | $04 = half heart | $08 = heart
|
||||
CurrentMagic: skip 1 ; Current magic | Max value is $80
|
||||
CurrentSmallKeys: skip 1 ; Number of small keys held for current dungeon (integer)
|
||||
BombCapacityUpgrades: skip 1 ; \ Bomb & Arrow Capacity Upgrades
|
||||
ArrowCapacityUpgrades: skip 1 ; / Indicates flatly how many can be held above vanilla max (integers)
|
||||
BombCapacity: skip 1 ; \ Bomb & Arrow Capacity Upgrades
|
||||
ArrowCapacity: skip 1 ; / Indicates flatly how many can be held (integers)
|
||||
HeartsFiller: skip 1 ; Hearts collected yet to be filled. Write in multiples of $08
|
||||
MagicFiller: skip 1 ; Magic collected yet to be filled
|
||||
PendantsField: skip 1 ; - - - - - g b r (bitfield)
|
||||
@@ -168,13 +175,14 @@ CurrentGenericKeys: skip 1 ; Generic small keys
|
||||
;================================================================================
|
||||
; Tracking & Indicators ($7EF38C - $7EF3F0)
|
||||
;--------------------------------------------------------------------------------
|
||||
InventoryTracking: skip 2 ; b r m p n s k f - - - - - - o q (bitfield)
|
||||
InventoryTracking: skip 2 ; - - - - - - o q b r m p n s k f (bitfield)
|
||||
; b = Blue Boomerang | r = Red Boomerang | m = Mushroom Current
|
||||
; p = Magic Powder | n = Mushroom Past | s = Shovel
|
||||
; k = Inactive Flute | f = Active Flute | o = Any bomb acquired
|
||||
; q = Quickswap locked
|
||||
BowTracking: skip 2 ; b s p - - - - - - - - - - - - - (bitfield)
|
||||
; b = Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow
|
||||
BowTracking: skip 2 ; - - - - - - - - b s p f - - - - (bitfield)
|
||||
; b = Any Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow
|
||||
; f = First progressive bow
|
||||
; The front end writes two distinct progressive bow items. p
|
||||
; indicates whether the "second" has been found independent of
|
||||
; the first
|
||||
@@ -250,7 +258,8 @@ MapOverlay: skip 2 ; Used to reveal dungeon prizes on the map in mo
|
||||
; | m = Misery Mire | d = Palace of Darkness | s = Swamp Palace
|
||||
; | a = Aga Tower | t = Desert Palace | e = Eastern Palace
|
||||
; / h = Hyrule Castle | s = Sewer Passage
|
||||
HudFlag: ;
|
||||
HudFlag: ; - h c - - - - -
|
||||
; c = show maps and compasses | h = show heart pieces
|
||||
IgnoreFaeries: ;
|
||||
HasGroveItem: ;
|
||||
GeneralFlags: skip 1 ; - - h - - i - g (bitfield)
|
||||
@@ -310,46 +319,31 @@ MagicCounter: skip 2 ; Magic used by player (16-bit integer)
|
||||
HighestMail: skip 1 ; Highest mail level
|
||||
SmallKeyCounter: skip 1 ; Total Number of small keys collected (integer)
|
||||
HeartPieceCounter: skip 1 ; Total Number of heartpieces collected (integer)
|
||||
CrystalCounter: skip 1 ; Total Number of crystals collected (integer)
|
||||
skip 1 ; Unused
|
||||
DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize has been collected.
|
||||
; This has the same shape as the dungeon item bitfields.
|
||||
skip 44 ; Unused
|
||||
ServiceSequenceRx: ; Service sequence receive
|
||||
ServiceSequenceTx: ; Service sequence transmit
|
||||
ServiceSequence: skip 8 ; Service request block. See servicerequest.asm
|
||||
skip 8 ; Unused
|
||||
DungeonAbsorbedKeys: ; \ Absorbed key counters (integers)
|
||||
SewerAbsorbedKeys: skip 1 ; | Sewer Passage
|
||||
HCAbsorbedKeys: skip 1 ; | Hyrule Castle
|
||||
EPAbsorbedKeys: skip 1 ; | Eastern Palace
|
||||
DPAbsorbedKeys: skip 1 ; | Desert Palace
|
||||
CTAbsorbedKeys: skip 1 ; | Agahnim's Tower
|
||||
SPAbsorbedKeys: skip 1 ; | Swamp Palace
|
||||
PDAbsorbedKeys: skip 1 ; | Palace of Darkness
|
||||
MMAbsorbedKeys: skip 1 ; | Misery Mire
|
||||
SWAbsorbedKeys: skip 1 ; | Skull Woods
|
||||
IPAbsorbedKeys: skip 1 ; | Ice Palace
|
||||
THAbsorbedKeys: skip 1 ; | Tower of Hera
|
||||
TTAbsorbedKeys: skip 1 ; | Thieves' Town
|
||||
TRAbsorbedKeys: skip 1 ; | Turtle Rock
|
||||
GTAbsorbedKeys: skip 1 ; / Ganon's Tower
|
||||
skip 2 ; Reserved for previous table
|
||||
DungeonLocationsChecked: ; \ Dungeon locations checked counters (integers)
|
||||
SewersLocations: skip 1 ; | Sewer Passage
|
||||
HCLocations: skip 1 ; | Hyrule Castle
|
||||
EPLocations: skip 1 ; | Eastern Palace
|
||||
DPLocations: skip 1 ; | Desert Palace
|
||||
CTLocations: skip 1 ; | Agahnim's Tower
|
||||
SPLocations: skip 1 ; | Swamp Palace
|
||||
PDLocations: skip 1 ; | Palace of Darkness
|
||||
MMLocations: skip 1 ; | Misery Mire
|
||||
SWLocations: skip 1 ; | Skull Woods
|
||||
IPLocations: skip 1 ; | Ice Palace
|
||||
THLocations: skip 1 ; | Tower of Hera
|
||||
TTLocations: skip 1 ; | Thieves' Town
|
||||
TRLocations: skip 1 ; | Turtle Rock
|
||||
GTLocations: skip 1 ; / Ganon's Tower:
|
||||
skip 2 ; Reserved for previous table
|
||||
MapCountDisplay: skip 2 ;
|
||||
CrystalCounter: skip 2 ; Total Number of crystals collected (integer)
|
||||
skip 40 ; Unused
|
||||
ServiceSequence: ; See servicerequest.asm
|
||||
ServiceSequenceRx: skip 8 ; Service sequence receive
|
||||
ServiceSequenceTx: skip 8 ; Service sequence transmit
|
||||
DungeonLocationsChecked: ; \ Dungeon locations checked counters (integers, word size)
|
||||
SewersLocations: skip 2 ; | Sewer Passage
|
||||
HCLocations: skip 2 ; | Hyrule Castle
|
||||
EPLocations: skip 2 ; | Eastern Palace
|
||||
DPLocations: skip 2 ; | Desert Palace
|
||||
CTLocations: skip 2 ; | Agahnim's Tower
|
||||
SPLocations: skip 2 ; | Swamp Palace
|
||||
PDLocations: skip 2 ; | Palace of Darkness
|
||||
MMLocations: skip 2 ; | Misery Mire
|
||||
SWLocations: skip 2 ; | Skull Woods
|
||||
IPLocations: skip 2 ; | Ice Palace
|
||||
THLocations: skip 2 ; | Tower of Hera
|
||||
TTLocations: skip 2 ; | Thieves' Town
|
||||
TRLocations: skip 2 ; | Turtle Rock
|
||||
GTLocations: skip 2 ; / Ganon's Tower:
|
||||
skip 4 ; Reserved for previous table
|
||||
skip 16 ; Currently occupied by multiworld stuff in DR, can be reclaimed
|
||||
DungeonCollectedKeys: ; \ Chest Key Counters. Only counts keys placed in chests. (integers)
|
||||
SewerCollectedKeys: skip 1 ; | Sewer Passage
|
||||
@@ -369,7 +363,7 @@ GTCollectedKeys: skip 1 ; / Ganon's Tower
|
||||
skip 2 ; Reserved for previous table
|
||||
FileMarker: skip 1 ; $FF = Active save file | $00 = Inactive save file
|
||||
skip 13 ; Unused
|
||||
InverseChecksum: skip 2 ; Vanilla Inverse Checksum. Don't write unless computing checksum.
|
||||
InverseChecksumWRAM: skip 2 ; Vanilla Inverse Checksum. Don't write unless computing checksum.
|
||||
|
||||
;================================================================================
|
||||
; Expanded SRAM ($7F6000 - $7F6FFF)
|
||||
@@ -377,13 +371,14 @@ InverseChecksum: skip 2 ; Vanilla Inverse Checksum. Don't write unless c
|
||||
; This $1000 byte segment is saved beginning where the second save file was in SRAM
|
||||
; beginning at $700500
|
||||
;--------------------------------------------------------------------------------
|
||||
base $7F6000 ; $1000 byte buffer we place beginning at second save file
|
||||
ExtendedFileNameWRAM: skip 24 ; File name, 12 word-length characters.
|
||||
RoomPotData: skip 592 ; Table for expanded pot shuffle. One word per room.
|
||||
SpritePotData: skip 592 ; Table for expanded pot shuffle. One word per room.
|
||||
PurchaseCounts: skip 96 ; Keeps track of shop purchases
|
||||
PrivateBlock: skip 512 ; Reserved for 3rd party developers
|
||||
DummyValue: skip 1 ; $01 if you're a real dummy
|
||||
base $7F6000 ; $1000 byte buffer we place beginning at second save file
|
||||
ExtendedSaveDataWRAM: ;
|
||||
ExtendedFileNameWRAM: skip 24 ; File name, 12 word-length characters.
|
||||
RoomPotData: skip 592 ; Table for expanded pot shuffle. One word per room.
|
||||
SpriteDropData: skip 592 ; Table for expanded drop shuffle. One word per room.
|
||||
PurchaseCounts: skip 96 ; Keeps track of shop purchases
|
||||
PrivateBlockPersistent: skip 513 ; Reserved for 3rd party developers
|
||||
skip 231
|
||||
|
||||
;================================================================================
|
||||
; Direct SRAM Assignments ($700000 - $7080000)
|
||||
@@ -398,7 +393,10 @@ RoomDataSRAM: ;
|
||||
skip $280 ;
|
||||
OverworldEventDataSRAM: ;
|
||||
skip $C0 ;
|
||||
EquipmentSRAM: skip 76 ;
|
||||
EquipmentSRAM: skip 3 ;
|
||||
BombsEquipmentSRAM: skip 31 ;
|
||||
DisplayRupeesSRAM: skip 21 ;
|
||||
CurrentArrowsSRAM: skip 21 ;
|
||||
InventoryTrackingSRAM: skip 2 ;
|
||||
BowTrackingSRAM: skip 2 ;
|
||||
skip 53 ;
|
||||
@@ -406,16 +404,19 @@ ProgressIndicatorSRAM: skip 1 ;
|
||||
skip 19 ;
|
||||
FileNameVanillaSRAM: skip 8 ; First four characters of file name
|
||||
FileValiditySRAM: skip 2 ;
|
||||
skip 285 ;
|
||||
skip 283 ;
|
||||
InverseChecksumSRAM: skip 2 ;
|
||||
ExtendedSaveDataSRAM: ;
|
||||
ExtendedFileNameSRAM: skip 24 ; We read and write the file name directly from and to SRAM (24 bytes)
|
||||
skip $1AE4 ;
|
||||
RomVersionSRAM: skip 4 ; ALTTPR ROM version. Low byte is the version, high byte writes
|
||||
; $01 for now (32-bits total)
|
||||
RomNameSRAM: skip 21 ; ROM name from $FFC0, burned in during init (21 bytes)
|
||||
; If value in the ROM doesn't match SRAM, save is cleared.
|
||||
skip 4075 ;
|
||||
PasswordSRAM: skip 16 ; Password value (16 bytes)
|
||||
|
||||
skip 8155 ;
|
||||
SaveBackupSRAM: ; Backup copy of save ram. Game will attempt to use this if
|
||||
; checksum on file select screen load fails.
|
||||
base off
|
||||
|
||||
;================================================================================
|
||||
@@ -475,8 +476,8 @@ endmacro
|
||||
%assertSRAM(CurrentHealth, $7EF36D)
|
||||
%assertSRAM(CurrentMagic, $7EF36E)
|
||||
%assertSRAM(CurrentSmallKeys, $7EF36F)
|
||||
%assertSRAM(BombCapacityUpgrades, $7EF370)
|
||||
%assertSRAM(ArrowCapacityUpgrades, $7EF371)
|
||||
%assertSRAM(BombCapacity, $7EF370)
|
||||
%assertSRAM(ArrowCapacity, $7EF371)
|
||||
%assertSRAM(HeartsFiller, $7EF372)
|
||||
%assertSRAM(MagicFiller, $7EF373)
|
||||
%assertSRAM(PendantsField, $7EF374)
|
||||
@@ -518,7 +519,7 @@ endmacro
|
||||
%assertSRAM(FollowerDropped, $7EF3D3)
|
||||
%assertSRAM(FileNameVanillaWRAM, $7EF3D9)
|
||||
%assertSRAM(FileValidity, $7EF3E1)
|
||||
%assertSRAM(InverseChecksum, $7EF4FE)
|
||||
%assertSRAM(InverseChecksumWRAM, $7EF4FE)
|
||||
|
||||
;================================================================================
|
||||
; Randomizer Assertions
|
||||
@@ -584,43 +585,29 @@ endmacro
|
||||
%assertSRAM(HighestMail, $7EF46E)
|
||||
%assertSRAM(SmallKeyCounter, $7EF46F)
|
||||
%assertSRAM(HeartPieceCounter, $7EF470)
|
||||
%assertSRAM(CrystalCounter, $7EF471)
|
||||
%assertSRAM(DungeonsCompleted, $7EF472)
|
||||
%assertSRAM(MapCountDisplay, $7EF474)
|
||||
%assertSRAM(CrystalCounter, $7EF476)
|
||||
;--------------------------------------------------------------------------------
|
||||
%assertSRAM(ServiceSequence, $7EF4A0)
|
||||
%assertSRAM(ServiceSequenceRx, $7EF4A0)
|
||||
%assertSRAM(ServiceSequenceTx, $7EF4A0)
|
||||
%assertSRAM(ServiceSequenceTx, $7EF4A8)
|
||||
;--------------------------------------------------------------------------------
|
||||
%assertSRAM(DungeonAbsorbedKeys, $7EF4B0)
|
||||
%assertSRAM(SewerAbsorbedKeys, $7EF4B0)
|
||||
%assertSRAM(HCAbsorbedKeys, $7EF4B1)
|
||||
%assertSRAM(EPAbsorbedKeys, $7EF4B2)
|
||||
%assertSRAM(DPAbsorbedKeys, $7EF4B3)
|
||||
%assertSRAM(CTAbsorbedKeys, $7EF4B4)
|
||||
%assertSRAM(SPAbsorbedKeys, $7EF4B5)
|
||||
%assertSRAM(PDAbsorbedKeys, $7EF4B6)
|
||||
%assertSRAM(MMAbsorbedKeys, $7EF4B7)
|
||||
%assertSRAM(SWAbsorbedKeys, $7EF4B8)
|
||||
%assertSRAM(IPAbsorbedKeys, $7EF4B9)
|
||||
%assertSRAM(THAbsorbedKeys, $7EF4BA)
|
||||
%assertSRAM(TTAbsorbedKeys, $7EF4BB)
|
||||
%assertSRAM(TRAbsorbedKeys, $7EF4BC)
|
||||
%assertSRAM(GTAbsorbedKeys, $7EF4BD)
|
||||
%assertSRAM(DungeonLocationsChecked, $7EF4C0)
|
||||
%assertSRAM(SewersLocations, $7EF4C0)
|
||||
%assertSRAM(HCLocations, $7EF4C1)
|
||||
%assertSRAM(EPLocations, $7EF4C2)
|
||||
%assertSRAM(DPLocations, $7EF4C3)
|
||||
%assertSRAM(CTLocations, $7EF4C4)
|
||||
%assertSRAM(SPLocations, $7EF4C5)
|
||||
%assertSRAM(PDLocations, $7EF4C6)
|
||||
%assertSRAM(MMLocations, $7EF4C7)
|
||||
%assertSRAM(SWLocations, $7EF4C8)
|
||||
%assertSRAM(IPLocations, $7EF4C9)
|
||||
%assertSRAM(THLocations, $7EF4CA)
|
||||
%assertSRAM(TTLocations, $7EF4CB)
|
||||
%assertSRAM(TRLocations, $7EF4CC)
|
||||
%assertSRAM(GTLocations, $7EF4CD)
|
||||
%assertSRAM(DungeonLocationsChecked, $7EF4B0)
|
||||
%assertSRAM(SewersLocations, $7EF4B0)
|
||||
%assertSRAM(HCLocations, $7EF4B2)
|
||||
%assertSRAM(EPLocations, $7EF4B4)
|
||||
%assertSRAM(DPLocations, $7EF4B6)
|
||||
%assertSRAM(CTLocations, $7EF4B8)
|
||||
%assertSRAM(SPLocations, $7EF4BA)
|
||||
%assertSRAM(PDLocations, $7EF4BC)
|
||||
%assertSRAM(MMLocations, $7EF4BE)
|
||||
%assertSRAM(SWLocations, $7EF4C0)
|
||||
%assertSRAM(IPLocations, $7EF4C2)
|
||||
%assertSRAM(THLocations, $7EF4C4)
|
||||
%assertSRAM(TTLocations, $7EF4C6)
|
||||
%assertSRAM(TRLocations, $7EF4C8)
|
||||
%assertSRAM(GTLocations, $7EF4CA)
|
||||
%assertSRAM(DungeonCollectedKeys, $7EF4E0)
|
||||
%assertSRAM(SewerCollectedKeys, $7EF4E0)
|
||||
%assertSRAM(HCCollectedKeys, $7EF4E1)
|
||||
@@ -638,12 +625,12 @@ endmacro
|
||||
%assertSRAM(GTCollectedKeys, $7EF4ED)
|
||||
%assertSRAM(FileMarker, $7EF4F0)
|
||||
;--------------------------------------------------------------------------------
|
||||
%assertSRAM(ExtendedSaveDataWRAM, $7F6000)
|
||||
%assertSRAM(ExtendedFileNameWRAM, $7F6000)
|
||||
%assertSRAM(RoomPotData, $7F6018)
|
||||
%assertSRAM(SpritePotData, $7F6268)
|
||||
%assertSRAM(SpriteDropData, $7F6268)
|
||||
%assertSRAM(PurchaseCounts, $7F64B8)
|
||||
%assertSRAM(PrivateBlock, $7F6518)
|
||||
%assertSRAM(DummyValue, $7F6718)
|
||||
%assertSRAM(PrivateBlockPersistent, $7F6518)
|
||||
|
||||
;================================================================================
|
||||
; Direct SRAM Assertions
|
||||
@@ -652,14 +639,20 @@ endmacro
|
||||
%assertSRAM(RoomDataSRAM, $700000)
|
||||
%assertSRAM(OverworldEventDataSRAM, $700280)
|
||||
%assertSRAM(EquipmentSRAM, $700340)
|
||||
%assertSRAM(BombsEquipmentSRAM, $700343)
|
||||
%assertSRAM(DisplayRupeesSRAM, $700362)
|
||||
%assertSRAM(CurrentArrowsSRAM, $700377)
|
||||
%assertSRAM(InventoryTrackingSRAM, $70038C)
|
||||
%assertSRAM(BowTrackingSRAM, $70038E)
|
||||
%assertSRAM(ProgressIndicatorSRAM, $7003C5)
|
||||
%assertSRAM(FileNameVanillaSRAM, $7003D9)
|
||||
%assertSRAM(FileValiditySRAM, $7003E1)
|
||||
%assertSRAM(InverseChecksumSRAM, $7004FE)
|
||||
%assertSRAM(ExtendedSaveDataSRAM, $700500)
|
||||
%assertSRAM(ExtendedFileNameSRAM, $700500)
|
||||
%assertSRAM(RomNameSRAM, $702000)
|
||||
%assertSRAM(RomVersionSRAM, $701FFC)
|
||||
%assertSRAM(PasswordSRAM, $703000)
|
||||
%assertSRAM(RomNameSRAM, $702000)
|
||||
%assertSRAM(PasswordSRAM, $702015)
|
||||
%assertSRAM(SaveBackupSRAM, $704000)
|
||||
|
||||
pullpc
|
||||
|
||||
Reference in New Issue
Block a user