diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index ef8e0fc..81e2742 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -162,6 +162,7 @@ incsrc lift.asm incsrc mothula.asm incsrc switches.asm incsrc zoom_on_carry.asm +incsrc iframes.asm warnpc $A58000 org $A28000 diff --git a/data/c2807_v4.bin b/data/c2807_v4.bin index 328b31d..2023b0b 100644 Binary files a/data/c2807_v4.bin and b/data/c2807_v4.bin differ diff --git a/data/c2807_v4.gfx b/data/c2807_v4.gfx index 82d79c9..29994a6 100644 Binary files a/data/c2807_v4.gfx and b/data/c2807_v4.gfx differ diff --git a/data/customitems.4bpp b/data/customitems.4bpp index 83e41be..8f8bfaf 100644 Binary files a/data/customitems.4bpp and b/data/customitems.4bpp differ diff --git a/events.asm b/events.asm index 78dcfed..b7fb316 100644 --- a/events.asm +++ b/events.asm @@ -123,9 +123,9 @@ OnFileCreation: MVN CartridgeSRAM>>16, InitSRAMTable>>16 PLB - ; initialize rewind table - LDA.w #$0000 - STA.l RewindTriggerSRAM + ; initialize rewind table and IFrames + LDA.w #$0014 + STA.l IFramesSRAM ; low byte i-frames, high byte rewind trigger LDA.w #$FFFF STA.l RewindRoomIdSRAM diff --git a/iframes.asm b/iframes.asm new file mode 100644 index 0000000..57ecfab --- /dev/null +++ b/iframes.asm @@ -0,0 +1,45 @@ +pushpc + +org $8780B9 +JSL CalcIFrames +NOP + +pullpc + +CalcIFrames: + LDA.l IFrames + STA.w $031F + RTL + +DrawIFrames: + LDA.l IFrames + AND.w #$00FF + JSL HexToDec + + LDY.w #$16EE + LDA.w #$253B + STA.w $0000, Y + LDA.w #$253C + STA.w $0002, Y + + LDA.l HexToDecDigit3 + AND.w #$00FF + BEQ + + CLC : ADC.w #$2416 + STA.w $003E, Y ++ + LDA.l HexToDecDigit4 + AND.w #$00FF + BNE + + LDA.w #$0011 ++ CLC : ADC.w #$2416 + STA.w $0040, Y + + LDA.l HexToDecDigit5 + AND.w #$00FF + BNE + + LDA.w #$0011 ++ CLC : ADC.w #$2416 + STA.w $0042, Y + + RTL diff --git a/itemdatatables.asm b/itemdatatables.asm index 42c4da0..b1e9a35 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -321,7 +321,7 @@ endmacro %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, $52, $F36A, $FF, teleporter, skip) ; B8 - Teleporter -%ReceiptProps($B9, -4, 0, $49, $F36A, $FF, skip, skip) ; B9 - +%ReceiptProps($B9, -4, 0, $53, $F36A, $FF, i_frames, skip) ; B9 - 10 IFrames %ReceiptProps($BA, -4, 0, $49, $F36A, $FF, skip, skip) ; BA - %ReceiptProps($BB, -4, 0, $49, $F36A, $FF, skip, skip) ; BB - %ReceiptProps($BC, -4, 0, $49, $F36A, $FF, skip, skip) ; BC - @@ -600,7 +600,7 @@ endmacro %SpriteProps($B6, 2, 2, $80, $80, PalettesCustom_crystal) ; B6 - Crystal 3 %SpriteProps($B7, 2, 2, $80, $80, $0000) ; B7 - Reserved %SpriteProps($B8, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B8 - Teleporter -%SpriteProps($B9, 2, 2, $04, $04, $0000) ; B9 - +%SpriteProps($B9, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B9 - 10 IFrames %SpriteProps($BA, 2, 2, $04, $04, $0000) ; BA - %SpriteProps($BB, 2, 2, $04, $04, $0000) ; BB - %SpriteProps($BC, 2, 2, $04, $04, $0000) ; BC - @@ -876,7 +876,7 @@ endmacro %InventoryItem($B6, $0080, $0000, $0000) ; B6 - Crystal 3 %InventoryItem($B7, $0000, $0000, $0000) ; B7 - Reserved %InventoryItem($B8, $0081, $0000, $0000) ; B8 - Teleporter -%InventoryItem($B9, $0001, $0000, $0000) ; B9 - +%InventoryItem($B9, $0081, $0000, $0000) ; B9 - 10 IFrames %InventoryItem($BA, $0001, $0000, $0000) ; BA - %InventoryItem($BB, $0001, $0000, $0000) ; BB - %InventoryItem($BC, $0001, $0000, $0000) ; BC - @@ -1140,7 +1140,7 @@ ItemReceiptGraphicsOffsets: dw BigDecompressionBuffer+$08A0 ; B6 - Crystal 3 dw $0 ; B7 - Reserved dw $0CE0 ; B8 - Teleporter - dw $0 ; B9 - + dw $0CA0 ; B9 - 10 IFrames dw $0 ; BA - dw $0 ; BB - dw $0 ; BC - @@ -1410,7 +1410,7 @@ StandingItemGraphicsOffsets: dw BigDecompressionBuffer+$08A0 ; B6 - Crystal 3 dw $0 ; B7 - Reserved dw $0CE0 ; B8 - Teleporter - dw $0 ; B9 - + dw $0CA0 ; B9 - 10 IFrames dw $0 ; BA - dw $0 ; BB - dw $0 ; BC - diff --git a/newitems.asm b/newitems.asm index 4cfa022..dc200ca 100644 --- a/newitems.asm +++ b/newitems.asm @@ -670,13 +670,18 @@ ItemBehavior: LDA.b #$01 STA.l RewindTrigger RTS - ; save + JSL.l SaveRewind SEP #$20 RTS + .i_frames + LDA.l IFrames + CLC : ADC.b #10 + STA.l IFrames + RTS + ResolveReceipt: PHA : PHX PHK : PLB diff --git a/pendantcrystalhud.asm b/pendantcrystalhud.asm index 8f36de3..b6fcba9 100644 --- a/pendantcrystalhud.asm +++ b/pendantcrystalhud.asm @@ -602,6 +602,8 @@ RestoreMenu_SetSubModule: RTL ;------------------------------------------------------------------------------- DrawHeartPiecesMenu: + JSL DrawIFrames + LDA.l HUDHeartColors_index : AND.w #$00FF ASL : TAX LDA.l HUDHeartColors_masks_game_hud,X @@ -609,7 +611,7 @@ DrawHeartPiecesMenu: LDA.l HeartPieceQuarter : AND.w #$00FF ASL #3 : TAX - LDY.w #$16F2 + LDY.w #$16F6 LDA.l HeartPieceMenuBaseTiles,X ORA.b Scrap0D diff --git a/sram.asm b/sram.asm index 2b01b15..bde76ce 100644 --- a/sram.asm +++ b/sram.asm @@ -392,6 +392,7 @@ SpritePotData: skip 592 ; Table for expanded pot shuffle. One word per PurchaseCounts: skip 96 ; Keeps track of shop purchases PrivateBlockPersistent: ; Reserved for 3rd party developers +IFrames: skip 1 RewindTrigger: skip 1 RewindRoomId: skip 2 RewindDungeonEntrance: skip 2 @@ -415,7 +416,7 @@ Rewind_A6: skip 1 Rewind_A7: skip 1 Rewind_A9: skip 1 Rewind_AA: skip 1 -skip 474 +skip 473 ;================================================================================ ; Direct SRAM Assignments ($700000 - $7080000) @@ -446,9 +447,10 @@ InverseChecksumSRAM: skip 2 ; ExtendedSaveDataSRAM: ; ExtendedFileNameSRAM: skip 24 ; We read and write the file name directly from and to SRAM (24 bytes) skip $500 +IFramesSRAM: skip 1 RewindTriggerSRAM: skip 1 RewindRoomIdSRAM: skip 2 -skip $15E1 ; +skip $15E0 ; 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)