This commit is contained in:
Vadim Grigoruk 2018-08-11 09:13:18 +03:00
parent 3275257ae2
commit 6e4b33e74d
1 changed files with 16 additions and 12 deletions

View File

@ -1075,22 +1075,26 @@ static void onConsoleLoadCommandConfirmed(Console* console, const char* param)
static void load(Console* console, const char* path, const char* hash)
{
s32 size = 0;
const char* name = getCartName(path);
void* data = fsLoadFileByHash(console->fs, hash, &size);
if(data)
if(hash)
{
console->showGameMenu = true;
s32 size = 0;
const char* name = getCartName(path);
loadRom(console->tic, data, size, true);
onCartLoaded(console, name);
void* data = fsLoadFileByHash(console->fs, hash, &size);
free(data);
if(data)
{
console->showGameMenu = true;
loadRom(console->tic, data, size, true);
onCartLoaded(console, name);
free(data);
}
commandDone(console);
}
commandDone(console);
else onConsoleLoadCommandConfirmed(console, path);
}
typedef void(*ConfirmCallback)(Console* console, const char* param);