summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2014-12-19 16:20:07 -0500
committer Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2014-12-19 16:20:07 -0500
commit350dd4a7d04348ed8f031e1077bc37197bd43116 (patch)
tree94ad8c42d4e652bda64a94f15c2017e8ae7829be
parent42829f31b1520bf392aac37192250f9613d580fc (diff)
(MESS) Fix VSM rom read through the tms51xx, and add tms6100 hookup to tispeak.c, fixing speech in speak and spell and speak and math. The drivers are usable but no display yet. Fixed speak and spell clock speed (it is 1/2 the clock input of the tms51xx chip) [Lord Nightmare]
Non-Whatsnew Note: this commit breaks the speech in radar scope trs02 set (because the rom it has has the bits in the backwards order). I will fix this later.
-rw-r--r--src/emu/machine/tms6100.c2
-rw-r--r--src/emu/sound/tms5110.c59
-rw-r--r--src/mess/drivers/tispeak.c15
3 files changed, 56 insertions, 20 deletions
diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c
index 47b69b7f6b3..c261d1b949b 100644
--- a/src/emu/machine/tms6100.c
+++ b/src/emu/machine/tms6100.c
@@ -182,7 +182,7 @@ WRITE_LINE_MEMBER(tms6100_device::tms6100_romclock_w)
else
{
/* read bit at address */
- m_data = (m_rom[m_address >> 3] >> ((m_address & 0x07) ^ 0x07)) & 1;
+ m_data = (m_rom[m_address >> 3] >> (m_address & 0x07)) & 1;
m_address++;
}
m_state &= ~TMS6100_READ_PENDING;
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index e4e87a2c165..e0b60a4d4d6 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -8,6 +8,7 @@
Various fixes by Lord Nightmare
Additional enhancements by Couriersud
Sub-interpolation-cycle parameter updating added by Lord Nightmare
+ Read-bit and Output fixes by Lord Nightmare
Todo:
- implement CS
@@ -148,6 +149,7 @@ UINT8 tms5110_device::new_int_read()
new_int_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus
if (!m_data_cb.isnull())
return m_data_cb();
+ if (DEBUG_5110) logerror("WARNING: CALLBACK MISSING, RETURNING 0!\n");
return 0;
}
@@ -230,13 +232,14 @@ void tms5110_device::FIFO_data_write(int data)
int tms5110_device::extract_bits(int count)
{
int val = 0;
-
+ if (DEBUG_5110) logerror("requesting %d bits from fifo: ", count);
while (count--)
{
val = (val << 1) | (m_fifo[m_fifo_head] & 1);
m_fifo_count--;
m_fifo_head = (m_fifo_head + 1) % FIFO_SIZE;
}
+ if (DEBUG_5110) logerror("returning: %02x\n", val);
return val;
}
@@ -245,6 +248,7 @@ void tms5110_device::request_bits(int no)
for (int i = 0; i < no; i++)
{
UINT8 data = new_int_read();
+ if (DEBUG_5110) logerror("bit added to fifo: %d\n", data);
FIFO_data_write(data);
}
}
@@ -591,6 +595,7 @@ void tms5110_device::PDC_set(int data)
m_PDC = data & 0x1;
if (m_PDC == 0) /* toggling 1->0 processes command on CTL_pins */
{
+ if (DEBUG_5110) logerror("PDC falling edge: ");
/* first pdc toggles output, next toggles input */
switch (m_state)
{
@@ -598,21 +603,26 @@ void tms5110_device::PDC_set(int data)
/* continue */
break;
case CTL_STATE_NEXT_TTALK_OUTPUT:
+ if (DEBUG_5110) logerror("Switching CTL bus direction to output for Test Talk\n");
m_state = CTL_STATE_TTALK_OUTPUT;
return;
case CTL_STATE_TTALK_OUTPUT:
+ if (DEBUG_5110) logerror("Switching CTL bus direction back to input from Test Talk\n");
m_state = CTL_STATE_INPUT;
return;
case CTL_STATE_NEXT_OUTPUT:
+ if (DEBUG_5110) logerror("Switching CTL bus direction for Read Bit Buffer Output\n");
m_state = CTL_STATE_OUTPUT;
return;
case CTL_STATE_OUTPUT:
+ if (DEBUG_5110) logerror("Switching CTL bus direction back to input from Read Bit Buffer Output\n");
m_state = CTL_STATE_INPUT;
return;
}
/* the only real commands we handle now are SPEAK and RESET */
if (m_next_is_address)
{
+ if (DEBUG_5110) logerror("Loading address nybble %02x to VSMs\n", m_CTL_pins);
m_next_is_address = FALSE;
m_address = m_address | ((m_CTL_pins & 0x0F)<<m_addr_bit);
m_addr_bit = (m_addr_bit + 4) % 12;
@@ -621,47 +631,55 @@ void tms5110_device::PDC_set(int data)
}
else
{
+ if (DEBUG_5110) logerror("Got command nybble %02x: ", m_CTL_pins);
switch (m_CTL_pins & 0xe) /*CTL1 - don't care*/
{
case TMS5110_CMD_RESET:
+ if (DEBUG_5110) logerror("RESET\n");
perform_dummy_read();
reset();
break;
case TMS5110_CMD_LOAD_ADDRESS:
+ if (DEBUG_5110) logerror("LOAD ADDRESS\n");
m_next_is_address = TRUE;
break;
case TMS5110_CMD_OUTPUT:
+ if (DEBUG_5110) logerror("OUTPUT (from read-bit buffer)\n");
m_state = CTL_STATE_NEXT_OUTPUT;
break;
case TMS5110_CMD_SPKSLOW:
+ if (DEBUG_5110) logerror("SPKSLOW (todo: this isn't implemented right yet)\n");
perform_dummy_read();
m_speaking_now = 1;
//should FIFO be cleared now ????? there is no fifo! the fifo is a lie!
break;
case TMS5110_CMD_READ_BIT:
+ if (DEBUG_5110) logerror("READ BIT\n");
if (m_schedule_dummy_read)
perform_dummy_read();
else
{
+ if (DEBUG_5110) logerror("actually reading a bit now\n");
request_bits(1);
- //m_CTL_pins = (m_CTL_pins & 0x0E) | extract_bits(1);
- m_CTL_buffer <<= 1;
- m_CTL_buffer |= extract_bits(1);
+ m_CTL_buffer >>= 1;
+ m_CTL_buffer |= (extract_bits(1)<<3);
m_CTL_buffer &= 0xF;
}
break;
case TMS5110_CMD_SPEAK:
+ if (DEBUG_5110) logerror("SPEAK\n");
perform_dummy_read();
m_speaking_now = 1;
//should FIFO be cleared now ????? there is no fifo! the fifo is a lie!
break;
case TMS5110_CMD_READ_BRANCH:
+ if (DEBUG_5110) logerror("READ AND BRANCH\n");
new_int_write(0,1,1,0);
new_int_write(1,1,1,0);
new_int_write(0,1,1,0);
@@ -672,6 +690,7 @@ void tms5110_device::PDC_set(int data)
break;
case TMS5110_CMD_TEST_TALK:
+ if (DEBUG_5110) logerror("TEST TALK\n");
m_state = CTL_STATE_NEXT_TTALK_OUTPUT;
break;
@@ -1009,16 +1028,18 @@ WRITE_LINE_MEMBER( tms5110_device::pdc_w )
/******************************************************************************
- tms5110_ctl_r -- read status from the sound chip
-
- bit 0 = TS - Talk Status is active (high) when the VSP is processing speech data.
+ tms5110_ctl_r -- read from the VSP (51xx) control bus
+ The CTL bus can be in three states:
+ 1. Test talk output:
+ bit 0 = TS - Talk Status is active (high) when the VSP is processing speech data.
Talk Status goes active at the initiation of a SPEAK command.
It goes inactive (low) when the stop code (Energy=1111) is processed, or
immediately(?????? not TMS5110) by a RESET command.
- TMS5110 datasheets mention this is only available as a result of executing
- TEST TALK command.
-
- FIXME: data read not implemented, CTL1 only available after TALK command
+ other bits may be open bus
+ 2. 'read bit' buffer contents output:
+ bits 0-3 = buffer contents
+ 3. Input 'open bus' state:
+ bits 0-3 = high-z
******************************************************************************/
@@ -1028,18 +1049,18 @@ READ8_MEMBER( tms5110_device::ctl_r )
m_stream->update();
if (m_state == CTL_STATE_TTALK_OUTPUT)
{
- //if (DEBUG_5110) logerror("Status read (status=%2d)\n", m_talk_status);
+ if (DEBUG_5110) logerror("Status read while outputting Test Talk (status=%2d)\n", m_talk_status);
return (m_talk_status << 0); /*CTL1 = still talking ? */
}
else if (m_state == CTL_STATE_OUTPUT)
{
- //if (DEBUG_5110) logerror("Status read (status=%2d)\n", m_talk_status);
+ if (DEBUG_5110) logerror("Status read while outputting buffer (buffer=%2d)\n", m_CTL_buffer);
return (m_CTL_buffer);
}
- else
+ else // we're reading with the bus in input mode! just return the last thing written to the bus
{
- //if (DEBUG_5110) logerror("Status read (not in output mode)\n");
- return (0);
+ if (DEBUG_5110) logerror("Status read (not in output mode), returning %02x\n", m_CTL_pins);
+ return (m_CTL_pins);
}
}
@@ -1128,6 +1149,8 @@ void tms5110_device::sound_stream_update(sound_stream &stream, stream_sample_t *
/******************************************************************************
tms5110_set_frequency -- adjusts the playback frequency
+ TODO: kill this function; we should be adjusting the tms51xx device clock itself,
+ not setting it here!
******************************************************************************/
@@ -1136,6 +1159,10 @@ void tms5110_device::set_frequency(int frequency)
m_stream->set_sample_rate(frequency / 80);
}
+
+
+/* from here on in this file is a VSM 'Emulator' circuit used by bagman and ad2083 */
+
/*
*
* General Interface design (Bagman)
diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c
index 7b22a2c37f2..a6f9289e099 100644
--- a/src/mess/drivers/tispeak.c
+++ b/src/mess/drivers/tispeak.c
@@ -9,6 +9,7 @@
#include "emu.h"
#include "cpu/tms0980/tms0980.h"
#include "sound/tms5110.h"
+#include "machine/tms6100.h"
#include "tispeak.lh"
@@ -256,7 +257,7 @@ void tispeak_state::machine_start()
static MACHINE_CONFIG_START( tispeak, tispeak_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS0270, MASTER_CLOCK)
+ MCFG_CPU_ADD("maincpu", TMS0270, XTAL_640kHz/2)
MCFG_TMS1XXX_READ_K_CB(READ8(tispeak_state, read_k))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, write_o))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tispeak_state, write_r))
@@ -271,9 +272,17 @@ static MACHINE_CONFIG_START( tispeak, tispeak_state )
/* no video! */
/* sound hardware */
+ MCFG_DEVICE_ADD("tms6100", TMS6100, 0)
+
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("tms5100", TMS5100, XTAL_640kHz)
+ MCFG_TMS5110_M0_CB(DEVWRITELINE("tms6100", tms6100_device, tms6100_m0_w))
+ MCFG_TMS5110_M1_CB(DEVWRITELINE("tms6100", tms6100_device, tms6100_m1_w))
+ MCFG_TMS5110_ADDR_CB(DEVWRITE8("tms6100", tms6100_device, tms6100_addr_w))
+ MCFG_TMS5110_DATA_CB(DEVREADLINE("tms6100", tms6100_device, tms6100_data_r))
+ MCFG_TMS5110_ROMCLK_CB(DEVWRITELINE("tms6100", tms6100_device, tms6100_romclock_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+
MACHINE_CONFIG_END
@@ -295,7 +304,7 @@ ROM_START( snspell )
ROM_REGION( 1246, "maincpu:opla", 0 )
ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(e70836e2) SHA1(70e7dcdf81ae2052874fb21c504fcc06b2649f9a) ) // "
- ROM_REGION( 0x8000, "tms5100", 0 )
+ ROM_REGION( 0x8000, "tms6100", 0 )
ROM_LOAD( "tmc0351.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) )
ROM_LOAD( "tmc0352.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) )
ROM_END
@@ -311,7 +320,7 @@ ROM_START( snmath )
ROM_REGION( 1246, "maincpu:opla", 0 )
ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(e70836e2) SHA1(70e7dcdf81ae2052874fb21c504fcc06b2649f9a) ) // "
- ROM_REGION( 0x8000, "tms5100", 0 )
+ ROM_REGION( 0x8000, "tms6100", 0 )
ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) )
ROM_LOAD( "cd2393.vsm", 0x4000, 0x4000, CRC(571d5b5a) SHA1(83284755d9b77267d320b5b87fdc39f352433715) )
ROM_END