mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Hook memory RW to Lua
This commit is contained in:
parent
b908f3efc1
commit
74026d2faa
3 changed files with 52 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
#include "memory.hpp"
|
||||
|
||||
#ifdef PANDA3DS_ENABLE_LUA
|
||||
extern "C" {
|
||||
|
@ -15,8 +16,15 @@ class LuaManager {
|
|||
bool initialized = false;
|
||||
|
||||
public:
|
||||
// For Lua we must have some global pointers to our emulator objects to use them in script code via thunks. See the thunks in lua.cpp as an
|
||||
// example
|
||||
static Memory* g_memory;
|
||||
|
||||
LuaManager(Memory& mem) { g_memory = &mem; }
|
||||
|
||||
void close();
|
||||
void initialize();
|
||||
void initializeThunks();
|
||||
void loadFile(const char* path);
|
||||
void reset();
|
||||
};
|
||||
|
@ -24,6 +32,8 @@ class LuaManager {
|
|||
#elif // Lua not enabled, Lua manager does nothing
|
||||
class LuaManager {
|
||||
public:
|
||||
LuaManager(Memory& mem) {}
|
||||
|
||||
void close() {}
|
||||
void initialize() {}
|
||||
void loadFile(const char* path) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue