summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-02-28 02:22:42 +1100
committer Vas Crabb <vas@vastheman.com>2020-02-28 02:22:42 +1100
commit673232ea59df2c7fec1f59592cd0ed62bbd5ff9b (patch)
treef15073a773939eb2045e9246eba0cc63df2bb6a2
parenteb2b5fa96cb85175de283bbd97707290bccb312c (diff)
parentc39f46d6d259f686879d2afe226e7219d7266a39 (diff)
Merge branch 'release0219' into mainline-master
-rw-r--r--plugins/hiscore/init.lua41
-rw-r--r--src/devices/cpu/ks0164/ks0164d.h9
-rw-r--r--src/devices/cpu/xavix2/xavix2d.h7
3 files changed, 16 insertions, 41 deletions
diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua
index acf5471ecef..9bd6ba2276c 100644
--- a/plugins/hiscore/init.lua
+++ b/plugins/hiscore/init.lua
@@ -1,5 +1,5 @@
-- hiscore.lua
--- by borgar@borgar.net & eadmaster, WTFPL license
+-- by borgar@borgar.net, WTFPL license
--
-- This uses MAME's built-in Lua scripting to implment
-- high-score saving with hiscore.dat infom just as older
@@ -7,10 +7,10 @@
--
local exports = {}
exports.name = "hiscore"
-exports.version = "1.1.0"
+exports.version = "1.0.0"
exports.description = "Hiscore"
exports.license = "WTFPL license"
-exports.author = { name = "borgar@borgar.net & eadmaster" }
+exports.author = { name = "borgar@borgar.net" }
local hiscore = exports
local hiscore_plugin_path = ""
@@ -46,7 +46,7 @@ function hiscore.startplugin()
emu.print_verbose( "hiscore: config found" );
local _conf = {}
for line in io.lines(config_path) do
- token, value = string.match(line, '([^ ]+) +([^ ]+)');
+ token, spaces, value = string.match(line, '([^ ]+)([ ]+)([^ ]+)');
if token ~= nil and token ~= '' then
_conf[token] = value;
end
@@ -98,25 +98,14 @@ function hiscore.startplugin()
local function read_hiscore_dat ()
local file = io.open( hiscoredata_path, "r" );
local rm_match;
- local rm_match_crc = 0;
if not file then
- file = io.open( hiscore_plugin_path .. "/console_hiscore.dat", "r" );
+ file = io.open( hiscore_plugin_path .. "/hiscore.dat", "r" );
end
if emu.softname() ~= "" then
local soft = emu.softname():match("([^:]*)$")
- rm_match = emu.romname() .. ',' .. soft .. ':';
- elseif manager:machine().images["cart"]:filename() ~= nil then
- local basename = string.gsub(manager:machine().images["cart"]:filename(), "(.*/)(.*)", "%2");
- local filename = string.gsub(basename, "(.*)(%..*)", "%1"); -- strip the extension (e.g. ".nes")
- rm_match = emu.romname() .. "," .. filename .. ':';
- rm_match_crc = emu.romname() .. ",crc32=" .. string.format("%x", manager:machine().images["cart"]:crc()) .. ':';
- elseif manager:machine().images["cdrom"]:filename() ~= nil then
- local basename = string.gsub(manager:machine().images["cdrom"]:filename(), "(.*/)(.*)", "%2");
- local filename = string.gsub(basename, "(.*)(%..*)", "%1"); -- strip the extension (e.g. ".cue")
- rm_match = emu.romname() .. "," .. filename .. ':';
- --rm_match_crc = string.format("%x", manager:machine().images["cdrom"]:crc()) .. ':'; -- always 0 with cdrom media?
+ rm_match = '^' .. emu.romname() .. ',' .. soft .. ':';
else
- rm_match = emu.romname() .. ':';
+ rm_match = '^' .. emu.romname() .. ':';
end
local cluster = "";
local current_is_match = false;
@@ -133,9 +122,7 @@ function hiscore.startplugin()
end
elseif string.find(line, rm_match) then --- match this game
current_is_match = true;
- elseif line == rm_match_crc then --- match this game crc
- current_is_match = true;
- elseif string.find(line, '^.+:') then --- some game
+ elseif string.find(line, '^[a-z0-9_]+:') then --- some game
if current_is_match and string.len(cluster) > 0 then
break; -- we're done
end
@@ -171,17 +158,8 @@ function hiscore.startplugin()
local r;
if emu.softname() ~= "" then
local soft = emu.softname():match("([^:]*)$")
- r = hiscore_path .. '/' .. emu.romname() .. '/' .. soft .. ".hi";
- elseif manager:machine().images["cart"]:filename() ~= nil then
- local basename = string.gsub(manager:machine().images["cart"]:filename(), "(.*/)(.*)", "%2")
- local filename = string.gsub(basename, "(.*)(%..*)", "%1"); -- strip the extension (e.g. ".nes")
- r = hiscore_path .. '/' .. emu.romname() .. '/' .. filename .. ".hi";
- elseif manager:machine().images["cdrom"]:filename() ~= nil then
- local basename = string.gsub(manager:machine().images["cdrom"]:filename(), "(.*/)(.*)", "%2");
- local filename = string.gsub(basename, "(.*)(%..*)", "%1"); -- strip the media extension (e.g. ".cue")
- r = hiscore_path .. '/' .. emu.romname() .. '/' .. filename .. ".hi";
+ r = hiscore_path .. '/' .. emu.romname() .. "_" .. soft .. ".hi";
else
- -- arcade games
r = hiscore_path .. '/' .. emu.romname() .. ".hi";
end
return r;
@@ -194,7 +172,6 @@ function hiscore.startplugin()
if not output then
-- attempt to create the directory, and try again
lfs.mkdir( hiscore_path );
- lfs.mkdir( hiscore_path .. '/' .. emu.romname() );
output = io.open(get_file_name(), "wb");
end
emu.print_verbose("hiscore: write_scores output")
diff --git a/src/devices/cpu/ks0164/ks0164d.h b/src/devices/cpu/ks0164/ks0164d.h
index ebc3adc2655..4383fbd7388 100644
--- a/src/devices/cpu/ks0164/ks0164d.h
+++ b/src/devices/cpu/ks0164/ks0164d.h
@@ -3,8 +3,8 @@
// KS0164 disassembler
-#ifndef MAME_CPU_KS0164_KS0164DASM_H
-#define MAME_CPU_KS0164_KS0164DASM_H
+#ifndef MAME_CPU_KS0164_KS0164D_H
+#define MAME_CPU_KS0164_KS0164D_H
#pragma once
@@ -21,7 +21,7 @@ private:
struct instruction {
u16 value;
u16 mask;
- std::function<u32 (std::ostream &, u32, const data_buffer &, u32)> cb;
+ u32 (*cb)(std::ostream &, u32, const data_buffer &, u32);
};
static const instruction instructions[];
@@ -31,5 +31,4 @@ private:
static std::string off16(s16 dt);
};
-#endif
-
+#endif // MAME_CPU_KS0164_KS0164D_H
diff --git a/src/devices/cpu/xavix2/xavix2d.h b/src/devices/cpu/xavix2/xavix2d.h
index cd049e423fd..409fac0da0e 100644
--- a/src/devices/cpu/xavix2/xavix2d.h
+++ b/src/devices/cpu/xavix2/xavix2d.h
@@ -3,8 +3,8 @@
// Xavix2 disassembler
-#ifndef MAME_CPU_XAVIX2_XAVIX2DASM_H
-#define MAME_CPU_XAVIX2_XAVIX2DASM_H
+#ifndef MAME_CPU_XAVIX2_XAVIX2D_H
+#define MAME_CPU_XAVIX2_XAVIX2D_H
#pragma once
@@ -50,5 +50,4 @@ private:
std::string rel8();
};
-#endif
-
+#endif // MAME_CPU_XAVIX2_XAVIX2D_H