summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/cbus/pc9801_26.cpp65
-rw-r--r--src/devices/bus/cbus/pc9801_26.h2
-rw-r--r--src/devices/bus/snes/event.cpp12
-rw-r--r--src/devices/bus/snes/upd.cpp68
-rw-r--r--src/devices/bus/ti99/peb/cc_fdc.cpp13
-rw-r--r--src/devices/cpu/upd7725/upd7725.cpp30
-rw-r--r--src/devices/cpu/upd7725/upd7725.h10
-rw-r--r--src/devices/sound/c6280.cpp71
-rw-r--r--src/devices/sound/c6280.h1
-rw-r--r--src/devices/video/upd7220.h8
10 files changed, 175 insertions, 105 deletions
diff --git a/src/devices/bus/cbus/pc9801_26.cpp b/src/devices/bus/cbus/pc9801_26.cpp
index d767b0eeace..e86a276c619 100644
--- a/src/devices/bus/cbus/pc9801_26.cpp
+++ b/src/devices/bus/cbus/pc9801_26.cpp
@@ -32,6 +32,7 @@ pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *ta
, m_bus(*this, DEVICE_SELF_OWNER)
, m_opn(*this, "opn")
, m_joy(*this, "joy_p%u", 1U)
+ , m_irq_jp(*this, "JP6A1_JP6A3")
{
}
@@ -39,15 +40,41 @@ 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([this] (int state) { m_bus->int_w<5>(state); });
+ 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] () {
- if(BIT(m_joy_sel, 7))
- return m_joy[BIT(m_joy_sel, 6)]->read();
-
- return (u8)0xff;
+ 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
@@ -86,15 +113,14 @@ const tiny_rom_entry *pc9801_26_device::device_rom_region() const
static INPUT_PORTS_START( pc9801_26 )
// 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("OPN_JP6A2")
+ 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("JP6A2")
PORT_CONFNAME( 0x07, 0x01, "PC-9801-26: Sound ROM address")
PORT_CONFSETTING( 0x00, "0xc8000" ) // 1-10
PORT_CONFSETTING( 0x01, "0xcc000" ) // 2-9
@@ -102,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
@@ -115,7 +141,7 @@ ioport_constructor pc9801_26_device::device_input_ports() const
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()
@@ -129,7 +155,7 @@ void pc9801_26_device::device_start()
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());
@@ -167,9 +193,8 @@ 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
diff --git a/src/devices/bus/cbus/pc9801_26.h b/src/devices/bus/cbus/pc9801_26.h
index 2b6bc9e98e7..c3576e67286 100644
--- a/src/devices/bus/cbus/pc9801_26.h
+++ b/src/devices/bus/cbus/pc9801_26.h
@@ -46,10 +46,12 @@ 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;
u32 m_rom_base;
u16 m_io_base;
u8 m_joy_sel;
+ u8 m_int_level;
};
diff --git a/src/devices/bus/snes/event.cpp b/src/devices/bus/snes/event.cpp
index 5ce5bbca97c..fe9a367e54d 100644
--- a/src/devices/bus/snes/event.cpp
+++ b/src/devices/bus/snes/event.cpp
@@ -113,8 +113,10 @@ uint8_t sns_pfest94_device::chip_read(offs_t offset)
else
{
// DSP access
- offset &= 0x1fff;
- return m_upd7725->snesdsp_read(offset < 0x1000);
+ if (BIT(offset, 12))
+ return m_upd7725->status_r();
+ else
+ return m_upd7725->data_r();
}
}
@@ -151,8 +153,10 @@ void sns_pfest94_device::chip_write(offs_t offset, uint8_t data)
else
{
// DSP access
- offset &= 0x1fff;
- m_upd7725->snesdsp_write(offset < 0x1000, data);
+ if (BIT(~offset, 12))
+ m_upd7725->data_w(data);
+ else
+ logerror("%s: Writing DSP status to %02x, ignored", machine().describe_context(), data);
}
}
diff --git a/src/devices/bus/snes/upd.cpp b/src/devices/bus/snes/upd.cpp
index 476a1b42544..aa64a656d0d 100644
--- a/src/devices/bus/snes/upd.cpp
+++ b/src/devices/bus/snes/upd.cpp
@@ -13,13 +13,13 @@
// helpers
-inline uint32_t get_prg(uint8_t *CPU, uint32_t addr)
+inline uint32_t get_prg(uint8_t const *CPU, uint32_t addr)
{
- return ((CPU[addr * 4] << 24) | (CPU[addr * 4 + 1] << 16) | (CPU[addr * 4 + 2] << 8) | 0x00);
+ return (CPU[addr * 4] << 24) | (CPU[addr * 4 + 1] << 16) | (CPU[addr * 4 + 2] << 8) | 0x00;
}
-inline uint16_t get_data(uint8_t *CPU, uint32_t addr)
+inline uint16_t get_data(uint8_t const *CPU, uint32_t addr)
{
- return ((CPU[addr * 2] << 8) | CPU[addr * 2 + 1]);
+ return (CPU[addr * 2] << 8) | CPU[addr * 2 + 1];
}
//-------------------------------------------------
@@ -141,15 +141,19 @@ void sns_rom20_necdsp_device::device_add_mconfig(machine_config &config)
uint8_t sns_rom20_necdsp_device::chip_read(offs_t offset)
{
- offset &= 0x7fff;
- return m_upd7725->snesdsp_read(offset < 0x4000);
+ if (BIT(offset, 14))
+ return m_upd7725->status_r();
+ else
+ return m_upd7725->data_r();
}
void sns_rom20_necdsp_device::chip_write(offs_t offset, uint8_t data)
{
- offset &= 0x7fff;
- m_upd7725->snesdsp_write(offset < 0x4000, data);
+ if (BIT(~offset, 14))
+ m_upd7725->data_w(data);
+ else
+ logerror("%s: Writing DSP status to %02x, ignored", machine().describe_context(), data);
}
@@ -199,15 +203,19 @@ void sns_rom21_necdsp_device::device_add_mconfig(machine_config &config)
uint8_t sns_rom21_necdsp_device::chip_read(offs_t offset)
{
- offset &= 0x1fff;
- return m_upd7725->snesdsp_read(offset < 0x1000);
+ if (BIT(offset, 12))
+ return m_upd7725->status_r();
+ else
+ return m_upd7725->data_r();
}
void sns_rom21_necdsp_device::chip_write(offs_t offset, uint8_t data)
{
- offset &= 0x1fff;
- m_upd7725->snesdsp_write(offset < 0x1000, data);
+ if (BIT(~offset, 12))
+ m_upd7725->data_w(data);
+ else
+ logerror("%s: Writing DSP status to %02x, ignored", machine().describe_context(), data);
}
@@ -220,13 +228,18 @@ void sns_rom21_necdsp_device::chip_write(offs_t offset, uint8_t data)
uint8_t sns_rom_setadsp_device::chip_read(offs_t offset)
{
if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)
- m_upd96050->snesdsp_read((offset & 0x01) ? false : true);
+ {
+ if (BIT(offset, 0))
+ return m_upd96050->status_r();
+ else
+ return m_upd96050->data_r();
+ }
if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000)
{
- uint16_t address = offset & 0xffff;
- uint16_t temp = m_upd96050->dataram_r(address/2);
- if (offset & 1)
+ uint16_t const address = offset & 0xffff;
+ uint16_t const temp = m_upd96050->dataram_r(address >> 1);
+ if (BIT(offset, 0))
return temp >> 8;
else
return temp & 0xff;
@@ -240,27 +253,18 @@ void sns_rom_setadsp_device::chip_write(offs_t offset, uint8_t data)
{
if (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000)
{
- m_upd96050->snesdsp_write((offset & 0x01) ? false : true, data);
+ if (BIT(~offset, 0))
+ m_upd96050->data_w(data);
+ else
+ logerror("%s: Writing DSP status to %02x, ignored", machine().describe_context(), data);
return;
}
if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000)
{
- uint16_t address = offset & 0xffff;
- uint16_t temp = m_upd96050->dataram_r(address/2);
-
- if (offset & 1)
- {
- temp &= 0xff;
- temp |= data << 8;
- }
- else
- {
- temp &= 0xff00;
- temp |= data;
- }
-
- m_upd96050->dataram_w(address/2, temp);
+ uint16_t const address = (offset & 0xffff) >> 1;
+ uint8_t const shift = BIT(offset, 0) << 3;
+ m_upd96050->dataram_w(address, (uint16_t(data) << 8) | data, uint16_t(0xff) << shift);
return;
}
}
diff --git a/src/devices/bus/ti99/peb/cc_fdc.cpp b/src/devices/bus/ti99/peb/cc_fdc.cpp
index 88fa46d2aa3..7663abe04d8 100644
--- a/src/devices/bus/ti99/peb/cc_fdc.cpp
+++ b/src/devices/bus/ti99/peb/cc_fdc.cpp
@@ -367,8 +367,10 @@ void corcomp_fdc_device::select_dsk(int state)
if (m_floppy[m_selected_drive-1]->get_device() != nullptr)
{
m_wdc->set_floppy(m_floppy[m_selected_drive-1]->get_device());
- m_floppy[m_selected_drive-1]->get_device()->ss_w(m_tms9901->read_bit(tms9901_device::INT15_P7));
+ side_select(m_tms9901->read_bit(tms9901_device::INT15_P7));
}
+ else
+ LOGMASKED(LOG_WARN, "No drive connected as DSK%d\n", m_selected_drive);
}
}
@@ -377,8 +379,13 @@ void corcomp_fdc_device::side_select(int state)
// Select side of disk (bit 7)
if (m_selected_drive != 0)
{
- LOGMASKED(LOG_DRIVE, "Set side (bit 7) = %d on DSK%d\n", state, m_selected_drive);
- m_floppy[m_selected_drive-1]->get_device()->ss_w(state);
+ if (m_floppy[m_selected_drive-1]->get_device() != nullptr)
+ {
+ LOGMASKED(LOG_DRIVE, "Set side (bit 7) = %d on DSK%d\n", state, m_selected_drive);
+ m_floppy[m_selected_drive-1]->get_device()->ss_w(state);
+ }
+ else
+ LOGMASKED(LOG_WARN, "No drive connected as DSK%d\n", m_selected_drive);
}
}
diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp
index 5f20a7b8c3a..a7d43f50e68 100644
--- a/src/devices/cpu/upd7725/upd7725.cpp
+++ b/src/devices/cpu/upd7725/upd7725.cpp
@@ -569,38 +569,44 @@ void necdsp_device::exec_ld(uint32_t opcode) {
}
}
-uint8_t necdsp_device::snesdsp_read(bool mode) {
- if (!mode)
- {
- return regs.sr >> 8;
- }
+uint8_t necdsp_device::status_r()
+{
+ return regs.sr >> 8;
+}
+
+uint8_t necdsp_device::data_r()
+{
if (regs.sr.drc == 0)
{
//16-bit
if(regs.sr.drs == 0)
{
- regs.sr.drs = 1;
+ if (!machine().side_effects_disabled())
+ regs.sr.drs = 1;
return regs.dr >> 0;
}
else
{
- regs.sr.rqm = 0;
- regs.sr.drs = 0;
+ if (!machine().side_effects_disabled())
+ {
+ regs.sr.rqm = 0;
+ regs.sr.drs = 0;
+ }
return regs.dr >> 8;
}
}
else
{
//8-bit
- regs.sr.rqm = 0;
+ if (!machine().side_effects_disabled())
+ regs.sr.rqm = 0;
return regs.dr >> 0;
}
}
-void necdsp_device::snesdsp_write(bool mode, uint8_t data) {
- if (!mode) return;
-
+void necdsp_device::data_w(uint8_t data)
+{
if (regs.sr.drc == 0)
{
//16-bit
diff --git a/src/devices/cpu/upd7725/upd7725.h b/src/devices/cpu/upd7725/upd7725.h
index 7e70e5642c5..d77e3620dcf 100644
--- a/src/devices/cpu/upd7725/upd7725.h
+++ b/src/devices/cpu/upd7725/upd7725.h
@@ -36,8 +36,9 @@ public:
auto p0() { return m_out_p0_cb.bind(); }
auto p1() { return m_out_p1_cb.bind(); }
- uint8_t snesdsp_read(bool mode);
- void snesdsp_write(bool mode, uint8_t data);
+ uint8_t status_r();
+ uint8_t data_r();
+ void data_w(uint8_t data);
protected:
// construction/destruction
@@ -175,7 +176,10 @@ public:
upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
uint16_t dataram_r(uint16_t addr) { return dataRAM[addr & 0x07ff]; }
- void dataram_w(uint16_t addr, uint16_t data) { dataRAM[addr & 0x07ff] = data; }
+ void dataram_w(uint16_t addr, uint16_t data, uint16_t mem_mask = uint16_t(~0))
+ {
+ COMBINE_DATA(&dataRAM[addr & 0x07ff]);
+ }
};
// device type definition
diff --git a/src/devices/sound/c6280.cpp b/src/devices/sound/c6280.cpp
index c6f3e92a4fd..474a3bf57a6 100644
--- a/src/devices/sound/c6280.cpp
+++ b/src/devices/sound/c6280.cpp
@@ -44,6 +44,14 @@
void c6280_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
+ // Fast method if none of the channels are enabled (most Data East arcade games)
+ if (!(m_enabled & 0x3f))
+ {
+ outputs[0].fill(0);
+ outputs[1].fill(0);
+ return;
+ }
+
static const u8 scale_tab[16] =
{
0x00, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f,
@@ -53,24 +61,21 @@ void c6280_device::sound_stream_update(sound_stream &stream, std::vector<read_st
const u8 lmal = scale_tab[(m_balance >> 4) & 0x0f];
const u8 rmal = scale_tab[(m_balance >> 0) & 0x0f];
- /* Clear buffer */
- outputs[0].fill(0);
- outputs[1].fill(0);
-
for (int i = 0; i < outputs[0].samples(); i++)
{
s32 lout = 0, rout = 0;
for (int ch = 0; ch < 6; ch++)
{
- channel &chan = m_channel[ch];
- /* Only look at enabled channels */
- if (BIT(chan.control, 7))
+ // Only look at enabled channels
+ if (BIT(m_enabled, ch))
{
+ channel &chan = m_channel[ch];
+
const u8 lal = scale_tab[(chan.balance >> 4) & 0x0f];
const u8 ral = scale_tab[(chan.balance >> 0) & 0x0f];
const u8 al = chan.control & 0x1f;
- // verified from both patent and manual
+ // Verified from both patent and manual
int vll = (0x1f - lmal) + (0x1f - al) + (0x1f - lal);
if (vll > 0x1f) vll = 0x1f;
@@ -80,10 +85,10 @@ void c6280_device::sound_stream_update(sound_stream &stream, std::vector<read_st
vll = m_volume_table[vll];
vlr = m_volume_table[vlr];
- /* Check channel mode */
+ // Check channel mode
if ((ch >= 4) && BIT(chan.noise_control, 7))
{
- /* Noise mode */
+ // Noise mode
const u32 step = (chan.noise_control & 0x1f) ^ 0x1f;
const s16 data = BIT(chan.noise_seed, 0) ? 0x1f : 0;
chan.noise_counter--;
@@ -99,7 +104,7 @@ void c6280_device::sound_stream_update(sound_stream &stream, std::vector<read_st
}
else if (BIT(chan.control, 6))
{
- /* DDA mode */
+ // DDA mode
lout += vll * (chan.dda - 16);
rout += vlr * (chan.dda - 16);
}
@@ -109,7 +114,7 @@ void c6280_device::sound_stream_update(sound_stream &stream, std::vector<read_st
{
if (ch == 0)
{
- /* Waveform mode with LFO */
+ // Waveform mode with LFO
channel &lfo_srcchan = m_channel[1];
channel &lfo_dstchan = m_channel[0];
const u16 lfo_step = lfo_srcchan.frequency ? lfo_srcchan.frequency : 0x1000;
@@ -149,7 +154,7 @@ void c6280_device::sound_stream_update(sound_stream &stream, std::vector<read_st
}
else
{
- /* Waveform mode */
+ // Waveform mode
const u32 step = chan.frequency ? chan.frequency : 0x1000;
const s16 data = chan.waveform[chan.index];
chan.tick--;
@@ -222,30 +227,30 @@ void c6280_device::c6280_w(offs_t offset, uint8_t data)
{
channel &chan = m_channel[m_select];
- /* Update stream */
+ // Update stream
m_stream->update();
switch (offset & 0x0f)
{
- case 0x00: /* Channel select */
+ case 0x00: // Channel select
m_select = data & 0x07;
break;
- case 0x01: /* Global balance */
- m_balance = data;
+ case 0x01: // Global balance
+ m_balance = data;
break;
- case 0x02: /* Channel frequency (LSB) */
+ case 0x02: // Channel frequency (LSB)
chan.frequency = (chan.frequency & 0x0f00) | data;
break;
- case 0x03: /* Channel frequency (MSB) */
+ case 0x03: // Channel frequency (MSB)
chan.frequency = (chan.frequency & 0x00ff) | ((data << 8) & 0x0f00);
break;
- case 0x04: /* Channel control (key-on, DDA mode, volume) */
+ case 0x04: // Channel control (key-on, DDA mode, volume)
- /* 1-to-0 transition of DDA bit resets waveform index */
+ // 1-to-0 transition of DDA bit resets waveform index
if (BIT(chan.control, 6) && BIT(~data, 6))
{
chan.index = 0;
@@ -255,13 +260,17 @@ void c6280_device::c6280_w(offs_t offset, uint8_t data)
chan.tick = chan.frequency;
}
chan.control = data;
+
+ // Cache channel enable flag
+ m_enabled &= ~(1 << m_select);
+ m_enabled |= BIT(data, 7) << m_select;
break;
- case 0x05: /* Channel balance */
+ case 0x05: // Channel balance
chan.balance = data;
break;
- case 0x06: /* Channel waveform data */
+ case 0x06: // Channel waveform data
switch (chan.control & 0x40)
{
@@ -278,15 +287,15 @@ void c6280_device::c6280_w(offs_t offset, uint8_t data)
break;
- case 0x07: /* Noise control (enable, frequency) */
+ case 0x07: // Noise control (enable, frequency)
chan.noise_control = data;
break;
- case 0x08: /* LFO frequency */
+ case 0x08: // LFO frequency
m_lfo_frequency = data;
break;
- case 0x09: /* LFO control (enable, mode) */
+ case 0x09: // LFO control (enable, mode)
m_lfo_control = data;
break;
@@ -314,11 +323,12 @@ void c6280_device::device_clock_changed()
void c6280_device::device_start()
{
- /* Loudest volume level for table */
+ // Loudest volume level for table
double level = 65535.0 / 6.0 / 32.0;
- /* Clear context */
+ // Clear context
m_select = 0;
+ m_enabled = 0;
m_balance = 0;
m_lfo_frequency = 0;
m_lfo_control = 0;
@@ -326,8 +336,8 @@ void c6280_device::device_start()
m_stream = stream_alloc(0, 2, clock());
- /* Make volume table */
- /* PSG has 48dB volume range spread over 32 steps */
+ // Make volume table
+ // PSG has 48dB volume range spread over 32 steps
double step = 48.0 / 32.0;
for (int i = 0; i < 31; i++)
{
@@ -337,6 +347,7 @@ void c6280_device::device_start()
m_volume_table[31] = 0;
save_item(NAME(m_select));
+ save_item(NAME(m_enabled));
save_item(NAME(m_balance));
save_item(NAME(m_lfo_frequency));
save_item(NAME(m_lfo_control));
diff --git a/src/devices/sound/c6280.h b/src/devices/sound/c6280.h
index 407f5abaad0..dda6dbfa833 100644
--- a/src/devices/sound/c6280.h
+++ b/src/devices/sound/c6280.h
@@ -42,6 +42,7 @@ private:
// internal state
sound_stream *m_stream;
u8 m_select;
+ u8 m_enabled;
u8 m_balance;
u8 m_lfo_frequency;
u8 m_lfo_control;
diff --git a/src/devices/video/upd7220.h b/src/devices/video/upd7220.h
index 41d901bc07f..646d614bca0 100644
--- a/src/devices/video/upd7220.h
+++ b/src/devices/video/upd7220.h
@@ -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;