2016-09-05 21:43:17 -05:00
|
|
|
local dat = {}
|
|
|
|
|
|
2022-06-25 04:57:24 +10:00
|
|
|
local ver, info
|
|
|
|
|
local datread = require('data/load_dat')
|
|
|
|
|
datread, ver = datread.open(
|
|
|
|
|
'messinfo.dat',
|
|
|
|
|
'# MESSINFO.DAT',
|
|
|
|
|
function (str) return str:gsub('\n\n', '\n') end)
|
2016-09-05 21:43:17 -05:00
|
|
|
|
|
|
|
|
function dat.check(set, softlist)
|
|
|
|
|
if softlist or not datread then
|
|
|
|
|
return nil
|
|
|
|
|
end
|
2016-11-02 15:33:11 -05:00
|
|
|
local status, drvinfo
|
2022-06-25 04:57:24 +10:00
|
|
|
status, info = pcall(datread, 'mame', 'info', set)
|
2016-09-05 21:43:17 -05:00
|
|
|
if not status or not info then
|
|
|
|
|
return nil
|
|
|
|
|
end
|
2025-08-08 15:07:08 +02:00
|
|
|
local sourcefile = emu.driver_find(set).source_file:match('[^/\\]+[/\\\\][^/\\]*$')
|
2022-06-25 04:57:24 +10:00
|
|
|
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile)
|
2025-08-08 15:07:08 +02:00
|
|
|
if not drvinfo then
|
|
|
|
|
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile:match('[^/\\]*$'))
|
|
|
|
|
end
|
2016-11-02 15:33:11 -05:00
|
|
|
if drvinfo then
|
2022-06-25 04:57:24 +10:00
|
|
|
info = info .. _p('plugin-data', '\n\n--- DRIVER INFO ---\nDriver: ') .. sourcefile .. '\n\n' .. drvinfo
|
2016-11-02 15:33:11 -05:00
|
|
|
end
|
2022-06-25 04:57:24 +10:00
|
|
|
return _p('plugin-data', 'MESSinfo')
|
2016-09-05 21:43:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function dat.get()
|
|
|
|
|
return info
|
|
|
|
|
end
|
|
|
|
|
|
2016-09-06 22:11:01 -05:00
|
|
|
function dat.ver()
|
|
|
|
|
return ver
|
|
|
|
|
end
|
|
|
|
|
|
2016-09-05 21:43:17 -05:00
|
|
|
return dat
|