Windows: Add "Restart" menu command

It resets all VM states and restart the game.
This commit is contained in:
kichikuou
2022-06-26 17:25:39 +09:00
parent 26db7f46f5
commit b15690d9b7
28 changed files with 252 additions and 84 deletions
+4 -10
View File
@@ -82,14 +82,10 @@ static void emit_initialized_event(void) {
send_json(event);
}
static void emit_terminated_event(bool restart) {
cJSON *event = cJSON_CreateObject(), *body;
static void emit_terminated_event(void) {
cJSON *event = cJSON_CreateObject();
cJSON_AddStringToObject(event, "type", "event");
cJSON_AddStringToObject(event, "event", "terminated");
if (restart) {
cJSON_AddItemToObjectCS(event, "body", body = cJSON_CreateObject());
cJSON_AddBoolToObject(body, "restart", true);
}
send_json(event);
}
@@ -590,10 +586,8 @@ static void dbg_dap_init(const char *path) {
}
}
static void dbg_dap_quit(bool restart) {
emit_terminated_event(restart);
if (restart)
exit(0); // The front end will restart xsystem35, so we can just exit.
static void dbg_dap_quit(void) {
emit_terminated_event();
}
static void dbg_dap_repl(int bp_no) {