mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-11 00:28:20 +03:00
Windows: Add "Restart" menu command
It resets all VM states and restart the game.
This commit is contained in:
+4
-10
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user