Merge branch 'mamedev:master' into master
Some checks failed
CI (Windows) / build-windows (gcc, gcc-x64, g++, mame, MINGW64, windows-latest, mingw-w64-x86_64, mame) (push) Has been cancelled

This commit is contained in:
holub 2025-04-24 08:21:39 -04:00 committed by GitHub
commit 2069184277
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
78 changed files with 886 additions and 759 deletions

View File

@ -3,7 +3,7 @@
<!--
license:CC0-1.0
-->
<softwarelist name="sgx" description="NEC Supergrafx cartridges">
<softwarelist name="sgx" description="NEC Supergrafx HuCards">
<software name="1941">
<description>1941 - Counter Attack</description>
<year>1991</year>

View File

@ -150,7 +150,11 @@ PLATFORM := x86
else ifeq ($(MSYSTEM),CLANGARM64)
PLATFORM := arm64
else # MSYSTEM
OSARCH := $(shell reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE)
# Get system processor architecture. Note that PROCESSOR_ARCHITECTURE local
# environment variable is for the currently running process, so we go through
# the registry instead.
OSARCH := $(shell reg query "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" -v PROCESSOR_ARCHITECTURE)
ifneq ($(findstring ARM64,$(OSARCH)),)
PLATFORM := arm64
else # OSARCH
@ -327,8 +331,6 @@ else # windows
UNAME := $(shell uname -mps)
TARGETOS := $(OS)
ARCHITECTURE := _x86
ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
ARCHITECTURE := _x64
else ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
@ -341,6 +343,8 @@ else ifeq ($(firstword $(filter powerpc64,$(UNAME))),powerpc64)
ARCHITECTURE := _x64
else ifeq ($(firstword $(filter s390x,$(UNAME))),s390x)
ARCHITECTURE := _x64
else
ARCHITECTURE := _x86
endif
endif # windows

View File

@ -1396,7 +1396,7 @@ project "bimg"
"BX_CONFIG_DEBUG=0",
}
if not string.find(_OPTIONS["gcc"], "clang") then
if _OPTIONS["gcc"]~=nil and not string.find(_OPTIONS["gcc"], "clang") then
-- This is a gross hack. For some reason GitHub Actions MinGW GCC seems to define SSE feature macros for features that are not enabled.
local archopts = (_OPTIONS["ARCHOPTS"] or "") .. " " .. (_OPTIONS["ARCHOPTS_CXX"] or "")
local ssever = "20"

View File

@ -5312,8 +5312,6 @@ if (BUSES["CBUS"]~=null) then
MAME_DIR .. "src/devices/bus/cbus/pc9801_118.h",
MAME_DIR .. "src/devices/bus/cbus/pc9801_cbus.cpp",
MAME_DIR .. "src/devices/bus/cbus/pc9801_cbus.h",
MAME_DIR .. "src/devices/bus/cbus/pc9801_snd.cpp",
MAME_DIR .. "src/devices/bus/cbus/pc9801_snd.h",
MAME_DIR .. "src/devices/bus/cbus/sb16_ct2720.cpp",
MAME_DIR .. "src/devices/bus/cbus/sb16_ct2720.h",
}

View File

@ -50,8 +50,6 @@ function osdmodulesbuild()
}
files {
MAME_DIR .. "src/osd/osdnet.cpp",
MAME_DIR .. "src/osd/osdnet.h",
MAME_DIR .. "src/osd/watchdog.cpp",
MAME_DIR .. "src/osd/watchdog.h",
MAME_DIR .. "src/osd/interface/inputcode.h",
@ -111,6 +109,8 @@ function osdmodulesbuild()
MAME_DIR .. "src/osd/modules/monitor/monitor_module.h",
MAME_DIR .. "src/osd/modules/monitor/monitor_sdl.cpp",
MAME_DIR .. "src/osd/modules/monitor/monitor_win32.cpp",
MAME_DIR .. "src/osd/modules/netdev/netdev_common.cpp",
MAME_DIR .. "src/osd/modules/netdev/netdev_common.h",
MAME_DIR .. "src/osd/modules/netdev/netdev_module.h",
MAME_DIR .. "src/osd/modules/netdev/none.cpp",
MAME_DIR .. "src/osd/modules/netdev/pcap.cpp",

View File

@ -2,21 +2,24 @@
// copyright-holders:Angelo Salese
/**************************************************************************************************
NEC PC-9801-118 sound card "CanBe Sound 2"
NEC PC-9801-118 sound card "CanBe Sound 2"
YMF297 + some extra ports, apparently derived from -86.
Introduced around the same time as Windows 95 release, it has various compatibility issues
under DOS (especially when PnP is enabled).
Doesn't have a sound ROM, it also cannot be installed with an environment also sporting a -86.
References:
- https://sammargh.github.io/pc98/ext_card_doc/9801-118.txt
TODO:
- Fix sound chip type (YMF297-F);
- Add CS-4232 support, it's an extended clone of the already emulated AD1848 used on the
Windows Sound System;
- Understand what the obfuscated NEC "ANCHOR" and "MAZE" chips really are;
- PnP interface (missing BIOS);
- verify sound irq;
- test if driver can be installed under Windows 95;
YMF297 + some extra ports, apparently derived from -86.
Introduced around the same time as Windows 95 release, it has various compatibility issues
under DOS (especially when PnP is enabled).
Doesn't have a sound ROM, it also cannot be installed with an environment also sporting a -86.
TODO:
- Fix sound chip type (YMF297-F);
- Add CS-4232 support, it's an extended clone of the already emulated AD1848 used on the
Windows Sound System;
- Understand what the obfuscated NEC "ANCHOR" and "MAZE" chips really are;
- PnP interface (missing BIOS);
- verify sound irq;
- test if driver can be installed under Windows 95;
**************************************************************************************************/
@ -37,16 +40,6 @@
// device type definition
DEFINE_DEVICE_TYPE(PC9801_118, pc9801_118_device, "pc9801_118", "NEC PC-9801-118")
void pc9801_118_device::sound_irq(int state)
{
// TODO: sometimes misfired irq causes sound or even host hang
m_bus->int_w<5>(state);
}
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void pc9801_118_device::device_add_mconfig(machine_config &config)
{
// TODO: "ANCHOR" & "MAZE" custom NEC chips
@ -58,13 +51,13 @@ void pc9801_118_device::device_add_mconfig(machine_config &config)
// actually YMF297-F (YMF288 + OPL3 compatible FM sources), unknown clock / divider
// 5B is near both CS-4232 and this
YM2608(config, m_opn3, XTAL_5B * 2 / 5);
m_opn3->irq_handler().set(FUNC(pc9801_118_device::sound_irq));
m_opn3->port_a_read_callback().set(FUNC(pc9801_118_device::opn_porta_r));
//m_opn3->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r));
//m_opn3->port_a_write_callback().set(FUNC(pc8801_state::opn_porta_w));
m_opn3->port_b_write_callback().set(FUNC(pc9801_118_device::opn_portb_w));
m_opn3->irq_handler().set([this] (int state) { m_bus->int_w<5>(state); });
// m_opn3->port_a_read_callback().set(FUNC(pc9801_118_device::opn_porta_r));
// m_opn3->port_b_write_callback().set(FUNC(pc9801_118_device::opn_portb_w));
m_opn3->add_route(ALL_OUTPUTS, "lspeaker", 1.00);
m_opn3->add_route(ALL_OUTPUTS, "rspeaker", 1.00);
// TODO: DA-15 PC gameport labeled "MIDI / Joystick"
}
@ -73,8 +66,6 @@ void pc9801_118_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
static INPUT_PORTS_START( pc9801_118 )
PORT_INCLUDE( pc9801_joy_port )
// 12 line Jumper settings @ 8F
// documented at https://sammargh.github.io/pc98/ext_card_doc/9801-118.txt
// TODO: understand how SW can read these
@ -149,35 +140,16 @@ const tiny_rom_entry *pc9801_118_device::device_rom_region() const
//-------------------------------------------------
pc9801_118_device::pc9801_118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pc9801_snd_device(mconfig, PC9801_118, tag, owner, clock),
: device_t(mconfig, PC9801_118, tag, owner, clock),
m_bus(*this, DEVICE_SELF_OWNER),
m_opn3(*this, "opn3")
{
}
//-------------------------------------------------
// device_validity_check - perform validity checks
// on this device
//-------------------------------------------------
void pc9801_118_device::device_validity_check(validity_checker &valid) const
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
u16 pc9801_118_device::read_io_base()
{
// hardwired on this board
return 0x0188;
}
void pc9801_118_device::device_start()
{
m_io_base = read_io_base();
// hardwired on this board
const u16 m_io_base = 0x0188;
m_bus->install_io(0xa460, 0xa463, read8sm_delegate(*this, FUNC(pc9801_118_device::id_r)), write8sm_delegate(*this, FUNC(pc9801_118_device::ext_w)));
m_bus->install_io(
@ -190,17 +162,16 @@ void pc9801_118_device::device_start()
save_item(NAME(m_ext_reg));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pc9801_118_device::device_reset()
{
// TODO: is this enabled or disabled at boot?
m_ext_reg = 1;
}
void pc9801_118_device::device_validity_check(validity_checker &valid) const
{
}
//**************************************************************************
// READ/WRITE HANDLERS

View File

@ -11,10 +11,9 @@
#pragma once
#include "bus/cbus/pc9801_cbus.h"
#include "sound/ymopn.h"
#include "pc9801_snd.h"
#include "pc9801_cbus.h"
//**************************************************************************
// TYPE DEFINITIONS
@ -22,7 +21,7 @@
// ======================> pc9801_118_device
class pc9801_118_device : public pc9801_snd_device
class pc9801_118_device : public device_t
{
public:
// construction/destruction
@ -44,15 +43,14 @@ protected:
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
virtual ioport_constructor device_input_ports() const override ATTR_COLD;
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
virtual u16 read_io_base() override;
private:
required_device<pc9801_slot_device> m_bus;
required_device<ym2608_device> m_opn3;
uint8_t m_ext_reg;
// u16 m_io_base, m_joy_sel;
void sound_irq(int state);
uint8_t m_ext_reg;
};

View File

@ -2,14 +2,14 @@
// copyright-holders:Angelo Salese
/**************************************************************************************************
NEC PC-9801-26 sound card
NEC PC-9801-26 sound card
Legacy sound card for PC-98xx family, composed by a single YM2203
Legacy sound card for PC-98xx family, composed by a single YM2203
TODO:
- verify sound irq;
- understand if dips can be read by SW;
- configurable irq level needs a binding flush in C-bus handling;
TODO:
- DE-9 output writes (cfr. page 419 of PC-9801 Bible, needs software testing the functionality)
- understand if dips can be read by SW;
- configurable irq level needs a binding flush in C-bus handling;
**************************************************************************************************/
@ -25,27 +25,58 @@
//**************************************************************************
// device type definition
DEFINE_DEVICE_TYPE(PC9801_26, pc9801_26_device, "pc9801_26", "NEC PC-9801-26")
DEFINE_DEVICE_TYPE(PC9801_26, pc9801_26_device, "pc9801_26", "NEC PC-9801-26/K")
void pc9801_26_device::sound_irq(int state)
pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, PC9801_26, tag, owner, clock)
, m_bus(*this, DEVICE_SELF_OWNER)
, m_opn(*this, "opn")
, m_joy(*this, "joy_p%u", 1U)
, m_irq_jp(*this, "JP6A1_JP6A3")
{
m_bus->int_w<5>(state);
}
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void pc9801_26_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "mono").front_center();
YM2203(config, m_opn, 15.9744_MHz_XTAL / 4); // divider not verified
m_opn->irq_handler().set(FUNC(pc9801_26_device::sound_irq));
m_opn->port_a_read_callback().set(FUNC(pc9801_26_device::opn_porta_r));
//m_opn->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r));
//m_opn->port_a_write_callback().set(FUNC(pc8801_state::opn_porta_w));
m_opn->port_b_write_callback().set(FUNC(pc9801_26_device::opn_portb_w));
m_opn->irq_handler().set([this] (int state) {
switch(m_int_level & 3)
{
case 0: m_bus->int_w<0>(state); break;
case 1: m_bus->int_w<4>(state); break;
case 2: m_bus->int_w<6>(state); break;
case 3: m_bus->int_w<5>(state); break;
}
});
/*
* xx-- ---- IRSTx interrupt status 0/1
* --xx ---- TRIGx Trigger 1/2
* ---- xxxx <directions>
*/
m_opn->port_a_read_callback().set([this] () {
u8 res = (BIT(m_joy_sel, 7)) ? m_joy[BIT(m_joy_sel, 6)]->read() : 0x3f;
res |= m_int_level << 6;
return (u8)res;
});
/*
* x--- ---- OUTE Output Enable (DDR?)
* -x-- ---- INSL Input Select
* --21 2211 OUTxy x = port / y (2-1) = number (1-3)
*/
m_opn->port_b_write_callback().set([this] (u8 data) {
m_joy_sel = data;
// TODO: guesswork, verify
if (BIT(data, 7))
return;
m_joy[0]->pin_6_w(BIT(~data, 0));
m_joy[0]->pin_7_w(BIT(~data, 1));
m_joy[1]->pin_6_w(BIT(~data, 2));
m_joy[1]->pin_7_w(BIT(~data, 3));
m_joy[0]->pin_8_w(BIT(~data, 4));
m_joy[1]->pin_8_w(BIT(~data, 5));
});
// TODO: verify mixing on HW
// emerald stage 1 BGM uses ch. 3 for bassline, which sounds way more prominent
// than the others combined (0.25 1/4 ratio even?)
@ -53,6 +84,9 @@ void pc9801_26_device::device_add_mconfig(machine_config &config)
m_opn->add_route(1, "mono", 0.50);
m_opn->add_route(2, "mono", 0.50);
m_opn->add_route(3, "mono", 1.00);
MSX_GENERAL_PURPOSE_PORT(config, m_joy[0], msx_general_purpose_port_devices, "joystick");
MSX_GENERAL_PURPOSE_PORT(config, m_joy[1], msx_general_purpose_port_devices, "joystick");
}
// to load a different bios for slots:
@ -77,23 +111,16 @@ const tiny_rom_entry *pc9801_26_device::device_rom_region() const
return ROM_NAME( pc9801_26 );
}
//-------------------------------------------------
// input_ports - device-specific input ports
//-------------------------------------------------
static INPUT_PORTS_START( pc9801_26 )
PORT_INCLUDE( pc9801_joy_port )
// On-board jumpers
// TODO: any way to actually read these from HW?
PORT_START("OPN_JP6A1_JP6A3")
PORT_CONFNAME( 0x03, 0x02, "PC-9801-26: Interrupt level")
PORT_CONFSETTING( 0x00, "IRQ 0" ) // 2-3, 2-3
PORT_CONFSETTING( 0x01, "IRQ 4" ) // 2-3, 1-2
PORT_CONFSETTING( 0x02, "IRQ 5" ) // 1-2, 1-2
PORT_CONFSETTING( 0x03, "IRQ 6" ) // 1-2, 2-3
PORT_START("JP6A1_JP6A3")
PORT_CONFNAME( 0x03, 0x03, "PC-9801-26: Interrupt level")
PORT_CONFSETTING( 0x00, "INT0 (IRQ3)" ) // 2-3, 2-3
PORT_CONFSETTING( 0x02, "INT41 (IRQ10)" ) // 2-3, 1-2
PORT_CONFSETTING( 0x03, "INT5 (IRQ12)" ) // 1-2, 1-2
PORT_CONFSETTING( 0x01, "INT6 (IRQ13)" ) // 1-2, 2-3
PORT_START("OPN_JP6A2")
PORT_START("JP6A2")
PORT_CONFNAME( 0x07, 0x01, "PC-9801-26: Sound ROM address")
PORT_CONFSETTING( 0x00, "0xc8000" ) // 1-10
PORT_CONFSETTING( 0x01, "0xcc000" ) // 2-9
@ -101,7 +128,7 @@ static INPUT_PORTS_START( pc9801_26 )
PORT_CONFSETTING( 0x03, "0xd4000" ) // 4-7
PORT_CONFSETTING( 0x04, "Disable ROM") // 5-6
PORT_START("OPN_JP6A4")
PORT_START("JP6A4")
PORT_CONFNAME( 0x01, 0x01, "PC-9801-26: Port Base" )
PORT_CONFSETTING( 0x00, "0x088" ) // 1-4
PORT_CONFSETTING( 0x01, "0x188" ) // 2-3
@ -112,55 +139,23 @@ ioport_constructor pc9801_26_device::device_input_ports() const
return INPUT_PORTS_NAME( pc9801_26 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// pc9801_26_device - constructor
//-------------------------------------------------
pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pc9801_snd_device(mconfig, PC9801_26, tag, owner, clock)
, m_bus(*this, DEVICE_SELF_OWNER)
, m_opn(*this, "opn")
{
}
//-------------------------------------------------
// device_validity_check - perform validity checks
// on this device
//-------------------------------------------------
void pc9801_26_device::device_validity_check(validity_checker &valid) const
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
u16 pc9801_26_device::read_io_base()
{
return ((ioport("OPN_JP6A4")->read() & 1) << 8) + 0x0088;
return ((ioport("JP6A4")->read() & 1) << 8) + 0x0088;
}
void pc9801_26_device::device_start()
{
m_rom_base = 0;
m_io_base = 0;
save_item(NAME(m_joy_sel));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pc9801_26_device::device_reset()
{
// install the ROM to the physical program space
u8 rom_setting = ioport("OPN_JP6A2")->read() & 7;
u8 rom_setting = ioport("JP6A2")->read() & 7;
static const u32 rom_addresses[8] = { 0xc8000, 0xcc000, 0xd0000, 0xd4000, 0, 0, 0, 0 };
u32 current_rom = rom_addresses[rom_setting & 7];
memory_region *rom_region = memregion(this->subtag("sound_bios").c_str());
@ -198,9 +193,12 @@ void pc9801_26_device::device_reset()
);
m_io_base = current_io;
// install IRQ line
// static const u8 irq_levels[4] = {0, 4, 5, 6};
// m_irq_level = irq_levels[ioport("OPN_JP6A1_JP6A3")->read() & 3];
// read INT line
m_int_level = m_irq_jp->read() & 3;
}
void pc9801_26_device::device_validity_check(validity_checker &valid) const
{
}

View File

@ -11,9 +11,10 @@
#pragma once
#include "bus/cbus/pc9801_cbus.h"
#include "pc9801_cbus.h"
#include "bus/msx/ctrl/ctrl.h"
#include "sound/ymopn.h"
#include "pc9801_snd.h"
//**************************************************************************
// TYPE DEFINITIONS
@ -21,7 +22,7 @@
// ======================> pc9801_26_device
class pc9801_26_device : public pc9801_snd_device
class pc9801_26_device : public device_t
{
public:
// construction/destruction
@ -39,14 +40,18 @@ protected:
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
virtual ioport_constructor device_input_ports() const override ATTR_COLD;
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
virtual u16 read_io_base() override;
u16 read_io_base();
private:
required_device<pc9801_slot_device> m_bus;
required_device<ym2203_device> m_opn;
required_device_array<msx_general_purpose_port_device, 2U> m_joy;
required_ioport m_irq_jp;
void sound_irq(int state);
u32 m_rom_base;
u16 m_io_base;
u8 m_joy_sel;
u8 m_int_level;
};

View File

@ -38,24 +38,30 @@ TODO:
#define QUEUE_SIZE 32768
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
// device type definition
DEFINE_DEVICE_TYPE(PC9801_86, pc9801_86_device, "pc9801_86", "NEC PC-9801-86")
DEFINE_DEVICE_TYPE(PC9801_SPEAKBOARD, pc9801_speakboard_device, "pc9801_spb", "NEC PC-9801 SpeakBoard")
DEFINE_DEVICE_TYPE(OTOMICHAN_KAI, otomichan_kai_device, "pc98_otomichan_kai", "MAD Factory Otomi-chan Kai") // 音美(おとみ)ちゃん改
// only for derived designs?
void pc9801_86_device::opna_map(address_map &map)
pc9801_86_device::pc9801_86_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
, m_bus(*this, DEVICE_SELF_OWNER)
, m_opna(*this, "opna")
, m_irqs(*this, "irqs")
, m_ldac(*this, "ldac")
, m_rdac(*this, "rdac")
, m_queue(QUEUE_SIZE)
, m_joy(*this, "joy_port")
{
// TODO: confirm it really is ROMless
// TODO: confirm size
map(0x000000, 0x1fffff).ram();
}
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
pc9801_86_device::pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pc9801_86_device(mconfig, PC9801_86, tag, owner, clock)
{
}
void pc9801_86_device::pc9801_86_config(machine_config &config)
{
@ -76,17 +82,26 @@ void pc9801_86_device::pc9801_86_config(machine_config &config)
// shouldn't have one
// m_opna->set_addrmap(0, &pc9801_86_device::opna_map);
m_opna->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>));
m_opna->port_a_read_callback().set(FUNC(pc9801_86_device::opn_porta_r));
//m_opna->port_b_read_callback().set(FUNC(pc8801_state::opn_portb_r));
//m_opna->port_a_write_callback().set(FUNC(pc8801_state::opn_porta_w));
m_opna->port_b_write_callback().set(FUNC(pc9801_86_device::opn_portb_w));
m_opna->add_route(0, "lspeaker", 1.00);
m_opna->add_route(0, "rspeaker", 1.00);
m_opna->port_a_read_callback().set([this] () {
if((m_joy_sel & 0xc0) == 0x80)
return m_joy->read();
return (u8)0xff;
});
m_opna->port_b_write_callback().set([this] (u8 data) {
m_joy_sel = data;
});
// TODO: confirm mixing
m_opna->add_route(0, "lspeaker", 0.75);
m_opna->add_route(0, "rspeaker", 0.75);
m_opna->add_route(1, "lspeaker", 1.00);
m_opna->add_route(2, "rspeaker", 1.00);
DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_ldac, 0).add_route(ALL_OUTPUTS, "lspeaker", 1.0); // burr brown pcm61p
DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_rdac, 0).add_route(ALL_OUTPUTS, "rspeaker", 1.0); // burr brown pcm61p
// NOTE: 1 DE-9 port only
MSX_GENERAL_PURPOSE_PORT(config, m_joy, msx_general_purpose_port_devices, "joystick");
}
void pc9801_86_device::device_add_mconfig(machine_config &config)
@ -98,8 +113,8 @@ void pc9801_86_device::device_add_mconfig(machine_config &config)
void pc9801_86_device::opna_reset_routes_config(machine_config &config)
{
m_opna->reset_routes();
m_opna->add_route(0, "lspeaker", 0.50);
m_opna->add_route(0, "rspeaker", 0.50);
m_opna->add_route(0, "lspeaker", 0.125);
m_opna->add_route(0, "rspeaker", 0.125);
m_opna->add_route(1, "lspeaker", 0.50);
m_opna->add_route(2, "rspeaker", 0.50);
}
@ -131,8 +146,6 @@ const tiny_rom_entry *pc9801_86_device::device_rom_region() const
//-------------------------------------------------
static INPUT_PORTS_START( pc9801_86 )
PORT_INCLUDE( pc9801_joy_port )
// Single 8-bit DSW bank
PORT_START("OPNA_DSW")
PORT_DIPNAME( 0x01, 0x00, "PC-9801-86: Port Base" ) PORT_DIPLOCATION("OPNA_SW:!1")
@ -166,29 +179,12 @@ ioport_constructor pc9801_86_device::device_input_ports() const
return INPUT_PORTS_NAME( pc9801_86 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// pc9801_86_device - constructor
//-------------------------------------------------
pc9801_86_device::pc9801_86_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: pc9801_snd_device(mconfig, type, tag, owner, clock)
, m_bus(*this, DEVICE_SELF_OWNER)
, m_opna(*this, "opna")
, m_irqs(*this, "irqs")
, m_ldac(*this, "ldac")
, m_rdac(*this, "rdac")
, m_queue(QUEUE_SIZE)
// only for derived designs?
void pc9801_86_device::opna_map(address_map &map)
{
}
pc9801_86_device::pc9801_86_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pc9801_86_device(mconfig, PC9801_86, tag, owner, clock)
{
// TODO: confirm it really is ROMless
// TODO: confirm size
map(0x000000, 0x1fffff).ram();
}
//-------------------------------------------------
@ -205,10 +201,6 @@ u16 pc9801_86_device::read_io_base()
return ((ioport("OPNA_DSW")->read() & 1) << 8) + 0x188;
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pc9801_86_device::device_start()
{
// TODO: uninstall option from dip
@ -239,11 +231,6 @@ void pc9801_86_device::device_start()
save_item(NAME(m_irq_rate));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pc9801_86_device::device_reset()
{
u16 current_io = read_io_base();
@ -499,8 +486,6 @@ TIMER_CALLBACK_MEMBER(pc9801_86_device::dac_tick)
//
//**************************************************************************
DEFINE_DEVICE_TYPE(PC9801_SPEAKBOARD, pc9801_speakboard_device, "pc9801_spb", "NEC PC-9801 SpeakBoard")
ROM_START( pc9801_spb )
ROM_REGION( 0x4000, "sound_bios", ROMREGION_ERASEFF )
ROM_LOAD16_BYTE( "spb lh5764 ic21_pink.bin", 0x0001, 0x2000, CRC(5bcefa1f) SHA1(ae88e45d411bf5de1cb42689b12b6fca0146c586) )
@ -570,8 +555,6 @@ void pc9801_speakboard_device::opna_slave_w(offs_t offset, u8 data)
//
//**************************************************************************
DEFINE_DEVICE_TYPE(OTOMICHAN_KAI, otomichan_kai_device, "pc98_otomichan_kai", "MAD Factory Otomi-chan Kai") // 音美(おとみ)ちゃん改
otomichan_kai_device::otomichan_kai_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pc9801_86_device(mconfig, OTOMICHAN_KAI, tag, owner, clock)
, m_opn2c(*this, "opn2c")

View File

@ -11,20 +11,20 @@
#pragma once
#include "bus/cbus/pc9801_cbus.h"
#include "pc9801_cbus.h"
#include "bus/msx/ctrl/ctrl.h"
#include "machine/input_merger.h"
#include "sound/dac.h"
#include "sound/ymopn.h"
#include "pc9801_snd.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> pc9801_86_device
class pc9801_86_device : public pc9801_snd_device
class pc9801_86_device : public device_t
{
public:
// construction/destruction
@ -49,7 +49,7 @@ protected:
virtual ioport_constructor device_input_ports() const override ATTR_COLD;
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
void pc9801_86_config(machine_config &config);
virtual u16 read_io_base() override;
u16 read_io_base();
TIMER_CALLBACK_MEMBER(dac_tick);
@ -76,9 +76,14 @@ private:
required_device<dac_16bit_r2r_twos_complement_device> m_ldac;
required_device<dac_16bit_r2r_twos_complement_device> m_rdac;
std::vector<u8> m_queue;
required_device<msx_general_purpose_port_device> m_joy;
emu_timer *m_dac_timer;
void dac_transfer();
u8 m_joy_sel;
u16 m_io_base;
};
class pc9801_speakboard_device : public pc9801_86_device

View File

@ -1,48 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
/***************************************************************************
NEC PC-9801
common functions for C-bus sound boards -26, -86, -118
***************************************************************************/
#include "emu.h"
#include "pc9801_snd.h"
pc9801_snd_device::pc9801_snd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
{
}
u8 pc9801_snd_device::opn_porta_r()
{
if(m_joy_sel & 0x80)
return ioport(m_joy_sel & 0x40 ? "PA2" : "PA1")->read();
return 0xff;
}
void pc9801_snd_device::opn_portb_w(u8 data) { m_joy_sel = data; }
INPUT_PORTS_START(pc9801_joy_port)
PORT_START("PA1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Up")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Down")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Left")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Right")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("PA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Down")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Left")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Right")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END

View File

@ -1,33 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Angelo Salese
/***************************************************************************
NEC PC-9801
common functions for CBUS sound boards -26, -86, -118
***************************************************************************/
#ifndef MAME_BUS_CBUS_PC9801_SND_H
#define MAME_BUS_CBUS_PC9801_SND_H
#pragma once
class pc9801_snd_device : public device_t
{
public:
pc9801_snd_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
protected:
u8 opn_porta_r();
void opn_portb_w(u8 data);
u16 m_io_base;
virtual u16 read_io_base() = 0;
private:
u8 m_joy_sel;
};
//DECLARE_DEVICE_TYPE(PC9801_SND, pc9801_snd_device)
INPUT_PORTS_EXTERN(pc9801_joy_port);
#endif

View File

@ -50,8 +50,8 @@ void pc8801_23_device::device_add_mconfig(machine_config &config)
// m_opna->port_a_read_callback().set(FUNC(pc8801_23_device::opn_porta_r));
// m_opna->port_b_read_callback().set_ioport("OPN_PB");
// TODO: per-channel mixing is unconfirmed
m_opna->add_route(0, "^^lspeaker", 0.25);
m_opna->add_route(0, "^^rspeaker", 0.25);
m_opna->add_route(0, "^^lspeaker", 0.75);
m_opna->add_route(0, "^^rspeaker", 0.75);
m_opna->add_route(1, "^^lspeaker", 0.75);
m_opna->add_route(2, "^^rspeaker", 0.75);
}

View File

@ -308,11 +308,6 @@ protected:
// wants SSG streams first; to do this, we rotate the outputs
// by the number of SSG output channels
parent::update_internal(outputs, ChipClass::SSG_OUTPUTS);
// for the single-output case, also apply boost the gain to better match
// previous version, which summed instead of averaged the outputs
if (ChipClass::SSG_OUTPUTS == 1)
outputs[0].apply_gain(3.0);
}
};

View File

@ -69,7 +69,6 @@ public:
set_screen(std::forward<T>(screen_tag));
}
template <typename... T> void set_display_pixels(T &&... args) { m_display_cb.set(std::forward<T>(args)...); }
template <typename... T> void set_draw_text(T &&... args) { m_draw_text_cb.set(std::forward<T>(args)...); }
@ -233,6 +232,13 @@ public:
// construction/destruction
upd7220a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <typename T>
upd7220a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&screen_tag)
: upd7220a_device(mconfig, tag, owner, clock)
{
set_screen(std::forward<T>(screen_tag));
}
protected:
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;

View File

@ -4,7 +4,7 @@
#include "emu.h"
#include "dinetwork.h"
#include "osdnet.h"
#include "osdepend.h"
#include <algorithm>
@ -143,7 +143,7 @@ void device_network_interface::set_interface(int id)
if (m_dev)
stop_net_device();
m_dev.reset(open_netdev(id, *this));
m_dev = device().machine().osd().open_network_device(id, *this);
if (m_dev)
{
if (!m_loopback_control)

View File

@ -6,8 +6,6 @@
#include "interface/nethandler.h"
class osd_network_device;
class device_network_interface : public device_interface, public osd::network_handler
{
public:
@ -51,7 +49,7 @@ private:
void start_net_device();
void stop_net_device();
std::unique_ptr<osd_network_device> m_dev;
std::unique_ptr<osd::network_device> m_dev;
emu_timer *m_poll_timer;
emu_timer *m_send_timer;
emu_timer *m_recv_timer;

View File

@ -20,7 +20,6 @@
#include "infoxml.h"
#include "mame.h"
#include "osdnet.h"
#include "mameopts.h"
#include "pluginopts.h"
#include "dinetwork.h"
@ -29,6 +28,8 @@
#include "romload.h"
#include "uiinput.h"
#include "osdepend.h"
#include "path.h"
#include <algorithm>
@ -172,17 +173,17 @@ void menu_network_devices::populate()
for (device_network_interface &network : network_interface_enumerator(machine().root_device()))
{
int curr = network.get_interface();
const char *title = nullptr;
for (auto &entry : get_netdev_list())
std::string_view title;
for (auto &entry : machine().osd().list_network_devices())
{
if (entry->id == curr)
if (entry.id == curr)
{
title = entry->description;
title = entry.description;
break;
}
}
item_append(network.device().tag(), title ? title : "------", FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, (void *)&network);
item_append(network.device().tag(), std::string(!title.empty() ? title : "------"), FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, (void *)&network);
}
item_append(menu_item_type::SEPARATOR);
@ -200,30 +201,34 @@ bool menu_network_devices::handle(event const *ev)
}
else if (ev->iptkey == IPT_UI_LEFT || ev->iptkey == IPT_UI_RIGHT)
{
// FIXME: this conflates presumably arbitrary interface ID numbers with 0-based indices
device_network_interface *const network = (device_network_interface *)ev->itemref;
auto const &interfaces = get_netdev_list();
auto const interfaces = machine().osd().list_network_devices();
int curr = network->get_interface();
auto const found = std::find_if(
std::begin(interfaces),
std::end(interfaces),
[curr] (osd::network_device_info const &info) { return info.id == curr; });
auto index = std::distance(interfaces.begin(), found);
if (ev->iptkey == IPT_UI_LEFT)
curr--;
else
curr++;
if (curr == -2)
curr = interfaces.size() - 1;
network->set_interface(curr);
--index;
else if (std::end(interfaces) == found)
index = 0;
else if (std::size(interfaces) <= ++index)
index = -1;
network->set_interface((0 <= index) ? interfaces[index].id : -1);
curr = network->get_interface();
const char *title = nullptr;
std::string_view title;
for (auto &entry : interfaces)
{
if (entry->id == curr)
if (entry.id == curr)
{
title = entry->description;
title = entry.description;
break;
}
}
ev->item->set_subtext(title ? title : "------");
ev->item->set_subtext(!title.empty() ? title : "------");
return true;
}
else

View File

@ -3621,6 +3621,79 @@ ROM_START( tattass )
ROM_LOAD32_WORD( "pp44.cpu", 0x000000, 0x80000, CRC(c3ca5b49) SHA1(c6420b0c20df1ae166b279504880ade65b1d8048) )
ROM_LOAD32_WORD( "pp45.cpu", 0x000002, 0x80000, CRC(d3f30de0) SHA1(5a0aa0f96d29299b3b337b4b51bc84e447eb74d0) )
ROM_REGION(0x10000, "decobsmt:soundcpu", 0 ) // Sound CPU
ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(a7228077) SHA1(4d01575e51958a4d4686968008f5ed0a46380d70) )
ROM_REGION( 0x200000, "tiles1", 0 )
ROM_LOAD16_BYTE( "abak_b01.s02", 0x000000, 0x80000, CRC(bc805680) SHA1(ccdbca23fc843ef82a3524020999542f43b3c618) )
ROM_LOAD16_BYTE( "abak_b01.s13", 0x000001, 0x80000, CRC(350effcd) SHA1(0452d95be9fc28bd00d846a2cc5828899d69601e) )
ROM_LOAD16_BYTE( "abak_b23.s02", 0x100000, 0x80000, CRC(91abdc21) SHA1(ba08e59bc0417e863d35ea295cf58cfe8faf57b5) )
ROM_LOAD16_BYTE( "abak_b23.s13", 0x100001, 0x80000, CRC(80eb50fe) SHA1(abfe1a5417ceff9d6d52372d11993bf9b1db9432) )
ROM_REGION( 0x200000, "tiles2", 0 )
ROM_LOAD16_BYTE( "bbak_b01.s02", 0x000000, 0x80000, CRC(611be9a6) SHA1(86263c8beb562e0607a65aa30fbbe030a044cd75) )
ROM_LOAD16_BYTE( "bbak_b01.s13", 0x000001, 0x80000, CRC(097e0604) SHA1(6ae241b37b6bb15fc66679cf66f500b8f8a19f44) )
ROM_LOAD16_BYTE( "bbak_b23.s02", 0x100000, 0x80000, CRC(3836531a) SHA1(57bead820ac396ee0ed8fb2ac5c15929896d75bf) )
ROM_LOAD16_BYTE( "bbak_b23.s13", 0x100001, 0x80000, CRC(1210485a) SHA1(9edc4c96f389e231066ef164a7b2851cd7ade038) )
ROM_REGION( 0xa00000, "sprites1", 0 )
ROM_LOAD40_BYTE( "ob1_c0.b0", 0x000004, 0x80000, CRC(053fecca) SHA1(319efc71042238d9012d2c3dddab9d11205decc6) )
ROM_LOAD40_BYTE( "ob1_c1.b0", 0x000003, 0x80000, CRC(e183e6bc) SHA1(d9cce277861967f403a882879e1baefa84696bdc) )
ROM_LOAD40_BYTE( "ob1_c2.b0", 0x000002, 0x80000, CRC(1314f828) SHA1(6a91543d4e70af30de287ba775c69ffb1cde719d) )
ROM_LOAD40_BYTE( "ob1_c3.b0", 0x000001, 0x80000, CRC(c63866df) SHA1(a897835d8a33002f1bd54f27d1a6393c4e1864b9) )
ROM_LOAD40_BYTE( "ob1_c4.b0", 0x000000, 0x80000, CRC(f71cdd1b) SHA1(6fbccdbe460c8ddfeed972ebe766a6f8a2d4c466) )
ROM_LOAD40_BYTE( "ob1_c0.b1", 0x280004, 0x80000, CRC(385434b0) SHA1(ea764bd9844e13f5b10207022135dbe07bf0258a) )
ROM_LOAD40_BYTE( "ob1_c1.b1", 0x280003, 0x80000, CRC(0a3ec489) SHA1(1a2e1252d6acda43019ded5a31ae60bef40e4bd9) )
ROM_LOAD40_BYTE( "ob1_c2.b1", 0x280002, 0x80000, CRC(52f06081) SHA1(c630f45b110b9423dfb0bf92359fdb28b75c8cf1) )
ROM_LOAD40_BYTE( "ob1_c3.b1", 0x280001, 0x80000, CRC(a8a5cfbe) SHA1(7afc8f7c7f3826a276e4840e4fc8b8bb645dd3bd) )
ROM_LOAD40_BYTE( "ob1_c4.b1", 0x280000, 0x80000, CRC(09d0acd6) SHA1(1b162f5b76852e49ae6a24db2031d66ca59d87e9) )
ROM_LOAD40_BYTE( "ob1_c0.b2", 0x500004, 0x80000, CRC(946e9f59) SHA1(46a0d35641b381fe553caa00451c30f1950b5dfd) )
ROM_LOAD40_BYTE( "ob1_c1.b2", 0x500003, 0x80000, CRC(9f66ad54) SHA1(6e6ac6edee2f2dda46e7cd85db8d79c8335c73cd) )
ROM_LOAD40_BYTE( "ob1_c2.b2", 0x500002, 0x80000, CRC(a8df60eb) SHA1(c971e66eec6accccaf2bdd87dde7adde79322da9) )
ROM_LOAD40_BYTE( "ob1_c3.b2", 0x500001, 0x80000, CRC(a1a753be) SHA1(1666a32bb69db36dba029a835592d00a21ad8c5e) )
ROM_LOAD40_BYTE( "ob1_c4.b2", 0x500000, 0x80000, CRC(b65b3c4b) SHA1(f636a682b506e3ce5ca07ba8fd3166158d1ab667) )
ROM_LOAD40_BYTE( "ob1_c0.b3", 0x780004, 0x80000, CRC(cbbbc696) SHA1(6f2383655461ac35f3178e0f7c0146cff89c8295) )
ROM_LOAD40_BYTE( "ob1_c1.b3", 0x780003, 0x80000, CRC(f7b1bdee) SHA1(1d505d8d4ede55246de0b5fbc6ca20f836699b60) )
ROM_LOAD40_BYTE( "ob1_c2.b3", 0x780002, 0x80000, CRC(97815619) SHA1(b1b694310064971aa5438671d0f9992b7e4bf277) )
ROM_LOAD40_BYTE( "ob1_c3.b3", 0x780001, 0x80000, CRC(fc3ccb7a) SHA1(4436fcbd830912589bd6c838eb63b7d41a2bb56e) )
ROM_LOAD40_BYTE( "ob1_c4.b3", 0x780000, 0x80000, CRC(dfdfd0ff) SHA1(79dc686351d41d635359936efe97c7ade305dc84) )
ROM_REGION( 0x800000, "sprites2", 0 )
ROM_LOAD16_BYTE( "ob2_c0.b0", 0x000000, 0x80000, CRC(9080ebe4) SHA1(1cfabe045532e16f203fe054449149451a280f56) )
ROM_LOAD16_BYTE( "ob2_c1.b0", 0x000001, 0x80000, CRC(c0464970) SHA1(2bd87c9a7ed0742a8f1ee0c0de225e18a0351168) )
ROM_LOAD16_BYTE( "ob2_c2.b0", 0x400000, 0x80000, CRC(35a2e621) SHA1(ff7687e30c379cbcee4f80c0c737cef891509881) )
ROM_LOAD16_BYTE( "ob2_c3.b0", 0x400001, 0x80000, CRC(99c7cc2d) SHA1(c761e5b7f1e2afdafef36390f7141ebcb5e8f254) )
ROM_LOAD16_BYTE( "ob2_c0.b1", 0x100000, 0x80000, CRC(2c2c15c9) SHA1(fdc48fab6dad97d16d4e77479fa77bb320eb3767) )
ROM_LOAD16_BYTE( "ob2_c1.b1", 0x100001, 0x80000, CRC(d2c49a14) SHA1(49d92233d6d5f77fbbf9d31607c568efef6d94f0) )
ROM_LOAD16_BYTE( "ob2_c2.b1", 0x500000, 0x80000, CRC(fbe957e8) SHA1(4f0bb0e434771316bcd8796878ffd3e5cafebb2b) )
ROM_LOAD16_BYTE( "ob2_c3.b1", 0x500001, 0x80000, CRC(d7238829) SHA1(6fef08a518be69251852d3204413b4b8b6615be2) )
ROM_LOAD16_BYTE( "ob2_c0.b2", 0x200000, 0x80000, CRC(aefa1b01) SHA1(bbd4b432b36d64f80065c56559ea9675acf3151e) )
ROM_LOAD16_BYTE( "ob2_c1.b2", 0x200001, 0x80000, CRC(4af620ca) SHA1(f3753235b2e72f011c9b94f26a425b9a79577201) )
ROM_LOAD16_BYTE( "ob2_c2.b2", 0x600000, 0x80000, CRC(8e58be07) SHA1(d8a8662e800da0892d70c628de0ca27ff983006c) )
ROM_LOAD16_BYTE( "ob2_c3.b2", 0x600001, 0x80000, CRC(1b5188c5) SHA1(4792a36b889a2c2dfab9ec78d848d3d8bf10d20f) )
ROM_LOAD16_BYTE( "ob2_c0.b3", 0x300000, 0x80000, CRC(a2a5dafd) SHA1(2baadcfe9ae8fa30ae4226caa10fe3d58f8af3e0) )
ROM_LOAD16_BYTE( "ob2_c1.b3", 0x300001, 0x80000, CRC(6f0afd05) SHA1(6a4bf3466a77d14b3bc18377537f86108774badd) )
ROM_LOAD16_BYTE( "ob2_c2.b3", 0x700000, 0x80000, CRC(90fe5f4f) SHA1(2149e9eae152556c632ebd4d0b2de49e40916a77) )
ROM_LOAD16_BYTE( "ob2_c3.b3", 0x700001, 0x80000, CRC(e3517e6e) SHA1(68ac60570423d8f0d7cff3db1901c9c050d0be91) )
ROM_REGION(0x1000000, "decobsmt:bsmt", 0 )
ROM_LOAD( "u17.snd", 0x000000, 0x80000, CRC(49303539) SHA1(3c4b6bbdcb039e355b66f72ed5ffe0bbd363f179) )
ROM_LOAD( "u21.snd", 0x080000, 0x80000, CRC(0ad8bc18) SHA1(b06654e682080b3baeb7872d3c4eb3a04b22d79b) )
ROM_LOAD( "u36.snd", 0x100000, 0x80000, CRC(f558947b) SHA1(57c0dc2e23beb388c1cf10a175be7dabf07da458) )
ROM_LOAD( "u37.snd", 0x180000, 0x80000, CRC(7a3190bc) SHA1(e78b77268e5aa2879e7dcb5e8ff9e5dbed228cb1) )
ROM_REGION( 0x400, "eeprom", 0 )
ROM_LOAD( "eeprom-tattass.bin", 0x0000, 0x0400, CRC(7140f40c) SHA1(4fb7897933046b6adaf00b4626d5fd23d0e8a666) )
ROM_END
ROM_START( tattasso )
ROM_REGION(0x100000, "maincpu", 0 ) // ARM 32 bit code
ROM_LOAD32_WORD( "pp44.cpu", 0x000000, 0x80000, CRC(c3ca5b49) SHA1(c6420b0c20df1ae166b279504880ade65b1d8048) )
ROM_LOAD32_WORD( "pp45.cpu", 0x000002, 0x80000, CRC(d3f30de0) SHA1(5a0aa0f96d29299b3b337b4b51bc84e447eb74d0) )
ROM_REGION(0x10000, "decobsmt:soundcpu", 0 ) // Sound CPU
ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(6947be8a) SHA1(4ac6c3c7f54501f23c434708cea6bf327bc8cf95) )
@ -3695,7 +3768,7 @@ ROM_START( tattassa )
ROM_LOAD32_WORD( "rev232a.001", 0x000002, 0x80000, CRC(550245d4) SHA1(c1b2b31768da9becebd907a8622d05aa68ecaa29) )
ROM_REGION(0x10000, "decobsmt:soundcpu", 0 ) // Sound CPU
ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(6947be8a) SHA1(4ac6c3c7f54501f23c434708cea6bf327bc8cf95) )
ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(a7228077) SHA1(4d01575e51958a4d4686968008f5ed0a46380d70) )
ROM_REGION( 0x200000, "tiles1", 0 )
ROM_LOAD16_BYTE( "abak_b01.s02", 0x000000, 0x80000, CRC(bc805680) SHA1(ccdbca23fc843ef82a3524020999542f43b3c618) )
@ -3753,10 +3826,10 @@ ROM_START( tattassa )
ROM_LOAD16_BYTE( "ob2_c3.b3", 0x700001, 0x80000, CRC(e3517e6e) SHA1(68ac60570423d8f0d7cff3db1901c9c050d0be91) )
ROM_REGION(0x1000000, "decobsmt:bsmt", 0 )
ROM_LOAD( "u17.snd", 0x000000, 0x80000, CRC(b945c18d) SHA1(6556bbb4a7057df3680132f24687fa944006c784) )
ROM_LOAD( "u21.snd", 0x080000, 0x80000, CRC(10b2110c) SHA1(83e5938ed22da2874022e1dc8df76c72d95c448d) )
ROM_LOAD( "u36.snd", 0x100000, 0x80000, CRC(3b73abe2) SHA1(195096e2302e84123b23b4ccd982fb3ab9afe42c) )
ROM_LOAD( "u37.snd", 0x180000, 0x80000, CRC(986066b5) SHA1(9dd1a14de81733617cf51293674a8e26fc5cec68) )
ROM_LOAD( "u17.snd", 0x000000, 0x80000, CRC(49303539) SHA1(3c4b6bbdcb039e355b66f72ed5ffe0bbd363f179) )
ROM_LOAD( "u21.snd", 0x080000, 0x80000, CRC(0ad8bc18) SHA1(b06654e682080b3baeb7872d3c4eb3a04b22d79b) )
ROM_LOAD( "u36.snd", 0x100000, 0x80000, CRC(f558947b) SHA1(57c0dc2e23beb388c1cf10a175be7dabf07da458) )
ROM_LOAD( "u37.snd", 0x180000, 0x80000, CRC(7a3190bc) SHA1(e78b77268e5aa2879e7dcb5e8ff9e5dbed228cb1) )
ROM_REGION( 0x400, "eeprom", 0 )
ROM_LOAD( "eeprom-tattass.bin", 0x0000, 0x0400, CRC(7140f40c) SHA1(4fb7897933046b6adaf00b4626d5fd23d0e8a666) )
@ -3963,6 +4036,7 @@ GAME( 1994, nslashers, nslasher, nslasher, nslasher, nslasher_state, init_nsla
GAME( 1994, nslasheru, nslasher, nslasheru, nslasher, nslasher_state, init_nslasher, ROT0, "Data East Corporation", "Night Slashers (US Rev 1.2, DE-0395-1 PCB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1994, tattass, 0, tattass, tattass, tattass_state, init_tattass, ROT0, "Data East Pinball", "Tattoo Assassins (US prototype, Mar 14 1995)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1994, tattasso, tattass, tattass, tattass, tattass_state, init_tattass, ROT0, "Data East Pinball", "Tattoo Assassins (US prototype, Mar 14 1995, older sound)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1994, tattassa, tattass, tattass, tattass, tattass_state, init_tattass, ROT0, "Data East Pinball", "Tattoo Assassins (Asia prototype, Mar 14 1995)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
// Dragon Gun / Locked 'n Loaded have very different sprite hardware

View File

@ -21657,8 +21657,19 @@ ROM_START( fl7_tw ) // Serial 00000050E9B7.
ROM_END
// PCB pic is blurred, but main components appear to be: TMPZ84C00AP-8, Winbond WF19054, 5 8-dip banks (dip sheet available)
// it's a 3-reel 5-liner with an extra reel. Puts PATRICK SHANGHAI in NVRAM, so some kind of hack / bootleg
/*
Super Shanghai 2001
it's a 3-reel 5-liner with an extra reel.
Puts PATRICK SHANGHAI in NVRAM, so some kind of hack / bootleg
PCB pic is blurred, but main components appear to be:
TMPZ84C00AP-8,
Winbond WF19054,
5 8-dip banks (dip sheet available)
*/
ROM_START( ss2001 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "9.u26", 0x00000, 0x10000, CRC(9ddb0239) SHA1(15733481996de9becccd5b920e40220c6101becf) )
@ -21685,6 +21696,64 @@ ROM_START( ss2001 )
ROM_LOAD( "d27hc65d.bin", 0x0000, 0x02000, CRC(af8ce88d) SHA1(59d59b6b739aed4f6ee618db04af9ab9d2873bed) ) // colour data is at 0x1800-0x18ff
ROM_END
/*
Super Shanghai 2000
PCB pic is blurred, but main components appear to be:
Zilog Z80,
Winbond WF19054,
5 8-dip banks (dip sheet available)
*/
ROM_START( ss2000 ) // main program (green board)
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "main_program_set_2_green_board.bin", 0x00000, 0x10000, CRC(a5017fa0) SHA1(af985a15fe2c6195b3310ece8dc9e431d1b8c673) )
ROM_REGION( 0x80000, "gfx", 0 ) // all 27c512, same gfx set as ss2001 but half sized roms
ROM_LOAD( "rom1_m27c512.u1", 0x00000, 0x10000, CRC(52d1914b) SHA1(f8e5e7ba8809006e4109b82dd84e019d0d1e5447) )
ROM_LOAD( "rom2_m27c512.u2", 0x10000, 0x10000, CRC(d5d50ef8) SHA1(60016d62922b369ce78130b8a94d967585657cd1) )
ROM_LOAD( "rom3_m27c512.u3", 0x20000, 0x10000, CRC(56e6e11b) SHA1(0a20ef1e05ded62b0aece5a94565736cbc83edf7) )
ROM_LOAD( "rom4_m27c512.u4", 0x30000, 0x10000, CRC(2cd3eb2d) SHA1(31f804cf9ddcd7dd8501946f9bf2f8a13b5b48f3) )
ROM_LOAD( "rom5_m27c512.u5", 0x40000, 0x10000, CRC(57328ec5) SHA1(0f5cddb4b45ddef8f6d352220e32cff27edac2b4) )
ROM_LOAD( "rom6_m27c512.u6", 0x50000, 0x10000, CRC(dd228316) SHA1(2d618758e870224284efc0dc8d3a83f3447d0e48) )
ROM_LOAD( "rom7_m27c512.u7", 0x60000, 0x10000, CRC(a7c2a38b) SHA1(149ccc4b36bca6a149f3a26f5a580f34f4020ef3) )
ROM_LOAD( "rom8_m27c512.u8", 0x70000, 0x10000, CRC(f6ef214c) SHA1(1f50ea87214b86416feda58fb5065175eb18df6a) )
ROM_REGION( 0x2000, "proms", 0 )
ROM_LOAD( "am27s29.bin", 0x0000, 0x0200, CRC(3ad40503) SHA1(5f7516001ac4286df3ca4f6ab36882a15019546a) )
ROM_END
/*
Super Shanghai 2000
Wrestle Fiesta.
Main program 30% bonus by Vegas (red board)
PCB pic is blurred, but main components appear to be:
TMPZ84C00AP-8,
Winbond WF19054,
5 8-dip banks
*/
ROM_START( ss2000a )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "main_program_set_3_red_board.bin", 0x00000, 0x10000, CRC(4aaa348c) SHA1(a33656798807906ce72351a1740f77563c5b2640) )
ROM_REGION( 0x80000, "gfx", 0 ) // all 27c512
ROM_LOAD( "27c512.u1", 0x00000, 0x10000, CRC(26df6ee7) SHA1(3221639174b432ea93e0db33b7554f2ce8125052) )
ROM_LOAD( "27c512.u2", 0x10000, 0x10000, CRC(5983a654) SHA1(6374e1fb0eda2454370e54d4dd8bf6c82b2f177e) )
ROM_LOAD( "27c512.u3", 0x20000, 0x10000, CRC(0c2cd067) SHA1(a1c749ee0c0c3d25a80af6d56c41057430646ce9) )
ROM_LOAD( "27c512.u4", 0x30000, 0x10000, CRC(e3adb317) SHA1(817a885236c28dc5dee02cc1d7e9e1c780560cae) )
ROM_LOAD( "27c512.u5", 0x40000, 0x10000, CRC(e693e419) SHA1(8834419d02eb0f4f4a1619195a87b00e3f315a39) )
ROM_LOAD( "27c512.u6", 0x50000, 0x10000, CRC(096c691a) SHA1(59a45ad654981cdfecaa3390253850491baccb9f) )
ROM_LOAD( "27c512.u7", 0x60000, 0x10000, CRC(f26a3eeb) SHA1(83bbe0b068549f3bceb083d17894fb080e9b58a1) )
ROM_LOAD( "27c512.u8", 0x70000, 0x10000, CRC(1444ee50) SHA1(6e6137869d4c46762bab92ed54071d9292243532) )
ROM_REGION( 0x2000, "proms", 0 )
ROM_LOAD( "am27s29.bin", 0x0000, 0x0200, CRC(3ad40503) SHA1(5f7516001ac4286df3ca4f6ab36882a15019546a) )
ROM_END
/*********************************************************************************************************************/
@ -24042,7 +24111,9 @@ GAME( 1996, cherry96, scmaster, unkch, unkch4, unkch_state, init_un
GAME( 1998, rolling, scmaster, rolling, unkch4, unkch_state, empty_init, ROT0, "bootleg", "Rolling", MACHINE_NOT_WORKING ) // inputs, outputs
// this has a 4th reel
GAME( 200?, ss2001, 0, ss2001, cmaster, cmaster_state, empty_init, ROT0, "bootleg", "Super Shanghai 2001", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // TODO: everything
GAME( 2001, ss2001, 0, ss2001, cmaster, cmaster_state, empty_init, ROT0, "bootleg", "Super Shanghai 2001", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // TODO: everything
GAME( 2000, ss2000, 0, ss2001, cmaster, cmaster_state, empty_init, ROT0, "bootleg", "Super Shanghai 2000 (standard. green board)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // TODO: everything
GAME( 2000, ss2000a, 0, ss2001, cmaster, cmaster_state, empty_init, ROT0, "bootleg", "Super Shanghai 2000 - Wrestle Fiesta (30% bonus, red board)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // TODO: everything
// ******************* Stealth sets *******************

View File

@ -17059,6 +17059,7 @@ nslashers
nslasheru
tattass
tattassa
tattasso
@source:dataeast/deco_ld.cpp
begas
@ -20465,6 +20466,8 @@ skill98
skillch
skillcha
srmagic
ss2000
ss2000a
ss2001
star100
super7

View File

@ -3486,8 +3486,8 @@ void blzntrnd_state::blzntrnd(machine_config &config)
ym2610_device &ymsnd(YM2610(config, m_ymsnd, 16_MHz_XTAL/2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}
@ -3510,9 +3510,9 @@ void blzntrnd_state::gstrik2(machine_config &config)
ym2610_device &ymsnd(YM2610(config.replace(), m_ymsnd, 16_MHz_XTAL/2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "mono", 0.5);
ymsnd.add_route(1, "mono", 0.5);
ymsnd.add_route(2, "mono", 0.5);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.25);
ymsnd.add_route(2, "mono", 0.25);
}

View File

@ -746,7 +746,7 @@ void mcatadv_state::mcatadv(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000) / 2)); // verified on PCB
ymsnd.irq_handler().set_inputline(m_soundcpu, 0);
ymsnd.add_route(0, "mono", 0.32);
ymsnd.add_route(0, "mono", 1.0);
ymsnd.add_route(1, "mono", 0.5);
ymsnd.add_route(2, "mono", 0.5);
}
@ -760,7 +760,7 @@ void mcatadv_state::nost(machine_config &config)
ym2610_device *ymsnd = subdevice<ym2610_device>("ymsnd");
ymsnd->reset_routes();
ymsnd->add_route(0, "mono", 0.2);
ymsnd->add_route(0, "mono", 0.6);
ymsnd->add_route(1, "mono", 0.5);
ymsnd->add_route(2, "mono", 0.5);
}

View File

@ -1768,8 +1768,8 @@ void pc8801fh_state::pc8801fh(machine_config &config)
m_opna->port_b_write_callback().set(FUNC(pc8801fh_state::opn_portb_w));
// TODO: per-channel mixing is unconfirmed
m_opna->add_route(0, m_lspeaker, 0.25);
m_opna->add_route(0, m_rspeaker, 0.25);
m_opna->add_route(0, m_lspeaker, 0.75);
m_opna->add_route(0, m_rspeaker, 0.75);
m_opna->add_route(1, m_lspeaker, 0.75);
m_opna->add_route(2, m_rspeaker, 0.75);

View File

@ -1515,8 +1515,8 @@ void pc88va_state::pc88va(machine_config &config)
m_opna->port_b_read_callback().set(FUNC(pc88va_state::opn_portb_r));
m_opna->port_b_write_callback().set(FUNC(pc88va_state::opn_portb_w));
// TODO: per-channel mixing is unconfirmed
m_opna->add_route(0, m_lspeaker, 0.25);
m_opna->add_route(0, m_rspeaker, 0.25);
m_opna->add_route(0, m_lspeaker, 0.75);
m_opna->add_route(0, m_rspeaker, 0.75);
m_opna->add_route(1, m_lspeaker, 0.75);
m_opna->add_route(2, m_rspeaker, 0.75);

View File

@ -2231,6 +2231,18 @@ void pc9801_atapi_devices(device_slot_interface &device)
device.option_add("pc98_cd", PC98_CD);
}
void pc9801_state::config_video(machine_config &config)
{
m_hgdc[0]->set_addrmap(0, &pc9801_state::upd7220_1_map);
m_hgdc[0]->set_draw_text(FUNC(pc9801_state::hgdc_draw_text));
m_hgdc[0]->vsync_wr_callback().set(m_hgdc[1], FUNC(upd7220_device::ext_sync_w));
m_hgdc[0]->vsync_wr_callback().append(FUNC(pc9801_state::vrtc_irq));
m_hgdc[1]->set_addrmap(0, &pc9801_state::upd7220_2_map);
m_hgdc[1]->set_display_pixels(FUNC(pc9801_state::hgdc_display_pixels));
}
void pc9801_state::config_keyboard(machine_config &config)
{
I8251(config, m_sio_kbd, 0);
@ -2432,14 +2444,8 @@ void pc9801_state::pc9801_common(machine_config &config)
m_screen->set_screen_update(FUNC(pc9801_state::screen_update));
UPD7220(config, m_hgdc[0], 21.0526_MHz_XTAL / 8, "screen");
m_hgdc[0]->set_addrmap(0, &pc9801_state::upd7220_1_map);
m_hgdc[0]->set_draw_text(FUNC(pc9801_state::hgdc_draw_text));
m_hgdc[0]->vsync_wr_callback().set(m_hgdc[1], FUNC(upd7220_device::ext_sync_w));
m_hgdc[0]->vsync_wr_callback().append(FUNC(pc9801_state::vrtc_irq));
UPD7220(config, m_hgdc[1], 21.0526_MHz_XTAL / 8, "screen");
m_hgdc[1]->set_addrmap(0, &pc9801_state::upd7220_2_map);
m_hgdc[1]->set_display_pixels(FUNC(pc9801_state::hgdc_display_pixels));
config_video(config);
SPEAKER(config, "mono").front_center();

View File

@ -199,6 +199,7 @@ protected:
DECLARE_MACHINE_START(pc9801_common);
DECLARE_MACHINE_RESET(pc9801_common);
void config_video(machine_config &config);
void config_keyboard(machine_config &config);
void pc9801_mouse(machine_config &config);
void pc9801_cbus(machine_config &config);

View File

@ -803,6 +803,12 @@ void pc9821_state::pc9821(machine_config &config)
PALETTE(config.replace(), m_palette, FUNC(pc9821_state::pc9801_palette), 16 + 16 + 256);
// win95 expects to be A revision, otherwise it will overlay startup text prompts over desktop GFX
// NOTE: possibly this bump happened around PC-9801BX series
UPD7220A(config.replace(), m_hgdc[0], 21.0526_MHz_XTAL / 8, "screen");
UPD7220A(config.replace(), m_hgdc[1], 21.0526_MHz_XTAL / 8, "screen");
config_video(config);
PC98_119_KBD(config.replace(), m_keyb, 0);
m_keyb->rxd_callback().set("sio_kbd", FUNC(i8251_device::write_rxd));

View File

@ -14,6 +14,8 @@ TODO:
\- triggered in bokosuka when it starts losing a key break along the way.
- key repeat: alternates break and make keys when typematic kicks in, 30ms per swap?
\- Most keyboards don't have a method for disabling typematic, depends on RTY?
\- pc9821ap2: specifically wants F3 to be unmapped for calling setup mode with soft reset:
HELP key is recognized but code overrides with the F3 path, any way to avoid it?
- Undumped i8048 MCU;
- GRPH + SHIFT scancodes;
- Subclass keyboard variants (cfr. PC-9801-115 Bungo);
@ -22,7 +24,7 @@ TODO:
STOP is correct, verified with branmar2
- Problems with natural keyboard (most nonprinting keys don't work);
- pc9801fs: doesn't capture HELP key even with -119, need to mash for entering setup mode (verify)
- slotify
- slotify;
**************************************************************************************************/
@ -382,6 +384,7 @@ void pc98_119_kbd_device::device_start()
pc98_kbd_device::device_start();
save_item(NAME(m_cmd_state));
save_item(NAME(m_key_delay));
save_pointer(NAME(m_repeat_state), 0x80);
}
@ -390,6 +393,7 @@ void pc98_119_kbd_device::device_reset()
pc98_kbd_device::device_reset();
m_cmd_state = 0;
m_key_delay = 500;
std::fill(std::begin(m_repeat_state), std::end(m_repeat_state), 0);
}
@ -406,7 +410,7 @@ void pc98_119_kbd_device::key_make(uint8_t row, uint8_t column)
if (code == 0x3f)
{
m_repeat_state[code] = 0;
typematic_start(row, column, attotime::from_msec(500), attotime::from_msec(60));
typematic_start(row, column, attotime::from_msec(m_key_delay), attotime::from_msec(60));
}
}
@ -427,7 +431,7 @@ void pc98_119_kbd_device::received_byte(u8 byte)
if (m_cmd_state)
{
// ignore same byte, we expect specific signature in 0x9d already
// ignore same byte, we expect a 0 in bit 7 anyway
if (m_cmd_state == byte)
return;
@ -435,13 +439,29 @@ void pc98_119_kbd_device::received_byte(u8 byte)
switch(m_cmd_state)
{
// -xx- ---- key delay
// -11- ---- 1000 ms
// -10- ---- 500 ms
// -01- ---- 500 ms (default)
// -00- ---- 250 ms
// ---x xxxx repeat rate (slow 11111 -> 00001 fast)
// win95: sets 0x70 at startup by default, 0x51 at shutdown
case 0x9c:
{
static const u16 key_delay_ms[] = {250, 500, 500, 1000 };
m_key_delay = key_delay_ms[(byte >> 5) & 3];
// TODO: repeat rate
send_key(ACK);
break;
}
// TODO: caps/kana/num lock handling
// 0110 ---- reads back LEDs
// 0111 ---- sets lock state
// ---- x--- Kana lock
// ---- -x-- CAPS lock
// ---- ---x Num lock
case 0x9d:
// TODO: caps/kana/num lock handling
// 0110 ---- reads back LEDs
// 0111 ---- sets lock state
// ---- x--- Kana lock
// ---- -x-- CAPS lock
// ---- ---x Num lock
send_key(ACK);
break;
}
@ -465,17 +485,15 @@ void pc98_119_kbd_device::received_byte(u8 byte)
// 0x99 <unknown>
// returns 0xfa ACK -> 0xfb (not ready?)
// 0x9c key repeat (expects param byte)
// -xx- ---- key delay
// -11- ---- 1000 ms
// -10- ---- 500 ms
// -01- ---- 500 ms (default)
// -00- ---- 250 ms
// ---x xxxx repeat rate (slow 11111 -> 00001 fast)
case 0x9c:
LOGCOMMAND("\t$9c Key Repeat rate settings\n");
m_cmd_state = byte;
send_key(ACK);
break;
case 0x9d:
// NOTE: different for PC-9801NS/T
LOGCOMMAND("\tKeyboard LED settings\n");
LOGCOMMAND("\t$9d Keyboard LED settings\n");
m_cmd_state = byte;
send_key(ACK);
break;
@ -483,7 +501,7 @@ void pc98_119_kbd_device::received_byte(u8 byte)
// 0x9e ?, assume it returns ACK
case 0x9f:
LOGCOMMAND("\tKeyboard Type ID\n");
LOGCOMMAND("\t$9f Keyboard Type ID\n");
send_key(ACK);
send_key(0xa0);
send_key(0x80);

View File

@ -83,6 +83,8 @@ protected:
private:
bool m_repeat_state[0x80];
u8 m_cmd_state;
u16 m_key_delay;
};

View File

@ -1971,8 +1971,8 @@ void neogeo_base_state::neogeo_stereo(machine_config &config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
m_ym->add_route(0, "lspeaker", 0.28);
m_ym->add_route(0, "rspeaker", 0.28);
m_ym->add_route(0, "lspeaker", 0.84);
m_ym->add_route(0, "rspeaker", 0.84);
m_ym->add_route(1, "lspeaker", 0.98);
m_ym->add_route(2, "rspeaker", 0.98);
}
@ -2009,7 +2009,7 @@ void ngarcade_base_state::neogeo_mono(machine_config &config)
{
SPEAKER(config, "speaker").front_center();
m_ym->add_route(0, "speaker", 0.28);
m_ym->add_route(0, "speaker", 0.84);
m_ym->add_route(1, "speaker", 0.49);
m_ym->add_route(2, "speaker", 0.49);
}

View File

@ -1130,7 +1130,7 @@ void psikyo_state::gunbird(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.55);
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.55);
GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);

View File

@ -524,8 +524,8 @@ void mechatt_state::mechatt(machine_config &config)
ym2608_device &ymsnd(YM2608(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "lspeaker", 0.15);
ymsnd.add_route(0, "rspeaker", 0.15);
ymsnd.add_route(0, "lspeaker", 0.45);
ymsnd.add_route(0, "rspeaker", 0.45);
ymsnd.add_route(1, "lspeaker", 0.80);
ymsnd.add_route(2, "rspeaker", 0.80);
}

View File

@ -966,8 +966,8 @@ public:
YM2610B(config, m_ym2610b, 16_MHz_XTAL / 2);
m_ym2610b->irq_handler().set_inputline(m_audiocpu, 0);
m_ym2610b->add_route(0, m_speaker[0], 0.25);
m_ym2610b->add_route(0, m_speaker[1], 0.25);
m_ym2610b->add_route(0, m_speaker[0], 0.75);
m_ym2610b->add_route(0, m_speaker[1], 0.75);
m_ym2610b->add_route(1, m_speaker[0], 1.0);
m_ym2610b->add_route(2, m_speaker[1], 1.0);

View File

@ -379,8 +379,8 @@ void _2mindril_state::drill(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 16000000/2));
ymsnd.irq_handler().set(FUNC(_2mindril_state::irqhandler));
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -1126,7 +1126,7 @@ void bonzeadv_state::bonzeadv(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);

View File

@ -130,7 +130,7 @@ void bingowav_state::bingowav(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);

View File

@ -195,8 +195,8 @@ void cpzodiac_state::cpzodiac(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 16_MHz_XTAL/2));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);

View File

@ -270,15 +270,15 @@ void heromem_state::heromem(machine_config &config)
ym2610b_device &ym_l(YM2610B(config, "ym_l", 16000000 / 2));
ym_l.irq_handler().set_inputline("audiocpu_l", 0);
ym_l.add_route(0, "lspeaker", 0.25);
ym_l.add_route(0, "lspeaker", 0.25);
ym_l.add_route(0, "lspeaker", 0.75);
ym_l.add_route(0, "lspeaker", 0.75);
ym_l.add_route(1, "lspeaker", 1.0);
ym_l.add_route(2, "lspeaker", 1.0);
ym2610b_device &ym_r(YM2610B(config, "ym_r", 16000000 / 2));
ym_r.irq_handler().set_inputline("audiocpu_r", 0);
ym_r.add_route(0, "rspeaker", 0.25);
ym_r.add_route(0, "rspeaker", 0.25);
ym_r.add_route(0, "rspeaker", 0.75);
ym_r.add_route(0, "rspeaker", 0.75);
ym_r.add_route(1, "rspeaker", 1.0);
ym_r.add_route(2, "rspeaker", 1.0);
}

View File

@ -980,7 +980,7 @@ void ninjaw_state::ninjaw(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16000000/2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "subwoofer", 0.25);
ymsnd.add_route(0, "subwoofer", 0.75);
ymsnd.add_route(1, "2610.1.l", 1.0);
ymsnd.add_route(1, "2610.1.r", 1.0);
ymsnd.add_route(2, "2610.2.l", 1.0);
@ -1086,7 +1086,7 @@ void ninjaw_state::darius2(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16000000/2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "subwoofer", 0.25);
ymsnd.add_route(0, "subwoofer", 0.75);
ymsnd.add_route(1, "2610.1.l", 1.0);
ymsnd.add_route(1, "2610.1.r", 1.0);
ymsnd.add_route(2, "2610.2.l", 1.0);

View File

@ -631,8 +631,8 @@ void othunder_state::othunder(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16000000/2));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "2610.0l", 0.25);
ymsnd.add_route(0, "2610.0r", 0.25);
ymsnd.add_route(0, "2610.0l", 0.75);
ymsnd.add_route(0, "2610.0r", 0.75);
ymsnd.add_route(1, "2610.1l", 1.0);
ymsnd.add_route(1, "2610.1r", 1.0);
ymsnd.add_route(2, "2610.2l", 1.0);

View File

@ -442,8 +442,8 @@ void slapshot_state::slapshot(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 32_MHz_XTAL/4)); /* 8 MHz */
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
@ -508,8 +508,8 @@ void slapshot_state::opwolf3(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 32_MHz_XTAL/4)); /* 8 MHz */
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);

View File

@ -1900,7 +1900,7 @@ void taitob_state::rastsag2(machine_config &config)
ym2610_device &ymsnd(YM2610(config, m_ym, 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2026,7 +2026,7 @@ void taitob_state::ashura(machine_config &config)
ym2610_device &ymsnd(YM2610(config, m_ym, 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2080,7 +2080,7 @@ void taitob_state::crimec(machine_config &config)
ym2610_device &ymsnd(YM2610(config, m_ym, 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2193,7 +2193,7 @@ void rambo3_state::rambo3p(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2)); /* verified on pcb */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2247,7 +2247,7 @@ void rambo3_state::rambo3(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2)); /* 8 MHz verified on pcb */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2306,7 +2306,7 @@ void taitob_state::pbobble(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2365,7 +2365,7 @@ void taitob_state::spacedx(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2419,7 +2419,7 @@ void taitob_state::spacedxo(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2478,7 +2478,7 @@ void taitob_state::qzshowby(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2591,7 +2591,7 @@ void taitob_state::silentd(machine_config &config) /* ET910000B PCB */
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2645,7 +2645,7 @@ void taitob_state::selfeena(machine_config &config) /* ET910000A PCB */
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2)); /* 8 MHz */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2717,7 +2717,7 @@ void taitob_state::sbm(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
@ -2775,7 +2775,7 @@ void taitob_c_state::realpunc(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);

View File

@ -2831,8 +2831,8 @@ void taitof2_state::taito_f2(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 24000000/3)); /* Was 16000000/2, but only a 24Mhz OSC */
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);

View File

@ -612,7 +612,7 @@ void taitoh_state::taitoh_base(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000)));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);

View File

@ -1356,7 +1356,7 @@ void taitol_2cpu_state::raimais(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8_MHz_XTAL)); /* verified on pcb (8Mhz OSC is also for the 2nd z80) */
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);

View File

@ -1054,8 +1054,8 @@ void taitox_cchip_state::superman(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2)); // verified on PCB
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
@ -1139,8 +1139,8 @@ void taitox_state::gigandes(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
@ -1183,8 +1183,8 @@ void taitox_state::ballbros(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);

View File

@ -3225,7 +3225,7 @@ void contcirc_state::contcirc(machine_config &config) //OSC: 26.686, 24.000, 16.
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "subwoofer", 0.20);
ymsnd.add_route(0, "subwoofer", 0.60);
ymsnd.add_route(1, "2610.1.l", 2.0);
ymsnd.add_route(1, "2610.1.r", 2.0);
ymsnd.add_route(2, "2610.2.l", 2.0);
@ -3284,7 +3284,7 @@ void chasehq_state::chasehq(machine_config &config) //OSC: 26.686, 24.000, 16.00
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "subwoofer", 0.20);
ymsnd.add_route(0, "subwoofer", 0.60);
ymsnd.add_route(1, "2610.1.l", 1.0);
ymsnd.add_route(1, "2610.1.r", 1.0);
ymsnd.add_route(2, "2610.2.l", 1.0);
@ -3345,8 +3345,8 @@ void contcirc_state::enforce(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 20.0);
ymsnd.add_route(1, "2610.1.r", 20.0);
ymsnd.add_route(2, "2610.2.l", 20.0);
@ -3401,8 +3401,8 @@ void taitoz_state::bshark_base(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16000000/2));
//ymsnd.irq_handler().set_inputline(m_audiocpu, 0); // DG: this is probably specific to Z80 and wrong?
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 28.0);
ymsnd.add_route(1, "2610.1.r", 28.0);
ymsnd.add_route(2, "2610.2.l", 28.0);
@ -3476,8 +3476,8 @@ void sci_state::sci(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(32'000'000)/4)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 2.0);
ymsnd.add_route(1, "2610.1.r", 2.0);
ymsnd.add_route(2, "2610.2.l", 2.0);
@ -3546,7 +3546,7 @@ void nightstr_state::nightstr(machine_config &config) //OSC: 26.686, 24.000, 16.
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "subwoofer", 0.20);
ymsnd.add_route(0, "subwoofer", 0.60);
ymsnd.add_route(1, "2610.1.l", 2.0);
ymsnd.add_route(1, "2610.1.r", 2.0);
ymsnd.add_route(2, "2610.2.l", 2.0);
@ -3606,8 +3606,8 @@ void taitoz_z80_sound_state::aquajack(machine_config &config) //OSC: 26.686, 24.
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 2.0);
ymsnd.add_route(1, "2610.1.r", 2.0);
ymsnd.add_route(2, "2610.2.l", 2.0);
@ -3673,8 +3673,8 @@ void spacegun_state::spacegun(machine_config &config) //OSC: 26.686, 24.000, 16.
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000)/2)); // 8 MHz
//ymsnd.irq_handler().set_inputline(m_audiocpu, 0); // DG: this is probably specific to Z80 and wrong?
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 8.0);
ymsnd.add_route(1, "2610.1.r", 8.0);
ymsnd.add_route(2, "2610.2.l", 8.0);
@ -3731,8 +3731,8 @@ void taitoz_z80_sound_state::dblaxle(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(32'000'000)/4)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 8.0);
ymsnd.add_route(1, "2610.1.r", 8.0);
ymsnd.add_route(2, "2610.2.l", 8.0);
@ -3792,8 +3792,8 @@ void sci_state::racingb(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(32'000'000)/4)); // 8 MHz
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 8.0);
ymsnd.add_route(1, "2610.1.r", 8.0);
ymsnd.add_route(2, "2610.2.l", 8.0);

View File

@ -722,7 +722,7 @@ void taitoair_state::airsys(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(16'000'000) / 2));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.30);
ymsnd.add_route(0, "mono", 0.90);
ymsnd.add_route(1, "mono", 0.60);
ymsnd.add_route(2, "mono", 0.60);

View File

@ -635,7 +635,7 @@ void warriorb_state::darius2d(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16_MHz_XTAL / 2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "subwoofer", 0.25);
ymsnd.add_route(0, "subwoofer", 0.75);
ymsnd.add_route(1, "2610.1.l", 1.0);
ymsnd.add_route(1, "2610.1.r", 1.0);
ymsnd.add_route(2, "2610.2.l", 1.0);
@ -712,8 +712,8 @@ void warriorb_state::warriorb(machine_config &config)
ym2610b_device &ymsnd(YM2610B(config, "ymsnd", 16_MHz_XTAL / 2));
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "2610.1.l", 1.0);
ymsnd.add_route(1, "2610.1.r", 1.0);
ymsnd.add_route(2, "2610.2.l", 1.0);

View File

@ -900,8 +900,8 @@ void wgp_state::wgp(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 16000000/2));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0); // assumes Z80 sandwiched between 68Ks
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);

View File

@ -587,9 +587,9 @@ void wc90_state::wc90(machine_config &config)
ym2608_device &ymsnd(YM2608(config, "ymsnd", XTAL(8'000'000))); // verified on PCB
ymsnd.irq_handler().set_inputline("audiocpu", 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.5);
ymsnd.add_route(2, "mono", 0.5);
}
void wc90_state::wc90t(machine_config &config)

View File

@ -3726,15 +3726,15 @@ void vgmplay_state::vgmplay(machine_config &config)
// TODO: prevent error.log spew
YM2608(config, m_ym2608[0], 0);
m_ym2608[0]->set_addrmap(0, &vgmplay_state::ym2608_map<0>);
m_ym2608[0]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 0);
m_ym2608[0]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 1);
m_ym2608[0]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 0);
m_ym2608[0]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 1);
m_ym2608[0]->add_route(1, m_mixer, 1.00, AUTO_ALLOC_INPUT, 0);
m_ym2608[0]->add_route(2, m_mixer, 1.00, AUTO_ALLOC_INPUT, 1);
YM2608(config, m_ym2608[1], 0);
m_ym2608[1]->set_addrmap(0, &vgmplay_state::ym2608_map<1>);
m_ym2608[1]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 0);
m_ym2608[1]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 1);
m_ym2608[1]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 0);
m_ym2608[1]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 1);
m_ym2608[1]->add_route(1, m_mixer, 1.00, AUTO_ALLOC_INPUT, 0);
m_ym2608[1]->add_route(2, m_mixer, 1.00, AUTO_ALLOC_INPUT, 1);
@ -3742,16 +3742,16 @@ void vgmplay_state::vgmplay(machine_config &config)
YM2610(config, m_ym2610[0], 0);
m_ym2610[0]->set_addrmap(0, &vgmplay_state::ym2610_adpcm_a_map<0>);
m_ym2610[0]->set_addrmap(1, &vgmplay_state::ym2610_adpcm_b_map<0>);
m_ym2610[0]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 0);
m_ym2610[0]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 1);
m_ym2610[0]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 0);
m_ym2610[0]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 1);
m_ym2610[0]->add_route(1, m_mixer, 0.50, AUTO_ALLOC_INPUT, 0);
m_ym2610[0]->add_route(2, m_mixer, 0.50, AUTO_ALLOC_INPUT, 1);
YM2610(config, m_ym2610[1], 0);
m_ym2610[1]->set_addrmap(0, &vgmplay_state::ym2610_adpcm_a_map<1>);
m_ym2610[1]->set_addrmap(1, &vgmplay_state::ym2610_adpcm_b_map<1>);
m_ym2610[1]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 0);
m_ym2610[1]->add_route(0, m_mixer, 0.25, AUTO_ALLOC_INPUT, 1);
m_ym2610[1]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 0);
m_ym2610[1]->add_route(0, m_mixer, 0.75, AUTO_ALLOC_INPUT, 1);
m_ym2610[1]->add_route(1, m_mixer, 0.50, AUTO_ALLOC_INPUT, 0);
m_ym2610[1]->add_route(2, m_mixer, 0.50, AUTO_ALLOC_INPUT, 1);

View File

@ -409,8 +409,8 @@ void aerofgt_state::aerofgt(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); // verified on pcb
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -631,8 +631,8 @@ void crshrace_state::crshrace(machine_config &config) // TODO: PCB sports 32 MHz
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8'000'000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -867,8 +867,8 @@ void f1gp_state::f1gp(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000)));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -532,8 +532,8 @@ void fromanc2_state::fromanc2(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.75);
ymsnd.add_route(2, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.25);
ymsnd.add_route(2, "mono", 0.25);
}
void fromanc2_state::fromancr(machine_config &config)
@ -588,8 +588,8 @@ void fromanc2_state::fromancr(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.75);
ymsnd.add_route(2, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.25);
ymsnd.add_route(2, "mono", 0.25);
}
void fromanc4_state::fromanc4(machine_config &config)
@ -643,8 +643,8 @@ void fromanc4_state::fromanc4(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.75);
ymsnd.add_route(2, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.25);
ymsnd.add_route(2, "mono", 0.25);
}

View File

@ -676,8 +676,8 @@ void gstriker_state::base(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8_MHz_XTAL));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -592,8 +592,8 @@ void inufuku_state::inufuku(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(32'000'000)/4));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 0.75);
ymsnd.add_route(2, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.25);
ymsnd.add_route(2, "mono", 0.25);
}

View File

@ -684,9 +684,9 @@ void pipedrm_state::pipedrm(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8_MHz_XTAL));
ymsnd.irq_handler().set_inputline("sub", 0);
ymsnd.add_route(0, "mono", 0.50);
ymsnd.add_route(1, "mono", 1.0);
ymsnd.add_route(2, "mono", 1.0);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.5);
ymsnd.add_route(2, "mono", 0.5);
}
void hatris_state::hatris(machine_config &config)
@ -728,9 +728,9 @@ void hatris_state::hatris(machine_config &config)
ym2608_device &ym2608(YM2608(config, "ymsnd", 8_MHz_XTAL));
ym2608.irq_handler().set_inputline("sub", 0);
ym2608.add_route(0, "mono", 0.50);
ym2608.add_route(1, "mono", 1.0);
ym2608.add_route(2, "mono", 1.0);
ym2608.add_route(0, "mono", 0.75);
ym2608.add_route(1, "mono", 0.5);
ym2608.add_route(2, "mono", 0.5);
}

View File

@ -2318,8 +2318,8 @@ void pspikes_banked_sound_state::pspikes(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}
@ -2519,8 +2519,8 @@ void pspikes_banked_sound_state::karatblz(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); // verified on pcb
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}
@ -2617,8 +2617,8 @@ void pspikes_banked_sound_state::spinlbrk(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); // verified on pcb
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}
@ -2666,8 +2666,8 @@ void pspikes_banked_sound_state::turbofrc(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); // verified on pcb
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}
@ -2717,8 +2717,8 @@ void pspikes_banked_sound_state::aerofgtb(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -459,8 +459,8 @@ void suprslam_state::suprslam(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 32_MHz_XTAL / 4)); // not verified
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -526,8 +526,8 @@ void tail2nos_state::tail2nos(machine_config &config)
ym2608_device &ymsnd(YM2608(config, "ymsnd", XTAL(8'000'000))); // verified on PCB
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.port_b_write_callback().set(FUNC(tail2nos_state::sound_bankswitch_w));
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -609,8 +609,8 @@ void taotaido_state::taotaido(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8'000'000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "lspeaker", 0.25);
ymsnd.add_route(0, "rspeaker", 0.25);
ymsnd.add_route(0, "lspeaker", 0.75);
ymsnd.add_route(0, "rspeaker", 0.75);
ymsnd.add_route(1, "lspeaker", 1.0);
ymsnd.add_route(2, "rspeaker", 1.0);
}

View File

@ -861,7 +861,7 @@ void welltris_state::welltris(machine_config &config)
ym2610_device &ymsnd(YM2610(config, "ymsnd", 8000000));
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(0, "mono", 0.25);
ymsnd.add_route(0, "mono", 0.75);
ymsnd.add_route(1, "mono", 0.75);
ymsnd.add_route(2, "mono", 0.75);
}

View File

@ -15,6 +15,7 @@
#include "osdcomm.h"
#include <array>
#include <string_view>
namespace osd {
@ -23,6 +24,7 @@ namespace osd {
// TYPE DEFINITIONS
//**************************************************************************
// base for virtual network interface handler
class network_handler
@ -40,6 +42,29 @@ protected:
std::array<u8, 6> m_mac;
};
// interface to network device
class network_device
{
public:
virtual ~network_device() = default;
virtual void start() = 0;
virtual void stop() = 0;
virtual void poll() = 0;
virtual int send(const void *buf, int len) = 0;
};
// description of an available network device
struct network_device_info
{
int id;
std::string_view description;
};
} // namespace osd
#endif // MAME_OSD_INTERFACE_NETHANDLER_H

View File

@ -15,12 +15,12 @@
#include "modules/font/font_module.h"
#include "modules/input/input_module.h"
#include "modules/midi/midi_module.h"
#include "modules/netdev/netdev_module.h"
#include "modules/monitor/monitor_module.h"
#include "modules/netdev/netdev_module.h"
#include "modules/render/render_module.h"
#include "modules/sound/sound_module.h"
#include "osdnet.h"
#include "watchdog.h"
#include "emu.h"
@ -208,6 +208,7 @@ osd_common_t::osd_common_t(osd_options &options)
, m_sound(nullptr)
, m_debugger(nullptr)
, m_midi(nullptr)
, m_network(nullptr)
, m_keyboard_input(nullptr)
, m_mouse_input(nullptr)
, m_lightgun_input(nullptr)
@ -615,8 +616,8 @@ bool osd_common_t::execute_command(const char *command)
{
if (strcmp(command, OSDCOMMAND_LIST_NETWORK_ADAPTERS) == 0)
{
osd_module &om = select_module_options<osd_module>(OSD_NETDEV_PROVIDER);
auto const &interfaces = get_netdev_list();
auto &om = select_module_options<netdev_module>(OSD_NETDEV_PROVIDER);
auto const interfaces = om.list_devices();
if (interfaces.empty())
{
printf("No supported network interfaces were found\n");
@ -626,17 +627,17 @@ bool osd_common_t::execute_command(const char *command)
printf("Available network interfaces:\n");
for (auto &entry : interfaces)
{
printf(" %s\n", entry->description);
printf(" %.*s\n", int(entry.description.length()), entry.description.data());
}
}
om.exit();
dynamic_cast<osd_module &>(om).exit();
return true;
}
else if (strcmp(command, OSDCOMMAND_LIST_MIDI_DEVICES) == 0)
{
osd_module &om = select_module_options<osd_module>(OSD_MIDI_PROVIDER);
auto const ports = dynamic_cast<midi_module &>(om).list_midi_ports();
auto &om = select_module_options<midi_module>(OSD_MIDI_PROVIDER);
auto const ports = om.list_midi_ports();
if (ports.empty())
{
printf("No MIDI ports were found\n");
@ -657,7 +658,7 @@ bool osd_common_t::execute_command(const char *command)
printf(port.default_output ? "%s (default)\n" : "%s\n", port.name.c_str());
}
}
om.exit();
dynamic_cast<osd_module &>(om).exit();
return true;
}
@ -697,10 +698,10 @@ void osd_common_t::init_subsystems()
m_debugger = &select_module_options<debug_module>(OSD_DEBUG_PROVIDER);
select_module_options<netdev_module>(OSD_NETDEV_PROVIDER);
m_midi = &select_module_options<midi_module>(OSD_MIDI_PROVIDER);
m_network = &select_module_options<netdev_module>(OSD_NETDEV_PROVIDER);
m_output = &select_module_options<output_module>(OSD_OUTPUT_PROVIDER);
machine().output().set_global_notifier(output_notifier_callback, this);
@ -788,3 +789,12 @@ std::vector<osd::midi_port_info> osd_common_t::list_midi_ports()
return m_midi->list_midi_ports();
}
std::unique_ptr<osd::network_device> osd_common_t::open_network_device(int id, osd::network_handler &handler)
{
return m_network->open_device(id, handler);
}
std::vector<osd::network_device_info> osd_common_t::list_network_devices()
{
return m_network->list_devices();
}

View File

@ -197,6 +197,7 @@ class font_module;
class input_module;
class midi_module;
class monitor_module;
class netdev_module;
class osd_watchdog;
class osd_window;
class output_module;
@ -234,16 +235,22 @@ public:
virtual void add_audio_to_recording(const int16_t *buffer, int samples_this_frame) override;
virtual std::vector<ui::menu_item> get_slider_list() override;
// command option overrides
virtual bool execute_command(const char *command) override;
// font interface
virtual osd_font::ptr font_alloc() override;
virtual bool get_font_families(std::string const &font_path, std::vector<std::pair<std::string, std::string> > &result) override;
// command option overrides
virtual bool execute_command(const char *command) override;
// MIDI interface
virtual std::unique_ptr<osd::midi_input_port> create_midi_input(std::string_view name) override;
virtual std::unique_ptr<osd::midi_output_port> create_midi_output(std::string_view name) override;
virtual std::vector<osd::midi_port_info> list_midi_ports() override;
// network interface
virtual std::unique_ptr<osd::network_device> open_network_device(int id, osd::network_handler &handler) override;
virtual std::vector<osd::network_device_info> list_network_devices() override;
// FIXME: everything below seems to be osd specific and not part of
// this INTERFACE but part of the osd IMPLEMENTATION
@ -317,6 +324,7 @@ protected:
sound_module* m_sound;
debug_module* m_debugger;
midi_module* m_midi;
netdev_module* m_network;
input_module* m_keyboard_input;
input_module* m_mouse_input;
input_module* m_lightgun_input;

View File

@ -0,0 +1,39 @@
// license:BSD-3-Clause
// copyright-holders:Carl
#include "netdev_common.h"
namespace osd {
network_device_base::network_device_base(network_handler &handler)
: m_handler(handler)
, m_stopped(true)
{
}
network_device_base::~network_device_base()
{
}
void network_device_base::start()
{
m_stopped = false;
}
void network_device_base::stop()
{
m_stopped = true;
}
void network_device_base::poll()
{
uint8_t *buf;
int len;
while (!m_stopped && (len = recv_dev(&buf)))
{
m_handler.recv_cb(buf, len);
}
}
} // namespace osd

View File

@ -0,0 +1,36 @@
// license:BSD-3-Clause
// copyright-holders:Carl
#ifndef MAME_OSD_NETDEV_NETDEV_COMMON_H
#define MAME_OSD_NETDEV_NETDEV_COMMON_H
#pragma once
#include "interface/nethandler.h"
#include <cstdint>
namespace osd {
class network_device_base : public network_device
{
public:
virtual ~network_device_base();
virtual void start() override;
virtual void stop() override;
virtual void poll() override;
protected:
network_device_base(network_handler &handler);
virtual int recv_dev(uint8_t **buf) = 0;
private:
network_handler &m_handler;
bool m_stopped;
};
} // namespace osd
#endif // MAME_OSD_NETDEV_NETDEV_COMMON_H

View File

@ -9,6 +9,11 @@
#pragma once
#include "interface/nethandler.h"
#include <memory>
#include <vector>
//============================================================
// CONSTANTS
@ -20,7 +25,9 @@ class netdev_module
{
public:
virtual ~netdev_module() = default;
// no specific routines below ... may change
virtual std::unique_ptr<osd::network_device> open_device(int id, osd::network_handler &handler) = 0;
virtual std::vector<osd::network_device_info> list_devices() = 0;
};
#endif // MAME_OSD_NETDEV_NETDEV_MODULE_H

View File

@ -8,6 +8,9 @@
#include "modules/osdmodule.h"
#include <memory>
#include <vector>
namespace osd {
@ -21,7 +24,21 @@ public:
}
virtual ~netdev_none() { }
virtual int init(osd_interface &osd, const osd_options &options) override { return 0; }
virtual int init(osd_interface &osd, const osd_options &options) override
{
return 0;
}
virtual std::unique_ptr<network_device> open_device(int id, network_handler &handler) override
{
return std::unique_ptr<network_device>();
}
virtual std::vector<network_device_info> list_devices() override
{
return std::vector<network_device_info>();
}
};
} // anonymous namespace

View File

@ -7,20 +7,25 @@
#if defined(OSD_NET_USE_PCAP)
#include "netdev_common.h"
#include "modules/lib/osdlib.h"
#include "osdnet.h"
#include "osdcore.h" // osd_printf_*
#include "util/strformat.h" // string_format
#include <memory>
#include <vector>
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
#include <windows.h>
#undef interface
#define LIB_NAME "wpcap.dll"
#elif defined(SDLMAME_MACOSX)
#include <atomic>
#include <pthread.h>
#include <libkern/OSAtomic.h>
#define LIB_NAME "libpcap.dylib"
#else
@ -47,10 +52,10 @@ typedef int (*pcap_dispatch_fn)(pcap_t *, int, pcap_handler, u_char *);
class pcap_module : public osd_module, public netdev_module
{
public:
pcap_module()
: osd_module(OSD_NETDEV_PROVIDER, "pcap"), netdev_module(),
pcap_findalldevs_dl(nullptr), pcap_open_live_dl(nullptr), pcap_next_ex_dl(nullptr), pcap_compile_dl(nullptr),
pcap_close_dl(nullptr), pcap_setfilter_dl(nullptr), pcap_sendpacket_dl(nullptr), pcap_set_datalink_dl(nullptr), pcap_dispatch_dl(nullptr)
pcap_module() :
osd_module(OSD_NETDEV_PROVIDER, "pcap"), netdev_module(),
pcap_findalldevs_dl(nullptr), pcap_open_live_dl(nullptr), pcap_next_ex_dl(nullptr), pcap_compile_dl(nullptr),
pcap_close_dl(nullptr), pcap_setfilter_dl(nullptr), pcap_sendpacket_dl(nullptr), pcap_set_datalink_dl(nullptr), pcap_dispatch_dl(nullptr)
{
}
@ -84,6 +89,20 @@ public:
return true;
}
virtual std::unique_ptr<network_device> open_device(int id, network_handler &handler) override;
virtual std::vector<network_device_info> list_devices() override;
private:
struct device_info
{
std::string name;
std::string description;
};
class netdev_pcap;
std::vector<device_info> m_devices;
osd::dynamic_module::ptr pcap_dll;
pcap_findalldevs_fn pcap_findalldevs_dl;
@ -97,113 +116,113 @@ public:
pcap_dispatch_fn pcap_dispatch_dl;
};
// FIXME: bridge between pcap_module and netdev_pcap
static pcap_module *module = nullptr;
#ifdef SDLMAME_MACOSX
struct netdev_pcap_context
class pcap_module::netdev_pcap : public network_device_base
{
public:
netdev_pcap(pcap_module &module, const char *name, network_handler &handler);
~netdev_pcap();
virtual int send(void const *buf, int len) override;
protected:
virtual int recv_dev(uint8_t **buf) override;
private:
pcap_module &m_module;
pcap_t *m_p;
#ifdef SDLMAME_MACOSX
pthread_t m_thread;
uint8_t *pkt;
int len;
pcap_t *p;
uint8_t packets[32][1600];
int packetlens[32];
int head;
int tail;
};
#endif
std::atomic<int> head;
std::atomic<int> tail;
class netdev_pcap : public osd_network_device
{
public:
netdev_pcap(const char *name, network_handler &ifdev);
~netdev_pcap();
virtual int send(uint8_t *buf, int len) override;
protected:
virtual int recv_dev(uint8_t **buf) override;
private:
pcap_t *m_p;
#ifdef SDLMAME_MACOSX
struct netdev_pcap_context m_ctx;
pthread_t m_thread;
static void pcap_handler(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes);
static void *pcap_blocker(void *arg);
#endif
};
#ifdef SDLMAME_MACOSX
static void netdev_pcap_handler(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes)
void pcap_module::netdev_pcap::pcap_handler(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes)
{
struct netdev_pcap_context *ctx = (struct netdev_pcap_context*)user;
netdev_pcap *const ctx = reinterpret_cast<netdev_pcap *>(user);
if(!ctx->p) return;
if (!ctx->p)
return;
if(OSAtomicCompareAndSwapInt((ctx->head+1) & 0x1F, ctx->tail, &ctx->tail)) {
int const curr = ctx->head;
int const next = (curr + 1) & 0x1f;
if (ctx->tail.load(std::memory_order_acquire) == next)
{
printf("buffer full, dropping packet\n");
return;
}
memcpy(ctx->packets[ctx->head], bytes, h->len);
ctx->packetlens[ctx->head] = h->len;
OSAtomicCompareAndSwapInt(ctx->head, (ctx->head+1) & 0x1F, &ctx->head);
memcpy(ctx->packets[curr], bytes, h->len);
ctx->packetlens[curr] = h->len;
ctx->head.store(next, std::memory_order_release);
}
static void *netdev_pcap_blocker(void *arg) {
struct netdev_pcap_context *ctx = (struct netdev_pcap_context*)arg;
void *pcap_module::netdev_pcap::pcap_blocker(void *arg)
{
netdev_pcap *const ctx = reinterpret_cast<netdev_pcap *>(arg);
while(ctx && ctx->p) {
(*module->pcap_dispatch_dl)(ctx->p, 1, netdev_pcap_handler, (u_char*)ctx);
}
while (ctx && ctx->p)
(*ctx->m_module.pcap_dispatch_dl)(ctx->p, 1, &netdev_pcap::pcap_handler, reinterpret_cast<u_char *>(ctx));
return 0;
return nullptr;
}
#endif
netdev_pcap::netdev_pcap(const char *name, network_handler &ifdev)
: osd_network_device(ifdev)
pcap_module::netdev_pcap::netdev_pcap(pcap_module &module, const char *name, network_handler &handler) :
network_device_base(handler),
m_module(module),
m_p(nullptr)
{
char errbuf[PCAP_ERRBUF_SIZE];
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
m_p = (*module->pcap_open_live_dl)(name, 65535, 1, -1, errbuf);
m_p = (*m_module.pcap_open_live_dl)(name, 65535, 1, -1, errbuf);
#else
m_p = (*module->pcap_open_live_dl)(name, 65535, 1, 1, errbuf);
m_p = (*m_module.pcap_open_live_dl)(name, 65535, 1, 1, errbuf);
#endif
if(!m_p)
{
osd_printf_error("Unable to open %s: %s\n", name, errbuf);
return;
}
if ((*module->pcap_set_datalink_dl)(m_p, DLT_EN10MB) == -1)
if ((*m_module.pcap_set_datalink_dl)(m_p, DLT_EN10MB) == -1)
{
osd_printf_error("Unable to set %s to ethernet", name);
(*module->pcap_close_dl)(m_p);
(*m_module.pcap_close_dl)(m_p);
m_p = nullptr;
return;
}
#ifdef SDLMAME_MACOSX
m_ctx.head = 0;
m_ctx.tail = 0;
m_ctx.p = m_p;
pthread_create(&m_thread, nullptr, netdev_pcap_blocker, &m_ctx);
head = 0;
tail = 0;
p = m_p;
pthread_create(&m_thread, nullptr, &netdev_pcap::pcap_blocker, this);
#endif
}
int netdev_pcap::send(uint8_t *buf, int len)
int pcap_module::netdev_pcap::send(void const *buf, int len)
{
int ret;
if(!m_p) {
printf("send invoked, but no pcap context\n");
return 0;
}
ret = (*module->pcap_sendpacket_dl)(m_p, buf, len);
ret = (*m_module.pcap_sendpacket_dl)(m_p, reinterpret_cast<const u_char *>(buf), len);
printf("sent packet length %d, returned %d\n", len, ret);
return ret ? len : 0;
//return (!pcap_sendpacket_dl(m_p, buf, len))?len:0;
//return (!pcap_sendpacket_dl(m_p, reinterpret_cast<const u_char *>(buf), len))?len:0;
}
int netdev_pcap::recv_dev(uint8_t **buf)
int pcap_module::netdev_pcap::recv_dev(uint8_t **buf)
{
#ifdef SDLMAME_MACOSX
uint8_t pktbuf[2048];
@ -213,60 +232,48 @@ int netdev_pcap::recv_dev(uint8_t **buf)
if(!m_p) return 0;
// Empty
if(OSAtomicCompareAndSwapInt(m_ctx.head, m_ctx.tail, &m_ctx.tail)) {
return 0;
}
memcpy(pktbuf, m_ctx.packets[m_ctx.tail], m_ctx.packetlens[m_ctx.tail]);
ret = m_ctx.packetlens[m_ctx.tail];
OSAtomicCompareAndSwapInt(m_ctx.tail, (m_ctx.tail+1) & 0x1F, &m_ctx.tail);
int const curr = tail;
if (head.load(std::memory_order_acquire) == curr)
return 0;
memcpy(pktbuf, packets[curr], packetlens[curr]);
ret = packetlens[curr];
tail.store((curr + 1) & 0x1f, std::memory_order_release);
*buf = pktbuf;
return ret;
#else
struct pcap_pkthdr *header;
if(!m_p) return 0;
return ((*module->pcap_next_ex_dl)(m_p, &header, (const u_char **)buf) == 1)?header->len:0;
return ((*m_module.pcap_next_ex_dl)(m_p, &header, (const u_char **)buf) == 1)?header->len:0;
#endif
}
netdev_pcap::~netdev_pcap()
pcap_module::netdev_pcap::~netdev_pcap()
{
#ifdef SDLMAME_MACOSX
m_ctx.p = nullptr;
p = nullptr;
pthread_cancel(m_thread);
pthread_join(m_thread, nullptr);
#endif
if(m_p) (*module->pcap_close_dl)(m_p);
if(m_p) (*m_module.pcap_close_dl)(m_p);
m_p = nullptr;
}
static CREATE_NETDEV(create_pcap)
{
auto *dev = new netdev_pcap(ifname, ifdev);
return dynamic_cast<osd_network_device *>(dev);
}
int pcap_module::init(osd_interface &osd, const osd_options &options)
{
pcap_if_t *devs;
char errbuf[PCAP_ERRBUF_SIZE];
// FIXME: bridge between pcap_module and netdev_pcap
module = this;
if ((*pcap_findalldevs_dl)(&devs, errbuf) == -1)
{
osd_printf_error("Unable to get network devices: %s\n", errbuf);
return 1;
}
while(devs)
while (devs)
{
if(devs->description) {
add_netdev(devs->name, devs->description, create_pcap);
} else {
add_netdev(devs->name, devs->name, create_pcap);
}
m_devices.emplace_back(device_info{ devs->name, devs->description ? devs->description : devs->name });
devs = devs->next;
}
return 0;
@ -274,7 +281,24 @@ int pcap_module::init(osd_interface &osd, const osd_options &options)
void pcap_module::exit()
{
clear_netdev();
m_devices.clear();
}
std::unique_ptr<network_device> pcap_module::open_device(int id, network_handler &handler)
{
if ((0 > id) || (m_devices.size() <= id))
return nullptr;
return std::make_unique<netdev_pcap>(*this, m_devices[id].name.c_str(), handler);
}
std::vector<network_device_info> pcap_module::list_devices()
{
std::vector<network_device_info> result;
result.reserve(m_devices.size());
for (int id = 0; m_devices.size() > id; ++id)
result.emplace_back(network_device_info{ id, m_devices[id].description });
return result;
}
} // anonymous namespace

View File

@ -6,6 +6,17 @@
#if defined(OSD_NET_USE_TAPTUN)
#include "netdev_common.h"
#include "osdcore.h" // osd_printf_verbose
#include "osdfile.h" // PATH_SEPARATOR
#include "util/hashing.h" // crc32_creator
#include "util/unicode.h"
#include <memory>
#include <vector>
#if defined(_WIN32)
#include <windows.h>
#include <winioctl.h>
@ -17,13 +28,6 @@
#include <cerrno>
#endif
#include "osdcore.h" // osd_printf_verbose
#include "osdfile.h" // PATH_SEPARATOR
#include "osdnet.h"
#include "unicode.h"
#include "util/hashing.h" // crc32_creator
#ifdef __linux__
#define IFF_TAP 0x0002
#define IFF_NO_PI 0x1000
@ -52,21 +56,33 @@ public:
}
virtual ~taptun_module() { }
virtual int init(osd_interface &osd, const osd_options &options);
virtual void exit();
virtual int init(osd_interface &osd, const osd_options &options) override;
virtual void exit() override;
virtual bool probe() { return true; }
virtual bool probe() override { return true; }
virtual std::unique_ptr<network_device> open_device(int id, network_handler &handler) override;
virtual std::vector<network_device_info> list_devices() override;
private:
struct device_info
{
std::string name;
std::string description;
};
std::vector<device_info> m_devices;
};
class netdev_tap : public osd_network_device
class netdev_tap : public network_device_base
{
public:
netdev_tap(const char *name, network_handler &ifdev);
netdev_tap(const char *name, network_handler &handler);
~netdev_tap();
int send(uint8_t *buf, int len) override;
int send(void const *buf, int len) override;
protected:
int recv_dev(uint8_t **buf) override;
@ -83,8 +99,8 @@ private:
uint8_t m_buf[2048];
};
netdev_tap::netdev_tap(const char *name, network_handler &ifdev)
: osd_network_device(ifdev)
netdev_tap::netdev_tap(const char *name, network_handler &handler)
: network_device_base(handler)
{
#if defined(__linux__)
m_fd = -1;
@ -173,7 +189,7 @@ static u32 finalise_frame(u8 buf[], u32 length)
}
#if defined(_WIN32)
int netdev_tap::send(uint8_t *buf, int len)
int netdev_tap::send(void const *buf, int len)
{
OVERLAPPED overlapped = {};
@ -237,7 +253,7 @@ static std::wstring safe_string(WCHAR value[], int length)
}
// find the friendly name for an adapter in the registry
static std::wstring get_connection_name(std::wstring &id)
static std::wstring get_connection_name(std::wstring const &id)
{
std::wstring result;
@ -319,7 +335,7 @@ static std::vector<std::wstring> get_tap_adapters()
return result;
}
#else
int netdev_tap::send(uint8_t *buf, int len)
int netdev_tap::send(void const *buf, int len)
{
if(m_fd == -1) return 0;
len = write(m_fd, buf, len);
@ -328,7 +344,8 @@ int netdev_tap::send(uint8_t *buf, int len)
int netdev_tap::recv_dev(uint8_t **buf)
{
if(m_fd == -1) return 0;
if (0 > m_fd)
return 0;
int len = read(m_fd, m_buf, sizeof(m_buf));
@ -336,30 +353,43 @@ int netdev_tap::recv_dev(uint8_t **buf)
len = finalise_frame(m_buf, len);
*buf = m_buf;
return (len == -1)?0:len;
return (len == -1) ? 0 : len;
}
#endif
static CREATE_NETDEV(create_tap)
{
auto *dev = new netdev_tap(ifname, ifdev);
return dynamic_cast<osd_network_device *>(dev);
}
int taptun_module::init(osd_interface &osd, const osd_options &options)
{
#if defined(_WIN32)
for (std::wstring &id : get_tap_adapters())
add_netdev(utf8_from_wstring(id).c_str(), utf8_from_wstring(get_connection_name(id)).c_str(), create_tap);
auto const adapters = get_tap_adapters();
m_devices.reserve(adapters.size());
for (std::wstring const &id : adapters)
m_devices.emplace_back(device_info{ utf8_from_wstring(id), utf8_from_wstring(get_connection_name(id)) });
#else
add_netdev("tap", "TAP/TUN Device", create_tap);
m_devices.emplace_back(device_info{ "tap", "TUN/TAP Device" });
#endif
return 0;
}
void taptun_module::exit()
{
clear_netdev();
m_devices.clear();
}
std::unique_ptr<network_device> taptun_module::open_device(int id, network_handler &handler)
{
if ((0 > id) || (m_devices.size() <= id))
return nullptr;
return std::make_unique<netdev_tap>(m_devices[id].name.c_str(), handler);
}
std::vector<network_device_info> taptun_module::list_devices()
{
std::vector<network_device_info> result;
result.reserve(m_devices.size());
for (int id = 0; m_devices.size() > id; ++id)
result.emplace_back(network_device_info{ id, m_devices[id].description });
return result;
}
} // anonymous namespace

View File

@ -17,6 +17,7 @@
#include "bitmap.h"
#include "interface/midiport.h"
#include "interface/nethandler.h"
#include <cstdint>
#include <memory>
@ -100,6 +101,10 @@ public:
virtual std::unique_ptr<osd::midi_output_port> create_midi_output(std::string_view name) = 0;
virtual std::vector<osd::midi_port_info> list_midi_ports() = 0;
// network interface
virtual std::unique_ptr<osd::network_device> open_network_device(int id, osd::network_handler &handler) = 0;
virtual std::vector<osd::network_device_info> list_network_devices() = 0;
protected:
virtual ~osd_interface() { }
};

View File

@ -1,79 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carl
#include "osdnet.h"
#include "interface/nethandler.h"
static std::vector<std::unique_ptr<osd_network_device::entry_t>> netdev_list;
void add_netdev(const char *name, const char *description, create_netdev func)
{
auto entry = std::make_unique<osd_network_device::entry_t>();
entry->id = netdev_list.size();
strncpy(entry->name, name, 255);
entry->name[255] = '\0';
strncpy(entry->description, (description != nullptr) ? description : "(no name)", 255);
entry->description[255] = '\0';
entry->func = func;
netdev_list.push_back(std::move(entry));
}
void clear_netdev()
{
netdev_list.clear();
}
const std::vector<std::unique_ptr<osd_network_device::entry_t>>& get_netdev_list()
{
return netdev_list;
}
osd_network_device *open_netdev(int id, osd::network_handler &ifdev)
{
for(auto &entry : netdev_list)
if(entry->id==id)
return entry->func(entry->name, ifdev);
return nullptr;
}
osd_network_device::osd_network_device(osd::network_handler &ifdev)
: m_dev(ifdev)
, m_stopped(true)
{
}
osd_network_device::~osd_network_device()
{
}
void osd_network_device::start()
{
m_stopped = false;
}
void osd_network_device::stop()
{
m_stopped = true;
}
void osd_network_device::poll()
{
uint8_t *buf;
int len;
while(!m_stopped && (len = recv_dev(&buf)))
{
m_dev.recv_cb(buf, len);
}
}
int osd_network_device::send(uint8_t *buf, int len)
{
return 0;
}
int osd_network_device::recv_dev(uint8_t **buf)
{
return 0;
}

View File

@ -1,61 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Carl
#ifndef MAME_OSD_OSDNET_H
#define MAME_OSD_OSDNET_H
#pragma once
#include "osdcomm.h"
#include <algorithm>
#include <array>
#include <memory>
#include <vector>
namespace osd { class network_handler; }
class osd_network_device;
#define CREATE_NETDEV(name) osd_network_device *name(const char *ifname, osd::network_handler &ifdev)
typedef osd_network_device *(*create_netdev)(const char *ifname, osd::network_handler &ifdev);
class osd_network_device
{
public:
struct entry_t
{
entry_t()
{
std::fill(std::begin(name), std::end(name), 0);
std::fill(std::begin(description), std::end(description), 0);
}
int id = 0;
char name[256];
char description[256];
create_netdev func = nullptr;
};
osd_network_device(osd::network_handler &ifdev);
virtual ~osd_network_device();
void start();
void stop();
void poll();
virtual int send(uint8_t *buf, int len);
protected:
virtual int recv_dev(uint8_t **buf);
private:
osd::network_handler &m_dev;
bool m_stopped;
};
osd_network_device *open_netdev(int id, osd::network_handler &ifdev);
void add_netdev(const char *name, const char *description, create_netdev func);
void clear_netdev();
const std::vector<std::unique_ptr<osd_network_device::entry_t>>& get_netdev_list();
#endif // MAME_OSD_OSDNET_H