Add an interface to load files with.

This allows loading from other than raw files.
This commit is contained in:
Unknown W. Brackets committed 2014-11-23 13:25:32 -08:00
1 parent a0461f1dcd
commit 102b7b03fa
6 files changed
+190 -57

No files matched your search

+8 -3
View File
@@ -72,6 +72,7 @@ MetaFileSystem pspFileSystem;
ParamSFOData g_paramSFO;
static GlobalUIState globalUIState;
static CoreParameter coreParameter;
static FileLoader *loadedFile;
static PSPMixer *mixer;
static std::thread *cpuThread = NULL;
static std::thread::id cpuThreadID;
@@ -181,7 +182,8 @@ void CPU_Init() {
Memory::g_PSPModel = g_Config.iPSPModel;
std::string filename = coreParameter.fileToStart;
IdentifiedFileType type = Identify_File(filename);
loadedFile = new LocalFileLoader(filename);
IdentifiedFileType type = Identify_File(loadedFile);
MIPSAnalyst::Reset();
Replacement_Init();
@@ -190,7 +192,7 @@ void CPU_Init() {
case FILETYPE_PSP_ISO:
case FILETYPE_PSP_ISO_NP:
case FILETYPE_PSP_DISC_DIRECTORY:
InitMemoryForGameISO(filename);
InitMemoryForGameISO(loadedFile);
break;
default:
break;
@@ -213,7 +215,7 @@ void CPU_Init() {
// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly
// Why did we check for CORE_POWERDOWN here?
if (!LoadFile(filename, &coreParameter.errorString)) {
if (!LoadFile(loadedFile, &coreParameter.errorString)) {
CPU_Shutdown();
coreParameter.fileToStart = "";
CPU_SetState(CPU_THREAD_NOT_RUNNING);
@@ -245,6 +247,9 @@ void CPU_Shutdown() {
pspFileSystem.Shutdown();
mipsr4k.Shutdown();
Memory::Shutdown();
delete loadedFile;
loadedFile = 0;
}
void CPU_RunLoop() {