From 6e06426096420f20abb4e7f173b65c2d352f70a2 Mon Sep 17 00:00:00 2001 From: "R. Belmont" Date: Tue, 24 Sep 2013 14:02:47 +0000 Subject: web: Fix web options reading from ini, improved load/save state UI [Firehawke] --- src/emu/emuopts.c | 2 +- src/emu/mame.c | 8 +++ src/emu/webengine.c | 2 +- web/commands.html | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++-- web/index.html | 21 +++++++- 5 files changed, 167 insertions(+), 8 deletions(-) diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index dd3a54af3e3..9146a36f3a5 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -202,7 +202,7 @@ const options_entry emu_options::s_option_entries[] = { OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" }, { OPTION_AUTOBOOT_SCRIPT ";script", NULL, OPTION_STRING, "lua script to execute after machine boot" }, { OPTION_HTTP, "0", OPTION_BOOLEAN, "enable local http server" }, - { OPTION_HTTP_PORT, "8080", OPTION_INTEGER, "http server listener port" }, + { OPTION_HTTP_PORT, "8080", OPTION_STRING, "http server listener port" }, { OPTION_HTTP_PATH, "web", OPTION_STRING, "path to web files" }, { NULL } }; diff --git a/src/emu/mame.c b/src/emu/mame.c index b58aa4b05a8..e66d98dbbc4 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -148,6 +148,14 @@ int mame_execute(emu_options &options, osd_interface &osd) bool exit_pending = false; int error = MAMERR_NONE; + // We need to preprocess the config files once to determine the web server's configuration + if (options.read_config()) + { + options.revert(OPTION_PRIORITY_INI); + astring errors; + options.parse_standard_inis(errors); + } + web_engine web(options); while (error == MAMERR_NONE && !exit_pending) diff --git a/src/emu/webengine.c b/src/emu/webengine.c index 3fcb71970cb..2c3ac85eea7 100644 --- a/src/emu/webengine.c +++ b/src/emu/webengine.c @@ -44,6 +44,7 @@ #include "web/mongoose.h" #include "web/json/json.h" + //************************************************************************** // WEB ENGINE //************************************************************************** @@ -318,7 +319,6 @@ int web_engine::begin_request_handler(struct mg_connection *conn) return 0; } - void *web_engine::websocket_keepalive() { while(!m_exiting_core) diff --git a/web/commands.html b/web/commands.html index 3fc3fb7822a..1923d80bd1c 100644 --- a/web/commands.html +++ b/web/commands.html @@ -1,6 +1,138 @@ Toggle Pause -Soft reset -Hard reset -Save State -Load State -Exit +Soft reset +Hard reset +Save State +Load State +Exit + +
+

Select position to save to

+ + +
+ Cancel + Autosave Slot +
+
+ 0 + 1 + 2 + 3 +
+
+ 4 + 5 + 6 + 7 +
+
+ 8 + 9 + A + B +
+
+ C + D + E + F +
+
+ G + H + I + J +
+
+ K + L + M + N +
+
+ O + P + Q + R +
+
+ S + T + U + V +
+
+ W + X + Y + Z +
+ +




+
+ +
+

Select position to load from

+ + +
+ Cancel + Autoload Slot +
+
+ 0 + 1 + 2 + 3 +
+
+ 4 + 5 + 6 + 7 +
+
+ 8 + 9 + A + B +
+
+ C + D + E + F +
+
+ G + H + I + J +
+
+ K + L + M + N +
+
+ O + P + Q + R +
+
+ S + T + U + V +
+
+ W + X + Y + Z +
+ +




+
diff --git a/web/index.html b/web/index.html index 554f13c2ecb..4591f77e16d 100644 --- a/web/index.html +++ b/web/index.html @@ -25,13 +25,14 @@ { document.getElementById('main').innerHTML = '
'; } - + function loadContent(htmlName) { $("#main").load(htmlName+'.html', function () { $(this).trigger('create'); }); } + function executeCommands(command) { $.ajax({ @@ -44,6 +45,24 @@ }); } + function executeHardReset() + { + executeCommands("hardreset"); + $('.ui-dialog').dialog('close'); + } + + function executeSoftReset() + { + executeCommands("softreset"); + $('.ui-dialog').dialog('close'); + } + + function executeExit() + { + executeCommands("exit"); + $('.ui-dialog').dialog('close'); + } + function executeSlider() { $.ajax({ -- cgit v1.2.3