Previous 15994 Revisions Next

r13139 Sunday 30th October, 2011 at 11:17:42 UTC by Robbbert
KIM1 - added standard paste facility.
[src/mess/drivers]kim1.c
[src/mess/layout]kim1.lay

src/mess/layout/kim1.lay
r13138r13139
77         <color red="0.75" green="0.0" blue="0.0" />
88      </led7seg>
99   </element>
10   <element name="background">
11      <rect>
12         <bounds left="0" top="0" right="1" bottom="1" />
13         <color red="0.0" green="0.0" blue="0.0" />
14      </rect>
15   </element>
1016
1117   <view name="Default Layout">
18      <!-- Background -->
19      <backdrop element="background">
20         <bounds left="377" top="399" right="571" bottom="443" />
21      </backdrop>
1222      <!-- Led address display -->
1323      <bezel name="digit0" element="digit">
1424         <bounds x="387" y="409" width="18" height="24" />
r13138r13139
3040      <bezel name="digit5" element="digit">
3141         <bounds x="543" y="409" width="18" height="24" />
3242      </bezel>
33
34
35      <!-- Buttons -->
36      <!-- Row 1 : GO ST RS -->
37      <bezel element="button" inputtag="LINE2" inputmask="0x02">
38         <bounds x="418" y="516" width="24" height="18"/>
39      </bezel>
40
41      <bezel element="button" inputtag="LINE3" inputmask="0x40">
42         <bounds x="455" y="516" width="24" height="18"/>
43      </bezel>
44
45      <bezel element="button" inputtag="LINE3" inputmask="0x20">
46         <bounds x="492" y="516" width="24" height="18"/>
47      </bezel>
48
49
50      <!-- Row 2 : AD DA PC + -->
51      <bezel element="button" inputtag="LINE2" inputmask="0x10">
52         <bounds x="418" y="552" width="24" height="18"/>
53      </bezel>
54
55      <bezel element="button" inputtag="LINE2" inputmask="0x08">
56         <bounds x="455" y="552" width="24" height="18"/>
57      </bezel>
58
59      <bezel element="button" inputtag="LINE2" inputmask="0x01">
60         <bounds x="492" y="552" width="24" height="18"/>
61      </bezel>
62
63      <bezel element="button" inputtag="LINE2" inputmask="0x04">
64         <bounds x="529" y="552" width="24" height="18"/>
65      </bezel>
66
67
68      <!-- Row 3 : C D E F -->
69      <bezel element="button" inputtag="LINE1" inputmask="0x02">
70         <bounds x="418" y="588" width="24" height="18"/>
71      </bezel>
72
73      <bezel element="button" inputtag="LINE1" inputmask="0x01">
74         <bounds x="455" y="588" width="24" height="18"/>
75      </bezel>
76
77      <bezel element="button" inputtag="LINE2" inputmask="0x40">
78         <bounds x="492" y="588" width="24" height="18"/>
79      </bezel>
80
81      <bezel element="button" inputtag="LINE2" inputmask="0x20">
82         <bounds x="529" y="588" width="24" height="18"/>
83      </bezel>
84
85
86      <!-- Row 4 : 8 9 A B -->
87      <bezel element="button" inputtag="LINE1" inputmask="0x20">
88         <bounds x="418" y="624" width="24" height="18"/>
89      </bezel>
90
91      <bezel element="button" inputtag="LINE1" inputmask="0x10">
92         <bounds x="455" y="624" width="24" height="18"/>
93      </bezel>
94
95      <bezel element="button" inputtag="LINE1" inputmask="0x08">
96         <bounds x="492" y="624" width="24" height="18"/>
97      </bezel>
98
99      <bezel element="button" inputtag="LINE1" inputmask="0x04">
100         <bounds x="529" y="624" width="24" height="18"/>
101      </bezel>
102
103
104      <!-- Row 5 : 4 5 6 7 -->
105      <bezel element="button" inputtag="LINE0" inputmask="0x04">
106         <bounds x="418" y="660" width="24" height="18"/>
107      </bezel>
108
109      <bezel element="button" inputtag="LINE0" inputmask="0x02">
110         <bounds x="455" y="660" width="24" height="18"/>
111      </bezel>
112
113      <bezel element="button" inputtag="LINE0" inputmask="0x01">
114         <bounds x="492" y="660" width="24" height="18"/>
115      </bezel>
116
117      <bezel element="button" inputtag="LINE1" inputmask="0x40">
118         <bounds x="529" y="660" width="24" height="18"/>
119      </bezel>
120
121
122      <!-- Row 6 : 0 1 2 3 -->
123      <bezel element="button" inputtag="LINE0" inputmask="0x40">
124         <bounds x="418" y="696" width="24" height="18"/>
125      </bezel>
126
127      <bezel element="button" inputtag="LINE0" inputmask="0x20">
128         <bounds x="455" y="696" width="24" height="18"/>
129      </bezel>
130
131      <bezel element="button" inputtag="LINE0" inputmask="0x10">
132         <bounds x="492" y="696" width="24" height="18"/>
133      </bezel>
134
135      <bezel element="button" inputtag="LINE0" inputmask="0x08">
136         <bounds x="529" y="696" width="24" height="18"/>
137      </bezel>
138
13943   </view>
14044</mamelayout>
src/mess/drivers/kim1.c
r13138r13139
7777change from 1 to 0.
7878
7979
80
81Pasting:
82        0-F : as is
83        + (inc) : ^
84        AD : -
85        DA : =
86        GO : X
87
88(note: DA only works when addressing RAM)
89
90Test Paste:
91        =11^22^33^44^55^66^77^88^99^-0000
92        Now press up-arrow to confirm the data has been entered.
93
8094******************************************************************************/
8195#define ADDRESS_MAP_MODERN
8296
r13138r13139
94108public:
95109   kim1_state(const machine_config &mconfig, device_type type, const char *tag)
96110      : driver_device(mconfig, type, tag),
97   m_riot2(*this, "miot_u2")
111   m_riot2(*this, "miot_u2"),
112   m_cass(*this, CASSETTE_TAG)
98113   { }
99114
100115   required_device<device_t> m_riot2;
116   required_device<cassette_image_device> m_cass;
101117   DECLARE_READ8_MEMBER(kim1_u2_read_a);
102118   DECLARE_WRITE8_MEMBER(kim1_u2_write_a);
103119   DECLARE_READ8_MEMBER(kim1_u2_read_b);
r13138r13139
133149static INPUT_PORTS_START( kim1 )
134150   PORT_START("LINE0")         /* IN0 keys row 0 */
135151   PORT_BIT( 0x80, 0x00, IPT_UNUSED )
136   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("0.6: 0") PORT_CODE(KEYCODE_0)
137   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("0.5: 1") PORT_CODE(KEYCODE_1)
138   PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("0.4: 2") PORT_CODE(KEYCODE_2)
139   PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("0.3: 3") PORT_CODE(KEYCODE_3)
140   PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("0.2: 4") PORT_CODE(KEYCODE_4)
141   PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("0.1: 5") PORT_CODE(KEYCODE_5)
142   PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("0.0: 6") PORT_CODE(KEYCODE_6)
152   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
153   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1')
154   PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2')
155   PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3')
156   PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4')
157   PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5')
158   PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6')
143159
144160   PORT_START("LINE1")         /* IN1 keys row 1 */
145161   PORT_BIT( 0x80, 0x00, IPT_UNUSED )
146   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("1.6: 7") PORT_CODE(KEYCODE_7)
147   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("1.5: 8") PORT_CODE(KEYCODE_8)
148   PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("1.4: 9") PORT_CODE(KEYCODE_9)
149   PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("1.3: A") PORT_CODE(KEYCODE_A)
150   PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("1.2: B") PORT_CODE(KEYCODE_B)
151   PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("1.1: C") PORT_CODE(KEYCODE_C)
152   PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("1.0: D") PORT_CODE(KEYCODE_D)
162   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7')
163   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8')
164   PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9')
165   PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A')
166   PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B')
167   PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C')
168   PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D')
153169
154170   PORT_START("LINE2")         /* IN2 keys row 2 */
155171   PORT_BIT( 0x80, 0x00, IPT_UNUSED )
156   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("2.6: E") PORT_CODE(KEYCODE_E)
157   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("2.5: F") PORT_CODE(KEYCODE_F)
158   PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("2.4: AD (F1)") PORT_CODE(KEYCODE_F1)
159   PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("2.3: DA (F2)") PORT_CODE(KEYCODE_F2)
160   PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("2.2: +  (CR)") PORT_CODE(KEYCODE_ENTER)
161   PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("2.1: GO (F5)") PORT_CODE(KEYCODE_F5)
162   PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("2.0: PC (F6)") PORT_CODE(KEYCODE_F6)
172   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E')
173   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F')
174   PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("AD") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
175   PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("DA") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=')
176   PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("+") PORT_CODE(KEYCODE_UP) PORT_CHAR('^')
177   PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("GO") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
178   PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("PC") PORT_CODE(KEYCODE_F6)
163179
164180   PORT_START("LINE3")         /* IN3 STEP and RESET keys, MODE switch */
165181   PORT_BIT( 0x80, 0x00, IPT_UNUSED )
166   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("sw1: ST (F7)") PORT_CODE(KEYCODE_F7)
167   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("sw2: RS (F3)") PORT_CODE(KEYCODE_F3) PORT_CHANGED(kim1_reset, NULL)
168   PORT_DIPNAME(0x10, 0x10, "sw3: SS (NumLock)") PORT_CODE(KEYCODE_NUMLOCK) PORT_TOGGLE
182   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("sw1: ST") PORT_CODE(KEYCODE_F7)
183   PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("sw2: RS") PORT_CODE(KEYCODE_F3) PORT_CHANGED(kim1_reset, NULL)
184   PORT_DIPNAME(0x10, 0x10, "sw3: SS") PORT_CODE(KEYCODE_NUMLOCK) PORT_TOGGLE
169185   PORT_DIPSETTING( 0x00, "single step")
170186   PORT_DIPSETTING( 0x10, "run")
171187   PORT_BIT( 0x08, 0x00, IPT_UNUSED )
r13138r13139
177193
178194READ8_MEMBER( kim1_state::kim1_u2_read_a )
179195{
180   UINT8   data = 0xff;
196   UINT8 data = 0xff;
181197
182198   switch( ( m_u2_port_b >> 1 ) & 0x0f )
183199   {
r13138r13139
223239   m_u2_port_b = data;
224240
225241   if ( data & 0x20 )
226   {
227242      /* cassette write/speaker update */
228      machine().device<cassette_image_device>(CASSETTE_TAG)->output(( data & 0x80 ) ? -1.0 : 1.0 );
229   }
243      m_cass->output(( data & 0x80 ) ? -1.0 : 1.0 );
230244
231245   /* Set IRQ when bit 7 is cleared */
232246}
r13138r13139
252266static TIMER_DEVICE_CALLBACK( kim1_cassette_input )
253267{
254268   kim1_state *state = timer.machine().driver_data<kim1_state>();
255   double tap_val = (timer.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
269   double tap_val = state->m_cass->input();
256270
257271   if ( tap_val <= 0 )
258272   {
r13138r13139
264278   }
265279
266280   if ( tap_val > 0 )
267   {
268281      state->m_cassette_high_count++;
269   }
270282}
271283
272284
273285static TIMER_DEVICE_CALLBACK( kim1_update_leds )
274286{
275287   kim1_state *state = timer.machine().driver_data<kim1_state>();
276   int i;
288   UINT8 i;
277289
278290   for ( i = 0; i < 6; i++ )
279291   {
r13138r13139
297309static MACHINE_RESET( kim1 )
298310{
299311   kim1_state *state = machine.driver_data<kim1_state>();
300   int i;
312   UINT8 i;
301313
302
303314   for ( i = 0; i < 6; i++ )
304   {
305315      state->m_led_time[i] = 0;
306   }
307316
308317   state->m_311_output = 0;
309318   state->m_cassette_high_count = 0;
r13138r13139
329338   MCFG_MACHINE_START( kim1 )
330339   MCFG_MACHINE_RESET( kim1 )
331340
332   MCFG_MOS6530_ADD( "miot_u2", 1000000, kim1_u2_mos6530_interface )
333   MCFG_MOS6530_ADD( "miot_u3", 1000000, kim1_u3_mos6530_interface )
341   /* video */
342   MCFG_DEFAULT_LAYOUT( layout_kim1 )
334343
335344   /* sound hardware */
336345   MCFG_SPEAKER_STANDARD_MONO("mono")
337
338346   MCFG_SOUND_ADD("dac", DAC, 0)
339347   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
340348
349   /* Devices */
350   MCFG_MOS6530_ADD( "miot_u2", 1000000, kim1_u2_mos6530_interface )
351   MCFG_MOS6530_ADD( "miot_u3", 1000000, kim1_u3_mos6530_interface )
341352   MCFG_CASSETTE_ADD( CASSETTE_TAG, kim1_cassette_interface )
342
343   /* video */
344   MCFG_DEFAULT_LAYOUT( layout_kim1 )
345
346353   MCFG_TIMER_ADD_PERIODIC("led_timer", kim1_update_leds, attotime::from_hz(60))
347354   MCFG_TIMER_ADD_PERIODIC("cassette_timer", kim1_cassette_input, attotime::from_hz(44100))
348355MACHINE_CONFIG_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team