mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-20 14:01:44 +12:00
Merge pull request #140 from wheremyfoodat/pause
Add resume/pause button, some hotkeys, more HTTPanda commands
This commit is contained in:
commit
037d16ae7c
4 changed files with 66 additions and 7 deletions
|
@ -56,7 +56,8 @@ class Emulator {
|
|||
static constexpr u32 width = 400;
|
||||
static constexpr u32 height = 240 * 2; // * 2 because 2 screens
|
||||
ROMType romType = ROMType::None;
|
||||
bool running = true;
|
||||
bool running = false; // Is the emulator running a game?
|
||||
bool programRunning = false; // Is the emulator program itself running?
|
||||
|
||||
#ifdef PANDA3DS_ENABLE_HTTP_SERVER
|
||||
HttpServer httpServer;
|
||||
|
@ -86,6 +87,10 @@ class Emulator {
|
|||
void run();
|
||||
void runFrame();
|
||||
|
||||
void resume(); // Resume the emulator
|
||||
void pause(); // Pause the emulator
|
||||
void togglePause();
|
||||
|
||||
bool loadROM(const std::filesystem::path& path);
|
||||
bool loadNCSD(const std::filesystem::path& path, ROMType type);
|
||||
bool loadELF(const std::filesystem::path& path);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "helpers.hpp"
|
||||
|
||||
enum class HttpActionType { None, Screenshot, Key };
|
||||
enum class HttpActionType { None, Screenshot, Key, TogglePause, Reset };
|
||||
|
||||
class Emulator;
|
||||
namespace httplib {
|
||||
|
@ -42,6 +42,8 @@ class HttpAction {
|
|||
|
||||
static std::unique_ptr<HttpAction> createScreenshotAction(DeferredResponseWrapper& response);
|
||||
static std::unique_ptr<HttpAction> createKeyAction(uint32_t key, bool state);
|
||||
static std::unique_ptr<HttpAction> createTogglePauseAction();
|
||||
static std::unique_ptr<HttpAction> createResetAction();
|
||||
};
|
||||
|
||||
struct HttpServer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue