Files
jak-project/game/mips2c/mips2c_table.h
T
water111 f9d8fcd6e4 [decomp] add mips2c converter (#842)
* mips 2 c basic version, not yet tested

* calling works without crashing, but the function doesn't

* it works

* add test

* cleanup and actually add the test

* dont use mips2c by default for font

* clean up formatting
2021-09-11 20:52:35 -04:00

29 lines
643 B
C++

#pragma once
#include <unordered_map>
#include <vector>
#include <string>
#include "game/kernel/Ptr.h"
#include "common/common_types.h"
#include "common/util/assert.h"
namespace Mips2C {
class LinkedFunctionTable {
public:
void reg(const std::string& name, u64 (*exec)(void*), u32 goal_stack_size);
u32 get(const std::string& name);
private:
struct Func {
u64 (*c_func)(void*);
Ptr<u8> goal_trampoline;
};
std::unordered_map<std::string, Func> m_executes;
};
extern std::unordered_map<std::string, std::vector<void (*)()>> gMips2CLinkCallbacks;
extern LinkedFunctionTable gLinkedFunctionTable;
} // namespace Mips2C