src/mess/drivers/newbrain.c
| r3024 | r3025 | |
| 31 | 31 | ADC0809 (427) |
| 32 | 32 | DAC0808 (461) |
| 33 | 33 | |
| 34 | Model M: 'Page Register', Expansion Port onto Z80 bus, Video, ACIA/CTC, User Port |
| 35 | Model A: Expansion Port, Video, no User Port but has software driver serial port - s/w Printer, s/w V24 |
| 36 | Model V: ACIA/CTC, User Port |
| 37 | |
| 34 | 38 | */ |
| 35 | 39 | |
| 36 | 40 | /* |
| r3024 | r3025 | |
| 61 | 65 | return image_from_devtype_and_index(IO_CASSETTE, index); |
| 62 | 66 | } |
| 63 | 67 | |
| 68 | /* Enable/Status */ |
| 69 | |
| 70 | #define NEWBRAIN_ENRG1_CLK 0x01 |
| 71 | #define NEWBRAIN_ENRG1_TVP 0x04 |
| 72 | #define NEWBRAIN_ENRG1_CTS 0x10 |
| 73 | #define NEWBRAIN_ENRG1_DO 0x20 |
| 74 | #define NEWBRAIN_ENRG1_PO 0x80 |
| 75 | |
| 76 | static WRITE8_HANDLER( enrg1_w ) |
| 77 | { |
| 78 | /* |
| 79 | |
| 80 | bit signal description |
| 81 | |
| 82 | 0 _CLK enable frame frequency clock interrupts |
| 83 | 1 enable user interrupt |
| 84 | 2 TVP enable video display |
| 85 | 3 enable V24 |
| 86 | 4 V24 Select Receive Bit 0 |
| 87 | 5 V24 Select Receive Bit 1 |
| 88 | 6 V24 Select Transmit Bit 0 |
| 89 | 7 V24 Select Transmit Bit 1 |
| 90 | |
| 91 | */ |
| 92 | |
| 93 | newbrain_state *state = machine->driver_data; |
| 94 | |
| 95 | state->enrg1 = data; |
| 96 | } |
| 97 | |
| 98 | static WRITE8_HANDLER( a_enrg1_w ) |
| 99 | { |
| 100 | /* |
| 101 | |
| 102 | bit signal description |
| 103 | |
| 104 | 0 _CLK Clock Enable |
| 105 | 1 |
| 106 | 2 TVP TV Enable |
| 107 | 3 |
| 108 | 4 _CTS Clear to Send V24 |
| 109 | 5 DO Transmit Data V24 |
| 110 | 6 |
| 111 | 7 PO Transmit Data Printer |
| 112 | |
| 113 | */ |
| 114 | |
| 115 | newbrain_state *state = machine->driver_data; |
| 116 | |
| 117 | state->enrg1 = data; |
| 118 | } |
| 119 | |
| 120 | static READ8_HANDLER( ust_r ) |
| 121 | { |
| 122 | /* |
| 123 | |
| 124 | bit signal description |
| 125 | |
| 126 | 0 |
| 127 | 1 |
| 128 | 2 mains present |
| 129 | 3 user status |
| 130 | 4 user interrupt |
| 131 | 5 clock interrupt |
| 132 | 6 ACIA interrupt |
| 133 | 7 _COPINT COP interrupt |
| 134 | |
| 135 | */ |
| 136 | |
| 137 | newbrain_state *state = machine->driver_data; |
| 138 | |
| 139 | UINT8 data = (state->copint << 7) | (state->aciaint << 6) | (state->clkint << 5) | (state->userint << 4) | 0x04; |
| 140 | |
| 141 | switch (state->enrg1 >> 6) |
| 142 | { |
| 143 | case 0: |
| 144 | // excess, 1=24, 0=4 |
| 145 | if (state->tvctl & NEWBRAIN_VIDEO_32_40) |
| 146 | { |
| 147 | data |= 0x01; |
| 148 | } |
| 149 | break; |
| 150 | |
| 151 | case 1: |
| 152 | // characters per line, 1=40, 0=80 |
| 153 | if (state->tvctl & NEWBRAIN_VIDEO_80L) |
| 154 | { |
| 155 | data |= 0x01; |
| 156 | } |
| 157 | break; |
| 158 | |
| 159 | case 2: |
| 160 | // tape in |
| 161 | break; |
| 162 | |
| 163 | case 3: |
| 164 | // calling indicator |
| 165 | break; |
| 166 | } |
| 167 | |
| 168 | switch (state->enrg1 >> 4) |
| 169 | { |
| 170 | case 0: |
| 171 | // PWRUP, if set indicates that power is supplied to Z80 and memory |
| 172 | if (!state->pwrup) |
| 173 | { |
| 174 | data |= 0x02; |
| 175 | } |
| 176 | break; |
| 177 | |
| 178 | case 1: |
| 179 | // TVCNSL, if set then processor has video device as primary console output |
| 180 | if (state->tvcnsl) |
| 181 | { |
| 182 | data |= 0x02; |
| 183 | } |
| 184 | break; |
| 185 | |
| 186 | case 2: |
| 187 | // _BEE, if set then processor is Model A type |
| 188 | if (state->bee) |
| 189 | { |
| 190 | data |= 0x02; |
| 191 | } |
| 192 | break; |
| 193 | |
| 194 | case 3: |
| 195 | // _CALLIND, calling indicator |
| 196 | data |= 0x02; |
| 197 | break; |
| 198 | } |
| 199 | |
| 200 | return data; |
| 201 | } |
| 202 | |
| 203 | static READ8_HANDLER( a_ust_r ) |
| 204 | { |
| 205 | /* |
| 206 | |
| 207 | bit signal description |
| 208 | |
| 209 | 0 +5V |
| 210 | 1 PWRUP |
| 211 | 2 |
| 212 | 3 |
| 213 | 4 |
| 214 | 5 _CLKINT clock interrupt |
| 215 | 6 |
| 216 | 7 _COPINT COP interrupt |
| 217 | |
| 218 | */ |
| 219 | |
| 220 | newbrain_state *state = machine->driver_data; |
| 221 | |
| 222 | return (state->copint << 7) | (state->clkint << 5) | (state->pwrup << 1) | 0x01; |
| 223 | } |
| 224 | |
| 225 | static READ8_HANDLER( user_r ) |
| 226 | { |
| 227 | /* |
| 228 | |
| 229 | bit signal description |
| 230 | |
| 231 | 0 RDDK Received Data V24 |
| 232 | 1 _CTSD _Clear to Send V24 |
| 233 | 2 |
| 234 | 3 |
| 235 | 4 |
| 236 | 5 TPIN Tape in |
| 237 | 6 |
| 238 | 7 _CTSP _Clear to Send Printer |
| 239 | |
| 240 | */ |
| 241 | |
| 242 | newbrain_state *state = machine->driver_data; |
| 243 | |
| 244 | state->user = 0; |
| 245 | |
| 246 | return 0xff; |
| 247 | } |
| 248 | |
| 249 | static WRITE8_HANDLER( user_w ) |
| 250 | { |
| 251 | newbrain_state *state = machine->driver_data; |
| 252 | |
| 253 | state->user = data; |
| 254 | } |
| 255 | |
| 256 | /* Interrupts */ |
| 257 | |
| 258 | static READ8_HANDLER( clclk_r ) |
| 259 | { |
| 260 | newbrain_state *state = machine->driver_data; |
| 261 | |
| 262 | state->clkint = 1; |
| 263 | |
| 264 | return 0xff; |
| 265 | } |
| 266 | |
| 267 | static WRITE8_HANDLER( clclk_w ) |
| 268 | { |
| 269 | newbrain_state *state = machine->driver_data; |
| 270 | |
| 271 | state->clkint = 1; |
| 272 | } |
| 273 | |
| 274 | static READ8_HANDLER( clusr_r ) |
| 275 | { |
| 276 | newbrain_state *state = machine->driver_data; |
| 277 | |
| 278 | state->userint = 1; |
| 279 | |
| 280 | return 0xff; |
| 281 | } |
| 282 | |
| 283 | static WRITE8_HANDLER( clusr_w ) |
| 284 | { |
| 285 | newbrain_state *state = machine->driver_data; |
| 286 | |
| 287 | state->userint = 1; |
| 288 | } |
| 289 | |
| 64 | 290 | /* COP420 */ |
| 65 | 291 | |
| 66 | 292 | static READ8_HANDLER( newbrain_cop_l_r ) |
| r3024 | r3025 | |
| 99 | 325 | |
| 100 | 326 | newbrain_state *state = machine->driver_data; |
| 101 | 327 | |
| 102 | | state->cop_int = BIT(data, 0); |
| 328 | state->copint = BIT(data, 0); |
| 103 | 329 | |
| 104 | 330 | /* tape motor enable */ |
| 105 | 331 | |
| r3024 | r3025 | |
| 221 | 447 | return state->cop_tdi; |
| 222 | 448 | } |
| 223 | 449 | |
| 224 | | /* Floppy Disc Controller */ |
| 450 | /* Paging */ |
| 225 | 451 | |
| 226 | | static WRITE8_HANDLER( fdc_io2_w ) |
| 452 | static WRITE8_HANDLER( m_pr_w ) |
| 227 | 453 | { |
| 228 | 454 | /* |
| 229 | 455 | |
| 230 | 456 | bit description |
| 231 | 457 | |
| 232 | | 0 MOTON |
| 233 | | 1 765 RESET |
| 234 | | 2 TC |
| 235 | | 3 |
| 236 | | 4 |
| 237 | | 5 PA15 |
| 238 | | 6 |
| 239 | | 7 |
| 458 | 0 memory module identifier |
| 459 | 1 memory module identifier |
| 460 | 2 memory module identifier |
| 461 | 3 memory module identifier |
| 462 | 4 memory module identifier |
| 463 | 5 memory module identifier |
| 464 | 6 memory module identifier |
| 465 | 7 ROM/RAM identifier |
| 240 | 466 | |
| 241 | 467 | */ |
| 242 | 468 | |
| 243 | | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), BIT(data, 0)); |
| 244 | | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0); |
| 469 | // int page = (offset >> 13) & 0x07; |
| 470 | // int bank = data & 0x7f; |
| 245 | 471 | |
| 246 | | nec765_set_reset_state(machine, BIT(data, 1)); |
| 247 | | |
| 248 | | nec765_set_tc_state(machine, BIT(data, 2)); |
| 472 | if (BIT(data, 7)) |
| 473 | { |
| 474 | // RAM |
| 475 | } |
| 476 | else |
| 477 | { |
| 478 | // ROM |
| 479 | } |
| 249 | 480 | } |
| 250 | 481 | |
| 251 | | static WRITE8_HANDLER( fdc_io_w ) |
| 482 | /* Video */ |
| 483 | |
| 484 | static READ8_HANDLER( tvl_r ) |
| 252 | 485 | { |
| 253 | | /* |
| 486 | newbrain_state *state = machine->driver_data; |
| 254 | 487 | |
| 255 | | bit description |
| 256 | | |
| 257 | | 0 PAGING |
| 258 | | 1 |
| 259 | | 2 HA16 |
| 260 | | 3 MPM |
| 261 | | 4 |
| 262 | | 5 _FDC RESET |
| 263 | | 6 |
| 264 | | 7 FDC ATT |
| 265 | | |
| 266 | | */ |
| 267 | | |
| 268 | | if (!BIT(data, 5)) |
| 488 | if (offset) |
| 269 | 489 | { |
| 270 | | fdc_io2_w(machine, 0, 0); |
| 490 | state->tvram = 0xff; |
| 271 | 491 | } |
| 492 | else |
| 493 | { |
| 494 | state->tvram = 0x1ff; |
| 495 | } |
| 496 | |
| 497 | return 0xff; |
| 272 | 498 | } |
| 273 | 499 | |
| 274 | | static READ8_HANDLER( fdc_io3_r ) |
| 500 | static WRITE8_HANDLER( tvl_w ) |
| 275 | 501 | { |
| 276 | | /* |
| 277 | | |
| 278 | | bit description |
| 279 | | |
| 280 | | 0 |
| 281 | | 1 |
| 282 | | 2 |
| 283 | | 3 |
| 284 | | 4 |
| 285 | | 5 FDC INT |
| 286 | | 6 PAGING |
| 287 | | 7 FDC ATT |
| 288 | | |
| 289 | | */ |
| 290 | | |
| 291 | 502 | newbrain_state *state = machine->driver_data; |
| 292 | 503 | |
| 293 | | return state->fdc_int << 5; |
| 504 | if (offset) |
| 505 | { |
| 506 | state->tvram = data; |
| 507 | } |
| 508 | else |
| 509 | { |
| 510 | state->tvram = 0x100 | data; |
| 511 | } |
| 294 | 512 | } |
| 295 | 513 | |
| 296 | 514 | static WRITE8_HANDLER( tvctl_w ) |
| 297 | 515 | { |
| 298 | 516 | /* |
| 299 | 517 | |
| 300 | | bit description |
| 518 | bit signal description |
| 301 | 519 | |
| 302 | | 0 RV |
| 303 | | 1 FS |
| 304 | | 2 32/_40 |
| 305 | | 3 UCR |
| 520 | 0 RV 1 reverses video over entire field, ie. black on white |
| 521 | 1 FS 0 generates 128 characters and 128 reverse field characters from 8 bit character code. 1 generates 256 characters from 8 bit character code |
| 522 | 2 32/_40 0 generates 320 or 640 horizontal dots in pixel graphics mode. 1 generates 256 or 512 horizontal dots in pixel graphics mode |
| 523 | 3 UCR 0 selects 256 characters expressed in an 8x10 matrix, and 25 lines (max) displayed. 1 selects 256 characters in an 8x8 matrix, and 31 lines (max) displayed |
| 306 | 524 | 4 |
| 307 | 525 | 5 |
| 308 | | 6 80L |
| 526 | 6 80L 0 selects 40 character line length. 1 selects 80 character line length |
| 309 | 527 | 7 |
| 310 | 528 | |
| 311 | 529 | */ |
| 312 | | } |
| 313 | 530 | |
| 314 | | static READ8_HANDLER( clclk_r ) |
| 315 | | { |
| 316 | 531 | newbrain_state *state = machine->driver_data; |
| 317 | 532 | |
| 318 | | state->clk_int = 1; |
| 319 | | |
| 320 | | return 0xff; |
| 533 | state->tvctl = data; |
| 321 | 534 | } |
| 322 | 535 | |
| 323 | | static WRITE8_HANDLER( clclk_w ) |
| 324 | | { |
| 325 | | newbrain_state *state = machine->driver_data; |
| 536 | /* Disc Controller */ |
| 326 | 537 | |
| 327 | | state->clk_int = 1; |
| 328 | | } |
| 329 | | |
| 330 | | static WRITE8_HANDLER( enrg_w ) |
| 538 | static WRITE8_HANDLER( fdc_auxiliary_w ) |
| 331 | 539 | { |
| 332 | 540 | /* |
| 333 | 541 | |
| 334 | 542 | bit description |
| 335 | 543 | |
| 336 | | 0 _CLK |
| 337 | | 1 |
| 338 | | 2 TVP |
| 544 | 0 MOTON |
| 545 | 1 765 RESET |
| 546 | 2 TC |
| 339 | 547 | 3 |
| 340 | | 4 _RTSD (V24 Ready to Send) |
| 341 | | 5 DO (V24 TxD) |
| 548 | 4 |
| 549 | 5 PA15 |
| 342 | 550 | 6 |
| 343 | | 7 PO (Printer TxD) |
| 551 | 7 |
| 344 | 552 | |
| 345 | 553 | */ |
| 346 | 554 | |
| 347 | | newbrain_state *state = machine->driver_data; |
| 555 | floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), BIT(data, 0)); |
| 556 | floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0); |
| 348 | 557 | |
| 349 | | state->clk = BIT(data, 0); |
| 350 | | state->tvp = BIT(data, 2); |
| 351 | | state->v24_rts = BIT(data, 4); |
| 352 | | state->v24_txd = BIT(data, 5); |
| 353 | | state->prt_txd = BIT(data, 7); |
| 558 | nec765_set_reset_state(machine, BIT(data, 1)); |
| 559 | |
| 560 | nec765_set_tc_state(machine, BIT(data, 2)); |
| 354 | 561 | } |
| 355 | 562 | |
| 356 | | static READ8_HANDLER( ust_r ) |
| 563 | static READ8_HANDLER( fdc_control_r ) |
| 357 | 564 | { |
| 358 | 565 | /* |
| 359 | 566 | |
| 360 | 567 | bit description |
| 361 | 568 | |
| 362 | | 0 tied to +5V |
| 363 | | 1 PWRUP |
| 569 | 0 |
| 570 | 1 |
| 364 | 571 | 2 |
| 365 | 572 | 3 |
| 366 | 573 | 4 |
| 367 | | 5 _CLKINT |
| 368 | | 6 |
| 369 | | 7 _COPINT |
| 574 | 5 FDC INT |
| 575 | 6 PAGING |
| 576 | 7 FDC ATT |
| 370 | 577 | |
| 371 | 578 | */ |
| 372 | 579 | |
| 373 | 580 | newbrain_state *state = machine->driver_data; |
| 374 | 581 | |
| 375 | | return (state->cop_int << 7) || (state->clk_int << 5) | (state->pwrup << 1) | 0x01; |
| 582 | return (state->fdc_att << 7) | (state->paging << 6) | (state->fdc_int << 5); |
| 376 | 583 | } |
| 377 | 584 | |
| 378 | 585 | static READ8_HANDLER( ust2_r ) |
| r3024 | r3025 | |
| 428 | 635 | state->cop_access = 1; |
| 429 | 636 | } |
| 430 | 637 | |
| 431 | | /* Expansion Box */ |
| 638 | /* Expansion Interface Module */ |
| 432 | 639 | |
| 433 | | static WRITE8_HANDLER( enrg2_w ) |
| 640 | static WRITE8_HANDLER( ei_enrg2_w ) |
| 434 | 641 | { |
| 435 | 642 | /* |
| 436 | 643 | |
| 437 | | bit description |
| 644 | bit signal description |
| 438 | 645 | |
| 439 | | 0 _USERP |
| 440 | | 1 ANP |
| 441 | | 2 MLTMD |
| 442 | | 3 MSPD |
| 443 | | 4 ENOR (enable output receive) |
| 444 | | 5 ANSW |
| 445 | | 6 ENOT (enable output transmit) |
| 446 | | 7 |
| 646 | 0 _USERP 0 enables user data bus interrupt and also parallel latched data output (or centronics printer) interrupt |
| 647 | 1 ANP 1 enables ADC conversion complete interrupt and also calling indicator interrupt |
| 648 | 2 MLTMD 1 enables serial receive clock into multiplier input of DAC and signals data terminal not ready |
| 649 | 3 MSPD 1 enables 50K Baud serial data rate to be obtained ie. CTC input clock of 800KHz. 0 selects xxx.692KHz |
| 650 | 4 ENOR 1 enables serial receive clock to sound output summer, and also selects serial input from the printer port. 0 selects serial input from the comms port |
| 651 | 5 ANSW 1 enables second bank of 4 analogue inputs (voltage, non-ratiometric), ie. ch4-7, and enabled sound output, 0 selects ch03 |
| 652 | 6 ENOT 1 enables serial transmit clock to sound ouput summer, and also selects serial output to the printer port. 0 selects serial output to the comms port |
| 653 | 7 9th output bit for centronics printer port |
| 447 | 654 | |
| 448 | 655 | */ |
| 449 | 656 | |
| 450 | | if (BIT(data, 4)) |
| 451 | | { |
| 452 | | // ACIA RxD connected to Printer |
| 453 | | } |
| 454 | | else |
| 455 | | { |
| 456 | | // ACIA RxD connected to V24 |
| 457 | | } |
| 657 | newbrain_state *state = machine->driver_data; |
| 458 | 658 | |
| 459 | | if (BIT(data, 6)) |
| 460 | | { |
| 461 | | // ACIA TxD connected to Printer |
| 462 | | } |
| 463 | | else |
| 464 | | { |
| 465 | | // ACIA TxD connected to V24 |
| 466 | | } |
| 659 | state->enrg2 = data; |
| 467 | 660 | } |
| 468 | 661 | |
| 469 | | static READ8_HANDLER( st0_r ) |
| 662 | static WRITE8_HANDLER( ei_pr_w ) |
| 470 | 663 | { |
| 664 | // newbrain_state *state = machine->driver_data; |
| 665 | |
| 666 | // int page = (BIT(offset, 12) >> 9) | (BIT(offset, 15) >> 13) | (BIT(offset, 14) >> 13) | (BIT(offset, 13) >> 13); |
| 667 | // int bank = (BIT(offset, 11) >> 3) | (data & 0x7f); |
| 668 | } |
| 669 | |
| 670 | static READ8_HANDLER( ei_user_r ) |
| 671 | { |
| 672 | newbrain_state *state = machine->driver_data; |
| 673 | |
| 674 | state->user = 0xff; |
| 675 | |
| 676 | return 0xff; |
| 677 | } |
| 678 | |
| 679 | static WRITE8_HANDLER( ei_user_w ) |
| 680 | { |
| 681 | newbrain_state *state = machine->driver_data; |
| 682 | |
| 683 | state->user = data; |
| 684 | } |
| 685 | |
| 686 | static READ8_HANDLER( ei_anout_r ) |
| 687 | { |
| 688 | return 0xff; |
| 689 | } |
| 690 | |
| 691 | static WRITE8_HANDLER( ei_anout_w ) |
| 692 | { |
| 693 | } |
| 694 | |
| 695 | static READ8_HANDLER( ei_anin_r ) |
| 696 | { |
| 697 | // int channel = offset & 0x03; |
| 698 | |
| 699 | return 0; |
| 700 | } |
| 701 | |
| 702 | static WRITE8_HANDLER( ei_anio_w ) |
| 703 | { |
| 704 | // int channel = offset & 0x03; |
| 705 | } |
| 706 | |
| 707 | static READ8_HANDLER( ei_st0_r ) |
| 708 | { |
| 471 | 709 | /* |
| 472 | 710 | |
| 473 | | bit description |
| 711 | bit signal description |
| 474 | 712 | |
| 475 | | 0 |
| 476 | | 1 |
| 477 | | 2 tied to 0V |
| 478 | | 3 _USRINT0 |
| 479 | | 4 _USRINT |
| 480 | | 5 |
| 481 | | 6 _ACINT |
| 482 | | 7 |
| 713 | 0 fixed at 1 - indicates excess of 24 or 48, obsolete |
| 714 | 1 PWRUP 1 indicates power up from 'cold' - necessary in battery machines with power switching |
| 715 | 2 1 indicates analogue or calling indicator interrupts |
| 716 | 3 _USRINT0 0 indicates centronics printer (latched output data) port interrupt |
| 717 | 4 _USRINT 0 indicates parallel data bus port interrupt |
| 718 | 5 _CLKINT 0 indicates frame frequency clock interrupt |
| 719 | 6 _ACINT 0 indicates ACIA interrupt |
| 720 | 7 _COPINT 0 indicates interrupt from micro-controller COP420M |
| 483 | 721 | |
| 484 | 722 | */ |
| 485 | 723 | |
| 486 | 724 | return acia_irq << 6; |
| 487 | 725 | } |
| 488 | 726 | |
| 489 | | static READ8_HANDLER( st1_r ) |
| 727 | static READ8_HANDLER( ei_st1_r ) |
| 490 | 728 | { |
| 491 | 729 | /* |
| 492 | 730 | |
| 493 | | bit description |
| 731 | bit signal description |
| 494 | 732 | |
| 495 | 733 | 0 |
| 496 | | 1 TVCNSL |
| 497 | | 2 |
| 498 | | 3 40/_80 |
| 499 | | 4 _ANCH |
| 500 | | 5 N/_RV |
| 501 | | 6 |
| 734 | 1 |
| 735 | 2 N/_RV 1 selects normal video on power up (white on black), 0 selects reversed video (appears as D0 on the first 200 EI's) |
| 736 | 3 ANCH 1 indicates power is being taken from the mains supply |
| 737 | 4 40/_80 1 indicates that 40 column video is selected on power up. 0 selects 80 column video |
| 738 | 5 |
| 739 | 6 TVCNSL 1 indicates that a video display is required on power up |
| 502 | 740 | 7 |
| 503 | 741 | |
| 504 | 742 | */ |
| 505 | 743 | |
| 506 | | return 0; |
| 744 | newbrain_state *state = machine->driver_data; |
| 745 | |
| 746 | return (state->tvcnsl << 6); |
| 507 | 747 | } |
| 508 | 748 | |
| 509 | | static READ8_HANDLER( st2_r ) |
| 749 | static READ8_HANDLER( ei_st2_r ) |
| 510 | 750 | { |
| 511 | 751 | /* |
| 512 | 752 | |
| 513 | | bit description |
| 753 | bit signal description |
| 514 | 754 | |
| 515 | | 0 |
| 516 | | 1 |
| 755 | 0 received serial data from communications port |
| 756 | 1 0 indicates 'clear-to-send' condition at communications port |
| 517 | 757 | 2 |
| 518 | 758 | 3 |
| 519 | 759 | 4 |
| 520 | | 5 |
| 760 | 5 logic level tape input |
| 521 | 761 | 6 |
| 522 | | 7 |
| 762 | 7 0 indicates 'clear-to-send' condition at printer port |
| 523 | 763 | |
| 524 | 764 | */ |
| 525 | 765 | |
| 526 | 766 | return 0; |
| 527 | 767 | } |
| 528 | 768 | |
| 529 | | static READ8_HANDLER( usbs_r ) |
| 769 | static READ8_HANDLER( ei_usbs_r ) |
| 530 | 770 | { |
| 531 | 771 | return 0xff; |
| 532 | 772 | } |
| 533 | 773 | |
| 774 | static WRITE8_HANDLER( ei_usbs_w ) |
| 775 | { |
| 776 | } |
| 777 | |
| 778 | static WRITE8_HANDLER( ei_paging_w ) |
| 779 | { |
| 780 | newbrain_state *state = machine->driver_data; |
| 781 | |
| 782 | state->paging = data; |
| 783 | |
| 784 | if (BIT(offset, 8)) |
| 785 | { |
| 786 | // expansion interface module |
| 787 | |
| 788 | /* |
| 789 | |
| 790 | bit signal description |
| 791 | |
| 792 | 0 PG |
| 793 | 1 WPL |
| 794 | 2 A16 |
| 795 | 3 _MPM |
| 796 | 4 HISLT |
| 797 | 5 |
| 798 | 6 |
| 799 | 7 |
| 800 | |
| 801 | */ |
| 802 | } |
| 803 | else if (BIT(offset, 9)) |
| 804 | { |
| 805 | // disc controller |
| 806 | |
| 807 | /* |
| 808 | |
| 809 | bit signal description |
| 810 | |
| 811 | 0 PAGING |
| 812 | 1 |
| 813 | 2 HA16 |
| 814 | 3 MPM |
| 815 | 4 |
| 816 | 5 _FDC RESET |
| 817 | 6 |
| 818 | 7 FDC ATT |
| 819 | |
| 820 | */ |
| 821 | |
| 822 | cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE); |
| 823 | |
| 824 | state->fdc_att = BIT(data, 7); |
| 825 | } |
| 826 | else if (BIT(offset, 10)) |
| 827 | { |
| 828 | // network controller |
| 829 | } |
| 830 | } |
| 831 | |
| 534 | 832 | /* Memory Maps */ |
| 535 | 833 | |
| 536 | 834 | static ADDRESS_MAP_START( newbrain_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 537 | 835 | ADDRESS_MAP_UNMAP_HIGH |
| 538 | | AM_RANGE(0x0000, 0x7fff) AM_RAMBANK(1) |
| 539 | | AM_RANGE(0xa000, 0xffff) AM_ROM |
| 836 | AM_RANGE(0x0000, 0x1fff) AM_RAMBANK(1) |
| 837 | AM_RANGE(0x2000, 0x3fff) AM_RAMBANK(2) |
| 838 | AM_RANGE(0x4000, 0x5fff) AM_RAMBANK(3) |
| 839 | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(4) |
| 840 | AM_RANGE(0x8000, 0x9fff) AM_RAMBANK(5) |
| 841 | AM_RANGE(0xa000, 0xbfff) AM_RAMBANK(6) |
| 842 | AM_RANGE(0xc000, 0xdfff) AM_RAMBANK(7) |
| 843 | AM_RANGE(0xe000, 0xffff) AM_RAMBANK(8) |
| 540 | 844 | ADDRESS_MAP_END |
| 541 | 845 | |
| 542 | | static ADDRESS_MAP_START( newbrain_io_map, ADDRESS_SPACE_IO, 8 ) |
| 846 | static ADDRESS_MAP_START( newbrain_ei_io_map, ADDRESS_SPACE_IO, 8 ) |
| 543 | 847 | ADDRESS_MAP_UNMAP_HIGH |
| 544 | | // ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 545 | | // AM_RANGE(0x00, 0x00) AM_READWRITE(clusr) |
| 546 | | AM_RANGE(0x01, 0x01) AM_WRITE(enrg2_w) |
| 547 | | // AM_RANGE(0x02, 0x02) AM_READWRITE(pr) |
| 548 | | // AM_RANGE(0x03, 0x03) AM_READWRITE(user) |
| 549 | | AM_RANGE(0x04, 0x04) AM_READWRITE(clclk_r, clclk_w) |
| 550 | | // AM_RANGE(0x05, 0x05) AM_WRITE(cldma) |
| 551 | | AM_RANGE(0x06, 0x06) AM_READWRITE(cop_r, cop_w) |
| 552 | | AM_RANGE(0x07, 0x07) AM_WRITE(enrg_w) |
| 553 | | // AM_RANGE(0x08, 0x08) AM_READWRITE(tvl) |
| 554 | | AM_RANGE(0x0c, 0x0c) AM_WRITE(tvctl_w) |
| 555 | | // AM_RANGE(0x10, 0x10) AM_READ(anin_r) |
| 556 | | AM_RANGE(0x14, 0x14) AM_READ(ust_r) |
| 557 | | AM_RANGE(0x16, 0x16) AM_READ(ust2_r) |
| 558 | | AM_RANGE(0x18, 0x18) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w) |
| 559 | | AM_RANGE(0x19, 0x19) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w) |
| 560 | | AM_RANGE(0x1c, 0x1c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 848 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(clusr_r, clusr_w) |
| 849 | AM_RANGE(0x01, 0x01) AM_MIRROR(0xff00) AM_WRITE(ei_enrg2_w) |
| 850 | AM_RANGE(0x02, 0x02) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE(ei_pr_w) |
| 851 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xff00) AM_READWRITE(ei_user_r, ei_user_w) |
| 852 | AM_RANGE(0x04, 0x04) AM_MIRROR(0xff00) AM_READWRITE(clclk_r, clclk_w) |
| 853 | AM_RANGE(0x05, 0x05) AM_MIRROR(0xff00) AM_READWRITE(ei_anout_r, ei_anout_w) |
| 854 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xff00) AM_READWRITE(cop_r, cop_w) |
| 855 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff00) AM_WRITE(enrg1_w) |
| 856 | AM_RANGE(0x08, 0x09) AM_MIRROR(0xff02) AM_READWRITE(tvl_r, tvl_w) |
| 857 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff03) AM_WRITE(tvctl_w) |
| 858 | AM_RANGE(0x10, 0x13) AM_MIRROR(0xff00) AM_READWRITE(ei_anin_r, ei_anio_w) |
| 859 | AM_RANGE(0x14, 0x14) AM_MIRROR(0xff00) AM_READ(ei_st0_r) |
| 860 | AM_RANGE(0x15, 0x15) AM_MIRROR(0xff00) AM_READ(ei_st1_r) |
| 861 | AM_RANGE(0x16, 0x16) AM_MIRROR(0xff00) AM_READ(ei_st2_r) |
| 862 | AM_RANGE(0x17, 0x17) AM_MIRROR(0xff00) AM_READWRITE(ei_usbs_r, ei_usbs_w) |
| 863 | AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w) |
| 864 | AM_RANGE(0x19, 0x19) AM_MIRROR(0xff00) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w) |
| 865 | AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xff00) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 866 | AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_WRITE(ei_paging_w) |
| 561 | 867 | ADDRESS_MAP_END |
| 562 | 868 | |
| 563 | | static ADDRESS_MAP_START( newbrain_extension_io_map, ADDRESS_SPACE_IO, 8 ) |
| 869 | static ADDRESS_MAP_START( newbrain_m_io_map, ADDRESS_SPACE_IO, 8 ) |
| 564 | 870 | ADDRESS_MAP_UNMAP_HIGH |
| 565 | | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 566 | | // AM_RANGE(0x00, 0x00) AM_READWRITE(clusr) |
| 567 | | AM_RANGE(0x01, 0x01) AM_WRITE(enrg2_w) |
| 568 | | // AM_RANGE(0x02, 0x02) AM_READWRITE(pr) |
| 569 | | // AM_RANGE(0x03, 0x03) AM_READWRITE(user) |
| 570 | | // AM_RANGE(0x04, 0x04) AM_READWRITE(clclk) |
| 571 | | // AM_RANGE(0x05, 0x05) AM_WRITE(anout_w) |
| 572 | | AM_RANGE(0x06, 0x06) AM_READWRITE(cop_r, cop_w) |
| 573 | | AM_RANGE(0x07, 0x07) AM_WRITE(enrg_w) |
| 574 | | // AM_RANGE(0x08, 0x08) AM_READWRITE(tvl) |
| 575 | | AM_RANGE(0x0c, 0x0c) AM_WRITE(tvctl_w) |
| 576 | | // AM_RANGE(0x10, 0x10) AM_READ(anin_r) |
| 577 | | AM_RANGE(0x14, 0x14) AM_READ(st0_r) |
| 578 | | AM_RANGE(0x15, 0x15) AM_READ(st1_r) |
| 579 | | AM_RANGE(0x16, 0x16) AM_READ(st2_r) |
| 580 | | AM_RANGE(0x17, 0x17) AM_READ(usbs_r) |
| 581 | | AM_RANGE(0x18, 0x18) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w) |
| 582 | | AM_RANGE(0x19, 0x19) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w) |
| 583 | | AM_RANGE(0x1c, 0x1c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 584 | | AM_RANGE(0x02ff, 0x02ff) AM_WRITE(fdc_io_w) |
| 871 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xffc0) AM_READWRITE(clusr_r, clusr_w) |
| 872 | AM_RANGE(0x02, 0x02) AM_MIRROR(0xffc0) AM_MASK(0xff00) AM_WRITE(m_pr_w) |
| 873 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xffc0) AM_WRITE(user_w) |
| 874 | AM_RANGE(0x04, 0x04) AM_MIRROR(0xffc0) AM_READWRITE(clclk_r, clclk_w) |
| 875 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xffc0) AM_READWRITE(cop_r, cop_w) |
| 876 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xffc0) AM_WRITE(a_enrg1_w) |
| 877 | AM_RANGE(0x08, 0x09) AM_MIRROR(0xffc2) AM_READWRITE(tvl_r, tvl_w) |
| 878 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xffc3) AM_WRITE(tvctl_w) |
| 879 | AM_RANGE(0x14, 0x14) AM_MIRROR(0xffc0) AM_READ(ust_r) |
| 880 | AM_RANGE(0x15, 0x15) AM_MIRROR(0xffc2) AM_READ(user_r) |
| 881 | AM_RANGE(0x16, 0x16) AM_MIRROR(0xffc0) AM_READ(ust2_r) |
| 882 | AM_RANGE(0x18, 0x18) AM_MIRROR(0xffc0) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w) |
| 883 | AM_RANGE(0x19, 0x19) AM_MIRROR(0xffc0) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w) |
| 884 | AM_RANGE(0x1c, 0x1c) AM_MIRROR(0xffc0) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 585 | 885 | ADDRESS_MAP_END |
| 586 | 886 | |
| 887 | static ADDRESS_MAP_START( newbrain_a_io_map, ADDRESS_SPACE_IO, 8 ) |
| 888 | ADDRESS_MAP_UNMAP_HIGH |
| 889 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xffc0) AM_READWRITE(clusr_r, clusr_w) |
| 890 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xffc0) AM_WRITE(user_w) |
| 891 | AM_RANGE(0x04, 0x04) AM_MIRROR(0xffc0) AM_READWRITE(clclk_r, clclk_w) |
| 892 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xffc0) AM_READWRITE(cop_r, cop_w) |
| 893 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xffc0) AM_WRITE(a_enrg1_w) |
| 894 | AM_RANGE(0x08, 0x09) AM_MIRROR(0xffc2) AM_READWRITE(tvl_r, tvl_w) |
| 895 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xffc3) AM_WRITE(tvctl_w) |
| 896 | AM_RANGE(0x14, 0x14) AM_MIRROR(0xffc0) AM_READ(a_ust_r) |
| 897 | AM_RANGE(0x16, 0x16) AM_MIRROR(0xffc0) AM_READ(ust2_r) |
| 898 | ADDRESS_MAP_END |
| 899 | |
| 900 | static ADDRESS_MAP_START( newbrain_v_io_map, ADDRESS_SPACE_IO, 8 ) |
| 901 | ADDRESS_MAP_UNMAP_HIGH |
| 902 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xffc0) AM_READWRITE(clusr_r, clusr_w) |
| 903 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xffc0) AM_WRITE(user_w) |
| 904 | AM_RANGE(0x04, 0x04) AM_MIRROR(0xffc0) AM_READWRITE(clclk_r, clclk_w) |
| 905 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xffc0) AM_READWRITE(cop_r, cop_w) |
| 906 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xffc0) AM_WRITE(enrg1_w) |
| 907 | AM_RANGE(0x08, 0x09) AM_MIRROR(0xffc2) AM_WRITE(tvl_w) |
| 908 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xffc3) AM_WRITE(tvctl_w) |
| 909 | AM_RANGE(0x14, 0x14) AM_MIRROR(0xffc0) AM_READ(ust_r) |
| 910 | AM_RANGE(0x15, 0x15) AM_MIRROR(0xffc2) AM_READ(user_r) |
| 911 | AM_RANGE(0x18, 0x18) AM_MIRROR(0xffc0) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w) |
| 912 | AM_RANGE(0x19, 0x19) AM_MIRROR(0xffc0) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w) |
| 913 | AM_RANGE(0x1c, 0x1c) AM_MIRROR(0xffc0) AM_READWRITE(z80ctc_0_r, z80ctc_0_w) |
| 914 | ADDRESS_MAP_END |
| 915 | |
| 587 | 916 | static ADDRESS_MAP_START( newbrain_cop_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 588 | 917 | AM_RANGE(0x000, 0x3ff) AM_ROM |
| 589 | 918 | ADDRESS_MAP_END |
| r3024 | r3025 | |
| 606 | 935 | static ADDRESS_MAP_START( newbrain_fdc_io_map, ADDRESS_SPACE_IO, 8 ) |
| 607 | 936 | ADDRESS_MAP_UNMAP_HIGH |
| 608 | 937 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 609 | | AM_RANGE(0x20, 0x20) AM_WRITE(fdc_io2_w) |
| 610 | | AM_RANGE(0x40, 0x40) AM_READ(fdc_io3_r) |
| 938 | AM_RANGE(0x00, 0x00) AM_READ(nec765_status_r) |
| 939 | AM_RANGE(0x01, 0x01) AM_READWRITE(nec765_data_r, nec765_data_w) |
| 940 | AM_RANGE(0x20, 0x20) AM_WRITE(fdc_auxiliary_w) |
| 941 | AM_RANGE(0x40, 0x40) AM_READ(fdc_control_r) |
| 611 | 942 | ADDRESS_MAP_END |
| 612 | 943 | |
| 613 | 944 | /* Input Ports */ |
| r3024 | r3025 | |
| 761 | 1092 | static TIMER_CALLBACK( pwrup_tick ) |
| 762 | 1093 | { |
| 763 | 1094 | newbrain_state *state = machine->driver_data; |
| 1095 | int bank; |
| 764 | 1096 | |
| 765 | 1097 | state->pwrup = 0; |
| 766 | 1098 | |
| 767 | | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1); |
| 768 | | |
| 769 | | memory_set_bank(1, 1); |
| 1099 | for (bank = 1; bank < 9; bank++) |
| 1100 | { |
| 1101 | memory_configure_bank(bank, 0, 1, memory_region(machine, "main") + (bank - 1) * 0x2000, 0); |
| 1102 | memory_set_bank(bank, 0); |
| 1103 | } |
| 770 | 1104 | } |
| 771 | 1105 | |
| 772 | 1106 | INLINE int get_reset_t(void) |
| r3024 | r3025 | |
| 782 | 1116 | static MACHINE_START( newbrain ) |
| 783 | 1117 | { |
| 784 | 1118 | newbrain_state *state = machine->driver_data; |
| 1119 | int bank; |
| 785 | 1120 | |
| 786 | 1121 | /* memory banking */ |
| 787 | 1122 | |
| 788 | | memory_configure_bank(1, 0, 1, memory_region(machine, "main") + 0xa000, 0); |
| 789 | | memory_configure_bank(1, 1, 1, mess_ram, 0); |
| 1123 | for (bank = 1; bank < 9; bank++) |
| 1124 | { |
| 1125 | memory_configure_bank(bank, 0, 1, memory_region(machine, "main") + 0xe000, 0); |
| 1126 | memory_set_bank(bank, 0); |
| 1127 | } |
| 790 | 1128 | |
| 791 | | memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0x6000, SMH_BANK1, SMH_UNMAP); |
| 792 | | |
| 793 | | memory_set_bank(1, 0); |
| 794 | | |
| 795 | 1129 | /* initialize devices */ |
| 796 | 1130 | |
| 797 | 1131 | nec765_init(machine, &newbrain_nec765_interface, NEC765A, NEC765_RDY_PIN_NOT_CONNECTED); |
| r3024 | r3025 | |
| 808 | 1142 | timer_adjust_oneshot(state->reset_timer, ATTOTIME_IN_MSEC(get_pwrup_t()), 0); |
| 809 | 1143 | state->pwrup = 1; |
| 810 | 1144 | |
| 1145 | /* initialize variables */ |
| 1146 | |
| 1147 | state->userint = 1; |
| 1148 | state->clkint = 1; |
| 1149 | state->aciaint = 1; |
| 1150 | state->copint = 1; |
| 1151 | state->bee = 1; |
| 1152 | state->tvcnsl = 1; |
| 1153 | |
| 811 | 1154 | /* register for state saving */ |
| 1155 | |
| 812 | 1156 | } |
| 813 | 1157 | |
| 814 | 1158 | static MACHINE_RESET( newbrain ) |
| r3024 | r3025 | |
| 829 | 1173 | |
| 830 | 1174 | static INTERRUPT_GEN( newbrain_interrupt ) |
| 831 | 1175 | { |
| 832 | | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, HOLD_LINE); |
| 1176 | newbrain_state *state = machine->driver_data; |
| 1177 | |
| 1178 | if (state->enrg1 & NEWBRAIN_ENRG1_CLK) |
| 1179 | { |
| 1180 | cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, HOLD_LINE); |
| 1181 | |
| 1182 | state->clkint = 0; |
| 1183 | } |
| 833 | 1184 | } |
| 834 | 1185 | |
| 835 | 1186 | static COP400_INTERFACE( newbrain_cop_intf ) |
| r3024 | r3025 | |
| 848 | 1199 | |
| 849 | 1200 | MDRV_CPU_ADD("main", Z80, XTAL_16MHz/8) |
| 850 | 1201 | MDRV_CPU_PROGRAM_MAP(newbrain_map, 0) |
| 851 | | MDRV_CPU_IO_MAP(newbrain_io_map, 0) |
| 1202 | MDRV_CPU_IO_MAP(newbrain_ei_io_map, 0) |
| 852 | 1203 | MDRV_CPU_VBLANK_INT("main", newbrain_interrupt) |
| 853 | 1204 | |
| 854 | | MDRV_CPU_ADD("cop", COP420, XTAL_16MHz/8) |
| 1205 | MDRV_CPU_ADD("cop", COP420, XTAL_16MHz/8) // COP420-GUW/M |
| 855 | 1206 | MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0) |
| 856 | 1207 | MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0) |
| 857 | 1208 | MDRV_CPU_CONFIG(newbrain_cop_intf) |
| r3024 | r3025 | |
| 868 | 1219 | MDRV_IMPORT_FROM(newbrain_video) |
| 869 | 1220 | MACHINE_DRIVER_END |
| 870 | 1221 | |
| 871 | | static MACHINE_DRIVER_START( newbraid ) |
| 872 | | MDRV_IMPORT_FROM(newbrain) |
| 1222 | static MACHINE_DRIVER_START( newbraim ) |
| 1223 | MDRV_DRIVER_DATA(newbrain_state) |
| 1224 | |
| 1225 | // basic system hardware |
| 1226 | |
| 1227 | MDRV_CPU_ADD("main", Z80, XTAL_16MHz/8) |
| 1228 | MDRV_CPU_PROGRAM_MAP(newbrain_map, 0) |
| 1229 | MDRV_CPU_IO_MAP(newbrain_m_io_map, 0) |
| 1230 | MDRV_CPU_VBLANK_INT("main", newbrain_interrupt) |
| 1231 | |
| 1232 | MDRV_CPU_ADD("cop", COP420, XTAL_16MHz/8) // COP420-GUW/M |
| 1233 | MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0) |
| 1234 | MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0) |
| 1235 | MDRV_CPU_CONFIG(newbrain_cop_intf) |
| 1236 | |
| 1237 | MDRV_MACHINE_START(newbrain) |
| 1238 | MDRV_MACHINE_RESET(newbrain) |
| 1239 | |
| 1240 | // video hardware |
| 1241 | |
| 1242 | MDRV_IMPORT_FROM(newbrain_video) |
| 873 | 1243 | MACHINE_DRIVER_END |
| 874 | 1244 | |
| 875 | | static MACHINE_DRIVER_START( newbramd ) |
| 876 | | MDRV_IMPORT_FROM(newbrain) |
| 1245 | static MACHINE_DRIVER_START( newbraia ) |
| 1246 | MDRV_DRIVER_DATA(newbrain_state) |
| 1247 | |
| 1248 | // basic system hardware |
| 1249 | |
| 1250 | MDRV_CPU_ADD("main", Z80, XTAL_16MHz/8) |
| 1251 | MDRV_CPU_PROGRAM_MAP(newbrain_map, 0) |
| 1252 | MDRV_CPU_IO_MAP(newbrain_a_io_map, 0) |
| 1253 | MDRV_CPU_VBLANK_INT("main", newbrain_interrupt) |
| 1254 | |
| 1255 | MDRV_CPU_ADD("cop", COP420, XTAL_16MHz/8) // COP420-GUW/M |
| 1256 | MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0) |
| 1257 | MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0) |
| 1258 | MDRV_CPU_CONFIG(newbrain_cop_intf) |
| 1259 | |
| 1260 | MDRV_MACHINE_START(newbrain) |
| 1261 | MDRV_MACHINE_RESET(newbrain) |
| 1262 | |
| 1263 | // video hardware |
| 1264 | |
| 1265 | MDRV_IMPORT_FROM(newbrain_video) |
| 877 | 1266 | MACHINE_DRIVER_END |
| 878 | 1267 | |
| 1268 | static MACHINE_DRIVER_START( newbraiv ) |
| 1269 | MDRV_DRIVER_DATA(newbrain_state) |
| 1270 | |
| 1271 | // basic system hardware |
| 1272 | |
| 1273 | MDRV_CPU_ADD("main", Z80, XTAL_16MHz/8) |
| 1274 | MDRV_CPU_PROGRAM_MAP(newbrain_map, 0) |
| 1275 | MDRV_CPU_IO_MAP(newbrain_v_io_map, 0) |
| 1276 | MDRV_CPU_VBLANK_INT("main", newbrain_interrupt) |
| 1277 | |
| 1278 | MDRV_CPU_ADD("cop", COP420, XTAL_16MHz/8) // COP420-GUW/M |
| 1279 | MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0) |
| 1280 | MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0) |
| 1281 | MDRV_CPU_CONFIG(newbrain_cop_intf) |
| 1282 | |
| 1283 | MDRV_MACHINE_START(newbrain) |
| 1284 | MDRV_MACHINE_RESET(newbrain) |
| 1285 | |
| 1286 | // video hardware |
| 1287 | |
| 1288 | MDRV_IMPORT_FROM(newbrain_video) |
| 1289 | MACHINE_DRIVER_END |
| 1290 | |
| 879 | 1291 | /* ROMs */ |
| 880 | 1292 | |
| 881 | 1293 | ROM_START( newbrain ) |
| 882 | 1294 | ROM_REGION( 0x10000, "main", 0 ) |
| 883 | | ROM_SYSTEM_BIOS( 0, "default", "ROM 2.0" ) |
| 1295 | ROM_LOAD( "d413-2.rom", 0x8000, 0x2000, CRC(097591f1) SHA1(c2aa1d27d4f3a24ab0c8135df746a4a44201a7f4) ) |
| 1296 | ROM_LOAD( "cdmd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a) ) |
| 1297 | ROM_LOAD( "efmd.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6) ) |
| 1298 | |
| 1299 | ROM_REGION( 0x400, "cop", 0 ) |
| 1300 | ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP ) |
| 1301 | |
| 1302 | ROM_REGION( 0x10000, "eim", 0 ) // Expansion Interface Module |
| 1303 | ROM_LOAD( "e415-2.rom", 0x4000, 0x2000, CRC(5b0e390c) SHA1(0f99cae57af2e64f3f6b02e5325138d6ba015e72) ) |
| 1304 | ROM_LOAD( "e415-3.rom", 0x4000, 0x2000, CRC(2f88bae5) SHA1(04e03f230f4b368027442a7c2084dae877f53713) ) |
| 1305 | ROM_LOAD( "e416-3.rom", 0x6000, 0x2000, CRC(8b5099d8) SHA1(19b0cfce4c8b220eb1648b467f94113bafcb14e0) ) // 10/8/83.mtv |
| 1306 | ROM_LOAD( "e417-2.rom", 0x8000, 0x2000, CRC(6a7afa20) SHA1(f90db4f8318777313a862b3d5bab83c2fd260010) ) |
| 1307 | |
| 1308 | ROM_REGION( 0x10000, "fdc", 0 ) // Floppy Disk Controller |
| 1309 | ROM_LOAD( "d417-1.rom", 0x0000, 0x2000, CRC(40fad31c) SHA1(5137be4cc026972c0ffd4fa6990e8583bdfce163) ) |
| 1310 | ROM_LOAD( "d417-2.rom", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) ) |
| 1311 | |
| 1312 | ROM_REGION( 0x1000, "chargen", 0 ) |
| 1313 | ROM_LOAD( "8248r7.453", 0x0000, 0x1000, NO_DUMP ) |
| 1314 | ROM_END |
| 1315 | |
| 1316 | ROM_START( newbraim ) |
| 1317 | ROM_REGION( 0x10000, "main", 0 ) |
| 1318 | ROM_LOAD( "cdmd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a) ) |
| 1319 | ROM_LOAD( "efmd.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6) ) |
| 1320 | |
| 1321 | ROM_REGION( 0x400, "cop", 0 ) |
| 1322 | ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP ) |
| 1323 | |
| 1324 | ROM_REGION( 0x1000, "chargen", 0 ) |
| 1325 | ROM_LOAD( "8248r7.453", 0x0000, 0x1000, NO_DUMP ) |
| 1326 | ROM_END |
| 1327 | |
| 1328 | ROM_START( newbraia ) |
| 1329 | ROM_SYSTEM_BIOS( 0, "rom20", "ROM 2.0" ) |
| 884 | 1330 | ROMX_LOAD( "aben20.rom", 0xa000, 0x2000, CRC(3d76d0c8) SHA1(753b4530a518ad832e4b81c4e5430355ba3f62e0), ROM_BIOS(1) ) |
| 885 | 1331 | ROMX_LOAD( "cd20tci.rom", 0xc000, 0x4000, CRC(f65b2350) SHA1(1ada7fbf207809537ec1ffb69808524300622ada), ROM_BIOS(1) ) |
| 1332 | |
| 886 | 1333 | ROM_SYSTEM_BIOS( 1, "rom191", "ROM 1.91" ) |
| 887 | 1334 | ROMX_LOAD( "aben191.rom", 0xa000, 0x2000, CRC(b7be8d89) SHA1(cce8d0ae7aa40245907ea38b7956c62d039d45b7), ROM_BIOS(2) ) |
| 888 | 1335 | ROMX_LOAD( "cd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a), ROM_BIOS(2) ) |
| 889 | 1336 | ROMX_LOAD( "ef1x.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6), ROM_BIOS(2) ) |
| 1337 | |
| 890 | 1338 | ROM_SYSTEM_BIOS( 2, "rom19", "ROM 1.9" ) |
| 891 | 1339 | ROMX_LOAD( "aben19.rom", 0xa000, 0x2000, CRC(d0283eb1) SHA1(351d248e69a77fa552c2584049006911fb381ff0), ROM_BIOS(3) ) |
| 892 | 1340 | ROMX_LOAD( "cd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a), ROM_BIOS(3) ) |
| 893 | 1341 | ROMX_LOAD( "ef1x.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6), ROM_BIOS(3) ) |
| 1342 | |
| 894 | 1343 | ROM_SYSTEM_BIOS( 3, "rom14", "ROM 1.4" ) |
| 895 | 1344 | ROMX_LOAD( "aben14.rom", 0xa000, 0x2000, CRC(d0283eb1) SHA1(351d248e69a77fa552c2584049006911fb381ff0), ROM_BIOS(4) ) |
| 896 | 1345 | ROMX_LOAD( "cd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a), ROM_BIOS(4) ) |
| r3024 | r3025 | |
| 899 | 1348 | ROM_REGION( 0x400, "cop", 0 ) |
| 900 | 1349 | ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP ) |
| 901 | 1350 | |
| 902 | | ROM_REGION( 0x10000, "fdc", 0 ) |
| 903 | | ROM_LOAD( "d417-2.417", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) ) |
| 904 | | |
| 905 | | ROM_REGION( 0x1000, "gfx1", 0 ) |
| 1351 | ROM_REGION( 0x1000, "chargen", 0 ) |
| 906 | 1352 | ROM_LOAD( "8248r7.453", 0x0000, 0x1000, NO_DUMP ) |
| 907 | 1353 | ROM_END |
| 908 | 1354 | |
| 909 | | #define rom_newbraid rom_newbrain |
| 1355 | #define rom_newbraiv rom_newbraia |
| 910 | 1356 | |
| 911 | | ROM_START( newbramd ) |
| 912 | | ROM_REGION( 0x10000, "main", 0 ) |
| 913 | | ROM_LOAD( "cdmd.rom", 0xc000, 0x2000, CRC(6b4d9429) SHA1(ef688be4e75aced61f487c928258c8932a0ae00a) ) |
| 914 | | ROM_LOAD( "efmd.rom", 0xe000, 0x2000, CRC(20dd0b49) SHA1(74b517ca223cefb588e9f49e72ff2d4f1627efc6) ) |
| 915 | | |
| 916 | | ROM_REGION( 0x400, "cop", 0 ) |
| 917 | | ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP ) |
| 918 | | |
| 919 | | ROM_REGION( 0x10000, "fdc", 0 ) // TODO: remove this |
| 920 | | ROM_LOAD( "d417-2.417", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) ) |
| 921 | | |
| 922 | | ROM_REGION( 0x1000, "gfx1", 0 ) |
| 923 | | ROM_LOAD( "8248r7.453", 0x0000, 0x1000, NO_DUMP ) |
| 924 | | ROM_END |
| 925 | | |
| 926 | 1357 | /* System Configuration */ |
| 927 | 1358 | |
| 928 | 1359 | static void newbrain_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| r3024 | r3025 | |
| 1014 | 1445 | CONFIG_DEVICE(newbrain_serial_getinfo) |
| 1015 | 1446 | SYSTEM_CONFIG_END |
| 1016 | 1447 | |
| 1448 | static SYSTEM_CONFIG_START( newbraim ) |
| 1449 | CONFIG_RAM_DEFAULT (32 * 1024) |
| 1450 | CONFIG_DEVICE(newbrain_cassette_getinfo) |
| 1451 | CONFIG_DEVICE(newbrain_serial_getinfo) |
| 1452 | SYSTEM_CONFIG_END |
| 1453 | |
| 1454 | static SYSTEM_CONFIG_START( newbraia ) |
| 1455 | CONFIG_RAM_DEFAULT (32 * 1024) |
| 1456 | CONFIG_DEVICE(newbrain_cassette_getinfo) |
| 1457 | CONFIG_DEVICE(newbrain_serial_getinfo) |
| 1458 | SYSTEM_CONFIG_END |
| 1459 | |
| 1460 | static SYSTEM_CONFIG_START( newbraiv ) |
| 1461 | CONFIG_RAM_DEFAULT (32 * 1024) |
| 1462 | CONFIG_DEVICE(newbrain_serial_getinfo) |
| 1463 | SYSTEM_CONFIG_END |
| 1464 | |
| 1017 | 1465 | /* System Drivers */ |
| 1018 | 1466 | |
| 1019 | 1467 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS |
| 1020 | | COMP( 1981, newbrain, 0, 0, newbrain, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain A", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1021 | | COMP( 1981, newbraid, newbrain, 0, newbraid, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain AD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1022 | | COMP( 1981, newbramd, newbrain, 0, newbramd, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain MD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1468 | COMP( 1981, newbrain, 0, 0, newbrain, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain MD with Expansion Interface", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1469 | COMP( 1981, newbraim, 0, 0, newbraim, newbrain, 0, newbraim, "Grundy Business Systems Ltd.", "NewBrain MD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1470 | COMP( 1981, newbraia, newbrain, 0, newbraia, newbrain, 0, newbraia, "Grundy Business Systems Ltd.", "NewBrain AD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1471 | COMP( 1981, newbraiv, newbrain, 0, newbraiv, newbrain, 0, newbraiv, "Grundy Business Systems Ltd.", "NewBrain VD", GAME_NOT_WORKING | GAME_NO_SOUND ) |