diff options
Diffstat (limited to 'src/devices/bus/isa/stereo_fx.cpp')
-rw-r--r-- | src/devices/bus/isa/stereo_fx.cpp | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/src/devices/bus/isa/stereo_fx.cpp b/src/devices/bus/isa/stereo_fx.cpp index b23a0dbe454..bfd6eb6cfe5 100644 --- a/src/devices/bus/isa/stereo_fx.cpp +++ b/src/devices/bus/isa/stereo_fx.cpp @@ -8,31 +8,31 @@ #include "stereo_fx.h" #include "sound/dac.h" -#include "sound/volt_reg.h" #include "speaker.h" DEFINE_DEVICE_TYPE(ISA8_STEREO_FX, stereo_fx_device, "stereo_fx", "ATi Stereo F/X Audio Adapter") -READ8_MEMBER( stereo_fx_device::dev_dsp_data_r ) +uint8_t stereo_fx_device::dev_dsp_data_r() { - m_data_in = false; + if (!machine().side_effects_disabled()) + m_data_in = false; return m_in_byte; } -WRITE8_MEMBER( stereo_fx_device::dev_dsp_data_w ) +void stereo_fx_device::dev_dsp_data_w(uint8_t data) { m_data_out = true; m_out_byte = data; } // port 1 is the left DAC but is written and read bitwise during capture -READ8_MEMBER( stereo_fx_device::p1_r ) +uint8_t stereo_fx_device::p1_r() { return 0x80; } -READ8_MEMBER( stereo_fx_device::p3_r ) +uint8_t stereo_fx_device::p3_r() { uint8_t ret = 0; @@ -43,17 +43,17 @@ READ8_MEMBER( stereo_fx_device::p3_r ) return ret; } -WRITE8_MEMBER( stereo_fx_device::p3_w ) +void stereo_fx_device::p3_w(uint8_t data) { m_t1 = (data & 0x20) >> 5; } -WRITE8_MEMBER( stereo_fx_device::dev_host_irq_w ) +void stereo_fx_device::dev_host_irq_w(uint8_t data) { m_isa->irq5_w(1); } -WRITE8_MEMBER( stereo_fx_device::raise_drq_w ) +void stereo_fx_device::raise_drq_w(uint8_t data) { m_isa->drq1_w(1); } @@ -68,7 +68,7 @@ WRITE8_MEMBER( stereo_fx_device::raise_drq_w ) * bit6 - * bit7 - */ -WRITE8_MEMBER( stereo_fx_device::port20_w ) +void stereo_fx_device::port20_w(uint8_t data) { m_port20 = data; } @@ -83,7 +83,7 @@ WRITE8_MEMBER( stereo_fx_device::port20_w ) * bit6 - * bit7 - */ -WRITE8_MEMBER( stereo_fx_device::port00_w ) +void stereo_fx_device::port00_w(uint8_t data) { m_port00 = data; } @@ -98,7 +98,7 @@ void stereo_fx_device::stereo_fx_io(address_map &map) map(0xFF00, 0xFF00).w(FUNC(stereo_fx_device::port00_w)); map(0xFF10, 0xFF10).w("rdac", FUNC(dac_byte_interface::data_w)); map(0xFF20, 0xFF20).w(FUNC(stereo_fx_device::port20_w)); - //AM_RANGE(0xFF30, 0xFF30) AM_WRITE() // used only on reset and undocumented cmd 0xc4 + //map(0xFF30, 0xFF30).w(FUNC(stereo_fx_device::)); // used only on reset and undocumented cmd 0xc4 map(0xFF40, 0xFF40).rw(FUNC(stereo_fx_device::dev_dsp_data_r), FUNC(stereo_fx_device::dev_dsp_data_w)); map(0xFF50, 0xFF50).w(FUNC(stereo_fx_device::raise_drq_w)); map(0xFF60, 0xFF60).w(FUNC(stereo_fx_device::dev_host_irq_w)); @@ -124,31 +124,26 @@ void stereo_fx_device::device_add_mconfig(machine_config &config) m_cpu->port_in_cb<3>().set(FUNC(stereo_fx_device::p3_r)); m_cpu->port_out_cb<3>().set(FUNC(stereo_fx_device::p3_w)); - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); + SPEAKER(config, "speaker", 2).front(); ym3812_device &ym3812(YM3812(config, "ym3812", XTAL(3'579'545))); - ym3812.add_route(ALL_OUTPUTS, "lspeaker", 1.00); - ym3812.add_route(ALL_OUTPUTS, "rspeaker", 1.00); + ym3812.add_route(ALL_OUTPUTS, "speaker", 1.00, 0); + ym3812.add_route(ALL_OUTPUTS, "speaker", 1.00, 1); /* no CM/S support (empty sockets) */ - DAC_8BIT_R2R(config, "ldac", 0).add_route(ALL_OUTPUTS, "lspeaker", 0.5); // unknown DAC - DAC_8BIT_R2R(config, "rdac", 0).add_route(ALL_OUTPUTS, "rspeaker", 0.5); // unknown DAC - voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0)); - vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT); - vref.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT); - vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT); - vref.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT); + DAC_8BIT_R2R(config, "ldac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5, 0); // unknown DAC + DAC_8BIT_R2R(config, "rdac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5, 1); // unknown DAC PC_JOY(config, m_joy); } -READ8_MEMBER( stereo_fx_device::dsp_data_r ) +uint8_t stereo_fx_device::dsp_data_r() { - m_data_out = false; + if (!machine().side_effects_disabled()) + m_data_out = false; return m_out_byte; } -WRITE8_MEMBER( stereo_fx_device::dsp_cmd_w ) +void stereo_fx_device::dsp_cmd_w(uint8_t data) { m_data_in = true; m_in_byte = data; @@ -168,31 +163,33 @@ void stereo_fx_device::dack_w(int line, uint8_t data) m_in_byte = data; } -WRITE8_MEMBER( stereo_fx_device::dsp_reset_w ) +void stereo_fx_device::dsp_reset_w(uint8_t data) { device_reset(); m_cpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); } -READ8_MEMBER( stereo_fx_device::dsp_wbuf_status_r ) +uint8_t stereo_fx_device::dsp_wbuf_status_r() { return m_data_in << 7; } -READ8_MEMBER( stereo_fx_device::dsp_rbuf_status_r ) +uint8_t stereo_fx_device::dsp_rbuf_status_r() { - m_isa->irq5_w(0); + if (!machine().side_effects_disabled()) + m_isa->irq5_w(0); return m_data_out << 7; } -WRITE8_MEMBER( stereo_fx_device::invalid_w ) +void stereo_fx_device::invalid_w(uint8_t data) { logerror("stereo fx: invalid port write\n"); } -READ8_MEMBER( stereo_fx_device::invalid_r ) +uint8_t stereo_fx_device::invalid_r() { - logerror("stereo fx: invalid port read\n"); + if (!machine().side_effects_disabled()) + logerror("stereo fx: invalid port read\n"); return 0xff; } @@ -207,17 +204,17 @@ stereo_fx_device::stereo_fx_device(const machine_config &mconfig, const char *ta void stereo_fx_device::device_start() { - ym3812_device *ym3812 = subdevice<ym3812_device>("ym3812"); + ym3812_device &ym3812 = *subdevice<ym3812_device>("ym3812"); set_isa_device(); - m_isa->install_device(0x0200, 0x0207, read8_delegate(FUNC(pc_joy_device::joy_port_r), subdevice<pc_joy_device>("pc_joy")), write8_delegate(FUNC(pc_joy_device::joy_port_w), subdevice<pc_joy_device>("pc_joy"))); - m_isa->install_device(0x0226, 0x0227, read8_delegate(FUNC(stereo_fx_device::invalid_r), this), write8_delegate(FUNC(stereo_fx_device::dsp_reset_w), this)); - m_isa->install_device(0x022a, 0x022b, read8_delegate(FUNC(stereo_fx_device::dsp_data_r), this), write8_delegate(FUNC(stereo_fx_device::invalid_w), this) ); - m_isa->install_device(0x022c, 0x022d, read8_delegate(FUNC(stereo_fx_device::dsp_wbuf_status_r), this), write8_delegate(FUNC(stereo_fx_device::dsp_cmd_w), this) ); - m_isa->install_device(0x022e, 0x022f, read8_delegate(FUNC(stereo_fx_device::dsp_rbuf_status_r), this), write8_delegate(FUNC(stereo_fx_device::invalid_w), this) ); - m_isa->install_device(0x0388, 0x0389, read8sm_delegate(FUNC(ym3812_device::read), ym3812), write8sm_delegate(FUNC(ym3812_device::write), ym3812)); - m_isa->install_device(0x0228, 0x0229, read8sm_delegate(FUNC(ym3812_device::read), ym3812), write8sm_delegate(FUNC(ym3812_device::write), ym3812)); - m_timer = timer_alloc(); + m_isa->install_device(0x0200, 0x0207, read8smo_delegate(*subdevice<pc_joy_device>("pc_joy"), FUNC(pc_joy_device::joy_port_r)), write8smo_delegate(*subdevice<pc_joy_device>("pc_joy"), FUNC(pc_joy_device::joy_port_w))); + m_isa->install_device(0x0226, 0x0227, read8smo_delegate(*this, FUNC(stereo_fx_device::invalid_r)), write8smo_delegate(*this, FUNC(stereo_fx_device::dsp_reset_w))); + m_isa->install_device(0x022a, 0x022b, read8smo_delegate(*this, FUNC(stereo_fx_device::dsp_data_r)), write8smo_delegate(*this, FUNC(stereo_fx_device::invalid_w))); + m_isa->install_device(0x022c, 0x022d, read8smo_delegate(*this, FUNC(stereo_fx_device::dsp_wbuf_status_r)), write8smo_delegate(*this, FUNC(stereo_fx_device::dsp_cmd_w))); + m_isa->install_device(0x022e, 0x022f, read8smo_delegate(*this, FUNC(stereo_fx_device::dsp_rbuf_status_r)), write8smo_delegate(*this, FUNC(stereo_fx_device::invalid_w))); + m_isa->install_device(0x0388, 0x0389, read8sm_delegate(ym3812, FUNC(ym3812_device::read)), write8sm_delegate(ym3812, FUNC(ym3812_device::write))); + m_isa->install_device(0x0228, 0x0229, read8sm_delegate(ym3812, FUNC(ym3812_device::read)), write8sm_delegate(ym3812, FUNC(ym3812_device::write))); + m_timer = timer_alloc(FUNC(stereo_fx_device::clock_tick), this); m_timer->adjust(attotime::from_hz(2000000), 0, attotime::from_hz(2000000)); m_isa->set_dma_channel(1, this, false); } @@ -234,7 +231,7 @@ void stereo_fx_device::device_reset() m_t0 = CLEAR_LINE; } -void stereo_fx_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) +TIMER_CALLBACK_MEMBER(stereo_fx_device::clock_tick) { m_t0 = !m_t0; m_cpu->set_input_line(MCS51_T0_LINE, m_t0); |