From 5fc5dc13b255e10139a600956eb46c4dc28bd04a Mon Sep 17 00:00:00 2001 From: cassidy Date: Tue, 7 Dec 2021 15:29:30 -0500 Subject: [PATCH] Add ROM version to unused hw vector and before filename in SRAM Two 16 bit ints located at $FFE0 (0x7FE0 PC) in ROM and burned into SRAM starting at $701FFC, just before the ROM name --- LTTP_RND_GeneralBugfixes.asm | 9 +++++++++ init.asm | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 9960257..a9c3585 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -27,6 +27,15 @@ db #$00 ; expand file to 2mb org $1FFFF8 ; <- FFFF8 timestamp rom db #$20, #$19, #$08, #$31 ; year/month/day +;================================================================================ +!ROM_VERSION_LOW = 1 ; ROM version (two 16-bit integers) +!ROM_VERSION_HIGH = 1 ; + +org $00FFE0 ; Unused hardware vector +RomVersion: +dw !ROM_VERSION_LOW +dw !ROM_VERSION_HIGH + ;================================================================================ !ADD = "CLC : ADC" diff --git a/init.asm b/init.asm index 340c4a9..8fc9a65 100644 --- a/init.asm +++ b/init.asm @@ -1,3 +1,5 @@ +RomVersionSRAM = $701FFC + ;-------------------------------------------------------------------------------- ; Init_Primary ;-------------------------------------------------------------------------------- @@ -39,6 +41,11 @@ Init_Primary: LDA $00FFC0, X : STA $702000, X INX CPX #$15 : !BLT - + LDX #$00 + - + LDA RomVersion, X : STA RomVersionSRAM, X + INX + CPX #$04 : !BLT - .done REP #$20 @@ -63,4 +70,4 @@ Init_PostRAMClear: JSL MSUInit JSL InitRNGPointerTable -JML $00D463 ; The original target of the jump table that we hijacked \ No newline at end of file +JML $00D463 ; The original target of the jump table that we hijacked