diff options
author | 2023-04-07 06:20:40 +1000 | |
---|---|---|
committer | 2023-04-07 06:20:40 +1000 | |
commit | b67b969bf0911d71396c77e42d85ddfe80de6f20 (patch) | |
tree | 8d964eac6e0c4c849dc2b9b0b3742154c6c943d4 /plugins/dummy/init.lua | |
parent | c4282fecede9032be78028e8fde737d44bf2b7c6 (diff) |
-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.
Diffstat (limited to 'plugins/dummy/init.lua')
-rw-r--r-- | plugins/dummy/init.lua | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/dummy/init.lua b/plugins/dummy/init.lua index 45f6d78d570..54d4f3d7fef 100644 --- a/plugins/dummy/init.lua +++ b/plugins/dummy/init.lua @@ -9,21 +9,25 @@ local exports = { local dummy = exports +local reset_subscription, stop_subscription + function dummy.startplugin() - emu.register_start(function() - emu.print_verbose("Starting " .. emu.gamename()) - end) + reset_subscription = emu.add_machine_reset_notifier( + function () + emu.print_info("Starting " .. emu.gamename()) + end) - emu.register_stop(function() - emu.print_verbose("Exiting " .. 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_verbose("index: " .. index .. " event: " .. event) + emu.print_info("index: " .. index .. " event: " .. event) return false end |