src/mess/drivers/dectalk.c
| r5603 | r5604 | |
| 52 | 52 | * FE 05 - RAM check fail @ 0x90000-0x93fff, ram at E32 or E44 " |
| 53 | 53 | * FD 00 - DUART test (test code at $046C) |
| 54 | 54 | * FC 00 - TMS32010 'SPC' and DTMF-decoder 'TLC' status register test (test code at $051E) [passes in mess] |
| 55 | | * FB 00 - DUART interrupt tests [fails 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] |
| 56 | 56 | * Jump to $102C to skip the self tests |
| 57 | 57 | * During normal operation: |
| 58 | 58 | * D3 - ? some sort of failure |
| r5603 | r5604 | |
| 88 | 88 | SPC is INT level 5 |
| 89 | 89 | DUART is INT level 6 |
| 90 | 90 | */ |
| 91 | #undef VERBOSE |
| 91 | 92 | |
| 92 | | |
| 93 | | |
| 94 | 93 | /* Core includes */ |
| 95 | 94 | #include "driver.h" |
| 96 | 95 | #include "cpu/m68000/m68000.h" |
| 97 | 96 | #include "cpu/tms32010/tms32010.h" |
| 98 | 97 | #include "dectalk.lh" // nasty hack to avoid crash on screenless system |
| 99 | 98 | #include "machine/68681.h" |
| 99 | #include "sound/dac.h" |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | /* Components */ |
| r5603 | r5604 | |
| 130 | 130 | UINT16 outfifo[16]; // technically three 74LS224 4bit*16stage FIFO chips, arranged as a 16 stage, 12-bit wide fifo |
| 131 | 131 | UINT8 outfifo_tail_ptr; |
| 132 | 132 | UINT8 outfifo_head_ptr; |
| 133 | | UINT8 outfifo_writable_latch; // latch for status of output fifo, d-latch 74ls74 @ E64 'lower half' |
| 133 | UINT8 infifo_semaphore; // latch for status of output fifo, d-latch 74ls74 @ E64 'lower half' |
| 134 | 134 | UINT8 spc_error_latch; // latch for error status of speech dsp, d-latch 74ls74 @ E64 'upper half' |
| 135 | 135 | UINT8 m68k_spcflags_latch; // latch for initializing the speech dsp, d-latch 74ls74 @ E29 'lower half', AND latch for spc irq enable, d-latch 74ls74 @ E29 'upper half'; these are stored in bits 0 and 6 respectively, the rest of the bits stored here MUST be zeroed! |
| 136 | 136 | UINT8 m68k_tlcflags_latch; // latch for telephone interface stuff, d-latches 74ls74 @ E93 'upper half' and @ 103 'upper and lower halves' |
| 137 | UINT8 simulate_outfifo_error; // simulate an error on the outfifo, which does something unusual to the dsp latches |
| 138 | UINT8 tlc_tonedetect; |
| 139 | UINT8 tlc_ringdetect; |
| 137 | 140 | } dectalk={ {0}}; |
| 138 | 141 | |
| 139 | 142 | #define SPC_INITIALIZE dectalk.m68k_spcflags_latch&0x1 // speech initialize flag |
| 140 | 143 | #define SPC_IRQ_ENABLED ((dectalk.m68k_spcflags_latch&0x40)>>6) // irq enable flag |
| 141 | 144 | |
| 145 | static void dectalk_outfifo_check (running_machine *machine) |
| 146 | { |
| 147 | // check if output fifo is full; if it isn't, set the int on the dsp |
| 148 | if (((dectalk.outfifo_head_ptr-1)&0xF) != dectalk.outfifo_tail_ptr) |
| 149 | cputag_set_input_line(machine, "dsp", 0, ASSERT_LINE); // TMS32010 INT |
| 150 | else |
| 151 | cputag_set_input_line(machine, "dsp", 0, CLEAR_LINE); // TMS32010 INT |
| 152 | } |
| 153 | |
| 142 | 154 | static void dectalk_clear_all_fifos( running_machine *machine ) |
| 143 | 155 | { |
| 144 | 156 | // clear fifos (TODO: memset would work better here...) |
| r5603 | r5604 | |
| 147 | 159 | for (i=0; i<32; i++) dectalk.infifo[i] = 0; |
| 148 | 160 | dectalk.outfifo_tail_ptr = dectalk.outfifo_head_ptr = 0; |
| 149 | 161 | dectalk.infifo_tail_ptr = dectalk.infifo_head_ptr = 0; |
| 162 | dectalk_outfifo_check(machine); |
| 150 | 163 | } |
| 151 | 164 | |
| 152 | 165 | static void dectalk_x2212_store( running_machine *machine ) |
| r5603 | r5604 | |
| 167 | 180 | logerror("nvram recall done\n"); |
| 168 | 181 | } |
| 169 | 182 | |
| 183 | // helper for dsp infifo_semaphore flag to make dealing with interrupts easier |
| 184 | static void dectalk_semaphore_w ( running_machine *machine, UINT16 data ) |
| 185 | { |
| 186 | dectalk.infifo_semaphore = data&1; |
| 187 | if ((dectalk.infifo_semaphore == 1) && (dectalk.m68k_spcflags_latch&0x40)) |
| 188 | { |
| 189 | #ifdef VERBOSE |
| 190 | logerror("speech int fired!\n"); |
| 191 | #endif |
| 192 | cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); |
| 193 | } |
| 194 | else |
| 195 | cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_5, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); |
| 196 | } |
| 197 | |
| 198 | // read the output fifo and set the interrupt line active on the dsp |
| 199 | static UINT16 dectalk_outfifo_r ( running_machine *machine ) |
| 200 | { |
| 201 | UINT16 data = 0xFFFF; |
| 202 | data = dectalk.outfifo[dectalk.outfifo_tail_ptr]; |
| 203 | // if fifo is empty (tail ptr == head ptr), do not increment the tail ptr, otherwise do. |
| 204 | //if (dectalk.outfifo_tail_ptr != dectalk.outfifo_head_ptr) dectalk.outfifo_tail_ptr++; // technically correct but doesn't match sn74ls224 sheet |
| 205 | if (((dectalk.outfifo_head_ptr-1)&0xF) != dectalk.outfifo_tail_ptr) dectalk.outfifo_tail_ptr++; // matches sn74ls224 sheet |
| 206 | dectalk.outfifo_tail_ptr&=0xF; |
| 207 | dectalk_outfifo_check(machine); |
| 208 | return ((data&0xfff0)^0x8000); // yes this is right, top bit is inverted and bottom 4 are ignored |
| 209 | //return data; // not right but want to get it working first |
| 210 | } |
| 211 | |
| 170 | 212 | /* |
| 171 | 213 | static void dectalk_spcflags_write ( running_machine *machine, UINT16 data ) |
| 172 | 214 | { |
| r5603 | r5604 | |
| 177 | 219 | } |
| 178 | 220 | */ |
| 179 | 221 | |
| 180 | | /* Driver init: stuff that needs setting up which isn't directly affected by reset */ |
| 181 | | DRIVER_INIT( dectalk ) |
| 182 | | { |
| 183 | | dectalk_clear_all_fifos(machine); |
| 184 | | dectalk.outfifo_writable_latch = 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. |
| 185 | | dectalk.spc_error_latch = 1; // normally would be 0, but if set to 1 on startup the dectalk should recover as well |
| 186 | | } |
| 187 | | |
| 188 | 222 | /* Machine reset and friends: stuff that needs setting up which IS directly affected by reset */ |
| 189 | 223 | static void dectalk_reset(const device_config *device) |
| 190 | 224 | { |
| r5603 | r5604 | |
| 196 | 230 | // DUART is reset, write me "duart68681" |
| 197 | 231 | // stuff that is INDIRECTLY affected by the RESET line |
| 198 | 232 | 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. |
| 233 | dectalk_semaphore_w(device->machine, 0); |
| 234 | //dectalk.infifo_semaphore = 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. |
| 235 | dectalk.spc_error_latch = 0; // spc error latch is cleared on /reset |
| 199 | 236 | cputag_set_input_line(device->machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); // speech reset forces the CLR line active on the tms32010 |
| 237 | dectalk.tlc_tonedetect = 0; // TODO, needed for selftest pass |
| 238 | dectalk.tlc_ringdetect = 0; // TODO |
| 200 | 239 | } |
| 201 | 240 | |
| 202 | 241 | MACHINE_RESET( dectalk ) |
| r5603 | r5604 | |
| 206 | 245 | } |
| 207 | 246 | |
| 208 | 247 | /* Begin 68k i/o handlers */ |
| 209 | | |
| 210 | 248 | /* x2212 nvram/sram chip and led array demunger due to interleaved addresses */ |
| 211 | 249 | /* 0x400 long: anything at offset&0x1 = 0 is open bus read, write to leds; everything else is nvram*/ |
| 212 | 250 | READ16_HANDLER( led_sw_nvr_read ) |
| r5603 | r5604 | |
| 238 | 276 | if (ACCESSING_BITS_0_7) // LEDS |
| 239 | 277 | { |
| 240 | 278 | dectalk.statusLED = data&0xFF; |
| 241 | | popmessage("LED status: %x\n", data&0xFF); |
| 279 | popmessage("LED status: %02X\n", data&0xFF); |
| 280 | #ifdef VERBOSE |
| 281 | logerror("m68k: LED status: %02X\n", data&0xFF); |
| 282 | #endif |
| 242 | 283 | //popmessage("LED status: %x %x %x %x %x %x %x %x\n", data&0x80, data&0x40, data&0x20, data&0x10, data&0x8, data&0x4, data&0x2, data&0x1); |
| 243 | 284 | } |
| 244 | 285 | else if (ACCESSING_BITS_8_15) // X2212 NVRAM chip |
| r5603 | r5604 | |
| 251 | 292 | |
| 252 | 293 | WRITE16_HANDLER( m68k_infifo_w ) // 68k write to the speech input fifo |
| 253 | 294 | { |
| 254 | | dectalk.infifo[dectalk.infifo_head_ptr] = data; |
| 255 | | dectalk.infifo_head_ptr++; |
| 256 | | dectalk.infifo_head_ptr&=0x1F; |
| 295 | #ifdef VERBOSE |
| 296 | 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); |
| 297 | #endif |
| 298 | // if fifo is full (head ptr = tail ptr-1), do not increment the head ptr and do not store the data |
| 299 | if (((dectalk.infifo_tail_ptr-1)&0x1F) == dectalk.infifo_head_ptr) |
| 300 | { |
| 301 | #ifdef VERBOSE |
| 302 | logerror("infifo was full, write ignored!\n"); |
| 303 | #endif |
| 304 | return; |
| 305 | } |
| 306 | dectalk.infifo[dectalk.infifo_head_ptr] = data; |
| 307 | dectalk.infifo_head_ptr++; |
| 308 | dectalk.infifo_head_ptr&=0x1F; |
| 257 | 309 | } |
| 258 | 310 | |
| 259 | 311 | READ16_HANDLER( m68k_spcflags_r ) // 68k read from the speech flags |
| r5603 | r5604 | |
| 261 | 313 | UINT8 data = 0; |
| 262 | 314 | data |= dectalk.m68k_spcflags_latch; // bits 0 and 6 |
| 263 | 315 | data |= dectalk.spc_error_latch<<5; // bit 5 |
| 264 | | data |= dectalk.outfifo_writable_latch<<7; // bit 7 |
| 316 | data |= dectalk.infifo_semaphore<<7; // bit 7 |
| 317 | #ifdef VERBOSE |
| 318 | logerror("m68k: SPC flags read, returning data = %04X\n",data); |
| 319 | #endif |
| 265 | 320 | return data; |
| 266 | 321 | } |
| 267 | 322 | |
| 268 | 323 | WRITE16_HANDLER( m68k_spcflags_w ) // 68k write to the speech flags (only 3 bits do anything) |
| 269 | 324 | { |
| 325 | #ifdef VERBOSE |
| 326 | logerror("m68k: SPC flags written with %04X, only storing %04X\n",data, data&0x41); |
| 327 | #endif |
| 270 | 328 | dectalk.m68k_spcflags_latch = data&0x41; // ONLY store bits 6 and 0! |
| 271 | 329 | // d0: initialize speech flag (reset tms32010 and clear infifo and outfifo if high) |
| 272 | 330 | if ((data&0x1) == 0x1) // bit 0 |
| 273 | 331 | { |
| 332 | #ifdef VERBOSE |
| 333 | logerror(" | 0x01: initialize speech: fifos reset, clear error+semaphore latches and dsp reset\n"); |
| 334 | #endif |
| 274 | 335 | dectalk_clear_all_fifos(space->machine); |
| 275 | 336 | cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); // speech reset forces the CLR line active on the tms32010 |
| 276 | 337 | // clear the two speech side latches |
| 277 | 338 | dectalk.spc_error_latch = 0; |
| 278 | | dectalk.outfifo_writable_latch = 0; |
| 339 | dectalk_semaphore_w(space->machine, 0); |
| 279 | 340 | } |
| 280 | 341 | else // (data&0x1) == 0 |
| 281 | 342 | { |
| 282 | | cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, CLEAR_LINE); // speech reset deassert clears the CLR line on the tms32010 |
| 343 | #ifdef VERBOSE |
| 344 | logerror(" | 0x01 = 0: initialize speech off, dsp running\n"); |
| 345 | #endif |
| 346 | cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, CLEAR_LINE); // speech reset deassert clears the CLR line on the tms32010 |
| 283 | 347 | } |
| 284 | | if ((data&0x2) == 0x2) // bit 1 |
| 348 | if ((data&0x2) == 0x2) // bit 1 - clear error and semaphore latches |
| 285 | 349 | { |
| 350 | #ifdef VERBOSE |
| 351 | logerror(" | 0x02: clear error+semaphore latches\n"); |
| 352 | #endif |
| 286 | 353 | // clear the two speech side latches |
| 287 | 354 | dectalk.spc_error_latch = 0; |
| 288 | | dectalk.outfifo_writable_latch = 0; |
| 355 | dectalk_semaphore_w(space->machine, 0); |
| 289 | 356 | } |
| 290 | | if ((data&0x40) == 0x40) // bit 6 |
| 357 | if ((data&0x40) == 0x40) // bit 6 - spc irq enable |
| 291 | 358 | { |
| 292 | | /* write me */ //enable or disable the spc irq, which triggers when fifo writable goes high, if data&40 is set. |
| 359 | #ifdef VERBOSE |
| 360 | logerror(" | 0x40: speech int enabled\n"); |
| 361 | #endif |
| 362 | if ((dectalk.infifo_semaphore == 1)) |
| 363 | { |
| 364 | #ifdef VERBOSE |
| 365 | logerror(" speech int fired!\n"); |
| 366 | #endif |
| 367 | cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_5, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR); // set int because semaphore was set |
| 368 | } |
| 293 | 369 | } |
| 370 | else |
| 371 | { |
| 372 | #ifdef VERBOSE |
| 373 | logerror(" | 0x40 = 0: speech int disabled\n"); |
| 374 | #endif |
| 375 | cputag_set_input_line_and_vector(space->machine, "maincpu", M68K_IRQ_5, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); // clear int because int is now disabled |
| 376 | } |
| 294 | 377 | } |
| 295 | 378 | |
| 296 | 379 | READ16_HANDLER( m68k_tlcflags_r ) // dtmf flags read |
| 297 | 380 | { |
| 298 | 381 | UINT16 data = 0; |
| 299 | 382 | data |= dectalk.m68k_tlcflags_latch; // bits 6, 8, 14; |
| 300 | | //data |= dectalk.tlc_tonedetect<<7; // bit 7 is tone detect |
| 301 | | //data |= dectalk.tlc_ringdetect<<14; // bit 15 is ring detect |
| 383 | data |= dectalk.tlc_tonedetect<<7; // bit 7 is tone detect |
| 384 | data |= dectalk.tlc_ringdetect<<14; // bit 15 is ring detect |
| 385 | #ifdef VERBOSE |
| 386 | logerror("m68k: TLC flags read, returning data = %04X\n",data); |
| 387 | #endif |
| 302 | 388 | return data; |
| 303 | 389 | } |
| 304 | 390 | |
| 305 | 391 | WRITE16_HANDLER( m68k_tlcflags_w ) // dtmf flags write |
| 306 | 392 | { |
| 393 | #ifdef VERBOSE |
| 394 | logerror("m68k: TLC flags written with %04X, only storing %04X\n",data, data&0x4140); |
| 395 | #endif |
| 307 | 396 | dectalk.m68k_tlcflags_latch = data&0x4140; // ONLY store bits 6 8 and 14! |
| 308 | 397 | // write me for the ring and tone int enables and answer phone |
| 309 | 398 | } |
| 310 | 399 | |
| 311 | 400 | READ16_HANDLER( m68k_tlc_dtmf_r ) // dtmf chip read |
| 312 | 401 | { |
| 313 | | // write me! |
| 314 | | return 0; |
| 402 | // write me! |
| 403 | #ifdef VERBOSE |
| 404 | logerror("m68k: TLC dtmf read, currently unhandled, returning data = 0"); |
| 405 | #endif |
| 406 | return 0; |
| 315 | 407 | } |
| 316 | | |
| 317 | 408 | /* End 68k i/o handlers */ |
| 318 | 409 | |
| 319 | 410 | /* Begin tms32010 i/o handlers */ |
| 320 | 411 | WRITE16_HANDLER( spc_latch_outfifo_error_stats ) // latch 74ls74 @ E64 upper and lower halves with d0 and 1 respectively |
| 321 | 412 | { |
| 322 | | dectalk.outfifo_writable_latch = 1; // always set to 1 here. |
| 323 | | dectalk.spc_error_latch = data&1; |
| 413 | #ifdef VERBOSE |
| 414 | logerror("dsp: set fifo semaphore and set error status = %01X\n",data&1); |
| 415 | #endif |
| 416 | dectalk_semaphore_w(space->machine, (~dectalk.simulate_outfifo_error)&1); // always set to 1 here, unless outfifo error. |
| 417 | dectalk.spc_error_latch = (data&1); |
| 324 | 418 | } |
| 325 | 419 | |
| 326 | 420 | READ16_HANDLER( spc_infifo_data_r ) |
| 327 | 421 | { |
| 328 | | UINT16 data = 0xFFFF; |
| 329 | | data = dectalk.infifo[dectalk.infifo_tail_ptr]; |
| 330 | | //logerror("dsp read from infifo, data %x\n", data); |
| 331 | | dectalk.infifo_tail_ptr++; |
| 332 | | dectalk.infifo_tail_ptr&=0x1F; |
| 333 | | return data; |
| 422 | UINT16 data = 0xFFFF; |
| 423 | data = dectalk.infifo[dectalk.infifo_tail_ptr]; |
| 424 | #ifdef VERBOSE |
| 425 | logerror("dsp: SPC infifo read with data = %04X, fifo head: %02X; fifo tail was: %02X\n",data, dectalk.infifo_head_ptr, dectalk.infifo_tail_ptr); |
| 426 | #endif |
| 427 | // if fifo is empty (tail ptr == head ptr), do not increment the tail ptr, otherwise do. |
| 428 | if (dectalk.infifo_tail_ptr != dectalk.infifo_head_ptr) dectalk.infifo_tail_ptr++; // technically correct but doesn't match sn74ls224 sheet |
| 429 | //if (((dectalk.infifo_head_ptr-1)&0x1F) != dectalk.infifo_tail_ptr) dectalk.infifo_tail_ptr++; // matches sn74ls224 sheet |
| 430 | dectalk.infifo_tail_ptr&=0x1F; |
| 431 | return data; |
| 334 | 432 | } |
| 335 | 433 | |
| 336 | 434 | WRITE16_HANDLER( spc_outfifo_data_w ) |
| 337 | 435 | { |
| 338 | | // the low 4 data bits are thrown out on the real unit due to use of a 12 bit dac (and to save use of another 16x4 fifo chip), though technically they're probably valid, and with suitable hacking a dtc-01 could probably output full 16 bit samples at 10khz. |
| 339 | | logerror("dsp write to outfifo, data %x\n", data); |
| 340 | | dectalk.outfifo[dectalk.outfifo_head_ptr] = data; |
| 341 | | dectalk.outfifo_head_ptr++; |
| 342 | | dectalk.outfifo_head_ptr&=0xF; |
| 436 | // the low 4 data bits are thrown out on the real unit due to use of a 12 bit dac (and to save use of another 16x4 fifo chip), though technically they're probably valid, and with suitable hacking a dtc-01 could probably output full 16 bit samples at 10khz. |
| 437 | #ifdef VERBOSE |
| 438 | logerror("dsp: SPC outfifo write, data = %04X, fifo head was: %02X; fifo tail: %02X\n", data, dectalk.outfifo_head_ptr, dectalk.outfifo_tail_ptr); |
| 439 | #endif |
| 440 | cputag_set_input_line(space->machine, "dsp", 0, CLEAR_LINE); //TMS32010 INT (cleared because LDCK inverts the IR line, clearing int on any outfifo write... for a moment at least.) |
| 441 | // if fifo is full (head ptr = tail ptr-1), do not increment the head ptr and do not store the data |
| 442 | if (((dectalk.outfifo_tail_ptr-1)&0xF) == dectalk.outfifo_head_ptr) |
| 443 | { |
| 444 | #ifdef VERBOSE |
| 445 | logerror("outfifo was full, write ignored!\n"); |
| 446 | #endif |
| 447 | return; |
| 448 | } |
| 449 | dectalk.outfifo[dectalk.outfifo_head_ptr] = data; |
| 450 | dectalk.outfifo_head_ptr++; |
| 451 | dectalk.outfifo_head_ptr&=0xF; |
| 452 | //dectalk_outfifo_check(space->machine); // commented to allow int to clear |
| 343 | 453 | } |
| 344 | 454 | |
| 345 | | READ16_HANDLER( spc_outfifo_writable_r ) // Return state of d-latch 74ls74 @ E64 'lower half' in d0 which indicates whether outfifo is writable |
| 455 | READ16_HANDLER( spc_semaphore_r ) // Return state of d-latch 74ls74 @ E64 'lower half' in d0 which indicates whether infifo is readable |
| 346 | 456 | { |
| 347 | | return dectalk.outfifo_writable_latch; |
| 457 | #ifdef VERBOSE |
| 458 | //logerror("dsp: read infifo semaphore, returned %d\n", dectalk.infifo_semaphore); // commented due to extreme annoyance factor |
| 459 | if (!dectalk.infifo_semaphore) logerror("dsp: read infifo semaphore, returned %d\n", dectalk.infifo_semaphore); |
| 460 | #endif |
| 461 | return dectalk.infifo_semaphore; |
| 348 | 462 | } |
| 349 | 463 | /* end tms32010 i/o handlers */ |
| 350 | 464 | |
| r5603 | r5604 | |
| 394 | 508 | static ADDRESS_MAP_START(tms32010_io, ADDRESS_SPACE_IO, 16) |
| 395 | 509 | AM_RANGE(0, 0) AM_WRITE(spc_latch_outfifo_error_stats) // *set* the outfifo_status_r semaphore, and also latch the error bit at D0. |
| 396 | 510 | AM_RANGE(1, 1) AM_READWRITE(spc_infifo_data_r, spc_outfifo_data_w) //read from input fifo, write to sound fifo |
| 397 | | AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ(spc_outfifo_writable_r) //read output fifo writable status |
| 511 | AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ(spc_semaphore_r) //read output fifo writable status |
| 398 | 512 | ADDRESS_MAP_END |
| 399 | 513 | |
| 400 | 514 | /****************************************************************************** |
| r5603 | r5604 | |
| 406 | 520 | /****************************************************************************** |
| 407 | 521 | Machine Drivers |
| 408 | 522 | ******************************************************************************/ |
| 523 | static TIMER_CALLBACK( outfifo_read_cb ) |
| 524 | { |
| 525 | UINT16 data; |
| 526 | const device_config *speaker = devtag_get_device(machine, "dac"); |
| 527 | data = dectalk_outfifo_r(machine); |
| 528 | #ifdef VERBOSE |
| 529 | if (data!= 0x8000) logerror("sample output: %04X\n", data); |
| 530 | #endif |
| 531 | timer_set(machine, ATTOTIME_IN_HZ(10000), NULL, 0, outfifo_read_cb); |
| 532 | dac_signed_data_16_w( speaker, data ); |
| 533 | } |
| 409 | 534 | |
| 535 | /* Driver init: stuff that needs setting up which isn't directly affected by reset */ |
| 536 | DRIVER_INIT( dectalk ) |
| 537 | { |
| 538 | dectalk_clear_all_fifos(machine); |
| 539 | dectalk.simulate_outfifo_error = 0; |
| 540 | timer_set(machine, ATTOTIME_IN_HZ(10000), NULL, 0, outfifo_read_cb); |
| 541 | } |
| 542 | |
| 543 | |
| 410 | 544 | static MACHINE_DRIVER_START(dectalk) |
| 411 | 545 | /* basic machine hardware */ |
| 412 | 546 | MDRV_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) /* E74 20MHz OSC (/2) */ |
| 413 | 547 | MDRV_CPU_PROGRAM_MAP(m68k_mem) |
| 414 | 548 | MDRV_CPU_IO_MAP(m68k_io) |
| 415 | | MDRV_QUANTUM_TIME(HZ(10000)) |
| 416 | 549 | MDRV_MACHINE_RESET(dectalk) |
| 417 | 550 | MDRV_DUART68681_ADD( "duart68681", XTAL_3_6864MHz, dectalk_duart68681_config ) /* Y3 3.6864MHz Xtal */ |
| 418 | 551 | |
| r5603 | r5604 | |
| 420 | 553 | MDRV_CPU_ADD("dsp", TMS32010, XTAL_20MHz) /* Y1 20MHz xtal */ |
| 421 | 554 | MDRV_CPU_PROGRAM_MAP(tms32010_mem) |
| 422 | 555 | MDRV_CPU_IO_MAP(tms32010_io) |
| 423 | | MDRV_QUANTUM_TIME(HZ(10000)) |
| 556 | //MDRV_QUANTUM_TIME(HZ(750000)) |
| 557 | MDRV_QUANTUM_PERFECT_CPU("dsp") |
| 424 | 558 | |
| 425 | 559 | /* video hardware */ |
| 426 | 560 | MDRV_DEFAULT_LAYOUT(layout_dectalk) // hack to avoid screenless system crash |
| 427 | 561 | |
| 428 | 562 | /* sound hardware */ |
| 429 | | //MDRV_SPEAKER_STANDARD_MONO("mono") |
| 430 | | //MDRV_SOUND_ADD("dectalk_snd", SPEAKER, XTAL_10KHz) /* E88 10KHz OSC */ |
| 431 | | //MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 563 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 564 | MDRV_SOUND_ADD("dac", DAC, 0) /* E88 10KHz OSC, handled by timer */ |
| 565 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.9) |
| 432 | 566 | |
| 433 | 567 | /* Y2 is a 3.579545 MHz xtal for the dtmf decoder chip */ |
| 434 | 568 | |
| r5603 | r5604 | |
| 443 | 577 | |
| 444 | 578 | ROM_START( dectalk ) |
| 445 | 579 | ROM_REGION16_BE(0x40000,"maincpu", 0) |
| 446 | | // dectalk dtc-01 firmware v?.? (probably 1.4 or 2.1) (first half: 23Jul84 tag; second half: 02Jul84 tag), all roms are 27128 eproms |
| 580 | // dectalk dtc-01 firmware v2.0 (first half: 23Jul84 tag; second half: 02Jul84 tag), all roms are 27128 eproms |
| 447 | 581 | ROM_LOAD16_BYTE("dtc01_e5.123", 0x00000, 0x4000, CRC(03e1eefa) SHA1(e586de03e113683c2534fca1f3f40ba391193044)) // Label: "SP8510123E5" @ E8 |
| 448 | 582 | ROM_LOAD16_BYTE("dtc01_e5.119", 0x00001, 0x4000, CRC(af20411f) SHA1(7954bb56b7591f8954403a22d34de31c7d5441ac)) // Label: "SP8510119E5" @ E22 |
| 449 | 583 | ROM_LOAD16_BYTE("dtc01_e5.124", 0x08000, 0x4000, CRC(9edeafcb) SHA1(7724babf4ae5d77c0b4200f608d599058d04b25c)) // Label: "SP8510124E5" @ E7 |
| r5603 | r5604 | |
| 462 | 596 | ROM_LOAD16_BYTE("dtc01_e5.098", 0x38001, 0x4000, CRC(3d8910e7) SHA1(01921e77b46c2d4845023605239c45ffa4a35872)) // Label: "SP8510098E5" @ E15 |
| 463 | 597 | |
| 464 | 598 | ROM_REGION(0x2000,"dsp", 0) |
| 465 | | // dectalk dtc-01 'klsyn' tms32010 firmware v1.2?, both proms are 82s191 equivalent |
| 599 | // dectalk dtc-01 'klsyn' tms32010 firmware v2.0, both proms are 82s191 equivalent |
| 466 | 600 | ROM_LOAD16_BYTE("dtc01_f4.205", 0x000, 0x800, CRC(ed76a3ad) SHA1(3136bae243ef48721e21c66fde70dab5fc3c21d0)) // Label: "LM8506205F4 // M1-76161-5" @ E70 |
| 467 | 601 | ROM_LOAD16_BYTE("dtc01_f4.204", 0x001, 0x800, CRC(79bb54ff) SHA1(9409f90f7a397b041e4440341f2d7934cb479285)) // Label: "LM8504204F4 // 78S191" @ E69 |
| 468 | 602 | |