Previous 15994 Revisions Next

r11583 Wednesday 18th May, 2011 at 10:52:21 UTC by Sandro Ronco
[VBC/ABC] Added LEDs and done a little cleanup. (no whatsnew)
[src/mess/drivers]fidelz80.c
[src/mess/layout]abc.lay

src/mess/layout/abc.lay
r11582r11583
55         <color red="0.0" green="0.6" blue="1.0" />
66      </led14seg>
77   </element>
8   <element name="led" defstate="0">
9      <rect state="1">
10         <color red="0.0" green="0.2" blue="0.2" />
11      </rect>
12      <rect state="0">
13         <color red="0.0" green="0.6" blue="1.0" />
14      </rect>
15   </element>
16
17   <element name="str_n">      <text string="N"/>         </element>
18   <element name="str_e">      <text string="E"/>         </element>
19   <element name="str_s">      <text string="S"/>         </element>
20   <element name="str_w">      <text string="W"/>         </element>
21   <element name="str_v1">      <text string="^V"/>         </element>
22   <element name="str_v2">      <text string="&lt;&gt;V"/>   </element>
23   <element name="str_db">      <text string="DB"/>         </element>
24   <element name="str_rd">      <text string="RD"/>         </element>
25
826   <element name="background">
927      <rect>
1028         <bounds left="0" top="0" right="1" bottom="1" />
r11582r11583
1937      </bezel>
2038
2139      <bezel name="digit1" element="digit">
22         <bounds x="10" y="5" width="50" height="80" />
40         <bounds x="10" y="20" width="50" height="80" />
2341      </bezel>
2442      <bezel name="digit2" element="digit">
25         <bounds x="70" y="5" width="50" height="80" />
43         <bounds x="70" y="20" width="50" height="80" />
2644      </bezel>
2745      <bezel name="digit3" element="digit">
28         <bounds x="130" y="5" width="50" height="80" />
46         <bounds x="130" y="20" width="50" height="80" />
2947      </bezel>
3048      <bezel name="digit4" element="digit">
31         <bounds x="190" y="5" width="50" height="80" />
49         <bounds x="190" y="20" width="50" height="80" />
3250      </bezel>
3351      <bezel name="digit5" element="digit">
34         <bounds x="250" y="5" width="50" height="80" />
52         <bounds x="250" y="20" width="50" height="80" />
3553      </bezel>
3654      <bezel name="digit6" element="digit">
37         <bounds x="310" y="5" width="50" height="80" />
55         <bounds x="310" y="20" width="50" height="80" />
3856      </bezel>
3957      <bezel name="digit7" element="digit">
40         <bounds x="370" y="5" width="50" height="80" />
58         <bounds x="370" y="20" width="50" height="80" />
4159      </bezel>
4260      <bezel name="digit8" element="digit">
43         <bounds x="430" y="5" width="50" height="80" />
61         <bounds x="430" y="20" width="50" height="80" />
4462      </bezel>
63
64      <bezel name="led1" element="led">
65         <bounds x="35" y="5" width="10" height="10" />
66      </bezel>
67      <bezel name="led2" element="led">
68         <bounds x="95" y="5" width="10" height="10" />
69      </bezel>
70      <bezel name="led3" element="led">
71         <bounds x="155" y="5" width="10" height="10" />
72      </bezel>
73      <bezel name="led4" element="led">
74         <bounds x="215" y="5" width="10" height="10" />
75      </bezel>
76      <bezel name="led5" element="led">
77         <bounds x="275" y="5" width="10" height="10" />
78      </bezel>
79      <bezel name="led6" element="led">
80         <bounds x="335" y="5" width="10" height="10" />
81      </bezel>
82      <bezel name="led7" element="led">
83         <bounds x="395" y="5" width="10" height="10" />
84      </bezel>
85      <bezel name="led8" element="led">
86         <bounds x="455" y="5" width="10" height="10" />
87      </bezel>
88
89      <bezel name="led1_label" element="str_n">
90         <bounds x="35" y="5" width="10" height="10" />
91      </bezel>
92      <bezel name="led2_label" element="str_e">
93         <bounds x="95" y="5" width="10" height="10" />
94      </bezel>
95      <bezel name="led3_label" element="str_s">
96         <bounds x="155" y="5" width="10" height="10" />
97      </bezel>
98      <bezel name="led4_label" element="str_w">
99         <bounds x="215" y="5" width="10" height="10" />
100      </bezel>
101      <bezel name="led5_label" element="str_v1">
102         <bounds x="275" y="5" width="10" height="10" />
103      </bezel>
104      <bezel name="led6_label" element="str_v2">
105         <bounds x="335" y="5" width="10" height="10" />
106      </bezel>
107      <bezel name="led7_label" element="str_db">
108         <bounds x="395" y="5" width="10" height="10" />
109      </bezel>
110      <bezel name="led8_label" element="str_rd">
111         <bounds x="455" y="5" width="10" height="10" />
112      </bezel>
45113   </view>
46114</mamelayout>
src/mess/drivers/fidelz80.c
r11582r11583
279279The digits of the display are numbered left to right, 0 through 7 and are controlled
280280by the grids.  hi = grid on, hi = segment on.
281281
282A detailed description of the hardware can be found also in the patent 4,373,719.
283
282284******************************************************************************
283285
284286Sensory Chess Challenger champion (6502 based, needs its own driver .c file)
r11582r11583
845847
846848WRITE8_MEMBER(fidelz80_state::kp_matrix_w)
847849{
848   if (m_kp_matrix)
849   {
850      UINT16 out_data = BITSWAP16(m_digit_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8);
851      UINT16 out_digit = out_data & 0x3fff;
852      //UINT8 out_led = BIT(out_data, 15);
850   UINT16 out_data = BITSWAP16(m_digit_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8);
851   UINT16 out_digit = out_data & 0x3fff;
852   UINT8 out_led = BIT(out_data, 15) ? 0 : 1;
853853
854      beep_set_state(m_beep, BIT(out_data, 14));
855
856      // output the digit before update the matrix
857      switch (m_kp_matrix)
858      {
859         case 0x01:
860            output_set_digit_value(1, out_digit);
861            break;
862         case 0x02:
863            output_set_digit_value(2, out_digit);
864            break;
865         case 0x04:
866            output_set_digit_value(3, out_digit);
867            break;
868         case 0x08:
869            output_set_digit_value(4, out_digit);
870            break;
871         case 0x10:
872            output_set_digit_value(5, out_digit);
873            break;
874         case 0x20:
875            output_set_digit_value(6, out_digit);
876            break;
877         case 0x40:
878            output_set_digit_value(7, out_digit);
879            break;
880         case 0x80:
881            output_set_digit_value(8, out_digit);
882            break;
883      }
854   // output the digit before update the matrix
855   if (m_kp_matrix & 0x01)
856   {
857      output_set_digit_value(1, out_digit);
858      output_set_led_value(8, out_led);
884859   }
860   if (m_kp_matrix & 0x02)
861   {
862      output_set_digit_value(2, out_digit);
863      output_set_led_value(7, out_led);
864   }
865   if (m_kp_matrix & 0x04)
866   {
867      output_set_digit_value(3, out_digit);
868      output_set_led_value(6, out_led);
869   }
870   if (m_kp_matrix & 0x08)
871   {
872      output_set_digit_value(4, out_digit);
873      output_set_led_value(5, out_led);
874   }
875   if (m_kp_matrix & 0x10)
876   {
877      output_set_digit_value(5, out_digit);
878      output_set_led_value(4, out_led);
879   }
880   if (m_kp_matrix & 0x20)
881   {
882      output_set_digit_value(6, out_digit);
883      output_set_led_value(3, out_led);
884   }
885   if (m_kp_matrix & 0x40)
886   {
887      output_set_digit_value(7, out_digit);
888      output_set_led_value(2, out_led);
889   }
890   if (m_kp_matrix & 0x80)
891   {
892      output_set_digit_value(8, out_digit);
893      output_set_led_value(1, out_led);
894   }
885895
886   m_digit_data = 0;
887   memset(m_digit_line_status, 0, ARRAY_LENGTH(m_digit_line_status));
896   memset(m_digit_line_status, 0, sizeof(m_digit_line_status));
888897
889898   m_kp_matrix = data;
890899}
891900
892901READ8_MEMBER(fidelz80_state::exp_i8243_p2_r)
893902{
894   UINT8 data = 0;
903   UINT8 data = 0xff;
895904
896   switch (m_kp_matrix)
897   {
898      case 0x01:
899         data = input_port_read(machine(), "LINE1");
900         break;
901      case 0x02:
902         data = input_port_read(machine(), "LINE2");
903         break;
904      case 0x04:
905         data = input_port_read(machine(), "LINE3");
906         break;
907      case 0x08:
908         data = input_port_read(machine(), "LINE4");
909         break;
910      case 0x10:
911         data = input_port_read(machine(), "LINE5");
912         break;
913      case 0x20:
914         data = input_port_read(machine(), "LINE6");
915         break;
916      case 0x40:
917         data = input_port_read(machine(), "LINE7");
918         break;
919      case 0x80:
920         data = input_port_read(machine(), "LINE8");
921         break;
922      default:
923         data = 0xf0;
924   }
905   if (m_kp_matrix & 0x01)
906      data &= input_port_read(machine(), "LINE1");
907   if (m_kp_matrix & 0x02)
908      data &= input_port_read(machine(), "LINE2");
909   if (m_kp_matrix & 0x04)
910      data &= input_port_read(machine(), "LINE3");
911   if (m_kp_matrix & 0x08)
912      data &= input_port_read(machine(), "LINE4");
913   if (m_kp_matrix & 0x10)
914      data &= input_port_read(machine(), "LINE5");
915   if (m_kp_matrix & 0x20)
916      data &= input_port_read(machine(), "LINE6");
917   if (m_kp_matrix & 0x40)
918      data &= input_port_read(machine(), "LINE7");
919   if (m_kp_matrix & 0x80)
920      data &= input_port_read(machine(), "LINE8");
921
925922   return (m_i8243->i8243_p2_r(offset)&0x0f) | (data&0xf0);
926923}
927924
r11582r11583
938935
939936READ8_MEMBER(fidelz80_state::rand_r)
940937{
941   return space.machine().rand();
938   return machine().rand();
942939}
943940
944941/******************************************************************************
r11582r11583
949946{
950947   fidelz80_state *state = device->machine().driver_data<fidelz80_state>();
951948
952   if (state->m_kp_matrix)
953      switch (offset)
954      {
955         case 0:
956            if (state->m_digit_line_status[0] == 0)
957            {
958               state->m_digit_line_status[0] = 1;
959               state->m_digit_data = (state->m_digit_data&(~0x000f)) | ((data<<0)&0x000f);
960            }
961            break;
962         case 1:
963            if (state->m_digit_line_status[1] == 0)
964            {
965               state->m_digit_line_status[1] = 1;
966               state->m_digit_data = (state->m_digit_data&(~0x00f0)) | ((data<<4)&0x00f0);
967            }
968            break;
969         case 2:
970            if (state->m_digit_line_status[2] == 0)
971            {
972               state->m_digit_line_status[2] = 1;
973               state->m_digit_data = (state->m_digit_data&(~0x0f00)) | ((data<<8)&0x0f00);
974            }
975            break;
976         case 3:
977            if (state->m_digit_line_status[3] == 0)
978            {
979               state->m_digit_line_status[3] = 1;
980               state->m_digit_data = (state->m_digit_data&(~0xf000)) | ((data<<12)&0xf000);
981            }
982            break;
983      }
949   if (state->m_digit_line_status[offset])
950      return;
951
952   state->m_digit_line_status[offset&3] = 1;
953
954   switch (offset)
955   {
956   case 0:
957      state->m_digit_data = (state->m_digit_data&(~0x000f)) | ((data<<0)&0x000f);
958      break;
959   case 1:
960      state->m_digit_data = (state->m_digit_data&(~0x00f0)) | ((data<<4)&0x00f0);
961      break;
962   case 2:
963      state->m_digit_data = (state->m_digit_data&(~0x0f00)) | ((data<<8)&0x0f00);
964      break;
965   case 3:
966      state->m_digit_data = (state->m_digit_data&(~0xf000)) | ((data<<12)&0xf000);
967      break;
968   }
984969}
985970
986971/******************************************************************************
r11582r11583
10211006   m_kp_matrix = 0;
10221007   m_digit_data = 0;
10231008   m_led_data = 0;
1024   memset(m_digit_line_status, 0, ARRAY_LENGTH(m_digit_line_status));
1009   memset(m_digit_line_status, 0, sizeof(m_digit_line_status));
10251010}
10261011
10271012static TIMER_DEVICE_CALLBACK( nmi_timer )
r11582r11583
12501235      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
12511236
12521237   PORT_START("LINE2")
1253      PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED
1238      PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED
12541239      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
12551240      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
12561241      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("5") PORT_CODE(KEYCODE_5)
r11582r11583
12611246      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q)
12621247      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
12631248      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
1264      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_P)
1249      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_Z)
12651250
12661251   PORT_START("LINE4")
12671252      PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED
r11582r11583
12741259      PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED
12751260      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("EN") PORT_CODE(KEYCODE_E)
12761261      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("SC") PORT_CODE(KEYCODE_S)
1277      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PL") PORT_CODE(KEYCODE_P)
1262      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PL") PORT_CODE(KEYCODE_X)
12781263      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Spades") PORT_CODE(KEYCODE_1_PAD)
12791264
12801265   PORT_START("LINE6")
1281      PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED
1266      PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED) PORT_UNUSED
12821267      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_C)
12831268      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("DB") PORT_CODE(KEYCODE_D)
12841269      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("VL") PORT_CODE(KEYCODE_V)
r11582r11583
13801365
13811366   /* sound hardware */
13821367   MCFG_SPEAKER_STANDARD_MONO( "mono" )
1383   MCFG_SOUND_ADD( "beep", BEEP, 0 )
13841368   MCFG_SOUND_ADD("speech", S14001A, 25000) // around 25khz
13851369   MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 )
13861370MACHINE_CONFIG_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team