summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-03-29 08:15:17 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-03-29 08:15:17 +0200
commit699fa1462a56d44b77fa3f0ddab8f65b885f4a8c (patch)
tree3fa9bcc6d0b2e13dd78026e42a20a63971a89906 /plugins
parent1d84a0c3aafa46899a35fcd2945fb6a493037992 (diff)
Add ability for notifiers to add at front, fix for hiscore [Carl]
Diffstat (limited to 'plugins')
-rw-r--r--plugins/hiscore/init.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua
index 3c8e9a37dbe..63e68c0bb5d 100644
--- a/plugins/hiscore/init.lua
+++ b/plugins/hiscore/init.lua
@@ -127,7 +127,7 @@ function hiscore.startplugin()
function write_scores ( posdata )
- print("write_scores")
+ print("write_scores")
local output = io.open(get_file_name(), "wb");
if not output then
-- attempt to create the directory, and try again
@@ -242,9 +242,8 @@ function hiscore.startplugin()
current_game = ""
mem_check_passed = false
scores_have_been_read = false;
+ last_write_time = -10
print("Starting " .. emu.gamename())
- -- check if we've just soft reset
- -- reset() -- there's no way to reliably save scores after a soft reset currently
current_game = emu.romname()
dat = read_hiscore_dat()
if dat and dat ~= "" then
@@ -254,14 +253,17 @@ function hiscore.startplugin()
print("hiscore.dat parse error");
return;
end
- emu.sethook( tick, "frame" );
- emu.register_stop(function()
- reset()
- end)
- end
+ end
+ emu.sethook( tick, "frame" );
end)
+ emu.register_stop(function()
+ reset()
+ end)
+ emu.register_prestart(function()
+ reset()
+ end)
end
return exports