src/mess/drivers/exidy.c
| r1995 | r1996 | |
| 79 | 79 | |
| 80 | 80 | The driver "exidyd" emulates the most common form, a cassette-based system with 48k of ram. |
| 81 | 81 | |
| 82 | | - Robert |
| 83 | 82 | |
| 84 | 83 | ********************************************************************************/ |
| 85 | 84 | #include "driver.h" |
| r1995 | r1996 | |
| 90 | 89 | #include "machine/wd17xx.h" |
| 91 | 90 | #include "devices/basicdsk.h" |
| 92 | 91 | #include "devices/cassette.h" |
| 92 | #include "devices/snapquik.h" |
| 93 | 93 | #include "devices/cartslot.h" |
| 94 | 94 | #include "devices/printer.h" |
| 95 | 95 | #include "devices/z80bin.h" |
| r1995 | r1996 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | | //static unsigned char exidy_fc; |
| 113 | | //static unsigned char exidy_fd; |
| 114 | 112 | static unsigned char exidy_fe; |
| 115 | | //static unsigned char exidy_ff; |
| 116 | | |
| 117 | | //static int exidy_parallel_control; |
| 118 | 113 | static int exidy_keyboard_line; |
| 119 | 114 | static unsigned long exidy_hd6402_state; |
| 120 | 115 | |
| r1995 | r1996 | |
| 253 | 248 | cassette_serial_connection.input_state = state; |
| 254 | 249 | } |
| 255 | 250 | |
| 256 | | static MACHINE_START( exidy ) |
| 251 | static MACHINE_START( exidyd ) |
| 257 | 252 | { |
| 258 | 253 | serial_timer = timer_alloc(exidy_serial_timer_callback, NULL); |
| 259 | 254 | cassette_timer = timer_alloc(exidy_cassette_timer_callback, NULL); |
| 260 | | |
| 261 | | wd17xx_init(machine, WD_TYPE_179X, NULL, NULL); |
| 262 | 255 | } |
| 263 | 256 | |
| 264 | | static MACHINE_RESET( exidy ) |
| 257 | static MACHINE_START( exidy ) |
| 265 | 258 | { |
| 266 | | hd6402_init(); |
| 267 | | hd6402_set_callback(exidy_hd6402_callback); |
| 268 | | hd6402_reset(); |
| 269 | | |
| 270 | | centronics_config(0, exidy_cent_config); |
| 271 | | /* assumption: select is tied low */ |
| 272 | | centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET); |
| 273 | | |
| 274 | | serial_connection_init(&cassette_serial_connection); |
| 275 | | serial_connection_set_in_callback(&cassette_serial_connection, cassette_serial_in); |
| 276 | | |
| 277 | | exidy_fe_port_w(machine, 0, 0); |
| 278 | | |
| 279 | | timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback); |
| 280 | | |
| 281 | | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); |
| 282 | | |
| 283 | | /* this is temporary. Normally when a Z80 is reset, it will |
| 284 | | execute address 0. The exidy starts executing from 0x0e000 */ |
| 285 | | // memory_set_opbase_handler(0, exidy_opbaseoverride); |
| 286 | | |
| 287 | | // cpunum_write_byte(0,0,0x0c3); |
| 288 | | // cpunum_write_byte(0,1,0x000); |
| 289 | | // cpunum_write_byte(0,2,0x0e0); |
| 290 | | |
| 259 | MACHINE_START_CALL( exidyd ); |
| 260 | wd17xx_init(machine, WD_TYPE_179X, NULL, NULL); |
| 291 | 261 | } |
| 292 | 262 | |
| 293 | 263 | static MACHINE_RESET( exidyd ) |
| r1995 | r1996 | |
| 306 | 276 | exidy_fe_port_w(machine, 0, 0); |
| 307 | 277 | |
| 308 | 278 | timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback); |
| 279 | } |
| 309 | 280 | |
| 281 | static MACHINE_RESET( exidy ) |
| 282 | { |
| 283 | MACHINE_RESET_CALL( exidyd ); |
| 310 | 284 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); |
| 311 | 285 | } |
| 312 | 286 | |
| 287 | |
| 313 | 288 | static READ8_HANDLER ( exidy_wd179x_r ) |
| 314 | 289 | { |
| 315 | 290 | switch (offset & 0x03) |
| r1995 | r1996 | |
| 323 | 298 | case 3: |
| 324 | 299 | return wd17xx_data_r(machine, offset); |
| 325 | 300 | default: |
| 326 | | break; |
| 301 | return 0xff; |
| 327 | 302 | } |
| 328 | | |
| 329 | | return 0x0ff; |
| 330 | 303 | } |
| 331 | 304 | |
| 332 | 305 | static WRITE8_HANDLER ( exidy_wd179x_w ) |
| r1995 | r1996 | |
| 386 | 359 | logerror("exidy fd w: %04x %02x\n",offset,data); |
| 387 | 360 | |
| 388 | 361 | /* bit 0,1: char length select */ |
| 389 | | if (data & (1<<0)) |
| 390 | | { |
| 362 | if (data & 1) |
| 391 | 363 | hd6402_set_input(HD6402_INPUT_CLS1, HD6402_INPUT_CLS1); |
| 392 | | } |
| 393 | 364 | else |
| 394 | | { |
| 395 | 365 | hd6402_set_input(HD6402_INPUT_CLS1, 0); |
| 396 | | } |
| 397 | 366 | |
| 398 | | if (data & (1<<1)) |
| 399 | | { |
| 367 | if (data & 2) |
| 400 | 368 | hd6402_set_input(HD6402_INPUT_CLS2, HD6402_INPUT_CLS2); |
| 401 | | } |
| 402 | 369 | else |
| 403 | | { |
| 404 | 370 | hd6402_set_input(HD6402_INPUT_CLS2, 0); |
| 405 | | } |
| 406 | 371 | |
| 407 | 372 | /* bit 2: stop bit count */ |
| 408 | | if (data & (1<<2)) |
| 409 | | { |
| 373 | if (data & 4) |
| 410 | 374 | hd6402_set_input(HD6402_INPUT_SBS, HD6402_INPUT_SBS); |
| 411 | | } |
| 412 | 375 | else |
| 413 | | { |
| 414 | 376 | hd6402_set_input(HD6402_INPUT_SBS, 0); |
| 415 | | } |
| 416 | 377 | |
| 417 | 378 | /* bit 3: parity type select */ |
| 418 | | if (data & (1<<3)) |
| 419 | | { |
| 379 | if (data & 8) |
| 420 | 380 | hd6402_set_input(HD6402_INPUT_EPE, HD6402_INPUT_EPE); |
| 421 | | } |
| 422 | 381 | else |
| 423 | | { |
| 424 | 382 | hd6402_set_input(HD6402_INPUT_EPE, 0); |
| 425 | | } |
| 426 | 383 | |
| 427 | 384 | /* bit 4: inhibit parity (no parity) */ |
| 428 | | if (data & (1<<4)) |
| 429 | | { |
| 385 | if (data & 16) |
| 430 | 386 | hd6402_set_input(HD6402_INPUT_PI, HD6402_INPUT_PI); |
| 431 | | } |
| 432 | 387 | else |
| 433 | | { |
| 434 | 388 | hd6402_set_input(HD6402_INPUT_PI, 0); |
| 435 | | } |
| 436 | 389 | } |
| 437 | 390 | |
| 438 | 391 | #define EXIDY_CASSETTE_MOTOR_MASK ((1<<4)|(1<<5)) |
| r1995 | r1996 | |
| 468 | 421 | } |
| 469 | 422 | else |
| 470 | 423 | { |
| 471 | | /* if both motors were off previously, at least one motor |
| 472 | | has been switched on */ |
| 424 | /* if both motors were off previously, at least one motor has been switched on */ |
| 473 | 425 | if ((exidy_fe & EXIDY_CASSETTE_MOTOR_MASK)==0) |
| 474 | 426 | { |
| 475 | 427 | cassette_clock_counter = 0; |
| r1995 | r1996 | |
| 484 | 436 | if (data & 0x080) |
| 485 | 437 | { |
| 486 | 438 | /* connect to serial device (not yet emulated) */ |
| 487 | | /* Notes by Robert |
| 488 | | Due to bugs in the hardware and software of a real Sorcerer, the serial |
| 489 | | interface misbehaves. |
| 490 | | 1. Sorcerer I had a hardware problem causing rs232 idle to be a space (+9v) |
| 491 | | instead of mark (-9v). Fixed in Sorcerer II. |
| 492 | | 2. When you select a different baud for rs232, it was "remembered" but not |
| 493 | | sent to port fe. It only gets sent when motor on was requested. Motor on is |
| 494 | | only meaningful in a cassette operation. |
| 495 | | 3. The monitor software always resets the device to cassette whenever the |
| 496 | | keyboard is scanned, motors altered, or an error occurred. |
| 497 | | 4. The above problems make rs232 communication impractical unless you write |
| 498 | | your own routines or create a corrected monitor rom. */ |
| 439 | /* Due to bugs in the hardware and software of a real Sorcerer, the serial |
| 440 | interface misbehaves. |
| 441 | 1. Sorcerer I had a hardware problem causing rs232 idle to be a space (+9v) |
| 442 | instead of mark (-9v). Fixed in Sorcerer II. |
| 443 | 2. When you select a different baud for rs232, it was "remembered" but not |
| 444 | sent to port fe. It only gets sent when motor on was requested. Motor on is |
| 445 | only meaningful in a cassette operation. |
| 446 | 3. The monitor software always resets the device to cassette whenever the |
| 447 | keyboard is scanned, motors altered, or an error occurred. |
| 448 | 4. The above problems make rs232 communication impractical unless you write |
| 449 | your own routines or create a corrected monitor rom. */ |
| 499 | 450 | } |
| 500 | 451 | else |
| 501 | 452 | { |
| r1995 | r1996 | |
| 521 | 472 | |
| 522 | 473 | static WRITE8_HANDLER(exidy_ff_port_w) |
| 523 | 474 | { |
| 524 | | logerror("exidy ff w: %04x %02x\n",offset,data); |
| 525 | | /* reading the dipswitch */ |
| 526 | | switch ((readinputport(0)>>1) & 0x01) |
| 475 | /* reading the config switch */ |
| 476 | switch ((readinputportbytag("CONFIG")>>1) & 0x01) |
| 527 | 477 | { |
| 528 | 478 | case 0: /* speaker */ |
| 529 | | { |
| 530 | | int level; |
| 479 | speaker_level_w(0, (data) ? 1 : 0); |
| 480 | break; |
| 531 | 481 | |
| 532 | | level = 0; /* speaker muted */ |
| 533 | | if (data) |
| 534 | | { |
| 535 | | level = 0x0ff; /* speaker on */ |
| 536 | | } |
| 537 | | |
| 538 | | speaker_level_w(0, level); |
| 539 | | } |
| 540 | | break; |
| 541 | | |
| 542 | 482 | case 1: /* printer */ |
| 543 | | { |
| 544 | 483 | /* bit 7 = strobe, bit 6..0 = data */ |
| 545 | 484 | centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET); |
| 546 | 485 | centronics_write_handshake(0, (data>>7) & 0x01, CENTRONICS_STROBE); |
| 547 | | centronics_write_data(0,data & 0x07f); |
| 548 | | |
| 549 | | } |
| 550 | | break; |
| 486 | centronics_write_data(0, data & 0x7f); |
| 487 | break; |
| 551 | 488 | } |
| 552 | | |
| 553 | 489 | } |
| 554 | 490 | |
| 555 | 491 | static READ8_HANDLER(exidy_fc_port_r) |
| 556 | 492 | { |
| 557 | | int data; |
| 493 | UINT8 data; |
| 558 | 494 | |
| 559 | 495 | hd6402_set_input(HD6402_INPUT_DRR, HD6402_INPUT_DRR); |
| 560 | 496 | data = hd6402_data_r(machine, offset); |
| r1995 | r1996 | |
| 566 | 502 | |
| 567 | 503 | static READ8_HANDLER(exidy_fd_port_r) |
| 568 | 504 | { |
| 569 | | int data; |
| 570 | 505 | /* set unused bits high */ |
| 571 | | data = 0xe0; |
| 506 | UINT8 data = 0xe0; |
| 572 | 507 | |
| 573 | 508 | /* bit 4: parity error */ |
| 574 | | if (exidy_hd6402_state & HD6402_OUTPUT_PE) |
| 575 | | { |
| 576 | | data |= (1<<4); |
| 577 | | } |
| 509 | if (exidy_hd6402_state & HD6402_OUTPUT_PE) data |= (1<<4); |
| 578 | 510 | |
| 579 | 511 | /* bit 3: framing error */ |
| 580 | | if (exidy_hd6402_state & HD6402_OUTPUT_FE) |
| 581 | | { |
| 582 | | data |= (1<<3); |
| 583 | | } |
| 512 | if (exidy_hd6402_state & HD6402_OUTPUT_FE) data |= (1<<3); |
| 584 | 513 | |
| 585 | 514 | /* bit 2: over-run error */ |
| 586 | | if (exidy_hd6402_state & HD6402_OUTPUT_OE) |
| 587 | | { |
| 588 | | data |= (1<<2); |
| 589 | | } |
| 515 | if (exidy_hd6402_state & HD6402_OUTPUT_OE) data |= (1<<2); |
| 590 | 516 | |
| 591 | 517 | /* bit 1: data receive ready - data ready in receive reg */ |
| 592 | | if (exidy_hd6402_state & HD6402_OUTPUT_DR) |
| 593 | | { |
| 594 | | data |= (1<<1); |
| 595 | | } |
| 518 | if (exidy_hd6402_state & HD6402_OUTPUT_DR) data |= (1<<1); |
| 596 | 519 | |
| 597 | 520 | /* bit 0: transmitter buffer receive empty */ |
| 598 | 521 | /* if this BIT is forced high, then the cassette save routine does not hang */ |
| 599 | | if (exidy_hd6402_state & HD6402_OUTPUT_TBRE) |
| 600 | | { |
| 601 | | data |= (1<<0); |
| 602 | | } |
| 522 | if (exidy_hd6402_state & HD6402_OUTPUT_TBRE) data |= (1<<0); |
| 603 | 523 | |
| 604 | | |
| 605 | 524 | logerror("exidy fd r: %04x %02x\n",offset,data); |
| 606 | 525 | |
| 607 | 526 | return data; |
| r1995 | r1996 | |
| 614 | 533 | - not emulated |
| 615 | 534 | - tied high, allowing PARIN and PAROUT bios routines to run */ |
| 616 | 535 | |
| 617 | | unsigned int data=0xc0; |
| 536 | UINT8 data=0xc0; |
| 618 | 537 | |
| 619 | 538 | /* bit 5 - vsync (inverted) */ |
| 620 | | data |= (((~readinputport(0)) & 0x01)<<5); |
| 539 | data |= (((~readinputportbytag("VS")) & 0x01)<<5); |
| 621 | 540 | |
| 622 | 541 | /* bits 4..0 - keyboard data */ |
| 623 | 542 | data |= (readinputport(exidy_keyboard_line+1) & 0x01f); |
| 624 | 543 | |
| 625 | | logerror("exidy fe r: %04x %02x\n",offset,data); |
| 626 | | |
| 627 | 544 | return data; |
| 628 | 545 | } |
| 629 | 546 | |
| 630 | 547 | static READ8_HANDLER(exidy_ff_port_r) |
| 631 | 548 | { |
| 632 | | /* Notes added by Robert |
| 633 | | The use of the parallel port as a general purpose port is not emulated. |
| 634 | | Currently the only use is to read the printer status in the Centronics CENDRV bios routine. |
| 635 | | This uses bit 7. The other bits have been set high (=nothing plugged in). |
| 636 | | This fixes those games that use a joystick. */ |
| 549 | /* The use of the parallel port as a general purpose port is not emulated. |
| 550 | Currently the only use is to read the printer status in the Centronics CENDRV bios routine. |
| 551 | This uses bit 7. The other bits have been set high (=nothing plugged in). |
| 552 | This fixes those games that use a joystick. */ |
| 637 | 553 | |
| 638 | 554 | UINT8 data=0x7f; |
| 639 | 555 | |
| 640 | 556 | /* bit 7 = printer busy |
| 641 | | 0 = printer is not busy */ |
| 557 | 0 = printer is not busy */ |
| 642 | 558 | |
| 643 | 559 | if (printer_status(image_from_devtype_and_index(IO_PRINTER, 0), 0)==0 ) |
| 644 | 560 | data |= 0x080; |
| 645 | 561 | |
| 646 | | logerror("exidy ff r: %04x %02x\n",offset,data); |
| 647 | | |
| 648 | 562 | return data; |
| 649 | 563 | } |
| 650 | 564 | |
| r1995 | r1996 | |
| 659 | 573 | ADDRESS_MAP_END |
| 660 | 574 | |
| 661 | 575 | static INPUT_PORTS_START(exidy) |
| 662 | | PORT_START |
| 576 | PORT_START_TAG("VS") |
| 663 | 577 | /* vblank */ |
| 664 | 578 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK) |
| 665 | | /* hardware connected to printer port */ |
| 666 | | PORT_DIPNAME( 0x02, 0x02, "Parallel port" ) |
| 667 | | PORT_DIPSETTING( 0x00, "Speaker" ) |
| 668 | | PORT_DIPSETTING( 0x02, "Printer" ) |
| 579 | |
| 669 | 580 | /* line 0 */ |
| 670 | 581 | PORT_START |
| 671 | 582 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| r1995 | r1996 | |
| 780 | 691 | PORT_BIT (0x04, 0x04, IPT_UNUSED) |
| 781 | 692 | PORT_BIT (0x02, 0x02, IPT_UNUSED) |
| 782 | 693 | PORT_BIT (0x01, 0x01, IPT_UNUSED) |
| 694 | |
| 695 | /* Enhanced options not available on real hardware */ |
| 696 | PORT_START_TAG("CONFIG") |
| 697 | PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload") |
| 698 | PORT_CONFSETTING( 0x00, DEF_STR(No)) |
| 699 | PORT_CONFSETTING( 0x01, DEF_STR(Yes)) |
| 700 | /* hardware connected to printer port */ |
| 701 | PORT_CONFNAME( 0x02, 0x00, "Parallel port" ) |
| 702 | PORT_CONFSETTING( 0x00, "Speaker" ) |
| 703 | PORT_CONFSETTING( 0x02, "Printer" ) |
| 704 | // PORT_CONFNAME( 0x08, 0x08, "Cassette Speaker") |
| 705 | // PORT_CONFSETTING( 0x08, DEF_STR(On)) |
| 706 | // PORT_CONFSETTING( 0x00, DEF_STR(Off)) |
| 783 | 707 | INPUT_PORTS_END |
| 784 | 708 | |
| 785 | 709 | /**********************************************************************************************************/ |
| r1995 | r1996 | |
| 789 | 713 | MDRV_CPU_ADD_TAG("main", Z80, 12638000/6) |
| 790 | 714 | MDRV_CPU_PROGRAM_MAP(exidy_mem, 0) |
| 791 | 715 | MDRV_CPU_IO_MAP(exidy_io, 0) |
| 792 | | MDRV_SCREEN_ADD("main", RASTER) |
| 793 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 794 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(200)) |
| 795 | | MDRV_INTERLEAVE(1) |
| 796 | 716 | |
| 797 | 717 | MDRV_MACHINE_START( exidy ) |
| 798 | 718 | MDRV_MACHINE_RESET( exidy ) |
| 799 | 719 | |
| 800 | | /* video hardware */ |
| 720 | /* video hardware */ |
| 721 | MDRV_SCREEN_ADD("main", RASTER) |
| 722 | MDRV_SCREEN_REFRESH_RATE(50) |
| 723 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(200)) |
| 801 | 724 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 802 | 725 | MDRV_SCREEN_SIZE(EXIDY_SCREEN_WIDTH, EXIDY_SCREEN_HEIGHT) |
| 803 | 726 | MDRV_SCREEN_VISIBLE_AREA(0, EXIDY_SCREEN_WIDTH-1, 0, EXIDY_SCREEN_HEIGHT-1) |
| r1995 | r1996 | |
| 818 | 741 | MDRV_CPU_MODIFY("main") |
| 819 | 742 | MDRV_CPU_PROGRAM_MAP(exidyd_mem, 0) |
| 820 | 743 | |
| 744 | MDRV_MACHINE_START( exidyd ) |
| 821 | 745 | MDRV_MACHINE_RESET( exidyd ) |
| 822 | 746 | MACHINE_DRIVER_END |
| 823 | 747 | |
| r1995 | r1996 | |
| 828 | 752 | ***************************************************************************/ |
| 829 | 753 | |
| 830 | 754 | ROM_START(exidy) |
| 831 | | /* these are common to all because they are inside the machine */ |
| 832 | | ROM_REGION(64*1024+32, REGION_CPU1,0) |
| 755 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 756 | ROM_LOAD("exmo1-1.dat", 0xe000, 0x0800, CRC(ac924f67) SHA1(72fcad6dd1ed5ec0527f967604401284d0e4b6a1) ) /* monitor roms */ |
| 757 | ROM_LOAD("exmo1-2.dat", 0xe800, 0x0800, CRC(ead1d0f6) SHA1(c68bed7344091bca135e427b4793cc7d49ca01be) ) |
| 758 | ROM_LOAD("exchr-1.dat", 0xf800, 0x0400, CRC(4a7e1cdd) SHA1(2bf07a59c506b6e0c01ec721fb7b747b20f5dced) ) /* char rom */ |
| 759 | ROM_LOAD_OPTIONAL("diskboot.dat",0xbc00, 0x0100, BAD_DUMP CRC(d82a40d6) SHA1(cd1ef5fb0312cd1640e0853d2442d7d858bc3e3b)) |
| 760 | ROM_CART_LOAD(0, "rom", 0xc000, 0x2000, ROM_NOMIRROR | ROM_OPTIONAL) |
| 833 | 761 | |
| 834 | | ROM_LOAD_OPTIONAL("diskboot.dat",0x0bc00, 0x0100, BAD_DUMP CRC(d82a40d6) SHA1(cd1ef5fb0312cd1640e0853d2442d7d858bc3e3b)) |
| 762 | ROM_REGION( 0x0020, REGION_PROMS, 0 ) |
| 763 | ROM_LOAD_OPTIONAL("bruce.dat", 0x0000, 0x0020, CRC(fae922cb) SHA1(470a86844cfeab0d9282242e03ff1d8a1b2238d1)) /* video prom */ |
| 764 | ROM_END |
| 835 | 765 | |
| 836 | | /* char rom */ |
| 837 | | ROM_LOAD("exchr-1.dat",0x0f800, 1024, CRC(4a7e1cdd) SHA1(2bf07a59c506b6e0c01ec721fb7b747b20f5dced)) |
| 766 | ROM_START(exidyd) |
| 767 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 768 | ROM_LOAD("exmo1-1.dat", 0xe000, 0x0800, CRC(ac924f67) SHA1(72fcad6dd1ed5ec0527f967604401284d0e4b6a1) ) /* monitor roms */ |
| 769 | ROM_LOAD("exmo1-2.dat", 0xe800, 0x0800, CRC(ead1d0f6) SHA1(c68bed7344091bca135e427b4793cc7d49ca01be) ) |
| 770 | ROM_LOAD("exchr-1.dat", 0xf800, 0x0400, CRC(4a7e1cdd) SHA1(2bf07a59c506b6e0c01ec721fb7b747b20f5dced) ) /* char rom */ |
| 771 | ROM_CART_LOAD(0, "rom", 0xc000, 0x2000, ROM_NOMIRROR | ROM_OPTIONAL) |
| 838 | 772 | |
| 839 | | /* video prom */ |
| 840 | | ROM_LOAD("bruce.dat", 0x010000, 32, CRC(fae922cb) SHA1(470a86844cfeab0d9282242e03ff1d8a1b2238d1)) |
| 773 | ROM_REGION( 0x0020, REGION_PROMS, 0 ) |
| 774 | ROM_LOAD_OPTIONAL("bruce.dat", 0x0000, 0x0020, CRC(fae922cb) SHA1(470a86844cfeab0d9282242e03ff1d8a1b2238d1)) /* video prom */ |
| 775 | ROM_END |
| 841 | 776 | |
| 842 | | ROM_LOAD("exmo1-1.dat", 0x0e000, 0x0800, CRC(ac924f67) SHA1(72fcad6dd1ed5ec0527f967604401284d0e4b6a1)) |
| 843 | | ROM_LOAD("exmo1-2.dat", 0x0e800, 0x0800, CRC(ead1d0f6) SHA1(c68bed7344091bca135e427b4793cc7d49ca01be)) |
| 777 | static QUICKLOAD_LOAD( exidy ) |
| 778 | { |
| 779 | UINT8 sw = readinputportbytag("CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 780 | UINT16 exec_addr, start_addr, end_addr; |
| 844 | 781 | |
| 845 | | ROM_CART_LOAD(0, "rom", 0xc000, 0x2000, ROM_NOMIRROR | ROM_OPTIONAL) |
| 782 | if (z80bin_load_file( machine, image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 783 | return INIT_FAIL; /* load file */ |
| 846 | 784 | |
| 847 | | // ROM_LOAD_OPTIONAL("exsb1-1.dat", 0x0c000, 0x0800, CRC(1dd20d80) SHA1(dd34364ca1a35caa7255b18e6c953f6df664cc74)) |
| 848 | | // ROM_LOAD_OPTIONAL("exsb1-2.dat", 0x0c800, 0x0800, CRC(1068a3f8) SHA1(6395f2c9829d537d68b75a750acbf27145f1bbad)) |
| 849 | | // ROM_LOAD_OPTIONAL("exsb1-3.dat", 0x0d000, 0x0800, CRC(e6332518) SHA1(fe27fccc82f86b90453c4fae55371f3a050dd6dc)) |
| 850 | | // ROM_LOAD_OPTIONAL("exsb1-4.dat", 0x0d800, 0x0800, CRC(a370cb19) SHA1(75fffd897aec8c3dbe1a918f5a29485e603004cb)) |
| 851 | | ROM_END |
| 785 | /* Since Exidy Basic is by Microsoft, it needs some preprocessing before it can be run. |
| 786 | 1. A start address of 01D5 indicates a basic program which needs its pointers fixed up. |
| 787 | 2. An exec address of C858 indicates a basic program. |
| 788 | This address is unsuitable, so the routine at F020 is used instead. |
| 789 | 3. If the start address is 1D5 and the exec address is NOT C858, |
| 790 | the pointers still need fixing, but then jump to the exec address. |
| 791 | 4. If autorun is turned off, the pointers still need fixing, but then display READY. |
| 792 | Important addresses: |
| 793 | 01D5 = start (load) address of a conventional basic program |
| 794 | C858 = an autorun basic program will have this exec address on the tape |
| 795 | C3DD = part of basic that displays READY and lets user enter input |
| 796 | F020 = custom routine to fix basic pointers |
| 797 | F030 = exec address to jump to after fixing the pointers */ |
| 852 | 798 | |
| 853 | | ROM_START(exidyd) |
| 854 | | /* these are common to all because they are inside the machine */ |
| 855 | | ROM_REGION(64*1024+32, REGION_CPU1,0) |
| 799 | if ((start_addr == 0x1d5) || (exec_addr == 0xc858)) |
| 800 | { |
| 801 | UINT8 i, sec[18]={ |
| 802 | 0x2a, 2, 0xf0, // LD HL,(F002) ;get saved end_addr+1 |
| 803 | 0x22, 0xb7, 1, // LD (01B7),HL ;move it to correct place |
| 804 | 0xcd, 0x26, 0xc4, // CALL C426 ;set up other pointers |
| 805 | 0x21, 0xd4, 1, // LD HL,01D4 ;dummy-start address |
| 806 | 0x36, 0, // LD (HL),00 ;make sure it is end-of-line |
| 807 | 0, // NOP ;line up jump address to an even byte |
| 808 | 0xc3, 0x89, 0xc6,}; // JP C689 ;run program - f030 = adjustable jump |
| 856 | 809 | |
| 857 | | /* char rom */ |
| 858 | | ROM_LOAD("exchr-1.dat",0x0f800, 1024, CRC(4a7e1cdd) SHA1(2bf07a59c506b6e0c01ec721fb7b747b20f5dced)) |
| 810 | for (i = 0; i < 18; i++) program_write_byte(0xf020 + i, sec[i]); |
| 859 | 811 | |
| 860 | | /* video prom */ |
| 861 | | ROM_LOAD("bruce.dat", 0x010000, 32, CRC(fae922cb) SHA1(470a86844cfeab0d9282242e03ff1d8a1b2238d1)) |
| 812 | if (!sw) program_write_word_16le(0xf030,0xc3dd); |
| 862 | 813 | |
| 863 | | /* Monitor roms */ |
| 864 | | ROM_LOAD("exmo1-1.dat", 0x0e000, 0x0800, CRC(ac924f67) SHA1(72fcad6dd1ed5ec0527f967604401284d0e4b6a1)) |
| 865 | | ROM_LOAD("exmo1-2.dat", 0x0e800, 0x0800, CRC(ead1d0f6) SHA1(c68bed7344091bca135e427b4793cc7d49ca01be)) |
| 814 | if (start_addr == 0x1d5) |
| 815 | { |
| 816 | program_write_word_16le(0xf002,end_addr+1); |
| 817 | if ((exec_addr != 0xc858) && (sw == 1)) program_write_word_16le(0xf030,exec_addr); |
| 818 | exec_addr=0xf020; |
| 819 | } |
| 820 | else |
| 821 | exec_addr=0xf02f; // skip fixing pointers, just jump into bios |
| 822 | |
| 823 | sw = 1; |
| 866 | 824 | |
| 867 | | /* cart */ |
| 868 | | ROM_CART_LOAD(0, "rom", 0xc000, 0x2000, ROM_NOMIRROR | ROM_OPTIONAL) |
| 869 | | ROM_END |
| 825 | if (program_read_byte(0xdffa) != 0xc3) exec_addr=0xffff; // can't run if cart not in |
| 826 | } |
| 870 | 827 | |
| 828 | if ((exec_addr != 0xffff) && (sw)) cpunum_set_reg(0, REG_PC, exec_addr); |
| 829 | |
| 830 | return INIT_PASS; |
| 831 | } |
| 832 | |
| 833 | static void exidy_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 834 | { |
| 835 | /* quickload */ |
| 836 | switch(state) |
| 837 | { |
| 838 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 839 | case MESS_DEVINFO_STR_DEV_FILE: strcpy(info->s = device_temp_str(), __FILE__); break; |
| 840 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "bin"); break; |
| 841 | |
| 842 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 843 | case MESS_DEVINFO_PTR_QUICKLOAD_LOAD: info->f = (genf *) quickload_load_exidy; break; |
| 844 | |
| 845 | default: quickload_device_getinfo(devclass, state, info); break; |
| 846 | } |
| 847 | } |
| 848 | |
| 871 | 849 | static void exidy_printer_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 872 | 850 | { |
| 873 | 851 | /* printer */ |
| r1995 | r1996 | |
| 915 | 893 | CONFIG_DEVICE(exidy_floppy_getinfo) |
| 916 | 894 | CONFIG_DEVICE(cartslot_device_getinfo) |
| 917 | 895 | CONFIG_DEVICE(exidy_cassette_getinfo) // use of cassette causes a hang |
| 918 | | CONFIG_DEVICE(z80bin_quickload_getinfo) |
| 896 | CONFIG_DEVICE(exidy_quickload_getinfo) |
| 919 | 897 | SYSTEM_CONFIG_END |
| 920 | 898 | |
| 899 | SYSTEM_CONFIG_START(exidyd) |
| 900 | CONFIG_DEVICE(exidy_printer_getinfo) |
| 901 | CONFIG_DEVICE(cartslot_device_getinfo) |
| 902 | CONFIG_DEVICE(exidy_cassette_getinfo) // use of cassette causes a hang |
| 903 | CONFIG_DEVICE(exidy_quickload_getinfo) |
| 904 | SYSTEM_CONFIG_END |
| 921 | 905 | |
| 922 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 923 | | COMP(1979, exidy, 0, 0, exidy, exidy, 0, exidy, "Exidy Inc", "Sorcerer", GAME_NOT_WORKING ) |
| 924 | | COMP(1979, exidyd, exidy, 0, exidyd, exidy, 0, exidy, "Exidy Inc", "Sorcerer (diskless)", GAME_NOT_WORKING ) |
| 925 | 906 | |
| 907 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 908 | COMP(1979, exidy, 0, 0, exidy, exidy, 0, exidy, "Exidy Inc", "Sorcerer", 0 ) |
| 909 | COMP(1979, exidyd, exidy, 0, exidyd, exidy, 0, exidyd, "Exidy Inc", "Sorcerer (Cassette only)", 0 ) |
| 910 | |