summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/timecode
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-11-06 05:20:59 +1100
committer Vas Crabb <vas@vastheman.com>2021-11-06 05:20:59 +1100
commit07e55935cf49c94a94dcc75d8240d0733d1ed5d7 (patch)
treefa60ebf78fee04fd57d9c8b8665f02729ef48a43 /plugins/timecode
parent3bb8e3adc7dbd6a9e57771047011efc3c54378ac (diff)
plugins: Rewrote timer plugin fixing multiple issues.
Added emulated time recording as well as wall clock time. Fixed recording time for multiple software items per system. An incorrect constraint on the database table meant that time was only being recorded for a single software item per system. Detect the "empty" driver so the time spent at the selection menu isn't recorded (you'd get multiple entries for this due to the way options leak when returning to the system selection menu). Included schema migration code to update existing timer plugin databases. Also replaced some unnecessary floating point code with integer maths, added log messages, and made the plugin unload unload its database access code during emulation. Changed other plugins' use of paths with trailing slashes as this causes stat to fail on Windows.
Diffstat (limited to 'plugins/timecode')
-rw-r--r--plugins/timecode/init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/timecode/init.lua b/plugins/timecode/init.lua
index 084d3b3e8d6..09e49229cae 100644
--- a/plugins/timecode/init.lua
+++ b/plugins/timecode/init.lua
@@ -34,7 +34,7 @@ function timecode.startplugin()
local function get_settings_path()
- return emu.subst_env(manager.machine.options.entries.homepath:value():match('([^;]+)')) .. '/timecode/'
+ return emu.subst_env(manager.machine.options.entries.homepath:value():match('([^;]+)')) .. '/timecode'
end
@@ -50,7 +50,7 @@ function timecode.startplugin()
set_default_hotkey()
-- try to open configuration file
- local cfgname = get_settings_path() .. 'plugin.cfg'
+ local cfgname = get_settings_path() .. '/plugin.cfg'
local cfgfile = io.open(cfgname, 'r')
if not cfgfile then
return -- probably harmless, configuration just doesn't exist yet
@@ -97,7 +97,7 @@ function timecode.startplugin()
settings.hotkey = hotkey_cfg
end
local data = json.stringify(settings, { indent = true })
- local cfgname = path .. 'plugin.cfg'
+ local cfgname = path .. '/plugin.cfg'
local cfgfile = io.open(cfgname, 'w')
if not cfgfile then
emu.print_error(string.format('Error saving timecode recorder settings: error opening file "%s" for writing', cfgname))