Added TMS5220C variant to tms5220.c [Credit: Lord Nightmare]

- implemented reset for TMS5220C if /RS and /WS are pulled down together
- Inserted LNs email and corrections as comment into source
- Created a TODO section.
This commit is contained in:
Couriersud 2009-09-21 21:32:38 +00:00
parent d93f2fec5c
commit 6a0043bf8a
2 changed files with 133 additions and 6 deletions

View File

@ -38,9 +38,103 @@
Note the standard naming for d* data bits with 7 as MSB and 0 as LSB is in lowercase.
TI's naming has D7 as LSB and D0 as MSB and is in uppercase
TODO:
Implement a ready callback for pc interfaces
- this will be quite a challenge since for it to be really accurate
the whole emulation has to run in sync (lots of timers) with the
cpu cores.
If a command is still executing, /READY will be kept high until the command has
finished if the next command is written.
TMS5220C: see below.
Notes:
Looping has the tms5220 hookep up directly to the cpu. However currently the
tms9900 cpu core does not support a ready line.
Email from Lord Nightmare having a lot more detail follows:
Yes, there is at least two more differences:
The 5220 is 'noisier' when playing unvoiced frames than the 5220C is; I
think the 5220C may use a different energy table (or use one value lower
in the normal energy table) than the 5220 does, possibly only when
playing unvoiced frames, but I can't prove this without a decap; the
5220C's PROMOUT pin (for dumping the lpc tables as played) is
nonfunctional due to changed design or a die bug.
In addition, the NOP commands on the FIFO interface have been changed
and data passed in the low bits has a meaning regarding frame length:
commands :
(lsb is right, msb is left; x means don't care)
x0x0xbcc : (5220: NOP) (5220C: select frame length by cc, and b selects
whether every frame is preceeded by 2 bits to select the frame length
(instead of using the value set by cc)) (default is 00 for frame length
(200 samples) and 0 for whether the preceeding 2 bits are enabled (off))
x001xxxx: sends eight read bit commands (M0 high M1 low) to VSM and
reads the resulting bits serially into a temporary register, which
becomes readable as the next byte read from the tms52xx once ready goes
active.
Note the bit order of the byte read from the TMS52xx is BACKWARDS as
compared to the actual data order as in the rom on the VSM chips! This
was IMHO a rather silly design decision of TI. (I asked Larry
Brantingham about this but he wasn't involved with the TMS52xx chips,
just the 5100)
There's ASCII data in the TI 99/4 speech module VSMs which has the bit
order reversed on purpose because of this!
x011xxxx: sends a read and branch command (M0 high, M1 high) to force
VSM to set its data pointer to whatever the data is at its current
pointer location is)
x100aaaa: send a load address command (M0 low M1 high) to vsm with the 4
'a' bits
x101xxxx: 'speak' begins speaking from current address in the data
pointer of the vsms
x110xxxx: 'speak external' begins speaking from the 16 byte fifo
x111xxxx: resets the speech synthesis core immediately; clears the bit
offset counter in the fifo to the nearest byte 'forward ', but does NOT
clear the fifo, annoyingly!
Its also possible but inconclusive that the chirp table was changed.
The LPC tables between the 5220 and 5220C are MOSTLY the same of not
completely so, but as mentioned above the energy table has some sort of
difference.
As for which games used which chips, from the TMS5220 wikipedia page:
TMS5200 AKA TMC0285: (1981 to 1983ish when supplies ran low)
Arcade: Zaccaria's 'money money' and 'jack rabbit'; Bally/Midway's
'Discs of Tron' (all environmental cabs and a few upright cabs; the code
exists on all versions for the speech though, and upright cabs can be
upgraded to add it by hacking on a 'Squawk & Talk' pinball speech board
(which is also TMS5200 based) with a few modded components)
Pinball: All Bally/Midway machines which uses the 'Squawk & Talk' board.
Home computer: TI 99/4 PHP1500 Speech module (along with two VSM
serial chips); Street Electronics Corp.'s Apple II 'Echo 2' Speech
synthesizer (early cards only)
TMS5220: (mostly on things made between 1982 and 1984-1985 when supplies
ran low)
Arcade: Bally/Midway's 'NFL Football'; Atari's 'Star Wars',
'Firefox', 'Return of the Jedi', 'Road Runner', 'The Empire Strikes
Back' (all verified with schematics); Venture Line's 'Looping' and 'Sky
Bumper' (need verify for both); Olympia's 'Portraits' (need verify);
Exidy's 'Victory' and 'Victor Banana' (need verify for both)
Pinball: Several (don't know names offhand, have not checked schematics)
Home computer: Street Electronics Corp.'s Apple II 'Echo 2' Speech
synthesizer (later cards only); Texas Instruments' 'Speak and Learn'
scanner wand unit.
TMS5220C AKA TSP5220C: (on stuff made from 1984 to 1992 or so)
Arcade: Atari's 'Indiana Jones and the Temple of Doom', '720',
'Gauntlet', 'Gauntlet II', 'A.P.B.', 'Paperboy', 'RoadBlasters',
'Vindicators Pt II'(verify?), and 'Escape from the Planet of the Robot
Monsters' (all verified except for vindicators pt 2)
Pinball: Several (less common than the tms5220? (not sure about
this), mostly on later pinballs with LPC speech)
Home computer: Street Electronics Corp.'s 'ECHO' parallel/hobbyist
module (6511 based), IBM PS/2 Speech adapter (parallel port connection
device), PES Speech adapter (serial port connection)
***********************************************************************************************/
@ -58,7 +152,8 @@ Notes:
enum _tms5220_variant
{
variant_tms5220, /* TMS5220_IS_TMS5220, TMS5220_IS_TMS5220C, TMS5220_IS_TSP5220C */
variant_tms5220c, /* TMS5220_IS_TMS5220C TMS5220_IS_TSP5220C */
variant_tms5220, /* TMS5220_IS_TMS5220 */
variant_tmc0285 /* TMS5220_IS_TMS5200, TMS5220_IS_CD2501 */
};
typedef enum _tms5220_variant tms5220_variant;
@ -1138,6 +1233,12 @@ static DEVICE_START( tms5220 )
register_for_save_states(tms);
}
static DEVICE_START( tms5220c )
{
tms5220_state *tms = get_safe_token(device);
DEVICE_START_CALL( tms5220 );
tms->variant = variant_tms5220c;
}
static DEVICE_START( tmc0285 )
{
@ -1239,9 +1340,19 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w )
if (new != tms->rs_ws)
{
tms->rs_ws = new;
if (new == 0 || new ==3)
if (new == 0)
{
/* illegal */
if (tms->variant == variant_tms5220c)
device_reset(device);
else
/* illegal */
LOG(("tms5220_rs_w: illegal\n"));
return;
}
else if ( new == 3)
{
/* high impedance */
tms->read_latch = 0xff;
return;
}
if (state)
@ -1272,10 +1383,19 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w )
if (new != tms->rs_ws)
{
tms->rs_ws = new;
if (new == 0 || new ==3)
if (new == 0)
{
/* illegal */
if (new == 0) LOG(("tms5220_ws_w: illegal\n"));
if (tms->variant == variant_tms5220c)
device_reset(device);
else
/* illegal */
LOG(("tms5220_ws_w: illegal\n"));
return;
}
else if ( new == 3)
{
/* high impedance */
tms->read_latch = 0xff;
return;
}
if (state)
@ -1455,6 +1575,11 @@ static const char DEVTEMPLATE_SOURCE[] = __FILE__;
#define DEVTEMPLATE_FAMILY "TI Speech"
#include "devtempl.h"
#define DEVTEMPLATE_DERIVED_ID(p,s) p##tms5220c##s
#define DEVTEMPLATE_DERIVED_FEATURES DT_HAS_START
#define DEVTEMPLATE_DERIVED_NAME "TMS5220C"
#include "devtempl.h"
#define DEVTEMPLATE_DERIVED_ID(p,s) p##tmc0285##s
#define DEVTEMPLATE_DERIVED_FEATURES DT_HAS_START
#define DEVTEMPLATE_DERIVED_NAME "TMC0285"

View File

@ -39,10 +39,12 @@ double tms5220_time_to_ready(const device_config *device);
void tms5220_set_frequency(const device_config *device, int frequency);
DEVICE_GET_INFO( tms5220c );
DEVICE_GET_INFO( tms5220 );
DEVICE_GET_INFO( tmc0285 );
DEVICE_GET_INFO( tms5200 );
#define SOUND_TMS5220C DEVICE_GET_INFO_NAME( tms5220c )
#define SOUND_TMS5220 DEVICE_GET_INFO_NAME( tms5220 )
#define SOUND_TMC0285 DEVICE_GET_INFO_NAME( tmc0285 )
#define SOUND_TMS5200 DEVICE_GET_INFO_NAME( tms5200 )