src/mess/layout/kim1.lay
| r13138 | r13139 | |
| 7 | 7 | <color red="0.75" green="0.0" blue="0.0" /> |
| 8 | 8 | </led7seg> |
| 9 | 9 | </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> |
| 10 | 16 | |
| 11 | 17 | <view name="Default Layout"> |
| 18 | <!-- Background --> |
| 19 | <backdrop element="background"> |
| 20 | <bounds left="377" top="399" right="571" bottom="443" /> |
| 21 | </backdrop> |
| 12 | 22 | <!-- Led address display --> |
| 13 | 23 | <bezel name="digit0" element="digit"> |
| 14 | 24 | <bounds x="387" y="409" width="18" height="24" /> |
| r13138 | r13139 | |
| 30 | 40 | <bezel name="digit5" element="digit"> |
| 31 | 41 | <bounds x="543" y="409" width="18" height="24" /> |
| 32 | 42 | </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 | | |
| 139 | 43 | </view> |
| 140 | 44 | </mamelayout> |
src/mess/drivers/kim1.c
| r13138 | r13139 | |
| 77 | 77 | change from 1 to 0. |
| 78 | 78 | |
| 79 | 79 | |
| 80 | |
| 81 | Pasting: |
| 82 | 0-F : as is |
| 83 | + (inc) : ^ |
| 84 | AD : - |
| 85 | DA : = |
| 86 | GO : X |
| 87 | |
| 88 | (note: DA only works when addressing RAM) |
| 89 | |
| 90 | Test 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 | |
| 80 | 94 | ******************************************************************************/ |
| 81 | 95 | #define ADDRESS_MAP_MODERN |
| 82 | 96 | |
| r13138 | r13139 | |
| 94 | 108 | public: |
| 95 | 109 | kim1_state(const machine_config &mconfig, device_type type, const char *tag) |
| 96 | 110 | : driver_device(mconfig, type, tag), |
| 97 | | m_riot2(*this, "miot_u2") |
| 111 | m_riot2(*this, "miot_u2"), |
| 112 | m_cass(*this, CASSETTE_TAG) |
| 98 | 113 | { } |
| 99 | 114 | |
| 100 | 115 | required_device<device_t> m_riot2; |
| 116 | required_device<cassette_image_device> m_cass; |
| 101 | 117 | DECLARE_READ8_MEMBER(kim1_u2_read_a); |
| 102 | 118 | DECLARE_WRITE8_MEMBER(kim1_u2_write_a); |
| 103 | 119 | DECLARE_READ8_MEMBER(kim1_u2_read_b); |
| r13138 | r13139 | |
| 133 | 149 | static INPUT_PORTS_START( kim1 ) |
| 134 | 150 | PORT_START("LINE0") /* IN0 keys row 0 */ |
| 135 | 151 | 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') |
| 143 | 159 | |
| 144 | 160 | PORT_START("LINE1") /* IN1 keys row 1 */ |
| 145 | 161 | 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') |
| 153 | 169 | |
| 154 | 170 | PORT_START("LINE2") /* IN2 keys row 2 */ |
| 155 | 171 | 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) |
| 163 | 179 | |
| 164 | 180 | PORT_START("LINE3") /* IN3 STEP and RESET keys, MODE switch */ |
| 165 | 181 | 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 |
| 169 | 185 | PORT_DIPSETTING( 0x00, "single step") |
| 170 | 186 | PORT_DIPSETTING( 0x10, "run") |
| 171 | 187 | PORT_BIT( 0x08, 0x00, IPT_UNUSED ) |
| r13138 | r13139 | |
| 177 | 193 | |
| 178 | 194 | READ8_MEMBER( kim1_state::kim1_u2_read_a ) |
| 179 | 195 | { |
| 180 | | UINT8 data = 0xff; |
| 196 | UINT8 data = 0xff; |
| 181 | 197 | |
| 182 | 198 | switch( ( m_u2_port_b >> 1 ) & 0x0f ) |
| 183 | 199 | { |
| r13138 | r13139 | |
| 223 | 239 | m_u2_port_b = data; |
| 224 | 240 | |
| 225 | 241 | if ( data & 0x20 ) |
| 226 | | { |
| 227 | 242 | /* 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 ); |
| 230 | 244 | |
| 231 | 245 | /* Set IRQ when bit 7 is cleared */ |
| 232 | 246 | } |
| r13138 | r13139 | |
| 252 | 266 | static TIMER_DEVICE_CALLBACK( kim1_cassette_input ) |
| 253 | 267 | { |
| 254 | 268 | 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(); |
| 256 | 270 | |
| 257 | 271 | if ( tap_val <= 0 ) |
| 258 | 272 | { |
| r13138 | r13139 | |
| 264 | 278 | } |
| 265 | 279 | |
| 266 | 280 | if ( tap_val > 0 ) |
| 267 | | { |
| 268 | 281 | state->m_cassette_high_count++; |
| 269 | | } |
| 270 | 282 | } |
| 271 | 283 | |
| 272 | 284 | |
| 273 | 285 | static TIMER_DEVICE_CALLBACK( kim1_update_leds ) |
| 274 | 286 | { |
| 275 | 287 | kim1_state *state = timer.machine().driver_data<kim1_state>(); |
| 276 | | int i; |
| 288 | UINT8 i; |
| 277 | 289 | |
| 278 | 290 | for ( i = 0; i < 6; i++ ) |
| 279 | 291 | { |
| r13138 | r13139 | |
| 297 | 309 | static MACHINE_RESET( kim1 ) |
| 298 | 310 | { |
| 299 | 311 | kim1_state *state = machine.driver_data<kim1_state>(); |
| 300 | | int i; |
| 312 | UINT8 i; |
| 301 | 313 | |
| 302 | | |
| 303 | 314 | for ( i = 0; i < 6; i++ ) |
| 304 | | { |
| 305 | 315 | state->m_led_time[i] = 0; |
| 306 | | } |
| 307 | 316 | |
| 308 | 317 | state->m_311_output = 0; |
| 309 | 318 | state->m_cassette_high_count = 0; |
| r13138 | r13139 | |
| 329 | 338 | MCFG_MACHINE_START( kim1 ) |
| 330 | 339 | MCFG_MACHINE_RESET( kim1 ) |
| 331 | 340 | |
| 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 ) |
| 334 | 343 | |
| 335 | 344 | /* sound hardware */ |
| 336 | 345 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 337 | | |
| 338 | 346 | MCFG_SOUND_ADD("dac", DAC, 0) |
| 339 | 347 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 340 | 348 | |
| 349 | /* Devices */ |
| 350 | MCFG_MOS6530_ADD( "miot_u2", 1000000, kim1_u2_mos6530_interface ) |
| 351 | MCFG_MOS6530_ADD( "miot_u3", 1000000, kim1_u3_mos6530_interface ) |
| 341 | 352 | MCFG_CASSETTE_ADD( CASSETTE_TAG, kim1_cassette_interface ) |
| 342 | | |
| 343 | | /* video */ |
| 344 | | MCFG_DEFAULT_LAYOUT( layout_kim1 ) |
| 345 | | |
| 346 | 353 | MCFG_TIMER_ADD_PERIODIC("led_timer", kim1_update_leds, attotime::from_hz(60)) |
| 347 | 354 | MCFG_TIMER_ADD_PERIODIC("cassette_timer", kim1_cassette_input, attotime::from_hz(44100)) |
| 348 | 355 | MACHINE_CONFIG_END |