We can now load lua scripts properly
This commit is contained in:
@@ -119,6 +119,8 @@ class Emulator {
|
||||
EmulatorConfig& getConfig() { return config; }
|
||||
Cheats& getCheats() { return cheats; }
|
||||
ServiceManager& getServiceManager() { return kernel.getServiceManager(); }
|
||||
LuaManager& getLua() { return lua; }
|
||||
|
||||
RendererType getRendererType() const { return config.rendererType; }
|
||||
Renderer* getRenderer() { return gpu.getRenderer(); }
|
||||
u64 getTicks() { return cpu.getTicks(); }
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
#include "helpers.hpp"
|
||||
#include "memory.hpp"
|
||||
|
||||
@@ -36,6 +38,8 @@ class LuaManager {
|
||||
void initialize();
|
||||
void initializeThunks();
|
||||
void loadFile(const char* path);
|
||||
void loadString(const std::string& code);
|
||||
|
||||
void reset();
|
||||
void signalEvent(LuaEvent e) {
|
||||
if (haveScript) [[unlikely]] {
|
||||
@@ -52,6 +56,7 @@ class LuaManager {
|
||||
void close() {}
|
||||
void initialize() {}
|
||||
void loadFile(const char* path) {}
|
||||
void loadString(const std::string& code) {}
|
||||
void reset() {}
|
||||
void signalEvent(LuaEvent e) {}
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ class MainWindow : public QMainWindow {
|
||||
|
||||
private:
|
||||
// Types of messages we might send from the GUI thread to the emulator thread
|
||||
enum class MessageType { LoadROM, Reset, Pause, Resume, TogglePause, DumpRomFS, PressKey, ReleaseKey };
|
||||
enum class MessageType { LoadROM, Reset, Pause, Resume, TogglePause, DumpRomFS, PressKey, ReleaseKey, LoadLuaScript };
|
||||
|
||||
// Tagged union representing our message queue messages
|
||||
struct EmulatorMessage {
|
||||
@@ -35,6 +35,10 @@ class MainWindow : public QMainWindow {
|
||||
struct {
|
||||
u32 key;
|
||||
} key;
|
||||
|
||||
struct {
|
||||
std::string* str;
|
||||
} string;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -72,4 +76,5 @@ class MainWindow : public QMainWindow {
|
||||
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
void loadLuaScript(const std::string& code);
|
||||
};
|
||||
Reference in New Issue
Block a user