mame/plugins/data/data_messinfo.lua
Vas Crabb 923ef2c25d -plugins.data: Reworked the code substantialy.
* Use the plugin data folder for storing the cache.  The history folder
  may be read-only or shared with different configurations.
* Don't create the cache database or surrounding folder if there's
  nothing to store in it.
* Actually use prepared queries multiple times rather than always
  destroying them after a single use.
* Added proper error checking for most database operations.
* Improved query performance by avoiding outer joins and table scans.

-bus/nubus: Made the Macintosh Display Cards map the blue channel to
 white with monochrome monitors.  Also added logging for PLL
 configuration to help debug how CRTC and RAMDAC clocks work in the
 future.
2022-06-25 04:57:24 +10:00

35 lines
792 B
Lua

local dat = {}
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)
function dat.check(set, softlist)
if softlist or not datread then
return nil
end
local status, drvinfo
status, info = pcall(datread, 'mame', 'info', set)
if not status or not info then
return nil
end
local sourcefile = emu.driver_find(set).source_file:match('[^/\\]*$')
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile)
if drvinfo then
info = info .. _p('plugin-data', '\n\n--- DRIVER INFO ---\nDriver: ') .. sourcefile .. '\n\n' .. drvinfo
end
return _p('plugin-data', 'MESSinfo')
end
function dat.get()
return info
end
function dat.ver()
return ver
end
return dat