mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
minimaws: add rudimentary listing of software lists to web UI and work around a python issue on loading; also fix up more software list issues (nw)
This commit is contained in:
parent
24d2b7a51d
commit
1fda8836a7
@ -1565,7 +1565,6 @@ almost nothing like the prototype.
|
||||
<publisher>Atari / Electronic Arts</publisher>
|
||||
<info name="serial" value="CX7824"/>
|
||||
<sharedfeat name="compatibility" value="NTSC"/>
|
||||
<sharedfeat name="compatibility" value="NTSC"/>
|
||||
<part name="cart" interface="a7800_cart">
|
||||
<feature name="slot" value="a78_rom" />
|
||||
<dataarea name="rom" size="49152">
|
||||
@ -1580,7 +1579,6 @@ almost nothing like the prototype.
|
||||
<publisher>Atari / Electronic Arts</publisher>
|
||||
<info name="serial" value="CX7824"/>
|
||||
<sharedfeat name="compatibility" value="PAL"/>
|
||||
<sharedfeat name="compatibility" value="PAL"/>
|
||||
<part name="cart" interface="a7800_cart">
|
||||
<feature name="slot" value="a78_rom" />
|
||||
<dataarea name="rom" size="49152">
|
||||
|
@ -17677,7 +17677,6 @@ Unreleased (music source code exists, possibly no prototypes exist)
|
||||
<feature name="u5" value="U5 [LVX04]" />
|
||||
<feature name="batt" value="Batt CR2025" />
|
||||
<feature name="slot" value="rom_huc3" />
|
||||
<feature name="slot" value="rom_huc3" />
|
||||
<dataarea name="rom" size="1048576">
|
||||
<rom name="robopon - sun version (usa).bin" size="1048576" crc="32caef11" sha1="399c928a38a3901b7a1093bd61f5a4d8c05b9771"/>
|
||||
</dataarea>
|
||||
|
11
hash/nes.xml
11
hash/nes.xml
@ -15683,7 +15683,7 @@
|
||||
<feature name="ic5" value="CIC" />
|
||||
<feature name="ic6" value="3195 [unpopulated]" />
|
||||
<feature name="ic7" value="3196 [unpopulated]" />
|
||||
<feature name="ic7" value="319X [unpopulated]" />
|
||||
<!-- feature name="ic7" value="319X [unpopulated]" / duplicate feature - what's this even supposed to be? -->
|
||||
<feature name="cart_back_label" value="REV-A" />
|
||||
<dataarea name="prg" size="131072">
|
||||
<rom name="0.prg" size="131072" crc="40e0f69e" sha1="8be9caaebd09e231cfa5f74ac86f2a35362d06fb" offset="00000" />
|
||||
@ -24308,7 +24308,6 @@
|
||||
<publisher>Codemasters</publisher>
|
||||
<info name="serial" value="COBIC-7403-MM"/>
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="mirroring" value="vertical" />
|
||||
<feature name="slot" value="bf9093" />
|
||||
<feature name="pcb" value="NR8NV1-1" />
|
||||
<feature name="mirroring" value="vertical" />
|
||||
@ -36105,8 +36104,7 @@
|
||||
<part name="cart" interface="nes_cart">
|
||||
<feature name="slot" value="sxrom" />
|
||||
<feature name="pcb" value="NES-SFROM" />
|
||||
<feature name="peripheral" value="zapper" />
|
||||
<feature name="peripheral" value="powerpad" />
|
||||
<feature name="peripheral" value="zapper,powerpad" />
|
||||
<dataarea name="prg" size="131072">
|
||||
<rom name="nes-wh-0 prg" size="131072" crc="6beb5c84" sha1="ad48815abdf6ae67eccd1d1cc15eaa709cd5e4cc" offset="00000" />
|
||||
</dataarea>
|
||||
@ -36127,8 +36125,7 @@
|
||||
<feature name="slot" value="sxrom_a" />
|
||||
<feature name="pcb" value="NES-SFROM" />
|
||||
<feature name="mmc1_type" value="MMC1A" />
|
||||
<feature name="peripheral" value="zapper" />
|
||||
<feature name="peripheral" value="powerpad" />
|
||||
<feature name="peripheral" value="zapper,powerpad" />
|
||||
<dataarea name="prg" size="131072">
|
||||
<rom name="0.prg" size="131072" crc="d4f018f5" sha1="c673378f44042213c2e28da14de02009e4470011" offset="00000" />
|
||||
</dataarea>
|
||||
@ -47174,7 +47171,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
|
||||
<feature name="u2" value="U2 CHR" />
|
||||
<feature name="u3" value="U3 PRG" />
|
||||
<feature name="u4" value="U4 DIS23CO1" />
|
||||
<feature name="u4" value="U5 PAL" />
|
||||
<feature name="u5" value="U5 PAL" />
|
||||
<!-- PRG chip on Frank Cifaldi's board says "9318" and CHR chip on the same one says "9317". -->
|
||||
<!-- Likely a sort of production code? -->
|
||||
<dataarea name="chr" size="131072">
|
||||
|
@ -14087,7 +14087,7 @@ more investigation needed...
|
||||
<feature name="u3" value="U3 HCU04" />
|
||||
<feature name="u4" value="U4 CIC" />
|
||||
<feature name="lockout" value="" />
|
||||
<feature name="u4" value="U5 Ω" />
|
||||
<feature name="u5" value="U5 Ω" />
|
||||
<feature name="battery" value="BATT CR2032" />
|
||||
<feature name="cart_model" value="SHVC-006" />
|
||||
<feature name="cart_back_label" value="920214" />
|
||||
@ -24253,7 +24253,7 @@ more investigation needed...
|
||||
<feature name="u2" value="U2 P1" />
|
||||
<feature name="u3" value="U3 P2" />
|
||||
<feature name="u4" value="U4 LS139" />
|
||||
<feature name="u4" value="U5 CIC" />
|
||||
<feature name="u5" value="U5 CIC" />
|
||||
<feature name="lockout" value="" />
|
||||
<feature name="cart_model" value="SHVC-006" />
|
||||
<feature name="cart_back_label" value="920214" />
|
||||
@ -32618,7 +32618,7 @@ Alternate board (XL-1)
|
||||
<feature name="u2" value="U2 FLASH" />
|
||||
<feature name="u3" value="U3 74AC139" />
|
||||
<feature name="u4" value="U4 CIC F411/F413" />
|
||||
<feature name="u4" value="U5 74AC08" />
|
||||
<feature name="u5" value="U5 74AC08" />
|
||||
<feature name="lockout" value="F411B (C)" />
|
||||
<feature name="battery" value="none" />
|
||||
<feature name="cart_model" value="SHVC-006" />
|
||||
@ -32644,7 +32644,7 @@ Alternate board (XL-1)
|
||||
<feature name="u2" value="U2 FLASH" />
|
||||
<feature name="u3" value="U3 74AC139" />
|
||||
<feature name="u4" value="U4 CIC F411/F413" />
|
||||
<feature name="u4" value="U5 74AC08" />
|
||||
<feature name="u5" value="U5 74AC08" />
|
||||
<feature name="lockout" value="F411B (C)" />
|
||||
<feature name="battery" value="none" />
|
||||
<feature name="cart_model" value="SHVC-006" />
|
||||
@ -60388,7 +60388,6 @@ to ensure nothing has been touched in the Retro Quest cart production in 2013/20
|
||||
<year>1996</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<sharedfeat name="compatibility" value="PAL"/>
|
||||
<sharedfeat name="compatibility" value="PAL"/>
|
||||
<part name="cart" interface="snes_cart">
|
||||
<feature name="slot" value="hirom" />
|
||||
<dataarea name="rom" size="4194304">
|
||||
|
@ -644,6 +644,20 @@ class QueryCursor(object):
|
||||
'ORDER BY ramoption.size',
|
||||
(machine, ))
|
||||
|
||||
def get_softwarelists(self, pattern):
|
||||
if pattern is not None:
|
||||
return self.dbcurs.execute(
|
||||
'SELECT softwarelist.shortname AS shortname, softwarelist.description AS description, COUNT(*) AS total, COUNT(CASE software.supported WHEN 0 THEN 1 ELSE NULL END) AS supported, COUNT(CASE software.supported WHEN 1 THEN 1 ELSE NULL END) AS partiallysupported, COUNT(CASE software.supported WHEN 2 THEN 1 ELSE NULL END) AS unsupported ' \
|
||||
'FROM softwarelist LEFT JOIN software ON softwarelist.id = software.softwarelist ' \
|
||||
'WHERE softwarelist.shortname GLOB ? ' \
|
||||
'GROUP BY softwarelist.id',
|
||||
(pattern, ))
|
||||
else:
|
||||
return self.dbcurs.execute(
|
||||
'SELECT softwarelist.shortname AS shortname, softwarelist.description AS description, COUNT(*) AS total, COUNT(CASE software.supported WHEN 0 THEN 1 ELSE NULL END) AS supported, COUNT(CASE software.supported WHEN 1 THEN 1 ELSE NULL END) AS partiallysupported, COUNT(CASE software.supported WHEN 2 THEN 1 ELSE NULL END) AS unsupported ' \
|
||||
'FROM softwarelist LEFT JOIN software ON softwarelist.id = software.softwarelist ' \
|
||||
'GROUP BY softwarelist.id')
|
||||
|
||||
def get_rom_dumps(self, crc, sha1):
|
||||
return self.dbcurs.execute(
|
||||
'SELECT machine.shortname AS shortname, machine.description AS description, romdump.name AS label, romdump.bad AS bad ' \
|
||||
|
@ -164,6 +164,45 @@ SOURCEFILE_LIST_ROW = string.Template(
|
||||
' <td style="text-align: right">${machines}</td>\n' \
|
||||
' </tr>\n')
|
||||
|
||||
|
||||
SOFTWARELIST_LIST_PROLOGUE = string.Template(
|
||||
'<!DOCTYPE html>\n' \
|
||||
'<html>\n' \
|
||||
'<head>\n' \
|
||||
' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n' \
|
||||
' <meta http-equiv="Content-Style-Type" content="text/css">\n' \
|
||||
' <meta http-equiv="Content-Script-Type" content="text/javascript">\n' \
|
||||
' <link rel="stylesheet" type="text/css" href="${assets}/style.css">\n' \
|
||||
' <script type="text/javascript">var assetsurl="${assets}"</script>\n' \
|
||||
' <script type="text/javascript" src="${assets}/common.js"></script>\n' \
|
||||
' <title>${title}</title>\n' \
|
||||
'</head>\n' \
|
||||
'<body>\n' \
|
||||
'<h1>${heading}</h1>\n' \
|
||||
'<table id="tbl-softwarelists">\n' \
|
||||
' <thead>\n' \
|
||||
' <tr>\n' \
|
||||
' <th>Short name</th>\n' \
|
||||
' <th>Description</th>\n' \
|
||||
' <th class="numeric">Total</th>\n' \
|
||||
' <th class="numeric">Supported</th>\n' \
|
||||
' <th class="numeric">Partially supported</th>\n' \
|
||||
' <th class="numeric">Unsupported</th>\n' \
|
||||
' </tr>\n' \
|
||||
' </thead>\n' \
|
||||
' <tbody>\n')
|
||||
|
||||
SOFTWARELIST_LIST_ROW = string.Template(
|
||||
' <tr>\n' \
|
||||
' <td><a href="${href}">${shortname}</a></td>\n' \
|
||||
' <td><a href="${href}">${description}</a></td>\n' \
|
||||
' <td style="text-align: right">${total}</td>\n' \
|
||||
' <td style="text-align: right">${supported}</td>\n' \
|
||||
' <td style="text-align: right">${partiallysupported}</td>\n' \
|
||||
' <td style="text-align: right">${unsupported}</td>\n' \
|
||||
' </tr>\n')
|
||||
|
||||
|
||||
ROMIDENT_PAGE = string.Template(
|
||||
'<!DOCTYPE html>\n' \
|
||||
'<html>\n' \
|
||||
|
@ -406,7 +406,8 @@ def load_info(options):
|
||||
if options.softwarepath:
|
||||
parser.setContentHandler(SoftwareListHandler(dbconn))
|
||||
for path in options.softwarepath:
|
||||
for filename in [os.path.join(path, f) for f in os.listdir(path) if f.endswith('.xml')]:
|
||||
files = [os.path.join(path, f) for f in os.listdir(path) if f.endswith('.xml')]
|
||||
for filename in files:
|
||||
parser.parse(filename)
|
||||
|
||||
dbconn.finalise_load()
|
||||
|
@ -103,6 +103,9 @@ class QueryPageHandler(HandlerBase):
|
||||
def sourcefile_href(self, sourcefile):
|
||||
return cgi.escape(urlparse.urljoin(self.application_uri, 'sourcefile/%s' % (urlquote(sourcefile), )), True)
|
||||
|
||||
def softwarelist_href(self, softwarelist):
|
||||
return cgi.escape(urlparse.urljoin(self.application_uri, 'softwarelist/%s' % (urlquote(softwarelist), )), True)
|
||||
|
||||
|
||||
class MachineRpcHandlerBase(QueryPageHandler):
|
||||
def __init__(self, app, application_uri, environ, start_response, **kwargs):
|
||||
@ -426,6 +429,43 @@ class SourceFileHandler(QueryPageHandler):
|
||||
parent=cgi.escape(machine_info['cloneof'] or '')).encode('utf-8')
|
||||
|
||||
|
||||
class SoftwareListHandler(QueryPageHandler):
|
||||
def __init__(self, app, application_uri, environ, start_response, **kwargs):
|
||||
super(SoftwareListHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs)
|
||||
|
||||
def __iter__(self):
|
||||
self.filename = self.environ['PATH_INFO']
|
||||
if self.filename and (self.filename[0] == '/'):
|
||||
self.filename = self.filename[1:]
|
||||
if (not self.filename) or ('*' in self.filename) or ('?' in self.filename):
|
||||
if self.environ['REQUEST_METHOD'] != 'GET':
|
||||
self.start_response('405 %s' % (self.STATUS_MESSAGE[405], ), [('Content-type', 'text/html; charset=utf-8'), ('Accept', 'GET, HEAD, OPTIONS'), ('Cache-Control', 'public, max-age=3600')])
|
||||
return self.error_page(405)
|
||||
else:
|
||||
self.start_response('200 OK', [('Content-type', 'text/html; chearset=utf-8'), ('Cache-Control', 'public, max-age=3600')])
|
||||
return self.softwarelist_listing_page(self.filename if self.filename else None)
|
||||
|
||||
def softwarelist_listing_page(self, pattern):
|
||||
if not pattern:
|
||||
title = heading = 'All Software Lists'
|
||||
else:
|
||||
title = heading = 'Software Lists: ' + cgi.escape(pattern)
|
||||
yield htmltmpl.SOFTWARELIST_LIST_PROLOGUE.substitute(
|
||||
assets=cgi.escape(urlparse.urljoin(self.application_uri, 'static'), True),
|
||||
title=title,
|
||||
heading=heading).encode('utf-8')
|
||||
for shortname, description, total, supported, partiallysupported, unsupported in self.dbcurs.get_softwarelists(pattern):
|
||||
yield htmltmpl.SOFTWARELIST_LIST_ROW.substitute(
|
||||
href=self.softwarelist_href(shortname),
|
||||
shortname=cgi.escape(shortname),
|
||||
description=cgi.escape(description),
|
||||
total=cgi.escape('%d' % total),
|
||||
supported=cgi.escape('%d' % supported),
|
||||
partiallysupported=cgi.escape('%d' % partiallysupported),
|
||||
unsupported=cgi.escape('%d' % unsupported)).encode('utf-8')
|
||||
yield ' </tbody>\n</table>\n<script>make_table_sortable(document.getElementById("tbl-softwarelists"));</script>\n</body>\n</html>\n'.encode('utf-8')
|
||||
|
||||
|
||||
class RomIdentHandler(QueryPageHandler):
|
||||
def __init__(self, app, application_uri, environ, start_response, **kwargs):
|
||||
super(QueryPageHandler, self).__init__(app=app, application_uri=application_uri, environ=environ, start_response=start_response, **kwargs)
|
||||
@ -598,6 +638,8 @@ class MiniMawsApp(object):
|
||||
return MachineHandler(self, application_uri, environ, start_response)
|
||||
elif module == 'sourcefile':
|
||||
return SourceFileHandler(self, application_uri, environ, start_response)
|
||||
elif module == 'softwarelist':
|
||||
return SoftwareListHandler(self, application_uri, environ, start_response)
|
||||
elif module == 'romident':
|
||||
return RomIdentHandler(self, application_uri, environ, start_response)
|
||||
elif module == 'static':
|
||||
|
Loading…
Reference in New Issue
Block a user