First working version of desktop emulator with game launcher support. Includes local stubs and launcher logic.

This commit is contained in:
Adolfo Reyna
2026-01-30 23:35:43 -05:00
parent d2fd001e70
commit c1423b66aa
28 changed files with 5074 additions and 0 deletions

35
emulator/game_launcher.h Normal file
View File

@@ -0,0 +1,35 @@
// Copy of game_launcher.h for emulator build
#include <stdint.h>
#include <vector>
#include "input_event.h"
#include "game.h"
class LowLevelRenderer;
class LowLevelGUI;
class InputManager;
struct GameEntry {
const char* name;
const char* description;
Game* (*factory)(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager);
};
class GameLauncher {
public:
GameLauncher(uint16_t width, uint16_t height, LowLevelRenderer* renderer, LowLevelGUI* gui, InputManager* input_manager);
void register_game(const char* name, const char* description, Game* (*factory)(uint16_t, uint16_t, LowLevelRenderer*, LowLevelGUI*, InputManager*));
void draw();
bool update(const InputEvent& event);
Game* get_selected_game();
void reset();
bool is_game_selected() const { return selected_game != nullptr; }
private:
uint16_t width;
uint16_t height;
LowLevelRenderer* renderer;
LowLevelGUI* gui;
InputManager* input_manager;
std::vector<GameEntry> games;
int selected_index;
Game* selected_game;
static const int MENU_Y_START = 60;
static const int MENU_ITEM_HEIGHT = 40;
static const int MENU_PADDING = 10;
};