(nw) misc cleanup:

* subhuntr.cpp: S2636 PVI was seemingly uncommented by mistake in 93308b483e - offsets and sound routing seem to be copy/pasted from somewhere
* phi: prettier config
* scramble.cpp, wallc.cpp: avoid some calls to subdevice<...>(...)
* makedep.py: open source files as UTF-8 (GitHub #5482)
* minimaws: be less trusting
This commit is contained in:
Vas Crabb 2019-10-02 02:11:58 +10:00
parent f7afeebdaf
commit 9a6e04b01f
13 changed files with 179 additions and 166 deletions

View File

@ -5,7 +5,9 @@
from __future__ import with_statement from __future__ import with_statement
import io
import sys import sys
## to ignore include of emu.h add it always to list ## to ignore include of emu.h add it always to list
files_included = ['src/emu/emu.h'] files_included = ['src/emu/emu.h']
@ -61,11 +63,12 @@ def add_rest_if_exists(root, srcfile,folder):
def parse_file_for_deps(root, srcfile, folder): def parse_file_for_deps(root, srcfile, folder):
try: try:
fp = open(root + srcfile, 'r') fp = io.open(root + srcfile, 'r', encoding='utf-8')
except IOError: except IOError:
return 1 return 1
in_comment = 0 in_comment = 0
linenum = 0 linenum = 0
with fp:
for line in fp.readlines(): for line in fp.readlines():
content = '' content = ''
linenum+=1 linenum+=1
@ -107,16 +110,16 @@ def parse_file_for_deps(root, srcfile, folder):
newfolder = fullname.rsplit('/', 1)[0] + '/' newfolder = fullname.rsplit('/', 1)[0] + '/'
parse_file_for_deps(root, fullname, newfolder) parse_file_for_deps(root, fullname, newfolder)
continue continue
fp.close()
return 0 return 0
def parse_file(root, srcfile, folder): def parse_file(root, srcfile, folder):
try: try:
fp = open(root + srcfile, 'r') fp = io.open(root + srcfile, 'r', encoding='utf-8')
except IOError: except IOError:
return 1 return 1
in_comment = 0 in_comment = 0
linenum = 0 linenum = 0
with fp:
for line in fp.readlines(): for line in fp.readlines():
content = '' content = ''
linenum+=1 linenum+=1
@ -165,7 +168,6 @@ def parse_file(root, srcfile, folder):
elif fullname.endswith('.h'): elif fullname.endswith('.h'):
parse_file(root, fullname.replace('.h','.cpp'), newfolder) parse_file(root, fullname.replace('.h','.cpp'), newfolder)
continue continue
fp.close()
return 0 return 0
def parse_file_for_drivers(root, srcfile): def parse_file_for_drivers(root, srcfile):
@ -177,10 +179,11 @@ def parse_file_for_drivers(root, srcfile):
def parse_lua_file(srcfile): def parse_lua_file(srcfile):
try: try:
fp = open(srcfile, 'r') fp = io.open(srcfile, 'r', encoding='utf-8')
except IOError: except IOError:
sys.stderr.write("Unable to open source file '%s'\n" % srcfile) sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
return 1 return 1
with fp:
for line in fp.readlines(): for line in fp.readlines():
content = line.strip() content = line.strip()
if len(content)>0: if len(content)>0:

View File

@ -136,7 +136,7 @@ var fetch_bios_sets = (function ()
{ {
pending[device] = true; pending[device] = true;
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('GET', appurl + 'rpc/bios/' + device, true); req.open('GET', appurl + 'rpc/bios/' + encodeURIComponent(device), true);
req.responseType = 'json'; req.responseType = 'json';
req.onload = req.onload =
function () function ()
@ -171,7 +171,7 @@ var fetch_machine_flags = (function ()
{ {
pending[device] = true; pending[device] = true;
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('GET', appurl + 'rpc/flags/' + device, true); req.open('GET', appurl + 'rpc/flags/' + encodeURIComponent(device), true);
req.responseType = 'json'; req.responseType = 'json';
req.onload = req.onload =
function () function ()
@ -413,7 +413,7 @@ function make_slot_change_handler(name, slot, defaults, dfltbtn)
row.appendChild(document.createElement('th')).textContent = 'Short name:'; row.appendChild(document.createElement('th')).textContent = 'Short name:';
var link = row.appendChild(document.createElement('td')).appendChild(document.createElement('a')); var link = row.appendChild(document.createElement('td')).appendChild(document.createElement('a'));
link.textContent = selection.device; link.textContent = selection.device;
link.setAttribute('href', appurl + 'machine/' + selection.device); link.setAttribute('href', appurl + 'machine/' + encodeURIComponent(selection.device));
// if we have emulation flags, populate now, otherwise fetch asynchronously // if we have emulation flags, populate now, otherwise fetch asynchronously
if (!Object.prototype.hasOwnProperty.call(machine_flags, selection.device)) if (!Object.prototype.hasOwnProperty.call(machine_flags, selection.device))
@ -487,7 +487,7 @@ function fetch_slots(machine)
function make_request(device) function make_request(device)
{ {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('GET', appurl + 'rpc/slots/' + device, true); req.open('GET', appurl + 'rpc/slots/' + encodeURIComponent(device), true);
req.responseType = 'json'; req.responseType = 'json';
req.onload = req.onload =
function () function ()

View File

@ -145,7 +145,7 @@ function get_machine_table(shortname, description)
var heading = div.appendChild(document.createElement('h2')); var heading = div.appendChild(document.createElement('h2'));
var link = heading.appendChild(document.createElement('a')); var link = heading.appendChild(document.createElement('a'));
link.textContent = description; link.textContent = description;
link.setAttribute('href', appurl + 'machine/' + shortname); link.setAttribute('href', appurl + 'machine/' + encodeURIComponent(shortname));
var table = div.appendChild(document.createElement('table')); var table = div.appendChild(document.createElement('table'));
machine_info[shortname] = table; machine_info[shortname] = table;
add_matches(table, matched_names, null); add_matches(table, matched_names, null);

View File

@ -13,13 +13,15 @@ import mimetypes
import os.path import os.path
import re import re
import sys import sys
import wsgiref.simple_server import urllib
import wsgiref.util import wsgiref.util
if sys.version_info >= (3, ): if sys.version_info >= (3, ):
import urllib.parse as urlparse import urllib.parse as urlparse
urlquote = urlparse.quote
else: else:
import urlparse import urlparse
urlquote = urllib.quote
class HandlerBase(object): class HandlerBase(object):
@ -96,10 +98,10 @@ class QueryPageHandler(HandlerBase):
self.dbcurs = app.dbconn.cursor() self.dbcurs = app.dbconn.cursor()
def machine_href(self, shortname): def machine_href(self, shortname):
return cgi.escape(urlparse.urljoin(self.application_uri, 'machine/%s' % (shortname, )), True) return cgi.escape(urlparse.urljoin(self.application_uri, 'machine/%s' % (urlquote(shortname), )), True)
def sourcefile_href(self, sourcefile): def sourcefile_href(self, sourcefile):
return cgi.escape(urlparse.urljoin(self.application_uri, 'sourcefile/%s' % (sourcefile, )), True) return cgi.escape(urlparse.urljoin(self.application_uri, 'sourcefile/%s' % (urlquote(sourcefile), )), True)
class MachineRpcHandlerBase(QueryPageHandler): class MachineRpcHandlerBase(QueryPageHandler):
@ -174,21 +176,21 @@ class MachineHandler(QueryPageHandler):
if parent: if parent:
yield ( yield (
' <tr><th>Parent Machine:</th><td><a href="%s">%s (%s)</a></td></tr>\n' % ' <tr><th>Parent Machine:</th><td><a href="%s">%s (%s)</a></td></tr>\n' %
(cgi.escape('%smachine/%s' % (self.application_uri, machine_info['cloneof']), True), cgi.escape(parent[1]), cgi.escape(machine_info['cloneof']))).encode('utf-8') (self.machine_href(machine_info['cloneof']), cgi.escape(parent[1]), cgi.escape(machine_info['cloneof']))).encode('utf-8')
else: else:
yield ( yield (
' <tr><th>Parent Machine:</th><td><a href="%s">%s</a></td></tr>\n' % ' <tr><th>Parent Machine:</th><td><a href="%s">%s</a></td></tr>\n' %
(cgi.escape('%smachine/%s' % (self.application_uri, machine_info['cloneof']), True), cgi.escape(machine_info['cloneof']))).encode('utf-8') (self.machine_href(machine_info['cloneof']), cgi.escape(machine_info['cloneof']))).encode('utf-8')
if (machine_info['romof'] is not None) and (machine_info['romof'] != machine_info['cloneof']): if (machine_info['romof'] is not None) and (machine_info['romof'] != machine_info['cloneof']):
parent = self.dbcurs.listfull(machine_info['romof']).fetchone() parent = self.dbcurs.listfull(machine_info['romof']).fetchone()
if parent: if parent:
yield ( yield (
' <tr><th>Parent ROM set:</th><td><a href="%s">%s (%s)</a></td></tr>\n' % ' <tr><th>Parent ROM set:</th><td><a href="%s">%s (%s)</a></td></tr>\n' %
(cgi.escape('%smachine/%s' % (self.application_uri, machine_info['romof']), True), cgi.escape(parent[1]), cgi.escape(machine_info['romof']))).encode('utf-8') (self.machine_href(machine_info['romof']), cgi.escape(parent[1]), cgi.escape(machine_info['romof']))).encode('utf-8')
else: else:
yield ( yield (
' <tr><th>Parent Machine:</th><td><a href="%s">%s</a></td></tr>\n' % ' <tr><th>Parent Machine:</th><td><a href="%s">%s</a></td></tr>\n' %
(cgi.escape('%smachine/%s' % (self.application_uri, machine_info['romof']), True), cgi.escape(machine_info['romof']))).encode('utf-8') (self.machine_href(machine_info['romof']), cgi.escape(machine_info['romof']))).encode('utf-8')
unemulated = [] unemulated = []
imperfect = [] imperfect = []
for feature, status, overall in self.dbcurs.get_feature_flags(id): for feature, status, overall in self.dbcurs.get_feature_flags(id):
@ -404,10 +406,10 @@ class SourceFileHandler(QueryPageHandler):
uri = urlparse.urljoin(self.application_uri, 'sourcefile') uri = urlparse.urljoin(self.application_uri, 'sourcefile')
title = '' title = ''
for part in parts: for part in parts:
uri = urlparse.urljoin(uri + '/', part) uri = urlparse.urljoin(uri + '/', urlquote(part))
title += '<a href="{0}">{1}</a>/'.format(cgi.escape(uri, True), cgi.escape(part)) title += '<a href="{0}">{1}</a>/'.format(cgi.escape(uri, True), cgi.escape(part))
if linkfinal: if linkfinal:
uri = urlparse.urljoin(uri + '/', final) uri = urlparse.urljoin(uri + '/', urlquote(final))
return title + '<a href="{0}">{1}</a>'.format(cgi.escape(uri, True), cgi.escape(final)) return title + '<a href="{0}">{1}</a>'.format(cgi.escape(uri, True), cgi.escape(final))
else: else:
return title + final return title + final
@ -615,12 +617,3 @@ class MiniMawsApp(object):
def js_escape(self, str): def js_escape(self, str):
return self.JS_ESCAPE.sub('\\\\\\1', str).replace('\0', '\\0') return self.JS_ESCAPE.sub('\\\\\\1', str).replace('\0', '\\0')
def run_server(options):
application = MiniMawsApp(options.database)
server = wsgiref.simple_server.make_server(options.host, options.port, application)
try:
server.serve_forever()
except KeyboardInterrupt:
pass

View File

@ -78,19 +78,9 @@
## and see dependent slots update. Required command-line arguments to ## and see dependent slots update. Required command-line arguments to
## produce the selected configuration are also displayed. ## produce the selected configuration are also displayed.
import argparse
import os
import os.path
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import lib.auxverbs
import lib.lxparse
import lib.wsgiserve
if __name__ == '__main__': if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--database', metavar='<dbfile>', default='minimaws.sqlite3', help='SQLite 3 info database file (defaults to minimaws.sqlite3)') parser.add_argument('--database', metavar='<dbfile>', default='minimaws.sqlite3', help='SQLite 3 info database file (defaults to minimaws.sqlite3)')
subparsers = parser.add_subparsers(title='commands', dest='command', metavar='<command>') subparsers = parser.add_subparsers(title='commands', dest='command', metavar='<command>')
@ -123,6 +113,8 @@ if __name__ == '__main__':
group.add_argument('--file', metavar='<xmlfile>', help='XML machine information file') group.add_argument('--file', metavar='<xmlfile>', help='XML machine information file')
options = parser.parse_args() options = parser.parse_args()
import lib.auxverbs
if options.command == 'listfull': if options.command == 'listfull':
lib.auxverbs.do_listfull(options) lib.auxverbs.do_listfull(options)
elif options.command == 'listsource': elif options.command == 'listsource':
@ -136,8 +128,14 @@ if __name__ == '__main__':
elif options.command == 'romident': elif options.command == 'romident':
lib.auxverbs.do_romident(options) lib.auxverbs.do_romident(options)
elif options.command == 'serve': elif options.command == 'serve':
lib.wsgiserve.run_server(options) import wsgiref.simple_server
import lib.wsgiserve
application = lib.wsgiserve.MiniMawsApp(options.database)
server = wsgiref.simple_server.make_server(options.host, options.port, application)
try:
server.serve_forever()
except KeyboardInterrupt:
pass
elif options.command == 'load': elif options.command == 'load':
import lib.lxparse
lib.lxparse.load_info(options) lib.lxparse.load_info(options)
else:
application = lib.wsgiserve.MiniMawsApp(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'minimaws.sqlite3'))

View File

@ -0,0 +1,15 @@
#!/usr/bin/python
##
## license:BSD-3-Clause
## copyright-holders:Vas Crabb
##
## Simple script for deploying minimaws with mod_wsgi.
import os.path
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import lib.wsgiserve
application = lib.wsgiserve.MiniMawsApp(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'minimaws.sqlite3'))

View File

@ -893,14 +893,14 @@ void hp9895_device::device_add_mconfig(machine_config &config)
m_cpu->refresh_cb().set(FUNC(hp9895_device::z80_m1_w)); m_cpu->refresh_cb().set(FUNC(hp9895_device::z80_m1_w));
PHI(config, m_phi, 0); PHI(config, m_phi, 0);
m_phi->signal_write_cb<phi_device::PHI_488_EOI>().set(FUNC(hp9895_device::phi_eoi_w)); m_phi->eoi_write_cb().set(FUNC(hp9895_device::phi_eoi_w));
m_phi->signal_write_cb<phi_device::PHI_488_DAV>().set(FUNC(hp9895_device::phi_dav_w)); m_phi->dav_write_cb().set(FUNC(hp9895_device::phi_dav_w));
m_phi->signal_write_cb<phi_device::PHI_488_NRFD>().set(FUNC(hp9895_device::phi_nrfd_w)); m_phi->nrfd_write_cb().set(FUNC(hp9895_device::phi_nrfd_w));
m_phi->signal_write_cb<phi_device::PHI_488_NDAC>().set(FUNC(hp9895_device::phi_ndac_w)); m_phi->ndac_write_cb().set(FUNC(hp9895_device::phi_ndac_w));
m_phi->signal_write_cb<phi_device::PHI_488_IFC>().set(FUNC(hp9895_device::phi_ifc_w)); m_phi->ifc_write_cb().set(FUNC(hp9895_device::phi_ifc_w));
m_phi->signal_write_cb<phi_device::PHI_488_SRQ>().set(FUNC(hp9895_device::phi_srq_w)); m_phi->srq_write_cb().set(FUNC(hp9895_device::phi_srq_w));
m_phi->signal_write_cb<phi_device::PHI_488_ATN>().set(FUNC(hp9895_device::phi_atn_w)); m_phi->atn_write_cb().set(FUNC(hp9895_device::phi_atn_w));
m_phi->signal_write_cb<phi_device::PHI_488_REN>().set(FUNC(hp9895_device::phi_ren_w)); m_phi->ren_write_cb().set(FUNC(hp9895_device::phi_ren_w));
m_phi->dio_read_cb().set(FUNC(hp9895_device::phi_dio_r)); m_phi->dio_read_cb().set(FUNC(hp9895_device::phi_dio_r));
m_phi->dio_write_cb().set(FUNC(hp9895_device::phi_dio_w)); m_phi->dio_write_cb().set(FUNC(hp9895_device::phi_dio_w));
m_phi->int_write_cb().set(FUNC(hp9895_device::phi_int_w)); m_phi->int_write_cb().set(FUNC(hp9895_device::phi_int_w));

View File

@ -19,7 +19,8 @@ public:
phi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); phi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// See ieee488.h // See ieee488.h
enum phi_488_signal_t { enum phi_488_signal_t
{
PHI_488_EOI, PHI_488_EOI,
PHI_488_DAV, PHI_488_DAV,
PHI_488_NRFD, PHI_488_NRFD,
@ -35,7 +36,14 @@ public:
auto dio_read_cb() { return m_dio_read_func.bind(); } auto dio_read_cb() { return m_dio_read_func.bind(); }
auto dio_write_cb() { return m_dio_write_func.bind(); } auto dio_write_cb() { return m_dio_write_func.bind(); }
// Set write callbacks to access uniline signals on IEEE-488 // Set write callbacks to access uniline signals on IEEE-488
template <phi_488_signal_t Signal> auto signal_write_cb() { return m_signal_wr_fns[ Signal ].bind(); } auto eoi_write_cb() { return m_signal_wr_fns[ PHI_488_EOI ].bind(); }
auto dav_write_cb() { return m_signal_wr_fns[ PHI_488_DAV ].bind(); }
auto nrfd_write_cb() { return m_signal_wr_fns[ PHI_488_NRFD ].bind(); }
auto ndac_write_cb() { return m_signal_wr_fns[ PHI_488_NDAC ].bind(); }
auto ifc_write_cb() { return m_signal_wr_fns[ PHI_488_IFC ].bind(); }
auto srq_write_cb() { return m_signal_wr_fns[ PHI_488_SRQ ].bind(); }
auto atn_write_cb() { return m_signal_wr_fns[ PHI_488_ATN ].bind(); }
auto ren_write_cb() { return m_signal_wr_fns[ PHI_488_REN ].bind(); }
// Set write callback for INT signal // Set write callback for INT signal
auto int_write_cb() { return m_int_write_func.bind(); } auto int_write_cb() { return m_int_write_func.bind(); }
// Set write callback for DMARQ signal // Set write callback for DMARQ signal

View File

@ -947,11 +947,11 @@ void fromance_state::nekkyoku(machine_config &config)
void fromance_state::idolmj(machine_config &config) void fromance_state::idolmj(machine_config &config)
{ {
/* basic machine hardware */ /* basic machine hardware */
Z80(config, m_maincpu, XTAL(12'000'000) / 2); /* 6.00 Mhz ? */ Z80(config, m_maincpu, 12_MHz_XTAL / 2); /* 6.00 Mhz ? */
m_maincpu->set_addrmap(AS_PROGRAM, &fromance_state::fromance_main_map); m_maincpu->set_addrmap(AS_PROGRAM, &fromance_state::fromance_main_map);
m_maincpu->set_vblank_int("screen", FUNC(fromance_state::irq0_line_hold)); m_maincpu->set_vblank_int("screen", FUNC(fromance_state::irq0_line_hold));
Z80(config, m_subcpu, XTAL(12'000'000) / 2); /* 6.00 Mhz ? */ Z80(config, m_subcpu, 12_MHz_XTAL / 2); /* 6.00 Mhz ? */
m_subcpu->set_addrmap(AS_PROGRAM, &fromance_state::fromance_sub_map); m_subcpu->set_addrmap(AS_PROGRAM, &fromance_state::fromance_sub_map);
m_subcpu->set_addrmap(AS_IO, &fromance_state::idolmj_sub_io_map); m_subcpu->set_addrmap(AS_IO, &fromance_state::idolmj_sub_io_map);
@ -980,7 +980,7 @@ void fromance_state::idolmj(machine_config &config)
/* sound hardware */ /* sound hardware */
SPEAKER(config, "mono").front_center(); SPEAKER(config, "mono").front_center();
YM2149(config, "aysnd", 12000000/6).add_route(ALL_OUTPUTS, "mono", 0.15); YM2149(config, "aysnd", 12_MHz_XTAL / 6).add_route(ALL_OUTPUTS, "mono", 0.15);
MSM5205(config, m_msm, 384000); MSM5205(config, m_msm, 384000);
m_msm->vck_legacy_callback().set(FUNC(fromance_state::fromance_adpcm_int)); /* IRQ handler */ m_msm->vck_legacy_callback().set(FUNC(fromance_state::fromance_adpcm_int)); /* IRQ handler */

View File

@ -1456,14 +1456,14 @@ void hp64k_state::hp64k(machine_config &config)
m_phi->sys_cntrl_read_cb().set(FUNC(hp64k_state::hp64k_phi_sys_ctrl_r)); m_phi->sys_cntrl_read_cb().set(FUNC(hp64k_state::hp64k_phi_sys_ctrl_r));
m_phi->dio_read_cb().set(IEEE488_TAG, FUNC(ieee488_device::dio_r)); m_phi->dio_read_cb().set(IEEE488_TAG, FUNC(ieee488_device::dio_r));
m_phi->dio_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_dio_w)); m_phi->dio_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_dio_w));
m_phi->signal_write_cb<phi_device::PHI_488_EOI>().set(IEEE488_TAG, FUNC(ieee488_device::host_eoi_w)); m_phi->eoi_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_eoi_w));
m_phi->signal_write_cb<phi_device::PHI_488_DAV>().set(IEEE488_TAG, FUNC(ieee488_device::host_dav_w)); m_phi->dav_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_dav_w));
m_phi->signal_write_cb<phi_device::PHI_488_NRFD>().set(IEEE488_TAG, FUNC(ieee488_device::host_nrfd_w)); m_phi->nrfd_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_nrfd_w));
m_phi->signal_write_cb<phi_device::PHI_488_NDAC>().set(IEEE488_TAG, FUNC(ieee488_device::host_ndac_w)); m_phi->ndac_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ndac_w));
m_phi->signal_write_cb<phi_device::PHI_488_IFC>().set(IEEE488_TAG, FUNC(ieee488_device::host_ifc_w)); m_phi->ifc_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ifc_w));
m_phi->signal_write_cb<phi_device::PHI_488_SRQ>().set(IEEE488_TAG, FUNC(ieee488_device::host_srq_w)); m_phi->srq_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_srq_w));
m_phi->signal_write_cb<phi_device::PHI_488_ATN>().set(IEEE488_TAG, FUNC(ieee488_device::host_atn_w)); m_phi->atn_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_atn_w));
m_phi->signal_write_cb<phi_device::PHI_488_REN>().set(IEEE488_TAG, FUNC(ieee488_device::host_ren_w)); m_phi->ren_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ren_w));
ieee488_device &ieee(IEEE488(config, IEEE488_TAG)); ieee488_device &ieee(IEEE488(config, IEEE488_TAG));
ieee.eoi_callback().set(m_phi, FUNC(phi_device::eoi_w)); ieee.eoi_callback().set(m_phi, FUNC(phi_device::eoi_w));

View File

@ -1464,12 +1464,10 @@ void scramble_state::hotshock(machine_config &config)
m_palette->set_init(FUNC(scramble_state::galaxold_palette)); m_palette->set_init(FUNC(scramble_state::galaxold_palette));
MCFG_VIDEO_START_OVERRIDE(scramble_state,pisces) MCFG_VIDEO_START_OVERRIDE(scramble_state,pisces)
subdevice<ay8910_device>("8910.1")->reset_routes(); subdevice<ay8910_device>("8910.1")->reset_routes().add_route(ALL_OUTPUTS, "mono", 0.33);
subdevice<ay8910_device>("8910.1")->add_route(ALL_OUTPUTS, "mono", 0.33);
subdevice<ay8910_device>("8910.2")->port_a_read_callback().set(FUNC(scramble_state::hotshock_soundlatch_r)); subdevice<ay8910_device>("8910.2")->port_a_read_callback().set(FUNC(scramble_state::hotshock_soundlatch_r));
subdevice<ay8910_device>("8910.2")->reset_routes(); subdevice<ay8910_device>("8910.2")->reset_routes().add_route(ALL_OUTPUTS, "mono", 0.33);
subdevice<ay8910_device>("8910.2")->add_route(ALL_OUTPUTS, "mono", 0.33);
} }
void scramble_state::cavelon(machine_config &config) void scramble_state::cavelon(machine_config &config)
@ -1514,8 +1512,7 @@ void scramble_state::triplep(machine_config &config)
/* sound hardware */ /* sound hardware */
subdevice<ay8910_device>("8910.1")->set_clock(18432000/12); // triple punch/knock out ay clock is 1.535MHz, derived from main cpu xtal; verified on hardware subdevice<ay8910_device>("8910.1")->set_clock(18432000/12); // triple punch/knock out ay clock is 1.535MHz, derived from main cpu xtal; verified on hardware
subdevice<ay8910_device>("8910.1")->reset_routes(); subdevice<ay8910_device>("8910.1")->reset_routes().add_route(ALL_OUTPUTS, "mono", 1.0);
subdevice<ay8910_device>("8910.1")->add_route(ALL_OUTPUTS, "mono", 1.0);
config.device_remove("8910.2"); config.device_remove("8910.2");
} }

View File

@ -153,9 +153,9 @@ void subhuntr_state::subhuntr(machine_config &config)
m_maincpu->set_vblank_int("screen", FUNC(subhuntr_state::subhuntr_interrupt)); m_maincpu->set_vblank_int("screen", FUNC(subhuntr_state::subhuntr_interrupt));
m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank)); m_maincpu->sense_handler().set("screen", FUNC(screen_device::vblank));
s2636_device &s2636(S2636(config, "s2636", 0)); //s2636_device &s2636(S2636(config, "s2636", 0));
s2636.set_offsets(3, -21); //s2636.set_offsets(3, -21);
s2636.add_route(ALL_OUTPUTS, "mono", 0.10); //s2636.add_route(ALL_OUTPUTS, "mono", 0.10);
/* video hardware */ /* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));

View File

@ -556,8 +556,7 @@ void wallc_state::unkitpkr(machine_config &config)
/* sound hardware */ /* sound hardware */
subdevice<ay8912_device>("aysnd")->port_a_read_callback().set_ioport("DSW2"); subdevice<ay8912_device>("aysnd")->port_a_read_callback().set_ioport("DSW2");
subdevice<ay8912_device>("aysnd")->reset_routes(); subdevice<ay8912_device>("aysnd")->reset_routes().add_route(ALL_OUTPUTS, "mono", 0.50);
subdevice<ay8912_device>("aysnd")->add_route(ALL_OUTPUTS, "mono", 0.50);
} }
void wallc_state::sidampkr(machine_config &config) void wallc_state::sidampkr(machine_config &config)