mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
ARMv7Callback.h, psv modules initialization fixed
sceLibc: __cxa_atexit, __aeabi_atexit
This commit is contained in:
parent
506951a5a4
commit
509e09c2c5
14 changed files with 251 additions and 58 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "PSVFuncList.h"
|
||||
|
||||
std::vector<psv_func> g_psv_func_list;
|
||||
std::vector<psv_log_base*> g_psv_modules;
|
||||
|
||||
void add_psv_func(psv_func& data)
|
||||
{
|
||||
|
|
@ -48,33 +49,53 @@ extern psv_log_base sceLibm;
|
|||
extern psv_log_base sceLibstdcxx;
|
||||
extern psv_log_base sceLibKernel;
|
||||
|
||||
void list_known_psv_modules()
|
||||
void initialize_psv_modules()
|
||||
{
|
||||
if (!g_psv_func_list.size())
|
||||
assert(!g_psv_func_list.size() && !g_psv_modules.size());
|
||||
|
||||
// fill module list
|
||||
g_psv_modules.push_back(&sceLibc);
|
||||
g_psv_modules.push_back(&sceLibm);
|
||||
g_psv_modules.push_back(&sceLibstdcxx);
|
||||
g_psv_modules.push_back(&sceLibKernel);
|
||||
|
||||
// setup special functions (without NIDs)
|
||||
psv_func unimplemented;
|
||||
unimplemented.nid = 0;
|
||||
unimplemented.name = "Special function (unimplemented stub)";
|
||||
unimplemented.func.reset(new psv_func_detail::func_binder<void, ARMv7Context&>([](ARMv7Context& context)
|
||||
{
|
||||
// setup special functions (without NIDs)
|
||||
psv_func unimplemented;
|
||||
unimplemented.nid = 0;
|
||||
unimplemented.name = "Special function (unimplemented stub)";
|
||||
unimplemented.func.reset(new psv_func_detail::func_binder<void, ARMv7Context&>([](ARMv7Context& context)
|
||||
{
|
||||
context.thread.m_last_syscall = vm::psv::read32(context.thread.PC + 4);
|
||||
throw "Unimplemented function executed";
|
||||
}));
|
||||
g_psv_func_list.push_back(unimplemented);
|
||||
context.thread.m_last_syscall = vm::psv::read32(context.thread.PC + 4);
|
||||
throw "Unimplemented function executed";
|
||||
}));
|
||||
g_psv_func_list.push_back(unimplemented);
|
||||
|
||||
psv_func hle_return;
|
||||
hle_return.nid = 1;
|
||||
hle_return.name = "Special function (return from HLE)";
|
||||
hle_return.func.reset(new psv_func_detail::func_binder<void, ARMv7Context&>([](ARMv7Context& context)
|
||||
{
|
||||
context.thread.FastStop();
|
||||
}));
|
||||
g_psv_func_list.push_back(hle_return);
|
||||
psv_func hle_return;
|
||||
hle_return.nid = 1;
|
||||
hle_return.name = "Special function (return from HLE)";
|
||||
hle_return.func.reset(new psv_func_detail::func_binder<void, ARMv7Context&>([](ARMv7Context& context)
|
||||
{
|
||||
context.thread.FastStop();
|
||||
}));
|
||||
g_psv_func_list.push_back(hle_return);
|
||||
|
||||
sceLibc.Init();
|
||||
sceLibm.Init();
|
||||
sceLibstdcxx.Init();
|
||||
sceLibKernel.Init();
|
||||
// load functions
|
||||
for (auto module : g_psv_modules)
|
||||
{
|
||||
module->Init();
|
||||
}
|
||||
}
|
||||
|
||||
void finalize_psv_modules()
|
||||
{
|
||||
for (auto module : g_psv_modules)
|
||||
{
|
||||
if (module->on_stop)
|
||||
{
|
||||
module->on_stop();
|
||||
}
|
||||
}
|
||||
|
||||
g_psv_func_list.clear();
|
||||
g_psv_modules.clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue