This commit is contained in:
Rosalie Wanders committed 2020-11-04 14:38:44 +01:00
1 parent f8a0839f67
commit 48af07578c
2 files changed
+28 -3

No files matched your search

+27 -3
View File
@@ -236,12 +236,36 @@ bool Core::SetPlugin(Plugin_t plugin)
return true;
}
bool Core::GetRomInfo(RomInfo_t *info)
{
m64p_error ret;
ret = M64P::Core.DoCommand(M64CMD_ROM_GET_HEADER, sizeof(m64p_rom_header), &info->Header);
if (ret != M64ERR_SUCCESS)
{
this->rom_Close();
this->error_Message = "Core::GetRomInfo: M64P::Core.DoCommand(M64CMD_ROM_GET_HEADER) Failed: ";
this->error_Message += M64P::Core.ErrorMessage(ret);
return false;
}
ret = M64P::Core.DoCommand(M64CMD_ROM_GET_SETTINGS, sizeof(m64p_rom_settings), &info->Settings);
if (ret != M64ERR_SUCCESS)
{
this->rom_Close();
this->error_Message = "Core::GetRomInfo: M64P::Core.DoCommand(M64CMD_ROM_GET_SETTINGS) Failed: ";
this->error_Message += M64P::Core.ErrorMessage(ret);
return false;
}
return true;
}
bool Core::GetRomInfo(QString file, RomInfo_t *info)
{
m64p_error ret;
bool inEmulation = this->emulation_IsRunning() || this->emulation_IsPaused();
if (!inEmulation && !this->rom_Open(file))
if (!this->rom_Open(file))
return false;
ret = M64P::Core.DoCommand(M64CMD_ROM_GET_HEADER, sizeof(m64p_rom_header), &info->Header);
@@ -264,7 +288,7 @@ bool Core::GetRomInfo(QString file, RomInfo_t *info)
info->FileName = file;
if (!inEmulation && !this->rom_Close())
if (!this->rom_Close())
return false;
return true;
+1
View File
@@ -35,6 +35,7 @@ namespace M64P
bool SetPlugin(Plugin_t);
bool GetRomInfo(QString, RomInfo_t*);
bool GetRomInfo(RomInfo_t*);
bool LaunchEmulation(QString);
bool StopEmulation(void);