Previous 15994 Revisions Next

r5637 Tuesday 8th September, 2009 at 08:19:25 UTC by Jonathan Gevaryahu
[dectalk] update to use smaller interleave and boost interleave on fifo writes and semaphore sets; added input 'shortable jumper' array as a dipswitch; added dipswitch for hack to prevent crash if selftest is disabled; added some more advanced debug code, disabled for now
[vt100] added tu-58 cpu rom for vt103, not actually hooked up yet
[src/mess/drivers]dectalk.c vt100.c

src/mess/drivers/dectalk.c
r5636r5637
66*  from Kevin 'kevtris' Horton, without whom this driver would
77*  have been impossible.
88*  Special thanks to Al Kossow for archiving the DTC-01 schematic at bitsavers,
9*  which is invaluable for work on this driver.
9*  http://bitsavers.org/pdf/dec/dectalk/MP-01820_DTC01_EngrDrws_Nov83.pdf
10*  which has been invaluable for work on this driver.
1011*  Special thanks to leeeeee for helping figure out what the led selftest codes actually mean
1112*
1213*  TODO:
13*  * DUART: I suspect the duart test fails because modes 0-6 of the duart are currently unimplemented in 68681.c
14*  * DUART:
1415*    * DUART needs its i/o pins connected as well:   
1516*    * pins IP0, IP2, and IP3 are connected to the primary serial port:
1617*      * IP0 is CTS
r5636r5637
2526*      * OP2 is DTR
2627*  * Attach m68k interrupts properly; I suspect the DUART INT and SPC INTs are both hooked up wrong
2728*  * Actually store the X2212 nvram's eeprom data to disk rather than throwing it out on exit
28*  * force sync between both processors if either one pushes or pulls the fifo
29*      or the shared error/fifo flag regs... How can I actually do this? CPU_BOOST_INTERLEAVE?
30*      otherwise i need to have the two in some mad insane sync...
31*  * Hook the 'output' FIFO up to the 10khz sampling rate generator xtal using SPEAKER
29*    * is there some way i can hook this up using &generic_nvram?
3230*  * emulate/simulate the MT8060 dtmf decoder as a 16-key input device?
3331*  * discuss and figure out how to have an external application send data to the two serial ports to be spoken
3432*
r5636r5637
5048*    FE 03 - RAM check fail @ 0x88000-0x8bfff, ram at E34 or E47 "
5149*    FE 04 - RAM check fail @ 0x8c000-0x8ffff, ram at E33 or E46 "
5250*    FE 05 - RAM check fail @ 0x90000-0x93fff, ram at E32 or E44 "
53*    FD 00 - DUART test (test code at $046C)
54*    FC 00 - TMS32010 'SPC' and DTMF-decoder 'TLC' status register test (test code at $051E) [passes in mess]
55*    FB 00 - TMS32010 extensive tests: make dtmf tone and be sure the decoder detects it and triggers an interrupt [fails in mess]
51*    FD 00 - DUART test & DUART interrupt test (test code at $046C)
52*    FC 00 - This test doesn't exist. Some vestiges of it may remain in code for the FD and FB tests.
53*    FB 00 - TMS32010 extensive tests (test code at $051E): test spc interrupt [works] and make dtmf tone to test tlc interrupt [fails in mess, requires dtmf detection on output]
5654*    Jump to $102C to skip the self tests
5755*    During normal operation:
58*    D3 - ? some sort of failure
59*    FF - normal, status OK
60*    * figure out what all the other LED error codes actually mean, as DEC didn't document them anywhere.
56(table taken from http://www3.sympatico.ca/n.rieck/docs/DECtalk_notes.html )
57DTC-01 LEDs
58
59   76543210         LEDs
60   ||||||||
61   |||||||+-------- set if host asserting CTS
62   ||||||+--------- set if DECtalk asserting RTS
63   |||||+---------- set if host asserting DSR
64   ||||+----------- set if host asserting DCD
65   |||+------------ set if DECtalk asserting DTR
66   +++------------- 3 bit state code
67
68   000              in state 5, first 500 ms; waiting for CD & CTS in first 500 ms when DECtalk is on-line
69   001              timing 2 second CD=0 while in state 6 (moving data)
70   010              waiting for DSR=0 while disconnecting (part of state 7)
71   011              waiting for DSR=1 while connecting (state 3)
72   100              delaying for UK modems during disconnect (part of state 7)
73   101              waiting for CD and CTS (main part of state 5)
74   110              moving data (state 6)
75   111              disconnecting (start of state 7)
76*    Dectalk dtc-01 hardware and rom version history, from dtc-01 schematic at bitsavers and with additional info from
77     http://americanhistory.si.edu/archives/speechsynthesis/ss_dec1.htm
78     August 1983: Hardware version A done
79     unknown date: Version 1.0 roms finalized
80     unknown date: Version 1.1 roms released to fix a bug with insufficient stack space, see ss_dec1 above
81     March 1984: Hardware version B done (integrates the output fifo sync error check onto the pcb; Version A units are retrofitted when sent in for firmware upgrades) (most of the schematics come from this time)
82     <there might be a v1.2 or v1.3 in this period>
83     July 02 1984: Second half of Version 2.0 rom finalized
84     July 23 1984: First half of Version 2.0 rom finalized
85     October 1984 (the rest of the schematics come from this time)
86     unknown date: version 2.1 rom finalized
87
6188*******************************************************************************/
6289/*the 68k memory map is such:
63900x000000-0x007fff: E22 low, E8 high
r5636r5637
771040x090000-0x093fff: e32 low, e45 high
781050x094000-0x097fff: LED/SW/NVR
791060x098000-0x09bfff: DUART
800x09c000-0x09ffff: TMS32010 speech (TLC, SPC)
1070x09c000-0x09ffff: DTMF and TMS32010 (TLC, SPC)
81108mirrored at 0x0a0000-0x0fffff x3
82109entire space mirrored at 0x100000-0x7fffff
831100x800000-0xffffff is open bus?
r5636r5637
88115SPC is INT level 5
89116DUART is INT level 6
90117*/
91#undef VERBOSE
118// USE_LOOSE_TIMING makes the cpu interleave much lower and boosts it on fifo and flag writes by the 68k and semaphore sets by the dsp
119#define USE_LOOSE_TIMING 1
120#undef VERBOSE
121#undef SERIAL_TO_STDERR
92122
93123/* Core includes */
94124#include "driver.h"
95125#include "cpu/m68000/m68000.h"
96126#include "cpu/tms32010/tms32010.h"
97#include "dectalk.lh" // nasty hack to avoid crash on screenless system
127#include "dectalk.lh" // hack to avoid screenless system crash
98128#include "machine/68681.h"
99129#include "sound/dac.h"
100130
r5636r5637
109139   //cputag_set_input_line_and_vector(device->machine, "maincpu", M68K_IRQ_6, HOLD_LINE, vector);
110140};
111141
142 static UINT8 hack_self_test = 0; // temp variable for hack below
143
144static UINT8 duart_input(const device_config *device)
145{
146   UINT8 data = 0xFF;
147   data &= 0x8F; // write me: handle bits 0, 2, 3 which are port a CTS, DSR and RLS(DCD?) respectively
148   //data |= input_port_read(device->machine, "duart_in");
149    data |= (input_port_read(device->machine, "duart_in")&0x7f);
150    if ((hack_self_test == 1) && (input_port_read(device->machine, "duart_in")&0x80)) data |= 0x10; // hack to prevent hang if selftest disable bit is kept low past the first read; i suppose the proper use of this bit was an incremental switch, or perhaps its expecting an interrupt later from serial in or tone in? added a dipswitch to disable the hack for testing
151    hack_self_test = 1;
152   return data;
153}
154
155static void duart_tx(const device_config *device, int channel, UINT8 data)
156{
157#ifdef SERIAL_TO_STDERR
158   fprintf(stderr, "%02X ",data);
159#endif
160}
161
112162static const duart68681_config dectalk_duart68681_config =
113163{
114164   duart_irq_handler,
115   // duart_tx,
116   NULL,
165   duart_tx,
166   duart_input,
117167   NULL
118168};
119169
r5636r5637
137187UINT8 simulate_outfifo_error; // simulate an error on the outfifo, which does something unusual to the dsp latches
138188UINT8 tlc_tonedetect;
139189UINT8 tlc_ringdetect;
190UINT8 tlc_dtmf; // dtmf holding reg
140191} dectalk={ {0}};
141192
142193#define SPC_INITIALIZE dectalk.m68k_spcflags_latch&0x1 // speech initialize flag
r5636r5637
222273/* Machine reset and friends: stuff that needs setting up which IS directly affected by reset */
223274static void dectalk_reset(const device_config *device)
224275{
276   hack_self_test = 0; // hack
225277   // stuff that is DIRECTLY affected by the RESET line
226278   dectalk.statusLED = 0; // clear status led latch
227279   dectalk_x2212_recall(device->machine); // nvram recall
r5636r5637
236288   cputag_set_input_line(device->machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); // speech reset forces the CLR line active on the tms32010
237289   dectalk.tlc_tonedetect = 0; // TODO, needed for selftest pass
238290   dectalk.tlc_ringdetect = 0; // TODO
291   dectalk.tlc_dtmf = 0; // TODO
239292}
240293
241294MACHINE_RESET( dectalk )
r5636r5637
292345
293346WRITE16_HANDLER( m68k_infifo_w ) // 68k write to the speech input fifo
294347{
348#ifdef USE_LOOSE_TIMING
349   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(50));
350   cpuexec_trigger(space->machine, 100);
351#endif
295352#ifdef VERBOSE
296353   logerror("m68k: SPC infifo written with data = %04X, fifo head was: %02X; fifo tail: %02X\n",data, dectalk.infifo_head_ptr, dectalk.infifo_tail_ptr);
297354#endif
r5636r5637
322379
323380WRITE16_HANDLER( m68k_spcflags_w ) // 68k write to the speech flags (only 3 bits do anything)
324381{
382#ifdef USE_LOOSE_TIMING
383   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(50));
384   cpuexec_trigger(space->machine, 100);
385#endif
325386#ifdef VERBOSE
326387   logerror("m68k: SPC flags written with %04X, only storing %04X\n",data, data&0x41);
327388#endif
r5636r5637
367428         cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); // set int because semaphore was set
368429      }
369430   }
370   else
431   else // data&0x40 == 0
371432   {
372433#ifdef VERBOSE
373434      logerror(" | 0x40 = 0: speech int disabled\n");
r5636r5637
394455   logerror("m68k: TLC flags written with %04X, only storing %04X\n",data, data&0x4140);
395456#endif
396457   dectalk.m68k_tlcflags_latch = data&0x4140; // ONLY store bits 6 8 and 14!
397   // write me for the ring and tone int enables and answer phone
458   if ((data&0x40) == 0x40) // bit 6: tone detect interrupt enable
459   {
460#ifdef VERBOSE
461      logerror(" | 0x40: tone detect int enabled\n");
462#endif
463      if ((dectalk.tlc_tonedetect == 1))
464      {
465#ifdef VERBOSE
466         logerror("    TLC int fired!\n");
467#endif
468         cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_4, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); // set int because tone detect was set
469      }
470   }
471   else // data&0x40 == 0
472   {
473#ifdef VERBOSE
474      logerror(" | 0x40 = 0: tone detect int disabled\n");
475#endif
476   if (((data&0x4000)!=0x4000) || (dectalk.tlc_ringdetect == 0)) // check to be sure we don't disable int if both ints fired at once
477      cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_4, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); // clear int because int is now disabled
478   }
479   if ((data&0x100) == 0x100) // bit 8: answer phone relay enable
480   {
481#ifdef VERBOSE
482      logerror(" | 0x100: answer phone relay enabled\n");
483#endif
484   }
485   else // data&0x100 == 0
486   {
487#ifdef VERBOSE
488      logerror(" | 0x100 = 0: answer phone relay disabled\n");
489#endif
490   }
491   if ((data&0x4000) == 0x4000) // bit 14: ring int enable
492   {
493#ifdef VERBOSE
494      logerror(" | 0x4000: ring detect int enabled\n");
495#endif
496      if ((dectalk.tlc_ringdetect == 1))
497      {
498#ifdef VERBOSE
499         logerror("    TLC int fired!\n");
500#endif
501         cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_4, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); // set int because tone detect was set
502      }
503   }
504   else // data&0x4000 == 0
505   {
506#ifdef VERBOSE
507      logerror(" | 0x4000 = 0: ring detect int disabled\n");
508#endif
509   if (((data&0x40)!=0x40) || (dectalk.tlc_tonedetect == 0)) // check to be sure we don't disable int if both ints fired at once
510      cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_4, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); // clear int because int is now disabled
511   }
398512}
399513
400514READ16_HANDLER( m68k_tlc_dtmf_r ) // dtmf chip read
401515{
402   // write me!
516   UINT16 data = 0xFFFF;
517   data = dectalk.tlc_dtmf&0xF;
403518#ifdef VERBOSE
404   logerror("m68k: TLC dtmf read, currently unhandled, returning data = 0");
519   logerror("m68k: TLC dtmf detector read, returning data = %02X", data);
405520#endif
406521   return 0;
407522}
r5636r5637
410525/* Begin tms32010 i/o handlers */
411526WRITE16_HANDLER( spc_latch_outfifo_error_stats ) // latch 74ls74 @ E64 upper and lower halves with d0 and 1 respectively
412527{
528#ifdef USE_LOOSE_TIMING
529   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(50));
530   cpuexec_trigger(space->machine, 100);
531#endif
413532#ifdef VERBOSE
414533   logerror("dsp: set fifo semaphore and set error status = %01X\n",data&1);
415534#endif
r5636r5637
514633/******************************************************************************
515634 Input Ports
516635******************************************************************************/
636static INPUT_PORTS_START( dectalk )
637PORT_START("duart_in") // IP4, IP5, IP6 bits on duart are dipswitches (really unsoldered holes in the pcb where jumper wires can be soldered or shorted over)
638   PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // these bits are dealt with elsewhere
639   PORT_DIPNAME( 0x10, 0x00, "Skip Self Test (IP4)" )
640   PORT_DIPSETTING(    0x10, "Open (VCC)" )
641   PORT_DIPSETTING(    0x00, "Short to GND" )
642   PORT_DIPNAME( 0x20, 0x20, "Unknown (IP5)" )
643   PORT_DIPSETTING(    0x20, "Open (VCC)" )
644   PORT_DIPSETTING(    0x00, "Short to GND" )
645   PORT_DIPNAME( 0x40, 0x40, "Unknown (IP6)" )
646   PORT_DIPSETTING(    0x40, "Open (VCC)" )
647   PORT_DIPSETTING(    0x00, "Short to GND" )
648   //PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // this pin (IP7) doesn't actually exist as a pin at all, reads as 1
649   PORT_DIPNAME( 0x80, 0x80, "Hack to prevent hang when skip self test is shorted" )
650   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
651   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
652INPUT_PORTS_END
517653
518
519
520654/******************************************************************************
521655 Machine Drivers
522656******************************************************************************/
r5636r5637
553687    MDRV_CPU_ADD("dsp", TMS32010, XTAL_20MHz) /* Y1 20MHz xtal */
554688    MDRV_CPU_PROGRAM_MAP(tms32010_mem)
555689    MDRV_CPU_IO_MAP(tms32010_io)
556    //MDRV_QUANTUM_TIME(HZ(750000))
557   MDRV_QUANTUM_PERFECT_CPU("dsp")
690#ifdef USE_LOOSE_TIMING
691    MDRV_QUANTUM_TIME(HZ(200))
692#else
693    MDRV_QUANTUM_PERFECT_CPU("dsp")
694#endif
558695
696    //MDRV_NVRAM_HANDLER(generic_0fill)
697
559698    /* video hardware */
560699    MDRV_DEFAULT_LAYOUT(layout_dectalk) // hack to avoid screenless system crash
561700
562701    /* sound hardware */
563702    MDRV_SPEAKER_STANDARD_MONO("mono")
564   MDRV_SOUND_ADD("dac", DAC, 0) /* E88 10KHz OSC, handled by timer */
703    MDRV_SOUND_ADD("dac", DAC, 0) /* E88 10KHz OSC, handled by timer */
565704    MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.9)
566705
567706    /* Y2 is a 3.579545 MHz xtal for the dtmf decoder chip */
r5636r5637
617756 Drivers
618757******************************************************************************/
619758
620/*    YEAR   NAME      PARENT   COMPAT   MACHINE      INPUT   INIT      CONFIG      COMPANY      FULLNAME         FLAGS */
621COMP( 1984, dectalk,   0,      0,      dectalk,   0,      dectalk,   dectalk,   "DEC",      "DECTalk DTC-01",   GAME_NOT_WORKING )
759/*    YEAR   NAME      PARENT   COMPAT   MACHINE      INPUT      INIT      CONFIG      COMPANY      FULLNAME         FLAGS */
760COMP( 1984, dectalk,   0,      0,      dectalk,   dectalk,   dectalk,   dectalk,   "DEC",      "DECTalk DTC-01",   GAME_NOT_WORKING )
src/mess/drivers/vt100.c
r5636r5637
542542   ROM_LOAD_OPTIONAL( "23-094e2-00.e9", 0x0800, 0x0800, NO_DUMP) // optional (comes default with some models) alternate character set rom
543543
544544   ROM_REGION(0x0800, "tapecpu", 0) // rom for the 8085 cpu in the integrated serial tu58-xa drive
545   ROM_LOAD( "23-089e2-00.e1", 0x0000, 0x0800, NO_DUMP)
545   ROM_LOAD( "23-089e2.e1", 0x0000, 0x0800, CRC(8614dd4c) SHA1(1b554e6c98bddfc6bc48d81c990deea43cf9df7f)) // Label: "23-089E2 // P8316E - AMD // 35227 8008NPP"
546546
547547   ROM_REGION(0x80000, "lsi11cpu", 0) // rom for the LSI-11 cpu board
548548   ROM_LOAD_OPTIONAL( "unknown.bin", 0x00000, 0x80000, NO_DUMP)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team