2015-06-27 04:12:35 -04:00
|
|
|
#pragma once
|
2008-01-15 20:27:44 +00:00
|
|
|
|
|
|
|
#include "Iop_Module.h"
|
2008-10-20 04:14:13 +00:00
|
|
|
#include "Iop_SifMan.h"
|
2017-03-30 21:31:34 -04:00
|
|
|
#include "zip/ZipArchiveWriter.h"
|
|
|
|
#include "zip/ZipArchiveReader.h"
|
2012-10-24 06:39:29 +00:00
|
|
|
#include <functional>
|
2008-01-15 20:27:44 +00:00
|
|
|
|
|
|
|
class CIopBios;
|
|
|
|
|
|
|
|
namespace Iop
|
|
|
|
{
|
2012-06-25 18:28:43 +00:00
|
|
|
class CLoadcore : public CModule, public CSifModule
|
|
|
|
{
|
|
|
|
public:
|
2014-07-10 23:43:29 -04:00
|
|
|
enum MODULE_ID
|
|
|
|
{
|
|
|
|
MODULE_ID = 0x80000006
|
|
|
|
};
|
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
typedef std::function<uint32(const char*, const char*)> LoadExecutableHandler;
|
2008-01-15 20:27:44 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
CLoadcore(CIopBios&, uint8*, CSifMan&);
|
|
|
|
virtual ~CLoadcore() = default;
|
2012-10-24 06:39:29 +00:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
void SetModuleVersion(unsigned int);
|
2017-03-30 21:31:34 -04:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
std::string GetId() const override;
|
|
|
|
std::string GetFunctionName(unsigned int) const override;
|
|
|
|
void Invoke(CMIPS&, unsigned int) override;
|
|
|
|
bool Invoke(uint32, uint32*, uint32, uint32*, uint32, uint8*) override;
|
2012-10-24 06:39:29 +00:00
|
|
|
|
2020-09-22 17:20:14 -04:00
|
|
|
void LoadState(Framework::CZipArchiveReader&) override;
|
|
|
|
void SaveState(Framework::CZipArchiveWriter&) const override;
|
2017-03-30 21:31:34 -04:00
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
void SetLoadExecutableHandler(const LoadExecutableHandler&);
|
2008-01-15 20:27:44 +00:00
|
|
|
|
2012-06-25 18:28:43 +00:00
|
|
|
private:
|
2019-07-29 07:41:25 -04:00
|
|
|
uint32 GetLibraryEntryTable();
|
2018-04-30 21:01:23 +01:00
|
|
|
uint32 RegisterLibraryEntries(uint32);
|
2021-01-25 20:50:57 -05:00
|
|
|
int32 ReleaseLibraryEntries(uint32);
|
2018-04-30 21:01:23 +01:00
|
|
|
uint32 QueryBootMode(uint32);
|
|
|
|
uint32 SetRebootTimeLibraryHandlingMode(uint32, uint32);
|
|
|
|
|
|
|
|
bool LoadModule(uint32*, uint32, uint32*, uint32);
|
|
|
|
void LoadExecutable(uint32*, uint32, uint32*, uint32);
|
|
|
|
void LoadModuleFromMemory(uint32*, uint32, uint32*, uint32);
|
|
|
|
bool StopModule(uint32*, uint32, uint32*, uint32);
|
|
|
|
void UnloadModule(uint32*, uint32, uint32*, uint32);
|
|
|
|
void SearchModuleByName(uint32*, uint32, uint32*, uint32);
|
|
|
|
void Initialize(uint32*, uint32, uint32*, uint32);
|
|
|
|
|
|
|
|
CIopBios& m_bios;
|
|
|
|
uint8* m_ram;
|
|
|
|
unsigned int m_moduleVersion = 1000;
|
|
|
|
|
|
|
|
LoadExecutableHandler m_loadExecutableHandler;
|
2012-06-25 18:28:43 +00:00
|
|
|
};
|
2016-01-13 22:18:10 -05:00
|
|
|
|
|
|
|
typedef std::shared_ptr<CLoadcore> LoadcorePtr;
|
2008-01-15 20:27:44 +00:00
|
|
|
}
|