mirror of
https://github.com/holub/mame
synced 2025-04-20 07:22:04 +03:00
hiscore.dat: Updates [Leezer]
remove duplicate sets and merge identical entries (nw)
This commit is contained in:
parent
7e3c5676dc
commit
cdb2312cf8
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@ for line in datfile:lines() do
|
||||
end
|
||||
|
||||
local function clean(data)
|
||||
return data:match("^([^%s;]+)")
|
||||
return data:match("^([^%s;]+)"):lower()
|
||||
end
|
||||
|
||||
if line:match("^%w") then
|
||||
@ -107,6 +107,51 @@ for num, entry in ipairs(entries) do
|
||||
end
|
||||
end
|
||||
|
||||
for num1, entry in ipairs(sorted) do
|
||||
if entry.name then
|
||||
for num2, name in ipairs(entry.name) do
|
||||
local curname = name:match("[^:]*")
|
||||
for num3, entry2 in ipairs(sorted) do
|
||||
if entry2.name and entry.src == entry2.src and entry ~= entry2 then
|
||||
for num4, name2 in ipairs(entry2.name) do
|
||||
if curname == name2:match("[^:]*") then
|
||||
print(name, "duplicate name")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for num1, entry in ipairs(sorted) do
|
||||
if entry.data then
|
||||
for num2, entry2 in ipairs(sorted) do
|
||||
if entry2.data and entry.src == entry2.src and entry ~= entry2 and #entry.data == #entry2.data then
|
||||
for i = 1, #entry2.data do
|
||||
if entry.data[i] ~= entry2.data[i] then
|
||||
break
|
||||
end
|
||||
if i == #entry2.data then
|
||||
for num3, name in ipairs(entry2.name) do
|
||||
entry.name[#entry.name + 1] = name
|
||||
end
|
||||
if entry2.comment then
|
||||
for num3, comment in ipairs(entry2.comment) do
|
||||
if not entry.comment then
|
||||
entry.comment = {}
|
||||
end
|
||||
entry.comment[#entry.comment + 1] = comment
|
||||
end
|
||||
end
|
||||
sorted[num2] = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- copyright 2010 Uli Schlachter GPLv2
|
||||
function stable_sort(list, comp)
|
||||
-- A table could contain non-integer keys which we have to ignore.
|
||||
|
Loading…
Reference in New Issue
Block a user