diff --git a/hash/c64_cart.xml b/hash/c64_cart.xml index dc483cae2db..a2cbdd03bd8 100644 --- a/hash/c64_cart.xml +++ b/hash/c64_cart.xml @@ -614,7 +614,7 @@ - + @@ -2372,6 +2372,7 @@ + Gorf 1983 Commodore @@ -4093,6 +4094,7 @@ + Wizard of Wor 1984 Commodore @@ -6894,6 +6896,24 @@ + + + A Bee Cee's + 198? + Commodore + + + + + + + + + + + + + diff --git a/hash/c64_cass.xml b/hash/c64_cass.xml index d0230c2cb81..9d14903aeb3 100644 --- a/hash/c64_cass.xml +++ b/hash/c64_cass.xml @@ -54,4 +54,39 @@ + + Get Ready to Read with BJ Bear + 1984 + Commodore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hash/c64_flop.xml b/hash/c64_flop.xml index 4d23f8d723e..615e223e15e 100644 --- a/hash/c64_flop.xml +++ b/hash/c64_flop.xml @@ -587,6 +587,19 @@ + + Get Ready for Number with BJ Bear + 1984 + Commodore + + + + + + + + + @@ -798,6 +811,19 @@ + + Magic Voice Demo Disk + 198? + Commodore + + + + + + + + + CMD SwiftLink 1990 diff --git a/src/emu/sound/t6721a.c b/src/emu/sound/t6721a.c index f63fe558942..4d642ef7edb 100644 --- a/src/emu/sound/t6721a.c +++ b/src/emu/sound/t6721a.c @@ -99,3 +99,13 @@ WRITE8_MEMBER( t6721a_device::write ) WRITE_LINE_MEMBER( t6721a_device::di_w ) { } + + +//------------------------------------------------- +// eos_r - eos read +//------------------------------------------------- + +READ_LINE_MEMBER( t6721a_device::eos_r ) +{ + return 0; +} diff --git a/src/emu/sound/t6721a.h b/src/emu/sound/t6721a.h index 9005f596da6..8572063c380 100644 --- a/src/emu/sound/t6721a.h +++ b/src/emu/sound/t6721a.h @@ -77,6 +77,8 @@ public: DECLARE_WRITE_LINE_MEMBER( di_w ); + DECLARE_READ_LINE_MEMBER( eos_r ); + protected: // device-level overrides virtual void device_start(); diff --git a/src/mess/machine/c64/magic_voice.c b/src/mess/machine/c64/magic_voice.c index c9ca300def7..86b4ac87b25 100644 --- a/src/mess/machine/c64/magic_voice.c +++ b/src/mess/machine/c64/magic_voice.c @@ -7,6 +7,31 @@ **********************************************************************/ +/* + +LA05-123 Pinout +--------------- + _____ _____ + NEXTP 1 |* \_/ | 28 +5V + PD0 2 | | 27 _ROML2 + PD1 3 | | 26 _ROML + PD2 4 | | 25 _I/O2 + PD3 5 | | 24 _GAME + CLEAR 6 | | 23 PHI2 +_RAM/EPROM 7 | LA05-123 | 22 _ROMH2 + PB5 8 | LA05-124 | 21 _ROMH + PB6 9 | | 20 CLOCK + _6525 10 | | 19 SDO + _EPROM 11 | | 18 NEXTS + CA12 12 | | 17 _DA/CA + CA14 13 | | 16 CA15 + GND 14 |_____________| 15 CA13 + + +http://www.stefan-uhlmann.de/cbm/MVM/index.html + +*/ + #include "magic_voice.h" @@ -31,20 +56,178 @@ const device_type C64_MAGIC_VOICE = &device_creatorgame_r(get_offset(0xdf80), 1, 0, 1, 0) << 5; + data |= m_vslsi->eos_r() << 6; + //data |= m_fifo->dir_r() << 7; + + return data; +} + +WRITE8_MEMBER( c64_magic_voice_cartridge_device::tpi_pa_w ) +{ + /* + + bit description + + 0 FIFO D0 + 1 FIFO D1 + 2 FIFO D2 + 3 FIFO D3 + 4 FIFO SI + 5 + 6 + 7 + + */ + + //m_fifo->write(data & 0x0f); + //m_fifo->si_w(BIT(data, 4)); +} + +READ8_MEMBER( c64_magic_voice_cartridge_device::tpi_pb_r ) +{ + /* + + bit description + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 J1 _EXROM + + */ + + UINT8 data = 0; + + data |= m_exp->exrom_r(get_offset(0xdf81), 1, 0, 1, 0) << 7; + + return data; +} + +WRITE8_MEMBER( c64_magic_voice_cartridge_device::tpi_pb_w ) +{ + /* + + bit description + + 0 T6721 D0 + 1 T6721 D1 + 2 T6721 D2 + 3 T6721 D3 + 4 T6721 _WR + 5 + 6 + 7 + + */ + + m_vslsi_data = data & 0x0f; + + if (!BIT(data, 4)) + { + m_vslsi->write(space, 0, m_vslsi_data); + } +} + +READ8_MEMBER( c64_magic_voice_cartridge_device::tpi_pc_r ) +{ + /* + + bit description + + 0 + 1 + 2 T6721 _EOS + 3 FIFO DIR + 4 + 5 + 6 + 7 + + */ + + UINT8 data = 0; + + data |= m_vslsi->eos_r() << 2; + //data |= m_fifo->dir_r() << 3; + + return data; +} + +WRITE8_MEMBER( c64_magic_voice_cartridge_device::tpi_pc_w ) +{ + /* + + bit description + + 0 + 1 + 2 + 3 + 4 + 5 P1 _NMI + 6 0=RAM 1=EPROM + 7 P1 _EXROM + + */ + + m_slot->nmi_w(BIT(data, 5) ? CLEAR_LINE : ASSERT_LINE); + + m_exrom = BIT(data, 7); +} + static const tpi6525_interface tpi_intf = { DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, tpi_pa_r), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, tpi_pa_w), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, tpi_pb_r), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, tpi_pb_w), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, tpi_pc_r), + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, tpi_pc_w), DEVCB_NULL, DEVCB_NULL }; +//------------------------------------------------- +// t6721_interface +//------------------------------------------------- + +WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::dtrd_w ) +{ + +} + +WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::apd_w ) +{ + +} + + //------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c64_magic_voice ) //------------------------------------------------- @@ -55,6 +238,8 @@ static MACHINE_CONFIG_FRAGMENT( c64_magic_voice ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD(T6721A_TAG, T6721A, XTAL_640kHz) MCFG_T6721A_EOS_HANDLER(DEVWRITELINE(MOS6525_TAG, tpi6525_device, i2_w)) + MCFG_T6721A_DTRD_HANDLER(DEVWRITELINE(DEVICE_SELF, c64_magic_voice_cartridge_device, dtrd_w)) + MCFG_T6721A_APD_HANDLER(DEVWRITELINE(DEVICE_SELF, c64_magic_voice_cartridge_device, apd_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() @@ -86,7 +271,12 @@ c64_magic_voice_cartridge_device::c64_magic_voice_cartridge_device(const machine device_c64_expansion_card_interface(mconfig, *this), m_vslsi(*this, T6721A_TAG), m_tpi(*this, MOS6525_TAG), - m_exp(*this, C64_EXPANSION_SLOT_TAG) + m_exp(*this, C64_EXPANSION_SLOT_TAG), + m_roml2(1), + m_romh2(1), + m_eprom(0), + m_da_ca(0), + m_vslsi_data(0) { } @@ -107,6 +297,15 @@ void c64_magic_voice_cartridge_device::device_start() void c64_magic_voice_cartridge_device::device_reset() { m_tpi->reset(); + + m_game = 0; + m_exrom = 1; + + m_roml2 = 1; + m_romh2 = 1; + m_eprom = 0; + m_da_ca = 0; + m_vslsi_data = 0; } @@ -116,11 +315,16 @@ void c64_magic_voice_cartridge_device::device_reset() UINT8 c64_magic_voice_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { - data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); + data = m_exp->cd_r(space, get_offset(offset), data, sphi2, ba, m_roml2, m_romh2, io1, 1); - if (!io2 && BIT(offset, 7)) + if (!io2 && sphi2 && BIT(offset, 7)) { - m_tpi->read(space, offset & 0x07); + data = m_tpi->read(space, offset & 0x07); + } + + if (!m_eprom && sphi2) + { + data = m_romh[(BIT(offset, 14) << 13) | (offset & 0x1fff)]; } return data; @@ -133,30 +337,25 @@ UINT8 c64_magic_voice_cartridge_device::c64_cd_r(address_space &space, offs_t of void c64_magic_voice_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { - if (!io2 && BIT(offset, 7)) + if (!io2 && sphi2 && BIT(offset, 7)) { m_tpi->write(space, offset & 0x07, data); } - m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); + m_exp->cd_w(space, get_offset(offset), data, sphi2, ba, m_roml2, m_romh2, io1, 1); } //------------------------------------------------- -// c64_game_r - GAME read +// get_offset - //------------------------------------------------- -int c64_magic_voice_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) +offs_t c64_magic_voice_cartridge_device::get_offset(offs_t offset) { - return m_exp->game_r(offset, sphi2, ba, rw, hiram); -} - - -//------------------------------------------------- -// c64_exrom_r - EXROM read -//------------------------------------------------- - -int c64_magic_voice_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) -{ - return m_exp->exrom_r(offset, sphi2, ba, rw, hiram); + if (!m_da_ca) + { + offset = (m_vslsi_data << 12) | (offset & 0xfff); + } + + return offset; } diff --git a/src/mess/machine/c64/magic_voice.h b/src/mess/machine/c64/magic_voice.h index a2526d38588..7ace89df853 100644 --- a/src/mess/machine/c64/magic_voice.h +++ b/src/mess/machine/c64/magic_voice.h @@ -27,7 +27,7 @@ // ======================> c64_magic_voice_cartridge_device class c64_magic_voice_cartridge_device : public device_t, - public device_c64_expansion_card_interface + public device_c64_expansion_card_interface { public: // construction/destruction @@ -36,6 +36,16 @@ public: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; + DECLARE_READ8_MEMBER( tpi_pa_r ); + DECLARE_WRITE8_MEMBER( tpi_pa_w ); + DECLARE_READ8_MEMBER( tpi_pb_r ); + DECLARE_WRITE8_MEMBER( tpi_pb_w ); + DECLARE_READ8_MEMBER( tpi_pc_r ); + DECLARE_WRITE8_MEMBER( tpi_pc_w ); + + DECLARE_WRITE_LINE_MEMBER( dtrd_w ); + DECLARE_WRITE_LINE_MEMBER( apd_w ); + protected: // device-level overrides virtual void device_start(); @@ -44,13 +54,19 @@ protected: // device_c64_expansion_card_interface overrides virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); - virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); - virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); private: + offs_t get_offset(offs_t offset); + required_device m_vslsi; required_device m_tpi; required_device m_exp; + + int m_roml2; + int m_romh2; + int m_eprom; + int m_da_ca; + UINT8 m_vslsi_data; };