src/mess/machine/ins8154.c
| r0 | r1532 | |
| 1 | /***************************************************************************** |
| 2 | * |
| 3 | * machine/ins8154.h |
| 4 | * |
| 5 | * INS8154 N-Channel 128-by-8 Bit RAM Input/Output (RAM I/O) |
| 6 | * |
| 7 | * Written by Dirk Best, January 2008 |
| 8 | * |
| 9 | * TODO: Strobed modes |
| 10 | * |
| 11 | ****************************************************************************/ |
| 12 | |
| 13 | #include "driver.h" |
| 14 | #include "ins8154.h" |
| 15 | |
| 16 | #define MAX_INS8154 2 |
| 17 | |
| 18 | #define VERBOSE 1 |
| 19 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 20 | |
| 21 | |
| 22 | /* Mode Definition Register */ |
| 23 | enum |
| 24 | { |
| 25 | MDR_BASIC = 0x00, |
| 26 | MDR_STROBED_INPUT = 0x20, |
| 27 | MDR_STROBED_OUTPUT = 0x60, |
| 28 | MDR_STROBED_OUTPUT_3STATE = 0xe0 |
| 29 | }; |
| 30 | |
| 31 | |
| 32 | typedef struct _ins8154_state ins8154_state; |
| 33 | struct _ins8154_state |
| 34 | { |
| 35 | /* Pointer to our interface */ |
| 36 | const ins8154_interface *intf; |
| 37 | |
| 38 | UINT8 in_a; /* Input Latch Port A */ |
| 39 | UINT8 in_b; /* Input Latch Port B */ |
| 40 | UINT8 out_a; /* Output Latch Port A */ |
| 41 | UINT8 out_b; /* Output Latch Port B */ |
| 42 | UINT8 mdr; /* Mode Definition Register */ |
| 43 | UINT8 odra; /* Output Definition Register Port A */ |
| 44 | UINT8 odrb; /* Output Definition Register Port B */ |
| 45 | }; |
| 46 | |
| 47 | static ins8154_state ins8154[MAX_INS8154]; |
| 48 | |
| 49 | |
| 50 | /* Config */ |
| 51 | void ins8154_config(int which, const ins8154_interface *intf) |
| 52 | { |
| 53 | assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, |
| 54 | "Can only call ins8154_config at init time!"); |
| 55 | assert_always(which < MAX_INS8154, |
| 56 | "'which' exceeds maximum number of configured INS8154s!"); |
| 57 | |
| 58 | /* Assign interface */ |
| 59 | ins8154[which].intf = intf; |
| 60 | |
| 61 | /* Initialize */ |
| 62 | ins8154_reset(which); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | /* Reset */ |
| 67 | void ins8154_reset(int which) |
| 68 | { |
| 69 | ins8154[which].in_a = 0; |
| 70 | ins8154[which].in_b = 0; |
| 71 | ins8154[which].out_a = 0; |
| 72 | ins8154[which].out_b = 0; |
| 73 | ins8154[which].mdr = 0; |
| 74 | ins8154[which].odra = 0; |
| 75 | ins8154[which].odrb = 0; |
| 76 | } |
| 77 | |
| 78 | |
| 79 | static UINT8 ins8154_read(int which, offs_t offset) |
| 80 | { |
| 81 | ins8154_state *i = &ins8154[which]; |
| 82 | UINT8 val = 0xff; |
| 83 | |
| 84 | if (offset > 0x24) |
| 85 | { |
| 86 | logerror("INS8154 chip #%d (%08x): Read from unknown offset %02x!\n", |
| 87 | which, safe_activecpu_get_pc(), offset); |
| 88 | return 0xff; |
| 89 | } |
| 90 | |
| 91 | switch (offset) |
| 92 | { |
| 93 | case 0x20: |
| 94 | if (i->intf->in_a_func) |
| 95 | val = i->intf->in_a_func(0); |
| 96 | i->in_a = val; |
| 97 | break; |
| 98 | |
| 99 | case 0x21: |
| 100 | if (i->intf->in_b_func) |
| 101 | val = i->intf->in_b_func(0); |
| 102 | i->in_b = val; |
| 103 | break; |
| 104 | |
| 105 | default: |
| 106 | if (offset < 0x08) |
| 107 | { |
| 108 | if (i->intf->in_a_func) |
| 109 | val = (i->intf->in_a_func(0) << (8 - offset)) & 0x80; |
| 110 | i->in_a = val; |
| 111 | } |
| 112 | else |
| 113 | { |
| 114 | if (i->intf->in_a_func) |
| 115 | val = (i->intf->in_a_func(0) << (8 - (offset >> 4))) & 0x80; |
| 116 | i->in_b = val; |
| 117 | } |
| 118 | break; |
| 119 | } |
| 120 | |
| 121 | return val; |
| 122 | } |
| 123 | |
| 124 | |
| 125 | static void ins8154_write_port_a(int which, int data) |
| 126 | { |
| 127 | ins8154_state *i = &ins8154[which]; |
| 128 | |
| 129 | i->out_a = data; |
| 130 | |
| 131 | /* Test if any pins are set as outputs */ |
| 132 | if (i->odra) |
| 133 | { |
| 134 | if (i->intf->out_a_func) |
| 135 | i->intf->out_a_func(0, (data & i->odra) | (i->odra ^ 0xff)); |
| 136 | else |
| 137 | logerror("INS8154 chip #%d (%08x): Write to port A but no write handler defined!\n", |
| 138 | which, safe_activecpu_get_pc()); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | |
| 143 | static void ins8154_write_port_b(int which, int data) |
| 144 | { |
| 145 | ins8154_state *i = &ins8154[which]; |
| 146 | |
| 147 | i->out_b = data; |
| 148 | |
| 149 | /* Test if any pins are set as outputs */ |
| 150 | if (i->odrb) |
| 151 | { |
| 152 | if (i->intf->out_b_func) |
| 153 | i->intf->out_b_func(0, (data & i->odrb) | (i->odrb ^ 0xff)); |
| 154 | else |
| 155 | logerror("INS8154 chip #%d (%08x): Write to port B but no write handler defined!\n", |
| 156 | which, safe_activecpu_get_pc()); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | |
| 161 | static void ins8154_write(int which, offs_t offset, UINT8 data) |
| 162 | { |
| 163 | ins8154_state *i = &ins8154[which]; |
| 164 | |
| 165 | if (offset > 0x24) |
| 166 | { |
| 167 | logerror("INS8154 chip %d (%04x): Write %02x to invalid offset %02x!\n", |
| 168 | which, safe_activecpu_get_pc(), data, offset); |
| 169 | return; |
| 170 | } |
| 171 | |
| 172 | switch (offset) |
| 173 | { |
| 174 | case 0x20: |
| 175 | ins8154_write_port_a(which, data); |
| 176 | break; |
| 177 | |
| 178 | case 0x21: |
| 179 | ins8154_write_port_b(which, data); |
| 180 | break; |
| 181 | |
| 182 | case 0x22: |
| 183 | LOG(("INS8154 chip %d (%04x): ODR for port A set to %02x\n", |
| 184 | which, safe_activecpu_get_pc(), data)); |
| 185 | i->odra = data; |
| 186 | break; |
| 187 | |
| 188 | case 0x23: |
| 189 | LOG(("INS8154 chip %d (%04x): ODR for port B set to %02x\n", |
| 190 | which, safe_activecpu_get_pc(), data)); |
| 191 | i->odrb = data; |
| 192 | break; |
| 193 | |
| 194 | case 0x24: |
| 195 | LOG(("INS8154 chip %d (%04x): MDR set to %02x\n", |
| 196 | which, safe_activecpu_get_pc(), data)); |
| 197 | i->mdr = data; |
| 198 | break; |
| 199 | |
| 200 | default: |
| 201 | if (offset & 0x10) |
| 202 | { |
| 203 | /* Set bit */ |
| 204 | if (offset < 0x08) |
| 205 | { |
| 206 | ins8154_write_port_a(which, i->out_a |= offset & 0x07); |
| 207 | } |
| 208 | else |
| 209 | { |
| 210 | ins8154_write_port_b(which, i->out_b |= (offset >> 4) & 0x07); |
| 211 | } |
| 212 | } |
| 213 | else |
| 214 | { |
| 215 | /* Clear bit */ |
| 216 | if (offset < 0x08) |
| 217 | { |
| 218 | ins8154_write_port_a(which, i->out_a & ~(offset & 0x07)); |
| 219 | } |
| 220 | else |
| 221 | { |
| 222 | ins8154_write_port_b(which, i->out_b & ~((offset >> 4) & 0x07)); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | break; |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | |
| 231 | |
| 232 | /******************* Standard 8-bit CPU interfaces, D0-D7 *******************/ |
| 233 | |
| 234 | WRITE8_HANDLER( ins8154_0_w ) { ins8154_write(0, offset, data); } |
| 235 | WRITE8_HANDLER( ins8154_1_w ) { ins8154_write(1, offset, data); } |
| 236 | |
| 237 | READ8_HANDLER( ins8154_0_r ) { return ins8154_read(0, offset); } |
| 238 | READ8_HANDLER( ins8154_1_r ) { return ins8154_read(1, offset); } |
src/mess/drivers/acrnsys1.c
| r1531 | r1532 | |
| 1 | 1 | /****************************************************************************** |
| 2 | |
| 2 | 3 | Acorn System 1 (Microcomputer Kit) |
| 3 | 4 | |
| 4 | 5 | Skeleton driver |
| 5 | 6 | |
| 6 | | Written by Dirk Best October 2007 |
| 7 | Driver by Dirk Best |
| 7 | 8 | |
| 8 | | TODO: Emulate the National Semiconductor INS8154 |
| 9 | | |
| 10 | 9 | ******************************************************************************/ |
| 11 | 10 | |
| 11 | /* Core includes */ |
| 12 | 12 | #include "driver.h" |
| 13 | 13 | |
| 14 | /* Components */ |
| 15 | #include "machine/ins8154.h" |
| 16 | #include "machine/74145.h" |
| 17 | |
| 14 | 18 | /* Layout */ |
| 15 | 19 | #include "acrnsys1.lh" |
| 16 | 20 | |
| 17 | 21 | |
| 22 | static UINT8 key_digit; |
| 18 | 23 | |
| 24 | |
| 25 | READ8_HANDLER( ins8154_b1_port_a_r ) |
| 26 | { |
| 27 | char port[11]; |
| 28 | UINT8 data; |
| 29 | sprintf(port, "keyboard_%d", key_digit); |
| 30 | data = readinputportbytag(port); |
| 31 | logerror("Reading %02x from row %d\n", data, key_digit); |
| 32 | return data; |
| 33 | } |
| 34 | |
| 35 | WRITE8_HANDLER( ins8154_b1_port_a_w ) |
| 36 | { |
| 37 | ttl74145_0_w(0, data & 0x07); |
| 38 | } |
| 39 | |
| 40 | WRITE8_HANDLER( acrnsys1_led_segment_w ) |
| 41 | { |
| 42 | logerror("led %d segment data: %02x\n", key_digit, data); |
| 43 | |
| 44 | output_set_digit_value(key_digit + 0, data); |
| 45 | } |
| 46 | |
| 47 | static const ins8154_interface ins8154_b1 = |
| 48 | { |
| 49 | ins8154_b1_port_a_r, |
| 50 | NULL, |
| 51 | ins8154_b1_port_a_w, |
| 52 | acrnsys1_led_segment_w, |
| 53 | NULL |
| 54 | }; |
| 55 | |
| 56 | static void acrnsys1_7445_output_0_w(int state) { if (state) key_digit = 0; } |
| 57 | static void acrnsys1_7445_output_1_w(int state) { if (state) key_digit = 1; } |
| 58 | static void acrnsys1_7445_output_2_w(int state) { if (state) key_digit = 2; } |
| 59 | static void acrnsys1_7445_output_3_w(int state) { if (state) key_digit = 3; } |
| 60 | static void acrnsys1_7445_output_4_w(int state) { if (state) key_digit = 4; } |
| 61 | static void acrnsys1_7445_output_5_w(int state) { if (state) key_digit = 5; } |
| 62 | static void acrnsys1_7445_output_6_w(int state) { if (state) key_digit = 6; } |
| 63 | static void acrnsys1_7445_output_7_w(int state) { if (state) key_digit = 7; } |
| 64 | |
| 65 | static const ttl74145_interface ic8_7445 = |
| 66 | { |
| 67 | acrnsys1_7445_output_0_w, /* digit and keyboard column 0 */ |
| 68 | acrnsys1_7445_output_1_w, /* digit and keyboard column 1 */ |
| 69 | acrnsys1_7445_output_2_w, /* digit and keyboard column 2 */ |
| 70 | acrnsys1_7445_output_3_w, /* digit and keyboard column 3 */ |
| 71 | acrnsys1_7445_output_4_w, /* digit and keyboard column 4 */ |
| 72 | acrnsys1_7445_output_5_w, /* digit and keyboard column 5 */ |
| 73 | acrnsys1_7445_output_6_w, /* digit and keyboard column 6 */ |
| 74 | acrnsys1_7445_output_7_w, /* digit and keyboard column 7 */ |
| 75 | NULL, /* not connected */ |
| 76 | NULL, /* not connected */ |
| 77 | }; |
| 78 | |
| 79 | DRIVER_INIT( acrnsys1 ) |
| 80 | { |
| 81 | ins8154_config(0, &ins8154_b1); |
| 82 | ttl74145_config(0, &ic8_7445); |
| 83 | } |
| 84 | |
| 85 | MACHINE_RESET( acrnsys1 ) |
| 86 | { |
| 87 | ins8154_reset(0); |
| 88 | ttl74145_reset(0); |
| 89 | } |
| 90 | |
| 91 | |
| 19 | 92 | /****************************************************************************** |
| 20 | 93 | Memory Maps |
| 21 | 94 | ******************************************************************************/ |
| r1531 | r1532 | |
| 23 | 96 | |
| 24 | 97 | static ADDRESS_MAP_START( acrnsys1_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 25 | 98 | AM_RANGE(0x0000, 0x03ff) AM_RAM |
| 26 | | // AM_RANGE(0x0e00, 0x0e7f) AM_MIRROR(0x100) AM_READWRITE(ins8154_0_r, ins8154_0_w) |
| 99 | AM_RANGE(0x0e00, 0x0e7f) AM_MIRROR(0x100) AM_READWRITE(ins8154_0_r, ins8154_0_w) |
| 27 | 100 | AM_RANGE(0x0e80, 0x0eff) AM_MIRROR(0x100) AM_RAM |
| 28 | 101 | AM_RANGE(0xfe00, 0xffff) AM_MIRROR(0x600) AM_ROM |
| 29 | 102 | ADDRESS_MAP_END |
| r1531 | r1532 | |
| 37 | 110 | |
| 38 | 111 | static INPUT_PORTS_START( acrnsys1 ) |
| 39 | 112 | PORT_START_TAG("keyboard_0") |
| 40 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 41 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 42 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 43 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 44 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 45 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 46 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 47 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x93") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 113 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 114 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 115 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 116 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 117 | |
| 118 | PORT_START_TAG("keyboard_1") |
| 119 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 120 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 121 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 122 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 48 | 123 | |
| 49 | | PORT_START_TAG("keyboard_1") |
| 50 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 51 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 52 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 124 | PORT_START_TAG("keyboard_2") |
| 125 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 126 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 127 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 128 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 129 | |
| 130 | PORT_START_TAG("keyboard_3") |
| 53 | 131 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 54 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 55 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 56 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 57 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 132 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 133 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 134 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 135 | |
| 136 | PORT_START_TAG("keyboard_4") |
| 137 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 138 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 139 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 140 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 58 | 141 | |
| 59 | | PORT_START_TAG("keyboard_2") |
| 60 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 61 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 62 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 63 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 64 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 142 | PORT_START_TAG("keyboard_5") |
| 143 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 144 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_C) PORT_CHAR('R') |
| 65 | 145 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 66 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 67 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 146 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 68 | 147 | |
| 148 | PORT_START_TAG("keyboard_6") |
| 149 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 150 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 151 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 152 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 153 | |
| 154 | PORT_START_TAG("keyboard_7") |
| 155 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 156 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x93") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 157 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 158 | PORT_BIT(0xc7, IP_ACTIVE_LOW, IPT_UNUSED) |
| 159 | |
| 69 | 160 | PORT_START_TAG("reset") |
| 70 | 161 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RST") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 71 | 162 | PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED) |
| 163 | |
| 164 | PORT_START_TAG("switch") |
| 165 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Switch") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 166 | PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED) |
| 167 | |
| 168 | PORT_START_TAG("config") |
| 169 | PORT_CONFNAME( 0x03, 0x00, "Switch connected to") |
| 170 | PORT_CONFSETTING( 0x00, "IRQ" ) |
| 171 | PORT_CONFSETTING( 0x01, "NMI" ) |
| 172 | PORT_CONFSETTING( 0x02, "RST" ) |
| 72 | 173 | INPUT_PORTS_END |
| 73 | 174 | |
| 74 | 175 | |
| r1531 | r1532 | |
| 83 | 184 | MDRV_CPU_ADD(M6502, 1008000) /* 1.008 MHz */ |
| 84 | 185 | MDRV_CPU_PROGRAM_MAP(acrnsys1_map, 0) |
| 85 | 186 | |
| 187 | MDRV_MACHINE_RESET(acrnsys1) |
| 188 | |
| 86 | 189 | /* "video" hardware */ |
| 87 | 190 | MDRV_DEFAULT_LAYOUT(layout_acrnsys1) |
| 88 | 191 | MDRV_SCREEN_REFRESH_RATE(60) |
| r1531 | r1532 | |
| 118 | 221 | ******************************************************************************/ |
| 119 | 222 | |
| 120 | 223 | |
| 121 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 122 | | COMP( 1978, acrnsys1, 0, 0, acrnsys1, acrnsys1, 0, acrnsys1, "Acorn", "System 1", GAME_NOT_WORKING ) |
| 224 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 225 | COMP( 1978, acrnsys1, 0, 0, acrnsys1, acrnsys1, acrnsys1, acrnsys1, "Acorn", "System 1", GAME_NOT_WORKING ) |