Previous 15994 Revisions Next

r2412 Wednesday 16th April, 2008 at 20:44:59 UTC by Stefano Priore
Converted to tagged inputs
[src/mess/drivers]mk2.c nc.c pcw.c pcw16.c saturn.c

src/mess/drivers/nc.c
r2411r2412
10211021      nc_card_battery_status &=~(1<<7);
10221022   }
10231023
1024   if (input_port_read_indexed(machine, 10) & 0x02)
1024   if (input_port_read(machine, "EXTRA") & 0x02)
10251025   {
10261026      /* card write enable */
10271027      nc_card_battery_status &=~(1<<6);
r2411r2412
14321432      nc_card_battery_status&=~(1<<7);
14331433   }
14341434
1435   if (input_port_read_indexed(machine, 10) & 0x02)
1435   if (input_port_read(machine, "EXTRA") & 0x02)
14361436   {
14371437      /* card write enable */
14381438      nc_card_battery_status &=~(1<<6);
src/mess/drivers/pcw16.c
r2411r2412
10381038{
10391039//  logerror("system status r: \n");
10401040
1041   return pcw16_system_status | (input_port_read_indexed(machine, 0) & 0x04);
1041   return pcw16_system_status | (input_port_read(machine, "EXTRA") & 0x04);
10421042}
10431043
10441044static READ8_HANDLER(pcw16_timer_interrupt_counter_r)
r2411r2412
12441244         new_inputs = 0;
12451245
12461246         /* Power switch is connected to Ring indicator */
1247         if (input_port_read_indexed(Machine, 0) & 0x040)
1247         if (input_port_read(Machine, "EXTRA") & 0x040)
12481248         {
12491249            new_inputs = UART8250_INPUTS_RING_INDICATOR;
12501250         }
r2411r2412
13791379}
13801380
13811381static INPUT_PORTS_START(pcw16)
1382   PORT_START
1382   PORT_START_TAG("EXTRA")
13831383   /* vblank */
13841384   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_VBLANK)
13851385   /* power switch - default is on */
src/mess/drivers/pcw.c
r2411r2412
247247/* PCW keyboard is mapped into memory */
248248static  READ8_HANDLER(pcw_keyboard_r)
249249{
250   return input_port_read_indexed(machine, offset);
250   char port[7];
251
252   sprintf(port, "LINE%d", offset);
253   return input_port_read(machine, port);
251254}
252255
253256
r2411r2412
368371/* from Jacob Nevins docs */
369372static int pcw_get_sys_status(void)
370373{
371   return pcw_interrupt_counter | (input_port_read_indexed(Machine, 16) & (0x040 | 0x010)) | pcw_system_status;
374   return pcw_interrupt_counter | (input_port_read(Machine, "EXTRA") & (0x040 | 0x010)) | pcw_system_status;
372375}
373376
374377static READ8_HANDLER(pcw_interrupt_counter_r)
r2411r2412
593596      case 0x0e0:
594597      {
595598         /* spectravideo joystick */
596         if (input_port_read_indexed(machine, 16) & 0x020)
599         if (input_port_read(machine, "EXTRA") & 0x020)
597600         {
598            return input_port_read_indexed(machine, 17);
601            return input_port_read(machine, "SPECTRAVIDEO");
599602         }
600603         else
601604         {
r2411r2412
607610      {
608611
609612         /* kempston joystick */
610         return input_port_read_indexed(machine, 18);
613         return input_port_read(machine, "KEMPSTON");
611614      }
612615
613616      case 0x0e1:
r2411r2412
796799   /* keyboard "ports". These are poked automatically into the PCW address space */
797800
798801   /* 0x03ff0 */
799   PORT_START
802   PORT_START_TAG("LINE0")
800803   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4)
801804   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K0") PORT_CODE(KEYCODE_0_PAD)
802805   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2)
r2411r2412
807810   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K2") PORT_CODE(KEYCODE_2_PAD)
808811
809812   /* 0x03ff1 */
810   PORT_START
813   PORT_START_TAG("LINE1")
811814   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("EXIT") PORT_CODE(KEYCODE_ESC)
812815   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("PTR") PORT_CODE(KEYCODE_PGUP)
813816   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CUT") PORT_CODE(KEYCODE_INSERT)
r2411r2412
818821   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K1") PORT_CODE(KEYCODE_1_PAD)
819822
820823   /* 0x03ff2 */
821   PORT_START
824   PORT_START_TAG("LINE2")
822825   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEL>") PORT_CODE(KEYCODE_DEL)
823826   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE)
824827   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER)
r2411r2412
830833   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+") PORT_CODE(KEYCODE_PLUS_PAD)
831834
832835   /* 0x03ff3 */
833   PORT_START
836   PORT_START_TAG("LINE3")
834837   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS)
835838   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS)
836839   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE)
r2411r2412
841844   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP)
842845
843846   /* 0x03ff4 */
844   PORT_START
847   PORT_START_TAG("LINE4")
845848   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)
846849   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
847850   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O)
r2411r2412
852855   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA)
853856
854857   /* 0x03ff5 */
855   PORT_START
858   PORT_START_TAG("LINE5")
856859   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
857860   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
858861   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
r2411r2412
863866   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE)
864867
865868   /* 0x03ff6 */
866   PORT_START
869   PORT_START_TAG("LINE6")
867870   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
868871   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5)
869872   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R)
r2411r2412
874877   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
875878
876879   /* 0x03ff7 */
877   PORT_START
880   PORT_START_TAG("LINE7")
878881   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
879882   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3)
880883   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
r2411r2412
885888   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
886889
887890   /* 0x03ff8 */
888   PORT_START
891   PORT_START_TAG("LINE8")
889892   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
890893   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
891894   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("STOP")
r2411r2412
896899   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
897900
898901   /* 0x03ff9 */
899   PORT_START
902   PORT_START_TAG("LINE9")
900903   PORT_BIT(0x07f,0x00, IPT_UNUSED)
901904   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DEL<") PORT_CODE(KEYCODE_BACKSPACE)
902905
903906   /* 0x03ffa */
904   PORT_START
907   PORT_START_TAG("LINE10")
905908   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_6_PAD)
906   PORT_BIT (0x02, 0x00, IPT_UNUSED)
907   PORT_BIT (0x04, 0x00, IPT_UNUSED)
909   PORT_BIT(0x02, 0x00, IPT_UNUSED)
910   PORT_BIT(0x04, 0x00, IPT_UNUSED)
908911   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS_PAD)
909912   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_8_PAD)
910913   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER_PAD)
r2411r2412
915918   /* at this point the following reflect the above key combinations but in a incomplete
916919    way. No details available at this time */
917920   /* 0x03ffb */
918   PORT_START
919   PORT_BIT ( 0xff, 0x00,    IPT_UNUSED )
921   PORT_START_TAG("LINE11")
922   PORT_BIT(0xff, 0x00,    IPT_UNUSED)
920923
921924   /* 0x03ffc */
922   PORT_START
923   PORT_BIT ( 0xff, 0x00,    IPT_UNUSED )
925   PORT_START_TAG("LINE12")
926   PORT_BIT(0xff, 0x00,    IPT_UNUSED)
924927
925928   /* 0x03ffd */
926   PORT_START
927   PORT_BIT ( 0x03f, 0x000, IPT_UNUSED)
929   PORT_START_TAG("LINE13")
930   PORT_BIT(0x03f, 0x000, IPT_UNUSED)
928931   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT LOCK") PORT_CODE(KEYCODE_CAPSLOCK)
929   PORT_BIT (0x080, 0x000, IPT_UNUSED)
932   PORT_BIT(0x080, 0x000, IPT_UNUSED)
930933
931934   /* 0x03ffe */
932   PORT_START
935   PORT_START_TAG("LINE14")
933936   PORT_BIT ( 0xff, 0x00,    IPT_UNUSED )
934937
935938   /* 0x03fff */
936   PORT_START
939   PORT_START_TAG("LINE15")
937940   PORT_BIT ( 0xff, 0x00,    IPT_UNUSED )
938941
939942   /* from here on are the pretend dipswitches for machine config etc */
940   PORT_START
943   PORT_START_TAG("EXTRA")
941944   /* vblank */
942945   PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_VBLANK)
943946   /* frame rate option */
r2411r2412
960963    0: 1 if S
961964    */
962965
963   PORT_START
966   PORT_START_TAG("SPECTRAVIDEO")
964967   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN)
965968   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_BUTTON1)
966969   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT)
967970   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP)
968971   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT)
969   PORT_BIT (0x020, 0x020, IPT_UNUSED)
970   PORT_BIT (0x040, 0x040, IPT_UNUSED)
971   PORT_BIT (0x080, 0x00, IPT_UNUSED)
972   PORT_BIT(0x020, 0x020, IPT_UNUSED)
973   PORT_BIT(0x040, 0x040, IPT_UNUSED)
974   PORT_BIT(0x080, 0x00, IPT_UNUSED)
972975
976   /* Kempston joystick */
977   PORT_START_TAG("KEMPSTON")
978   PORT_BIT( 0xff, 0x00,    IPT_UNUSED)
979
973980INPUT_PORTS_END
974981
975982
src/mess/drivers/mk2.c
r2411r2412
8484   int i;
8585
8686   for (i=0; i<4; i++)
87      output_set_digit_value(i, mk2_led[i]);
87   output_set_digit_value(i, mk2_led[i]);
8888   output_set_led_value(0, mk2_led[4]&8?1:0);
8989   output_set_led_value(1, mk2_led[4]&0x20?1:0);
9090   output_set_led_value(2, mk2_led[4]&0x10?1:0);
r2411r2412
165165      if (help&2) data&=~0x10; // B
166166      if (help&1) data&=~0x20; // A
167167#if 0
168      if (input_port_read_indexed(machine, 3)&1) data&=~0x40; //?
168      if (input_port_read(Machine, "???")&1) data&=~0x40; //?
169169#endif
170170      break;
171171   case 5:
172172#if 0
173      if (input_port_read_indexed(machine, 3)&2) data&=~0x1; //?
174      if (input_port_read_indexed(machine, 3)&4) data&=~0x2; //?
175      if (input_port_read_indexed(machine, 3)&8) data&=~0x4; //?
173      if (input_port_read(Machine, "???")&2) data&=~0x1; //?
174      if (input_port_read(Machine, "???")&4) data&=~0x2; //?
175      if (input_port_read(Machine, "???")&8) data&=~0x4; //?
176176#endif
177177      if (input_port_read(Machine, "EXTRA")&4) data&=~0x8; // Enter
178178      if (input_port_read(Machine, "EXTRA")&2) data&=~0x10; // Clear
src/mess/drivers/saturn.c
r2411r2412
20862086    smpc_ram[0x2d] = DectoBCD(systime.local_time.minute);
20872087    smpc_ram[0x2f] = DectoBCD(systime.local_time.second);
20882088    smpc_ram[0x31] = 0x00; //CTG1=0 CTG0=0 (correct??)
2089//  smpc_ram[0x33] = input_port_read_indexed(machine, 7);
2089//  smpc_ram[0x33] = input_port_read(machine, "???");
20902090    smpc_ram[0x5f] = 0x10;
20912091}
20922092

Previous 15994 Revisions Next


© 1998-2018 The MESS Team