diff options
author | 2016-03-27 19:50:02 -0500 | |
---|---|---|
committer | 2016-03-27 19:52:35 -0500 | |
commit | 1e95b3b4591c389a2ce72b9903a34366a1e0a9a3 (patch) | |
tree | 9e46c8a8453ced08bf758ae9f1e926616d7154ed /plugins | |
parent | e424f4305d0987125575cb72d882b5d7a883faec (diff) |
luaengine: add software name getter (nw)
hiscore: add support for softlist rom hiscores (nw)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/hiscore/hiscore.dat | 6 | ||||
-rw-r--r-- | plugins/hiscore/init.lua | 21 |
2 files changed, 20 insertions, 7 deletions
diff --git a/plugins/hiscore/hiscore.dat b/plugins/hiscore/hiscore.dat index 00a4d5fb36b..17bd85d3dfd 100644 --- a/plugins/hiscore/hiscore.dat +++ b/plugins/hiscore/hiscore.dat @@ -9,6 +9,9 @@ ;This file can be edited with a text editor, but keep the same format: ; all fields are separated by a comma (,) ; <gamename>: +; or +; <gamename>,<softwarename>: +; for machines with softlists ; @<cputag>,<addressspace>,<address>,<length>,<value to wait for ; in the first byte/word>,<value to wait for in the last byte/word> ; [repeat the above as many times as necessary] @@ -13965,3 +13968,6 @@ zodiack: @:maincpu,program,b35f,1,08,08 @:maincpu,program,b37f,1,00,00 @:maincpu,program,b39f,1,00,00 + +genesis,tf3: +@:maincpu,program,fff2ac,4,00,90 diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua index 5c54a53912b..228892e7539 100644 --- a/plugins/hiscore/init.lua +++ b/plugins/hiscore/init.lua @@ -64,7 +64,11 @@ function hiscore.startplugin() if not file then file = io.open( hiscore_plugin_path .. "/hiscore.dat", "r" ); end - rm_match = '^' .. emu.romname() .. ':'; + if emu.softname() ~= "" then + rm_match = '^' .. emu.romname() .. ',' .. emu.softname() .. ':'; + else + rm_match = '^' .. emu.romname() .. ':'; + end cluster = ""; current_is_match = false; if file then @@ -113,7 +117,11 @@ function hiscore.startplugin() function get_file_name () - r = hiscore_path .. '/' .. emu.romname() .. ".hi"; + if emu.softname() ~= "" then + r = hiscore_path .. '/' .. emu.romname() .. "_" .. emu.softname() .. ".hi"; + else + r = hiscore_path .. '/' .. emu.romname() .. ".hi"; + end return r; end @@ -225,19 +233,18 @@ function hiscore.startplugin() write_scores(positions) end end - current_game = nil + current_game = "" mem_check_passed = false + scores_have_been_read = false; end emu.register_start(function() print("Starting " .. emu.gamename()) -- check if we've just soft reset - if reset then - reset() - end + -- reset() -- there's no way to reliably save scores after a soft reset currently current_game = emu.romname() dat = read_hiscore_dat() - if dat then + if dat and dat ~= "" then print( "found hiscore.dat entry for " .. emu.romname() ); positions = parse_table( dat ); if not positions then |