From 699fa1462a56d44b77fa3f0ddab8f65b885f4a8c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 29 Mar 2016 08:15:17 +0200 Subject: Add ability for notifiers to add at front, fix for hiscore [Carl] --- plugins/hiscore/init.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3-70-g09d2