cmd cart open fix
This commit is contained in:
parent
8f4dae83a4
commit
f136ea4c73
|
@ -507,13 +507,13 @@ static void onCartLoaded(Console* console, const char* name)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(TIC80_PRO)
|
|
||||||
|
|
||||||
static bool hasExt(const char* name, const char* ext)
|
static bool hasExt(const char* name, const char* ext)
|
||||||
{
|
{
|
||||||
return strcmp(name + strlen(name) - strlen(ext), ext) == 0;
|
return strcmp(name + strlen(name) - strlen(ext), ext) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(TIC80_PRO)
|
||||||
|
|
||||||
static bool hasProjectExt(const char* name)
|
static bool hasProjectExt(const char* name)
|
||||||
{
|
{
|
||||||
return hasExt(name, PROJECT_LUA_EXT) || hasExt(name, PROJECT_MOON_EXT) || hasExt(name, PROJECT_JS_EXT);
|
return hasExt(name, PROJECT_LUA_EXT) || hasExt(name, PROJECT_MOON_EXT) || hasExt(name, PROJECT_JS_EXT);
|
||||||
|
@ -2627,15 +2627,19 @@ static void cmdLoadCart(Console* console, const char* name)
|
||||||
if(hasProjectExt(name))
|
if(hasProjectExt(name))
|
||||||
{
|
{
|
||||||
loadProject(console, name, data, size, &embed.file);
|
loadProject(console, name, data, size, &embed.file);
|
||||||
|
strcpy(console->romName, fsFilename(name));
|
||||||
|
embed.yes = true;
|
||||||
embed.fast = true;
|
embed.fast = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
loadCart(console->tic, &embed.file, data, size, true);
|
|
||||||
|
|
||||||
strcpy(console->romName, fsFilename(name));
|
if(hasExt(name, CART_EXT))
|
||||||
|
{
|
||||||
embed.yes = true;
|
loadCart(console->tic, &embed.file, data, size, true);
|
||||||
|
strcpy(console->romName, fsFilename(name));
|
||||||
|
embed.yes = true;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_free(data);
|
SDL_free(data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue