mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
Merge pull request #70 from lucab/lucab/mame-lua/appinfo
luaengine: add API versioning [Luca Bruno]
This commit is contained in:
commit
10054246cf
@ -196,6 +196,27 @@ int lua_engine::l_ioport_write(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// emu_app_name - return application name
|
||||
//-------------------------------------------------
|
||||
|
||||
int lua_engine::l_emu_app_name(lua_State *L)
|
||||
{
|
||||
lua_pushstring(L, emulator_info::get_appname_lower());
|
||||
return 1;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// emu_app_version - return application version
|
||||
//-------------------------------------------------
|
||||
|
||||
int lua_engine::l_emu_app_version(lua_State *L)
|
||||
{
|
||||
lua_pushstring(L, bare_build_version);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// emu_gamename - returns game full name
|
||||
//-------------------------------------------------
|
||||
@ -521,6 +542,8 @@ void lua_engine::initialize()
|
||||
{
|
||||
luabridge::getGlobalNamespace (m_lua_state)
|
||||
.beginNamespace ("emu")
|
||||
.addCFunction ("app_name", l_emu_app_name )
|
||||
.addCFunction ("app_version", l_emu_app_version )
|
||||
.addCFunction ("gamename", l_emu_gamename )
|
||||
.addCFunction ("romname", l_emu_romname )
|
||||
.addCFunction ("keypost", l_emu_keypost )
|
||||
@ -549,6 +572,7 @@ void lua_engine::initialize()
|
||||
.addData ("manufacturer", &game_driver::manufacturer)
|
||||
.endClass ()
|
||||
.endNamespace ();
|
||||
|
||||
luabridge::push (m_lua_state, machine_manager::instance());
|
||||
lua_setglobal(m_lua_state, "manager");
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ private:
|
||||
|
||||
static int l_ioport_write(lua_State *L);
|
||||
static int l_emu_after(lua_State *L);
|
||||
static int l_emu_app_name(lua_State *L);
|
||||
static int l_emu_app_version(lua_State *L);
|
||||
static int l_emu_wait(lua_State *L);
|
||||
static int l_emu_time(lua_State *L);
|
||||
static int l_emu_gamename(lua_State *L);
|
||||
|
@ -120,7 +120,7 @@ private:
|
||||
//**************************************************************************
|
||||
|
||||
extern const char build_version[];
|
||||
|
||||
extern const char bare_build_version[];
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -8,5 +8,9 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#define BARE_BUILD_VERSION "0.156"
|
||||
|
||||
extern const char bare_build_version[];
|
||||
extern const char build_version[];
|
||||
const char build_version[] = "0.156 (" __DATE__")";
|
||||
const char bare_build_version[] = BARE_BUILD_VERSION;
|
||||
const char build_version[] = BARE_BUILD_VERSION " (" __DATE__")";
|
||||
|
Loading…
Reference in New Issue
Block a user