Skip to content

Commit b7f5030

Browse files
committed
mameinfo/messinfo dat plugins: support driver sourcefile path
1 parent aaa4a4b commit b7f5030

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

plugins/data/data_mameinfo.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ function dat.check(set, softlist)
1616
if not status or not info then
1717
return nil
1818
end
19-
local sourcefile = emu.driver_find(set).source_file:match('[^/\\]*$')
19+
local sourcefile = emu.driver_find(set).source_file:match('[^/\\]+[/\\\\][^/\\]*$')
2020
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile)
21+
if not drvinfo then
22+
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile:match('[^/\\]*$'))
23+
end
2124
if drvinfo then
2225
info = info .. _p('plugin-data', '\n\n--- DRIVER INFO ---\nDriver: ') .. sourcefile .. '\n\n' .. drvinfo
2326
end

plugins/data/data_messinfo.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ function dat.check(set, softlist)
1616
if not status or not info then
1717
return nil
1818
end
19-
local sourcefile = emu.driver_find(set).source_file:match('[^/\\]*$')
19+
local sourcefile = emu.driver_find(set).source_file:match('[^/\\]+[/\\\\][^/\\]*$')
2020
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile)
21+
if not drvinfo then
22+
status, drvinfo = pcall(datread, 'drv', 'info', sourcefile:match('[^/\\]*$'))
23+
end
2124
if drvinfo then
2225
info = info .. _p('plugin-data', '\n\n--- DRIVER INFO ---\nDriver: ') .. sourcefile .. '\n\n' .. drvinfo
2326
end

0 commit comments

Comments
 (0)