Previous 15994 Revisions Next

r4686 Wednesday 13th May, 2009 at 08:06:47 UTC by Curt Coder
[KYOCERA] Fixed trsm200 keyboard, added cassette input/output.
[src/mess/drivers]kyocera.c

src/mess/drivers/kyocera.c
r4685r4686
1919     - Basically everything:
2020      * inputs (keyboards are different)
2121      * sound
22      * cassettes
2322      * optional ROM & RAM
2423      * additional hardware
2524      * Tandy Model 200 support (video emulation completely different, but also
r4685r4686
281280
282281   UINT8 data = 0xff;
283282
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");
294292
295293   return data;
296294}
r4685r4686
641639static INPUT_PORTS_START( trsm200 )
642640   PORT_START("KEY0")
643641   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')
645643   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
646644   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
647645   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
r4685r4686
653651   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
654652   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
655653   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')
657655   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
658656   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
659657   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
r4685r4686
666664   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
667665   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
668666   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')
670668   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
671669
672670   PORT_START("KEY3")
r4685r4686
677675   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
678676   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR(']')
679677   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')
681679
682680   PORT_START("KEY4")
683681   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
r4685r4686
972970   CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED
973971};
974972
973static 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
978static int kyocera_sid_r(const device_config *device)
979{
980   return cassette_input(cassette_device_image(device->machine)) > 0.0;
981}
982
983static 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
975991static MACHINE_DRIVER_START( kyo85 )
976992   MDRV_DRIVER_DATA(kyocera_state)
977993
r4685r4686
979995   MDRV_CPU_ADD(I8085_TAG, 8085A, 2400000)
980996   MDRV_CPU_PROGRAM_MAP(kyo85_mem, 0)
981997   MDRV_CPU_IO_MAP(kyo85_io, 0)
998   MDRV_CPU_CONFIG(kyocera_i8085_config)
982999
9831000   MDRV_MACHINE_START( kyo85 )
9841001   MDRV_MACHINE_RESET( kyo85 )
r4685r4686
10141031   MDRV_CPU_ADD(I8085_TAG, 8085A, XTAL_2_4576MHz)
10151032   MDRV_CPU_PROGRAM_MAP(trsm200_mem, 0)
10161033   MDRV_CPU_IO_MAP(trsm200_io, 0)
1034   MDRV_CPU_CONFIG(kyocera_i8085_config)
10171035
10181036   MDRV_MACHINE_START( trsm200 )
10191037   MDRV_MACHINE_RESET( trsm200 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team