trunk/src/emu/cpu/tms0980/tms0980.c
| r242375 | r242376 | |
| 159 | 159 | // - RAM, ROM, and main instructions PLA is exactly the same as TMS0980 |
| 160 | 160 | // - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling |
| 161 | 161 | // - 48-term output PLA above the RAM (rotate opla 90 degrees) |
| 162 | | const device_type TMC0270 = &device_creator<tmc0270_cpu_device>; // 40-pin DIP, 16 O pins, 8 R pins (the other R pins are internally hooked up to support more I/O) |
| 162 | const device_type TMC0270 = &device_creator<tmc0270_cpu_device>; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) |
| 163 | 163 | // TMC0260 is same? except opla is 32 instead of 48 terms |
| 164 | 164 | |
| 165 | 165 | |
| r242375 | r242376 | |
| 250 | 250 | |
| 251 | 251 | |
| 252 | 252 | tmc0270_cpu_device::tmc0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 253 | | : tms0980_cpu_device(mconfig, TMC0270, "TMC0270", tag, owner, clock, 16, 8, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tmc0270", __FILE__) |
| 253 | : tms0980_cpu_device(mconfig, TMC0270, "TMC0270", tag, owner, clock, 16, 16, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tmc0270", __FILE__) |
| 254 | 254 | { |
| 255 | 255 | } |
| 256 | 256 | |
| r242375 | r242376 | |
| 396 | 396 | m_cs = 0; |
| 397 | 397 | m_r = 0; |
| 398 | 398 | m_o = 0; |
| 399 | | m_o_latch = 0; |
| 400 | | m_o_latch_low = 0; |
| 399 | m_o_index = 0; |
| 401 | 400 | m_cki_bus = 0; |
| 402 | 401 | m_c4 = 0; |
| 403 | 402 | m_p = 0; |
| r242375 | r242376 | |
| 422 | 421 | m_micro = 0; |
| 423 | 422 | m_subcycle = 0; |
| 424 | 423 | |
| 425 | | m_a_prev = m_a; |
| 426 | | m_r_prev = m_r; |
| 427 | | m_o_latch_prev = m_o_latch; |
| 428 | | |
| 429 | 424 | // register for savestates |
| 430 | 425 | save_item(NAME(m_pc)); |
| 431 | 426 | save_item(NAME(m_sr)); |
| r242375 | r242376 | |
| 439 | 434 | save_item(NAME(m_cs)); |
| 440 | 435 | save_item(NAME(m_r)); |
| 441 | 436 | save_item(NAME(m_o)); |
| 442 | | save_item(NAME(m_o_latch)); |
| 443 | | save_item(NAME(m_o_latch_low)); |
| 437 | save_item(NAME(m_o_index)); |
| 444 | 438 | save_item(NAME(m_cki_bus)); |
| 445 | 439 | save_item(NAME(m_c4)); |
| 446 | 440 | save_item(NAME(m_p)); |
| r242375 | r242376 | |
| 465 | 459 | save_item(NAME(m_micro)); |
| 466 | 460 | save_item(NAME(m_subcycle)); |
| 467 | 461 | |
| 468 | | save_item(NAME(m_a_prev)); |
| 469 | | save_item(NAME(m_r_prev)); |
| 470 | | save_item(NAME(m_o_latch_prev)); |
| 471 | | |
| 472 | 462 | // register state for debugger |
| 473 | 463 | state_add(TMS0980_PC, "PC", m_pc ).formatstr("%02X"); |
| 474 | 464 | state_add(TMS0980_SR, "SR", m_sr ).formatstr("%01X"); |
| r242375 | r242376 | |
| 485 | 475 | m_icountptr = &m_icount; |
| 486 | 476 | } |
| 487 | 477 | |
| 478 | void tmc0270_cpu_device::device_start() |
| 479 | { |
| 480 | // common init |
| 481 | tms1xxx_cpu_device::device_start(); |
| 488 | 482 | |
| 483 | // zerofill |
| 484 | m_a_prev = 0; |
| 485 | m_r_prev = 0; |
| 489 | 486 | |
| 487 | m_o_latch_low = 0; |
| 488 | m_o_latch = 0; |
| 489 | m_o_latch_prev = 0; |
| 490 | |
| 491 | // register for savestates |
| 492 | save_item(NAME(m_a_prev)); |
| 493 | save_item(NAME(m_r_prev)); |
| 494 | |
| 495 | save_item(NAME(m_o_latch_low)); |
| 496 | save_item(NAME(m_o_latch)); |
| 497 | save_item(NAME(m_o_latch_prev)); |
| 498 | } |
| 499 | |
| 500 | |
| 501 | |
| 490 | 502 | //------------------------------------------------- |
| 491 | 503 | // device_reset - device-specific reset |
| 492 | 504 | //------------------------------------------------- |
| r242375 | r242376 | |
| 513 | 525 | // clear outputs |
| 514 | 526 | m_r = 0; |
| 515 | 527 | m_write_r(0, m_r & m_r_mask, 0xffff); |
| 516 | | m_o_latch_low = 0; |
| 517 | | m_o_latch = 0; |
| 518 | 528 | write_o_output(0); |
| 519 | 529 | m_write_r(0, m_r & m_r_mask, 0xffff); |
| 520 | 530 | m_power_off(0); |
| r242375 | r242376 | |
| 673 | 683 | m_micro_direct[op] = decode_micro(op); |
| 674 | 684 | } |
| 675 | 685 | |
| 686 | void tmc0270_cpu_device::device_reset() |
| 687 | { |
| 688 | // common reset |
| 689 | tms0980_cpu_device::device_reset(); |
| 676 | 690 | |
| 691 | m_a_prev = m_a; |
| 692 | m_r_prev = m_r; |
| 677 | 693 | |
| 694 | m_o_latch_low = 0; |
| 695 | m_o_latch = 0; |
| 696 | m_o_latch_prev = 0; |
| 697 | } |
| 698 | |
| 699 | |
| 700 | |
| 678 | 701 | //------------------------------------------------- |
| 679 | 702 | // program counter/opcode decode |
| 680 | 703 | //------------------------------------------------- |
| r242375 | r242376 | |
| 731 | 754 | // RSTR is on the mpla |
| 732 | 755 | if (m_micro & M_RSTR) |
| 733 | 756 | m_fixed |= F_RSTR; |
| 734 | | |
| 735 | | // TODO: M_UNK1 |
| 736 | 757 | } |
| 737 | 758 | |
| 738 | 759 | |
| r242375 | r242376 | |
| 741 | 762 | // i/o handling |
| 742 | 763 | //------------------------------------------------- |
| 743 | 764 | |
| 744 | | void tms1xxx_cpu_device::write_o_output(UINT8 data) |
| 765 | void tms1xxx_cpu_device::write_o_output(UINT8 index) |
| 745 | 766 | { |
| 767 | m_o_index = index; |
| 768 | |
| 746 | 769 | // a hardcoded table is supported if the output pla is unknown |
| 747 | | m_o = (c_output_pla == NULL) ? m_opla->read(data) : c_output_pla[data]; |
| 770 | m_o = (c_output_pla == NULL) ? m_opla->read(index) : c_output_pla[index]; |
| 748 | 771 | m_write_o(0, m_o & m_o_mask, 0xffff); |
| 749 | 772 | } |
| 750 | 773 | |
| 751 | | void tms0970_cpu_device::write_o_output(UINT8 data) |
| 774 | void tms0970_cpu_device::write_o_output(UINT8 index) |
| 752 | 775 | { |
| 753 | | m_o = m_spla->read(data); |
| 776 | m_o_index = index; |
| 777 | |
| 778 | m_o = m_spla->read(index); |
| 754 | 779 | m_write_o(0, m_o & m_o_mask, 0xffff); |
| 755 | 780 | } |
| 756 | 781 | |
| r242375 | r242376 | |
| 1003 | 1028 | else |
| 1004 | 1029 | m_o_latch = m_o_latch_low | (m_a << 4 & 0x30); |
| 1005 | 1030 | |
| 1006 | | // handled further in dynamic_output |
| 1031 | // write to output is done in dynamic_output |
| 1007 | 1032 | } |
| 1008 | 1033 | |
| 1034 | void tmc0270_cpu_device::op_setr() |
| 1035 | { |
| 1036 | // same as default, but handle write to output in dynamic_output |
| 1037 | m_r = m_r | (1 << m_y); |
| 1038 | } |
| 1009 | 1039 | |
| 1040 | void tmc0270_cpu_device::op_rstr() |
| 1041 | { |
| 1042 | // same as default, but handle write to output in dynamic_output |
| 1043 | m_r = m_r & ~(1 << m_y); |
| 1044 | } |
| 1010 | 1045 | |
| 1046 | |
| 1047 | |
| 1011 | 1048 | //------------------------------------------------- |
| 1012 | 1049 | // execute_run |
| 1013 | 1050 | //------------------------------------------------- |
| r242375 | r242376 | |
| 1070 | 1107 | } |
| 1071 | 1108 | |
| 1072 | 1109 | // execute: k input valid, read ram, clear alu inputs |
| 1110 | dynamic_output(); |
| 1073 | 1111 | set_cki_bus(); |
| 1074 | | dynamic_output(); |
| 1075 | 1112 | m_ram_in = m_data->read_byte(m_ram_address) & 0xf; |
| 1076 | 1113 | m_dam_in = m_data->read_byte(m_ram_address | (0x10 << (m_x_bits-1))) & 0xf; |
| 1077 | 1114 | m_ram_out = -1; |
trunk/src/mess/drivers/mathmagi.c
| r242375 | r242376 | |
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | APF Mathemagician |
| 6 | | * TMS1100 MP1030 |
| 6 | * TMS1100 MP1030 - MCU |
| 7 | * 2 x DS8870N - Hex LED Digit Driver |
| 8 | * 2 x DS8861N - MOS-to-LED 5-Segment Driver |
| 7 | 9 | |
| 10 | This is a tabletop educational calculator. It came with plastic overlays |
| 11 | for playing different kind of games. Refer to the manual on how to use it. |
| 12 | In short, to start from scratch, press [SEL]. By default the device is in |
| 13 | calculator teaching mode. If [SEL] is followed with 1-6 and then [NXT], |
| 14 | one of the games is started. |
| 15 | |
| 16 | 1) Number Machine |
| 17 | 2) Countin' On |
| 18 | 3) Walk The Plank |
| 19 | 4) Gooey Gumdrop |
| 20 | 5) Football |
| 21 | 6) Lunar Lander |
| 22 | |
| 23 | |
| 24 | TODO: |
| 25 | - some of the led symbols are probably wrong, output pla is unknown |
| 26 | |
| 8 | 27 | ***************************************************************************/ |
| 9 | 28 | |
| 10 | 29 | #include "emu.h" |
| r242375 | r242376 | |
| 26 | 45 | m_button_matrix(*this, "IN") |
| 27 | 46 | { } |
| 28 | 47 | |
| 29 | | required_device<cpu_device> m_maincpu; |
| 30 | | optional_ioport_array<11> m_button_matrix; |
| 48 | required_device<tms1xxx_cpu_device> m_maincpu; |
| 49 | required_ioport_array<6> m_button_matrix; |
| 31 | 50 | |
| 32 | 51 | UINT16 m_o; |
| 33 | 52 | UINT16 m_r; |
| r242375 | r242376 | |
| 48 | 67 | |
| 49 | 68 | READ8_MEMBER(mathmagi_state::read_k) |
| 50 | 69 | { |
| 51 | | printf("r"); |
| 52 | | |
| 53 | 70 | UINT8 k = 0; |
| 54 | 71 | |
| 55 | 72 | // read selected button rows |
| 56 | | for (int i = 0; i < 11; i++) |
| 57 | | if (m_r >> i & 1) |
| 73 | for (int i = 0; i < 6; i++) |
| 74 | { |
| 75 | const int ki[6] = { 3, 5, 6, 7, 9, 10 }; |
| 76 | if (m_r >> ki[i] & 1) |
| 58 | 77 | k |= m_button_matrix[i]->read(); |
| 78 | } |
| 59 | 79 | |
| 60 | 80 | return k; |
| 61 | 81 | } |
| 62 | 82 | |
| 63 | 83 | WRITE16_MEMBER(mathmagi_state::write_o) |
| 64 | 84 | { |
| 85 | // O1-O7: led segments A-G |
| 65 | 86 | m_o = data; |
| 66 | | |
| 67 | | printf("\n%02X ",m_o); |
| 68 | | for (int i=0;i<11;i++) printf("%d",m_r>>(10-i)&1); |
| 69 | 87 | } |
| 70 | 88 | |
| 71 | 89 | WRITE16_MEMBER(mathmagi_state::write_r) |
| 72 | 90 | { |
| 91 | // R3,R5-R7,R9,R10: input mux |
| 92 | // and outputs: |
| 93 | for (int i = 0; i < 11; i++) |
| 94 | { |
| 95 | if (data >> i & 1) |
| 96 | { |
| 97 | // R8: custom math symbols digit |
| 98 | // R9: custom equals digit |
| 99 | // R10: lamps |
| 100 | if (i >= 8) |
| 101 | for (int j = 0; j < 8; j++) |
| 102 | output_set_lamp_value(i*10 + j, m_o >> j & 1); |
| 103 | |
| 104 | // R0-R7: 7seg leds |
| 105 | else |
| 106 | output_set_digit_value(i, m_o >> 1 & 0x7f); |
| 107 | } |
| 108 | } |
| 109 | |
| 73 | 110 | m_r = data; |
| 74 | | |
| 75 | | printf("\n%02X ",m_o); |
| 76 | | for (int i=0;i<11;i++) printf("%d",m_r>>(10-i)&1); |
| 77 | 111 | } |
| 78 | 112 | |
| 79 | 113 | |
| r242375 | r242376 | |
| 94 | 128 | */ |
| 95 | 129 | |
| 96 | 130 | static INPUT_PORTS_START( mathmagi ) |
| 97 | | PORT_START("IN.0") // R0 |
| 98 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) |
| 99 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) |
| 100 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) |
| 101 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) |
| 131 | PORT_START("IN.0") // R3 |
| 132 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") |
| 133 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") |
| 134 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") |
| 135 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") |
| 102 | 136 | |
| 103 | | PORT_START("IN.1") // R1 |
| 104 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) |
| 105 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) |
| 106 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) |
| 107 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) |
| 137 | PORT_START("IN.1") // R5 |
| 138 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") |
| 139 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("_") // blank |
| 140 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("r") |
| 141 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") |
| 108 | 142 | |
| 109 | | PORT_START("IN.2") // R2 |
| 110 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) |
| 111 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) |
| 112 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) |
| 113 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) |
| 143 | PORT_START("IN.2") // R6 |
| 144 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") |
| 145 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") |
| 146 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") |
| 147 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) |
| 114 | 148 | |
| 115 | | PORT_START("IN.3") // R3 |
| 116 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) |
| 117 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) |
| 118 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) |
| 119 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) |
| 149 | PORT_START("IN.3") // R7 |
| 150 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("SEL") |
| 151 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("NXT") |
| 152 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("?") // check |
| 153 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") |
| 120 | 154 | |
| 121 | | PORT_START("IN.4") // R4 |
| 122 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) |
| 123 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) |
| 124 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) |
| 125 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) |
| 155 | PORT_START("IN.4") // R9 |
| 156 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") |
| 157 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") |
| 158 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") |
| 159 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) |
| 126 | 160 | |
| 127 | | PORT_START("IN.5") // R5 |
| 128 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) |
| 129 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) |
| 130 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) |
| 131 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) |
| 132 | | |
| 133 | | PORT_START("IN.6") // R6 |
| 134 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) |
| 135 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) |
| 136 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) |
| 137 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) |
| 138 | | |
| 139 | | PORT_START("IN.7") // R7 |
| 140 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) |
| 141 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) |
| 142 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) |
| 143 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) |
| 144 | | |
| 145 | | PORT_START("IN.8") // R8 |
| 146 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) |
| 147 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) |
| 148 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) |
| 149 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) |
| 150 | | |
| 151 | | PORT_START("IN.9") // R9 |
| 152 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) |
| 153 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) |
| 154 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) |
| 155 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) |
| 156 | | |
| 157 | | PORT_START("IN.10") // R10 |
| 158 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) // 1P/2P switch? |
| 159 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) |
| 160 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) |
| 161 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) |
| 161 | PORT_START("IN.5") // R10 |
| 162 | PORT_CONFNAME( 0x01, 0x00, "Players") |
| 163 | PORT_CONFSETTING( 0x00, "1" ) |
| 164 | PORT_CONFSETTING( 0x01, "2" ) |
| 165 | PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 162 | 166 | INPUT_PORTS_END |
| 163 | 167 | |
| 164 | 168 | |
| r242375 | r242376 | |
| 178 | 182 | save_item(NAME(m_r)); |
| 179 | 183 | } |
| 180 | 184 | |
| 185 | // LED segments A-G |
| 186 | enum |
| 187 | { |
| 188 | lA = 0x02, |
| 189 | lB = 0x04, |
| 190 | lC = 0x08, |
| 191 | lD = 0x10, |
| 192 | lE = 0x20, |
| 193 | lF = 0x40, |
| 194 | lG = 0x80 |
| 195 | }; |
| 181 | 196 | |
| 182 | 197 | static const UINT16 mathmagi_output_pla[0x20] = |
| 183 | 198 | { |
| 184 | 199 | /* O output PLA configuration currently unknown */ |
| 185 | | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
| 186 | | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, |
| 187 | | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, |
| 188 | | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f |
| 200 | lA+lB+lC+lD+lE+lF, // 0 |
| 201 | lB+lC, // 1 |
| 202 | lA+lB+lG+lE+lD, // 2 |
| 203 | lA+lB+lG+lC+lD, // 3 |
| 204 | lF+lB+lG+lC, // 4 |
| 205 | lA+lF+lG+lC+lD, // 5 |
| 206 | lA+lF+lG+lC+lD+lE, // 6 |
| 207 | lA+lB+lC, // 7 |
| 208 | lA+lB+lC+lD+lE+lF+lG, // 8 |
| 209 | lA+lB+lG+lF+lC+lD, // 9 |
| 210 | lA+lB+lG+lE, // question mark |
| 211 | lE+lG, // r |
| 212 | lD, // underscore? |
| 213 | lA+lF+lG+lE+lD, // E |
| 214 | lG, // - |
| 215 | 0, // empty |
| 216 | 0, // empty |
| 217 | lG, // lamp 4 or MATH - |
| 218 | lD, // lamp 3 |
| 219 | lF+lE+lD+lC+lG, // b |
| 220 | lB, // lamp 2 |
| 221 | lB+lG, // MATH + |
| 222 | lB+lC, // MATH mul |
| 223 | lF+lG+lB+lC+lD, // y |
| 224 | lA, // lamp 1 |
| 225 | lA+lG, // MATH div |
| 226 | lA+lD, // EQUALS |
| 227 | 0, // ? |
| 228 | 0, // ? |
| 229 | lE+lD+lC+lG, // o |
| 230 | 0, // ? |
| 231 | lA+lF+lE+lD+lC // G |
| 189 | 232 | }; |
| 190 | 233 | |
| 191 | 234 | |
| 192 | 235 | static MACHINE_CONFIG_START( mathmagi, mathmagi_state ) |
| 193 | 236 | |
| 194 | 237 | /* basic machine hardware */ |
| 195 | | // MCFG_CPU_ADD("maincpu", TMS1100, MASTER_CLOCK) |
| 196 | | MCFG_CPU_ADD("maincpu", TMS1100, 10000) // temp |
| 238 | MCFG_CPU_ADD("maincpu", TMS1100, MASTER_CLOCK) |
| 197 | 239 | MCFG_TMS1XXX_OUTPUT_PLA(mathmagi_output_pla) |
| 198 | 240 | MCFG_TMS1XXX_READ_K_CB(READ8(mathmagi_state, read_k)) |
| 199 | 241 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mathmagi_state, write_o)) |
| r242375 | r242376 | |
| 225 | 267 | ROM_END |
| 226 | 268 | |
| 227 | 269 | |
| 228 | | COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW | GAME_NOT_WORKING ) |
| 270 | COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
trunk/src/mess/layout/mathmagi.lay
| r242375 | r242376 | |
| 31 | 31 | <!-- build screen --> |
| 32 | 32 | |
| 33 | 33 | <view name="Internal Layout"> |
| 34 | | <bounds left="0" right="100" top="0" bottom="15" /> |
| 34 | <bounds left="0" right="100" top="0" bottom="25" /> |
| 35 | 35 | |
| 36 | 36 | <bezel name="digit0" element="digit"> |
| 37 | | <bounds x="0" y="0" width="10" height="15" /> |
| 37 | <bounds x="0" y="10" width="10" height="15" /> |
| 38 | 38 | </bezel> |
| 39 | 39 | <bezel name="digit1" element="digit"> |
| 40 | | <bounds x="10" y="0" width="10" height="15" /> |
| 40 | <bounds x="10" y="10" width="10" height="15" /> |
| 41 | 41 | </bezel> |
| 42 | 42 | |
| 43 | 43 | <bezel name="digit2" element="digit"> |
| 44 | | <bounds x="30" y="0" width="10" height="15" /> |
| 44 | <bounds x="30" y="10" width="10" height="15" /> |
| 45 | 45 | </bezel> |
| 46 | 46 | <bezel name="digit3" element="digit"> |
| 47 | | <bounds x="40" y="0" width="10" height="15" /> |
| 47 | <bounds x="40" y="10" width="10" height="15" /> |
| 48 | 48 | </bezel> |
| 49 | 49 | |
| 50 | 50 | <bezel name="digit4" element="digit"> |
| 51 | | <bounds x="60" y="0" width="10" height="15" /> |
| 51 | <bounds x="60" y="10" width="10" height="15" /> |
| 52 | 52 | </bezel> |
| 53 | 53 | <bezel name="digit5" element="digit"> |
| 54 | | <bounds x="70" y="0" width="10" height="15" /> |
| 54 | <bounds x="70" y="10" width="10" height="15" /> |
| 55 | 55 | </bezel> |
| 56 | 56 | <bezel name="digit6" element="digit"> |
| 57 | | <bounds x="80" y="0" width="10" height="15" /> |
| 57 | <bounds x="80" y="10" width="10" height="15" /> |
| 58 | 58 | </bezel> |
| 59 | 59 | <bezel name="digit7" element="digit"> |
| 60 | | <bounds x="90" y="0" width="10" height="15" /> |
| 60 | <bounds x="90" y="10" width="10" height="15" /> |
| 61 | 61 | </bezel> |
| 62 | 62 | |
| 63 | | <!-- math symbols custom digit --> |
| 63 | <!-- math symbols custom digit --> |
| 64 | 64 | |
| 65 | | <bezel name="lamp65" element="lamp_dash"><bounds x="21.5" y="7.25" width="7" height="0.5" /></bezel> |
| 65 | <bezel name="lamp87" element="lamp_dash"><bounds x="21.5" y="17.25" width="7" height="0.5" /></bezel> |
| 66 | 66 | |
| 67 | | <bezel name="lamp61" element="lamp_slash"><bounds x="24" y="-0.5" width="5" height="7.5" /></bezel> |
| 68 | | <bezel name="lamp64" element="lamp_slash"><bounds x="21" y="7" width="5" height="7.5" /></bezel> |
| 67 | <bezel name="lamp82" element="lamp_slash"><bounds x="24" y="9.5" width="5" height="7.5" /></bezel> |
| 68 | <bezel name="lamp82" element="lamp_slash"><bounds x="21" y="17" width="5" height="7.5" /></bezel> |
| 69 | 69 | |
| 70 | | <bezel name="lamp66" element="lamp_backslash"><bounds x="21" y="-0.5" width="5" height="7.5" /></bezel> |
| 71 | | <bezel name="lamp62" element="lamp_backslash"><bounds x="24" y="7" width="5" height="7.5" /></bezel> |
| 70 | <bezel name="lamp83" element="lamp_backslash"><bounds x="21" y="9.5" width="5" height="7.5" /></bezel> |
| 71 | <bezel name="lamp83" element="lamp_backslash"><bounds x="24" y="17" width="5" height="7.5" /></bezel> |
| 72 | 72 | |
| 73 | | <bezel name="lamp60" element="lamp_dot"><bounds x="24.25" y="2.25" width="1.5" height="1.5" /></bezel> |
| 74 | | <bezel name="lamp63" element="lamp_dot"><bounds x="24.25" y="11.75" width="1.5" height="1.5" /></bezel> |
| 73 | <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="12.25" width="1.5" height="1.5" /></bezel> |
| 74 | <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="21.75" width="1.5" height="1.5" /></bezel> |
| 75 | 75 | |
| 76 | | <!-- equals sign custom digit --> |
| 76 | <!-- equals sign custom digit --> |
| 77 | 77 | |
| 78 | <bezel name="lamp91" element="lamp_dash"><bounds x="51.5" y="14.5" width="7" height="0.5" /></bezel> |
| 79 | <bezel name="lamp94" element="lamp_dash"><bounds x="51.5" y="20.0" width="7" height="0.5" /></bezel> |
| 78 | 80 | |
| 81 | <!-- other lamps --> |
| 82 | |
| 83 | <bezel name="lamp101" element="lamp_dot"><bounds x="1" y="1" width="4" height="4" /></bezel> |
| 84 | <bezel name="lamp102" element="lamp_dot"><bounds x="26" y="1" width="4" height="4" /></bezel> |
| 85 | <bezel name="lamp104" element="lamp_dot"><bounds x="51" y="1" width="4" height="4" /></bezel> |
| 86 | <bezel name="lamp107" element="lamp_dot"><bounds x="76" y="1" width="4" height="4" /></bezel> |
| 87 | |
| 88 | |
| 79 | 89 | </view> |
| 80 | 90 | </mamelayout> |