rpcsx/rpcs3/Emu/ARMv7/PSVFuncList.cpp

52 lines
848 B
C++
Raw Normal View History

#include "stdafx.h"
#include "PSVFuncList.h"
std::vector<psv_func> g_psv_func_list;
void add_psv_func(psv_func& data)
{
g_psv_func_list.push_back(data);
}
psv_func* get_psv_func_by_nid(u32 nid)
{
for (auto& f : g_psv_func_list)
{
if (f.nid == nid)
{
return &f;
}
}
return nullptr;
}
u32 get_psv_func_index(psv_func* func)
{
2014-11-02 04:18:02 +03:00
auto res = func - g_psv_func_list.data();
2014-11-02 04:18:02 +03:00
assert((size_t)res < g_psv_func_list.size());
2014-11-02 04:18:02 +03:00
return (u32)res;
}
void execute_psv_func_by_index(ARMv7Thread& CPU, u32 index)
{
assert(index < g_psv_func_list.size());
(*g_psv_func_list[index].func)(CPU);
}
2014-11-02 03:28:53 +03:00
extern psv_log_base& sceLibc;
2014-11-05 19:07:34 +03:00
extern psv_log_base& sceLibm;
2014-11-04 03:51:26 +03:00
extern psv_log_base& sceLibstdcxx;
2014-11-05 19:07:34 +03:00
extern psv_log_base& sceLibKernel;
void list_known_psv_modules()
{
sceLibc.Log("");
2014-11-05 19:07:34 +03:00
sceLibm.Log("");
2014-11-04 03:51:26 +03:00
sceLibstdcxx.Log("");
2014-11-05 19:07:34 +03:00
sceLibKernel.Log("");
}