From 07af59720f065bb21966d71ff5e3f7e3f7c66d8b Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Fri, 22 Nov 2024 07:40:40 -0600 Subject: [PATCH] Rewind -> warp --- data/customitems.4bpp | Bin 5120 -> 5120 bytes events.asm | 4 +-- itemdatatables.asm | 10 +++---- newitems.asm | 34 +++++++++++------------ rewind.asm | 26 +++++++++--------- sram.asm | 62 +++++++++++++++++++++--------------------- 6 files changed, 68 insertions(+), 68 deletions(-) diff --git a/data/customitems.4bpp b/data/customitems.4bpp index ec705b14d1a8515def1b7de69f84d07aca9eaedc..cbffdce0fb3f5ff91032e2284334fae26e43c431 100644 GIT binary patch delta 280 zcmW;Gy-LJD6o%n1%)ka2NeaQRJCMPwm_jh3$Y2xyuvrz$EiAnPZy>{JX}66R;01_w zR!50eR#sbXX&J;KMOZvZ`EhtTk4s(pG*N|zzBe3PB_@t~=_=r1;N_waxrk-n102R~ zINL8}9nDvM+C6g(EvTW|G;=^ei7-g?dVjQgvE6NiFj&J04gnA{@~hH5j&Htx@4F2j zlCSTW0MlFbG5uVAEiSiAtVJtHv=#zIzyfp<#QbIHPu7-NNog$+78MK7Nl^2b^PSP& uMwI9168HyXJ8eF|@4x~8*TM{> diff --git a/events.asm b/events.asm index 39aa71d..78dcfed 100644 --- a/events.asm +++ b/events.asm @@ -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 diff --git a/itemdatatables.asm b/itemdatatables.asm index fcc3e49..42c4da0 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -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 - diff --git a/newitems.asm b/newitems.asm index dc40b47..4cfa022 100644 --- a/newitems.asm +++ b/newitems.asm @@ -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 diff --git a/rewind.asm b/rewind.asm index c40aa82..29ce58a 100644 --- a/rewind.asm +++ b/rewind.asm @@ -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 diff --git a/sram.asm b/sram.asm index 8f29a3a..2b01b15 100644 --- a/sram.asm +++ b/sram.asm @@ -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