Previous 199869 Revisions Next

r25409 Tuesday 24th September, 2013 at 14:02:47 UTC by R. Belmont
web: Fix web options reading from ini, improved load/save state UI [Firehawke]
[src/emu]emuopts.c mame.c webengine.c
[web]commands.html index.html

trunk/src/emu/emuopts.c
r25408r25409
202202   { OPTION_AUTOBOOT_DELAY,                             "2",         OPTION_INTEGER,    "timer delay in sec to trigger command execution on autoboot" },
203203   { OPTION_AUTOBOOT_SCRIPT ";script",                  NULL,        OPTION_STRING,     "lua script to execute after machine boot" },
204204   { OPTION_HTTP,                                       "0",         OPTION_BOOLEAN,    "enable local http server" },
205   { OPTION_HTTP_PORT,                                  "8080",      OPTION_INTEGER,    "http server listener port" },
205   { OPTION_HTTP_PORT,                                  "8080",      OPTION_STRING,     "http server listener port" },
206206   { OPTION_HTTP_PATH,                                  "web",       OPTION_STRING,     "path to web files" },
207207   { NULL }
208208};
trunk/src/emu/webengine.c
r25408r25409
4444#include "web/mongoose.h"
4545#include "web/json/json.h"
4646
47
4748//**************************************************************************
4849//  WEB ENGINE
4950//**************************************************************************
r25408r25409
318319   return 0;
319320}
320321
321
322322void *web_engine::websocket_keepalive()
323323{
324324   while(!m_exiting_core)
trunk/src/emu/mame.c
r25408r25409
148148   bool exit_pending = false;
149149   int error = MAMERR_NONE;
150150
151       // We need to preprocess the config files once to determine the web server's configuration
152      if (options.read_config())
153      {
154         options.revert(OPTION_PRIORITY_INI);
155         astring errors;
156         options.parse_standard_inis(errors);
157      }
158
151159   web_engine web(options);
152160
153161   while (error == MAMERR_NONE && !exit_pending)
trunk/web/index.html
r25408r25409
2525  {
2626   document.getElementById('main').innerHTML = '<center><img src="/screenshot.png"/></center>';
2727  }
28 
28 
2929  function loadContent(htmlName)
3030  { 
3131   $("#main").load(htmlName+'.html', function () {
3232      $(this).trigger('create');
3333   });
3434  }
35
3536  function executeCommands(command)
3637  {
3738   $.ajax({
r25408r25409
4445   });   
4546  }
4647
48  function executeHardReset()
49  {
50    executeCommands("hardreset");
51   $('.ui-dialog').dialog('close');
52  }
53
54  function executeSoftReset()
55  {
56    executeCommands("softreset");
57   $('.ui-dialog').dialog('close');
58  }
59
60  function executeExit()
61  {
62    executeCommands("exit");
63   $('.ui-dialog').dialog('close');
64  }
65
4766  function executeSlider()
4867  {
4968   $.ajax({
trunk/web/commands.html
r25408r25409
11<a href="javascript:executeCommands('togglepause');" data-role="button">Toggle Pause</a>
2<a href="javascript:executeCommands('softreset');" data-role="button">Soft reset</a>
3<a href="javascript:executeCommands('hardreset');" data-role="button">Hard reset</a>
4<a href="javascript:loadContent('savestate');" data-transition="fade" data-role="button">Save State</a>
5<a href="javascript:loadContent('loadstate');" data-transition="fade" data-role="button">Load State</a>
6<a href="javascript:executeCommands('exit');" data-role="button">Exit</a>
2<a href="confirmsoftreset.html" data-rel="dialog" data-role="button">Soft reset</a>
3<a href="confirmhardreset.html" data-rel="dialog" data-role="button">Hard reset</a>
4<a href="#savestatepanel" data-transition="fade" data-role="button">Save State</a>
5<a href="#loadstatepanel" data-transition="fade" data-role="button">Load State</a>
6<a href="confirmexit.html" data-rel="dialog" data-role="button">Exit</a>
7
8<div data-role="panel" id="savestatepanel" data-position="left" data-display="overlay" data-theme="a">
9  <h3>Select position to save to</h3>
10
11<!-- Yes, it's a little ugly. I could redo this more cleanly with a little javascript, but not right now. -->
12  <div data-role="controlgroup" data-type="horizontal">
13    <a href="" data-rel="close" data-role="button">Cancel</a>
14    <a href="javascript:executeCommands('savestate&val=auto');" data-role="button">Autosave Slot</a>
15  </div>
16  <div data-role="controlgroup" data-type="horizontal">
17    <a href="javascript:executeCommands('savestate&val=0');" data-role="button">0</a>
18    <a href="javascript:executeCommands('savestate&val=1');" data-role="button">1</a>
19    <a href="javascript:executeCommands('savestate&val=2');" data-role="button">2</a>
20    <a href="javascript:executeCommands('savestate&val=3');" data-role="button">3</a>
21  </div>
22  <div data-role="controlgroup" data-type="horizontal">
23    <a href="javascript:executeCommands('savestate&val=4');" data-role="button">4</a>   
24   <a href="javascript:executeCommands('savestate&val=5');" data-role="button">5</a>
25    <a href="javascript:executeCommands('savestate&val=6');" data-role="button">6</a>
26    <a href="javascript:executeCommands('savestate&val=7');" data-role="button">7</a>
27  </div>
28  <div data-role="controlgroup" data-type="horizontal">
29    <a href="javascript:executeCommands('savestate&val=8');" data-role="button">8</a>
30    <a href="javascript:executeCommands('savestate&val=9');" data-role="button">9</a>
31    <a href="javascript:executeCommands('savestate&val=a');" data-role="button">A</a>
32    <a href="javascript:executeCommands('savestate&val=b');" data-role="button">B</a>
33  </div>
34  <div data-role="controlgroup" data-type="horizontal">
35    <a href="javascript:executeCommands('savestate&val=c');" data-role="button">C</a>
36    <a href="javascript:executeCommands('savestate&val=d');" data-role="button">D</a>
37    <a href="javascript:executeCommands('savestate&val=e');" data-role="button">E</a>
38    <a href="javascript:executeCommands('savestate&val=f');" data-role="button">F</a>
39  </div>
40  <div data-role="controlgroup" data-type="horizontal">
41    <a href="javascript:executeCommands('savestate&val=g');" data-role="button">G</a>
42    <a href="javascript:executeCommands('savestate&val=h');" data-role="button">H</a>
43    <a href="javascript:executeCommands('savestate&val=i');" data-role="button">I</a>
44    <a href="javascript:executeCommands('savestate&val=j');" data-role="button">J</a>
45  </div>
46  <div data-role="controlgroup" data-type="horizontal">
47    <a href="javascript:executeCommands('savestate&val=k');" data-role="button">K</a>
48    <a href="javascript:executeCommands('savestate&val=l');" data-role="button">L</a>
49    <a href="javascript:executeCommands('savestate&val=m');" data-role="button">M</a>
50    <a href="javascript:executeCommands('savestate&val=n');" data-role="button">N</a>
51  </div>
52  <div data-role="controlgroup" data-type="horizontal">
53    <a href="javascript:executeCommands('savestate&val=o');" data-role="button">O</a>
54    <a href="javascript:executeCommands('savestate&val=p');" data-role="button">P</a>
55    <a href="javascript:executeCommands('savestate&val=q');" data-role="button">Q</a>
56    <a href="javascript:executeCommands('savestate&val=r');" data-role="button">R</a>
57  </div>
58  <div data-role="controlgroup" data-type="horizontal">
59    <a href="javascript:executeCommands('savestate&val=s');" data-role="button">S</a>
60    <a href="javascript:executeCommands('savestate&val=t');" data-role="button">T</a>
61    <a href="javascript:executeCommands('savestate&val=u');" data-role="button">U</a>
62    <a href="javascript:executeCommands('savestate&val=v');" data-role="button">V</a>
63  </div>
64  <div data-role="controlgroup" data-type="horizontal">
65    <a href="javascript:executeCommands('savestate&val=w');" data-role="button">W</a>
66    <a href="javascript:executeCommands('savestate&val=x');" data-role="button">X</a>
67    <a href="javascript:executeCommands('savestate&val=y');" data-role="button">Y</a>
68    <a href="javascript:executeCommands('savestate&val=z');" data-role="button">Z</a>
69  </div>
70  <!-- This is here to prevent webkit from trying to put the last row of states under the bottom menu on small screens like phone-->
71  <br><br><br><br><br>
72</div>
73
74<div data-role="panel" id="loadstatepanel" data-position="left" data-display="overlay" data-theme="a">
75  <h3>Select position to load from</h3>
76
77<!-- Yes, it's a little ugly. I could redo this more cleanly with a little javascript, but not right now. -->
78  <div data-role="controlgroup" data-type="horizontal">
79    <a href="" data-rel="close" data-role="button">Cancel</a>
80    <a href="javascript:executeCommands('loadstate&val=auto');" data-role="button">Autoload Slot</a>
81  </div>
82  <div data-role="controlgroup" data-type="horizontal">
83    <a href="javascript:executeCommands('loadstate&val=0');" data-role="button">0</a>
84    <a href="javascript:executeCommands('loadstate&val=1');" data-role="button">1</a>
85    <a href="javascript:executeCommands('loadstate&val=2');" data-role="button">2</a>
86    <a href="javascript:executeCommands('loadstate&val=3');" data-role="button">3</a>
87  </div>
88  <div data-role="controlgroup" data-type="horizontal">
89    <a href="javascript:executeCommands('loadstate&val=4');" data-role="button">4</a>   
90   <a href="javascript:executeCommands('loadstate&val=5');" data-role="button">5</a>
91    <a href="javascript:executeCommands('loadstate&val=6');" data-role="button">6</a>
92    <a href="javascript:executeCommands('loadstate&val=7');" data-role="button">7</a>
93  </div>
94  <div data-role="controlgroup" data-type="horizontal">
95    <a href="javascript:executeCommands('loadstate&val=8');" data-role="button">8</a>
96    <a href="javascript:executeCommands('loadstate&val=9');" data-role="button">9</a>
97    <a href="javascript:executeCommands('loadstate&val=a');" data-role="button">A</a>
98    <a href="javascript:executeCommands('loadstate&val=b');" data-role="button">B</a>
99  </div>
100  <div data-role="controlgroup" data-type="horizontal">
101    <a href="javascript:executeCommands('loadstate&val=c');" data-role="button">C</a>
102    <a href="javascript:executeCommands('loadstate&val=d');" data-role="button">D</a>
103    <a href="javascript:executeCommands('loadstate&val=e');" data-role="button">E</a>
104    <a href="javascript:executeCommands('loadstate&val=f');" data-role="button">F</a>
105  </div>
106  <div data-role="controlgroup" data-type="horizontal">
107    <a href="javascript:executeCommands('loadstate&val=g');" data-role="button">G</a>
108    <a href="javascript:executeCommands('loadstate&val=h');" data-role="button">H</a>
109    <a href="javascript:executeCommands('loadstate&val=i');" data-role="button">I</a>
110    <a href="javascript:executeCommands('loadstate&val=j');" data-role="button">J</a>
111  </div>
112  <div data-role="controlgroup" data-type="horizontal">
113    <a href="javascript:executeCommands('loadstate&val=k');" data-role="button">K</a>
114    <a href="javascript:executeCommands('loadstate&val=l');" data-role="button">L</a>
115    <a href="javascript:executeCommands('loadstate&val=m');" data-role="button">M</a>
116    <a href="javascript:executeCommands('loadstate&val=n');" data-role="button">N</a>
117  </div>
118  <div data-role="controlgroup" data-type="horizontal">
119    <a href="javascript:executeCommands('loadstate&val=o');" data-role="button">O</a>
120    <a href="javascript:executeCommands('loadstate&val=p');" data-role="button">P</a>
121    <a href="javascript:executeCommands('loadstate&val=q');" data-role="button">Q</a>
122    <a href="javascript:executeCommands('loadstate&val=r');" data-role="button">R</a>
123  </div>
124  <div data-role="controlgroup" data-type="horizontal">
125    <a href="javascript:executeCommands('loadstate&val=s');" data-role="button">S</a>
126    <a href="javascript:executeCommands('loadstate&val=t');" data-role="button">T</a>
127    <a href="javascript:executeCommands('loadstate&val=u');" data-role="button">U</a>
128    <a href="javascript:executeCommands('loadstate&val=v');" data-role="button">V</a>
129  </div>
130  <div data-role="controlgroup" data-type="horizontal">
131    <a href="javascript:executeCommands('loadstate&val=w');" data-role="button">W</a>
132    <a href="javascript:executeCommands('loadstate&val=x');" data-role="button">X</a>
133    <a href="javascript:executeCommands('loadstate&val=y');" data-role="button">Y</a>
134    <a href="javascript:executeCommands('loadstate&val=z');" data-role="button">Z</a>
135  </div>
136  <!-- This is here to prevent webkit from trying to put the last row of states under the bottom menu on small screens like phone-->
137  <br><br><br><br><br>
138</div>

Previous 199869 Revisions Next


© 1997-2024 The MAME Team