mirror of
https://github.com/open-goal/jak-project
synced 2026-08-16 13:17:34 -04:00
f9d8fcd6e4
* 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
29 lines
643 B
C++
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
|