Fix more style issues, and abstract most of the init code from MemMap.cpp.

This commit is contained in:
The Dax committed 2013-06-26 16:02:52 -04:00
1 parent 7ade9f6ceb
commit 695f7eeec5
6 files changed
+25 -27

No files matched your search

+9 -2
View File
@@ -44,6 +44,7 @@
#include "CoreParameter.h"
#include "FileSystems/MetaFileSystem.h"
#include "Loaders.h"
#include "PSPLoaders.h"
#include "ELF/ParamSFO.h"
#include "../Common/LogManager.h"
@@ -72,7 +73,14 @@ bool PSP_Init(const CoreParameter &coreParam, std::string *error_string)
coreParameter = coreParam;
currentCPU = &mipsr4k;
numCPUs = 1;
Memory::Init(coreParam.fileToStart);
std::string filename = coreParameter.fileToStart;
EmuFileType type = Identify_File(filename);
if(type == FILETYPE_PSP_ISO || type == FILETYPE_PSP_ISO_NP)
InitMemoryForGameISO(filename);
Memory::Init();
mipsr4k.Reset();
mipsr4k.pc = 0;
@@ -96,7 +104,6 @@ bool PSP_Init(const CoreParameter &coreParam, std::string *error_string)
// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly
std::string filename = coreParameter.fileToStart;
if (!LoadFile(filename, error_string) || coreState == CORE_POWERDOWN)
{
pspFileSystem.Shutdown();