Add Lua scripting support to desktop emulator

- Created emulator-specific lua_game_emulator.cpp using filesystem instead of FatFS
- Created lua_game_loader_emulator.cpp to scan games/lua_examples directory
- Updated CMakeLists.txt to include Lua 5.4 engine and bindings
- Updated to SFML 3.0 API compatibility (event handling, sprite initialization)
- Updated Game class to use public members for Lua bindings
- Updated GameLauncher to use std::function for lambda captures
- Added continuous 60 FPS rendering for smooth display
- Emulator now loads and runs all three example Lua games
This commit is contained in:
Adolfo Reyna
2026-02-07 12:14:33 -05:00
parent e6e4eca188
commit 285dffc32e
10 changed files with 447 additions and 51 deletions

View File

@@ -7,21 +7,21 @@
// Minimal stub for emulator build
class InputManager {
public:
bool has_buttons() const { return false; }
bool has_touch() const { return false; }
inline bool has_buttons() const { return false; }
inline bool has_touch() const { return false; }
void get_virtual_button_regions(int* a_rect, int* b_rect) const {
inline void get_virtual_button_regions(int* a_rect, int* b_rect) const {
for (int i = 0; i < 4; i++) {
a_rect[i] = v_button_a[i];
b_rect[i] = v_button_b[i];
}
}
void set_virtual_button_regions(int ax, int ay, int aw, int ah, int bx, int by, int bw, int bh) {
inline void set_virtual_button_regions(int ax, int ay, int aw, int ah, int bx, int by, int bw, int bh) {
v_button_a[0] = ax; v_button_a[1] = ay; v_button_a[2] = aw; v_button_a[3] = ah;
v_button_b[0] = bx; v_button_b[1] = by; v_button_b[2] = bw; v_button_b[3] = bh;
v_buttons_active = true;
}
void clear_virtual_button_regions() {
inline void clear_virtual_button_regions() {
v_buttons_active = false;
for (int i = 0; i < 4; i++) {
v_button_a[i] = 0;
@@ -29,7 +29,7 @@ public:
}
}
bool check_virtual_buttons(int16_t x, int16_t y, InputType& out_type) const {
inline bool check_virtual_buttons(int16_t x, int16_t y, InputType& out_type) const {
if (!v_buttons_active) return false;
if (x >= v_button_a[0] && x <= v_button_a[0] + v_button_a[2] &&