From 330b0d146dd49946b9d34d83eaf62984c4f9ec71 Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 2 Nov 2016 15:33:11 -0500 Subject: [PATCH] plugins/data: fix driver info (nw) --- plugins/data/data_mameinfo.lua | 7 ++++++- plugins/data/data_messinfo.lua | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/data/data_mameinfo.lua b/plugins/data/data_mameinfo.lua index 641c0bc954e..5f42fe6a36f 100644 --- a/plugins/data/data_mameinfo.lua +++ b/plugins/data/data_mameinfo.lua @@ -7,11 +7,16 @@ function dat.check(set, softlist) if softlist or not datread then return nil end - local status + 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 .. "\n\n--- DRIVER INFO ---\nDriver: " .. sourcefile .. "\n\n" .. drvinfo + end info = info:gsub("\n\n", "\n") return "Mameinfo" end diff --git a/plugins/data/data_messinfo.lua b/plugins/data/data_messinfo.lua index 5554682598f..86949e30431 100644 --- a/plugins/data/data_messinfo.lua +++ b/plugins/data/data_messinfo.lua @@ -8,11 +8,16 @@ function dat.check(set, softlist) if softlist or not datread then return nil end - local status + 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 .. "\n\n--- DRIVER INFO ---\nDriver: " .. sourcefile .. "\n\n" .. drvinfo + end info = info:gsub("\n\n", "\n") return "Messinfo" end