Browse Source

changed some naming/misc cleanups

pull/15/merge
bunnei 12 years ago
parent
commit
3bd041f5b0
  1. 6
      src/core/hle.cpp
  2. 28
      src/core/hle/hle.h
  3. 4
      src/core/hle/hle_syscall.cpp
  4. 3
      src/core/hle/hle_syscall.h

6
src/core/hle.cpp

@ -11,10 +11,10 @@
namespace HLE { namespace HLE {
static std::vector<HLEModule> g_module_db;
static std::vector<ModuleDef> g_module_db;
void RegisterModule(const char *name, int num_functions, const HLEFunction *func_table) {
HLEModule module = {name, num_functions, func_table};
void RegisterModule(std::string name, int num_functions, const FunctionDef* func_table) {
ModuleDef module = {name, num_functions, func_table};
g_module_db.push_back(module); g_module_db.push_back(module);
} }

28
src/core/hle/hle.h

@ -9,29 +9,31 @@
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
typedef void (*HLEFunc)();
#define PARAM(n) Core::g_app_core->GetReg(n)
#define RETURN(n) Core::g_app_core->SetReg(0, n)
////////////////////////////////////////////////////////////////////////////////////////////////////
namespace HLE {
struct HLEFunction {
typedef void (*Func)();
struct FunctionDef {
u32 id; u32 id;
HLEFunc func;
const char* name;
Func func;
std::string name;
}; };
struct HLEModule {
const char* name;
struct ModuleDef {
std::string name;
int num_funcs; int num_funcs;
const HLEFunction* func_table;
const FunctionDef* func_table;
}; };
#define PARAM(n) Core::g_app_core->GetReg(n)
#define RETURN(n) Core::g_app_core->SetReg(0, n)
namespace HLE {
void Init(); void Init();
void Shutdown(); void Shutdown();
void RegisterModule(const char *name, int num_functions, const HLEFunction *func_table);
void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table);
} // namespace } // namespace

4
src/core/hle/hle_syscall.cpp

@ -15,10 +15,10 @@ Result SVC_ConnectToPort(void* out, const char* port_name) {
return 0; return 0;
} }
const HLEFunction SysCallTable[] = {
const HLE::FunctionDef SysCall_Table[] = {
{0x2D, WrapI_VC<SVC_ConnectToPort>, "svcConnectToPort"}, {0x2D, WrapI_VC<SVC_ConnectToPort>, "svcConnectToPort"},
}; };
void Register_SysCall() { void Register_SysCall() {
HLE::RegisterModule("SysCallTable", ARRAY_SIZE(SysCallTable), SysCallTable);
HLE::RegisterModule("SysCallTable", ARRAY_SIZE(SysCall_Table), SysCall_Table);
} }

3
src/core/hle/hle_syscall.h

@ -34,7 +34,4 @@
// } // }
//}; //};
void Register_SysCall(); void Register_SysCall();
Loading…
Cancel
Save