-- to use this get the package from http://greatstone.free.fr/hi2txt/ -- extract the hi2txt.zip and place it in your history path local dat = {} local env = {} local output local curset function dat.check(set, softlist) if softlist then return nil end local datpath local function xml_parse() local file = emu.file(lfs.env_replace(mame_manager:ui():options().entries.historypath:value():gsub("([^;]+)", "%1/hi2txt")), 1) local ret = file:open(set .. ".xml") local table if ret then return nil end datpath = file:fullpath():gsub(".zip", "/") local data = file:read(file:size()) data = data:match("(.*)") local function get_tags(str, parent) local arr = {} while str ~= "" do local tag, attr, stop tag, attr, stop, str = str:match("<([%w!_%-]+) ?(.-)(/?)[ %-]->(.*)") if not tag then return arr end if tag:sub(0, 3) ~= "!--" then local block = {} if stop ~= "/" then local nest nest, str = str:match("(.-)(.*)") local children = get_tags(nest, tag) if not next(children) then nest = nest:gsub("