trunk/src/emu/cpu/tms0980/tms0980.c
| r242462 | r242463 | |
| 146 | 146 | // - main instructions PLA at the top half, to the right of the midline |
| 147 | 147 | // - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions |
| 148 | 148 | // - 16-term output PLA and segment PLA above the RAM (rotate opla 90 degrees) |
| 149 | | const device_type TMS0980 = &device_creator<tms0980_cpu_device>; // 28-pin DIP, 9 R pins, 5 K pins |
| 149 | const device_type TMS0980 = &device_creator<tms0980_cpu_device>; // 28-pin DIP, 9 R pins |
| 150 | 150 | |
| 151 | 151 | // TMS0970 is a stripped-down version of the TMS0980, itself acting more like a TMS1000 |
| 152 | 152 | // - RAM and ROM is exactly the same as TMS1000 |
| r242462 | r242463 | |
| 161 | 161 | // - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling |
| 162 | 162 | // - 48-term output PLA above the RAM (rotate opla 90 degrees) |
| 163 | 163 | const device_type TMS0270 = &device_creator<tms0270_cpu_device>; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) |
| 164 | | // TMS0260 is same? except opla is 32 instead of 48 terms |
| 164 | // TMS0260 is similar? except opla is 32 instead of 48 terms |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1xxx_cpu_device) |
| r242462 | r242463 | |
| 192 | 192 | |
| 193 | 193 | |
| 194 | 194 | tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 195 | | : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8, 11, 4, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) |
| 196 | | { |
| 197 | | } |
| 195 | : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) |
| 196 | { } |
| 198 | 197 | |
| 199 | | tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 200 | | : tms1xxx_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, k_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 201 | | { |
| 202 | | } |
| 198 | tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 199 | : tms1xxx_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 200 | { } |
| 203 | 201 | |
| 204 | 202 | tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 205 | | : tms1000_cpu_device(mconfig, TMS1070, "TMS1070", tag, owner, clock, 8, 11, 4, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1070", __FILE__) |
| 206 | | { |
| 207 | | } |
| 203 | : tms1000_cpu_device(mconfig, TMS1070, "TMS1070", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1070", __FILE__) |
| 204 | { } |
| 208 | 205 | |
| 209 | 206 | tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 210 | | : tms1000_cpu_device(mconfig, TMS1200, "TMS1200", tag, owner, clock, 8, 13, 4, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1200", __FILE__) |
| 211 | | { |
| 212 | | } |
| 207 | : tms1000_cpu_device(mconfig, TMS1200, "TMS1200", tag, owner, clock, 8, 13, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1200", __FILE__) |
| 208 | { } |
| 213 | 209 | |
| 214 | 210 | |
| 215 | 211 | tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 216 | | : tms1000_cpu_device(mconfig, TMS1100, "TMS1100", tag, owner, clock, 8, 11, 4, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1100", __FILE__) |
| 217 | | { |
| 218 | | } |
| 212 | : tms1000_cpu_device(mconfig, TMS1100, "TMS1100", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1100", __FILE__) |
| 213 | { } |
| 219 | 214 | |
| 220 | | tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 221 | | : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, k_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 222 | | { |
| 223 | | } |
| 215 | tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 216 | : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 217 | { } |
| 224 | 218 | |
| 225 | 219 | tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 226 | | : tms1100_cpu_device(mconfig, TMS1300, "TMS1200", tag, owner, clock, 8, 16, 4, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__) |
| 227 | | { |
| 228 | | } |
| 220 | : tms1100_cpu_device(mconfig, TMS1300, "TMS1200", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__) |
| 221 | { } |
| 229 | 222 | |
| 230 | 223 | |
| 231 | 224 | tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 232 | | : tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8, 11, 4, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__) |
| 233 | | { |
| 234 | | } |
| 225 | : tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__) |
| 226 | { } |
| 235 | 227 | |
| 236 | | tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 237 | | : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, k_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 238 | | { |
| 239 | | } |
| 228 | tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 229 | : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 230 | { } |
| 240 | 231 | |
| 241 | 232 | |
| 242 | 233 | tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 243 | | : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8, 9, 5, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__) |
| 244 | | { |
| 245 | | } |
| 234 | : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8, 9, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__) |
| 235 | { } |
| 246 | 236 | |
| 247 | | tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 248 | | : tms0970_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, k_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 249 | | { |
| 250 | | } |
| 237 | tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 238 | : tms0970_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) |
| 239 | { } |
| 251 | 240 | |
| 252 | 241 | |
| 253 | 242 | tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 254 | | : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16, 16, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0270", __FILE__) |
| 255 | | { |
| 256 | | } |
| 243 | : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16, 16, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0270", __FILE__) |
| 244 | , m_read_ctl(*this) |
| 245 | , m_write_ctl(*this) |
| 246 | , m_write_pdc(*this) |
| 247 | { } |
| 257 | 248 | |
| 258 | 249 | |
| 259 | 250 | |
| r242462 | r242463 | |
| 380 | 371 | |
| 381 | 372 | m_o_mask = (1 << m_o_pins) - 1; |
| 382 | 373 | m_r_mask = (1 << m_r_pins) - 1; |
| 383 | | m_k_mask = (1 << m_k_pins) - 1; |
| 384 | 374 | m_pc_mask = (1 << m_pc_bits) - 1; |
| 385 | 375 | m_x_mask = (1 << m_x_bits) - 1; |
| 386 | 376 | |
| r242462 | r242463 | |
| 479 | 469 | // common init |
| 480 | 470 | tms1xxx_cpu_device::device_start(); |
| 481 | 471 | |
| 472 | m_read_ctl.resolve_safe(0); |
| 473 | m_write_ctl.resolve_safe(); |
| 474 | m_write_pdc.resolve_safe(); |
| 475 | |
| 482 | 476 | // zerofill |
| 483 | | m_a_prev = 0; |
| 484 | 477 | m_r_prev = 0; |
| 478 | m_chipsel = 0; |
| 479 | m_ctl_dir = 0; |
| 480 | m_ctl_out = 0; |
| 481 | m_pdc = -1; // ! |
| 485 | 482 | |
| 486 | 483 | m_o_latch_low = 0; |
| 487 | 484 | m_o_latch = 0; |
| 488 | 485 | m_o_latch_prev = 0; |
| 489 | 486 | |
| 490 | 487 | // register for savestates |
| 491 | | save_item(NAME(m_a_prev)); |
| 492 | 488 | save_item(NAME(m_r_prev)); |
| 489 | save_item(NAME(m_chipsel)); |
| 490 | save_item(NAME(m_ctl_dir)); |
| 491 | save_item(NAME(m_ctl_out)); |
| 492 | save_item(NAME(m_pdc)); |
| 493 | 493 | |
| 494 | 494 | save_item(NAME(m_o_latch_low)); |
| 495 | 495 | save_item(NAME(m_o_latch)); |
| r242462 | r242463 | |
| 687 | 687 | // common reset |
| 688 | 688 | tms0980_cpu_device::device_reset(); |
| 689 | 689 | |
| 690 | | m_a_prev = m_a; |
| 691 | | m_r_prev = m_r; |
| 692 | | |
| 693 | 690 | m_o_latch_low = 0; |
| 694 | 691 | m_o_latch = 0; |
| 695 | 692 | m_o_latch_prev = 0; |
| r242462 | r242463 | |
| 777 | 774 | |
| 778 | 775 | void tms0270_cpu_device::dynamic_output() |
| 779 | 776 | { |
| 780 | | // TODO.. |
| 777 | // R15: filament on (handled in the driver) |
| 778 | // R14: N/C by default |
| 779 | // R13: power off, trigger on falling edge |
| 780 | if ((m_r_prev >> 13 & 1) && !(m_r >> 13 & 1)) |
| 781 | m_power_off(1); |
| 781 | 782 | |
| 782 | | m_a_prev = m_a; |
| 783 | | m_r_prev = m_r; |
| 784 | | m_o_latch_prev = m_o_latch; |
| 783 | // R11: TMS5100 CTL port direction (0=read from TMS5100, 1=write to TMS5100) |
| 784 | m_ctl_dir = m_r >> 11 & 1; |
| 785 | |
| 786 | // R12: chip select (off=display via OPLA, on=TMS5100 via ACC/CKB) |
| 787 | m_chipsel = m_r >> 12 & 1; |
| 788 | |
| 789 | if (m_chipsel) |
| 790 | { |
| 791 | // ACC via SEG B,C,D,G: TMS5100 CTL pins |
| 792 | if (m_ctl_dir && m_a != m_ctl_out) |
| 793 | { |
| 794 | m_ctl_out = m_a; |
| 795 | m_write_ctl(0, m_ctl_out, 0xff); |
| 796 | } |
| 797 | |
| 798 | // R10 via SEG E: TMS5100 PDC pin |
| 799 | if (m_pdc != (m_r >> 10 & 1)) |
| 800 | { |
| 801 | m_pdc = m_r >> 10 & 1; |
| 802 | m_write_pdc(m_pdc); |
| 803 | } |
| 804 | } |
| 805 | else |
| 806 | { |
| 807 | // standard O-output |
| 808 | if (m_o_latch != m_o_latch_prev) |
| 809 | { |
| 810 | write_o_output(m_o_latch); |
| 811 | m_o_latch_prev = m_o_latch; |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | // standard R-output |
| 816 | if (m_r != m_r_prev) |
| 817 | { |
| 818 | m_write_r(0, m_r & m_r_mask, 0xffff); |
| 819 | m_r_prev = m_r; |
| 820 | } |
| 785 | 821 | } |
| 786 | 822 | |
| 787 | 823 | |
| 788 | 824 | UINT8 tms1xxx_cpu_device::read_k_input() |
| 789 | 825 | { |
| 790 | | // K1,2,4,8,3 (KC test pin is not emulated) |
| 791 | | UINT8 k = m_read_k(0, 0xff) & m_k_mask; |
| 792 | | UINT8 k3 = (k & 0x10) ? 3: 0; // the K3 line that is on some chips, is simply K1|K2 |
| 826 | // K1,2,4,8 (KC test pin is not emulated) |
| 827 | return m_read_k(0, 0xff) & 0xf; |
| 828 | } |
| 829 | |
| 830 | UINT8 tms0980_cpu_device::read_k_input() |
| 831 | { |
| 832 | UINT8 k = m_read_k(0, 0xff) & 0x1f; |
| 833 | UINT8 k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2 |
| 793 | 834 | return (k & 0xf) | k3; |
| 794 | 835 | } |
| 795 | 836 | |
| 796 | 837 | UINT8 tms0270_cpu_device::read_k_input() |
| 797 | 838 | { |
| 798 | | // TODO.. |
| 799 | | |
| 800 | | return tms1xxx_cpu_device::read_k_input(); |
| 839 | // external: TMS5100 CTL port via SEG B,C,D,G |
| 840 | if (m_chipsel) |
| 841 | return (m_ctl_dir) ? m_ctl_out : m_read_ctl(0, 0xff) & 0xf; |
| 842 | |
| 843 | // standard K-input otherwise |
| 844 | UINT8 k = m_read_k(0, 0xff) & 0x1f; |
| 845 | return (k & 0x10) ? 0xf : k; // the TMS0270 KF line asserts all K-inputs |
| 801 | 846 | } |
| 802 | 847 | |
| 803 | 848 | |
| r242462 | r242463 | |
| 1015 | 1060 | |
| 1016 | 1061 | |
| 1017 | 1062 | // TMS0270-specific |
| 1063 | void tms0270_cpu_device::op_setr() |
| 1064 | { |
| 1065 | // same as default, but handle write to output in dynamic_output |
| 1066 | m_r = m_r | (1 << m_y); |
| 1067 | } |
| 1068 | |
| 1069 | void tms0270_cpu_device::op_rstr() |
| 1070 | { |
| 1071 | // same as default, but handle write to output in dynamic_output |
| 1072 | m_r = m_r & ~(1 << m_y); |
| 1073 | } |
| 1074 | |
| 1018 | 1075 | void tms0270_cpu_device::op_tdo() |
| 1019 | 1076 | { |
| 1020 | 1077 | // TDO: transfer data out |
| r242462 | r242463 | |
| 1026 | 1083 | // write to output is done in dynamic_output |
| 1027 | 1084 | } |
| 1028 | 1085 | |
| 1029 | | void tms0270_cpu_device::op_setr() |
| 1086 | void tms0270_cpu_device::op_off() |
| 1030 | 1087 | { |
| 1031 | | // same as default, but handle write to output in dynamic_output |
| 1032 | | m_r = m_r | (1 << m_y); |
| 1088 | // OFF was moved to R13, handled in dynamic_output |
| 1033 | 1089 | } |
| 1034 | 1090 | |
| 1035 | | void tms0270_cpu_device::op_rstr() |
| 1036 | | { |
| 1037 | | // same as default, but handle write to output in dynamic_output |
| 1038 | | m_r = m_r & ~(1 << m_y); |
| 1039 | | } |
| 1040 | 1091 | |
| 1041 | 1092 | |
| 1042 | | |
| 1043 | 1093 | //------------------------------------------------- |
| 1044 | 1094 | // execute_run |
| 1045 | 1095 | //------------------------------------------------- |
trunk/src/emu/cpu/tms0980/tms0980.h
| r242462 | r242463 | |
| 21 | 21 | #define MCFG_TMS1XXX_WRITE_O_CB(_devcb) \ |
| 22 | 22 | tms1xxx_cpu_device::set_write_o_callback(*device, DEVCB_##_devcb); |
| 23 | 23 | |
| 24 | // Use this if the output PLA is unknown: |
| 25 | // If the microinstructions (or other) PLA is unknown, try using one from another romset. |
| 26 | #define MCFG_TMS1XXX_OUTPUT_PLA(_pla) \ |
| 27 | tms1xxx_cpu_device::set_output_pla(*device, _pla); |
| 28 | |
| 24 | 29 | // R output pins (also called D on some chips) |
| 25 | 30 | #define MCFG_TMS1XXX_WRITE_R_CB(_devcb) \ |
| 26 | 31 | tms1xxx_cpu_device::set_write_r_callback(*device, DEVCB_##_devcb); |
| 27 | 32 | |
| 28 | | // OFF opcode on TMS0980 and up |
| 33 | // OFF request on TMS0980 and up |
| 29 | 34 | #define MCFG_TMS1XXX_POWER_OFF_CB(_devcb) \ |
| 30 | 35 | tms1xxx_cpu_device::set_power_off_callback(*device, DEVCB_##_devcb); |
| 31 | 36 | |
| 32 | | // Use this if the output PLA is unknown: |
| 33 | | // If the microinstructions (or other) PLA is unknown, try using one from another romset. |
| 34 | | #define MCFG_TMS1XXX_OUTPUT_PLA(_pla) \ |
| 35 | | tms1xxx_cpu_device::set_output_pla(*device, _pla); |
| 36 | 37 | |
| 38 | // TMS0270 was designed to interface with TMS5100, set it up at driver level |
| 39 | #define MCFG_TMS0270_READ_CTL_CB(_devcb) \ |
| 40 | tms0270_cpu_device::set_read_ctl_callback(*device, DEVCB_##_devcb); |
| 37 | 41 | |
| 42 | #define MCFG_TMS0270_WRITE_CTL_CB(_devcb) \ |
| 43 | tms0270_cpu_device::set_write_ctl_callback(*device, DEVCB_##_devcb); |
| 38 | 44 | |
| 45 | #define MCFG_TMS0270_WRITE_PDC_CB(_devcb) \ |
| 46 | tms0270_cpu_device::set_write_pdc_callback(*device, DEVCB_##_devcb); |
| 47 | |
| 48 | |
| 49 | |
| 39 | 50 | class tms1xxx_cpu_device : public cpu_device |
| 40 | 51 | { |
| 41 | 52 | public: |
| 42 | 53 | // construction/destruction |
| 43 | | tms1xxx_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock |
| 44 | | , UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits |
| 45 | | , int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 54 | tms1xxx_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) |
| 46 | 55 | : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) |
| 47 | 56 | , m_program_config("program", ENDIANNESS_BIG, byte_bits > 8 ? 16 : 8, prgwidth, 0, program) |
| 48 | 57 | , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) |
| r242462 | r242463 | |
| 52 | 61 | , m_spla(*this, "spla") |
| 53 | 62 | , m_o_pins(o_pins) |
| 54 | 63 | , m_r_pins(r_pins) |
| 55 | | , m_k_pins(k_pins) |
| 56 | 64 | , m_pc_bits(pc_bits) |
| 57 | 65 | , m_byte_bits(byte_bits) |
| 58 | 66 | , m_x_bits(x_bits) |
| r242462 | r242463 | |
| 164 | 172 | |
| 165 | 173 | UINT8 m_o_pins; // how many O pins |
| 166 | 174 | UINT8 m_r_pins; // how many R pins |
| 167 | | UINT8 m_k_pins; // how many K pins |
| 168 | 175 | UINT8 m_pc_bits; // how many program counter bits |
| 169 | 176 | UINT8 m_byte_bits; // how many bits per 'byte' |
| 170 | 177 | UINT8 m_x_bits; // how many X register bits |
| r242462 | r242463 | |
| 196 | 203 | { |
| 197 | 204 | public: |
| 198 | 205 | tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 199 | | tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 206 | tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 200 | 207 | |
| 201 | 208 | protected: |
| 202 | 209 | // overrides |
| r242462 | r242463 | |
| 225 | 232 | { |
| 226 | 233 | public: |
| 227 | 234 | tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 228 | | tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 235 | tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 229 | 236 | |
| 230 | 237 | protected: |
| 231 | 238 | // overrides |
| r242462 | r242463 | |
| 248 | 255 | { |
| 249 | 256 | public: |
| 250 | 257 | tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 251 | | tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 258 | tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 252 | 259 | |
| 253 | 260 | protected: |
| 254 | 261 | // overrides |
| r242462 | r242463 | |
| 266 | 273 | { |
| 267 | 274 | public: |
| 268 | 275 | tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 269 | | tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 k_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 276 | tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); |
| 270 | 277 | |
| 271 | 278 | protected: |
| 272 | 279 | // overrides |
| r242462 | r242463 | |
| 278 | 285 | virtual UINT32 disasm_max_opcode_bytes() const { return 2; } |
| 279 | 286 | virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); |
| 280 | 287 | |
| 288 | virtual UINT8 read_k_input(); |
| 281 | 289 | virtual void set_cki_bus(); |
| 282 | 290 | virtual void read_opcode(); |
| 283 | 291 | |
| r242462 | r242463 | |
| 291 | 299 | { |
| 292 | 300 | public: |
| 293 | 301 | tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 302 | |
| 303 | // static configuration helpers |
| 304 | template<class _Object> static devcb_base &set_read_ctl_callback(device_t &device, _Object object) { return downcast<tms0270_cpu_device &>(device).m_read_ctl.set_callback(object); } |
| 305 | template<class _Object> static devcb_base &set_write_ctl_callback(device_t &device, _Object object) { return downcast<tms0270_cpu_device &>(device).m_write_ctl.set_callback(object); } |
| 306 | template<class _Object> static devcb_base &set_write_pdc_callback(device_t &device, _Object object) { return downcast<tms0270_cpu_device &>(device).m_write_pdc.set_callback(object); } |
| 294 | 307 | |
| 295 | 308 | protected: |
| 296 | 309 | // overrides |
| r242462 | r242463 | |
| 307 | 320 | virtual void op_setr(); |
| 308 | 321 | virtual void op_rstr(); |
| 309 | 322 | virtual void op_tdo(); |
| 323 | virtual void op_off(); |
| 310 | 324 | |
| 311 | 325 | private: |
| 312 | | UINT8 m_a_prev; |
| 326 | // state specific to interface with TMS5100 |
| 313 | 327 | UINT16 m_r_prev; |
| 328 | UINT8 m_chipsel; |
| 329 | UINT8 m_ctl_out; |
| 330 | UINT8 m_ctl_dir; |
| 331 | int m_pdc; |
| 314 | 332 | |
| 315 | 333 | UINT8 m_o_latch_low; |
| 316 | 334 | UINT8 m_o_latch; |
| 317 | 335 | UINT8 m_o_latch_prev; |
| 336 | |
| 337 | devcb_read8 m_read_ctl; |
| 338 | devcb_write8 m_write_ctl; |
| 339 | devcb_write_line m_write_pdc; |
| 318 | 340 | }; |
| 319 | 341 | |
| 320 | 342 | |
trunk/src/mess/drivers/tispeak.c
| r242462 | r242463 | |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/tms0980/tms0980.h" |
| 11 | #include "sound/tms5110.h" |
| 11 | 12 | |
| 12 | 13 | #include "tispeak.lh" |
| 13 | 14 | |
| r242462 | r242463 | |
| 20 | 21 | public: |
| 21 | 22 | tispeak_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | 23 | : driver_device(mconfig, type, tag), |
| 23 | | m_maincpu(*this, "maincpu") |
| 24 | m_maincpu(*this, "maincpu"), |
| 25 | m_button_matrix(*this, "IN") |
| 24 | 26 | { } |
| 25 | 27 | |
| 26 | 28 | required_device<tms0270_cpu_device> m_maincpu; |
| 29 | required_ioport_array<9> m_button_matrix; |
| 27 | 30 | |
| 28 | 31 | UINT16 m_r; |
| 29 | 32 | UINT16 m_o; |
| 30 | 33 | |
| 34 | UINT16 m_leds_state[8]; |
| 35 | void leds_update(); |
| 36 | |
| 31 | 37 | DECLARE_READ8_MEMBER(read_k); |
| 32 | 38 | DECLARE_WRITE16_MEMBER(write_o); |
| 33 | 39 | DECLARE_WRITE16_MEMBER(write_r); |
| 40 | DECLARE_WRITE_LINE_MEMBER(auto_power_off); |
| 34 | 41 | |
| 35 | 42 | virtual void machine_start(); |
| 36 | 43 | }; |
| r242462 | r242463 | |
| 43 | 50 | |
| 44 | 51 | ***************************************************************************/ |
| 45 | 52 | |
| 53 | void tispeak_state::leds_update() |
| 54 | { |
| 55 | // update leds state |
| 56 | for (int i = 0; i < 8; i++) |
| 57 | if (m_r >> i & 1) |
| 58 | m_leds_state[i] = m_o & 0x3fff; |
| 59 | |
| 60 | // if filament (R15) is on, send to output |
| 61 | // if (m_r & 0x8000) // blank.. |
| 62 | for (int i = 0; i < 8; i++) |
| 63 | output_set_digit_value(i, m_leds_state[i]); |
| 64 | } |
| 65 | |
| 66 | |
| 46 | 67 | READ8_MEMBER(tispeak_state::read_k) |
| 47 | 68 | { |
| 48 | | return 0; |
| 69 | // the Vss row is always on |
| 70 | UINT8 k = m_button_matrix[8]->read(); |
| 71 | |
| 72 | // read selected button rows |
| 73 | for (int i = 0; i < 8; i++) |
| 74 | if (m_r >> i & 1) |
| 75 | k |= m_button_matrix[i]->read(); |
| 76 | |
| 77 | return k; |
| 49 | 78 | } |
| 50 | 79 | |
| 51 | 80 | WRITE16_MEMBER(tispeak_state::write_r) |
| 52 | 81 | { |
| 53 | 82 | m_r = data; |
| 83 | leds_update(); |
| 54 | 84 | } |
| 55 | 85 | |
| 56 | 86 | WRITE16_MEMBER(tispeak_state::write_o) |
| 57 | 87 | { |
| 58 | 88 | m_o = data; |
| 89 | leds_update(); |
| 59 | 90 | } |
| 60 | 91 | |
| 92 | WRITE_LINE_MEMBER(tispeak_state::auto_power_off) |
| 93 | { |
| 94 | //if (state) printf("X"); |
| 95 | } |
| 61 | 96 | |
| 62 | 97 | |
| 98 | |
| 63 | 99 | /*************************************************************************** |
| 64 | 100 | |
| 65 | 101 | Inputs |
| 66 | 102 | |
| 67 | 103 | ***************************************************************************/ |
| 68 | 104 | |
| 69 | | static INPUT_PORTS_START( tispeak ) |
| 105 | static INPUT_PORTS_START( snspell ) |
| 106 | PORT_START("IN.0") // R0 |
| 107 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 108 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 109 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 110 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 111 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 112 | |
| 113 | PORT_START("IN.1") // R1 |
| 114 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 115 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 116 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 117 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 118 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 119 | |
| 120 | PORT_START("IN.2") // R2 |
| 121 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 122 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 123 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 124 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 125 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 126 | |
| 127 | PORT_START("IN.3") // R3 |
| 128 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 129 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 130 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 131 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 132 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 133 | |
| 134 | PORT_START("IN.4") // R4 |
| 135 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 136 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 137 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 138 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 139 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 140 | |
| 141 | PORT_START("IN.5") // R5 |
| 142 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 143 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') |
| 144 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_NAME("Module") |
| 145 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Erase") |
| 146 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Enter") |
| 147 | |
| 148 | PORT_START("IN.6") // R6 |
| 149 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) // unused |
| 150 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) // unused |
| 151 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) // unused |
| 152 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) // unused |
| 153 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) // unused |
| 154 | |
| 155 | PORT_START("IN.7") // R7 |
| 156 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") |
| 157 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_NAME("Go") |
| 158 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_NAME("Replay") |
| 159 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Repeat") |
| 160 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("Clue") |
| 161 | |
| 162 | PORT_START("IN.8") // Vss! |
| 163 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_NAME("Mystery Word") |
| 164 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Secret Code") |
| 165 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Letter") |
| 166 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Say It") |
| 167 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Spell/On") |
| 70 | 168 | INPUT_PORTS_END |
| 71 | 169 | |
| 72 | 170 | |
| 171 | static INPUT_PORTS_START( snmath ) |
| 172 | PORT_START("IN.0") // R0 |
| 173 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) // 0 |
| 174 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) // 3 |
| 175 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) // 6 |
| 176 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) // 9 |
| 177 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) // . |
| 73 | 178 | |
| 179 | PORT_START("IN.1") // R1 |
| 180 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) // 1 |
| 181 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) // 4 |
| 182 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) // 7 |
| 183 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) |
| 184 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) |
| 185 | |
| 186 | PORT_START("IN.2") // R2 |
| 187 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) // 2 |
| 188 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) // 5 |
| 189 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) // 8 |
| 190 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) |
| 191 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) |
| 192 | |
| 193 | PORT_START("IN.3") // R3 |
| 194 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) |
| 195 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) // ent |
| 196 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) // go |
| 197 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) // off |
| 198 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) |
| 199 | |
| 200 | PORT_START("IN.4") // R4 |
| 201 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) // clr |
| 202 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) // < |
| 203 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) // > |
| 204 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) // rpt |
| 205 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) |
| 206 | |
| 207 | PORT_START("IN.5") // R5 |
| 208 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) // + |
| 209 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) // - |
| 210 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) // x |
| 211 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) // / |
| 212 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) // mix |
| 213 | |
| 214 | PORT_START("IN.6") // R6 |
| 215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) // num stum |
| 216 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) // write it |
| 217 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) // g/l |
| 218 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) // word prob |
| 219 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) // solve it/on |
| 220 | |
| 221 | PORT_START("IN.7") // R7 |
| 222 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) |
| 223 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) |
| 224 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) |
| 225 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) |
| 226 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) |
| 227 | |
| 228 | PORT_START("IN.8") // Vss! |
| 229 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) |
| 230 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) |
| 231 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) |
| 232 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) |
| 233 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) |
| 234 | INPUT_PORTS_END |
| 235 | |
| 236 | |
| 237 | |
| 74 | 238 | /*************************************************************************** |
| 75 | 239 | |
| 76 | 240 | Machine Config |
| r242462 | r242463 | |
| 79 | 243 | |
| 80 | 244 | void tispeak_state::machine_start() |
| 81 | 245 | { |
| 246 | memset(m_leds_state, 0, sizeof(m_leds_state)); |
| 82 | 247 | m_r = 0; |
| 83 | 248 | m_o = 0; |
| 84 | 249 | |
| 250 | save_item(NAME(m_leds_state)); |
| 85 | 251 | save_item(NAME(m_r)); |
| 86 | 252 | save_item(NAME(m_o)); |
| 87 | 253 | } |
| r242462 | r242463 | |
| 94 | 260 | MCFG_TMS1XXX_READ_K_CB(READ8(tispeak_state, read_k)) |
| 95 | 261 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, write_o)) |
| 96 | 262 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tispeak_state, write_r)) |
| 97 | | |
| 263 | MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(tispeak_state, auto_power_off)) |
| 264 | |
| 265 | MCFG_TMS0270_READ_CTL_CB(DEVREAD8("tms5100", tms5100_device, ctl_r)) |
| 266 | MCFG_TMS0270_WRITE_CTL_CB(DEVWRITE8("tms5100", tms5100_device, ctl_w)) |
| 267 | MCFG_TMS0270_WRITE_PDC_CB(DEVWRITELINE("tms5100", tms5100_device, pdc_w)) |
| 268 | |
| 98 | 269 | MCFG_DEFAULT_LAYOUT(layout_tispeak) |
| 99 | 270 | |
| 100 | 271 | /* no video! */ |
| 101 | 272 | |
| 102 | 273 | /* sound hardware */ |
| 103 | | // MCFG_SPEAKER_STANDARD_MONO("mono") |
| 274 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 275 | MCFG_SOUND_ADD("tms5100", TMS5100, XTAL_640kHz) |
| 276 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 104 | 277 | MACHINE_CONFIG_END |
| 105 | 278 | |
| 106 | 279 | |
| r242462 | r242463 | |
| 111 | 284 | |
| 112 | 285 | ***************************************************************************/ |
| 113 | 286 | |
| 287 | ROM_START( snspell ) |
| 288 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 289 | ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // from patent 4189779, may have errors |
| 290 | |
| 291 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 292 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| 293 | ROM_REGION( 2127, "maincpu:mpla", 0 ) |
| 294 | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(94333005) SHA1(1583444c73637d859632dd5186cd7e1a2588c78a) ) // taken from cd2708, need to verify if it's same as tmc0271 |
| 295 | ROM_REGION( 1246, "maincpu:opla", 0 ) |
| 296 | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(e70836e2) SHA1(70e7dcdf81ae2052874fb21c504fcc06b2649f9a) ) // " |
| 297 | |
| 298 | ROM_REGION( 0x8000, "tms5100", 0 ) |
| 299 | ROM_LOAD( "tmc0351.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) ) |
| 300 | ROM_LOAD( "tmc0352.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) ) |
| 301 | ROM_END |
| 302 | |
| 114 | 303 | ROM_START( snmath ) |
| 115 | 304 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 116 | 305 | ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) // from patent 4946391, verified with source code |
| r242462 | r242463 | |
| 118 | 307 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 119 | 308 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| 120 | 309 | ROM_REGION( 2127, "maincpu:mpla", 0 ) |
| 121 | | ROM_LOAD( "tmc0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(94333005) SHA1(1583444c73637d859632dd5186cd7e1a2588c78a) ) // taken from cd2708, need to verify if it's same as cd2704 |
| 310 | ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(94333005) SHA1(1583444c73637d859632dd5186cd7e1a2588c78a) ) // taken from cd2708, need to verify if it's same as cd2704 |
| 122 | 311 | ROM_REGION( 1246, "maincpu:opla", 0 ) |
| 123 | | ROM_LOAD( "tmc0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(e70836e2) SHA1(70e7dcdf81ae2052874fb21c504fcc06b2649f9a) ) // " |
| 312 | ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(e70836e2) SHA1(70e7dcdf81ae2052874fb21c504fcc06b2649f9a) ) // " |
| 313 | |
| 314 | ROM_REGION( 0x8000, "tms5100", 0 ) |
| 315 | ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) |
| 316 | ROM_LOAD( "cd2393.vsm", 0x4000, 0x4000, CRC(571d5b5a) SHA1(83284755d9b77267d320b5b87fdc39f352433715) ) |
| 124 | 317 | ROM_END |
| 125 | 318 | |
| 126 | 319 | |
| 127 | | COMP( 1980, snmath, 0, 0, tispeak, tispeak, driver_device, 0, "Texas Instruments", "Speak & Math (US, prototype)", GAME_NO_SOUND | GAME_NOT_WORKING ) |
| 320 | COMP( 1978, snspell, 0, 0, tispeak, snspell, driver_device, 0, "Texas Instruments", "Speak & Spell (US, prototype)", GAME_NOT_WORKING ) |
| 321 | COMP( 1980, snmath, 0, 0, tispeak, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, prototype)", GAME_NOT_WORKING ) |