diff options
Diffstat (limited to 'src/mame/audio/laserbat.cpp')
-rw-r--r-- | src/mame/audio/laserbat.cpp | 93 |
1 files changed, 15 insertions, 78 deletions
diff --git a/src/mame/audio/laserbat.cpp b/src/mame/audio/laserbat.cpp index 5e8ee062b45..963f3aa7f76 100644 --- a/src/mame/audio/laserbat.cpp +++ b/src/mame/audio/laserbat.cpp @@ -230,7 +230,9 @@ WRITE8_MEMBER(laserbat_state::csound2_w) The Cat and Mouse sound board has a 6802 processor with three ROMs, a 6821 PIA, two AY-3-8910 PSGs, and some other logic and analog circuitry. Unfortunately we lack a schematic, so all knowledge of - this board is based on tracing the sound program. + this board is based on tracing the sound program, examining PCB + photos and cross-referencing with the schematic for the 1B11142 + schematic. The 6821 PIA is mapped at addresses $005C..$005F. The known PIA signal assignments are as follows: @@ -282,7 +284,7 @@ WRITE8_MEMBER(laserbat_state::csound2_w) | 6 | SOUND 5 | PIA CA1 | | 7 | | | | 8 | | | - | 9 | | | + | 9 | | 14L A11 | | 10 | | | | 11 | | | | 12 | | | @@ -292,6 +294,10 @@ WRITE8_MEMBER(laserbat_state::csound2_w) | 16 | RESET | Unknown | +-----+----------+-------------+ + Bit 9 is used to select the sprite ROM bank. There's a wire visible + on the component side of the PCB connecting it to the high address + bit (A11) of the sprite ROM at 14L. + There could well be other connections on the sound board - these are just what can be deduced by tracing the sound program. @@ -302,87 +308,18 @@ WRITE8_MEMBER(laserbat_state::csound2_w) WRITE8_MEMBER(catnmous_state::csound1_w) { - m_pia->ca1_w((data & 0x20) ? 1 : 0); + m_audiopcb->sound_w(space, offset, data); + m_csound1 = data; } WRITE8_MEMBER(catnmous_state::csound2_w) { - // the top bit is called RESET on the wiring diagram - assume it resets the sound CPU - m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE); - m_csound2 = data; -} - -READ8_MEMBER(catnmous_state::pia_porta_r) -{ - UINT8 const control = m_pia->b_output(); - UINT8 data = 0xff; - - if (0x01 == (control & 0x03)) - data &= m_psg1->data_r(space, 0); - - if (0x04 == (control & 0x0c)) - data &= m_psg2->data_r(space, 0); - - return data; -} - -WRITE8_MEMBER(catnmous_state::pia_porta_w) -{ - UINT8 const control = m_pia->b_output(); - - if (control & 0x02) - m_psg1->data_address_w(space, (control >> 0) & 0x01, data); - - if (control & 0x08) - m_psg2->data_address_w(space, (control >> 2) & 0x01, data); -} - -WRITE8_MEMBER(catnmous_state::pia_portb_w) -{ - if (data & 0x02) - m_psg1->data_address_w(space, (data >> 0) & 0x01, m_pia->a_output()); - - if (data & 0x08) - m_psg2->data_address_w(space, (data >> 2) & 0x01, m_pia->a_output()); -} - -WRITE_LINE_MEMBER(catnmous_state::pia_irqa) -{ - m_audiocpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); -} - -WRITE_LINE_MEMBER(catnmous_state::pia_irqb) -{ - m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE); -} - -WRITE8_MEMBER(catnmous_state::psg1_porta_w) -{ - // similar to zaccaria.c since we have no clue how this board really works - // this code could be completely wrong/inappropriate for this game for all we know - static double const table[8] = { - RES_K(8.2), - RES_R(820), - RES_K(3.3), - RES_R(150), - RES_K(5.6), - RES_R(390), - RES_K(1.5), - RES_R(47) }; - RES_VOLTAGE_DIVIDER(RES_K(4.7), table[data & 0x07]); - m_psg2->set_volume(1, 150 * RES_VOLTAGE_DIVIDER(RES_K(4.7), table[data & 0x07])); -} + // the bottom bit is used for sprite banking, of all things + m_gfx2 = memregion("gfx2")->base() + ((data & 0x01) ? 0x0800 : 0x0000); -READ8_MEMBER(catnmous_state::psg1_portb_r) -{ - // the sound program masks out the three most significant bits - // assume they're not connected and read high from the internal pull-ups - return m_csound1 | 0xe0; -} + // the top bit is called RESET on the wiring diagram + m_audiopcb->reset_w((data & 0x80) ? 1 : 0); -INTERRUPT_GEN_MEMBER(catnmous_state::cb1_toggle) -{ - m_cb1 = !m_cb1; - m_pia->cb1_w(m_cb1 ? 1 : 0); + m_csound2 = data; } |