mame/plugins/dummy/init.lua
Vas Crabb b67b969bf0 -Improved some Lua APIs:
* Moved several machine lifecycle callbacks to the notifier/subscriber
  model.  The old callback registration model is still available for
  them for now, but prints a deprecation warning.
* Added pre-save/post-load notifications.
* Use a single allocated timer rather than one anonymous timer per
  waiter.  Waiters no longer prevent saved states from being loaded.
* Clean up outstanding waiters on stop or state load rather than just
  leaking them.
* Started documenting parts of the emulator interface object that should
  be relatively stable.

-imagedev/avivideo.cpp: Fixed an object leak on unload.  Also changed
 some other media image devices to use smart pointers.
2023-04-07 06:20:40 +10:00

37 lines
881 B
Lua

-- license:BSD-3-Clause
-- copyright-holders:Miodrag Milanovic
local exports = {
name = "dummy",
version = "0.0.1",
description = "A dummy example",
license = "BSD-3-Clause",
author = { name = "Miodrag Milanovic" }}
local dummy = exports
local reset_subscription, stop_subscription
function dummy.startplugin()
reset_subscription = emu.add_machine_reset_notifier(
function ()
emu.print_info("Starting " .. emu.gamename())
end)
stop_subscription = emu.add_machine_stop_notifier(
function ()
emu.print_info("Exiting " .. emu.gamename())
end)
local function menu_populate()
return {{ "This is a", "test", "off" }, { "Also a", "test", "" }}
end
local function menu_callback(index, event)
emu.print_info("index: " .. index .. " event: " .. event)
return false
end
emu.register_menu(menu_callback, menu_populate, "Dummy")
end
return exports