mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
-emu/ioport.cpp: Allow punching holes in IPT_UNUSED and IPT_UNKNOWN.
-bus/waveblaster: Hide card implementations.
This commit is contained in:
parent
69a46f2263
commit
25b2829bab
@ -13,7 +13,32 @@
|
||||
#include "emu.h"
|
||||
#include "db50xg.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(DB50XG, db50xg_device, "db50xg", "Yamaha DB50XG")
|
||||
#include "cpu/h8/h83002.h"
|
||||
#include "sound/swp00.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class db50xg_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
db50xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~db50xg_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<h83002_device> m_cpu;
|
||||
required_device<swp00_device> m_swp00;
|
||||
|
||||
void map(address_map &map);
|
||||
};
|
||||
|
||||
db50xg_device::db50xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, DB50XG, tag, owner, clock),
|
||||
@ -43,11 +68,11 @@ void db50xg_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
H83002(config, m_cpu, 12_MHz_XTAL);
|
||||
m_cpu->set_addrmap(AS_PROGRAM, &db50xg_device::map);
|
||||
m_cpu->write_sci_tx<0>().set([this](int state) { m_connector->do_midi_tx(state); } );
|
||||
m_cpu->write_sci_tx<0>().set([this] (int state) { m_connector->do_midi_tx(state); });
|
||||
|
||||
SWP00(config, m_swp00);
|
||||
m_swp00->add_route(0, "^", 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_swp00->add_route(1, "^", 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
m_swp00->add_route(0, DEVICE_SELF_OWNER, 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_swp00->add_route(1, DEVICE_SELF_OWNER, 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
}
|
||||
|
||||
ROM_START( db50xg )
|
||||
@ -74,3 +99,6 @@ const tiny_rom_entry *db50xg_device::device_rom_region() const
|
||||
return ROM_NAME(db50xg);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(DB50XG, device_waveblaster_interface, db50xg_device, "db50xg", "Yamaha DB50XG")
|
||||
|
@ -6,30 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "waveblaster.h"
|
||||
#include "cpu/h8/h83002.h"
|
||||
#include "sound/swp00.h"
|
||||
|
||||
DECLARE_DEVICE_TYPE(DB50XG, db50xg_device)
|
||||
|
||||
class db50xg_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
db50xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~db50xg_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<h83002_device> m_cpu;
|
||||
required_device<swp00_device> m_swp00;
|
||||
|
||||
void map(address_map &map);
|
||||
};
|
||||
DECLARE_DEVICE_TYPE(DB50XG, device_waveblaster_interface)
|
||||
|
||||
#endif // MAME_BUS_WAVEBLASTER_DB50XG_H
|
||||
|
@ -11,7 +11,32 @@
|
||||
#include "emu.h"
|
||||
#include "db60xg.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(DB60XG, db60xg_device, "db60xg", "Yamaha DB60XG")
|
||||
#include "cpu/h8/h83002.h"
|
||||
#include "sound/swp00.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class db60xg_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
db60xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~db60xg_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<h83002_device> m_cpu;
|
||||
required_device<swp00_device> m_swp00;
|
||||
|
||||
void map(address_map &map);
|
||||
};
|
||||
|
||||
db60xg_device::db60xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, DB60XG, tag, owner, clock),
|
||||
@ -41,11 +66,11 @@ void db60xg_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
H83002(config, m_cpu, 12_MHz_XTAL);
|
||||
m_cpu->set_addrmap(AS_PROGRAM, &db60xg_device::map);
|
||||
m_cpu->write_sci_tx<0>().set([this](int state) { m_connector->do_midi_tx(state); } );
|
||||
m_cpu->write_sci_tx<0>().set([this] (int state) { m_connector->do_midi_tx(state); });
|
||||
|
||||
SWP00(config, m_swp00);
|
||||
m_swp00->add_route(0, "^", 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_swp00->add_route(1, "^", 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
m_swp00->add_route(0, DEVICE_SELF_OWNER, 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_swp00->add_route(1, DEVICE_SELF_OWNER, 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
}
|
||||
|
||||
ROM_START( db60xg )
|
||||
@ -72,3 +97,6 @@ const tiny_rom_entry *db60xg_device::device_rom_region() const
|
||||
return ROM_NAME(db60xg);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(DB60XG, device_waveblaster_interface, db60xg_device, "db60xg", "Yamaha DB60XG")
|
||||
|
@ -6,30 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "waveblaster.h"
|
||||
#include "cpu/h8/h83002.h"
|
||||
#include "sound/swp00.h"
|
||||
|
||||
DECLARE_DEVICE_TYPE(DB60XG, db60xg_device)
|
||||
|
||||
class db60xg_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
db60xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~db60xg_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<h83002_device> m_cpu;
|
||||
required_device<swp00_device> m_swp00;
|
||||
|
||||
void map(address_map &map);
|
||||
};
|
||||
DECLARE_DEVICE_TYPE(DB60XG, device_waveblaster_interface)
|
||||
|
||||
#endif // MAME_BUS_WAVEBLASTER_DB60XG_H
|
||||
|
@ -6,7 +6,27 @@
|
||||
#include "emu.h"
|
||||
#include "omniwave.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(OMNIWAVE, omniwave_device, "omniwave", "Samsung Omniwave")
|
||||
#include "sound/ks0164.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class omniwave_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
omniwave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~omniwave_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<ks0164_device> m_ks0164;
|
||||
};
|
||||
|
||||
omniwave_device::omniwave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, OMNIWAVE, tag, owner, clock),
|
||||
@ -27,9 +47,9 @@ void omniwave_device::midi_rx(int state)
|
||||
void omniwave_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
KS0164(config, m_ks0164, 16.9344_MHz_XTAL);
|
||||
m_ks0164->add_route(0, "^", 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_ks0164->add_route(1, "^", 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
m_ks0164->midi_tx().set([this](int state) { m_connector->do_midi_tx(state); } );
|
||||
m_ks0164->add_route(0, DEVICE_SELF_OWNER, 1.0, AUTO_ALLOC_INPUT, 0);
|
||||
m_ks0164->add_route(1, DEVICE_SELF_OWNER, 1.0, AUTO_ALLOC_INPUT, 1);
|
||||
m_ks0164->midi_tx().set([this] (int state) { m_connector->do_midi_tx(state); });
|
||||
}
|
||||
|
||||
ROM_START( omniwave )
|
||||
@ -46,3 +66,6 @@ const tiny_rom_entry *omniwave_device::device_rom_region() const
|
||||
return ROM_NAME(omniwave);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(OMNIWAVE, device_waveblaster_interface, omniwave_device, "omniwave", "Samsung Omniwave")
|
||||
|
@ -6,25 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "waveblaster.h"
|
||||
#include "sound/ks0164.h"
|
||||
|
||||
DECLARE_DEVICE_TYPE(OMNIWAVE, omniwave_device)
|
||||
|
||||
class omniwave_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
omniwave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~omniwave_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<ks0164_device> m_ks0164;
|
||||
};
|
||||
DECLARE_DEVICE_TYPE(OMNIWAVE, device_waveblaster_interface)
|
||||
|
||||
#endif // MAME_BUS_WAVEBLASTER_OMNIWAVE_H
|
||||
|
@ -8,10 +8,31 @@
|
||||
#include "emu.h"
|
||||
#include "wg130.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(WG130, wg130_device, "wg130", "Casio WG-130")
|
||||
#include "cpu/h8/gt913.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class wg130_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
wg130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~wg130_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<gt913_device> m_gt913;
|
||||
|
||||
void map(address_map &map);
|
||||
};
|
||||
|
||||
INPUT_PORTS_START(wg130)
|
||||
PORT_START("gt913:kbd:FI0")
|
||||
PORT_START("gt913:kbd:FI1")
|
||||
@ -29,8 +50,6 @@ INPUT_PORTS_START(wg130)
|
||||
PORT_START("gt913:kbd:KI2")
|
||||
INPUT_PORTS_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
wg130_device::wg130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, WG130, tag, owner, clock),
|
||||
device_waveblaster_interface(mconfig, *this),
|
||||
@ -64,7 +83,7 @@ void wg130_device::device_add_mconfig(machine_config &config)
|
||||
m_gt913->write_port1().set_nop();
|
||||
m_gt913->read_port2().set_constant(0xff);
|
||||
m_gt913->write_port2().set_nop();
|
||||
m_gt913->write_sci_tx<1>().set([this](int state) { m_connector->do_midi_tx(state); } );
|
||||
m_gt913->write_sci_tx<1>().set([this] (int state) { m_connector->do_midi_tx(state); });
|
||||
}
|
||||
|
||||
ROM_START( wg130 )
|
||||
@ -78,7 +97,7 @@ void wg130_device::device_start()
|
||||
the version of this ROM bundled with the SW-10 softsynth has little endian samples, so byteswap them
|
||||
(and stop at the end of sample data, not the end of the whole ROM, otherwise the ROM test fails)
|
||||
*/
|
||||
uint16_t* rom = (uint16_t*)memregion("gt913")->base();
|
||||
uint16_t *const rom = reinterpret_cast<uint16_t *>(memregion("gt913")->base());
|
||||
for (uint32_t addr = 0x2f000 >> 1; addr < 0x1fe8c2 >> 1; addr++)
|
||||
rom[addr] = swapendian_int16(rom[addr]);
|
||||
}
|
||||
@ -92,3 +111,7 @@ ioport_constructor wg130_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME(wg130);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(WG130, device_waveblaster_interface, wg130_device, "wg130", "Casio WG-130")
|
||||
|
@ -6,28 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "waveblaster.h"
|
||||
#include "cpu/h8/gt913.h"
|
||||
|
||||
DECLARE_DEVICE_TYPE(WG130, wg130_device)
|
||||
|
||||
class wg130_device : public device_t, public device_waveblaster_interface
|
||||
{
|
||||
public:
|
||||
wg130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~wg130_device();
|
||||
|
||||
virtual void midi_rx(int state) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<gt913_device> m_gt913;
|
||||
|
||||
void map(address_map &map);
|
||||
};
|
||||
DECLARE_DEVICE_TYPE(WG130, device_waveblaster_interface)
|
||||
|
||||
#endif // MAME_BUS_WAVEBLASTER_WG130_H
|
||||
|
@ -1670,14 +1670,14 @@ void ioport_port::insert_field(ioport_field &newfield, ioport_value &disallowedb
|
||||
for (ioport_field *field = m_fieldlist.first(); field != nullptr; field = nextfield)
|
||||
{
|
||||
nextfield = field->next();
|
||||
if ((field->mask() & newfield.mask()) != 0 &&
|
||||
if ((field->mask() & newfield.mask()) &&
|
||||
(newfield.condition().none() || field->condition().none() || field->condition() == newfield.condition()))
|
||||
{
|
||||
// reduce the mask of the field we found
|
||||
field->reduce_mask(newfield.mask());
|
||||
|
||||
// if the new entry fully overrides the previous one, we nuke
|
||||
if (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS || field->mask() == 0)
|
||||
if (!field->mask() || (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS && (field->type() != IPT_UNUSED) && (field->type() != IPT_UNKNOWN)))
|
||||
m_fieldlist.remove(*field);
|
||||
}
|
||||
}
|
||||
|
@ -751,7 +751,6 @@ static INPUT_PORTS_START( primrage )
|
||||
|
||||
/* primrage has a dedicated start button */
|
||||
PORT_MODIFY( "P1_P2" )
|
||||
PORT_BIT( 0x000000f5, IP_ACTIVE_LOW, IPT_UNUSED ) // TODO: remove this if "temporary" INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS is actually removed
|
||||
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
|
||||
INPUT_PORTS_END
|
||||
|
Loading…
Reference in New Issue
Block a user