Fixed eeprom saving on VC (#334)

* Fixed eeprom saving on VC

* Specify SM for EEP4K, for any other savetype use ED

* Moved IS_VC() check to an earlier point, switch IS_VC()->gIsVC

* Moved binary VC files to bin folder, added checks for EEP

* Do not keep vc_bin if EEP is not set
This commit is contained in:
Denis Kopyrin
2022-03-27 10:39:44 +08:00
committed by GitHub
parent 4b9a0b89a0
commit 4a3ef802d5
12 changed files with 128 additions and 3 deletions

View File

@@ -17,7 +17,11 @@
.ascii INTERNAL_ROM_NAME /* Internal ROM name */
.word 0x00000000 /* Unknown */
.word 0x0000004E /* Cartridge */
#if defined(EEP4K)
.ascii "SM" /* Cartridge ID */
#else
.ascii "ED" /* Cartridge ID */
#endif
/* Region */
#if defined(VERSION_JP) || defined(VERSION_SH)

23
asm/vc_bin.s Normal file
View File

@@ -0,0 +1,23 @@
// VC is using binary matching to stub functions - this hex was copied from SM64
// osEepromRead/Write are performing infinite cycle inside them which causes recompiler do go crazy
// _osEepStatus does not have any suspicious asm in it but it is just VC hacked anyways
// If it is not replaced with a VC variant, EEP probe fails
.include "macros.inc"
.section .text
#if defined(EEP)
// 0x80329150 = 0xE4150
.balign 16
glabel osEepromReadVC
.incbin "bin/vc/osEepromReadVC.bin"
// 0x80328af0 = 0xE3AF0
.balign 16
glabel osEepromWriteVC
.incbin "bin/vc/osEepromWriteVC.bin"
.balign 16
glabel __osEepStatusVC
.incbin "bin/vc/osEepStatusVC.bin"
#endif