match Sram_CopySave (#1467)

This commit is contained in:
engineer124 2023-11-07 07:58:28 +11:00 committed by GitHub
parent ddb63dcec2
commit 864748c6f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;