Previous 199869 Revisions Next

r30912 Monday 9th June, 2014 at 14:32:44 UTC by Miodrag Milanović
few more commands just for fun (nw)
[src/emu]luaengine.c

trunk/src/emu/luaengine.c
r30911r30912
1212#include "emu.h"
1313#include "emuopts.h"
1414#include "osdepend.h"
15#include "drivenum.h"
1516#include "lua/lua.hpp"
1617#include "lua/lib/lualibs.h"
1718#include "web/mongoose.h"
r30911r30912
131132   return 1;
132133}
133134
135int emu_exit(lua_State *L)
136{
137   machine_manager::instance()->machine()->schedule_exit();
138   return 1;
139}
140
141int emu_start(lua_State *L)
142{
143   const char *system_name = luaL_checkstring(L,1);
144   
145   int index = driver_list::find(system_name);
146   if (index != -1) {
147      machine_manager::instance()->schedule_new_driver(driver_list::driver(index));   
148      machine_manager::instance()->machine()->schedule_hard_reset();
149   }
150   return 1;
151}
152
134153static const struct luaL_Reg emu_funcs [] =
135154{
136155   { "gamename", emu_gamename },
137156   { "keypost", emu_keypost },
157   { "exit", emu_exit },
158   { "start", emu_start },
138159   { NULL, NULL }  /* sentinel */
139160};
140161

Previous 199869 Revisions Next


© 1997-2024 The MAME Team