well, GX FIFO base. noting that for now, it doesn't do much beyond getting full real quick.

also make ROM loading fail gracefully if it shits itself, instead of entering an endless loop.
This commit is contained in:
StapleButter
2017-02-07 23:31:21 +01:00
parent 2b7fac05c7
commit 971e7b7e89
7 changed files with 218 additions and 20 deletions

View File

@ -601,12 +601,17 @@ void Reset()
}
void LoadROM(char* path)
bool LoadROM(char* path)
{
// TODO: streaming mode? for really big ROMs or systems with limited RAM
// for now we're lazy
FILE* f = fopen(path, "rb");
if (!f)
{
printf("Failed to open ROM file %s\n", path);
return false;
}
fseek(f, 0, SEEK_END);
u32 len = (u32)ftell(f);
@ -674,6 +679,8 @@ void LoadROM(char* path)
strncpy(savepath + strlen(path) - 3, "sav", 3);
printf("Save file: %s\n", savepath);
NDSCart_SRAM::LoadSave(savepath);
return true;
}
void ReadROM(u32 addr, u32 len, u32 offset)