Previous 15994 Revisions Next

r13772 Thursday 29th December, 2011 at 04:59:40 UTC by Robbbert
SLC1 - Fixed display & keyboard. Marked as Working [Robbbert]
[src/mess/drivers]cvicny.c slc1.c
[src/mess/layout]slc1.lay

src/mess/layout/slc1.lay
r13771r13772
11<?xml version="1.0"?>
22<mamelayout version="2">
3   <element name="digit" defstate="0">
3   <element name="g_led" defstate="0">
4      <disk>
5         <color red="0.0" green="0.75" blue="0.0" />
6      </disk>
7   </element>
8   <element name="g_digit" defstate="0">
49      <led7seg>
10         <color red="0.75" green="0.5" blue="0.0" />
11      </led7seg>
12   </element>
13   <element name="r_digit" defstate="0">
14      <led7seg>
515         <color red="0.75" green="0.0" blue="0.0" />
616      </led7seg>
717   </element>
r13771r13772
1525   <view name="Default Layout">
1626      <!-- Black background -->
1727      <bezel element="background">
18         <bounds left="97" top="95" right="428" bottom="195" />
28         <bounds left="64" top="95" right="453" bottom="195" />
1929      </bezel>
20      <bezel name="digit7" element="digit">
30      <bezel name="busy_led" element="g_led">
31         <bounds left="76" right="96" top="130" bottom="150" />
32      </bezel>
33
34      <bezel name="digit0" element="r_digit">
2135         <bounds left="107" top="105" right="155" bottom="185" />
2236      </bezel>
23      <bezel name="digit6" element="digit">
37      <bezel name="digit6" element="r_digit">
2438         <bounds left="155" top="105" right="203" bottom="185" />
2539      </bezel>
26      <bezel name="digit5" element="digit">
40      <bezel name="digit5" element="r_digit">
2741         <bounds left="203" top="105" right="251" bottom="185" />
2842      </bezel>
29      <bezel name="digit4" element="digit">
43      <bezel name="digit4" element="r_digit">
3044         <bounds left="251" top="105" right="299" bottom="185" />
3145      </bezel>
32      <bezel name="digit3" element="digit">
33         <bounds left="323" top="105" right="370" bottom="185" />
46      <bezel name="digit3" element="g_digit">
47         <bounds left="347" top="105" right="395" bottom="185" />
3448      </bezel>
35      <bezel name="digit2" element="digit">
36         <bounds left="371" top="105" right="418" bottom="185" />
49      <bezel name="digit1" element="g_digit">
50         <bounds left="395" top="105" right="443" bottom="185" />
3751      </bezel>
3852   </view>
3953</mamelayout>
src/mess/drivers/cvicny.c
r13771r13772
2525        Now press up-arrow to confirm the data has been entered.
2626
2727    ToDo:
28    - When ADR is pressed, sometimes a segment stays alight. Bug?
28        - When ADR is pressed, sometimes a segment stays alight. Bug?
2929        - Blank the display if digits aren't being refreshed
3030
3131****************************************************************************/
src/mess/drivers/slc1.c
r13771r13772
11/***************************************************************************
22
32011-07-16 SLC1 skeleton driver [Robbbert]
32011-JUL-16 SLC1 skeleton driver [Robbbert]
42011-DEC-29 Working [Robbbert]
45
56http://www.jens-mueller.org/jkcemu/slc1.html
67
78This computer is both a Z80 trainer, and a chess computer.
9        The keyboard is different between the two, so
10        we redefine it for your convenience.
811
12        There is no chess board attached. You supply your own
13        and you sync the pieces and the computer instructions.
14
15        When started, it is in Chess mode. Press 11111 to switch to
16        Trainer mode.
17
918Hardware
10    4 Kbytes ROM in the address range 0000-0FFF
11    1 Kbyte RAM in the address range 5000-53ff
12    6-digit 7-segment display
13    Busy LED
14    Keyboard with 12 keys
19        4 Kbytes ROM in the address range 0000-0FFF
20        1 Kbyte RAM in the address range 5000-53ff (user area starts at 5100)
21        6-digit 7-segment display
22        Busy LED
23        Keyboard with 12 keys
1524
16ToDo:
17- Everything
25Keys:
26        0-7 : hexadecimal numbers
27        Shift then 0-7 : Hexadecimal 8-F (decimal points will appear)
28        ADR : enter an address to work with. After the 4 digits are entered,
29              the data at that address shows, and you can modify the data.
30        + (inc) : Enter the data into memory, and increment the address by 1.
1831
32Pasting doesn't work, but if it did...
1933
34    Pasting:
35        0-7 : as is
36        8-F : H, then 0-7
37        + : ^
38        - : H^
39        ADR : -
2040
41    Test Paste:
42        [[[[[-510011^22^33^44^55^66^77^H8H8^H9H9^-5100
43        Now press up-arrow to confirm the data has been entered.
44
45
46
2147***************************************************************************/
2248#define ADDRESS_MAP_MODERN
2349
r13771r13772
4066
4167   required_device<cpu_device> m_maincpu;
4268   required_device<device_t> m_speaker;
43   emu_timer *m_kbd_timer;
4469   DECLARE_READ8_MEMBER( io_r );
4570   DECLARE_WRITE8_MEMBER( io_w );
46   UINT8 m_kbd;
47   UINT8 m_segment;
4871   UINT8 m_digit;
49   UINT8 m_kbd_row;
50   UINT8 m_refresh[6];
51   UINT8 slc1_convert_col_to_bin( UINT8 col, UINT8 row );
72   bool m_kbd_type;
5273   virtual void machine_reset();
5374   virtual void machine_start();
5475};
r13771r13772
6485
6586WRITE8_MEMBER( slc1_state::io_w )
6687{
67   UINT8 upper = offset >> 8;
68//  if (upper == 0x2f) return;
88   bool segonoff = BIT(data, 7);
89   bool busyled = BIT(data, 4);
90   data &= 15;
6991
92   if (data < 8)
93      m_digit = data;
94   else
95   if (data < 12)
96   {
97      speaker_level_w(m_speaker, BIT(data, 1) );
98      return;
99   }
100   else
101   if (offset == 0x2f07)
102      return;
70103
71   speaker_level_w(m_speaker, (upper == 0x29));
104   UINT8 segdata = output_get_digit_value(m_digit);
105   UINT8 segnum  = offset & 7;
106   UINT8 segmask = 1 << segnum;
72107
73//  output_set_led_value(0, BIT(data, 4));
108   if (segonoff)
109      segdata |= segmask;
110   else
111      segdata &= ~segmask;
74112
75   // This computer sets each segment, one at a time. */
113   output_set_digit_value(m_digit, segdata);
76114
77   if ((offset & 0xff) < 8)
78   {
79      static const UINT8 segments[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
80      UINT8 digit = data & 7;
81      UINT8 segment = segments[offset];
82      UINT8 segdata = output_get_digit_value(digit);
115   output_set_value("busyled", busyled);
83116
84      if (BIT(data, 7))
85         segdata |= segment;
86      else
87         segdata &= ~segment;
88
89      output_set_digit_value(digit, segdata);
90   }
117   if (m_digit == 3)
118      m_kbd_type = (segdata);
91119}
92120
93121
94
95122/***************************************************************************
96123
97124    Keyboard
r13771r13772
102129{
103130   UINT8 data = 0xff, upper = (offset >> 8) & 7;
104131
105   if (upper == 5) data &= input_port_read(machine(), "X0");
106   if (upper == 6) data &= input_port_read(machine(), "X1");
107   if (upper == 7) data &= input_port_read(machine(), "X2");
132   if (m_kbd_type)
133   { // Trainer
134      if (upper == 3)
135         data &= input_port_read(machine(), "Y0");
136      else
137      if (upper == 4)
138         data &= input_port_read(machine(), "Y1");
139      else
140      if (upper == 5)
141         data &= input_port_read(machine(), "Y2");
142   }
143   else
144   { // Chess
145      if (upper == 3)
146         data &= input_port_read(machine(), "X0");
147      else
148      if (upper == 4)
149         data &= input_port_read(machine(), "X1");
150      else
151      if (upper == 5)
152         data &= input_port_read(machine(), "X2");
153   }
154
108155   return data;
109156}
110157
r13771r13772
152199***************************************************************************/
153200
154201static INPUT_PORTS_START( slc1 )
202// Chess Keyboard
155203   PORT_START("X0")
156204   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
157   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 B D 4 T") PORT_CODE(KEYCODE_3)
158   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 A C 3 L") PORT_CODE(KEYCODE_2)
159   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 9 B 2 S") PORT_CODE(KEYCODE_1)
160   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 8 A 1 B") PORT_CODE(KEYCODE_0)
205   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D4 T") PORT_CODE(KEYCODE_4)
206   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3 L") PORT_CODE(KEYCODE_3)
207   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2 S") PORT_CODE(KEYCODE_2)
208   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A1 B") PORT_CODE(KEYCODE_1) PORT_CHAR('[')
161209
162210   PORT_START("X1")
163211   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
164   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 F H 8 GO") PORT_CODE(KEYCODE_7)
165   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 E G 7 BL") PORT_CODE(KEYCODE_6)
166   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 D F 6 K DEL") PORT_CODE(KEYCODE_5)
167   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 C E 5 D INS") PORT_CODE(KEYCODE_4)
212   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5 D") PORT_CODE(KEYCODE_5)
213   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F6 K") PORT_CODE(KEYCODE_6)
214   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G7")   PORT_CODE(KEYCODE_7)
215   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H8")   PORT_CODE(KEYCODE_8)
168216
169217   PORT_START("X2")
170218   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
171   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Seq C BG") PORT_CODE(KEYCODE_Q)
172   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+-1 A SS") PORT_CODE(KEYCODE_W)
173   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Fu St DP") PORT_CODE(KEYCODE_E)
174   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ADR Z BP") PORT_CODE(KEYCODE_R)
219   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C")    PORT_CODE(KEYCODE_C)
220   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A")    PORT_CODE(KEYCODE_A)
221   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("St")   PORT_CODE(KEYCODE_S)
222   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z")    PORT_CODE(KEYCODE_Z)
223
224// Trainer Keyboard
225   PORT_START("Y0")
226   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
227   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 B")  PORT_CODE(KEYCODE_3) PORT_CHAR('3')
228   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 A")  PORT_CODE(KEYCODE_2) PORT_CHAR('2')
229   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 9")  PORT_CODE(KEYCODE_1) PORT_CHAR('1')
230   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 8")  PORT_CODE(KEYCODE_0) PORT_CHAR('0')
231
232   PORT_START("Y1")
233   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
234   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 C INS") PORT_CODE(KEYCODE_4) PORT_CHAR('4')
235   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 D DEL") PORT_CODE(KEYCODE_5) PORT_CHAR('5')
236   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 E BL")  PORT_CODE(KEYCODE_6) PORT_CHAR('6')
237   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 F Go")  PORT_CODE(KEYCODE_7) PORT_CHAR('7')
238
239   PORT_START("Y2")
240   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
241   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Fu DP") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR('H')
242   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+-1 SS") PORT_CODE(KEYCODE_UP) PORT_CHAR('^')
243   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Seq BG") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
244   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ADR BP") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
175245INPUT_PORTS_END
176246
177247
r13771r13772
210280
211281
212282/*    YEAR  NAME      PARENT  COMPAT  MACHINE     INPUT    INIT      COMPANY    FULLNAME */
213COMP( 1989, slc1,     0,      0,      slc1,       slc1,    0,      "Dr. Dieter Scheuschner",  "SLC-1" , GAME_NOT_WORKING )
283COMP( 1989, slc1,     0,      0,      slc1,       slc1,    0,      "Dr. Dieter Scheuschner",  "SLC-1" , 0 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team