src/mess/drivers/kyocera.c
| r4685 | r4686 | |
| 19 | 19 | - Basically everything: |
| 20 | 20 | * inputs (keyboards are different) |
| 21 | 21 | * sound |
| 22 | | * cassettes |
| 23 | 22 | * optional ROM & RAM |
| 24 | 23 | * additional hardware |
| 25 | 24 | * Tandy Model 200 support (video emulation completely different, but also |
| r4685 | r4686 | |
| 281 | 280 | |
| 282 | 281 | UINT8 data = 0xff; |
| 283 | 282 | |
| 284 | | if (BIT(state->keylatch, 0)) data &= input_port_read(space->machine, "KEY0"); |
| 285 | | if (BIT(state->keylatch, 1)) data &= input_port_read(space->machine, "KEY1"); |
| 286 | | if (BIT(state->keylatch, 2)) data &= input_port_read(space->machine, "KEY2"); |
| 287 | | if (BIT(state->keylatch, 3)) data &= input_port_read(space->machine, "KEY3"); |
| 288 | | if (BIT(state->keylatch, 4)) data &= input_port_read(space->machine, "KEY4"); |
| 289 | | if (BIT(state->keylatch, 5)) data &= input_port_read(space->machine, "KEY5"); |
| 290 | | if (BIT(state->keylatch, 6)) data &= input_port_read(space->machine, "KEY6"); |
| 291 | | if (BIT(state->keylatch, 7)) data &= input_port_read(space->machine, "KEY7"); |
| 292 | | if (BIT(state->keylatch, 8)) data &= input_port_read(space->machine, "KEY8"); |
| 293 | | if (BIT(state->keylatch, 9)) data &= input_port_read(space->machine, "KEY9"); |
| 283 | if (!BIT(state->keylatch, 0)) data &= input_port_read(space->machine, "KEY0"); |
| 284 | if (!BIT(state->keylatch, 1)) data &= input_port_read(space->machine, "KEY1"); |
| 285 | if (!BIT(state->keylatch, 2)) data &= input_port_read(space->machine, "KEY2"); |
| 286 | if (!BIT(state->keylatch, 3)) data &= input_port_read(space->machine, "KEY3"); |
| 287 | if (!BIT(state->keylatch, 4)) data &= input_port_read(space->machine, "KEY4"); |
| 288 | if (!BIT(state->keylatch, 5)) data &= input_port_read(space->machine, "KEY5"); |
| 289 | if (!BIT(state->keylatch, 6)) data &= input_port_read(space->machine, "KEY6"); |
| 290 | if (!BIT(state->keylatch, 7)) data &= input_port_read(space->machine, "KEY7"); |
| 291 | if (!BIT(state->keylatch, 8)) data &= input_port_read(space->machine, "KEY8"); |
| 294 | 292 | |
| 295 | 293 | return data; |
| 296 | 294 | } |
| r4685 | r4686 | |
| 641 | 639 | static INPUT_PORTS_START( trsm200 ) |
| 642 | 640 | PORT_START("KEY0") |
| 643 | 641 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 644 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 642 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 645 | 643 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 646 | 644 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 647 | 645 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| r4685 | r4686 | |
| 653 | 651 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 654 | 652 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 655 | 653 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 656 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 654 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 657 | 655 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 658 | 656 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 659 | 657 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| r4685 | r4686 | |
| 666 | 664 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 667 | 665 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 668 | 666 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 669 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 667 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 670 | 668 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 671 | 669 | |
| 672 | 670 | PORT_START("KEY3") |
| r4685 | r4686 | |
| 677 | 675 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 678 | 676 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR(']') |
| 679 | 677 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 680 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 678 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 681 | 679 | |
| 682 | 680 | PORT_START("KEY4") |
| 683 | 681 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| r4685 | r4686 | |
| 972 | 970 | CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED |
| 973 | 971 | }; |
| 974 | 972 | |
| 973 | static void kyocera_sod_w(const device_config *device, int state) |
| 974 | { |
| 975 | cassette_output(cassette_device_image(device->machine), state ? +1.0 : -1.0); |
| 976 | } |
| 977 | |
| 978 | static int kyocera_sid_r(const device_config *device) |
| 979 | { |
| 980 | return cassette_input(cassette_device_image(device->machine)) > 0.0; |
| 981 | } |
| 982 | |
| 983 | static const i8085_config kyocera_i8085_config = |
| 984 | { |
| 985 | NULL, /* INTE changed callback */ |
| 986 | NULL, /* STATUS changed callback */ |
| 987 | kyocera_sod_w, /* SOD changed callback (8085A only) */ |
| 988 | kyocera_sid_r /* SID changed callback (8085A only) */ |
| 989 | }; |
| 990 | |
| 975 | 991 | static MACHINE_DRIVER_START( kyo85 ) |
| 976 | 992 | MDRV_DRIVER_DATA(kyocera_state) |
| 977 | 993 | |
| r4685 | r4686 | |
| 979 | 995 | MDRV_CPU_ADD(I8085_TAG, 8085A, 2400000) |
| 980 | 996 | MDRV_CPU_PROGRAM_MAP(kyo85_mem, 0) |
| 981 | 997 | MDRV_CPU_IO_MAP(kyo85_io, 0) |
| 998 | MDRV_CPU_CONFIG(kyocera_i8085_config) |
| 982 | 999 | |
| 983 | 1000 | MDRV_MACHINE_START( kyo85 ) |
| 984 | 1001 | MDRV_MACHINE_RESET( kyo85 ) |
| r4685 | r4686 | |
| 1014 | 1031 | MDRV_CPU_ADD(I8085_TAG, 8085A, XTAL_2_4576MHz) |
| 1015 | 1032 | MDRV_CPU_PROGRAM_MAP(trsm200_mem, 0) |
| 1016 | 1033 | MDRV_CPU_IO_MAP(trsm200_io, 0) |
| 1034 | MDRV_CPU_CONFIG(kyocera_i8085_config) |
| 1017 | 1035 | |
| 1018 | 1036 | MDRV_MACHINE_START( trsm200 ) |
| 1019 | 1037 | MDRV_MACHINE_RESET( trsm200 ) |