summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Javier Asenjo Nitti <alejandro.asenjo88@gmail.com>2023-11-06 02:27:07 -0300
committerAlejandro Javier Asenjo Nitti <alejandro.asenjo88@gmail.com>2023-11-06 02:27:07 -0300
commit55a2507e192de103dbaafa51cd855b7507b61d36 (patch)
treed7dd3a00027bb04a6d28eb52aa75fa3b29d47f1d
parent975e72dc240e4d357c6bfb7ddcc47dd439e54cd9 (diff)
Sram_CopySave matching
-rw-r--r--src/code/z_sram_NES.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c
index 83e271edc..696d79823 100644
--- a/src/code/z_sram_NES.c
+++ b/src/code/z_sram_NES.c
@@ -1694,8 +1694,6 @@ void Sram_EraseSave(FileSelectState* fileSelect2, SramContext* sramCtx, s32 file
gSaveContext.flashSaveAvailable = D_801F6AF2;
}
-#ifdef NON_MATCHING
-// v0/v1
void Sram_CopySave(FileSelectState* fileSelect2, SramContext* sramCtx) {
FileSelectState* fileSelect = fileSelect2;
u16 i;
@@ -1737,13 +1735,11 @@ void Sram_CopySave(FileSelectState* fileSelect2, SramContext* sramCtx) {
// clear buffer
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
// read to buffer
- SysFlashrom_ReadData(&sramCtx->saveBuf[0], gFlashSaveStartPages[fileSelect->selectedFileIndex * 2],
- gFlashSaveNumPages[fileSelect->selectedFileIndex * 2]);
- if (1) {}
+ if (SysFlashrom_ReadData(&sramCtx->saveBuf[0], gFlashSaveStartPages[fileSelect->selectedFileIndex * 2],
+ gFlashSaveNumPages[fileSelect->selectedFileIndex * 2])) {}
- SysFlashrom_ReadData(&sramCtx->saveBuf[0x2000], gFlashSaveStartPages[fileSelect->selectedFileIndex * 2 + 1],
- gFlashSaveNumPages[fileSelect->selectedFileIndex * 2 + 1]);
- if (1) {}
+ if (SysFlashrom_ReadData(&sramCtx->saveBuf[0x2000], gFlashSaveStartPages[fileSelect->selectedFileIndex * 2 + 1],
+ gFlashSaveNumPages[fileSelect->selectedFileIndex * 2 + 1])) {}
// copy buffer to save context
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
@@ -1780,9 +1776,6 @@ void Sram_CopySave(FileSelectState* fileSelect2, SramContext* sramCtx) {
gSaveContext.save.time = D_801F6AF0;
gSaveContext.flashSaveAvailable = D_801F6AF2;
}
-#else
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram_NES/Sram_CopySave.s")
-#endif
void Sram_InitSave(FileSelectState* fileSelect2, SramContext* sramCtx) {
s32 phi_v0;