Previous 15994 Revisions Next

r7347 Sunday 14th February, 2010 at 04:54:05 UTC by Jonathan Gevaryahu
[dectalk] correctly reset DUART on system reset; I have no clue if I did this correctly (devices scare me) but it seems to work.
[src/mess/drivers]dectalk.c

src/mess/drivers/dectalk.c
r7346r7347
1212*
1313*  TODO:
1414*  * DUART:
15*    * DUART needs to be reset on reset line activation. as is it works ok, but it should be done anyway.
15*    * <DONE> DUART needs to be reset on reset line activation. as is it works ok, but it should be done anyway.
1616*    * DUART needs its i/o pins connected as well:
1717*    * pins IP0, IP2, and IP3 are connected to the primary serial port:
1818*      * IP0 is CTS
1919*      * IP2 is DSR
2020*      * IP3 is RLS (recieved line signal, this pin is rarely used on rs232)
21*    * pins IP4, IP5 and IP6 are on jumpers on the DUART, tied high normally but jumperable low, should be handled as dipswitches:
21*    * <DONE> pins IP4, IP5 and IP6 are on jumpers on the DUART, tied high normally but jumperable low, should be handled as dipswitches:
2222*      * IP4 low: skip hardware self tests
2323*      * IP5 low: unknown
2424*      * IP6 low: unknown
r7346r7347
2626*      * OP0 is RTS
2727*      * OP2 is DTR
2828*  * Actually store the X2212 nvram's eeprom data to disk rather than throwing it out on exit
29*    * is there some way i can hook this up using &generic_nvram?
30*  * emulate/simulate the MT8060 dtmf decoder as a 16-key input device? or hook it to some simple fft code?
31*  * discuss and figure out how to have an external application send data to the two serial ports to be spoken
29*    * Is there some way I can hook this up using &generic_nvram? Right now signs point to no.
30*  * emulate/simulate the MT8060 dtmf decoder as a 16-key input device? or hook it to some simple fft code? Francois Javier's fftmorse code ran full speed on a 6mhz 80286, maybe use that?
31*  * discuss and figure out how to have an external application send data to the two serial ports to be spoken (maybe using paste from clipboard?)
3232*
3333* LED error code list (found by experimentation and help from leeeeee):
3434*    Startup Self tests:
r7346r7347
152152
153153static struct
154154{
155UINT8 data[8]; // ? what is this for?
156UINT8 nvram_local[256]; // sram tempspace on the x2214
155UINT8 data[8]; // hack to prevent gcc bitching about struct pointers. not used.
156UINT8 x2214_sram[256]; // NVRAM chip's temp sram space
157157UINT8 statusLED;
158158// input fifo, between m68k and tms32010
159159UINT16 infifo[32]; // technically eight 74LS224 4bit*16stage FIFO chips, arranged as a 32 stage, 16-bit wide fifo
r7346r7347
248248   UINT8 *nvram = memory_region(machine, "nvram");
249249   int i;
250250   for (i = 0; i < 256; i++)
251   nvram[i] = dectalk.nvram_local[i];
251   nvram[i] = dectalk.x2214_sram[i];
252252#ifdef NVRAM_LOG
253253   logerror("nvram store done\n");
254254#endif
r7346r7347
259259   UINT8 *nvram = memory_region(machine, "nvram");
260260   int i;
261261   for (i = 0; i < 256; i++)
262   dectalk.nvram_local[i] = nvram[i];
262   dectalk.x2214_sram[i] = nvram[i];
263263#ifdef NVRAM_LOG
264264   logerror("nvram recall done\n");
265265#endif
r7346r7347
297297/* Machine reset and friends: stuff that needs setting up which IS directly affected by reset */
298298static void dectalk_reset(running_device *device)
299299{
300   const running_device *devconf = devtag_get_device(device->machine, "duart68681"); // this is probably an evil disgusting hack, and AaronGiles is gonna throttle me for doing this...
300301   hack_self_test = 0; // hack
301302   // stuff that is DIRECTLY affected by the RESET line
302303   dectalk.statusLED = 0; // clear status led latch
303304   dectalk_x2212_recall(device->machine); // nvram recall
304305   dectalk.m68k_spcflags_latch = 1; // initial status is speech reset(d0) active and spc int(d6) disabled
305306   dectalk.m68k_tlcflags_latch = 0; // initial status is tone detect int(d6) off, answer phone(d8) off, ring detect int(d14) off
306   // TODO: DUART is reset, "duart68681"
307   DEVICE_RESET(devconf); // reset the DUART
308   devconf = devconf; // hack to make gcc shut up about unused variables. the variable IS USED!
309   //devtag_get_device(device->machine,"duart68681")->reset(); // reset the DUART
307310   // stuff that is INDIRECTLY affected by the RESET line
308311   dectalk_clear_all_fifos(device->machine); // speech reset clears the fifos, though we have to do it explicitly here since we're not actually in the m68k_spcflags_w function.
309312   dectalk_semaphore_w(device->machine, 0); // on the original dectalk pcb revision, this is a semaphore for the INPUT fifo, later dec hacked on a check for the 3 output fifo chips to see if they're in sync, and set both of these latches if true.
r7346r7347
326329static READ8_HANDLER( nvram_read ) // read from x2212 nvram chip and possibly do recall
327330{
328331   UINT8 data = 0xFF;
329   data = dectalk.nvram_local[offset&0xff]; // TODO: should this be before or after a possible /RECALL? I'm guessing before.
332   data = dectalk.x2214_sram[offset&0xff]; // TODO: should this be before or after a possible /RECALL? I'm guessing before.
330333#ifdef NVRAM_LOG
331334      logerror("m68k: nvram read at %08X: %02X\n", offset, data);
332335#endif
r7346r7347
350353#ifdef NVRAM_LOG
351354   logerror("m68k: nvram write at %08X: %02X\n", offset, data&0x0f);
352355#endif
353   dectalk.nvram_local[offset&0xff] = (UINT8)data&0x0f; // TODO: should this be before or after a possible /STORE? I'm guessing before.
356   dectalk.x2214_sram[offset&0xff] = (UINT8)data&0x0f; // TODO: should this be before or after a possible /STORE? I'm guessing before.
354357   if (offset&0x200) // if a9 is set, do a /STORE
355358   dectalk_x2212_store(space->machine);
356359}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team