src/mess/machine/serial.c
| r6724 | r6725 | |
| 36 | 36 | #define VERBOSE 0 |
| 37 | 37 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 38 | 38 | |
| 39 | | /* number of serial streams supported. This is also the number |
| 40 | | of serial ports supported */ |
| 41 | | #define MAX_SERIAL_DEVICES 4 |
| 42 | | |
| 43 | | |
| 44 | 39 | /* a read/write bit stream. used to transmit data and to receive data */ |
| 45 | 40 | struct data_stream |
| 46 | 41 | { |
| r6724 | r6725 | |
| 55 | 50 | unsigned long ByteCount; |
| 56 | 51 | }; |
| 57 | 52 | |
| 58 | | |
| 59 | | /* a serial device */ |
| 60 | | struct serial_device |
| 53 | typedef struct _serial_t serial_t; |
| 54 | struct _serial_t |
| 61 | 55 | { |
| 62 | 56 | /* transmit data bit-stream */ |
| 63 | 57 | struct data_stream transmit; |
| r6724 | r6725 | |
| 84 | 78 | void *timer; |
| 85 | 79 | }; |
| 86 | 80 | |
| 81 | INLINE serial_t *get_safe_token(const device_config *device) |
| 82 | { |
| 83 | assert(device != NULL); |
| 84 | assert(device->token != NULL); |
| 85 | |
| 86 | return (serial_t *)device->token; |
| 87 | } |
| 87 | 88 | |
| 89 | |
| 88 | 90 | /* the serial streams */ |
| 89 | | static struct serial_device serial_devices[MAX_SERIAL_DEVICES]; |
| 90 | 91 | static TIMER_CALLBACK(serial_device_baud_rate_callback); |
| 91 | 92 | |
| 92 | 93 | |
| r6724 | r6725 | |
| 127 | 128 | |
| 128 | 129 | static void serial_device_in_callback(running_machine *machine, int id, unsigned long status) |
| 129 | 130 | { |
| 130 | | serial_devices[id].connection.input_state = status; |
| 131 | /* serial_t *ser = get_safe_token(device); |
| 132 | |
| 133 | ser->connection.input_state = status;*/ |
| 131 | 134 | } |
| 132 | 135 | |
| 133 | 136 | /***** SERIAL DEVICE ******/ |
| 134 | | void serial_device_setup(const device_config *image, int baud_rate, int num_data_bits, int stop_bit_count, int parity_code) |
| 137 | void serial_device_setup(const device_config *device, int baud_rate, int num_data_bits, int stop_bit_count, int parity_code) |
| 135 | 138 | { |
| 136 | | int id = image_index_in_device(image); |
| 139 | serial_t *ser = get_safe_token(device); |
| 137 | 140 | |
| 138 | | /* check id is valid */ |
| 139 | | if ((id<0) || (id>=MAX_SERIAL_DEVICES)) |
| 140 | | return; |
| 141 | ser->BaudRate = baud_rate; |
| 142 | ser->data_form.word_length = num_data_bits; |
| 143 | ser->data_form.stop_bit_count = stop_bit_count; |
| 144 | ser->data_form.parity = parity_code; |
| 145 | ser->timer = timer_alloc(device->machine, serial_device_baud_rate_callback, (void *)device); |
| 141 | 146 | |
| 142 | | serial_devices[id].BaudRate = baud_rate; |
| 143 | | serial_devices[id].data_form.word_length = num_data_bits; |
| 144 | | serial_devices[id].data_form.stop_bit_count = stop_bit_count; |
| 145 | | serial_devices[id].data_form.parity = parity_code; |
| 146 | | serial_devices[id].timer = timer_alloc(image->machine, serial_device_baud_rate_callback, NULL); |
| 147 | serial_connection_init(device->machine,&ser->connection); |
| 148 | serial_connection_set_in_callback(device->machine,&ser->connection, serial_device_in_callback); |
| 147 | 149 | |
| 148 | | serial_connection_init(image->machine, &serial_devices[id].connection); |
| 149 | | serial_connection_set_in_callback(image->machine, &serial_devices[id].connection, serial_device_in_callback); |
| 150 | | |
| 151 | 150 | /* signal to other end it is clear to send! */ |
| 152 | 151 | /* data is initially high state */ |
| 153 | 152 | /* set /rts */ |
| 154 | | serial_devices[id].connection.State |= SERIAL_STATE_RTS; |
| 153 | ser->connection.State |= SERIAL_STATE_RTS; |
| 155 | 154 | /* signal to other end data is ready to be accepted */ |
| 156 | 155 | /* set /dtr */ |
| 157 | | serial_devices[id].connection.State |= SERIAL_STATE_DTR; |
| 158 | | set_out_data_bit(serial_devices[id].connection.State, 1); |
| 159 | | serial_connection_out(image->machine,&serial_devices[id].connection); |
| 160 | | transmit_register_reset(&serial_devices[id].transmit_reg); |
| 161 | | receive_register_reset(&serial_devices[id].receive_reg); |
| 162 | | receive_register_setup(&serial_devices[id].receive_reg, &serial_devices[id].data_form); |
| 156 | ser->connection.State |= SERIAL_STATE_DTR; |
| 157 | set_out_data_bit(ser->connection.State, 1); |
| 158 | serial_connection_out(device->machine,&ser->connection); |
| 159 | transmit_register_reset(&ser->transmit_reg); |
| 160 | receive_register_reset(&ser->receive_reg); |
| 161 | receive_register_setup(&ser->receive_reg, &ser->data_form); |
| 163 | 162 | } |
| 164 | 163 | |
| 165 | 164 | |
| 166 | | unsigned long serial_device_get_state(int id) |
| 165 | unsigned long serial_device_get_state(const device_config *device) |
| 167 | 166 | { |
| 168 | | if ((id<0) || (id>=MAX_SERIAL_DEVICES)) |
| 169 | | return 0; |
| 170 | | return serial_devices[id].connection.State; |
| 167 | serial_t *ser = get_safe_token(device); |
| 168 | |
| 169 | return ser->connection.State; |
| 171 | 170 | } |
| 172 | 171 | |
| 173 | | void serial_device_set_transmit_state(const device_config *image, int state) |
| 172 | void serial_device_set_transmit_state(const device_config *device, int state) |
| 174 | 173 | { |
| 175 | 174 | int previous_state; |
| 176 | | int id = image_index_in_device(image); |
| 175 | serial_t *ser = get_safe_token(device); |
| 177 | 176 | |
| 178 | | if ((id<0) || (id>=MAX_SERIAL_DEVICES)) |
| 179 | | return; |
| 177 | previous_state = ser->transmit_state; |
| 180 | 178 | |
| 181 | | previous_state = serial_devices[id].transmit_state; |
| 179 | ser->transmit_state = state; |
| 182 | 180 | |
| 183 | | serial_devices[id].transmit_state = state; |
| 184 | | |
| 185 | 181 | if ((state^previous_state)!=0) |
| 186 | 182 | { |
| 187 | 183 | if (state) |
| 188 | 184 | { |
| 189 | 185 | /* start timer */ |
| 190 | | timer_adjust_periodic(serial_devices[id].timer, attotime_zero, id, ATTOTIME_IN_HZ(serial_devices[id].BaudRate)); |
| 186 | timer_adjust_periodic(ser->timer, attotime_zero, 0, ATTOTIME_IN_HZ(ser->BaudRate)); |
| 191 | 187 | } |
| 192 | 188 | else |
| 193 | 189 | { |
| 194 | 190 | /* remove timer */ |
| 195 | | timer_reset(serial_devices[id].timer, attotime_never); |
| 191 | timer_reset(ser->timer, attotime_never); |
| 196 | 192 | } |
| 197 | 193 | } |
| 198 | 194 | |
| r6724 | r6725 | |
| 475 | 471 | serial_connection_out(machine, connection); |
| 476 | 472 | } |
| 477 | 473 | |
| 478 | | static void serial_protocol_none_sent_char(int id) |
| 474 | static void serial_protocol_none_sent_char(const device_config *device) |
| 479 | 475 | { |
| 480 | 476 | int i; |
| 481 | 477 | int bit; |
| 482 | 478 | unsigned char data_byte; |
| 483 | | |
| 479 | serial_t *ser = get_safe_token(device); |
| 480 | |
| 484 | 481 | /* generate byte to transmit */ |
| 485 | 482 | data_byte = 0; |
| 486 | | for (i=0; i<serial_devices[id].data_form.word_length; i++) |
| 483 | for (i=0; i<ser->data_form.word_length; i++) |
| 487 | 484 | { |
| 488 | 485 | data_byte = data_byte<<1; |
| 489 | | bit = data_stream_get_data_bit_from_data_byte(&serial_devices[id].transmit); |
| 486 | bit = data_stream_get_data_bit_from_data_byte(&ser->transmit); |
| 490 | 487 | data_byte = data_byte|bit; |
| 491 | 488 | } |
| 492 | 489 | /* setup register */ |
| 493 | | transmit_register_setup(&serial_devices[id].transmit_reg,&serial_devices[id].data_form, data_byte); |
| 490 | transmit_register_setup(&ser->transmit_reg,&ser->data_form, data_byte); |
| 494 | 491 | |
| 495 | 492 | logerror("serial device transmitted char: %02x\n",data_byte); |
| 496 | 493 | } |
| 497 | 494 | |
| 498 | 495 | static TIMER_CALLBACK(serial_device_baud_rate_callback) |
| 499 | 496 | { |
| 500 | | int id = param; |
| 497 | serial_t *ser = get_safe_token(ptr); |
| 501 | 498 | |
| 502 | 499 | /* receive data into receive register */ |
| 503 | | receive_register_update_bit(&serial_devices[id].receive_reg, get_in_data_bit(serial_devices[id].connection.input_state)); |
| 500 | receive_register_update_bit(&ser->receive_reg, get_in_data_bit(ser->connection.input_state)); |
| 504 | 501 | |
| 505 | | if (serial_devices[id].receive_reg.flags & RECEIVE_REGISTER_FULL) |
| 502 | if (ser->receive_reg.flags & RECEIVE_REGISTER_FULL) |
| 506 | 503 | { |
| 507 | 504 | //logerror("SERIAL DEVICE\n"); |
| 508 | | receive_register_extract(&serial_devices[id].receive_reg, &serial_devices[id].data_form); |
| 505 | receive_register_extract(&ser->receive_reg, &ser->data_form); |
| 509 | 506 | |
| 510 | | logerror("serial device receive char: %02x\n",serial_devices[id].receive_reg.byte_received); |
| 507 | logerror("serial device receive char: %02x\n",ser->receive_reg.byte_received); |
| 511 | 508 | } |
| 512 | 509 | |
| 513 | 510 | /* is transmit empty? */ |
| 514 | | if (serial_devices[id].transmit_reg.flags & TRANSMIT_REGISTER_EMPTY) |
| 511 | if (ser->transmit_reg.flags & TRANSMIT_REGISTER_EMPTY) |
| 515 | 512 | { |
| 516 | 513 | /* char has been sent, execute callback */ |
| 517 | | serial_protocol_none_sent_char(id); |
| 514 | serial_protocol_none_sent_char(ptr); |
| 518 | 515 | } |
| 519 | 516 | |
| 520 | 517 | /* other side says it is clear to send? */ |
| 521 | | if (serial_devices[id].connection.input_state & SERIAL_STATE_CTS) |
| 518 | if (ser->connection.input_state & SERIAL_STATE_CTS) |
| 522 | 519 | { |
| 523 | 520 | /* send bit */ |
| 524 | | transmit_register_send_bit(machine, &serial_devices[id].transmit_reg, &serial_devices[id].connection); |
| 521 | transmit_register_send_bit(machine, &ser->transmit_reg, &ser->connection); |
| 525 | 522 | } |
| 526 | 523 | } |
| 527 | 524 | |
| 528 | 525 | /* connect the specified connection to this serial device */ |
| 529 | | void serial_device_connect(const device_config *image, struct serial_connection *connection) |
| 526 | void serial_device_connect(const device_config *device, struct serial_connection *connection) |
| 530 | 527 | { |
| 531 | | int id = image_index_in_device(image); |
| 532 | | |
| 533 | | /* check id is valid */ |
| 534 | | if ((id<0) || (id>=MAX_SERIAL_DEVICES)) |
| 535 | | return; |
| 536 | | |
| 537 | | serial_connection_link(image->machine, connection, &serial_devices[id].connection); |
| 528 | serial_t *ser = get_safe_token(device); |
| 529 | serial_connection_link(device->machine, connection, &ser->connection); |
| 538 | 530 | } |
| 539 | 531 | |
| 540 | 532 | |
| r6724 | r6725 | |
| 597 | 589 | data_stream_reset(stream); |
| 598 | 590 | } |
| 599 | 591 | |
| 600 | | DEVICE_START(serial_device) |
| 592 | DEVICE_START(serial) |
| 601 | 593 | { |
| 602 | | int id = image_index_in_device(device); |
| 603 | | memset(&serial_devices[id], 0, sizeof(serial_devices[id])); |
| 594 | //serial_t *ser = get_safe_token(device); |
| 604 | 595 | } |
| 605 | 596 | |
| 606 | | DEVICE_IMAGE_LOAD(serial_device) |
| 597 | DEVICE_RESET(serial) |
| 607 | 598 | { |
| 608 | | int id = image_index_in_device(image); |
| 599 | // serial_t *ser = get_safe_token(device); |
| 600 | } |
| 601 | |
| 602 | DEVICE_IMAGE_LOAD(serial) |
| 603 | { |
| 609 | 604 | int data_length; |
| 610 | 605 | unsigned char *data; |
| 611 | 606 | |
| 612 | | /* check id is valid */ |
| 613 | | if ((id<0) || (id>=MAX_SERIAL_DEVICES)) |
| 614 | | return INIT_FAIL; |
| 607 | serial_t *ser = get_safe_token(image); |
| 615 | 608 | |
| 616 | 609 | /* load file and setup transmit data */ |
| 617 | 610 | if (serial_device_load_internal(image, &data, &data_length)) |
| 618 | 611 | { |
| 619 | | data_stream_init(&serial_devices[id].transmit, data, data_length); |
| 612 | data_stream_init(&ser->transmit, data, data_length); |
| 620 | 613 | return INIT_PASS; |
| 621 | 614 | } |
| 622 | 615 | |
| r6724 | r6725 | |
| 624 | 617 | } |
| 625 | 618 | |
| 626 | 619 | |
| 627 | | DEVICE_IMAGE_UNLOAD(serial_device) |
| 620 | DEVICE_IMAGE_UNLOAD(serial) |
| 628 | 621 | { |
| 629 | | int id = image_index_in_device(image); |
| 622 | serial_t *ser = get_safe_token(image); |
| 630 | 623 | |
| 631 | 624 | /* stop transmit */ |
| 632 | 625 | serial_device_set_transmit_state(image, 0); |
| 633 | 626 | /* free streams */ |
| 634 | | data_stream_free(&serial_devices[id].transmit); |
| 635 | | data_stream_free(&serial_devices[id].receive); |
| 627 | data_stream_free(&ser->transmit); |
| 628 | data_stream_free(&ser->receive); |
| 636 | 629 | } |
| 637 | 630 | |
| 631 | |
| 632 | DEVICE_GET_INFO( serial ) |
| 633 | { |
| 634 | switch ( state ) |
| 635 | { |
| 636 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 637 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(serial_t); break; |
| 638 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 639 | case DEVINFO_INT_IMAGE_TYPE: info->i = IO_SERIAL; break; |
| 640 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 641 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 1; break; |
| 642 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 1; break; |
| 643 | |
| 644 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( serial ); break; |
| 645 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( serial ); break; |
| 646 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( serial ); break; |
| 647 | case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(serial ); break; |
| 648 | case DEVINFO_STR_NAME: strcpy( info->s, "Serial port"); break; |
| 649 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Serial port"); break; |
| 650 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, ""); break; |
| 651 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 652 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 653 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; |
| 654 | } |
| 655 | } |
| 656 | |
| 638 | 657 | /*******************************************************************************/ |
| 639 | 658 | /*******************************************************************************/ |
| 640 | 659 | /********* SERIAL CONNECTION ***********/ |
| r6724 | r6725 | |
| 676 | 695 | } |
| 677 | 696 | |
| 678 | 697 | /* set callback which will be executed when in status has changed */ |
| 679 | | void serial_connection_set_in_callback(running_machine *machine, struct serial_connection *connection, void (*in_cb)(running_machine *machine, int id, unsigned long state)) |
| 698 | void serial_connection_set_in_callback(running_machine *machine, struct serial_connection *connection, void (*in_cb)(running_machine *machine, int id, unsigned long status)) |
| 680 | 699 | { |
| 681 | 700 | connection->in_callback = in_cb; |
| 682 | 701 | } |
| r6724 | r6725 | |
| 707 | 726 | serial_connection_out(machine,connection_a); |
| 708 | 727 | /* let a know the state of b */ |
| 709 | 728 | serial_connection_out(machine,connection_b); |
| 710 | | } |
| 729 | } |
src/mess/machine/thomson.c
| r6724 | r6725 | |
| 382 | 382 | |
| 383 | 383 | static struct serial_connection to7_io_line; |
| 384 | 384 | |
| 385 | static DEVICE_START( thom_serial_cc90323 ) |
| 386 | { |
| 387 | DEVICE_START_CALL(serial); |
| 388 | LOG(( "thom_serial_init: init CD 90-320 RS232 device\n" )); |
| 389 | serial_device_connect( device, &to7_io_line ); |
| 390 | serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); |
| 391 | serial_device_set_transmit_state( device, 1 ); |
| 392 | } |
| 385 | 393 | |
| 386 | | |
| 387 | | DEVICE_START( thom_serial ) |
| 394 | static DEVICE_START( thom_serial_rf57232 ) |
| 388 | 395 | { |
| 389 | 396 | const device_config *acia = devtag_get_device(device->machine, "acia"); |
| 390 | | int idx = image_index_in_device(device); |
| 391 | | |
| 392 | | DEVICE_START_CALL(serial_device); |
| 393 | | |
| 394 | | switch ( idx ) { |
| 395 | | |
| 396 | | case THOM_SERIAL_CC90323: |
| 397 | | LOG(( "thom_serial_init: init CD 90-320 RS232 device\n" )); |
| 398 | | serial_device_connect( device, &to7_io_line ); |
| 399 | | break; |
| 400 | | |
| 401 | | case THOM_SERIAL_RF57232: |
| 402 | | LOG(( "thom_serial_init: init RF 57-232 RS232 device\n" )); |
| 403 | | acia_6551_connect_to_serial_device( acia, device ); |
| 404 | | break; |
| 405 | | |
| 406 | | case THOM_SERIAL_MODEM: |
| 407 | | LOG(( "thom_serial_init: init MODEM (MD 90-120) device\n" )); |
| 408 | | break; |
| 409 | | |
| 410 | | default: |
| 411 | | fatalerror( "thom_serial_init: unknown serial device index %i\n", idx ); |
| 412 | | break; |
| 413 | | } |
| 414 | | |
| 415 | | serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); /* default */ |
| 397 | DEVICE_START_CALL(serial); |
| 398 | LOG(( "thom_serial_init: init RF 57-232 RS232 device\n" )); |
| 399 | acia_6551_connect_to_serial_device( acia, device ); |
| 400 | serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); |
| 416 | 401 | serial_device_set_transmit_state( device, 1 ); |
| 417 | 402 | } |
| 418 | 403 | |
| 419 | | |
| 420 | | |
| 421 | | DEVICE_IMAGE_UNLOAD( thom_serial ) |
| 404 | static DEVICE_START( thom_serial_modem ) |
| 422 | 405 | { |
| 423 | | device_unload_serial_device( image ); |
| 406 | DEVICE_START_CALL(serial); |
| 407 | LOG(( "thom_serial_init: init MODEM (MD 90-120) device\n" )); |
| 408 | serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); |
| 409 | serial_device_set_transmit_state( device, 1 ); |
| 424 | 410 | } |
| 425 | 411 | |
| 426 | | |
| 427 | | |
| 428 | | DEVICE_IMAGE_LOAD( thom_serial ) |
| 412 | static DEVICE_IMAGE_LOAD( thom_serial ) |
| 429 | 413 | { |
| 430 | | int idx = image_index_in_device( image ); |
| 431 | | |
| 432 | | if ( device_load_serial_device( image ) != INIT_PASS ) |
| 414 | if ( device_load_serial( image ) != INIT_PASS ) |
| 433 | 415 | { |
| 434 | | logerror( "thom_serial_load: could not load serial image in device %i\n", idx ); |
| 416 | logerror( "thom_serial_load: could not load serial image in device\n"); |
| 435 | 417 | return INIT_FAIL; |
| 436 | 418 | } |
| 437 | 419 | |
| 438 | 420 | return INIT_PASS; |
| 439 | 421 | } |
| 440 | 422 | |
| 423 | DEVICE_GET_INFO( thom_serial_cc90323 ) |
| 424 | { |
| 425 | switch ( state ) |
| 426 | { |
| 427 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( thom_serial_cc90323 ); break; |
| 428 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( thom_serial );break; |
| 429 | case DEVINFO_STR_NAME: strcpy(info->s, "CD 90-320 RS232"); break; |
| 430 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 431 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 432 | } |
| 433 | } |
| 441 | 434 | |
| 435 | DEVICE_GET_INFO( thom_serial_rf57232 ) |
| 436 | { |
| 437 | switch ( state ) |
| 438 | { |
| 439 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( thom_serial_rf57232 ); break; |
| 440 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( thom_serial );break; |
| 441 | case DEVINFO_STR_NAME: strcpy(info->s, "RF 57-232 RS232"); break; |
| 442 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 443 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 444 | } |
| 445 | } |
| 442 | 446 | |
| 447 | |
| 448 | DEVICE_GET_INFO( thom_serial_modem ) |
| 449 | { |
| 450 | switch ( state ) |
| 451 | { |
| 452 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( thom_serial_modem ); break; |
| 453 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( thom_serial );break; |
| 454 | case DEVINFO_STR_NAME: strcpy(info->s, "MODEM (MD 90-120)"); break; |
| 455 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 456 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 457 | } |
| 458 | } |
| 459 | |
| 443 | 460 | /* ------------ 6850 defines ------------ */ |
| 444 | 461 | |
| 445 | 462 | #define ACIA_6850_RDRF 0x01 /* Receive data register full */ |
| r6724 | r6725 | |
| 751 | 768 | static to7_io_dev to7_io_mode( running_machine *machine ) |
| 752 | 769 | { |
| 753 | 770 | const device_config *centronics = devtag_get_device(machine, "centronics"); |
| 771 | const device_config *serial = devtag_get_device(machine, "cc90232"); |
| 754 | 772 | |
| 755 | 773 | if (centronics_pe_r(centronics) == TRUE) |
| 756 | 774 | return TO7_IO_CENTRONICS; |
| 757 | | else if ( image_exists( image_from_devtype_and_index( machine, IO_SERIAL, THOM_SERIAL_CC90323 ) ) ) |
| 775 | else if ( image_exists( serial )) |
| 758 | 776 | return TO7_IO_RS232; |
| 759 | 777 | return TO7_IO_NONE; |
| 760 | 778 | } |
src/mess/drivers/thomson.c
| r6724 | r6725 | |
| 75 | 75 | #include "devices/flopdrv.h" |
| 76 | 76 | #include "formats/basicdsk.h" |
| 77 | 77 | #include "devices/messram.h" |
| 78 | #include "machine/serial.h" |
| 78 | 79 | |
| 80 | |
| 79 | 81 | /**************************** common *******************************/ |
| 80 | 82 | |
| 81 | 83 | /* layout */ |
| r6724 | r6725 | |
| 196 | 198 | |
| 197 | 199 | INPUT_PORTS_END |
| 198 | 200 | |
| 199 | | |
| 200 | 201 | /* ------------ serial ------------ */ |
| 201 | 202 | |
| 202 | | static const char *const thom_serial_names[3][3]= |
| 203 | | { |
| 204 | | { "cc90232", "c232", "RS232 (older, CC 90-232)" }, |
| 205 | | { "rf57932", "r232", "RS232 (newer, RF 57-932)" }, |
| 206 | | { "modem", "modm", "Modem" } |
| 207 | | }; |
| 203 | #define THOM_SERIAL_CC90323 DEVICE_GET_INFO_NAME(thom_serial_cc90323) |
| 208 | 204 | |
| 209 | | static void thom_serial_getinfo ( const mess_device_class *devclass, UINT32 state, union devinfo *info ) |
| 210 | | { |
| 211 | | switch ( state ) { |
| 212 | | case MESS_DEVINFO_INT_COUNT: |
| 213 | | info->i = 3; |
| 214 | | break; |
| 215 | | case MESS_DEVINFO_INT_TYPE: |
| 216 | | info->i = IO_SERIAL; |
| 217 | | break; |
| 218 | | case MESS_DEVINFO_INT_READABLE: |
| 219 | | info->i = 1; |
| 220 | | break; |
| 221 | | case MESS_DEVINFO_INT_WRITEABLE: |
| 222 | | info->i = 1; |
| 223 | | break; |
| 224 | | case MESS_DEVINFO_INT_CREATABLE: |
| 225 | | info->i = 1; |
| 226 | | break; |
| 205 | #define MDRV_THOM_SERIAL_CC90323_ADD(_tag) \ |
| 206 | MDRV_DEVICE_ADD(_tag, THOM_SERIAL_CC90323, 0) |
| 207 | |
| 208 | #define THOM_SERIAL_RF57232 DEVICE_GET_INFO_NAME(thom_serial_rf57232) |
| 227 | 209 | |
| 228 | | case MESS_DEVINFO_PTR_START: |
| 229 | | info->start = DEVICE_START_NAME(thom_serial); |
| 230 | | break; |
| 231 | | case MESS_DEVINFO_PTR_LOAD: |
| 232 | | info->load = DEVICE_IMAGE_LOAD_NAME(thom_serial); |
| 233 | | break; |
| 234 | | case MESS_DEVINFO_PTR_UNLOAD: |
| 235 | | info->unload = DEVICE_IMAGE_UNLOAD_NAME(thom_serial); |
| 236 | | break; |
| 210 | #define MDRV_THOM_SERIAL_RF57232_ADD(_tag) \ |
| 211 | MDRV_DEVICE_ADD(_tag, THOM_SERIAL_RF57232, 0) |
| 212 | |
| 213 | #define THOM_SERIAL_MODEM DEVICE_GET_INFO_NAME(thom_serial_modem) |
| 237 | 214 | |
| 238 | | case MESS_DEVINFO_STR_NAME+0: |
| 239 | | case MESS_DEVINFO_STR_NAME+1: |
| 240 | | case MESS_DEVINFO_STR_NAME+2: |
| 241 | | strcpy( info->s = device_temp_str(), |
| 242 | | thom_serial_names[ state - MESS_DEVINFO_STR_NAME ][ 0 ] ); |
| 243 | | break; |
| 244 | | case MESS_DEVINFO_STR_SHORT_NAME+0: |
| 245 | | case MESS_DEVINFO_STR_SHORT_NAME+1: |
| 246 | | case MESS_DEVINFO_STR_SHORT_NAME+2: |
| 247 | | strcpy( info->s = device_temp_str(), |
| 248 | | thom_serial_names[ state - MESS_DEVINFO_STR_SHORT_NAME ][ 1 ] ); |
| 249 | | break; |
| 250 | | case MESS_DEVINFO_STR_DESCRIPTION+0: |
| 251 | | case MESS_DEVINFO_STR_DESCRIPTION+1: |
| 252 | | case MESS_DEVINFO_STR_DESCRIPTION+2: |
| 253 | | strcpy( info->s = device_temp_str(), |
| 254 | | thom_serial_names[ state - MESS_DEVINFO_STR_DESCRIPTION ][ 2 ] ); |
| 255 | | break; |
| 256 | | |
| 257 | | case MESS_DEVINFO_STR_DEV_FILE: |
| 258 | | strcpy( info->s = device_temp_str(), "serial" ); |
| 259 | | break; |
| 260 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: |
| 261 | | strcpy( info->s = device_temp_str(), "txt" ); |
| 262 | | break; |
| 263 | | |
| 264 | | } |
| 265 | | } |
| 266 | | |
| 267 | | |
| 268 | | |
| 215 | #define MDRV_THOM_SERIAL_MODEM_ADD(_tag) \ |
| 216 | MDRV_DEVICE_ADD(_tag, THOM_SERIAL_MODEM, 0) |
| 217 | |
| 269 | 218 | /************************** T9000 / TO7 ******************************* |
| 270 | 219 | |
| 271 | 220 | TO7 (1982) |
| r6724 | r6725 | |
| 646 | 595 | }; |
| 647 | 596 | |
| 648 | 597 | /* ------------ config ------------ */ |
| 649 | | |
| 598 | /* |
| 650 | 599 | static SYSTEM_CONFIG_START ( to ) |
| 651 | 600 | CONFIG_DEVICE ( thom_serial_getinfo ) |
| 652 | 601 | SYSTEM_CONFIG_END |
| 602 | */ |
| 653 | 603 | |
| 654 | | |
| 655 | 604 | /* ------------ driver ------------ */ |
| 656 | 605 | |
| 657 | 606 | static MACHINE_DRIVER_START ( to7 ) |
| r6724 | r6725 | |
| 728 | 677 | MDRV_RAM_ADD("messram") |
| 729 | 678 | MDRV_RAM_DEFAULT_SIZE("40K") |
| 730 | 679 | MDRV_RAM_EXTRA_OPTIONS("24K,48K") |
| 680 | |
| 681 | MDRV_THOM_SERIAL_CC90323_ADD("cc90232") |
| 682 | MDRV_THOM_SERIAL_RF57232_ADD("rf57932") |
| 683 | MDRV_THOM_SERIAL_MODEM_ADD("modem") |
| 731 | 684 | MACHINE_DRIVER_END |
| 732 | 685 | |
| 733 | 686 | static MACHINE_DRIVER_START ( t9000 ) |
| r6724 | r6725 | |
| 735 | 688 | MACHINE_DRIVER_END |
| 736 | 689 | |
| 737 | 690 | |
| 738 | | COMP ( 1982, to7, 0, 0, to7, to7, 0, to, "Thomson", "TO7", 0 ) |
| 691 | COMP ( 1982, to7, 0, 0, to7, to7, 0, 0, "Thomson", "TO7", 0 ) |
| 739 | 692 | |
| 740 | | COMP ( 1980, t9000, to7, 0, t9000, t9000, 0, to, "Thomson", "T9000", 0 ) |
| 693 | COMP ( 1980, t9000, to7, 0, t9000, t9000, 0, 0, "Thomson", "T9000", 0 ) |
| 741 | 694 | |
| 742 | 695 | |
| 743 | 696 | /***************************** TO7/70 ********************************* |
| r6724 | r6725 | |
| 917 | 870 | MDRV_IMPORT_FROM ( to770 ) |
| 918 | 871 | MACHINE_DRIVER_END |
| 919 | 872 | |
| 920 | | COMP ( 1984, to770, 0, 0, to770, to770, 0, to, "Thomson", "TO7/70", 0 ) |
| 873 | COMP ( 1984, to770, 0, 0, to770, to770, 0, 0, "Thomson", "TO7/70", 0 ) |
| 921 | 874 | |
| 922 | | COMP ( 1984, to770a, to770, 0, to770a, to770a, 0, to, "Thomson", "TO7/70 arabic", 0 ) |
| 875 | COMP ( 1984, to770a, to770, 0, to770a, to770a, 0, 0, "Thomson", "TO7/70 arabic", 0 ) |
| 923 | 876 | |
| 924 | 877 | |
| 925 | 878 | /************************* MO5 / MO5E ********************************* |
| r6724 | r6725 | |
| 1105 | 1058 | MACHINE_DRIVER_END |
| 1106 | 1059 | |
| 1107 | 1060 | |
| 1108 | | COMP ( 1984, mo5, 0, 0, mo5, mo5, 0, to, "Thomson", "MO5", 0 ) |
| 1061 | COMP ( 1984, mo5, 0, 0, mo5, mo5, 0, 0, "Thomson", "MO5", 0 ) |
| 1109 | 1062 | |
| 1110 | | COMP ( 1986, mo5e, mo5, 0, mo5e, mo5e, 0, to, "Thomson", "MO5E", 0 ) |
| 1063 | COMP ( 1986, mo5e, mo5, 0, mo5e, mo5e, 0, 0, "Thomson", "MO5E", 0 ) |
| 1111 | 1064 | |
| 1112 | 1065 | |
| 1113 | 1066 | /********************************* TO9 ******************************* |
| r6724 | r6725 | |
| 1441 | 1394 | MACHINE_DRIVER_END |
| 1442 | 1395 | |
| 1443 | 1396 | |
| 1444 | | COMP ( 1985, to9, 0, 0, to9, to9, 0, to, "Thomson", "TO9", GAME_IMPERFECT_COLORS ) |
| 1397 | COMP ( 1985, to9, 0, 0, to9, to9, 0, 0, "Thomson", "TO9", GAME_IMPERFECT_COLORS ) |
| 1445 | 1398 | |
| 1446 | 1399 | |
| 1447 | 1400 | /******************************** TO8 ******************************** |
| r6724 | r6725 | |
| 1664 | 1617 | MACHINE_DRIVER_END |
| 1665 | 1618 | |
| 1666 | 1619 | |
| 1667 | | COMP ( 1986, to8, 0, 0, to8, to8, 0, to, "Thomson", "TO8", 0 ) |
| 1620 | COMP ( 1986, to8, 0, 0, to8, to8, 0, 0, "Thomson", "TO8", 0 ) |
| 1668 | 1621 | |
| 1669 | | COMP ( 1987, to8d, to8, 0, to8d, to8d, 0, to, "Thomson", "TO8D", 0 ) |
| 1622 | COMP ( 1987, to8d, to8, 0, to8d, to8d, 0, 0, "Thomson", "TO8D", 0 ) |
| 1670 | 1623 | |
| 1671 | 1624 | |
| 1672 | 1625 | /******************************** TO9+ ******************************* |
| r6724 | r6725 | |
| 1809 | 1762 | MDRV_RAM_DEFAULT_SIZE("512K") |
| 1810 | 1763 | MACHINE_DRIVER_END |
| 1811 | 1764 | |
| 1812 | | COMP ( 1986, to9p, 0, 0, to9p, to9p, 0, to, "Thomson", "TO9+", 0 ) |
| 1765 | COMP ( 1986, to9p, 0, 0, to9p, to9p, 0, 0, "Thomson", "TO9+", 0 ) |
| 1813 | 1766 | |
| 1814 | 1767 | |
| 1815 | 1768 | |
| r6724 | r6725 | |
| 2150 | 2103 | MDRV_IMPORT_FROM ( mo6 ) |
| 2151 | 2104 | MACHINE_DRIVER_END |
| 2152 | 2105 | |
| 2153 | | COMP ( 1986, mo6, 0, 0, mo6, mo6, 0, to, "Thomson", "MO6", 0 ) |
| 2106 | COMP ( 1986, mo6, 0, 0, mo6, mo6, 0, 0, "Thomson", "MO6", 0 ) |
| 2154 | 2107 | |
| 2155 | | COMP ( 1986, pro128, mo6, 0, pro128, pro128, 0, to, "Olivetti / Thomson", "Prodest PC 128", 0 ) |
| 2108 | COMP ( 1986, pro128, mo6, 0, pro128, pro128, 0, 0, "Olivetti / Thomson", "Prodest PC 128", 0 ) |
| 2156 | 2109 | |
| 2157 | 2110 | |
| 2158 | 2111 | |
| r6724 | r6725 | |
| 2374 | 2327 | MDRV_RAM_DEFAULT_SIZE("128K") |
| 2375 | 2328 | MACHINE_DRIVER_END |
| 2376 | 2329 | |
| 2377 | | COMP ( 1986, mo5nr, 0, 0, mo5nr, mo5nr, 0, to, "Thomson", "MO5 NR", 0 ) |
| 2330 | COMP ( 1986, mo5nr, 0, 0, mo5nr, mo5nr, 0, 0, "Thomson", "MO5 NR", 0 ) |
src/mess/drivers/atarist.c
| r6724 | r6725 | |
| 1794 | 1794 | return INIT_FAIL; |
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | static DEVICE_IMAGE_LOAD( atarist_serial ) |
| 1798 | { |
| 1799 | /* filename specified */ |
| 1800 | if (device_load_serial(image)==INIT_PASS) |
| 1801 | { |
| 1802 | serial_device_setup(image, 9600, 8, 1, SERIAL_PARITY_NONE); |
| 1803 | |
| 1804 | serial_device_set_transmit_state(image, 1); |
| 1805 | |
| 1806 | return INIT_PASS; |
| 1807 | } |
| 1808 | |
| 1809 | return INIT_FAIL; |
| 1810 | } |
| 1811 | |
| 1812 | |
| 1813 | static DEVICE_GET_INFO( atarist_serial ) |
| 1814 | { |
| 1815 | switch ( state ) |
| 1816 | { |
| 1817 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( atarist_serial ); break; |
| 1818 | case DEVINFO_STR_NAME: strcpy(info->s, "Atari ST serial port"); break; |
| 1819 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 1820 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 1821 | } |
| 1822 | } |
| 1823 | |
| 1824 | #define ATARIST_SERIAL DEVICE_GET_INFO_NAME(atarist_serial) |
| 1825 | |
| 1826 | #define MDRV_ATARIST_SERIAL_ADD(_tag) \ |
| 1827 | MDRV_DEVICE_ADD(_tag, ATARIST_SERIAL, 0) |
| 1828 | |
| 1797 | 1829 | static const floppy_config atarist_floppy_config = |
| 1798 | 1830 | { |
| 1799 | 1831 | DEVCB_NULL, |
| r6724 | r6725 | |
| 1862 | 1894 | MDRV_RAM_ADD("messram") |
| 1863 | 1895 | MDRV_RAM_DEFAULT_SIZE("1024K") // 1040ST |
| 1864 | 1896 | MDRV_RAM_EXTRA_OPTIONS("512K,256K") // 520ST ,260ST |
| 1897 | |
| 1898 | MDRV_ATARIST_SERIAL_ADD("serial") |
| 1865 | 1899 | MACHINE_DRIVER_END |
| 1866 | 1900 | |
| 1867 | 1901 | static MACHINE_DRIVER_START( megast ) |
| r6724 | r6725 | |
| 1936 | 1970 | MDRV_RAM_ADD("messram") |
| 1937 | 1971 | MDRV_RAM_DEFAULT_SIZE("1024K") // 1040STe |
| 1938 | 1972 | MDRV_RAM_EXTRA_OPTIONS("512K") // 520STe |
| 1973 | |
| 1974 | MDRV_ATARIST_SERIAL_ADD("serial") |
| 1939 | 1975 | MACHINE_DRIVER_END |
| 1940 | 1976 | |
| 1941 | 1977 | static MACHINE_DRIVER_START( megaste ) |
| r6724 | r6725 | |
| 1951 | 1987 | MDRV_RAM_MODIFY("messram") |
| 1952 | 1988 | MDRV_RAM_DEFAULT_SIZE("4M") // Mega STe 4 |
| 1953 | 1989 | MDRV_RAM_EXTRA_OPTIONS("2M,1M") // Mega STe 2 ,Mega STe 1 |
| 1990 | |
| 1991 | MDRV_ATARIST_SERIAL_ADD("serial2") |
| 1954 | 1992 | MACHINE_DRIVER_END |
| 1955 | 1993 | |
| 1956 | 1994 | static MACHINE_DRIVER_START( stbook ) |
| r6724 | r6725 | |
| 2004 | 2042 | MDRV_RAM_ADD("messram") |
| 2005 | 2043 | MDRV_RAM_DEFAULT_SIZE("4M") |
| 2006 | 2044 | MDRV_RAM_EXTRA_OPTIONS("1M") |
| 2045 | |
| 2046 | MDRV_ATARIST_SERIAL_ADD("serial") |
| 2047 | MDRV_ATARIST_SERIAL_ADD("serial2") |
| 2007 | 2048 | MACHINE_DRIVER_END |
| 2008 | 2049 | |
| 2009 | 2050 | /* ROMs */ |
| r6724 | r6725 | |
| 2142 | 2183 | ROM_SYSTEM_BIOS( 0, "tos492", "TOS 4.92" ) |
| 2143 | 2184 | ROMX_LOAD( "tos492.img", 0xe00000, 0x080000, BAD_DUMP CRC(bc8e497f) SHA1(747a38042844a6b632dcd9a76d8525fccb5eb892), ROM_BIOS(2) ) |
| 2144 | 2185 | ROM_END |
| 2145 | | |
| 2146 | | /* System Configuration */ |
| 2147 | | static DEVICE_IMAGE_LOAD( atarist_serial ) |
| 2148 | | { |
| 2149 | | /* filename specified */ |
| 2150 | | if (device_load_serial_device(image)==INIT_PASS) |
| 2151 | | { |
| 2152 | | /* setup transmit parameters */ |
| 2153 | | serial_device_setup(image, 9600, 8, 1, SERIAL_PARITY_NONE); |
| 2154 | | |
| 2155 | | /* and start transmit */ |
| 2156 | | serial_device_set_transmit_state(image, 1); |
| 2157 | | |
| 2158 | | return INIT_PASS; |
| 2159 | | } |
| 2160 | | |
| 2161 | | return INIT_FAIL; |
| 2162 | | } |
| 2163 | | |
| 2164 | | static void atarist_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 2165 | | { |
| 2166 | | /* serial */ |
| 2167 | | switch(state) |
| 2168 | | { |
| 2169 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2170 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 2171 | | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 2172 | | |
| 2173 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2174 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 2175 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(atarist_serial); break; |
| 2176 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 2177 | | |
| 2178 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2179 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 2180 | | } |
| 2181 | | } |
| 2182 | | |
| 2183 | | static void megaste_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 2184 | | { |
| 2185 | | /* serial */ |
| 2186 | | switch(state) |
| 2187 | | { |
| 2188 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 2189 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 2190 | | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 2191 | | |
| 2192 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2193 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 2194 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(atarist_serial); break; |
| 2195 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 2196 | | |
| 2197 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 2198 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 2199 | | } |
| 2200 | | } |
| 2201 | | |
| 2202 | | static SYSTEM_CONFIG_START( atarist ) |
| 2203 | | CONFIG_DEVICE(atarist_serial_getinfo) |
| 2204 | | // MIDI |
| 2205 | | SYSTEM_CONFIG_END |
| 2206 | | |
| 2207 | | static SYSTEM_CONFIG_START( megaste ) |
| 2208 | | CONFIG_DEVICE(megaste_serial_getinfo) |
| 2209 | | SYSTEM_CONFIG_END |
| 2210 | | |
| 2211 | | |
| 2212 | | |
| 2186 | |
| 2213 | 2187 | /* System Drivers */ |
| 2214 | 2188 | |
| 2215 | 2189 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 2216 | | COMP( 1985, atarist, 0, 0, atarist, atarist, 0, atarist, "Atari", "Atari ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2217 | | COMP( 1987, megast, atarist, 0, megast, atarist, 0, atarist, "Atari", "Atari Mega ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2190 | COMP( 1985, atarist, 0, 0, atarist, atarist, 0, 0, "Atari", "Atari ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2191 | COMP( 1987, megast, atarist, 0, megast, atarist, 0, 0, "Atari", "Atari Mega ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2218 | 2192 | /* |
| 2219 | | COMP( 1989, stacy, atarist, 0, stacy, stacy, 0, atarist, "Atari", "Atari Stacy", GAME_NOT_WORKING ) |
| 2193 | COMP( 1989, stacy, atarist, 0, stacy, stacy, 0, 0, "Atari", "Atari Stacy", GAME_NOT_WORKING ) |
| 2220 | 2194 | */ |
| 2221 | | COMP( 1989, atariste, 0, 0, atariste, atariste, 0, atarist, "Atari", "Atari STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2222 | | COMP( 1990, stbook, atariste, 0, stbook, stbook, 0, megaste, "Atari", "Atari STBook", GAME_NOT_WORKING ) |
| 2223 | | COMP( 1991, megaste, atariste, 0, megaste, atarist, 0, megaste, "Atari", "Atari Mega STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2195 | COMP( 1989, atariste, 0, 0, atariste, atariste, 0, 0, "Atari", "Atari STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2196 | // last two use measte config |
| 2197 | COMP( 1990, stbook, atariste, 0, stbook, stbook, 0, 0, "Atari", "Atari STBook", GAME_NOT_WORKING ) |
| 2198 | COMP( 1991, megaste, atariste, 0, megaste, atarist, 0, 0, "Atari", "Atari Mega STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2224 | 2199 | /* |
| 2225 | 2200 | COMP( 1991, stpad, atariste, 0, stpad, stpad, 0, stpad, "Atari", "Atari STPad (prototype)", GAME_NOT_WORKING ) |
| 2226 | 2201 | COMP( 1990, tt030, 0, 0, tt030, tt030, 0, tt030, "Atari", "Atari TT030", GAME_NOT_WORKING ) |
src/mess/drivers/ql.c
| r6724 | r6725 | |
| 658 | 658 | DO_NOT_KEEP_GEOMETRY |
| 659 | 659 | }; |
| 660 | 660 | |
| 661 | static DEVICE_GET_INFO( ql_serial ) |
| 662 | { |
| 663 | switch ( state ) |
| 664 | { |
| 665 | case DEVINFO_STR_NAME: strcpy(info->s, "QL serial port"); break; |
| 666 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 667 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | #define QL_SERIAL DEVICE_GET_INFO_NAME(ql_serial) |
| 672 | |
| 673 | #define MDRV_QL_SERIAL_ADD(_tag) \ |
| 674 | MDRV_DEVICE_ADD(_tag, QL_SERIAL, 0) |
| 675 | |
| 676 | #define MDRV_QL_SERIAL_REMOVE(_tag) \ |
| 677 | MDRV_DEVICE_REMOVE(_tag) |
| 678 | |
| 661 | 679 | static MACHINE_DRIVER_START( ql ) |
| 662 | 680 | MDRV_DRIVER_DATA(ql_state) |
| 663 | 681 | |
| r6724 | r6725 | |
| 711 | 729 | MDRV_RAM_DEFAULT_SIZE("128K") |
| 712 | 730 | MDRV_RAM_EXTRA_OPTIONS("192K,256K,384K,640K,896K") |
| 713 | 731 | |
| 732 | MDRV_QL_SERIAL_ADD("serial0") |
| 733 | MDRV_QL_SERIAL_ADD("serial1") |
| 714 | 734 | MACHINE_DRIVER_END |
| 715 | 735 | |
| 716 | 736 | static MACHINE_DRIVER_START( ql_ntsc ) |
| r6724 | r6725 | |
| 729 | 749 | MDRV_RAM_MODIFY("messram") |
| 730 | 750 | MDRV_RAM_DEFAULT_SIZE("128K") |
| 731 | 751 | MDRV_RAM_EXTRA_OPTIONS("256K") |
| 752 | |
| 753 | MDRV_QL_SERIAL_REMOVE("serial0") |
| 754 | MDRV_QL_SERIAL_REMOVE("serial1") |
| 732 | 755 | MACHINE_DRIVER_END |
| 733 | 756 | |
| 734 | 757 | static MACHINE_DRIVER_START( megaopd ) |
| r6724 | r6725 | |
| 908 | 931 | |
| 909 | 932 | return INIT_PASS; |
| 910 | 933 | } |
| 911 | | |
| 912 | | static void ql_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 913 | | { |
| 914 | | /* serial */ |
| 915 | | switch(state) |
| 916 | | { |
| 917 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 918 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 919 | | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 920 | | |
| 921 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 922 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 923 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(serial_device); break; |
| 924 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 925 | | |
| 926 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 927 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 928 | | } |
| 929 | | } |
| 930 | | |
| 931 | | static SYSTEM_CONFIG_START( ql ) |
| 932 | | CONFIG_DEVICE(ql_serial_getinfo) |
| 933 | | SYSTEM_CONFIG_END |
| 934 | | |
| 934 | |
| 935 | 935 | /* Computer Drivers */ |
| 936 | 936 | |
| 937 | 937 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 938 | | COMP( 1984, ql, 0, 0, ql, ql, 0, ql, "Sinclair Research Ltd", "QL (UK)", GAME_SUPPORTS_SAVE ) |
| 939 | | COMP( 1985, ql_us, ql, 0, ql_ntsc, ql, 0, ql, "Sinclair Research Ltd", "QL (USA)", GAME_SUPPORTS_SAVE ) |
| 940 | | COMP( 1985, ql_es, ql, 0, ql, ql_es, 0, ql, "Sinclair Research Ltd", "QL (Spain)", GAME_SUPPORTS_SAVE ) |
| 941 | | COMP( 1985, ql_fr, ql, 0, ql, ql_fr, 0, ql, "Sinclair Research Ltd", "QL (France)", GAME_NOT_WORKING ) |
| 942 | | COMP( 1985, ql_de, ql, 0, ql, ql_de, 0, ql, "Sinclair Research Ltd", "QL (Germany)", GAME_SUPPORTS_SAVE ) |
| 943 | | COMP( 1985, ql_it, ql, 0, ql, ql_it, 0, ql, "Sinclair Research Ltd", "QL (Italy)", GAME_SUPPORTS_SAVE ) |
| 944 | | COMP( 1985, ql_se, ql, 0, ql, ql_se, 0, ql, "Sinclair Research Ltd", "QL (Sweden)", GAME_NOT_WORKING ) |
| 945 | | COMP( 1985, ql_dk, ql, 0, ql, ql_dk, 0, ql, "Sinclair Research Ltd", "QL (Denmark)", GAME_NOT_WORKING ) |
| 946 | | COMP( 1985, ql_gr, ql, 0, ql, ql, 0, ql, "Sinclair Research Ltd", "QL (Greece)", GAME_SUPPORTS_SAVE ) |
| 938 | COMP( 1984, ql, 0, 0, ql, ql, 0, 0, "Sinclair Research Ltd", "QL (UK)", GAME_SUPPORTS_SAVE ) |
| 939 | COMP( 1985, ql_us, ql, 0, ql_ntsc, ql, 0, 0, "Sinclair Research Ltd", "QL (USA)", GAME_SUPPORTS_SAVE ) |
| 940 | COMP( 1985, ql_es, ql, 0, ql, ql_es, 0, 0, "Sinclair Research Ltd", "QL (Spain)", GAME_SUPPORTS_SAVE ) |
| 941 | COMP( 1985, ql_fr, ql, 0, ql, ql_fr, 0, 0, "Sinclair Research Ltd", "QL (France)", GAME_NOT_WORKING ) |
| 942 | COMP( 1985, ql_de, ql, 0, ql, ql_de, 0, 0, "Sinclair Research Ltd", "QL (Germany)", GAME_SUPPORTS_SAVE ) |
| 943 | COMP( 1985, ql_it, ql, 0, ql, ql_it, 0, 0, "Sinclair Research Ltd", "QL (Italy)", GAME_SUPPORTS_SAVE ) |
| 944 | COMP( 1985, ql_se, ql, 0, ql, ql_se, 0, 0, "Sinclair Research Ltd", "QL (Sweden)", GAME_NOT_WORKING ) |
| 945 | COMP( 1985, ql_dk, ql, 0, ql, ql_dk, 0, 0, "Sinclair Research Ltd", "QL (Denmark)", GAME_NOT_WORKING ) |
| 946 | COMP( 1985, ql_gr, ql, 0, ql, ql, 0, 0, "Sinclair Research Ltd", "QL (Greece)", GAME_SUPPORTS_SAVE ) |
| 947 | // last two did not used system config |
| 947 | 948 | COMP( 1984, tonto, 0, 0, opd, ql, 0, 0, "British Telecom Business Systems", "Merlin M1800 Tonto", GAME_NOT_WORKING ) |
| 948 | 949 | COMP( 1986, megaopd,tonto, 0, megaopd, ql, 0, 0, "International Computer Limited", "MegaOPD (USA)", GAME_NOT_WORKING ) |
src/mess/drivers/abc80x.c
| r6724 | r6725 | |
| 1102 | 1102 | z80dart_ctsb_w(state->z80dart, 0); // 0 = 50Hz, 1 = 60Hz |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | static DEVICE_IMAGE_LOAD( abc800_serial ) |
| 1106 | { |
| 1107 | /* filename specified */ |
| 1108 | if (device_load_serial(image)==INIT_PASS) |
| 1109 | { |
| 1110 | /* setup transmit parameters */ |
| 1111 | serial_device_setup(image, 9600 >> input_port_read(image->machine, "BAUD"), 8, 1, SERIAL_PARITY_NONE); |
| 1112 | |
| 1113 | /* and start transmit */ |
| 1114 | serial_device_set_transmit_state(image, 1); |
| 1115 | |
| 1116 | return INIT_PASS; |
| 1117 | } |
| 1118 | |
| 1119 | return INIT_FAIL; |
| 1120 | } |
| 1121 | |
| 1122 | |
| 1123 | static DEVICE_GET_INFO( abc800_serial ) |
| 1124 | { |
| 1125 | switch ( state ) |
| 1126 | { |
| 1127 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( abc800_serial ); break; |
| 1128 | case DEVINFO_STR_NAME: strcpy(info->s, "ABC800 serial port"); break; |
| 1129 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 1130 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | #define ABC800_SERIAL DEVICE_GET_INFO_NAME(abc800_serial) |
| 1135 | |
| 1136 | #define MDRV_ABC800_SERIAL_ADD(_tag) \ |
| 1137 | MDRV_DEVICE_ADD(_tag, ABC800_SERIAL, 0) |
| 1138 | |
| 1105 | 1139 | /* Machine Drivers */ |
| 1106 | 1140 | |
| 1107 | 1141 | static MACHINE_DRIVER_START( abc800m ) |
| r6724 | r6725 | |
| 1142 | 1176 | MDRV_RAM_ADD("messram") |
| 1143 | 1177 | MDRV_RAM_DEFAULT_SIZE("16K") |
| 1144 | 1178 | MDRV_RAM_EXTRA_OPTIONS("32K") |
| 1179 | |
| 1180 | MDRV_ABC800_SERIAL_ADD("serial") |
| 1145 | 1181 | MACHINE_DRIVER_END |
| 1146 | 1182 | |
| 1147 | 1183 | static MACHINE_DRIVER_START( abc800c ) |
| r6724 | r6725 | |
| 1182 | 1218 | MDRV_RAM_ADD("messram") |
| 1183 | 1219 | MDRV_RAM_DEFAULT_SIZE("16K") |
| 1184 | 1220 | MDRV_RAM_EXTRA_OPTIONS("32K") |
| 1221 | |
| 1222 | MDRV_ABC800_SERIAL_ADD("serial") |
| 1185 | 1223 | MACHINE_DRIVER_END |
| 1186 | 1224 | |
| 1187 | 1225 | static MACHINE_DRIVER_START( abc802 ) |
| r6724 | r6725 | |
| 1221 | 1259 | /* internal ram */ |
| 1222 | 1260 | MDRV_RAM_ADD("messram") |
| 1223 | 1261 | MDRV_RAM_DEFAULT_SIZE("64K") |
| 1262 | |
| 1263 | MDRV_ABC800_SERIAL_ADD("serial") |
| 1224 | 1264 | MACHINE_DRIVER_END |
| 1225 | 1265 | |
| 1226 | 1266 | static MACHINE_DRIVER_START( abc806 ) |
| r6724 | r6725 | |
| 1259 | 1299 | MDRV_RAM_ADD("messram") |
| 1260 | 1300 | MDRV_RAM_DEFAULT_SIZE("160K") // 32KB + 128KB |
| 1261 | 1301 | MDRV_RAM_EXTRA_OPTIONS("544K") // 32KB + 512KB |
| 1302 | |
| 1303 | MDRV_ABC800_SERIAL_ADD("serial") |
| 1262 | 1304 | MACHINE_DRIVER_END |
| 1263 | 1305 | |
| 1264 | 1306 | /* ROMs */ |
| r6724 | r6725 | |
| 1370 | 1412 | ROM_LOAD( "64 90240-01.2d", 0x0000, 0x0400, NO_DUMP ) // "ABC P4-11" PAL16L8, memory mapper |
| 1371 | 1413 | ROM_END |
| 1372 | 1414 | |
| 1373 | | /* System Configuration */ |
| 1374 | | static DEVICE_IMAGE_LOAD( abc800_serial ) |
| 1375 | | { |
| 1376 | | /* filename specified */ |
| 1377 | | if (device_load_serial_device(image)==INIT_PASS) |
| 1378 | | { |
| 1379 | | /* setup transmit parameters */ |
| 1380 | | serial_device_setup(image, 9600 >> input_port_read(image->machine, "BAUD"), 8, 1, SERIAL_PARITY_NONE); |
| 1381 | | |
| 1382 | | /* and start transmit */ |
| 1383 | | serial_device_set_transmit_state(image, 1); |
| 1384 | | |
| 1385 | | return INIT_PASS; |
| 1386 | | } |
| 1387 | | |
| 1388 | | return INIT_FAIL; |
| 1389 | | } |
| 1390 | | |
| 1391 | | static void abc800_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 1392 | | { |
| 1393 | | /* serial */ |
| 1394 | | switch(state) |
| 1395 | | { |
| 1396 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1397 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 1398 | | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1399 | | |
| 1400 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1401 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 1402 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(abc800_serial); break; |
| 1403 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 1404 | | |
| 1405 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1406 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 1407 | | } |
| 1408 | | } |
| 1409 | | |
| 1410 | | static SYSTEM_CONFIG_START( abc800 ) |
| 1411 | | CONFIG_DEVICE(abc800_serial_getinfo) |
| 1412 | | SYSTEM_CONFIG_END |
| 1413 | | |
| 1414 | 1415 | /* Driver Initialization */ |
| 1415 | 1416 | |
| 1416 | 1417 | static DIRECT_UPDATE_HANDLER( abc800_direct_update_handler ) |
| r6724 | r6725 | |
| 1504 | 1505 | /* System Drivers */ |
| 1505 | 1506 | |
| 1506 | 1507 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 1507 | | COMP( 1981, abc800m, 0, 0, abc800m, abc800, abc800, abc800, "Luxor Datorer AB", "ABC 800 M/HR", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1508 | | COMP( 1981, abc800c, abc800m, 0, abc800c, abc800, abc800, abc800, "Luxor Datorer AB", "ABC 800 C/HR", GAME_NOT_WORKING ) |
| 1509 | | COMP( 1983, abc802, 0, 0, abc802, abc802, abc802, abc800, "Luxor Datorer AB", "ABC 802", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1510 | | COMP( 1983, abc806, 0, 0, abc806, abc806, abc806, abc800, "Luxor Datorer AB", "ABC 806", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1508 | COMP( 1981, abc800m, 0, 0, abc800m, abc800, abc800, 0, "Luxor Datorer AB", "ABC 800 M/HR", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1509 | COMP( 1981, abc800c, abc800m, 0, abc800c, abc800, abc800, 0, "Luxor Datorer AB", "ABC 800 C/HR", GAME_NOT_WORKING ) |
| 1510 | COMP( 1983, abc802, 0, 0, abc802, abc802, abc802, 0, "Luxor Datorer AB", "ABC 802", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 1511 | COMP( 1983, abc806, 0, 0, abc806, abc806, abc806, 0, "Luxor Datorer AB", "ABC 806", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
src/mess/drivers/newbrain.c
| r6724 | r6725 | |
| 1490 | 1490 | CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED |
| 1491 | 1491 | }; |
| 1492 | 1492 | |
| 1493 | |
| 1494 | static DEVICE_IMAGE_LOAD( newbrain_serial ) |
| 1495 | { |
| 1496 | if (device_load_serial(image)==INIT_PASS) |
| 1497 | { |
| 1498 | serial_device_setup(image, 9600, 8, 1, SERIAL_PARITY_NONE); |
| 1499 | |
| 1500 | serial_device_set_transmit_state(image, 1); |
| 1501 | |
| 1502 | return INIT_PASS; |
| 1503 | } |
| 1504 | |
| 1505 | return INIT_FAIL; |
| 1506 | } |
| 1507 | |
| 1508 | |
| 1509 | static DEVICE_GET_INFO( newbrain_serial ) |
| 1510 | { |
| 1511 | switch ( state ) |
| 1512 | { |
| 1513 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( newbrain_serial ); break; |
| 1514 | case DEVINFO_STR_NAME: strcpy(info->s, "Newbrain serial port"); break; |
| 1515 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 1516 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 1517 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 0; break; |
| 1518 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 0; break; |
| 1519 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 1520 | } |
| 1521 | } |
| 1522 | |
| 1523 | #define NEWBRAIN_SERIAL DEVICE_GET_INFO_NAME(newbrain_serial) |
| 1524 | |
| 1525 | #define MDRV_NEWBRAIN_SERIAL_ADD(_tag) \ |
| 1526 | MDRV_DEVICE_ADD(_tag, NEWBRAIN_SERIAL, 0) |
| 1527 | |
| 1493 | 1528 | static MACHINE_DRIVER_START( newbrain_a ) |
| 1494 | 1529 | MDRV_DRIVER_DATA(newbrain_state) |
| 1495 | 1530 | |
| r6724 | r6725 | |
| 1519 | 1554 | /* internal ram */ |
| 1520 | 1555 | MDRV_RAM_ADD("messram") |
| 1521 | 1556 | MDRV_RAM_DEFAULT_SIZE("32K") |
| 1557 | |
| 1558 | MDRV_NEWBRAIN_SERIAL_ADD("serial") |
| 1522 | 1559 | MACHINE_DRIVER_END |
| 1523 | 1560 | |
| 1524 | 1561 | static FLOPPY_OPTIONS_START(newbrain) |
| r6724 | r6725 | |
| 1666 | 1703 | ROM_REGION( 0x1000, "chargen", 0 ) |
| 1667 | 1704 | ROM_LOAD( "char eprom iss 1.ic453", 0x0000, 0x0a01, BAD_DUMP CRC(46ecbc65) SHA1(3fe064d49a4de5e3b7383752e98ad35a674e26dd) ) // 8248R7 |
| 1668 | 1705 | ROM_END |
| 1669 | | |
| 1670 | | /* System Configuration */ |
| 1671 | | static DEVICE_IMAGE_LOAD( newbrain_serial ) |
| 1672 | | { |
| 1673 | | /* filename specified */ |
| 1674 | | if (device_load_serial_device(image)==INIT_PASS) |
| 1675 | | { |
| 1676 | | /* setup transmit parameters */ |
| 1677 | | serial_device_setup(image, 9600, 8, 1, SERIAL_PARITY_NONE); |
| 1678 | | |
| 1679 | | /* and start transmit */ |
| 1680 | | serial_device_set_transmit_state(image, 1); |
| 1681 | | |
| 1682 | | return INIT_PASS; |
| 1683 | | } |
| 1684 | | |
| 1685 | | return INIT_FAIL; |
| 1686 | | } |
| 1687 | | |
| 1688 | | static void newbrain_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 1689 | | { |
| 1690 | | /* serial */ |
| 1691 | | switch(state) |
| 1692 | | { |
| 1693 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1694 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 1695 | | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 1696 | | |
| 1697 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1698 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 1699 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(newbrain_serial); break; |
| 1700 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 1701 | | |
| 1702 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1703 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 1704 | | } |
| 1705 | | } |
| 1706 | | |
| 1707 | | static SYSTEM_CONFIG_START( newbrain ) |
| 1708 | | CONFIG_DEVICE(newbrain_serial_getinfo) |
| 1709 | | SYSTEM_CONFIG_END |
| 1710 | | |
| 1706 | |
| 1711 | 1707 | /* System Drivers */ |
| 1712 | 1708 | |
| 1713 | 1709 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS |
| 1714 | | COMP( 1981, newbrain, 0, 0, newbrain_a, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain AD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1715 | | COMP( 1981, newbraie, newbrain, 0, newbrain_eim, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain AD with Expansion Interface", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1716 | | COMP( 1981, newbraia, newbrain, 0, newbrain_a, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain A", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1717 | | COMP( 1981, newbraim, newbrain, 0, newbrain_a, newbrain, 0, newbrain, "Grundy Business Systems Ltd.", "NewBrain MD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1710 | COMP( 1981, newbrain, 0, 0, newbrain_a, newbrain, 0, 0, "Grundy Business Systems Ltd.", "NewBrain AD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1711 | COMP( 1981, newbraie, newbrain, 0, newbrain_eim, newbrain, 0, 0, "Grundy Business Systems Ltd.", "NewBrain AD with Expansion Interface", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1712 | COMP( 1981, newbraia, newbrain, 0, newbrain_a, newbrain, 0, 0, "Grundy Business Systems Ltd.", "NewBrain A", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1713 | COMP( 1981, newbraim, newbrain, 0, newbrain_a, newbrain, 0, 0, "Grundy Business Systems Ltd.", "NewBrain MD", GAME_NOT_WORKING | GAME_NO_SOUND ) |
src/mess/drivers/nc.c
| r6724 | r6725 | |
| 1613 | 1613 | INPUT_PORTS_END |
| 1614 | 1614 | |
| 1615 | 1615 | |
| 1616 | /* Serial */ |
| 1617 | static DEVICE_IMAGE_LOAD( nc_serial ) |
| 1618 | { |
| 1619 | const device_config *uart = devtag_get_device(image->machine, "uart"); |
| 1620 | |
| 1621 | /* filename specified */ |
| 1622 | if (device_load_serial(image)==INIT_PASS) |
| 1623 | { |
| 1624 | /* setup transmit parameters */ |
| 1625 | serial_device_setup(image, 9600, 8, 1, SERIAL_PARITY_NONE); |
| 1626 | |
| 1627 | /* connect serial chip to serial device */ |
| 1628 | msm8251_connect_to_serial_device(uart, image); |
| 1629 | |
| 1630 | /* and start transmit */ |
| 1631 | serial_device_set_transmit_state(image,1); |
| 1632 | |
| 1633 | return INIT_PASS; |
| 1634 | } |
| 1635 | |
| 1636 | return INIT_FAIL; |
| 1637 | |
| 1638 | } |
| 1639 | |
| 1640 | static DEVICE_GET_INFO( nc_serial ) |
| 1641 | { |
| 1642 | switch ( state ) |
| 1643 | { |
| 1644 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( nc_serial ); break; |
| 1645 | case DEVINFO_STR_NAME: strcpy(info->s, "BW2 serial port"); break; |
| 1646 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 1647 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 1648 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 0; break; |
| 1649 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 0; break; |
| 1650 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 1651 | } |
| 1652 | } |
| 1653 | |
| 1654 | #define NC_SERIAL DEVICE_GET_INFO_NAME(nc_serial) |
| 1655 | |
| 1656 | #define MDRV_NC_SERIAL_ADD(_tag) \ |
| 1657 | MDRV_DEVICE_ADD(_tag, NC_SERIAL, 0) |
| 1658 | |
| 1616 | 1659 | /**********************************************************************************************************/ |
| 1617 | 1660 | |
| 1618 | 1661 | static MACHINE_DRIVER_START( nc100 ) |
| r6724 | r6725 | |
| 1666 | 1709 | /* internal ram */ |
| 1667 | 1710 | MDRV_RAM_ADD("messram") |
| 1668 | 1711 | MDRV_RAM_DEFAULT_SIZE("64K") |
| 1712 | |
| 1713 | MDRV_NC_SERIAL_ADD("serial") |
| 1669 | 1714 | MACHINE_DRIVER_END |
| 1670 | 1715 | |
| 1671 | 1716 | static const floppy_config nc200_floppy_config = |
| r6724 | r6725 | |
| 1738 | 1783 | |
| 1739 | 1784 | |
| 1740 | 1785 | ROM_START(nc200) |
| 1741 | | ROM_REGION(((64*1024)+(512*1024)), "maincpu",0) |
| 1742 | | ROM_LOAD("nc200.rom", 0x010000, 0x080000, CRC(bb8180e7) SHA1(fb5c93b0a3e199202c6a12548d2617f7a09bae47)) |
| 1786 | ROM_REGION(((64*1024)+(512*1024)), "maincpu",0) |
| 1787 | ROM_LOAD("nc200.rom", 0x010000, 0x080000, CRC(bb8180e7) SHA1(fb5c93b0a3e199202c6a12548d2617f7a09bae47)) |
| 1743 | 1788 | ROM_END |
| 1744 | 1789 | |
| 1745 | | static void nc_common_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 1746 | | { |
| 1747 | | /* serial */ |
| 1748 | | switch(state) |
| 1749 | | { |
| 1750 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1751 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_SERIAL; break; |
| 1752 | | case MESS_DEVINFO_INT_READABLE: info->i = 1; break; |
| 1753 | | case MESS_DEVINFO_INT_WRITEABLE: info->i = 0; break; |
| 1754 | | case MESS_DEVINFO_INT_CREATABLE: info->i = 0; break; |
| 1755 | | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1756 | | |
| 1757 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1758 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(serial_device); break; |
| 1759 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(nc_serial); break; |
| 1760 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break; |
| 1761 | | |
| 1762 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1763 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "txt"); break; |
| 1764 | | } |
| 1765 | | } |
| 1766 | | |
| 1767 | | static SYSTEM_CONFIG_START(nc_common) |
| 1768 | | CONFIG_DEVICE(nc_common_serial_getinfo) |
| 1769 | | SYSTEM_CONFIG_END |
| 1770 | | |
| 1771 | 1790 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 1772 | | COMP( 1992, nc100, 0, 0, nc100, nc100, 0, nc_common, "Amstrad plc", "NC100", 0 ) |
| 1773 | | COMP( 1992, nc150, nc100, 0, nc100, nc100, 0, nc_common, "Amstrad plc", "NC150", 0 ) |
| 1774 | | COMP( 1993, nc200, 0, 0, nc200, nc200, 0, nc_common, "Amstrad plc", "NC200", 0 ) |
| 1791 | COMP( 1992, nc100, 0, 0, nc100, nc100, 0, 0, "Amstrad plc", "NC100", 0 ) |
| 1792 | COMP( 1992, nc150, nc100, 0, nc100, nc100, 0, 0, "Amstrad plc", "NC150", 0 ) |
| 1793 | COMP( 1993, nc200, 0, 0, nc200, nc200, 0, 0, "Amstrad plc", "NC200", 0 ) |
| 1775 | 1794 | |
src/mess/drivers/apexc.c
| r6724 | r6725 | |
| 32 | 32 | the user to enter such a loader manually, but it would take hours...) |
| 33 | 33 | */ |
| 34 | 34 | |
| 35 | | typedef struct cylinder |
| 35 | typedef struct _apexc_cylinder_t apexc_cylinder_t; |
| 36 | struct _apexc_cylinder_t |
| 36 | 37 | { |
| 37 | | const device_config *fd; |
| 38 | 38 | int writable; |
| 39 | | } cylinder; |
| 39 | }; |
| 40 | 40 | |
| 41 | | static cylinder apexc_cylinder; |
| 42 | | |
| 43 | 41 | /* |
| 44 | 42 | Open cylinder image and read RAM |
| 45 | 43 | */ |
| 46 | 44 | static DEVICE_IMAGE_LOAD( apexc_cylinder ) |
| 47 | 45 | { |
| 48 | | /* open file */ |
| 49 | | apexc_cylinder.fd = image; |
| 50 | | /* tell whether the image is writable */ |
| 51 | | apexc_cylinder.writable = image_is_writable(image); |
| 52 | | |
| 53 | | if (apexc_cylinder.fd) |
| 54 | | { /* load RAM contents */ |
| 55 | | |
| 56 | | image_fread(apexc_cylinder.fd, memory_region(image->machine, "maincpu"), /*0x8000*/0x1000); |
| 46 | /* load RAM contents */ |
| 47 | apexc_cylinder_t *cyl = (apexc_cylinder_t *)image->token; |
| 48 | cyl->writable = image_is_writable(image); |
| 49 | |
| 50 | image_fread(image, memory_region(image->machine, "maincpu"), /*0x8000*/0x1000); |
| 57 | 51 | #ifdef LSB_FIRST |
| 58 | | { /* fix endianness */ |
| 59 | | UINT32 *RAM; |
| 60 | | int i; |
| 52 | { /* fix endianness */ |
| 53 | UINT32 *RAM; |
| 54 | int i; |
| 61 | 55 | |
| 62 | | RAM = (UINT32 *) memory_region(image->machine, "maincpu"); |
| 56 | RAM = (UINT32 *) memory_region(image->machine, "maincpu"); |
| 63 | 57 | |
| 64 | | for (i=0; i < /*0x2000*/0x0400; i++) |
| 65 | | RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]); |
| 66 | | } |
| 67 | | #endif |
| 58 | for (i=0; i < /*0x2000*/0x0400; i++) |
| 59 | RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]); |
| 68 | 60 | } |
| 61 | #endif |
| 69 | 62 | |
| 70 | 63 | return INIT_PASS; |
| 71 | 64 | } |
| r6724 | r6725 | |
| 75 | 68 | */ |
| 76 | 69 | static DEVICE_IMAGE_UNLOAD( apexc_cylinder ) |
| 77 | 70 | { |
| 78 | | if (apexc_cylinder.fd && apexc_cylinder.writable) |
| 71 | apexc_cylinder_t *cyl = (apexc_cylinder_t *)image->token; |
| 72 | if (cyl->writable) |
| 79 | 73 | { /* save RAM contents */ |
| 80 | 74 | /* rewind file */ |
| 81 | | image_fseek(apexc_cylinder.fd, 0, SEEK_SET); |
| 75 | image_fseek(image, 0, SEEK_SET); |
| 82 | 76 | #ifdef LSB_FIRST |
| 83 | 77 | { /* fix endianness */ |
| 84 | 78 | UINT32 *RAM; |
| r6724 | r6725 | |
| 91 | 85 | } |
| 92 | 86 | #endif |
| 93 | 87 | /* write */ |
| 94 | | image_fwrite(apexc_cylinder.fd, memory_region(image->machine, "maincpu"), /*0x8000*/0x1000); |
| 88 | image_fwrite(image, memory_region(image->machine, "maincpu"), /*0x8000*/0x1000); |
| 95 | 89 | } |
| 96 | 90 | } |
| 97 | 91 | |
| 92 | static DEVICE_START(apexc_cylinder) |
| 93 | { |
| 94 | } |
| 98 | 95 | |
| 96 | static DEVICE_RESET(apexc_cylinder) |
| 97 | { |
| 98 | } |
| 99 | |
| 100 | static DEVICE_GET_INFO( apexc_cylinder ) |
| 101 | { |
| 102 | switch ( state ) |
| 103 | { |
| 104 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 105 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(apexc_cylinder_t); break; |
| 106 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 107 | case DEVINFO_INT_IMAGE_TYPE: info->i = IO_CYLINDER; break; |
| 108 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 109 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 1; break; |
| 110 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 0; break; |
| 111 | case DEVINFO_INT_IMAGE_RESET_ON_LOAD: info->i = 1; break; |
| 112 | |
| 113 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( apexc_cylinder ); break; |
| 114 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 115 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( apexc_cylinder ); break; |
| 116 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( apexc_cylinder ); break; |
| 117 | case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(apexc_cylinder ); break; |
| 118 | case DEVINFO_STR_NAME: strcpy( info->s, "APEXC Cylinder"); break; |
| 119 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Cylinder"); break; |
| 120 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "apc"); break; |
| 121 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 122 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 123 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | #define APEXC_CYLINDER DEVICE_GET_INFO_NAME(apexc_cylinder) |
| 128 | |
| 129 | #define MDRV_APEXC_CYLINDER_ADD(_tag) \ |
| 130 | MDRV_DEVICE_ADD(_tag, APEXC_CYLINDER, 0) |
| 131 | |
| 132 | |
| 99 | 133 | /* |
| 100 | 134 | APEXC tape support |
| 101 | 135 | |
| r6724 | r6725 | |
| 141 | 175 | 11111 Letters |
| 142 | 176 | */ |
| 143 | 177 | |
| 144 | | typedef struct tape |
| 178 | typedef struct _apexc_tape_t apexc_tape_t; |
| 179 | struct _apexc_tape_t |
| 145 | 180 | { |
| 146 | | const device_config *fd; |
| 147 | | } tape; |
| 181 | int dummy; |
| 182 | }; |
| 183 | static DEVICE_START(apexc_tape) |
| 184 | { |
| 185 | } |
| 148 | 186 | |
| 149 | | static tape apexc_tapes[2]; |
| 150 | | |
| 151 | | |
| 152 | | |
| 153 | | static void apexc_get_open_mode(int id, |
| 154 | | unsigned int *readable, unsigned int *writeable, unsigned int *creatable) |
| 187 | static DEVICE_RESET(apexc_tape) |
| 155 | 188 | { |
| 156 | | /* unit 0 is read-only, unit 1 is write-only */ |
| 157 | | if (id) |
| 189 | } |
| 190 | static DEVICE_GET_INFO( apexc_tape ) |
| 191 | { |
| 192 | switch ( state ) |
| 158 | 193 | { |
| 159 | | *readable = 0; |
| 160 | | *writeable = 1; |
| 161 | | *creatable = 1; |
| 194 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 195 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(apexc_tape_t); break; |
| 196 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 197 | case DEVINFO_INT_IMAGE_TYPE: info->i = IO_PUNCHTAPE; break; |
| 198 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 199 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 1; break; |
| 200 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 1; break; |
| 201 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( apexc_tape ); break; |
| 202 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 203 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( apexc_tape ); break; |
| 204 | |
| 205 | case DEVINFO_STR_NAME: strcpy( info->s, "APEXC Tape"); break; |
| 206 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Punch tape"); break; |
| 207 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "tap"); break; |
| 208 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 209 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 210 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break; |
| 162 | 211 | } |
| 163 | | else |
| 164 | | { |
| 165 | | *readable = 1; |
| 166 | | *writeable = 1; |
| 167 | | *creatable = 1; |
| 168 | | } |
| 169 | 212 | } |
| 170 | 213 | |
| 171 | 214 | |
| 215 | #define APEXC_TAPE DEVICE_GET_INFO_NAME(apexc_tape) |
| 172 | 216 | |
| 173 | | static DEVICE_START( apexc_tape ) |
| 217 | #define MDRV_APEXC_TAPE_ADD(_tag) \ |
| 218 | MDRV_DEVICE_ADD(_tag, APEXC_TAPE, 0) |
| 219 | |
| 220 | static DEVICE_GET_INFO( apexc_tape_ro) |
| 174 | 221 | { |
| 222 | switch ( state ) |
| 223 | { |
| 224 | case DEVINFO_STR_NAME: strcpy(info->s, "APEXC Tape Read-Only"); break; |
| 225 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 226 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 0; break; |
| 227 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 0; break; |
| 228 | default: DEVICE_GET_INFO_CALL(apexc_tape); break; |
| 229 | } |
| 175 | 230 | } |
| 176 | 231 | |
| 232 | #define APEXC_TAPE_RO DEVICE_GET_INFO_NAME(apexc_tape_ro) |
| 177 | 233 | |
| 234 | #define MDRV_APEXC_TAPE_RO_ADD(_tag) \ |
| 235 | MDRV_DEVICE_ADD(_tag, APEXC_TAPE_RO, 0) |
| 178 | 236 | |
| 179 | 237 | /* |
| 180 | 238 | Open a tape image |
| 181 | 239 | */ |
| 182 | | static DEVICE_IMAGE_LOAD( apexc_tape ) |
| 183 | | { |
| 184 | | int id = image_index_in_device(image); |
| 185 | | tape *t = &apexc_tapes[id]; |
| 186 | 240 | |
| 187 | | /* open file */ |
| 188 | | t->fd = image; |
| 189 | | |
| 190 | | return INIT_PASS; |
| 191 | | } |
| 192 | | |
| 193 | | static READ8_HANDLER(tape_read) |
| 241 | static READ8_DEVICE_HANDLER(tape_read) |
| 194 | 242 | { |
| 195 | 243 | UINT8 reply; |
| 196 | 244 | |
| 197 | | if (apexc_tapes[0].fd && (image_fread(apexc_tapes[0].fd, & reply, 1) == 1)) |
| 245 | if (image_exists(device) && (image_fread(device, & reply, 1) == 1)) |
| 198 | 246 | return reply & 0x1f; |
| 199 | 247 | else |
| 200 | 248 | return 0; /* unit not ready - I don't know what we should do */ |
| 201 | 249 | } |
| 202 | 250 | |
| 203 | | static WRITE8_HANDLER(tape_write) |
| 251 | static WRITE8_DEVICE_HANDLER(tape_write) |
| 204 | 252 | { |
| 205 | 253 | UINT8 data5 = (data & 0x1f); |
| 206 | 254 | |
| 207 | | if (apexc_tapes[1].fd) |
| 208 | | image_fwrite(apexc_tapes[1].fd, & data5, 1); |
| 255 | if (image_exists(device)) |
| 256 | image_fwrite(device, & data5, 1); |
| 209 | 257 | |
| 210 | | apexc_teletyper_putchar(space->machine, data & 0x1f); /* display on screen */ |
| 258 | apexc_teletyper_putchar(device->machine, data & 0x1f); /* display on screen */ |
| 211 | 259 | } |
| 212 | 260 | |
| 213 | 261 | /* |
| r6724 | r6725 | |
| 789 | 837 | ADDRESS_MAP_END |
| 790 | 838 | |
| 791 | 839 | static ADDRESS_MAP_START(apexc_io_map, ADDRESS_SPACE_IO, 8) |
| 792 | | AM_RANGE(0, 0) AM_READWRITE(tape_read, tape_write) |
| 840 | AM_RANGE(0x00, 0x00) AM_DEVREAD("tape_ro",tape_read) |
| 841 | AM_RANGE(0x00, 0x00) AM_DEVWRITE("tape",tape_write) |
| 793 | 842 | ADDRESS_MAP_END |
| 794 | 843 | |
| 795 | 844 | |
| r6724 | r6725 | |
| 822 | 871 | MDRV_VIDEO_START(apexc) |
| 823 | 872 | MDRV_VIDEO_UPDATE(apexc) |
| 824 | 873 | |
| 874 | MDRV_APEXC_CYLINDER_ADD("cylinder") |
| 875 | MDRV_APEXC_TAPE_ADD("tape") |
| 876 | MDRV_APEXC_TAPE_RO_ADD("tape_ro") |
| 825 | 877 | MACHINE_DRIVER_END |
| 826 | 878 | |
| 827 | 879 | ROM_START(apexc) |
| r6724 | r6725 | |
| 833 | 885 | /* space filled with our font */ |
| 834 | 886 | ROM_END |
| 835 | 887 | |
| 836 | | static void apexc_cylinder_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 837 | | { |
| 838 | | /* cylinder */ |
| 839 | | switch(state) |
| 840 | | { |
| 841 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 842 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_CYLINDER; break; |
| 843 | | case MESS_DEVINFO_INT_READABLE: info->i = 1; break; |
| 844 | | case MESS_DEVINFO_INT_WRITEABLE: info->i = 1; break; |
| 845 | | case MESS_DEVINFO_INT_CREATABLE: info->i = 0; break; |
| 846 | | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 847 | | case MESS_DEVINFO_INT_RESET_ON_LOAD: info->i = 1; break; |
| 848 | | |
| 849 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 850 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(apexc_cylinder); break; |
| 851 | | case MESS_DEVINFO_PTR_UNLOAD: info->unload = DEVICE_IMAGE_UNLOAD_NAME(apexc_cylinder); break; |
| 852 | | |
| 853 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 854 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "apc"); break; |
| 855 | | } |
| 856 | | } |
| 857 | | |
| 858 | | static void apexc_punchtape_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 859 | | { |
| 860 | | /* punchtape */ |
| 861 | | switch(state) |
| 862 | | { |
| 863 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 864 | | case MESS_DEVINFO_INT_TYPE: info->i = IO_PUNCHTAPE; break; |
| 865 | | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 866 | | |
| 867 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 868 | | case MESS_DEVINFO_PTR_START: info->start = DEVICE_START_NAME(apexc_tape); break; |
| 869 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(apexc_tape); break; |
| 870 | | case MESS_DEVINFO_PTR_GET_DISPOSITIONS: info->getdispositions = apexc_get_open_mode; break; |
| 871 | | |
| 872 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 873 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "tap"); break; |
| 874 | | } |
| 875 | | } |
| 876 | | |
| 877 | | static SYSTEM_CONFIG_START(apexc) |
| 878 | | CONFIG_DEVICE(apexc_cylinder_getinfo) |
| 879 | | CONFIG_DEVICE(apexc_punchtape_getinfo) |
| 880 | | SYSTEM_CONFIG_END |
| 881 | | |
| 882 | 888 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 883 | | //COMP( 1951, apexc53, 0, 0, apexc53, apexc, apexc, apexc, "Booth", "APEXC (as described in 1953)" , GAME_NOT_WORKING) |
| 884 | | COMP( 1955, apexc, /*apexc53*/0, 0, apexc, apexc, apexc, apexc, "Booth", "APEXC (as described in 1957)" , 0) |
| 889 | //COMP( 1951, apexc53, 0, 0, apexc53, apexc, apexc, 0, "Booth", "APEXC (as described in 1953)" , GAME_NOT_WORKING) |
| 890 | COMP( 1955, apexc, /*apexc53*/0, 0, apexc, apexc, apexc, 0, "Booth", "APEXC (as described in 1957)" , 0) |
src/mess/drivers/bw2.c
| r6724 | r6725 | |
| 235 | 235 | memory_set_bank(space->machine, "bank1", state->bank); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | | /* Serial */ |
| 239 | | |
| 240 | | static DEVICE_IMAGE_LOAD( bw2_serial ) |
| 241 | | { |
| 242 | | bw2_state *state = image->machine->driver_data; |
| 243 | | |
| 244 | | /* filename specified */ |
| 245 | | if (device_load_serial_device(image) == INIT_PASS) |
| 246 | | { |
| 247 | | /* setup transmit parameters */ |
| 248 | | serial_device_setup(image, 9600 >> input_port_read(image->machine, "BAUD"), 8, 1, SERIAL_PARITY_NONE); |
| 249 | | |
| 250 | | /* connect serial chip to serial device */ |
| 251 | | msm8251_connect_to_serial_device(state->msm8251, image); |
| 252 | | |
| 253 | | /* and start transmit */ |
| 254 | | serial_device_set_transmit_state(image, 1); |
| 255 | | |
| 256 | | return INIT_PASS; |
| 257 | | } |
| 258 | | |
| 259 | | return INIT_FAIL; |
| 260 | | } |
| 261 | | |
| 262 | | |
| 263 | 238 | /* Floppy */ |
| 264 | 239 | static WRITE_LINE_DEVICE_HANDLER( bw2_wd17xx_drq_w ) |
| 265 | 240 | { |
| r6724 | r6725 | |
| 805 | 780 | {FLOPPY_0, FLOPPY_1, NULL, NULL} |
| 806 | 781 | }; |
| 807 | 782 | |
| 783 | /* Serial */ |
| 784 | |
| 785 | static DEVICE_IMAGE_LOAD( bw2_serial ) |
| 786 | { |
| 787 | bw2_state *state = image->machine->driver_data; |
| 788 | |
| 789 | if (device_load_serial(image) == INIT_PASS) |
| 790 | { |
| 791 | serial_device_setup(image, 9600 >> input_port_read(image->machine, "BAUD"), 8, 1, SERIAL_PARITY_NONE); |
| 792 | |
| 793 | msm8251_connect_to_serial_device(state->msm8251, image); |
| 794 | |
| 795 | serial_device_set_transmit_state(image, 1); |
| 796 | |
| 797 | return INIT_PASS; |
| 798 | } |
| 799 | |
| 800 | return INIT_FAIL; |
| 801 | } |
| 802 | |
| 803 | |
| 804 | static DEVICE_GET_INFO( bw2_serial ) |
| 805 | { |
| 806 | switch ( state ) |
| 807 | { |
| 808 | case DEVINFO_FCT_IMAGE_LOAD: info->f = (genf *) DEVICE_IMAGE_LOAD_NAME( bw2_serial ); break; |
| 809 | case DEVINFO_STR_NAME: strcpy(info->s, "BW2 serial port"); break; |
| 810 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "txt"); break; |
| 811 | case DEVINFO_INT_IMAGE_READABLE: info->i = 1; break; |
| 812 | case DEVINFO_INT_IMAGE_WRITEABLE: info->i = 0; break; |
| 813 | case DEVINFO_INT_IMAGE_CREATABLE: info->i = 0; break; |
| 814 | default: DEVICE_GET_INFO_CALL(serial); break; |
| 815 | } |
| 816 | } |
| 817 | |
| 818 | #define BW2_SERIAL DEVICE_GET_INFO_NAME(bw2_serial) |
| 819 | |
| 820 | #define MDRV_BW2_SERIAL_ADD(_tag) \ |
| 821 | MDRV_DEVICE_ADD(_tag, BW2_SERIAL, 0) |
| 822 | |
| 823 | |
| 808 | 824 | static MACHINE_DRIVER_START( bw2 ) |
| 809 | 825 | MDRV_DRIVER_DATA(bw2_state) |
| 810 | 826 | |
| r6724 | r6725 | |
| 848 | 864 | MDRV_RAM_ADD("messram") |
| 849 | 865 | MDRV_RAM_DEFAULT_SIZE("64K") |
| 850 | 866 | MDRV_RAM_EXTRA_OPTIONS("96K,128K,160K,192K,224K") |
| 867 | |
| 868 | MDRV_BW2_SERIAL_ADD("serial") |
| 851 | 869 | MACHINE_DRIVER_END |
| 852 | 870 | |
| 853 | 871 | /*************************************************************************** |
| r6724 | r6725 | |
| 867 | 885 | ROM_LOAD("ramcard-10.bin", 0x0000, 0x4000, CRC(68cde1ba) SHA1(a776a27d64f7b857565594beb63aa2cd692dcf04)) |
| 868 | 886 | ROM_END |
| 869 | 887 | |
| 870 | | static void bw2_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 871 | | { |
| 872 | | /* serial */ |
| 873 | | switch(state) |
| 874 | | { |
| 875 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 876 | | case MESS_DEVINFO_INT_TYPE: |
| 877 | | info->i = IO_SERIAL; |
| 878 | | break; |
| 879 | | case MESS_DEVINFO_INT_READABLE: |
| 880 | | info->i = 1; |
| 881 | | break; |
| 882 | | case MESS_DEVINFO_INT_WRITEABLE: |
| 883 | | info->i = 0; |
| 884 | | break; |
| 885 | | case MESS_DEVINFO_INT_CREATABLE: |
| 886 | | info->i = 0; |
| 887 | | break; |
| 888 | | case MESS_DEVINFO_INT_COUNT: |
| 889 | | info->i = 1; |
| 890 | | break; |
| 891 | | |
| 892 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 893 | | case MESS_DEVINFO_PTR_START: |
| 894 | | info->start = DEVICE_START_NAME(serial_device); |
| 895 | | break; |
| 896 | | case MESS_DEVINFO_PTR_LOAD: |
| 897 | | info->load = DEVICE_IMAGE_LOAD_NAME(bw2_serial); |
| 898 | | break; |
| 899 | | case MESS_DEVINFO_PTR_UNLOAD: |
| 900 | | info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); |
| 901 | | break; |
| 902 | | |
| 903 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 904 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: |
| 905 | | strcpy(info->s = device_temp_str(), "txt"); |
| 906 | | break; |
| 907 | | } |
| 908 | | } |
| 909 | | |
| 910 | | static SYSTEM_CONFIG_START( bw2 ) |
| 911 | | CONFIG_DEVICE( bw2_serial_getinfo ) |
| 912 | | SYSTEM_CONFIG_END |
| 913 | | |
| 914 | 888 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 915 | | COMP( 1985, bw2, 0, 0, bw2, bw2, bw2, bw2, "Bondwell", "BW 2", 0 ) |
| 889 | COMP( 1985, bw2, 0, 0, bw2, bw2, bw2, 0, "Bondwell", "BW 2", 0 ) |
src/mess/drivers/c64.c
| r6724 | r6725 | |
| 333 | 333 | |
| 334 | 334 | /* devices config */ |
| 335 | 335 | #include "includes/cbm.h" |
| 336 | | #include "includes/cbmdrive.h" |
| 337 | | #include "includes/vc1541.h" |
| 338 | 336 | #include "machine/cbmiec.h" |
| 339 | 337 | #include "machine/c1541.h" |
| 340 | 338 | |
| 341 | 339 | #include "includes/c64.h" |
| 342 | 340 | |
| 341 | #define VC1540_ROM( cpu ) \ |
| 342 | ROM_REGION( 0x10000, cpu, 0 ) \ |
| 343 | ROM_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11) ) \ |
| 344 | ROM_LOAD( "325303-01.ub3", 0xe000, 0x2000, CRC(10b39158) SHA1(56dfe79b26f50af4e83fd9604857756d196516b9) ) |
| 343 | 345 | |
| 346 | /* |
| 347 | rev. 01 - It is believed to be the first revision of the 1541 firmware. The service manual says that this ROM |
| 348 | is for North America and Japan only. |
| 349 | rev. 02 - Second version of the 1541 firmware. The service manual says that this ROM was not available in North |
| 350 | America (Japan only?). |
| 351 | rev. 03 - It is said to be the first version that is usable in Europe (in the service manual?). |
| 352 | rev. 05 - From an old-style 1541 with short board. |
| 353 | rev. 06AA - From an old-style 1541 with short board. |
| 354 | */ |
| 355 | #define VC1541_ROM( cpu ) \ |
| 356 | ROM_REGION( 0x10000, cpu, 0 ) \ |
| 357 | ROM_SYSTEM_BIOS( 0, "rev1", "VC-1541 rev. 01" ) \ |
| 358 | ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(1) ) \ |
| 359 | ROMX_LOAD( "901229-01.ub3", 0xe000, 0x2000, CRC(9a48d3f0) SHA1(7a1054c6156b51c25410caec0f609efb079d3a77), ROM_BIOS(1) ) \ |
| 360 | ROM_SYSTEM_BIOS( 1, "rev2", "VC-1541 rev. 02" ) \ |
| 361 | ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(2) ) \ |
| 362 | ROMX_LOAD( "901229-02.ub3", 0xe000, 0x2000, CRC(b29bab75) SHA1(91321142e226168b1139c30c83896933f317d000), ROM_BIOS(2) ) \ |
| 363 | ROM_SYSTEM_BIOS( 2, "rev3", "VC-1541 rev. 03" ) \ |
| 364 | ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(3) ) \ |
| 365 | ROMX_LOAD( "901229-03.ub3", 0xe000, 0x2000, CRC(9126e74a) SHA1(03d17bd745066f1ead801c5183ac1d3af7809744), ROM_BIOS(3) ) \ |
| 366 | ROM_SYSTEM_BIOS( 3, "rev5", "VC-1541 rev. 05" ) \ |
| 367 | ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(4) ) \ |
| 368 | ROMX_LOAD( "901229-05.ub3", 0xe000, 0x2000, CRC(361c9f37) SHA1(f5d60777440829e46dc91285e662ba072acd2d8b), ROM_BIOS(4) ) \ |
| 369 | ROM_SYSTEM_BIOS( 4, "rev6aa", "VC-1541 rev. 06AA" ) \ |
| 370 | ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(5) ) \ |
| 371 | ROMX_LOAD( "901229-06aa.ub3", 0xe000, 0x2000, CRC(3a235039) SHA1(c7f94f4f51d6de4cdc21ecbb7e57bb209f0530c0), ROM_BIOS(5) ) \ |
| 372 | ROM_SYSTEM_BIOS( 5, "rev1c", "VC-1541C rev. 01" ) \ |
| 373 | ROMX_LOAD( "251968-01.ua2", 0xc000, 0x4000, CRC(1b3ca08d) SHA1(8e893932de8cce244117fcea4c46b7c39c6a7765), ROM_BIOS(6) ) \ |
| 374 | ROM_SYSTEM_BIOS( 6, "rev2c", "VC-1541C rev. 02" ) \ |
| 375 | ROMX_LOAD( "251968-02.ua2", 0xc000, 0x4000, CRC(2d862d20) SHA1(38a7a489c7bbc8661cf63476bf1eb07b38b1c704), ROM_BIOS(7) ) \ |
| 376 | ROM_SYSTEM_BIOS( 7, "rev3ii", "VC-1541-II" ) \ |
| 377 | ROMX_LOAD( "251968-03.u4", 0xc000, 0x4000, CRC(899fa3c5) SHA1(d3b78c3dbac55f5199f33f3fe0036439811f7fb3), ROM_BIOS(8) ) \ |
| 378 | ROM_SYSTEM_BIOS( 8, "reviin", "VC-1541-II (with Newtronics D500)" ) \ |
| 379 | ROMX_LOAD( "355640-01.u4", 0xc000, 0x4000, CRC(57224cde) SHA1(ab16f56989b27d89babe5f89c5a8cb3da71a82f0), ROM_BIOS(9) ) \ |
| 380 | |
| 381 | |
| 382 | |
| 383 | // currently not used (hacked drive firmware with more RAM) |
| 384 | #define DOLPHIN_ROM( cpu ) \ |
| 385 | ROM_REGION( 0x10000, cpu, 0 ) \ |
| 386 | ROM_LOAD( "c1541.rom", 0xa000, 0x6000, CRC(bd8e42b2) SHA1(d6aff55fc70876fa72be45c666b6f42b92689b4d) ) |
| 387 | |
| 388 | |
| 344 | 389 | /************************************* |
| 345 | 390 | * |
| 346 | 391 | * Main CPU memory handlers |