mirror of
https://github.com/holub/mame
synced 2025-07-01 08:18:59 +03:00
plugins/hiscore: start delay (nw)
This commit is contained in:
parent
63979771d8
commit
f1e51d745a
@ -33,6 +33,7 @@ function hiscore.startplugin()
|
|||||||
local mem_check_passed = false;
|
local mem_check_passed = false;
|
||||||
local found_hiscore_entry = false;
|
local found_hiscore_entry = false;
|
||||||
local timed_save = true;
|
local timed_save = true;
|
||||||
|
local delaytime = 0;
|
||||||
|
|
||||||
local positions = {};
|
local positions = {};
|
||||||
-- Configuration file will be searched in the first path defined
|
-- Configuration file will be searched in the first path defined
|
||||||
@ -59,6 +60,10 @@ function hiscore.startplugin()
|
|||||||
local function parse_table ( dsting )
|
local function parse_table ( dsting )
|
||||||
local _table = {};
|
local _table = {};
|
||||||
for line in string.gmatch(dsting, '([^\n]+)') do
|
for line in string.gmatch(dsting, '([^\n]+)') do
|
||||||
|
local delay = line:match('^@delay=([%d])')
|
||||||
|
if delay and #delay > 0 then
|
||||||
|
delaytime = os.time() + tonumber(delay)
|
||||||
|
else
|
||||||
local cpu, mem;
|
local cpu, mem;
|
||||||
local cputag, space, offs, len, chk_st, chk_ed, fill = string.match(line, '^@([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),?(%x?%x?)');
|
local cputag, space, offs, len, chk_st, chk_ed, fill = string.match(line, '^@([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),?(%x?%x?)');
|
||||||
cpu = manager:machine().devices[cputag];
|
cpu = manager:machine().devices[cputag];
|
||||||
@ -83,6 +88,7 @@ function hiscore.startplugin()
|
|||||||
fill = tonumber(fill, 16)
|
fill = tonumber(fill, 16)
|
||||||
};
|
};
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return _table;
|
return _table;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -211,7 +217,7 @@ function hiscore.startplugin()
|
|||||||
|
|
||||||
local function init ()
|
local function init ()
|
||||||
if not scores_have_been_read then
|
if not scores_have_been_read then
|
||||||
if check_mem( positions ) then
|
if (delaytime <= os.time()) and check_mem( positions ) then
|
||||||
default_checksum = check_scores( positions );
|
default_checksum = check_scores( positions );
|
||||||
if read_scores( positions ) then
|
if read_scores( positions ) then
|
||||||
emu.print_verbose( "hiscore: scores read OK" );
|
emu.print_verbose( "hiscore: scores read OK" );
|
||||||
|
Loading…
Reference in New Issue
Block a user