mirror of
https://github.com/parasyte/alt64
synced 2025-02-28 17:31:47 -05:00
forgot some important pipes!
This commit is contained in:
parent
a73b73c3d5
commit
d4dd1f5595
29
src/main.c
29
src/main.c
@ -1091,7 +1091,7 @@ void loadgbrom(display_context_t disp, u8 *buff)
|
|||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
UINT bytesread;
|
UINT bytesread;
|
||||||
result = f_open(&file, gb_sram_file, FA_OPEN_ALWAYS);
|
result = f_open(&file, gb_sram_file, FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
@ -1556,7 +1556,7 @@ int backupSaveData(display_context_t disp)
|
|||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
UINT bytesread;
|
UINT bytesread;
|
||||||
result = f_open(&file, config_file_path, FA_OPEN_ALWAYS);
|
result = f_open(&file, config_file_path, FA_READ | FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
@ -1573,11 +1573,17 @@ int backupSaveData(display_context_t disp)
|
|||||||
&bytesread /* [OUT] Number of bytes read */
|
&bytesread /* [OUT] Number of bytes read */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TRACEF(disp, "FAT_ReadFile returned: %i", result);
|
||||||
|
|
||||||
|
if (bytesread > 0)
|
||||||
|
{
|
||||||
//split in save type and cart-id
|
//split in save type and cart-id
|
||||||
save_format = cfg_data[0];
|
save_format = cfg_data[0];
|
||||||
int last_cic = cfg_data[1];
|
int last_cic = cfg_data[1];
|
||||||
scopy(cfg_data + 2, rom_filename); //string copy
|
scopy(cfg_data + 2, rom_filename); //string copy
|
||||||
|
|
||||||
|
TRACE(disp, "copied last played game string");
|
||||||
|
|
||||||
//set savetype to 0 disable for next boot
|
//set savetype to 0 disable for next boot
|
||||||
if (save_format != 0)
|
if (save_format != 0)
|
||||||
{
|
{
|
||||||
@ -1622,15 +1628,16 @@ int backupSaveData(display_context_t disp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else //TODO: check required! I am pretty sure it is not!
|
else
|
||||||
{
|
{
|
||||||
TRACE(disp, "No previous ROM loaded - the file 'last.crt' was not found!");
|
TRACE(disp, "No previous ROM loaded!");
|
||||||
printText("...ready", 3, -1, disp);
|
printText("...ready", 3, -1, disp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//reset with save request
|
//reset with save request
|
||||||
if (save_after_reboot)
|
if (save_after_reboot)
|
||||||
@ -1723,7 +1730,7 @@ int saveTypeToSd(display_context_t disp, char *rom_name, int stype)
|
|||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
UINT bytesread;
|
UINT bytesread;
|
||||||
result = f_open(&file, fname, FA_OPEN_ALWAYS); //Could use FA_CREATE_ALWAYS but this could lead to the posibility of the file being emptied
|
result = f_open(&file, fname, FA_WRITE | FA_OPEN_ALWAYS); //Could use FA_CREATE_ALWAYS but this could lead to the posibility of the file being emptied
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
@ -1855,11 +1862,11 @@ void initFilesystem(void)
|
|||||||
FRESULT result = f_mount(fs,"",1);
|
FRESULT result = f_mount(fs,"",1);
|
||||||
if(result != FR_OK)
|
if(result != FR_OK)
|
||||||
{
|
{
|
||||||
fat_initialized = 1;
|
//printText("mount error", 11, -1, disp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//printText("mount error", 11, -1, disp);
|
fat_initialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fatInitRam();
|
fatInitRam();
|
||||||
@ -2232,7 +2239,7 @@ void bootRom(display_context_t disp, int silent)
|
|||||||
|
|
||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
result = f_open(&file, cfg_file, FA_OPEN_ALWAYS);
|
result = f_open(&file, cfg_file, FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
@ -3121,7 +3128,7 @@ void loadFile(display_context_t disp)
|
|||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
UINT bytesread;
|
UINT bytesread;
|
||||||
result = f_open(&file, "/ED64/LASTROM.CFG", FA_OPEN_ALWAYS);
|
result = f_open(&file, "/ED64/LASTROM.CFG", FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
@ -4111,7 +4118,7 @@ void handleInput(display_context_t disp, sprite_t *contr)
|
|||||||
|
|
||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
result = f_open(&file, rom_cfg_file, FA_OPEN_ALWAYS);
|
result = f_open(&file, rom_cfg_file, FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
#include "mempak.h"
|
||||||
#include "memorypak.h"
|
#include "memorypak.h"
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -413,7 +414,7 @@ void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
|
|||||||
|
|
||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
result = f_open(&file, buff, FA_OPEN_ALWAYS);
|
result = f_open(&file, buff, FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
|
|
||||||
if (result == FR_OK)
|
if (result == FR_OK)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user