diff options
Diffstat (limited to 'src/mess/machine/a2mockingboard.c')
-rw-r--r-- | src/mess/machine/a2mockingboard.c | 630 |
1 files changed, 315 insertions, 315 deletions
diff --git a/src/mess/machine/a2mockingboard.c b/src/mess/machine/a2mockingboard.c index cb1c8b10aeb..fe8bf52cd45 100644 --- a/src/mess/machine/a2mockingboard.c +++ b/src/mess/machine/a2mockingboard.c @@ -30,9 +30,9 @@ const device_type A2BUS_PHASOR = &device_creator<a2bus_phasor_device>; static const ay8910_interface mockingboard_ay8910_interface = { - AY8910_LEGACY_OUTPUT, - AY8910_DEFAULT_LOADS, - DEVCB_NULL + AY8910_LEGACY_OUTPUT, + AY8910_DEFAULT_LOADS, + DEVCB_NULL }; const via6522_interface mockingboard_via1_intf = @@ -61,33 +61,33 @@ MACHINE_CONFIG_FRAGMENT( mockingboard ) MCFG_VIA6522_ADD(VIA1_TAG, 1022727, mockingboard_via1_intf) MCFG_VIA6522_ADD(VIA2_TAG, 1022727, mockingboard_via2_intf) - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727) - MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727) - MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727) + MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727) + MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) MACHINE_CONFIG_END MACHINE_CONFIG_FRAGMENT( phasor ) MCFG_VIA6522_ADD(VIA1_TAG, 1022727, mockingboard_via1_intf) MCFG_VIA6522_ADD(VIA2_TAG, 1022727, mockingboard_via2_intf) - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SPEAKER_STANDARD_STEREO("lspeaker2", "rspeaker2") - MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727) - MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727) - MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker2", 1.0) - MCFG_SOUND_ADD(AY3_TAG, AY8913, 1022727) - MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_SOUND_ADD(AY4_TAG, AY8913, 1022727) - MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker2", 1.0) + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_STEREO("lspeaker2", "rspeaker2") + MCFG_SOUND_ADD(AY1_TAG, AY8913, 1022727) + MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ADD(AY2_TAG, AY8913, 1022727) + MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker2", 1.0) + MCFG_SOUND_ADD(AY3_TAG, AY8913, 1022727) + MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + MCFG_SOUND_ADD(AY4_TAG, AY8913, 1022727) + MCFG_SOUND_CONFIG(mockingboard_ay8910_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker2", 1.0) MACHINE_CONFIG_END //------------------------------------------------- @@ -110,31 +110,31 @@ machine_config_constructor a2bus_phasor_device::device_mconfig_additions() const //************************************************************************** a2bus_ayboard_device::a2bus_ayboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : - device_t(mconfig, type, name, tag, owner, clock), - device_a2bus_card_interface(mconfig, *this), - m_via1(*this, VIA1_TAG), - m_via2(*this, VIA2_TAG), - m_ay1(*this, AY1_TAG), - m_ay2(*this, AY2_TAG), - m_ay3(*this, AY3_TAG), - m_ay4(*this, AY4_TAG) + device_t(mconfig, type, name, tag, owner, clock), + device_a2bus_card_interface(mconfig, *this), + m_via1(*this, VIA1_TAG), + m_via2(*this, VIA2_TAG), + m_ay1(*this, AY1_TAG), + m_ay2(*this, AY2_TAG), + m_ay3(*this, AY3_TAG), + m_ay4(*this, AY4_TAG) { } a2bus_mockingboard_device::a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - a2bus_ayboard_device(mconfig, A2BUS_MOCKINGBOARD, "Sweet Micro Systems Mockingboard", tag, owner, clock) + a2bus_ayboard_device(mconfig, A2BUS_MOCKINGBOARD, "Sweet Micro Systems Mockingboard", tag, owner, clock) { m_shortname = "a2mockbd"; - m_isPhasor = false; - m_PhasorNative = false; + m_isPhasor = false; + m_PhasorNative = false; } a2bus_phasor_device::a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - a2bus_ayboard_device(mconfig, A2BUS_PHASOR, "Applied Engineering Phasor", tag, owner, clock) + a2bus_ayboard_device(mconfig, A2BUS_PHASOR, "Applied Engineering Phasor", tag, owner, clock) { m_shortname = "a2phasor"; - m_isPhasor = true; - m_PhasorNative = false; + m_isPhasor = true; + m_PhasorNative = false; } //------------------------------------------------- @@ -152,7 +152,7 @@ void a2bus_ayboard_device::device_start() void a2bus_ayboard_device::device_reset() { - m_porta1 = m_porta2 = 0; + m_porta1 = m_porta2 = 0; } /*------------------------------------------------- @@ -162,48 +162,48 @@ void a2bus_ayboard_device::device_reset() UINT8 a2bus_ayboard_device::read_cnxx(address_space &space, UINT8 offset) { // printf("Mockingboard(%d): read @ Cn%02X (PC=%x)\n", m_slot, offset, space.device().safe_pc()); - if (m_isPhasor) - { - UINT8 retVal = 0; - int viaSel; - - if (m_PhasorNative) - { - viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4); - } - else - { - viaSel = (offset & 0x80) ? 2 : 1; - } - - if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0)) - { - if (viaSel & 1) - { - retVal |= m_via1->read(space, offset & 0xf); - } - - if (viaSel & 2) - { - retVal |= m_via2->read(space, offset & 0xf); - } - } - - return retVal; - } - else - { - if (offset <= 0x10) - { - return m_via1->read(space, offset & 0xf); - } - else if (offset >= 0x80 && offset <= 0x90) - { - return m_via2->read(space, offset & 0xf); - } - } - - return 0; + if (m_isPhasor) + { + UINT8 retVal = 0; + int viaSel; + + if (m_PhasorNative) + { + viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4); + } + else + { + viaSel = (offset & 0x80) ? 2 : 1; + } + + if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0)) + { + if (viaSel & 1) + { + retVal |= m_via1->read(space, offset & 0xf); + } + + if (viaSel & 2) + { + retVal |= m_via2->read(space, offset & 0xf); + } + } + + return retVal; + } + else + { + if (offset <= 0x10) + { + return m_via1->read(space, offset & 0xf); + } + else if (offset >= 0x80 && offset <= 0x90) + { + return m_via2->read(space, offset & 0xf); + } + } + + return 0; } /*------------------------------------------------- @@ -212,73 +212,73 @@ UINT8 a2bus_ayboard_device::read_cnxx(address_space &space, UINT8 offset) void a2bus_ayboard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) { - if (m_isPhasor) - { - if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0)) - { - int viaSel; - - if (m_PhasorNative) - { - viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4); - } - else - { - viaSel = (offset & 0x80) ? 2 : 1; - } + if (m_isPhasor) + { + if ((offset <= 0x20) || (offset >= 0x80 && offset <= 0xa0)) + { + int viaSel; + + if (m_PhasorNative) + { + viaSel = ((offset & 0x80)>> 6) | ((offset & 0x10)>> 4); + } + else + { + viaSel = (offset & 0x80) ? 2 : 1; + } // printf("Phasor(%d): write %02x to Cn%02X (PC=%x) (native %d viaSel %d)\n", m_slot, data, offset, space.device().safe_pc(), m_PhasorNative ? 1 : 0, viaSel); - if (viaSel & 1) - { - m_via1->write(space, offset&0xf, data); - } - if (viaSel & 2) - { - m_via2->write(space, offset&0xf, data); - } - } - } - else - { - if (offset <= 0x10) - { - m_via1->write(space, offset & 0xf, data); - } - else if (offset >= 0x80 && offset <= 0x90) - { - m_via2->write(space, offset & 0xf, data); - } - else - { - printf("Mockingboard(%d): unk write %02x to Cn%02X (PC=%x)\n", m_slot, data, offset, space.device().safe_pc()); - } - } + if (viaSel & 1) + { + m_via1->write(space, offset&0xf, data); + } + if (viaSel & 2) + { + m_via2->write(space, offset&0xf, data); + } + } + } + else + { + if (offset <= 0x10) + { + m_via1->write(space, offset & 0xf, data); + } + else if (offset >= 0x80 && offset <= 0x90) + { + m_via2->write(space, offset & 0xf, data); + } + else + { + printf("Mockingboard(%d): unk write %02x to Cn%02X (PC=%x)\n", m_slot, data, offset, space.device().safe_pc()); + } + } } WRITE_LINE_MEMBER( a2bus_ayboard_device::via1_irq_w ) { - if (state) - { - raise_slot_irq(); - } - else - { - lower_slot_irq(); - } + if (state) + { + raise_slot_irq(); + } + else + { + lower_slot_irq(); + } } WRITE_LINE_MEMBER( a2bus_ayboard_device::via2_irq_w ) { - if (state) - { - raise_slot_irq(); - } - else - { - lower_slot_irq(); - } + if (state) + { + raise_slot_irq(); + } + else + { + lower_slot_irq(); + } } READ8_MEMBER( a2bus_ayboard_device::via1_in_a ) @@ -288,7 +288,7 @@ READ8_MEMBER( a2bus_ayboard_device::via1_in_a ) WRITE8_MEMBER( a2bus_ayboard_device::via1_out_a ) { - m_porta1 = data; + m_porta1 = data; } READ8_MEMBER( a2bus_ayboard_device::via1_in_b ) @@ -298,90 +298,90 @@ READ8_MEMBER( a2bus_ayboard_device::via1_in_b ) WRITE8_MEMBER( a2bus_ayboard_device::via1_out_b ) { - if (!(data & 4)) - { - ay8910_reset_w(m_ay1, space, 0, 0); - if (m_isPhasor && m_PhasorNative) - { - ay8910_reset_w(m_ay2, space, 0, 0); - } - } - else - { - if (!m_isPhasor) - { - switch (data & 3) - { - case 0: // BDIR=0, BC1=0 (inactive) - break; - - case 1: // BDIR=0, BC1=1 (read PSG) - m_porta1 = ay8910_r(m_ay1, space, 0); - break; - - case 2: // BDIR=1, BC1=0 (write PSG) - ay8910_data_w(m_ay1, space, 0, m_porta1); - break; - - case 3: // BDIR=1, BC1=1 (latch) - ay8910_address_w(m_ay1, space, 0, m_porta1); - break; - } - } - else - { - int chipSel; - - if (m_PhasorNative) - { - chipSel = (~(data >> 3) & 3); - } - else - { - chipSel = 1; - } + if (!(data & 4)) + { + ay8910_reset_w(m_ay1, space, 0, 0); + if (m_isPhasor && m_PhasorNative) + { + ay8910_reset_w(m_ay2, space, 0, 0); + } + } + else + { + if (!m_isPhasor) + { + switch (data & 3) + { + case 0: // BDIR=0, BC1=0 (inactive) + break; + + case 1: // BDIR=0, BC1=1 (read PSG) + m_porta1 = ay8910_r(m_ay1, space, 0); + break; + + case 2: // BDIR=1, BC1=0 (write PSG) + ay8910_data_w(m_ay1, space, 0, m_porta1); + break; + + case 3: // BDIR=1, BC1=1 (latch) + ay8910_address_w(m_ay1, space, 0, m_porta1); + break; + } + } + else + { + int chipSel; + + if (m_PhasorNative) + { + chipSel = (~(data >> 3) & 3); + } + else + { + chipSel = 1; + } // printf("Phasor: %02x to AY1/2 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta1, chipSel, data & 3, data); - switch (data & 3) - { - case 0: // BDIR=0, BC1=0 (inactive) - break; - - case 1: // BDIR=0, BC1=1 (read PSG) - if (chipSel & 1) - { - m_porta1 = ay8910_r(m_ay1, space, 0); - } - if (chipSel & 2) - { - m_porta1 = ay8910_r(m_ay2, space, 0); - } - break; - - case 2: // BDIR=1, BC1=0 (write PSG) - if (chipSel & 1) - { - ay8910_data_w(m_ay1, space, 0, m_porta1); - } - if (chipSel & 2) - { - ay8910_data_w(m_ay2, space, 0, m_porta1); - } - break; - - case 3: // BDIR=1, BC1=1 (latch) - if (chipSel & 1) - { - ay8910_address_w(m_ay1, space, 0, m_porta1); - } - if (chipSel & 2) - { - ay8910_address_w(m_ay2, space, 0, m_porta1); - } - break; - } - } - } + switch (data & 3) + { + case 0: // BDIR=0, BC1=0 (inactive) + break; + + case 1: // BDIR=0, BC1=1 (read PSG) + if (chipSel & 1) + { + m_porta1 = ay8910_r(m_ay1, space, 0); + } + if (chipSel & 2) + { + m_porta1 = ay8910_r(m_ay2, space, 0); + } + break; + + case 2: // BDIR=1, BC1=0 (write PSG) + if (chipSel & 1) + { + ay8910_data_w(m_ay1, space, 0, m_porta1); + } + if (chipSel & 2) + { + ay8910_data_w(m_ay2, space, 0, m_porta1); + } + break; + + case 3: // BDIR=1, BC1=1 (latch) + if (chipSel & 1) + { + ay8910_address_w(m_ay1, space, 0, m_porta1); + } + if (chipSel & 2) + { + ay8910_address_w(m_ay2, space, 0, m_porta1); + } + break; + } + } + } } READ8_MEMBER( a2bus_ayboard_device::via2_in_a ) @@ -391,7 +391,7 @@ READ8_MEMBER( a2bus_ayboard_device::via2_in_a ) WRITE8_MEMBER( a2bus_ayboard_device::via2_out_a ) { - m_porta2 = data; + m_porta2 = data; } READ8_MEMBER( a2bus_ayboard_device::via2_in_b ) @@ -401,110 +401,110 @@ READ8_MEMBER( a2bus_ayboard_device::via2_in_b ) WRITE8_MEMBER( a2bus_ayboard_device::via2_out_b ) { - if (!(data & 4)) - { - if (m_isPhasor && m_PhasorNative) - { - ay8910_reset_w(m_ay3, space, 0, 0); - ay8910_reset_w(m_ay4, space, 0, 0); - } - else - { - ay8910_reset_w(m_ay2, space, 0, 0); - } - } - else - { - if (!m_isPhasor) - { - switch (data & 3) - { - case 0: // BDIR=0, BC1=0 (inactive) - break; - - case 1: // BDIR=0, BC1=1 (read PSG) - m_porta2 = ay8910_r(m_ay2, space, 0); - break; - - case 2: // BDIR=1, BC1=0 (write PSG) - ay8910_data_w(m_ay2, space, 0, m_porta2); - break; - - case 3: // BDIR=1, BC1=1 (latch) - ay8910_address_w(m_ay2, space, 0, m_porta2); - break; - } - } - else - { - int chipSel; - - if (m_PhasorNative) - { - chipSel = (~(data >> 3) & 3); - } - else - { - chipSel = 1; - } + if (!(data & 4)) + { + if (m_isPhasor && m_PhasorNative) + { + ay8910_reset_w(m_ay3, space, 0, 0); + ay8910_reset_w(m_ay4, space, 0, 0); + } + else + { + ay8910_reset_w(m_ay2, space, 0, 0); + } + } + else + { + if (!m_isPhasor) + { + switch (data & 3) + { + case 0: // BDIR=0, BC1=0 (inactive) + break; + + case 1: // BDIR=0, BC1=1 (read PSG) + m_porta2 = ay8910_r(m_ay2, space, 0); + break; + + case 2: // BDIR=1, BC1=0 (write PSG) + ay8910_data_w(m_ay2, space, 0, m_porta2); + break; + + case 3: // BDIR=1, BC1=1 (latch) + ay8910_address_w(m_ay2, space, 0, m_porta2); + break; + } + } + else + { + int chipSel; + + if (m_PhasorNative) + { + chipSel = (~(data >> 3) & 3); + } + else + { + chipSel = 1; + } // printf("Phasor: %02x to AY3/4 CS %02x (BDIR/BC1 %02x, data %02x)\n", m_porta2, chipSel, data & 3, data); - switch (data & 3) - { - case 0: // BDIR=0, BC1=0 (inactive) - break; - - case 1: // BDIR=0, BC1=1 (read PSG) - if (chipSel & 1) - { - m_porta2 = ay8910_r(m_ay3, space, 0); - } - if (chipSel & 2) - { - m_porta2 = ay8910_r(m_ay4, space, 0); - } - break; - - case 2: // BDIR=1, BC1=0 (write PSG) - if (chipSel & 1) - { - ay8910_data_w(m_ay3, space, 0, m_porta2); - } - if (chipSel & 2) - { - ay8910_data_w(m_ay4, space, 0, m_porta2); - } - break; - - case 3: // BDIR=1, BC1=1 (latch) - if (chipSel & 1) - { - ay8910_address_w(m_ay3, space, 0, m_porta2); - } - if (chipSel & 2) - { - ay8910_address_w(m_ay4, space, 0, m_porta2); - } - break; - } - } - } + switch (data & 3) + { + case 0: // BDIR=0, BC1=0 (inactive) + break; + + case 1: // BDIR=0, BC1=1 (read PSG) + if (chipSel & 1) + { + m_porta2 = ay8910_r(m_ay3, space, 0); + } + if (chipSel & 2) + { + m_porta2 = ay8910_r(m_ay4, space, 0); + } + break; + + case 2: // BDIR=1, BC1=0 (write PSG) + if (chipSel & 1) + { + ay8910_data_w(m_ay3, space, 0, m_porta2); + } + if (chipSel & 2) + { + ay8910_data_w(m_ay4, space, 0, m_porta2); + } + break; + + case 3: // BDIR=1, BC1=1 (latch) + if (chipSel & 1) + { + ay8910_address_w(m_ay3, space, 0, m_porta2); + } + if (chipSel & 2) + { + ay8910_address_w(m_ay4, space, 0, m_porta2); + } + break; + } + } + } } UINT8 a2bus_ayboard_device::read_c0nx(address_space &space, UINT8 offset) { - if (m_isPhasor) - { - m_PhasorNative = (offset & 1) ? true : false; - } + if (m_isPhasor) + { + m_PhasorNative = (offset & 1) ? true : false; + } - return 0xff; + return 0xff; } void a2bus_ayboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) { - if (m_isPhasor) - { - m_PhasorNative = (offset & 1) ? true : false; - } + if (m_isPhasor) + { + m_PhasorNative = (offset & 1) ? true : false; + } } |