src/mess/drivers/dectalk.c
| r7346 | r7347 | |
| 12 | 12 | * |
| 13 | 13 | * TODO: |
| 14 | 14 | * * 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. |
| 16 | 16 | * * DUART needs its i/o pins connected as well: |
| 17 | 17 | * * pins IP0, IP2, and IP3 are connected to the primary serial port: |
| 18 | 18 | * * IP0 is CTS |
| 19 | 19 | * * IP2 is DSR |
| 20 | 20 | * * 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: |
| 22 | 22 | * * IP4 low: skip hardware self tests |
| 23 | 23 | * * IP5 low: unknown |
| 24 | 24 | * * IP6 low: unknown |
| r7346 | r7347 | |
| 26 | 26 | * * OP0 is RTS |
| 27 | 27 | * * OP2 is DTR |
| 28 | 28 | * * 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?) |
| 32 | 32 | * |
| 33 | 33 | * LED error code list (found by experimentation and help from leeeeee): |
| 34 | 34 | * Startup Self tests: |
| r7346 | r7347 | |
| 152 | 152 | |
| 153 | 153 | static struct |
| 154 | 154 | { |
| 155 | | UINT8 data[8]; // ? what is this for? |
| 156 | | UINT8 nvram_local[256]; // sram tempspace on the x2214 |
| 155 | UINT8 data[8]; // hack to prevent gcc bitching about struct pointers. not used. |
| 156 | UINT8 x2214_sram[256]; // NVRAM chip's temp sram space |
| 157 | 157 | UINT8 statusLED; |
| 158 | 158 | // input fifo, between m68k and tms32010 |
| 159 | 159 | UINT16 infifo[32]; // technically eight 74LS224 4bit*16stage FIFO chips, arranged as a 32 stage, 16-bit wide fifo |
| r7346 | r7347 | |
| 248 | 248 | UINT8 *nvram = memory_region(machine, "nvram"); |
| 249 | 249 | int i; |
| 250 | 250 | for (i = 0; i < 256; i++) |
| 251 | | nvram[i] = dectalk.nvram_local[i]; |
| 251 | nvram[i] = dectalk.x2214_sram[i]; |
| 252 | 252 | #ifdef NVRAM_LOG |
| 253 | 253 | logerror("nvram store done\n"); |
| 254 | 254 | #endif |
| r7346 | r7347 | |
| 259 | 259 | UINT8 *nvram = memory_region(machine, "nvram"); |
| 260 | 260 | int i; |
| 261 | 261 | for (i = 0; i < 256; i++) |
| 262 | | dectalk.nvram_local[i] = nvram[i]; |
| 262 | dectalk.x2214_sram[i] = nvram[i]; |
| 263 | 263 | #ifdef NVRAM_LOG |
| 264 | 264 | logerror("nvram recall done\n"); |
| 265 | 265 | #endif |
| r7346 | r7347 | |
| 297 | 297 | /* Machine reset and friends: stuff that needs setting up which IS directly affected by reset */ |
| 298 | 298 | static void dectalk_reset(running_device *device) |
| 299 | 299 | { |
| 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... |
| 300 | 301 | hack_self_test = 0; // hack |
| 301 | 302 | // stuff that is DIRECTLY affected by the RESET line |
| 302 | 303 | dectalk.statusLED = 0; // clear status led latch |
| 303 | 304 | dectalk_x2212_recall(device->machine); // nvram recall |
| 304 | 305 | dectalk.m68k_spcflags_latch = 1; // initial status is speech reset(d0) active and spc int(d6) disabled |
| 305 | 306 | 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 |
| 307 | 310 | // stuff that is INDIRECTLY affected by the RESET line |
| 308 | 311 | 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. |
| 309 | 312 | 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. |
| r7346 | r7347 | |
| 326 | 329 | static READ8_HANDLER( nvram_read ) // read from x2212 nvram chip and possibly do recall |
| 327 | 330 | { |
| 328 | 331 | 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. |
| 330 | 333 | #ifdef NVRAM_LOG |
| 331 | 334 | logerror("m68k: nvram read at %08X: %02X\n", offset, data); |
| 332 | 335 | #endif |
| r7346 | r7347 | |
| 350 | 353 | #ifdef NVRAM_LOG |
| 351 | 354 | logerror("m68k: nvram write at %08X: %02X\n", offset, data&0x0f); |
| 352 | 355 | #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. |
| 354 | 357 | if (offset&0x200) // if a9 is set, do a /STORE |
| 355 | 358 | dectalk_x2212_store(space->machine); |
| 356 | 359 | } |