Rewind -> warp

This commit is contained in:
2024-11-22 07:40:40 -06:00
parent 87249343ed
commit 07af59720f
6 changed files with 68 additions and 68 deletions

Binary file not shown.

View File

@@ -125,9 +125,9 @@ OnFileCreation:
; initialize rewind table
LDA.w #$0000
STA.l RewindTrigger
STA.l RewindTriggerSRAM
LDA.w #$FFFF
STA.l RewindRoomId
STA.l RewindRoomIdSRAM
; Resolve instant post-aga if standard
SEP #$20

View File

@@ -320,7 +320,7 @@ endmacro
%ReceiptProps($B5, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B5 - Crystal 4
%ReceiptProps($B6, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B6 - Crystal 3
%ReceiptProps($B7, -4, 0, $49, $F36A, $FF, skip, skip) ; B7 - Reserved
%ReceiptProps($B8, -4, 0, $49, $F36A, $FF, skip, skip) ; B8 -
%ReceiptProps($B8, -4, 0, $52, $F36A, $FF, teleporter, skip) ; B8 - Teleporter
%ReceiptProps($B9, -4, 0, $49, $F36A, $FF, skip, skip) ; B9 -
%ReceiptProps($BA, -4, 0, $49, $F36A, $FF, skip, skip) ; BA -
%ReceiptProps($BB, -4, 0, $49, $F36A, $FF, skip, skip) ; BB -
@@ -599,7 +599,7 @@ endmacro
%SpriteProps($B5, 2, 2, $80, $80, PalettesCustom_crystal) ; B5 - Crystal 4
%SpriteProps($B6, 2, 2, $80, $80, PalettesCustom_crystal) ; B6 - Crystal 3
%SpriteProps($B7, 2, 2, $80, $80, $0000) ; B7 - Reserved
%SpriteProps($B8, 2, 2, $04, $04, $0000) ; B8 -
%SpriteProps($B8, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B8 - Teleporter
%SpriteProps($B9, 2, 2, $04, $04, $0000) ; B9 -
%SpriteProps($BA, 2, 2, $04, $04, $0000) ; BA -
%SpriteProps($BB, 2, 2, $04, $04, $0000) ; BB -
@@ -875,7 +875,7 @@ endmacro
%InventoryItem($B5, $0080, $0000, $0000) ; B5 - Crystal 4
%InventoryItem($B6, $0080, $0000, $0000) ; B6 - Crystal 3
%InventoryItem($B7, $0000, $0000, $0000) ; B7 - Reserved
%InventoryItem($B8, $0001, $0000, $0000) ; B8 -
%InventoryItem($B8, $0081, $0000, $0000) ; B8 - Teleporter
%InventoryItem($B9, $0001, $0000, $0000) ; B9 -
%InventoryItem($BA, $0001, $0000, $0000) ; BA -
%InventoryItem($BB, $0001, $0000, $0000) ; BB -
@@ -1139,7 +1139,7 @@ ItemReceiptGraphicsOffsets:
dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4
dw BigDecompressionBuffer+$08A0 ; B6 - Crystal 3
dw $0 ; B7 - Reserved
dw $0 ; B8 -
dw $0CE0 ; B8 - Teleporter
dw $0 ; B9 -
dw $0 ; BA -
dw $0 ; BB -
@@ -1409,7 +1409,7 @@ StandingItemGraphicsOffsets:
dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4
dw BigDecompressionBuffer+$08A0 ; B6 - Crystal 3
dw $0 ; B7 - Reserved
dw $0 ; B8 -
dw $0CE0 ; B8 - Teleporter
dw $0 ; B9 -
dw $0 ; BA -
dw $0 ; BB -

View File

@@ -442,22 +442,6 @@ ItemBehavior:
.red_clock
REP #$20 ; set 16-bit accumulator
LDA.l RewindRoomId
CMP.w #$FFFF
BEQ +
; restore
SEP #$20
LDA.b #$01
STA.l RewindTrigger
RTS
; save
+
JSL.l SaveRewind
SEP #$20
RTS
LDA.l ChallengeTimer : !ADD.l RedClockAmount : STA.l ChallengeTimer
LDA.l ChallengeTimer+2 : ADC.l RedClockAmount+2 : STA.l ChallengeTimer+2
SEP #$20 ; set 8-bit accumulator
@@ -676,6 +660,23 @@ ItemBehavior:
.done
RTS
.teleporter
REP #$20 ; set 16-bit accumulator
LDA.l RewindRoomId
CMP.w #$FFFF
BEQ +
; restore
SEP #$20
LDA.b #$01
STA.l RewindTrigger
RTS
; save
+
JSL.l SaveRewind
SEP #$20
RTS
ResolveReceipt:
PHA : PHX
PHK : PLB
@@ -776,7 +777,6 @@ ResolveLootID:
.gloves
print ".gloves ", pc
SEP #$20
LDA.l GloveEquipment : TAX
LDA.w .gloves_ids,X

View File

@@ -185,12 +185,12 @@ LoadRewind:
LDA.w #$FFFF
STA.l RewindRoomId
PHB
LDX.w #RewindSRAM
LDY.w #SaveDataWRAM
LDA.w #$4FF
MVN SaveDataWRAM>>16, RewindSRAM>>16
PLB
; PHB
; LDX.w #RewindSRAM
; LDY.w #SaveDataWRAM
; LDA.w #$4FF
; MVN SaveDataWRAM>>16, RewindSRAM>>16
; PLB
PLP
RTS
@@ -287,12 +287,12 @@ SaveRewind:
LDA.b $AA
STA.l Rewind_AA
PHB
REP #$30
LDX #SaveDataWRAM
LDY #RewindSRAM
LDA #$4FF
MVN RewindSRAM>>16, SaveDataWRAM>>16
PLB
; PHB
; REP #$30
; LDX #SaveDataWRAM
; LDY #RewindSRAM
; LDA #$4FF
; MVN RewindSRAM>>16, SaveDataWRAM>>16
; PLB
PLP
RTL

View File

@@ -390,7 +390,32 @@ 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
PrivateBlockPersistent: skip 513 ; Reserved for 3rd party developers
PrivateBlockPersistent: ; Reserved for 3rd party developers
RewindTrigger: skip 1
RewindRoomId: skip 2
RewindDungeonEntrance: skip 2
RewindVerticalScroll: skip 2
RewindHorizontalScroll: skip 2
RewindYCoordinate: skip 2
RewindXCoordinate: skip 2
RewindCameraTriggerY: skip 2
RewindCameraTriggerX: skip 2
RewindOverworldDoorTilemap: skip 2
RewindCameraScrollBoundaries: skip 8
RewindLinkFacing: skip 1
RewindMainGFX: skip 1
RewindSong: skip 1
RewindFloor: skip 1
RewindDungeonId: skip 1
Rewind_6C: skip 1
Rewind_EE: skip 1
Rewind_0476: skip 1
Rewind_A6: skip 1
Rewind_A7: skip 1
Rewind_A9: skip 1
Rewind_AA: skip 1
skip 474
;================================================================================
; Direct SRAM Assignments ($700000 - $7080000)
@@ -420,41 +445,16 @@ 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 ;
skip $500
RewindTriggerSRAM: skip 1
RewindRoomIdSRAM: skip 2
skip $15E1 ;
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.
PasswordSRAM: skip 16 ; Password value (16 bytes)
RewindTrigger: skip 1
RewindDungeonEntrance: skip 2
RewindRoomId: skip 2
RewindVerticalScroll: skip 2
RewindHorizontalScroll: skip 2
RewindYCoordinate: skip 2
RewindXCoordinate: skip 2
RewindCameraTriggerY: skip 2
RewindCameraTriggerX: skip 2
RewindOverworldDoorTilemap: skip 2
RewindCameraScrollBoundaries: skip 8
RewindLinkFacing: skip 1
RewindMainGFX: skip 1
RewindSong: skip 1
RewindFloor: skip 1
RewindDungeonId: skip 1
Rewind_6C: skip 1
Rewind_EE: skip 1
Rewind_0476: skip 1
Rewind_A6: skip 1
Rewind_A7: skip 1
Rewind_A9: skip 1
Rewind_AA: skip 1
skip $B4
RewindSRAM: skip $1500
skip $A00 ;
skip 8155 ;
SaveBackupSRAM: ; Backup copy of save ram. Game will attempt to use this if
; checksum on file select screen load fails.
base off