mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-09 05:34:49 +12:00
Add /step http server command
This commit is contained in:
parent
ddf0ca19ee
commit
b14564bcb3
2 changed files with 80 additions and 5 deletions
include
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "helpers.hpp"
|
||||
|
||||
enum class HttpActionType { None, Screenshot, Key, TogglePause, Reset, LoadRom };
|
||||
enum class HttpActionType { None, Screenshot, Key, TogglePause, Reset, LoadRom, Step };
|
||||
|
||||
class Emulator;
|
||||
namespace httplib {
|
||||
|
@ -46,6 +46,7 @@ class HttpAction {
|
|||
static std::unique_ptr<HttpAction> createLoadRomAction(DeferredResponseWrapper& response, const std::filesystem::path& path, bool paused);
|
||||
static std::unique_ptr<HttpAction> createTogglePauseAction();
|
||||
static std::unique_ptr<HttpAction> createResetAction();
|
||||
static std::unique_ptr<HttpAction> createStepAction(DeferredResponseWrapper& response, int frames);
|
||||
};
|
||||
|
||||
struct HttpServer {
|
||||
|
@ -62,9 +63,11 @@ struct HttpServer {
|
|||
std::thread httpServerThread;
|
||||
std::queue<std::unique_ptr<HttpAction>> actionQueue;
|
||||
std::mutex actionQueueMutex;
|
||||
std::unique_ptr<HttpAction> currentStepAction {};
|
||||
|
||||
std::map<std::string, u32> keyMap;
|
||||
bool paused = false;
|
||||
int framesToRun = 0;
|
||||
|
||||
void startHttpServer();
|
||||
void pushAction(std::unique_ptr<HttpAction> action);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue