diff options
author | 2019-03-25 23:13:40 +0100 | |
---|---|---|
committer | 2019-03-25 23:13:40 +0100 | |
commit | b380514764cf857469bae61c11143a19f79a74c5 (patch) | |
tree | 63c8012e262618f08a332da31dd714281aa2c5ed /plugins/hiscore/init.lua | |
parent | c24473ddff715ecec2e258a6eb38960cf8c8e98e (diff) |
Revert "conflict resolution (nw)"
This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing
changes made to 009cba4fb8102102168ef32870892438327f3705.
Diffstat (limited to 'plugins/hiscore/init.lua')
-rw-r--r-- | plugins/hiscore/init.lua | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua index ded3f0e44d2..a89acfb33e3 100644 --- a/plugins/hiscore/init.lua +++ b/plugins/hiscore/init.lua @@ -33,7 +33,6 @@ function hiscore.startplugin() local mem_check_passed = false; local found_hiscore_entry = false; local timed_save = true; - local delaytime = 0; local positions = {}; -- Configuration file will be searched in the first path defined @@ -60,34 +59,29 @@ function hiscore.startplugin() local function parse_table ( dsting ) local _table = {}; for line in string.gmatch(dsting, '([^\n]+)') do - local delay = line:match('^@delay=([.%d]*)') - if delay and #delay > 0 then - delaytime = emu.time() + tonumber(delay) + local cpu, mem; + local cputag, space, offs, len, chk_st, chk_ed, fill = string.match(line, '^@([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),?(%x?%x?)'); + cpu = manager:machine().devices[cputag]; + if not cpu then + error(cputag .. " device not found") + end + local rgnname, rgntype = space:match("([^/]*)/?([^/]*)") + if rgntype == "share" then + mem = manager:machine():memory().shares[rgnname] else - local cpu, mem; - local cputag, space, offs, len, chk_st, chk_ed, fill = string.match(line, '^@([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),?(%x?%x?)'); - cpu = manager:machine().devices[cputag]; - if not cpu then - error(cputag .. " device not found") - end - local rgnname, rgntype = space:match("([^/]*)/?([^/]*)") - if rgntype == "share" then - mem = manager:machine():memory().shares[rgnname] - else - mem = cpu.spaces[space] - end - if not mem then - error(space .. " space not found") - end - _table[ #_table + 1 ] = { - mem = mem, - addr = tonumber(offs, 16), - size = tonumber(len, 16), - c_start = tonumber(chk_st, 16), - c_end = tonumber(chk_ed, 16), - fill = tonumber(fill, 16) - }; + mem = cpu.spaces[space] + end + if not mem then + error(space .. " space not found") end + _table[ #_table + 1 ] = { + mem = mem, + addr = tonumber(offs, 16), + size = tonumber(len, 16), + c_start = tonumber(chk_st, 16), + c_end = tonumber(chk_ed, 16), + fill = tonumber(fill, 16) + }; end return _table; end @@ -217,7 +211,7 @@ function hiscore.startplugin() local function init () if not scores_have_been_read then - if (delaytime <= emu.time()) and check_mem( positions ) then + if check_mem( positions ) then default_checksum = check_scores( positions ); if read_scores( positions ) then emu.print_verbose( "hiscore: scores read OK" ); |