src/mess/drivers/tsispch.c
| r12076 | r12077 | |
| 18 | 18 | * Attached i8251a uart at u15 |
| 19 | 19 | * Added dipswitch array S4 |
| 20 | 20 | * Attached 8259 PIC |
| 21 | | * IR0 = upd7720 p0 pin masked by something, not hooked up yet |
| 21 | * IR0 = upd7720 p0 pin masked by (probably peripheral bit 0) |
| 22 | 22 | * IR1 = i8251 rxrdy |
| 23 | 23 | * IR2 = i8251 txempty |
| 24 | 24 | * IR3 = i8251 txrdy |
| r12076 | r12077 | |
| 33 | 33 | * Correctly implement UPD7720 cpu core to avoid needing revolting conversion code; this probably involves overriding and duplicating much of the exec_xx sections of the 7725 core |
| 34 | 34 | * Correct memory maps and io maps, and figure out what all the proms do - mostly done |
| 35 | 35 | * 8259 PIC: figure out where IR4-7 come from, if anywhere. |
| 36 | | * UPD7720: hook up p0 and p1 as outputs, and figure out how IR0 is masked from p0. |
| 36 | * UPD7720 and 8259: hook up p0 and p1 as outputs, and figure out how 8259 IR0 is masked from 7720 p0. |
| 37 | 37 | * Add other dipswitches and jumpers (these may actually just control clock dividers for the two 8251s) |
| 38 | 38 | * Everything else |
| 39 | 39 | * |
| r12076 | r12077 | |
| 46 | 46 | * the low 8 bits (7-0) are Sw4 |
| 47 | 47 | * the high 8 bits: |
| 48 | 48 | * Bit F E D C B A 9 8 |
| 49 | | * | | | | | | | \- unknown, possibly related to 7720 p0 int mask |
| 49 | * | | | | | | | \- unknown but used, probably control (1=allow 0=mask?) 7720 p0 int to 8259 ir0? |
| 50 | 50 | * | | | | | | \--- LED 6 control (0 = on) |
| 51 | 51 | * | | | | | \----- LED 5 control (0 = on) |
| 52 | 52 | * | | | | \------- LED 4 control (0 = on) |
| 53 | 53 | * | | | \--------- LED 3 control (0 = on) |
| 54 | | * | | \----------- unknown |
| 54 | * | | \----------- unknown, possibly unused? |
| 55 | 55 | * | \------------- UPD7720 RESET line (0 = high/in reset, 1 = low/running) |
| 56 | | * \--------------- unknown |
| 56 | * \--------------- unknown, possibly unused? but might possibly related to 7720 p0->8259 as well? |
| 57 | 57 | * |
| 58 | | * in other words: |
| 59 | | * LEDS 6 5 4 3 |
| 60 | | * write of 0100 - LEDS on, on, on, on (7720 mask int changed? needs further test) |
| 61 | | * write of 0200 - LEDS off, on, on, on (led 6 control) |
| 62 | | * write of 0400 - LEDS on, off, on, on (led 5 control) |
| 63 | | * write of 0800 - LEDS on, on, off, on (led 4 control) |
| 64 | | * write of 1000 - LEDS on, on, on, off(led 3 control) |
| 65 | | * write of 2000 - LEDS on, on, on, on (?) |
| 66 | | * write of 4000 - LEDS on, on, on, on (changes upd7720 RESET line status from high to low) |
| 67 | | * write of 8000 - LEDS on, on, on, on (?) |
| 68 | | * |
| 69 | 58 | * When the unit is idle, leds 5 and 3 are on and upd7720 reset is low (write of 0b?1?0101?. |
| 59 | * On all character writes from i8251, bit 8 is unset, then set again, possibly to avoid interrupt clashes? |
| 70 | 60 | * |
| 71 | 61 | * Bootup notes: |
| 72 | 62 | * D3109: checks if 0x80 (S4-8) is set: if set, continue, else jump to D3123 |
| r12076 | r12077 | |
| 126 | 116 | /* |
| 127 | 117 | Devices and handlers |
| 128 | 118 | */ |
| 119 | //upd7720 (TODO: hook up p0, p1, int) |
| 120 | static NECDSP_INTERFACE( upd7720_config ) |
| 121 | { |
| 122 | DEVCB_NULL, |
| 123 | DEVCB_NULL, |
| 124 | DEVCB_NULL |
| 125 | }; |
| 129 | 126 | |
| 127 | |
| 130 | 128 | /***************************************************************************** |
| 131 | 129 | USART 8251 and Terminal stuff |
| 132 | 130 | *****************************************************************************/ |
| r12076 | r12077 | |
| 147 | 145 | |
| 148 | 146 | const msm8251_interface msm8251_config = |
| 149 | 147 | { |
| 150 | | DEVCB_NULL, // in rxd, serial |
| 148 | DEVCB_NULL, // in rxd, serial (todo: proper hookup, currently using hack w/msm8251_recieve_character()) |
| 151 | 149 | DEVCB_NULL, // out txd, serial |
| 152 | 150 | DEVCB_NULL, // in dsr |
| 153 | 151 | DEVCB_NULL, // out dtr |
| r12076 | r12077 | |
| 205 | 203 | |
| 206 | 204 | WRITE8_MEMBER( tsispch_state::peripheral_w ) |
| 207 | 205 | { |
| 208 | | /* These are the 4 debug leds on the pcb inside the case. |
| 209 | | They are called on the silkscreen, '6','5','4',and '3', and |
| 210 | | are connected to bits 1, 2, 3, and 4 of this register. |
| 211 | | Bit 4 also connects to the 'talking' LED on the front panel. |
| 212 | | When 0 is written to a bit, the led turns on. |
| 213 | | See notes at beginning of file for more info. |
| 214 | | */ |
| 206 | /* This controls the four LEDS, the RESET line for the upd77p20, |
| 207 | and (probably) the p0-to-ir0 masking of the upd77p20; there are two |
| 208 | unknown and seemingly unused bits as well. |
| 209 | see the top of the file for more info. |
| 210 | */ |
| 215 | 211 | tsispch_state *state = machine().driver_data<tsispch_state>(); |
| 216 | 212 | state->m_paramReg = data; |
| 217 | 213 | cputag_set_input_line(machine(), "dsp", INPUT_LINE_RESET, BIT(data,6)?CLEAR_LINE:ASSERT_LINE); |
| 218 | 214 | #ifdef DEBUG_PARAM |
| 219 | | //fprintf(stderr,"8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; UNK0: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0)); |
| 220 | | logerror("8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; UNK0: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0)); |
| 215 | //fprintf(stderr,"8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; DSPIRQMASK: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0)); |
| 216 | logerror("8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; DSPIRQMASK: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0)); |
| 221 | 217 | #endif |
| 222 | 218 | popmessage("LEDS: 6/Talking:%d 5:%d 4:%d 3:%d\n", 1-BIT(data,1), 1-BIT(data,2), 1-BIT(data,3), 1-BIT(data,4)); |
| 223 | 219 | } |
| r12076 | r12077 | |
| 339 | 335 | 0 0 x x 0 x 1 0 * * * * * * * * * * * s 6264*2 SRAM 3rd quarter |
| 340 | 336 | 0 0 x x 0 x 1 1 0 0 0 x x x x x x x * x iP8251A @ U15 |
| 341 | 337 | 0 0 x x 0 x 1 1 0 0 1 x x x x x x x * x AMD P8259A PIC |
| 342 | | 0 0 x x 0 x 1 1 0 1 0 x x x x x x x x * LEDS and dipswitches? |
| 338 | 0 0 x x 0 x 1 1 0 1 0 x x x x x x x x * LEDS, dipswitches, and UPD77P20 control lines |
| 343 | 339 | 0 0 x x 0 x 1 1 0 1 1 x x x x x x x * x UPD77P20 data/status |
| 344 | 340 | 0 0 x x 0 x 1 1 1 x x Open bus, verified (returns 0x00EA) |
| 345 | 341 | 0 0 x x 1 x Open bus? (or maybe status?) (returns 0xFA,B,C,FFF) |
| 346 | | 0 1 Open bus, verfiied (returns 0x00EA) |
| 342 | 0 1 Open bus, verified (returns 0x00EA) |
| 347 | 343 | 1 0 Open bus, verified (returns 0x00EA) |
| 348 | 344 | 1 1 0 * * * * * * * * * * * * * * * * s ROMs 2 and 3 |
| 349 | 345 | 1 1 1 * * * * * * * * * * * * * * * * s ROMs 0 and 1 |
| r12076 | r12077 | |
| 398 | 394 | PORT_DIPNAME( 0x20, 0x20, "S4-6") PORT_DIPLOCATION("SW4:6") |
| 399 | 395 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 400 | 396 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 401 | | PORT_DIPNAME( 0x40, 0x40, "Self Test") PORT_DIPLOCATION("SW4:7") |
| 397 | PORT_DIPNAME( 0x40, 0x40, "S4-7: Self Test") PORT_DIPLOCATION("SW4:7") |
| 402 | 398 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 403 | 399 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 404 | 400 | PORT_DIPNAME( 0x80, 0x80, "S4-8") PORT_DIPLOCATION("SW4:8") |
| r12076 | r12077 | |
| 421 | 417 | MCFG_CPU_ADD("dsp", UPD7725, 8000000) /* VERIFIED clock, unknown divider; correct dsp type is UPD77P20 */ |
| 422 | 418 | MCFG_CPU_PROGRAM_MAP(dsp_prg_map) |
| 423 | 419 | MCFG_CPU_DATA_MAP(dsp_data_map) |
| 420 | MCFG_CPU_CONFIG(upd7720_config) |
| 424 | 421 | |
| 425 | 422 | /* PIC 8259 */ |
| 426 | 423 | MCFG_PIC8259_ADD("pic8259", pic8259_config) |
| r12076 | r12077 | |
| 430 | 427 | |
| 431 | 428 | /* sound hardware */ |
| 432 | 429 | //MCFG_SPEAKER_STANDARD_MONO("mono") |
| 433 | | //MCFG_SOUND_ADD("dac", DAC, 0) /* TODO: correctly figure out how the DAC works; apparently it is connected to the serial output of the upd7720, which will be fun to connect up */ |
| 430 | //MCFG_SOUND_ADD("dac", DAC, 0) /* TODO: correctly figure out how the DAC works; apparently it is connected to the serial output of the upd7720, which will be "fun" to connect up */ |
| 434 | 431 | //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 435 | 432 | |
| 436 | 433 | MCFG_FRAGMENT_ADD( generic_terminal ) |
| r12076 | r12077 | |
| 460 | 457 | // L - always low; H - always high |
| 461 | 458 | // U77: unknown (what does this do?) |
| 462 | 459 | // input is A19 for I4, A18 for I3, A15 for I2, A13 for I1, A12 for I0 |
| 463 | | // output bits 0bLLLLzyxH |
| 460 | // output bits 0bLLLLzyxH (TODO: recheck) |
| 464 | 461 | // bit - function |
| 465 | 462 | // 7, 6, 5, 4 - seem unconnected? |
| 466 | 463 | // 3 - connection unknown, low in the RAM, ROM, and Peripheral memory areas |
| 467 | 464 | // 2 - connection unknown, low in the RAM and ROM memory areas |
| 468 | | // 1 - unknown, always high |
| 465 | // 1 - unknown, always high (TODO: recheck) |
| 469 | 466 | // 0 - unknown, always high |
| 470 | 467 | // |
| 471 | 468 | // U79: SRAM and peripheral mapping: |
| r12076 | r12077 | |
| 484 | 481 | // inputs: S0 - A9; S1 - A10; S2 - A11 |
| 485 | 482 | // /Y0 - /CS (pin 11) of iP8251A at U15 |
| 486 | 483 | // /Y1 - /CS (pin 1) of AMD 8259A at U4 |
| 487 | | // /Y2 - pins 1, 4, 9 (1A, 2A, 3A inputs) of 74HCT32 Quad OR gate at U58 <wip, involves LEDS?> |
| 484 | // /Y2 - pins 1, 4, 9 (1A, 2A, 3A inputs) of 74HCT32 Quad OR gate at U58 <wip, this is the 'peripheral' register, which deals with upd7720 control lines, LEDS and dipswitches> |
| 488 | 485 | // /Y3 - pin 26 (/CS) of UPD77P20 at U29 |
| 489 | 486 | // /Y4 thru /Y7 - seem unconnected SO FAR? <wip> |
| 490 | 487 | // The 74S138N at U78: <wip> |
| 491 | | // /EN3 - ? |
| 488 | // /EN3 - ? (TODO: figure these out) |
| 492 | 489 | // /EN2 - ? |
| 493 | 490 | // inputs: S0 - A18; S1 - A19; S2 - Pulled to GND |
| 494 | 491 | // /Y0 - ? |
| 495 | 492 | // /Y1 - ? |
| 496 | 493 | // /Y2 - ? |
| 497 | | // /Y3 - connects somewhere |
| 494 | // /Y3 - connects somewhere, only active when A18 and A19 are high, possibly a rom bus buffer enable? (TODO: figure out what this does) |
| 498 | 495 | // /Y4-/Y7 - never used since S2 is pulled to GND |
| 499 | 496 | // 2 - to /CS1 on 6264 SRAMs at U63 and U66 |
| 500 | 497 | // 1 - to /CS1 on 6264 SRAMs at U62 and U65 |