src/mess/formats/ti85_ser.c
| r11037 | r11038 | |
| 30 | 30 | TI85_SEND_SCREEN_REQUEST |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | //supported image formats |
| 34 | enum |
| 35 | { |
| 36 | TI_FILE_UNK, |
| 37 | TI_FILE_V1, //used for TI-85 and TI-86 image |
| 38 | TI_FILE_V2, //used for TI-82, TI-83 and TI-73 image |
| 39 | TI_FILE_V3 //used for TI-83+ and TI-84+ image |
| 40 | }; |
| 41 | |
| 33 | 42 | #define TI85_HEADER_SIZE 0x37 |
| 34 | 43 | |
| 35 | 44 | #define TI85_SEND_VARIABLES 1 |
| r11037 | r11038 | |
| 41 | 50 | #define TI85_PC_OK_PACKET_SIZE 4 |
| 42 | 51 | #define TI85_PC_END_PACKET_SIZE 4 |
| 43 | 52 | |
| 44 | | static const UINT8 ti85_pc_ok_packet[] = {0x05, 0x56, 0x00, 0x00}; |
| 45 | | static const UINT8 ti82_pc_ok_packet[] = {0x02, 0x56, 0x00, 0x00}; |
| 46 | | static const UINT8 ti86_pc_ok_packet[] = {0x06, 0x56, 0x00, 0x00}; |
| 47 | | static const UINT8 ti85_pc_continue_packet[] = {0x05, 0x09, 0x00, 0x00}; |
| 48 | | static const UINT8 ti82_pc_continue_packet[] = {0x02, 0x09, 0x00, 0x00}; |
| 49 | | static const UINT8 ti86_pc_continue_packet[] = {0x06, 0x09, 0x00, 0x00}; |
| 50 | | static const UINT8 ti85_pc_screen_request_packet[] = {0x05, 0x6d, 0x00, 0x00}; |
| 51 | | static const UINT8 ti85_pc_end_packet[] = {0x05, 0x92, 0x00, 0x00}; |
| 52 | | static const UINT8 ti82_pc_end_packet[] = {0x02, 0x92, 0x00, 0x00}; |
| 53 | | static const UINT8 ti86_pc_end_packet[] = {0x06, 0x92, 0x00, 0x00}; |
| 53 | //known tranfer ID |
| 54 | #define TI_TRANFER_ID_TI73 0x07 |
| 55 | #define TI_TRANFER_ID_TI82 0x02 |
| 56 | #define TI_TRANFER_ID_TI83 0x03 |
| 57 | #define TI_TRANFER_ID_TI83P 0x23 |
| 58 | #define TI_TRANFER_ID_TI85 0x05 |
| 59 | #define TI_TRANFER_ID_TI86 0x06 |
| 54 | 60 | |
| 61 | //packet type |
| 62 | #define TI_OK_PACKET 0x56 |
| 63 | #define TI_CONTINUE_PACKET 0x09 |
| 64 | #define TI_SCREEN_REQUEST_PACKET 0x6d |
| 65 | #define TI_END_PACKET 0x92 |
| 66 | |
| 67 | static const UINT8 ti73_file_signature[] = {0x2a, 0x2a, 0x54, 0x49, 0x37, 0x33, 0x2a, 0x2a, 0x1a, 0x0a, 0x00}; |
| 55 | 68 | static const UINT8 ti85_file_signature[] = {0x2a, 0x2a, 0x54, 0x49, 0x38, 0x35, 0x2a, 0x2a, 0x1a, 0x0c, 0x00}; |
| 56 | 69 | static const UINT8 ti82_file_signature[] = {0x2a, 0x2a, 0x54, 0x49, 0x38, 0x32, 0x2a, 0x2a, 0x1a, 0x0a, 0x00}; |
| 70 | static const UINT8 ti83_file_signature[] = {0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x2a, 0x2a, 0x1a, 0x0a, 0x00}; |
| 71 | static const UINT8 ti83p_file_signature[]= {0x2a, 0x2a, 0x54, 0x49, 0x38, 0x33, 0x46, 0x2a, 0x1a, 0x0a, 0x00}; |
| 57 | 72 | static const UINT8 ti86_file_signature[] = {0x2a, 0x2a, 0x54, 0x49, 0x38, 0x36, 0x2a, 0x2a, 0x1a, 0x0a, 0x00}; |
| 58 | 73 | |
| 59 | 74 | typedef struct { |
| r11037 | r11038 | |
| 87 | 102 | { |
| 88 | 103 | UINT8 status; |
| 89 | 104 | int transfer_type; |
| 105 | UINT8 image_type; |
| 106 | UINT8 send_id; /* ID used for PC to TI transfer */ |
| 107 | UINT8 receive_id; /* ID used for TI to PC transfer */ |
| 90 | 108 | UINT8 red_out; /* signal line from machine */ |
| 91 | 109 | UINT8 white_out; /* signal line from machine */ |
| 92 | 110 | UINT8 red_in; /* signal line to machine */ |
| r11037 | r11038 | |
| 116 | 134 | INLINE ti85serial_state *get_token(device_t *device) |
| 117 | 135 | { |
| 118 | 136 | assert(device != NULL); |
| 119 | | assert((device->type() == TI82SERIAL) || (device->type() == TI85SERIAL) || (device->type() == TI86SERIAL)); |
| 137 | assert((device->type() == TI82SERIAL) || |
| 138 | (device->type() == TI73SERIAL) || |
| 139 | (device->type() == TI83PSERIAL) || |
| 140 | (device->type() == TI85SERIAL) || |
| 141 | (device->type() == TI86SERIAL)); |
| 120 | 142 | return (ti85serial_state *) downcast<legacy_device_base *>(device)->token(); |
| 121 | 143 | } |
| 122 | 144 | |
| r11037 | r11038 | |
| 210 | 232 | |
| 211 | 233 | static void ti85_variables_read (device_t *device, const UINT8 * ti85_data, unsigned int ti85_data_size, ti85_entry * ti85_entries) |
| 212 | 234 | { |
| 235 | ti85serial_state *ti85serial = get_token( device ); |
| 213 | 236 | unsigned int pos, i=0; |
| 214 | 237 | |
| 215 | 238 | pos = TI85_HEADER_SIZE; |
| r11037 | r11038 | |
| 218 | 241 | ti85_entries[i].head_size = ti85_data[pos+0x00] + ti85_data[pos+0x01]*256; |
| 219 | 242 | ti85_entries[i].data_size = ti85_data[pos+0x02] + ti85_data[pos+0x03]*256; |
| 220 | 243 | ti85_entries[i].type = ti85_data[pos+0x04]; |
| 221 | | ti85_entries[i].name_size = (device->type() == TI82SERIAL) ? 8 : ti85_data[pos+0x05]; |
| 244 | ti85_entries[i].name_size = (ti85serial->image_type != TI_FILE_V1) ? 8 : ti85_data[pos+0x05]; |
| 222 | 245 | ti85_entries[i].offset = pos; |
| 223 | 246 | pos += ti85_entries[i].head_size+ti85_entries[i].data_size+4; |
| 224 | 247 | i++; |
| r11037 | r11038 | |
| 302 | 325 | } |
| 303 | 326 | |
| 304 | 327 | |
| 328 | static void ti85_append_head_to_stream (UINT8 transfer_id, UINT8 tranfer_type, UINT8* serial_data) |
| 329 | { |
| 330 | UINT8 tmp_data[4]; |
| 331 | |
| 332 | tmp_data[0] = transfer_id; |
| 333 | tmp_data[1] = tranfer_type; |
| 334 | tmp_data[2] = 0; |
| 335 | tmp_data[3] = 0; |
| 336 | |
| 337 | ti85_convert_data_to_stream(tmp_data, sizeof(tmp_data), serial_data); |
| 338 | } |
| 339 | |
| 340 | |
| 305 | 341 | static void ti85_convert_stream_to_data (const UINT8* serial_data, UINT32 size, UINT8* data) |
| 306 | 342 | { |
| 307 | 343 | UINT32 i; |
| r11037 | r11038 | |
| 330 | 366 | UINT8* temp_data_to_convert = NULL; |
| 331 | 367 | UINT16 checksum; |
| 332 | 368 | |
| 369 | //verify that the provided file is compatible with the model |
| 370 | if (device->type() == TI73SERIAL) |
| 371 | if (strncmp((char *) file_data, (char *) ti73_file_signature, 11)) |
| 372 | return 0; |
| 333 | 373 | if (device->type() == TI85SERIAL) |
| 334 | 374 | if (strncmp((char *) file_data, (char *) ti85_file_signature, 11)) |
| 335 | 375 | return 0; |
| 336 | 376 | if (device->type() == TI82SERIAL) |
| 337 | 377 | if (strncmp((char *) file_data, (char *) ti82_file_signature, 11)) |
| 338 | 378 | return 0; |
| 339 | | if (device->type() == TI86SERIAL) |
| 340 | | if (strncmp((char *) file_data, (char *) ti86_file_signature, 11)) |
| 379 | if (device->type() == TI83PSERIAL) //TI-83+ is compatible with TI-83 and TI-82 file |
| 380 | if (strncmp((char *) file_data, (char *) ti83p_file_signature, 10) && strncmp((char *) file_data, (char *) ti83_file_signature, 11) |
| 381 | && strncmp((char *) file_data, (char *) ti82_file_signature, 11)) |
| 341 | 382 | return 0; |
| 383 | if (device->type() == TI86SERIAL) //TI-86 is compatible with TI-85 file |
| 384 | if (strncmp((char *) file_data, (char *) ti86_file_signature, 11) && strncmp((char *) file_data, (char *) ti85_file_signature, 11)) |
| 385 | return 0; |
| 342 | 386 | |
| 387 | //identify the image |
| 388 | if (!strncmp((char *) file_data, (char *) ti73_file_signature, 11)) |
| 389 | { |
| 390 | ti85serial->send_id = TI_TRANFER_ID_TI73; |
| 391 | ti85serial->image_type = TI_FILE_V2; |
| 392 | } |
| 393 | else if (!strncmp((char *) file_data, (char *) ti85_file_signature, 11)) |
| 394 | { |
| 395 | ti85serial->send_id = TI_TRANFER_ID_TI85; |
| 396 | ti85serial->image_type = TI_FILE_V1; |
| 397 | } |
| 398 | else if (!strncmp((char *) file_data, (char *) ti82_file_signature, 11)) |
| 399 | { |
| 400 | ti85serial->send_id = TI_TRANFER_ID_TI82; |
| 401 | ti85serial->image_type = TI_FILE_V2; |
| 402 | } |
| 403 | else if (!strncmp((char *) file_data, (char *) ti83_file_signature, 11)) |
| 404 | { |
| 405 | ti85serial->send_id = TI_TRANFER_ID_TI83; |
| 406 | ti85serial->image_type = TI_FILE_V2; |
| 407 | } |
| 408 | else if (!strncmp((char *) file_data, (char *) ti83p_file_signature, 11)) |
| 409 | { |
| 410 | ti85serial->send_id = TI_TRANFER_ID_TI83P; |
| 411 | ti85serial->image_type = TI_FILE_V3; |
| 412 | } |
| 413 | else if (!strncmp((char *) file_data, (char *) ti86_file_signature, 11)) |
| 414 | { |
| 415 | ti85serial->send_id = TI_TRANFER_ID_TI86; |
| 416 | ti85serial->image_type = TI_FILE_V1; |
| 417 | } |
| 418 | |
| 419 | logerror("Image ID: 0x%02x, version: 0x%02x\n", ti85serial->send_id, ti85serial->image_type); |
| 420 | |
| 343 | 421 | /*Serial stream preparing*/ |
| 344 | 422 | serial_data->end = NULL; |
| 345 | 423 | |
| r11037 | r11038 | |
| 393 | 471 | return 0; |
| 394 | 472 | } |
| 395 | 473 | serial_data->variables[i].header_size = 0x0f*8; |
| 396 | | temp_data_to_convert[0] = 0x05; //PC sends |
| 474 | temp_data_to_convert[0] = ti85serial->send_id; //PC sends |
| 397 | 475 | temp_data_to_convert[1] = 0x06; //header |
| 398 | 476 | memcpy( temp_data_to_convert+0x02, file_data+0x37, 0x0b); |
| 399 | 477 | checksum = ti85_calculate_checksum(temp_data_to_convert+4, 0x09); |
| r11037 | r11038 | |
| 424 | 502 | return 0; |
| 425 | 503 | } |
| 426 | 504 | |
| 427 | | if (device->type() == TI85SERIAL || device->type() == TI86SERIAL) |
| 505 | if (ti85serial->image_type == TI_FILE_V1) |
| 428 | 506 | { |
| 429 | 507 | serial_data->variables[i].header_size = (10+ti85_entries[i].name_size)*8; |
| 430 | 508 | |
| 431 | | if (device->type() == TI85SERIAL) |
| 432 | | temp_data_to_convert[0] = 0x05; //PC to TI-85 |
| 433 | | if (device->type() == TI86SERIAL) |
| 434 | | temp_data_to_convert[0] = 0x06; //PC to TI-86 |
| 509 | temp_data_to_convert[0] = ti85serial->send_id; |
| 435 | 510 | temp_data_to_convert[1] = 0x06; //header |
| 436 | 511 | temp_data_to_convert[2] = (4+ti85_entries[i].name_size)&0x00ff; |
| 437 | 512 | temp_data_to_convert[3] = ((4+ti85_entries[i].name_size)&0xff00)>>8; |
| r11037 | r11038 | |
| 446 | 521 | ti85_convert_data_to_stream(temp_data_to_convert, 10+ti85_entries[i].name_size, serial_data->variables[i].header); |
| 447 | 522 | } |
| 448 | 523 | |
| 449 | | if (device->type() == TI82SERIAL) |
| 524 | if (ti85serial->image_type == TI_FILE_V2 || ti85serial->image_type == TI_FILE_V3) |
| 450 | 525 | { |
| 451 | 526 | serial_data->variables[i].header_size = (9+ti85_entries[i].name_size)*8; |
| 452 | 527 | |
| 453 | | temp_data_to_convert[0] = 0x02; //PC to TI-82 |
| 528 | temp_data_to_convert[0] = ti85serial->send_id; |
| 454 | 529 | temp_data_to_convert[1] = 0x06; //header |
| 455 | 530 | temp_data_to_convert[2] = (3+ti85_entries[i].name_size)&0x00ff; |
| 456 | 531 | temp_data_to_convert[3] = ((3+ti85_entries[i].name_size)&0xff00)>>8; |
| r11037 | r11038 | |
| 474 | 549 | free (ti85_entries); |
| 475 | 550 | return 0; |
| 476 | 551 | } |
| 477 | | if (device->type() == TI85SERIAL) |
| 478 | | ti85_convert_data_to_stream(ti85_pc_ok_packet, TI85_PC_OK_PACKET_SIZE, serial_data->variables[i].ok); |
| 479 | | if (device->type() == TI82SERIAL) |
| 480 | | ti85_convert_data_to_stream(ti82_pc_ok_packet, TI85_PC_OK_PACKET_SIZE, serial_data->variables[i].ok); |
| 481 | | if (device->type() == TI86SERIAL) |
| 482 | | ti85_convert_data_to_stream(ti86_pc_ok_packet, TI85_PC_OK_PACKET_SIZE, serial_data->variables[i].ok); |
| 552 | ti85_append_head_to_stream(ti85serial->send_id, TI_OK_PACKET, serial_data->variables[i].ok); |
| 483 | 553 | serial_data->variables[i].ok_size = TI85_PC_OK_PACKET_SIZE*8; |
| 484 | 554 | |
| 485 | 555 | /*Data packet*/ |
| r11037 | r11038 | |
| 498 | 568 | } |
| 499 | 569 | serial_data->variables[i].data_size = (6+ti85_entries[i].data_size)*8; |
| 500 | 570 | |
| 501 | | if (device->type() == TI85SERIAL) |
| 502 | | temp_data_to_convert[0] = 0x05; //PC to TI-85 |
| 503 | | if (device->type() == TI82SERIAL) |
| 504 | | temp_data_to_convert[0] = 0x02; //PC to TI-82 |
| 505 | | if (device->type() == TI86SERIAL) |
| 506 | | temp_data_to_convert[0] = 0x06; //PC to TI-86 |
| 571 | temp_data_to_convert[0] = ti85serial->send_id; |
| 507 | 572 | temp_data_to_convert[1] = 0x15; //data |
| 508 | 573 | temp_data_to_convert[2] = (ti85_entries[i].data_size)&0x00ff; |
| 509 | 574 | temp_data_to_convert[3] = ((ti85_entries[i].data_size)&0xff00)>>8; |
| 510 | 575 | |
| 511 | | UINT8 name_start = (device->type() == TI82SERIAL) ? 5 : 6; |
| 576 | UINT8 name_start = (ti85serial->image_type != TI_FILE_V1) ? 5 : 6; |
| 577 | |
| 578 | //TI-83+ files have two additional byte used for the file's version and flag |
| 579 | if (ti85serial->image_type == TI_FILE_V3) |
| 580 | name_start += 2; |
| 581 | |
| 512 | 582 | if (file_data[0x3b]==backup_id) |
| 513 | 583 | memcpy(temp_data_to_convert+4, file_data+ti85_entries[i].offset, ti85_entries[i].data_size); |
| 514 | 584 | else |
| r11037 | r11038 | |
| 529 | 599 | free (ti85_entries); |
| 530 | 600 | return 0; |
| 531 | 601 | } |
| 532 | | if (device->type() == TI85SERIAL) |
| 533 | | ti85_convert_data_to_stream(ti85_pc_end_packet, TI85_PC_END_PACKET_SIZE, serial_data->end); |
| 534 | | if (device->type() == TI82SERIAL) |
| 535 | | ti85_convert_data_to_stream(ti82_pc_end_packet, TI85_PC_END_PACKET_SIZE, serial_data->end); |
| 536 | | if (device->type() == TI86SERIAL) |
| 537 | | ti85_convert_data_to_stream(ti86_pc_end_packet, TI85_PC_END_PACKET_SIZE, serial_data->end); |
| 602 | ti85_append_head_to_stream(ti85serial->send_id, TI_END_PACKET, serial_data->end); |
| 538 | 603 | serial_data->end_size = TI85_PC_END_PACKET_SIZE*8; |
| 539 | 604 | |
| 540 | 605 | free (ti85_entries); |
| r11037 | r11038 | |
| 798 | 863 | ti85serial->status = TI85_SEND_STOP; |
| 799 | 864 | return; |
| 800 | 865 | } |
| 801 | | ti85_convert_data_to_stream (ti85_pc_ok_packet, 4, ti85serial->receive_buffer); |
| 802 | | ti85_convert_data_to_stream (ti85_pc_continue_packet, 4, ti85serial->receive_buffer+4*8); |
| 866 | ti85_append_head_to_stream(ti85serial->receive_id, TI_OK_PACKET, ti85serial->receive_buffer); |
| 867 | ti85_append_head_to_stream(ti85serial->receive_id, TI_CONTINUE_PACKET, ti85serial->receive_buffer+4*8); |
| 803 | 868 | ti85serial->status = TI85_SEND_OK_1; |
| 804 | 869 | } |
| 805 | 870 | break; |
| r11037 | r11038 | |
| 849 | 914 | ti85serial->status = TI85_SEND_STOP; |
| 850 | 915 | return; |
| 851 | 916 | } |
| 852 | | ti85_convert_data_to_stream (ti85_pc_ok_packet, 4, ti85serial->receive_buffer); |
| 917 | ti85_append_head_to_stream(ti85serial->receive_id, TI_OK_PACKET, ti85serial->receive_buffer); |
| 853 | 918 | ti85serial->status = TI85_SEND_OK_2; |
| 854 | 919 | } |
| 855 | 920 | break; |
| r11037 | r11038 | |
| 917 | 982 | ti85serial->status = TI85_SEND_STOP; |
| 918 | 983 | return; |
| 919 | 984 | } |
| 920 | | ti85_convert_data_to_stream (ti85_pc_ok_packet, 4, ti85serial->receive_buffer); |
| 985 | ti85_append_head_to_stream(ti85serial->receive_id, TI_OK_PACKET, ti85serial->receive_buffer); |
| 921 | 986 | ti85serial->status = TI85_SEND_OK_3; |
| 922 | 987 | } |
| 923 | 988 | } |
| r11037 | r11038 | |
| 983 | 1048 | ti85serial->status = TI85_SEND_STOP; |
| 984 | 1049 | return; |
| 985 | 1050 | } |
| 986 | | ti85_convert_data_to_stream (ti85_pc_ok_packet, 4, ti85serial->receive_buffer); |
| 987 | | ti85_convert_data_to_stream (ti85_pc_continue_packet, 4, ti85serial->receive_buffer+4*8); |
| 1051 | ti85_append_head_to_stream(ti85serial->receive_id, TI_OK_PACKET, ti85serial->receive_buffer); |
| 1052 | ti85_append_head_to_stream(ti85serial->receive_id, TI_CONTINUE_PACKET, ti85serial->receive_buffer+4*8); |
| 988 | 1053 | ti85serial->status = TI85_SEND_OK_1; |
| 989 | 1054 | } |
| 990 | 1055 | break; |
| r11037 | r11038 | |
| 1045 | 1110 | ti85serial->status = TI85_SEND_STOP; |
| 1046 | 1111 | return; |
| 1047 | 1112 | } |
| 1048 | | ti85_convert_data_to_stream (ti85_pc_ok_packet, 4, ti85serial->receive_buffer); |
| 1113 | ti85_append_head_to_stream(ti85serial->receive_id, TI_OK_PACKET, ti85serial->receive_buffer); |
| 1049 | 1114 | ti85serial->status = TI85_SEND_OK_2; |
| 1050 | 1115 | } |
| 1051 | 1116 | break; |
| r11037 | r11038 | |
| 1103 | 1168 | ti85serial->status = TI85_SEND_STOP; |
| 1104 | 1169 | return; |
| 1105 | 1170 | } |
| 1106 | | ti85_convert_data_to_stream (ti85_pc_screen_request_packet, 4, ti85serial->receive_buffer); |
| 1171 | ti85_append_head_to_stream(ti85serial->receive_id, TI_SCREEN_REQUEST_PACKET, ti85serial->receive_buffer); |
| 1107 | 1172 | ti85serial->status = TI85_SEND_SCREEN_REQUEST; |
| 1108 | 1173 | break; |
| 1109 | 1174 | case TI85_SEND_SCREEN_REQUEST: |
| r11037 | r11038 | |
| 1178 | 1243 | ti85serial->status = TI85_SEND_STOP; |
| 1179 | 1244 | return; |
| 1180 | 1245 | } |
| 1181 | | ti85_convert_data_to_stream (ti85_pc_ok_packet, 4, ti85serial->receive_buffer); |
| 1246 | ti85_append_head_to_stream(ti85serial->receive_id, TI_OK_PACKET, ti85serial->receive_buffer); |
| 1182 | 1247 | ti85serial->status = TI85_SEND_OK; |
| 1183 | 1248 | } |
| 1184 | 1249 | break; |
| r11037 | r11038 | |
| 1333 | 1398 | ti85serial->backup_file_data = NULL; |
| 1334 | 1399 | ti85serial->backup_variable_number = 0; |
| 1335 | 1400 | ti85serial->status = TI85_SEND_STOP; |
| 1401 | |
| 1402 | //initialize the receive_id used for TI to PC transfer |
| 1403 | if (device->type() == TI73SERIAL) |
| 1404 | ti85serial->receive_id = TI_TRANFER_ID_TI73; |
| 1405 | else if (device->type() == TI85SERIAL) |
| 1406 | ti85serial->receive_id = TI_TRANFER_ID_TI85; |
| 1407 | else if (device->type() == TI82SERIAL) |
| 1408 | ti85serial->receive_id = TI_TRANFER_ID_TI82; |
| 1409 | else if (device->type() == TI83PSERIAL) |
| 1410 | ti85serial->receive_id = TI_TRANFER_ID_TI83P; |
| 1411 | else if (device->type() == TI86SERIAL) |
| 1412 | ti85serial->receive_id = TI_TRANFER_ID_TI86; |
| 1413 | |
| 1414 | ti85serial->send_id = ti85serial->receive_id; |
| 1336 | 1415 | } |
| 1337 | 1416 | |
| 1338 | 1417 | |
| r11037 | r11038 | |
| 1401 | 1480 | } |
| 1402 | 1481 | } |
| 1403 | 1482 | |
| 1483 | DEVICE_GET_INFO( ti73serial ) |
| 1484 | { |
| 1485 | switch ( state ) |
| 1486 | { |
| 1487 | case DEVINFO_STR_NAME: strcpy(info->s, "TI73 Serial"); break; |
| 1488 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "73p,73s,73i,73n,73c,73l,73k,73m,73v,73d,73e,73r,73g"); break; |
| 1489 | default: DEVICE_GET_INFO_CALL( ti85serial ); |
| 1490 | } |
| 1491 | } |
| 1404 | 1492 | |
| 1405 | 1493 | DEVICE_GET_INFO( ti82serial ) |
| 1406 | 1494 | { |
| r11037 | r11038 | |
| 1413 | 1501 | } |
| 1414 | 1502 | |
| 1415 | 1503 | |
| 1504 | DEVICE_GET_INFO( ti83pserial ) |
| 1505 | { |
| 1506 | switch ( state ) |
| 1507 | { |
| 1508 | case DEVINFO_STR_NAME: strcpy(info->s, "TI83 Plus Serial"); break; |
| 1509 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "82p,82s,82i,82n,82c,82l,82k,82m,82v,82d,82e,82r,82g," //for TI-82 compatibility |
| 1510 | "83p,83s,83i,83n,83c,83l,83k,83m,83v,83d,83e,83r,83g," //for TI-83 compatibility |
| 1511 | "8xc,8xd,8xg,8xi,8xl,8xm,8xn,8xp,8xs,8xt,8xv,8xw,8xy,8xz"); break; |
| 1512 | default: DEVICE_GET_INFO_CALL( ti85serial ); |
| 1513 | } |
| 1514 | } |
| 1515 | |
| 1416 | 1516 | DEVICE_GET_INFO( ti86serial ) |
| 1417 | 1517 | { |
| 1418 | 1518 | switch ( state ) |
| 1419 | 1519 | { |
| 1420 | 1520 | case DEVINFO_STR_NAME: strcpy(info->s, "TI86 Serial"); break; |
| 1421 | | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "86p,86s,86i,86n,86c,86l,86k,86m,86v,86d,86e,86r,86g"); break; |
| 1521 | case DEVINFO_STR_IMAGE_FILE_EXTENSIONS: strcpy(info->s, "85p,85s,85i,85n,85c,85l,85k,85m,85v,85d,85e,85r,85g,85b" //for TI-85 compatibility |
| 1522 | "86p,86s,86i,86n,86c,86l,86k,86m,86v,86d,86e,86r,86g"); break; |
| 1422 | 1523 | default: DEVICE_GET_INFO_CALL( ti85serial ); |
| 1423 | 1524 | } |
| 1424 | 1525 | } |
| 1425 | 1526 | |
| 1426 | 1527 | DEFINE_LEGACY_IMAGE_DEVICE(TI85SERIAL, ti85serial); |
| 1528 | DEFINE_LEGACY_IMAGE_DEVICE(TI73SERIAL, ti73serial); |
| 1427 | 1529 | DEFINE_LEGACY_IMAGE_DEVICE(TI82SERIAL, ti82serial); |
| 1530 | DEFINE_LEGACY_IMAGE_DEVICE(TI83PSERIAL, ti83pserial); |
| 1428 | 1531 | DEFINE_LEGACY_IMAGE_DEVICE(TI86SERIAL, ti86serial); |
src/mess/drivers/ti85.c
| r11037 | r11038 | |
| 251 | 251 | AM_RANGE(0x0014, 0x0014) AM_READ_PORT( "BATTERY" ) |
| 252 | 252 | ADDRESS_MAP_END |
| 253 | 253 | |
| 254 | static ADDRESS_MAP_START( ti73_io, AS_IO, 8) |
| 255 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 256 | AM_RANGE(0x0000, 0x0000) AM_READWRITE( ti73_port_0000_r, ti73_port_0000_w) |
| 257 | AM_RANGE(0x0001, 0x0001) AM_READWRITE( ti8x_keypad_r, ti8x_keypad_w ) |
| 258 | AM_RANGE(0x0002, 0x0002) AM_READWRITE( ti83p_port_0002_r, ti83p_port_0002_w ) |
| 259 | AM_RANGE(0x0003, 0x0003) AM_READWRITE( ti83_port_0003_r, ti83p_port_0003_w ) |
| 260 | AM_RANGE(0x0004, 0x0004) AM_READWRITE( ti83_port_0003_r, ti83p_port_0004_w ) |
| 261 | AM_RANGE(0x0006, 0x0006) AM_READWRITE( ti86_port_0005_r, ti83p_port_0006_w ) |
| 262 | AM_RANGE(0x0007, 0x0007) AM_READWRITE( ti86_port_0006_r, ti83p_port_0007_w ) |
| 263 | AM_RANGE(0x0010, 0x0010) AM_READWRITE( ti82_port_0010_r, ti83p_port_0010_w ) |
| 264 | AM_RANGE(0x0011, 0x0011) AM_READWRITE( ti82_port_0011_r, ti82_port_0011_w ) |
| 265 | ADDRESS_MAP_END |
| 266 | |
| 254 | 267 | static ADDRESS_MAP_START( ti83p_io, AS_IO, 8) |
| 255 | 268 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 256 | | AM_RANGE(0x0000, 0x0000) AM_READWRITE( ti83p_port_0000_r, ti83p_port_0000_w) //TODO |
| 269 | AM_RANGE(0x0000, 0x0000) AM_READWRITE( ti83p_port_0000_r, ti83p_port_0000_w) |
| 257 | 270 | AM_RANGE(0x0001, 0x0001) AM_READWRITE( ti8x_keypad_r, ti8x_keypad_w ) |
| 258 | 271 | AM_RANGE(0x0002, 0x0002) AM_READWRITE( ti83p_port_0002_r, ti83p_port_0002_w ) |
| 259 | 272 | AM_RANGE(0x0003, 0x0003) AM_READWRITE( ti83_port_0003_r, ti83p_port_0003_w ) |
| r11037 | r11038 | |
| 612 | 625 | |
| 613 | 626 | MCFG_DEVICE_REMOVE("nvram") |
| 614 | 627 | MCFG_NVRAM_HANDLER(ti83p) |
| 628 | |
| 629 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 630 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 631 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 632 | |
| 633 | MCFG_TI83PSERIAL_ADD( "ti83pserial" ) |
| 615 | 634 | MACHINE_CONFIG_END |
| 616 | 635 | |
| 636 | static MACHINE_CONFIG_DERIVED( ti73, ti83p ) |
| 637 | MCFG_CPU_MODIFY("maincpu") |
| 638 | MCFG_CPU_IO_MAP(ti73_io) |
| 639 | |
| 640 | MCFG_DEVICE_REMOVE("ti83pserial") |
| 641 | MCFG_TI73SERIAL_ADD( "ti73serial" ) |
| 642 | MACHINE_CONFIG_END |
| 643 | |
| 617 | 644 | static MACHINE_CONFIG_DERIVED( ti86d, ti86 ) |
| 618 | 645 | MCFG_SNAPSHOT_ADD("snapshot", ti8x, "sav", 0) |
| 619 | 646 | MCFG_TI86SERIAL_ADD( "ti85serial" ) |
| r11037 | r11038 | |
| 767 | 794 | COMP( 1994, ti81v2, ti81, 0, ti81v2, ti81, 0, "Texas Instruments", "TI-81 v2.0", GAME_NO_SOUND ) |
| 768 | 795 | COMP( 1996, ti83, 0, 0, ti83, ti83, 0, "Texas Instruments", "TI-83", GAME_NO_SOUND ) |
| 769 | 796 | COMP( 1997, ti86, 0, 0, ti86d, ti85, 0, "Texas Instruments", "TI-86", GAME_NO_SOUND ) |
| 770 | | COMP( 1998, ti73, 0, 0, ti83p, ti82, 0, "Texas Instruments", "TI-73", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 797 | COMP( 1998, ti73, 0, 0, ti73, ti82, 0, "Texas Instruments", "TI-73", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 771 | 798 | COMP( 1999, ti83p, 0, 0, ti83p, ti82, 0, "Texas Instruments", "TI-83 Plus", GAME_NO_SOUND ) |
| 772 | 799 | COMP( 2001, ti83pse, 0, 0, ti85, ti85, 0, "Texas Instruments", "TI-83 Plus Silver Edition", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 773 | 800 | //COMP( 2004, ti84p, 0, 0, ti85, ti85, 0, "Texas Instruments", "TI-84 Plus", GAME_NOT_WORKING | GAME_NO_SOUND) |