Remove some hard coded addresses for MVN instructions

This commit is contained in:
cassidoxa
2022-07-29 22:04:13 -04:00
parent d8846a4ba9
commit 95ee31f7c9
4 changed files with 28 additions and 17 deletions

View File

@@ -89,16 +89,17 @@ OnAga2Defeated:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnFileCreation: OnFileCreation:
; Copy initial SRAM state from ROM to cart SRAM ; Copy initial SRAM state from ROM to cart SRAM
; If the inital SRAM table is move these addresses must be changed
PHB PHB
LDA.w #$03D7 ; \ LDA.w #$03D7 ; \
LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name
LDY.w #$0000 ; | (exclusively) LDY.w #$0000 ; | (exclusively)
MVN $70, $30 ; / MVN SRAMBank, SRAMTableBank ; /
; Skip file name and validity value ; Skip file name and validity value
LDA.w #$010C ; \ LDA.w #$010C ; \
LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block
LDY.w #$03E3 ; | LDY.w #$03E3 ; |
MVN $70, $30 ; / MVN SRAMBank, SRAMTableBank ; /
PLB PLB
; resolve instant post-aga if standard ; resolve instant post-aga if standard

View File

@@ -15,6 +15,7 @@ fillword $0000 ; Zero out the table
fill $500 ; fill $500 ;
org $30B000 ; PC 0x183000 org $30B000 ; PC 0x183000
InitSRAMTable:
InitRoomDataWRAM: InitRoomDataWRAM:
org $30B060 ; PC 0x183060 org $30B060 ; PC 0x183060
InitATAltarRoom: dw $0000 ; aga curtains InitATAltarRoom: dw $0000 ; aga curtains

View File

@@ -15,9 +15,9 @@ WriteSaveChecksumAndBackup:
PHB PHB
LDA.w #$14FF ; \ LDA.w #$14FF ; \
LDX.w #$0000 ; | Copies $1500 bytes from beginning of cart SRAM to LDX.w #CartridgeSRAM&$FFFF ; | Copies $1500 bytes from beginning of cart SRAM to
LDY.w #$4000 ; | $704000 LDY.w #SaveBackupSRAM&$FFFF ; | $704000
MVN $70, $70 ; / MVN SRAMBank, SRAMBank ; /
PLB PLB
RTL RTL
@@ -52,9 +52,9 @@ ValidateSRAM:
BRA .goodchecksum : + BRA .goodchecksum : +
PHB PHB
LDA.w #$14FF ; \ LDA.w #$14FF ; \
LDX.w #$4000 ; | Copies $1500 bytes from backup on cart SRAM to LDX.w #SaveBackupSRAM&$FFFF ; | Copies $1500 bytes from backup on cart SRAM to
LDY.w #$0000 ; | main save location at $700000 LDY.w #CartridgeSRAM&$FFFF ; | main save location at $700000
MVN $70, $70 ; / MVN SRAMBank, SRAMBank ; /
PLB PLB
.goodchecksum .goodchecksum

View File

@@ -417,6 +417,15 @@ SaveBackupSRAM: ; Backup copy of save ram. Game will attempt to
; checksum on file select screen load fails. ; checksum on file select screen load fails.
base off base off
;================================================================================
; Bank Definitions
;--------------------------------------------------------------------------------
; If these move (most likely by placing initsramtable.asm somewhere else) these
; bank definitions need to be changed as well.
;================================================================================
SRAMBank = $70
SRAMTableBank = $30|$80
;================================================================================ ;================================================================================
; Assertions ; Assertions
;================================================================================ ;================================================================================