Hook memory RW to Lua
This commit is contained in:
@@ -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) {}
|
||||
|
||||
Reference in New Issue
Block a user