src/mess/layout/junior.lay
| r0 | r5355 | |
| 1 | <?xml version="1.0"?>
|
| 2 | <mamelayout version="2">
|
| 3 | <element name="button" defstate="1"/>
|
| 4 | |
| 5 | <element name="digit" defstate="0">
|
| 6 | <led7seg>
|
| 7 | <color red="1.00" green="0.0" blue="0.0" />
|
| 8 | </led7seg>
|
| 9 | </element>
|
| 10 | |
| 11 | <view name="Standard">
|
| 12 | |
| 13 | <!-- Led address display -->
|
| 14 | <bezel name="digit0" element="digit">
|
| 15 | <bounds x="358" y="33" width="20" height="25" />
|
| 16 | </bezel>
|
| 17 | <bezel name="digit1" element="digit">
|
| 18 | <bounds x="390" y="33" width="20" height="25" />
|
| 19 | </bezel>
|
| 20 | <bezel name="digit2" element="digit">
|
| 21 | <bounds x="419" y="33" width="20" height="25" />
|
| 22 | </bezel>
|
| 23 | <bezel name="digit3" element="digit">
|
| 24 | <bounds x="449" y="33" width="20" height="25" />
|
| 25 | </bezel>
|
| 26 | |
| 27 | <!-- Led data display -->
|
| 28 | <bezel name="digit4" element="digit">
|
| 29 | <bounds x="478" y="33" width="20" height="25" />
|
| 30 | </bezel>
|
| 31 | <bezel name="digit5" element="digit">
|
| 32 | <bounds x="508" y="33" width="20" height="25" />
|
| 33 | </bezel>
|
| 34 | |
| 35 | |
| 36 | <!-- Buttons -->
|
| 37 | <!-- Column 1 : C 8 4 0 -->
|
| 38 | <bezel element="button" inputtag="LINE1" inputmask="0x02">
|
| 39 | <bounds x="342" y="230" width="26" height="23"/>
|
| 40 | </bezel>
|
| 41 | |
| 42 | <bezel element="button" inputtag="LINE1" inputmask="0x20">
|
| 43 | <bounds x="342" y="281" width="26" height="23"/>
|
| 44 | </bezel>
|
| 45 | |
| 46 | <bezel element="button" inputtag="LINE0" inputmask="0x04">
|
| 47 | <bounds x="342" y="331" width="26" height="23"/>
|
| 48 | </bezel>
|
| 49 | |
| 50 | <bezel element="button" inputtag="LINE0" inputmask="0x40">
|
| 51 | <bounds x="342" y="382" width="26" height="23"/>
|
| 52 | </bezel>
|
| 53 | |
| 54 | |
| 55 | <!-- Column 2 : D 9 5 1 -->
|
| 56 | <bezel element="button" inputtag="LINE1" inputmask="0x01">
|
| 57 | <bounds x="380" y="230" width="26" height="23"/>
|
| 58 | </bezel>
|
| 59 | |
| 60 | <bezel element="button" inputtag="LINE1" inputmask="0x10">
|
| 61 | <bounds x="380" y="281" width="26" height="23"/>
|
| 62 | </bezel>
|
| 63 | |
| 64 | <bezel element="button" inputtag="LINE0" inputmask="0x02">
|
| 65 | <bounds x="380" y="331" width="26" height="23"/>
|
| 66 | </bezel>
|
| 67 | |
| 68 | <bezel element="button" inputtag="LINE0" inputmask="0x20">
|
| 69 | <bounds x="380" y="382" width="26" height="23"/>
|
| 70 | </bezel>
|
| 71 | |
| 72 | |
| 73 | <!-- Column 3 : E A 6 2 -->
|
| 74 | <bezel element="button" inputtag="LINE2" inputmask="0x40">
|
| 75 | <bounds x="416" y="230" width="26" height="23"/>
|
| 76 | </bezel>
|
| 77 | |
| 78 | <bezel element="button" inputtag="LINE1" inputmask="0x08">
|
| 79 | <bounds x="416" y="281" width="26" height="23"/>
|
| 80 | </bezel>
|
| 81 | |
| 82 | <bezel element="button" inputtag="LINE0" inputmask="0x01">
|
| 83 | <bounds x="416" y="331" width="26" height="23"/>
|
| 84 | </bezel>
|
| 85 | |
| 86 | <bezel element="button" inputtag="LINE0" inputmask="0x10">
|
| 87 | <bounds x="416" y="382" width="26" height="23"/>
|
| 88 | </bezel>
|
| 89 | |
| 90 | |
| 91 | <!-- Column 4 : F B 7 3 -->
|
| 92 | <bezel element="button" inputtag="LINE2" inputmask="0x20">
|
| 93 | <bounds x="453" y="230" width="26" height="23"/>
|
| 94 | </bezel>
|
| 95 | |
| 96 | <bezel element="button" inputtag="LINE1" inputmask="0x04">
|
| 97 | <bounds x="453" y="281" width="26" height="23"/>
|
| 98 | </bezel>
|
| 99 | |
| 100 | <bezel element="button" inputtag="LINE1" inputmask="0x40">
|
| 101 | <bounds x="453" y="331" width="26" height="23"/>
|
| 102 | </bezel>
|
| 103 | |
| 104 | <bezel element="button" inputtag="LINE0" inputmask="0x08">
|
| 105 | <bounds x="453" y="382" width="26" height="23"/>
|
| 106 | </bezel>
|
| 107 | |
| 108 | |
| 109 | <!-- Column 5 : PC AD DA + -->
|
| 110 | <bezel element="button" inputtag="LINE2" inputmask="0x01">
|
| 111 | <bounds x="523" y="230" width="26" height="23"/>
|
| 112 | </bezel>
|
| 113 | |
| 114 | <bezel element="button" inputtag="LINE2" inputmask="0x10">
|
| 115 | <bounds x="523" y="280" width="26" height="23"/>
|
| 116 | </bezel>
|
| 117 | |
| 118 | <bezel element="button" inputtag="LINE2" inputmask="0x08">
|
| 119 | <bounds x="523" y="330" width="26" height="23"/>
|
| 120 | </bezel>
|
| 121 | |
| 122 | <bezel element="button" inputtag="LINE2" inputmask="0x04">
|
| 123 | <bounds x="523" y="380" width="26" height="23"/>
|
| 124 | </bezel>
|
| 125 | |
| 126 | |
| 127 | <!-- Column 6 : GO ST RST -->
|
| 128 | <bezel element="button" inputtag="LINE2" inputmask="0x02">
|
| 129 | <bounds x="562" y="280" width="26" height="23"/>
|
| 130 | </bezel>
|
| 131 | |
| 132 | <bezel element="button" inputtag="LINE3" inputmask="0x40">
|
| 133 | <bounds x="562" y="330" width="26" height="23"/>
|
| 134 | </bezel>
|
| 135 | |
| 136 | <bezel element="button" inputtag="LINE3" inputmask="0x20">
|
| 137 | <bounds x="562" y="380" width="26" height="23"/>
|
| 138 | </bezel>
|
| 139 | |
| 140 | </view>
|
| 141 | </mamelayout>
|
src/mess/drivers/junior.c
| r5354 | r5355 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "cpu/m6502/m6502.h" |
| 11 | 11 | #include "machine/6532riot.h" |
| 12 | #include "junior.lh" |
| 12 | 13 | |
| 13 | | static ADDRESS_MAP_START(junior_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 14 | static UINT8 junior_port_a; |
| 15 | static UINT8 junior_port_b; |
| 16 | static UINT8 junior_led_time[6]; |
| 17 | |
| 18 | |
| 19 | static ADDRESS_MAP_START(junior_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 14 | 20 | ADDRESS_MAP_GLOBAL_MASK(0x1FFF) |
| 15 | 21 | ADDRESS_MAP_UNMAP_HIGH |
| 16 | 22 | AM_RANGE(0x0000, 0x03ff) AM_RAM // 1K RAM |
| 17 | | AM_RANGE(0x1000, 0x17ff) AM_ROM // Printer ROM |
| 18 | 23 | AM_RANGE(0x1a00, 0x1a7f) AM_RAM // 6532 RAM |
| 19 | 24 | AM_RANGE(0x1a80, 0x1aff) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w) |
| 20 | 25 | AM_RANGE(0x1c00, 0x1fff) AM_ROM // Monitor |
| 21 | 26 | ADDRESS_MAP_END |
| 22 | 27 | |
| 28 | |
| 29 | static INPUT_CHANGED( junior_reset ) |
| 30 | { |
| 31 | if (newval == 0) |
| 32 | device_reset(field->port->machine->cpu[0]); |
| 33 | } |
| 34 | |
| 35 | |
| 23 | 36 | /* Input ports */ |
| 24 | 37 | INPUT_PORTS_START( junior ) |
| 38 | PORT_START("LINE0") /* IN0 keys row 0 */ |
| 39 | PORT_BIT( 0x80, 0x00, IPT_UNUSED ) |
| 40 | PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("0.6: 0") PORT_CODE(KEYCODE_0) |
| 41 | PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("0.5: 1") PORT_CODE(KEYCODE_1) |
| 42 | PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("0.4: 2") PORT_CODE(KEYCODE_2) |
| 43 | PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("0.3: 3") PORT_CODE(KEYCODE_3) |
| 44 | PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("0.2: 4") PORT_CODE(KEYCODE_4) |
| 45 | PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("0.1: 5") PORT_CODE(KEYCODE_5) |
| 46 | PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("0.0: 6") PORT_CODE(KEYCODE_6) |
| 47 | |
| 48 | PORT_START("LINE1") /* IN1 keys row 1 */ |
| 49 | PORT_BIT( 0x80, 0x00, IPT_UNUSED ) |
| 50 | PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("1.6: 7") PORT_CODE(KEYCODE_7) |
| 51 | PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("1.5: 8") PORT_CODE(KEYCODE_8) |
| 52 | PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("1.4: 9") PORT_CODE(KEYCODE_9) |
| 53 | PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("1.3: A") PORT_CODE(KEYCODE_A) |
| 54 | PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("1.2: B") PORT_CODE(KEYCODE_B) |
| 55 | PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("1.1: C") PORT_CODE(KEYCODE_C) |
| 56 | PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("1.0: D") PORT_CODE(KEYCODE_D) |
| 57 | |
| 58 | PORT_START("LINE2") /* IN2 keys row 2 */ |
| 59 | PORT_BIT( 0x80, 0x00, IPT_UNUSED ) |
| 60 | PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("2.6: E") PORT_CODE(KEYCODE_E) |
| 61 | PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("2.5: F") PORT_CODE(KEYCODE_F) |
| 62 | PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("2.4: AD (F1)") PORT_CODE(KEYCODE_F1) |
| 63 | PORT_BIT( 0x08, 0x08, IPT_KEYBOARD ) PORT_NAME("2.3: DA (F2)") PORT_CODE(KEYCODE_F2) |
| 64 | PORT_BIT( 0x04, 0x04, IPT_KEYBOARD ) PORT_NAME("2.2: + (CR)") PORT_CODE(KEYCODE_ENTER) |
| 65 | PORT_BIT( 0x02, 0x02, IPT_KEYBOARD ) PORT_NAME("2.1: GO (F5)") PORT_CODE(KEYCODE_F5) |
| 66 | PORT_BIT( 0x01, 0x01, IPT_KEYBOARD ) PORT_NAME("2.0: PC (F6)") PORT_CODE(KEYCODE_F6) |
| 67 | |
| 68 | PORT_START("LINE3") /* IN3 STEP and RESET keys, MODE switch */ |
| 69 | PORT_BIT( 0x80, 0x00, IPT_UNUSED ) |
| 70 | PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("sw1: ST (F7)") PORT_CODE(KEYCODE_F7) |
| 71 | PORT_BIT( 0x20, 0x20, IPT_KEYBOARD ) PORT_NAME("sw2: RST (F3)") PORT_CODE(KEYCODE_F3) PORT_CHANGED(junior_reset, NULL) |
| 72 | PORT_DIPNAME(0x10, 0x10, "sw3: SS (NumLock)") PORT_CODE(KEYCODE_NUMLOCK) PORT_TOGGLE |
| 73 | PORT_DIPSETTING( 0x00, "single step") |
| 74 | PORT_DIPSETTING( 0x10, "run") |
| 75 | PORT_BIT( 0x08, 0x00, IPT_UNUSED ) |
| 76 | PORT_BIT( 0x04, 0x00, IPT_UNUSED ) |
| 77 | PORT_BIT( 0x02, 0x00, IPT_UNUSED ) |
| 78 | PORT_BIT( 0x01, 0x00, IPT_UNUSED ) |
| 25 | 79 | INPUT_PORTS_END |
| 26 | 80 | |
| 27 | 81 | |
| 28 | | static MACHINE_RESET(junior) |
| 29 | | { |
| 30 | | } |
| 31 | 82 | |
| 32 | | static VIDEO_START( junior ) |
| 83 | static UINT8 junior_riot_a_r(const device_config *device, UINT8 olddata) |
| 33 | 84 | { |
| 34 | | } |
| 85 | UINT8 data = 0xff; |
| 35 | 86 | |
| 36 | | static VIDEO_UPDATE( junior ) |
| 37 | | { |
| 38 | | return 0; |
| 39 | | } |
| 87 | switch( ( junior_port_b >> 1 ) & 0x0f ) |
| 88 | { |
| 89 | case 0: |
| 90 | data = input_port_read(device->machine, "LINE0"); |
| 91 | break; |
| 92 | case 1: |
| 93 | data = input_port_read(device->machine, "LINE1"); |
| 94 | break; |
| 95 | case 2: |
| 96 | data = input_port_read(device->machine, "LINE2"); |
| 97 | break; |
| 98 | } |
| 99 | return data; |
| 40 | 100 | |
| 41 | | static UINT8 junior_riot_a_r(const device_config *device, UINT8 olddata) |
| 42 | | { |
| 43 | | return 0; |
| 44 | 101 | } |
| 45 | 102 | |
| 103 | |
| 46 | 104 | static UINT8 junior_riot_b_r(const device_config *device, UINT8 olddata) |
| 47 | 105 | { |
| 48 | | return 0; |
| 106 | if ( riot6532_portb_out_get(device) & 0x20 ) |
| 107 | return 0xFF; |
| 108 | |
| 109 | return 0x7F; |
| 110 | |
| 49 | 111 | } |
| 50 | 112 | |
| 51 | 113 | |
| 52 | | void junior_riot_a_w(const device_config *device, UINT8 data, UINT8 olddata) |
| 114 | void junior_riot_a_w(const device_config *device, UINT8 newdata, UINT8 olddata) |
| 53 | 115 | { |
| 116 | UINT8 idx = ( junior_port_b >> 1 ) & 0x0f; |
| 117 | |
| 118 | junior_port_a = newdata; |
| 119 | |
| 120 | if ((idx >= 4 && idx < 10) & ( junior_port_a != 0xff )) |
| 121 | { |
| 122 | output_set_digit_value( idx-4, junior_port_a ^ 0x7f ); |
| 123 | junior_led_time[idx - 4] = 10; |
| 124 | } |
| 54 | 125 | } |
| 55 | 126 | |
| 56 | | void junior_riot_b_w(const device_config *device, UINT8 data, UINT8 olddata) |
| 127 | |
| 128 | void junior_riot_b_w(const device_config *device, UINT8 newdata, UINT8 olddata) |
| 57 | 129 | { |
| 130 | UINT8 idx = ( newdata >> 1 ) & 0x0f; |
| 131 | |
| 132 | junior_port_b = newdata; |
| 133 | |
| 134 | if ((idx >= 4 && idx < 10) & ( junior_port_a != 0xff )) |
| 135 | { |
| 136 | output_set_digit_value( idx-4, junior_port_a ^ 0x7f ); |
| 137 | junior_led_time[idx - 4] = 10; |
| 138 | } |
| 58 | 139 | } |
| 59 | 140 | |
| 60 | 141 | |
| r5354 | r5355 | |
| 63 | 144 | cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); |
| 64 | 145 | } |
| 65 | 146 | |
| 147 | |
| 66 | 148 | static const riot6532_interface junior_riot_interface = |
| 67 | 149 | { |
| 68 | 150 | junior_riot_a_r, |
| r5354 | r5355 | |
| 73 | 155 | }; |
| 74 | 156 | |
| 75 | 157 | |
| 158 | static TIMER_CALLBACK( junior_update_leds ) |
| 159 | { |
| 160 | int i; |
| 161 | |
| 162 | for ( i = 0; i < 6; i++ ) |
| 163 | { |
| 164 | if ( junior_led_time[i] ) |
| 165 | junior_led_time[i]--; |
| 166 | else |
| 167 | output_set_digit_value( i, 0 ); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | |
| 172 | static MACHINE_START( junior ) |
| 173 | { |
| 174 | state_save_register_item(machine, "junior", NULL, 0, junior_port_a ); |
| 175 | state_save_register_item(machine, "junior", NULL, 0, junior_port_b ); |
| 176 | } |
| 177 | |
| 178 | |
| 179 | static MACHINE_RESET(junior) |
| 180 | { |
| 181 | int i; |
| 182 | |
| 183 | timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, junior_update_leds ); |
| 184 | |
| 185 | for ( i = 0; i < 6; i++ ) |
| 186 | { |
| 187 | junior_led_time[i] = 0; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | |
| 76 | 192 | static MACHINE_DRIVER_START( junior ) |
| 77 | 193 | /* basic machine hardware */ |
| 78 | 194 | MDRV_CPU_ADD("maincpu",M6502, XTAL_1MHz) |
| 79 | 195 | MDRV_CPU_PROGRAM_MAP(junior_mem) |
| 196 | MDRV_QUANTUM_TIME(HZ(50)) |
| 80 | 197 | |
| 198 | MDRV_MACHINE_START( junior ) |
| 81 | 199 | MDRV_MACHINE_RESET(junior) |
| 82 | 200 | |
| 83 | 201 | /* video hardware */ |
| 84 | | MDRV_SCREEN_ADD("screen", RASTER) |
| 85 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 86 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 87 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 88 | | MDRV_SCREEN_SIZE(640, 480) |
| 89 | | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 90 | | MDRV_PALETTE_LENGTH(2) |
| 91 | | MDRV_PALETTE_INIT(black_and_white) |
| 202 | MDRV_DEFAULT_LAYOUT( layout_junior ) |
| 92 | 203 | |
| 93 | | MDRV_VIDEO_START(junior) |
| 94 | | MDRV_VIDEO_UPDATE(junior) |
| 95 | | |
| 96 | 204 | MDRV_RIOT6532_ADD("riot", XTAL_1MHz, junior_riot_interface) |
| 97 | 205 | MACHINE_DRIVER_END |
| 98 | 206 | |
| 207 | |
| 99 | 208 | static SYSTEM_CONFIG_START(junior) |
| 100 | 209 | SYSTEM_CONFIG_END |
| 101 | 210 | |
| 211 | |
| 102 | 212 | /* ROM definition */ |
| 103 | 213 | ROM_START( junior ) |
| 104 | 214 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 105 | | ROM_LOAD( "printer.bin", 0x1000, 0x0800, CRC(b15bf48d) SHA1(0c8da5c0ce9d59cf1cc535cb47a73f147615f289)) |
| 106 | 215 | ROM_DEFAULT_BIOS("orig") |
| 107 | | ROM_SYSTEM_BIOS( 0, "orig", "Original (2708)" ) |
| 108 | | ROMX_LOAD( "junior.ic2", 0x1c00, 0x0400, CRC(ee8aa69d) SHA1(a132a51603f1a841c354815e6d868b335ac84364), ROM_BIOS(1)) |
| 109 | | ROM_SYSTEM_BIOS( 1, "2732", "Just monitor (2732) " ) |
| 110 | | ROMX_LOAD( "junior27321a.ic2", 0x1c00, 0x0400, CRC(e22f24cc) SHA1(a6edb52a9eea5e99624c128065e748e5a3fb2e4c), ROM_BIOS(2)) |
| 216 | ROM_SYSTEM_BIOS( 0, "orig", "Original ESS503" ) |
| 217 | ROMX_LOAD( "ess503.ic2", 0x1c00, 0x0400, CRC(9e804f8c) SHA1(181bdb69fb4711cb008e7966747d4775a5e3ef69), ROM_BIOS(1)) |
| 218 | ROM_SYSTEM_BIOS( 1, "mod-orig", "Mod-Original (2708)" ) |
| 219 | ROMX_LOAD( "junior-mod.ic2", 0x1c00, 0x0400, CRC(ee8aa69d) SHA1(a132a51603f1a841c354815e6d868b335ac84364), ROM_BIOS(2)) |
| 220 | ROM_SYSTEM_BIOS( 2, "2732", "Just monitor (2732) " ) |
| 221 | ROMX_LOAD( "junior27321a.ic2", 0x1c00, 0x0400, CRC(e22f24cc) SHA1(a6edb52a9eea5e99624c128065e748e5a3fb2e4c), ROM_BIOS(3)) |
| 111 | 222 | ROM_END |
| 112 | 223 | |
| 113 | 224 | /* Driver */ |
| 114 | 225 | |
| 115 | 226 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 116 | | COMP( 1980, junior, 0, 0, junior, junior, 0, junior, "Elektor Electronics", "Junior", GAME_NOT_WORKING) |
| 227 | COMP( 1980, junior, 0, 0, junior, junior, 0, junior, "Elektor Electronics", "Junior Computer", GAME_SUPPORTS_SAVE) |
| 117 | 228 | |