src/mess/machine/kr2376.c
| r0 | r4461 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | SMC KR2376 Keyboard Encoder emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "driver.h" |
| 11 | #include "kr2376.h" |
| 12 | |
| 13 | static const UINT8 KR2376_KEY_CODES[3][8][11] = |
| 14 | { |
| 15 | // normal |
| 16 | { |
| 17 | // Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10 |
| 18 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11, 0x50, 0x30 }, // X0 |
| 19 | { 0x10, 0x4b, 0x4c, 0x4e, 0x4d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1 |
| 20 | { 0x2d, 0x1c, 0x1d, 0x1e, 0x1f, 0x3c, 0x3e, 0x2c, 0x20, 0x2e, 0x5f }, // X2 |
| 21 | { 0x30, 0x3a, 0x70, 0x5f, 0x40, 0x08, 0x5B, 0x5d, 0x0d, 0x0a, 0x7f }, // X3 |
| 22 | { 0x3b, 0x2f, 0x2e, 0x2c, 0x6d, 0x6e, 0x62, 0x76, 0x63, 0x78, 0x7a }, // X4 |
| 23 | { 0x6c, 0x6b, 0x6a, 0x68, 0x67, 0x66, 0x64, 0x73, 0x61, 0x0c, 0x1b }, // X5 |
| 24 | { 0x6f, 0x69, 0x75, 0x79, 0x74, 0x72, 0x65, 0x77, 0x71, 0x09, 0x0b }, // X6 |
| 25 | { 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x5e, 0x5c } // X7 |
| 26 | }, |
| 27 | |
| 28 | // shift |
| 29 | { |
| 30 | // Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10 |
| 31 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11, 0x40, 0x5f }, // X0 |
| 32 | { 0x10, 0x5b, 0x60, 0x5e, 0x5d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1 |
| 33 | { 0x3d, 0x1c, 0x1d, 0x1e, 0x1f, 0x3c, 0x3e, 0x2c, 0x20, 0x2e, 0x5f }, // X2 |
| 34 | { 0x00, 0x2a, 0x50, 0x7f, 0x60, 0x08, 0x7B, 0x7d, 0x0d, 0x0a, 0x7f }, // X3 |
| 35 | { 0x2b, 0x3f, 0x3e, 0x3c, 0x4d, 0x4e, 0x42, 0x56, 0x43, 0x58, 0x5a }, // X4 |
| 36 | { 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x46, 0x44, 0x53, 0x41, 0x0c, 0x1b }, // X5 |
| 37 | { 0x4f, 0x49, 0x55, 0x59, 0x54, 0x52, 0x45, 0x57, 0x51, 0x09, 0x0b }, // X6 |
| 38 | { 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x7e, 0x7c } // X7 |
| 39 | }, |
| 40 | |
| 41 | // control |
| 42 | { |
| 43 | // Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10 |
| 44 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11, 0x10, 0x0f }, // X0 |
| 45 | { 0x10, 0x0b, 0x0c, 0x0e, 0x0d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1 |
| 46 | { 0x00, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x1f }, // X2 |
| 47 | { 0x00, 0x00, 0x10, 0x1f, 0x00, 0x08, 0x1B, 0x1d, 0x0d, 0x0a, 0x7f }, // X3 |
| 48 | { 0x00, 0x00, 0x00, 0x00, 0x1d, 0x0e, 0x02, 0x16, 0x03, 0x18, 0x1a }, // X4 |
| 49 | { 0x0c, 0x0b, 0x0a, 0x08, 0x07, 0x06, 0x04, 0x13, 0x01, 0x0c, 0x1b }, // X5 |
| 50 | { 0x1f, 0x09, 0x15, 0x19, 0x14, 0x12, 0x05, 0x17, 0x11, 0x09, 0x0b }, // X6 |
| 51 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1c } // X7 |
| 52 | } |
| 53 | }; |
| 54 | |
| 55 | typedef struct _kr2376_t kr2376_t; |
| 56 | struct _kr2376_t |
| 57 | { |
| 58 | const kr2376_interface *intf; |
| 59 | int pins[41]; |
| 60 | |
| 61 | int ring11; /* sense input scan counter */ |
| 62 | int ring8; /* drive output scan counter */ |
| 63 | int modifiers; /* modifier inputs */ |
| 64 | |
| 65 | int strobe; /* strobe output */ |
| 66 | int strobe_old; |
| 67 | int parity; |
| 68 | int data; |
| 69 | |
| 70 | /* timers */ |
| 71 | emu_timer *scan_timer; /* keyboard scan timer */ |
| 72 | }; |
| 73 | |
| 74 | INLINE kr2376_t *get_safe_token(const device_config *device) |
| 75 | { |
| 76 | assert(device != NULL); |
| 77 | assert(device->token != NULL); |
| 78 | |
| 79 | return (kr2376_t *)device->token; |
| 80 | } |
| 81 | |
| 82 | /*------------------------------------------------- |
| 83 | kr2376_set_input_pin - set an input pin |
| 84 | -------------------------------------------------*/ |
| 85 | void kr2376_set_input_pin( const device_config *device, kr2376_input_pin_t pin, int data ) |
| 86 | { |
| 87 | kr2376_t *kr2376 = get_safe_token(device); |
| 88 | |
| 89 | data = data ? 1 : 0; |
| 90 | switch ( pin ) |
| 91 | { |
| 92 | case KR2376_PII: |
| 93 | case KR2376_DSII: |
| 94 | kr2376->pins[pin] = data; |
| 95 | break; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | |
| 100 | /*------------------------------------------------- |
| 101 | kr2376_get_output_pin - get the status of an output pin |
| 102 | -------------------------------------------------*/ |
| 103 | int kr2376_get_output_pin( const device_config *device, kr2376_output_pin_t pin ) |
| 104 | { |
| 105 | kr2376_t *kr2376 = get_safe_token(device); |
| 106 | |
| 107 | return kr2376->pins[pin]; |
| 108 | } |
| 109 | |
| 110 | |
| 111 | static void change_output_lines(const device_config *device) |
| 112 | { |
| 113 | kr2376_t *kr2376 = get_safe_token(device); |
| 114 | |
| 115 | if (kr2376->strobe != kr2376->strobe_old) |
| 116 | { |
| 117 | kr2376->strobe_old = kr2376->strobe; |
| 118 | |
| 119 | if (kr2376->strobe) // strobe 0 --> 1 transition |
| 120 | { |
| 121 | /* update parity */ |
| 122 | kr2376->pins[KR2376_PO] = kr2376->parity ^ kr2376->pins[KR2376_PII]; |
| 123 | } |
| 124 | kr2376->pins[KR2376_SO] = kr2376->strobe ^ kr2376->pins[KR2376_DSII]; |
| 125 | if (kr2376->intf->on_strobe_changed) |
| 126 | kr2376->intf->on_strobe_changed(device, 0, kr2376->strobe ^ kr2376->pins[KR2376_DSII]); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | static void clock_scan_counters(const device_config *device) |
| 131 | { |
| 132 | kr2376_t *kr2376 = get_safe_token(device); |
| 133 | |
| 134 | /* ring counters inhibited while strobe active */ |
| 135 | if (!kr2376->strobe) |
| 136 | { |
| 137 | kr2376->ring11++; |
| 138 | if (kr2376->ring11 == 11) |
| 139 | { |
| 140 | kr2376->ring11 = 0; |
| 141 | kr2376->ring8++; |
| 142 | if (kr2376->ring8 == 8) |
| 143 | kr2376->ring8 = 0; |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | static void detect_keypress(const device_config *device) |
| 149 | { |
| 150 | kr2376_t *kr2376= get_safe_token(device); |
| 151 | |
| 152 | static const char *const keynames[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7" }; |
| 153 | |
| 154 | if (input_port_read(device->machine, keynames[kr2376->ring8]) == (1 << kr2376->ring11)) |
| 155 | { |
| 156 | kr2376->modifiers = input_port_read(device->machine, "MODIFIERS"); |
| 157 | |
| 158 | kr2376->strobe = 1; |
| 159 | /* strobe 0->1 transition, encode char and update parity */ |
| 160 | if (!kr2376->strobe_old) |
| 161 | { |
| 162 | int i; |
| 163 | int parbit; |
| 164 | int shift = BIT(kr2376->modifiers, 0); |
| 165 | int control = BIT(kr2376->modifiers, 1); |
| 166 | int alpha = BIT(kr2376->modifiers, 2); |
| 167 | int table = 0; |
| 168 | |
| 169 | if (shift || alpha) |
| 170 | table = 1; |
| 171 | else if (control) |
| 172 | table = 2; |
| 173 | |
| 174 | kr2376->data = KR2376_KEY_CODES[table][kr2376->ring8][kr2376->ring11]; |
| 175 | |
| 176 | /* Compute ODD parity */ |
| 177 | kr2376->parity = kr2376->data; |
| 178 | parbit = 0; |
| 179 | for (i=0; i<8; i++) |
| 180 | parbit ^= (kr2376->parity >> i) & 1; |
| 181 | kr2376->parity = parbit; |
| 182 | } |
| 183 | } |
| 184 | else |
| 185 | { |
| 186 | kr2376->strobe = 0; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | static TIMER_CALLBACK( kr2376_scan_tick ) |
| 191 | { |
| 192 | const device_config *device = ptr; |
| 193 | |
| 194 | change_output_lines(device); |
| 195 | clock_scan_counters(device); |
| 196 | detect_keypress(device); |
| 197 | } |
| 198 | |
| 199 | /* Keyboard Data */ |
| 200 | |
| 201 | READ8_DEVICE_HANDLER( kr2376_data_r ) |
| 202 | { |
| 203 | kr2376_t *kr2376 = get_safe_token(device); |
| 204 | |
| 205 | if (kr2376->pins[KR2376_DSII]) |
| 206 | return kr2376->data ^ 0xff; |
| 207 | else |
| 208 | return kr2376->data; |
| 209 | } |
| 210 | |
| 211 | /* Input Ports */ |
| 212 | |
| 213 | INPUT_PORTS_START( kr2376 ) |
| 214 | PORT_START("X0") |
| 215 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 216 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 217 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 218 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 219 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 220 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 221 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 222 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 223 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 224 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 225 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 226 | |
| 227 | PORT_START("X1") |
| 228 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 229 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 230 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 231 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 232 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 233 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 234 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 235 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 236 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 237 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 238 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 239 | |
| 240 | |
| 241 | PORT_START("X2") |
| 242 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 243 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 244 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 245 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 246 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 247 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 248 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 249 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 250 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 251 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 252 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 253 | |
| 254 | PORT_START("X3") |
| 255 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 256 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') |
| 257 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 258 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("- Delete") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('_') |
| 259 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('@') PORT_CHAR('`') |
| 260 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 261 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 262 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 263 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Carriage Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 264 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10) |
| 265 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) |
| 266 | |
| 267 | PORT_START("X4") |
| 268 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(';') PORT_CHAR('+') |
| 269 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 270 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 271 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 272 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 273 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 274 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 275 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 276 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 277 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 278 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 279 | |
| 280 | |
| 281 | PORT_START("X5") |
| 282 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 283 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 284 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 285 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 286 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 287 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 288 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 289 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 290 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 291 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 292 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) |
| 293 | |
| 294 | |
| 295 | PORT_START("X6") |
| 296 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 297 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 298 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 299 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 300 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 301 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 302 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 303 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 304 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 305 | |
| 306 | PORT_START("X7") |
| 307 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 308 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 309 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(0xFFFD) |
| 310 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 311 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 312 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 313 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 314 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') |
| 315 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 316 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~') |
| 317 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') |
| 318 | |
| 319 | PORT_START("MODIFIERS") |
| 320 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 321 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) |
| 322 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| 323 | INPUT_PORTS_END |
| 324 | |
| 325 | |
| 326 | static DEVICE_START( kr2376 ) |
| 327 | { |
| 328 | kr2376_t *kr2376 = get_safe_token(device); |
| 329 | |
| 330 | /* validate arguments */ |
| 331 | assert(device != NULL); |
| 332 | assert(device->tag != NULL); |
| 333 | |
| 334 | kr2376->intf = device->static_config; |
| 335 | |
| 336 | assert(kr2376->intf != NULL); |
| 337 | assert(kr2376->intf->clock > 0); |
| 338 | |
| 339 | /* set initial values */ |
| 340 | kr2376->ring11 = 0; |
| 341 | kr2376->ring8 = 0; |
| 342 | kr2376->modifiers = 0; |
| 343 | kr2376->strobe = 0; |
| 344 | kr2376->strobe_old = 0; |
| 345 | kr2376->parity = 0; |
| 346 | kr2376->data = 0; |
| 347 | change_output_lines(device); |
| 348 | |
| 349 | /* create the timers */ |
| 350 | kr2376->scan_timer = timer_alloc(device->machine, kr2376_scan_tick, (void *)device); |
| 351 | timer_adjust_periodic(kr2376->scan_timer, attotime_zero, 0, ATTOTIME_IN_HZ(kr2376->intf->clock)); |
| 352 | |
| 353 | /* register for state saving */ |
| 354 | state_save_register_device_item(device, 0, kr2376->ring11); |
| 355 | state_save_register_device_item(device, 0, kr2376->ring8); |
| 356 | state_save_register_device_item(device, 0, kr2376->modifiers); |
| 357 | state_save_register_device_item(device, 0, kr2376->strobe); |
| 358 | state_save_register_device_item(device, 0, kr2376->strobe_old); |
| 359 | state_save_register_device_item(device, 0, kr2376->parity); |
| 360 | state_save_register_device_item(device, 0, kr2376->data); |
| 361 | } |
| 362 | |
| 363 | static DEVICE_SET_INFO( kr2376 ) |
| 364 | { |
| 365 | switch (state) |
| 366 | { |
| 367 | /* no parameters to set */ |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | DEVICE_GET_INFO( kr2376 ) |
| 372 | { |
| 373 | switch (state) |
| 374 | { |
| 375 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 376 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(kr2376_t); break; |
| 377 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 378 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 379 | |
| 380 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 381 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(kr2376); break; |
| 382 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(kr2376); break; |
| 383 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 384 | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 385 | |
| 386 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 387 | case DEVINFO_STR_NAME: strcpy(info->s, "SMC KR2376"); break; |
| 388 | case DEVINFO_STR_FAMILY: strcpy(info->s, "SMC"); break; |
| 389 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 390 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 391 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 392 | } |
| 393 | } |
src/mess/machine/z80ne.c
| r0 | r4461 | |
| 1 | /*********************************************************************** |
| 2 | |
| 3 | machine/z80ne.c |
| 4 | |
| 5 | Functions to emulate general aspects of the machine (RAM, ROM, |
| 6 | interrupts, I/O ports) |
| 7 | |
| 8 | ***********************************************************************/ |
| 9 | |
| 10 | /* Core includes */ |
| 11 | #include "driver.h" |
| 12 | #include "devintrf.h" |
| 13 | #include "includes/z80ne.h" |
| 14 | |
| 15 | /* Components */ |
| 16 | #include "machine/ay31015.h" |
| 17 | #include "machine/kr2376.h" |
| 18 | #include "machine/wd17xx.h" |
| 19 | #include "video/m6847.h" |
| 20 | |
| 21 | /* Devices */ |
| 22 | #include "devices/basicdsk.h" |
| 23 | #include "devices/cassette.h" |
| 24 | |
| 25 | static UINT8 lx383_scan_counter; |
| 26 | static UINT8 lx383_key[LX383_KEYS]; |
| 27 | static int lx383_downsampler; |
| 28 | static int nmi_delay_counter; |
| 29 | static const device_config *z80ne_ay31015; |
| 30 | static UINT8 lx385_ctrl = 0x1f; |
| 31 | static const device_config *lx388_kr2376; |
| 32 | |
| 33 | |
| 34 | |
| 35 | /* timer to read cassette waveforms */ |
| 36 | static emu_timer *cassette_timer; |
| 37 | |
| 38 | /* wave duration threshold */ |
| 39 | typedef enum |
| 40 | { |
| 41 | TAPE_300BPS = 300, /* 300 bps */ |
| 42 | TAPE_600BPS = 600, /* 600 bps */ |
| 43 | TAPE_1200BPS = 1200 /* 1200 bps */ |
| 44 | } z80netape_speed; |
| 45 | |
| 46 | static struct { |
| 47 | struct { |
| 48 | int length; /* time cassette level is at input.level */ |
| 49 | int level; /* cassette level */ |
| 50 | int bit; /* bit being read */ |
| 51 | } input; |
| 52 | struct { |
| 53 | int length; /* time cassette level is at output.level */ |
| 54 | int level; /* cassette level */ |
| 55 | int bit; /* bit to to output */ |
| 56 | } output; |
| 57 | z80netape_speed speed; /* 300 - 600 - 1200 */ |
| 58 | int wave_filter; |
| 59 | int wave_length; |
| 60 | int wave_short; |
| 61 | int wave_long; |
| 62 | } cass_data; |
| 63 | |
| 64 | static const device_config *cassette_device_image(running_machine *machine) |
| 65 | { |
| 66 | if (lx385_ctrl & 0x08) |
| 67 | return devtag_get_device(machine, "cassetteb"); |
| 68 | else |
| 69 | return devtag_get_device(machine, "cassettea"); |
| 70 | } |
| 71 | |
| 72 | static TIMER_CALLBACK(z80ne_cassette_tc) |
| 73 | { |
| 74 | UINT8 cass_ws = 0; |
| 75 | cass_data.input.length++; |
| 76 | |
| 77 | cass_ws = (cassette_input(cassette_device_image(machine)) > +0.02) ? 1 : 0; |
| 78 | |
| 79 | if ((cass_ws ^ cass_data.input.level) & cass_ws) |
| 80 | { |
| 81 | cass_data.input.level = cass_ws; |
| 82 | cass_data.input.bit = ((cass_data.input.length < cass_data.wave_filter) || (cass_data.input.length > 0x20)) ? 1 : 0; |
| 83 | cass_data.input.length = 0; |
| 84 | ay31015_set_input_pin( z80ne_ay31015, AY31015_SI, cass_data.input.bit ); |
| 85 | } |
| 86 | cass_data.input.level = cass_ws; |
| 87 | |
| 88 | /* saving a tape - convert the serial stream from the uart */ |
| 89 | |
| 90 | cass_data.output.length--; |
| 91 | |
| 92 | if (!(cass_data.output.length)) |
| 93 | { |
| 94 | if (cass_data.output.level) |
| 95 | cass_data.output.level = 0; |
| 96 | else |
| 97 | { |
| 98 | cass_data.output.level=1; |
| 99 | cass_ws = ay31015_get_output_pin( z80ne_ay31015, AY31015_SO ); |
| 100 | cass_data.wave_length = cass_ws ? cass_data.wave_short : cass_data.wave_long; |
| 101 | } |
| 102 | cassette_output(cassette_device_image(machine), cass_data.output.level ? -1.0 : +1.0); |
| 103 | cass_data.output.length = cass_data.wave_length; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | |
| 108 | DRIVER_INIT( z80ne ) |
| 109 | { |
| 110 | /* first two entries point to rom on reset */ |
| 111 | UINT8 *RAM = memory_region(machine, "z80ne"); |
| 112 | memory_configure_bank(machine, 1, 0, 2, &RAM[0x0000], 0x8000); |
| 113 | } |
| 114 | |
| 115 | DRIVER_INIT( z80net ) |
| 116 | { |
| 117 | DRIVER_INIT_CALL(z80ne); |
| 118 | } |
| 119 | |
| 120 | DRIVER_INIT( z80netb ) |
| 121 | { |
| 122 | } |
| 123 | |
| 124 | /* after the first 3 bytes have been read from ROM, switch the ram back in */ |
| 125 | static TIMER_CALLBACK(z80ne_reset_address_decoder) |
| 126 | { |
| 127 | memory_set_bank(machine, 1, 0); |
| 128 | } |
| 129 | |
| 130 | static TIMER_CALLBACK( z80ne_kbd_scan ) |
| 131 | { |
| 132 | /* |
| 133 | * NE555 is connected to a 74LS93 binary counter |
| 134 | * 74LS93 output: |
| 135 | * QA-QC: column index for LEDs and keyboard |
| 136 | * QD: keyboard row select |
| 137 | * |
| 138 | * Port F0 input bit assignment: |
| 139 | * 0 QA bits 0..3 of row counter |
| 140 | * 1 QB |
| 141 | * 2 QC |
| 142 | * 3 QD |
| 143 | * 4 Control button pressed, active high |
| 144 | * 5 Always low |
| 145 | * 6 Always low |
| 146 | * 7 Selected button pressed, active low |
| 147 | * |
| 148 | * |
| 149 | */ |
| 150 | |
| 151 | static UINT16 key_bits; |
| 152 | static UINT8 ctrl, rst; |
| 153 | static UINT8 i; |
| 154 | |
| 155 | // 4-bit counter |
| 156 | --lx383_scan_counter; |
| 157 | lx383_scan_counter &= 0x0f; |
| 158 | |
| 159 | if ( --lx383_downsampler == 0 ) |
| 160 | { |
| 161 | lx383_downsampler = LX383_DOWNSAMPLING; |
| 162 | key_bits = (input_port_read(machine, "ROW1") << 8) | input_port_read(machine, "ROW0"); |
| 163 | rst = input_port_read(machine, "RST"); |
| 164 | ctrl = input_port_read(machine, "CTRL"); |
| 165 | |
| 166 | for ( i = 0; i<LX383_KEYS; i++) |
| 167 | { |
| 168 | lx383_key[i] = ( i | (key_bits & 0x01 ? 0x80 : 0x00) | ~ctrl); |
| 169 | key_bits >>= 1; |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | /* |
| 175 | * Handle NMI delay for single step instruction |
| 176 | */ |
| 177 | //static offs_t nmi_delay_count(ATTR_UNUSED const address_space *space, ATTR_UNUSED offs_t address, direct_read_data *direct) |
| 178 | static DIRECT_UPDATE_HANDLER( nmi_delay_count ) |
| 179 | { |
| 180 | nmi_delay_counter--; |
| 181 | |
| 182 | if (!nmi_delay_counter) |
| 183 | { |
| 184 | memory_set_direct_update_handler( space, NULL ); |
| 185 | cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); |
| 186 | } |
| 187 | return address; |
| 188 | } |
| 189 | |
| 190 | MACHINE_RESET(z80ne_base) |
| 191 | { |
| 192 | int i; |
| 193 | const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM); |
| 194 | |
| 195 | logerror("In MACHINE_RESET z80ne_base\n"); |
| 196 | |
| 197 | for ( i=0; i<LX383_KEYS; i++) |
| 198 | lx383_key[i] = 0xf0 | i; |
| 199 | lx383_scan_counter = 0x0f; |
| 200 | lx383_downsampler = LX383_DOWNSAMPLING; |
| 201 | timer_pulse(machine, ATTOTIME_IN_HZ(1000), NULL, 0, z80ne_kbd_scan ); |
| 202 | |
| 203 | /* Initialize cassette interface */ |
| 204 | switch(input_port_read(machine, "LX.385") & 0x07) |
| 205 | { |
| 206 | case 0x01: |
| 207 | cass_data.speed = TAPE_300BPS; |
| 208 | cass_data.wave_filter = LX385_TAPE_SAMPLE_FREQ / 1600; |
| 209 | cass_data.wave_short = LX385_TAPE_SAMPLE_FREQ / (2400 * 2); |
| 210 | cass_data.wave_long = LX385_TAPE_SAMPLE_FREQ / (1200 * 2); |
| 211 | break; |
| 212 | case 0x02: |
| 213 | cass_data.speed = TAPE_600BPS; |
| 214 | cass_data.wave_filter = LX385_TAPE_SAMPLE_FREQ / 3200; |
| 215 | cass_data.wave_short = LX385_TAPE_SAMPLE_FREQ / (4800 * 2); |
| 216 | cass_data.wave_long = LX385_TAPE_SAMPLE_FREQ / (2400 * 2); |
| 217 | break; |
| 218 | case 0x04: |
| 219 | cass_data.speed = TAPE_1200BPS; |
| 220 | cass_data.wave_filter = LX385_TAPE_SAMPLE_FREQ / 6400; |
| 221 | cass_data.wave_short = LX385_TAPE_SAMPLE_FREQ / (9600 * 2); |
| 222 | cass_data.wave_long = LX385_TAPE_SAMPLE_FREQ / (4800 * 2); |
| 223 | } |
| 224 | // cass_data.output.length = 0; |
| 225 | cass_data.wave_length = cass_data.wave_short; |
| 226 | cass_data.output.length = cass_data.wave_length; |
| 227 | cass_data.output.level = 1; |
| 228 | cass_data.input.length = 0; |
| 229 | cass_data.input.bit = 1; |
| 230 | |
| 231 | z80ne_ay31015 = devtag_get_device(machine, "ay_3_1015"); |
| 232 | ay31015_set_input_pin( z80ne_ay31015, AY31015_CS, 0 ); |
| 233 | ay31015_set_input_pin( z80ne_ay31015, AY31015_NB1, 1 ); |
| 234 | ay31015_set_input_pin( z80ne_ay31015, AY31015_NB2, 1 ); |
| 235 | ay31015_set_input_pin( z80ne_ay31015, AY31015_TSB, 1 ); |
| 236 | ay31015_set_input_pin( z80ne_ay31015, AY31015_EPS, 1 ); |
| 237 | ay31015_set_input_pin( z80ne_ay31015, AY31015_NP, input_port_read(machine, "LX.385") & 0x80 ? 1 : 0 ); |
| 238 | ay31015_set_input_pin( z80ne_ay31015, AY31015_CS, 1 ); |
| 239 | ay31015_set_receiver_clock( z80ne_ay31015, cass_data.speed * 16.0); |
| 240 | ay31015_set_transmitter_clock( z80ne_ay31015, cass_data.speed * 16.0); |
| 241 | |
| 242 | memory_set_direct_update_handler( space, NULL ); |
| 243 | nmi_delay_counter = 0; |
| 244 | lx385_ctrl_w(space, 0, 0); |
| 245 | |
| 246 | } |
| 247 | |
| 248 | MACHINE_RESET(z80ne) |
| 249 | { |
| 250 | // UINT8 *RAM = memory_region(machine, "z80ne"); |
| 251 | // memory_configure_bank(machine, 1, 0, 2, &RAM[0x0000], 0x8000); |
| 252 | |
| 253 | /* after the first 3 bytes have been read from ROM, switch the ram back in */ |
| 254 | timer_set(machine, ATTOTIME_IN_USEC(6), NULL, 0, z80ne_reset_address_decoder); |
| 255 | memory_set_bank(machine, 1, 1); |
| 256 | |
| 257 | logerror("In MACHINE_RESET z80ne\n"); |
| 258 | MACHINE_RESET_CALL( z80ne_base ); |
| 259 | } |
| 260 | |
| 261 | MACHINE_RESET(z80net) |
| 262 | { |
| 263 | MACHINE_RESET_CALL( z80ne ); |
| 264 | logerror("In MACHINE_RESET z80net\n"); |
| 265 | |
| 266 | lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376"); |
| 267 | kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0); |
| 268 | kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0); |
| 269 | } |
| 270 | |
| 271 | MACHINE_RESET(z80netb) |
| 272 | { |
| 273 | MACHINE_RESET_CALL( z80ne_base ); |
| 274 | logerror("In MACHINE_RESET z80netb\n"); |
| 275 | |
| 276 | lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376"); |
| 277 | kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0); |
| 278 | kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0); |
| 279 | } |
| 280 | |
| 281 | INPUT_CHANGED( z80ne_reset ) |
| 282 | { |
| 283 | UINT8 rst; |
| 284 | rst = input_port_read(field->port->machine, "RST"); |
| 285 | |
| 286 | if ( ! BIT(rst, 0)) |
| 287 | { |
| 288 | running_machine *machine = field->port->machine; |
| 289 | //MACHINE_RESET_CALL(z80ne); |
| 290 | //device_reset(machine->cpu[0]); |
| 291 | mame_schedule_soft_reset(machine); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | INPUT_CHANGED( z80ne_nmi ) |
| 296 | { |
| 297 | UINT8 nmi; |
| 298 | nmi = input_port_read(field->port->machine, "LX388_BRK"); |
| 299 | |
| 300 | if ( ! BIT(nmi, 0)) |
| 301 | { |
| 302 | cpu_set_input_line(field->port->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | MACHINE_START( z80ne ) |
| 307 | { |
| 308 | logerror("In MACHINE_START z80ne\n"); |
| 309 | state_save_register_item( machine, "z80ne", NULL, 0, lx383_scan_counter ); |
| 310 | state_save_register_item( machine, "z80ne", NULL, 0, lx383_downsampler ); |
| 311 | state_save_register_item_array( machine, "z80ne", NULL, 0, lx383_key ); |
| 312 | state_save_register_item( machine, "z80ne", NULL, 0, nmi_delay_counter ); |
| 313 | cassette_timer = timer_alloc(machine, z80ne_cassette_tc, NULL); |
| 314 | } |
| 315 | |
| 316 | MACHINE_START( z80net ) |
| 317 | { |
| 318 | MACHINE_START_CALL( z80ne ); |
| 319 | logerror("In MACHINE_START z80net\n"); |
| 320 | } |
| 321 | |
| 322 | MACHINE_START( z80netb ) |
| 323 | { |
| 324 | MACHINE_START_CALL( z80net ); |
| 325 | logerror("In MACHINE_START z80netb\n"); |
| 326 | } |
| 327 | |
| 328 | /****************************************************************************** |
| 329 | Drivers |
| 330 | ******************************************************************************/ |
| 331 | |
| 332 | /* LX.383 - LX.384 HEX keyboard and display */ |
| 333 | READ8_HANDLER( lx383_r ) |
| 334 | { |
| 335 | /* |
| 336 | * Keyboard scanning |
| 337 | * |
| 338 | * IC14 NE555 astable oscillator |
| 339 | * IC13 74LS93 binary counter |
| 340 | * IC5 74LS240 tri-state buffer |
| 341 | * |
| 342 | * l'oscillatore NE555 alimenta il clock del contatore 74LS93 |
| 343 | * D0 - Q(A) --\ |
| 344 | * D1 - Q(B) |-- column |
| 345 | * D2 - Q(C) --/ |
| 346 | * D3 - Q(D) row |
| 347 | * D4 - CTRL |
| 348 | * D5 - 0 |
| 349 | * D6 - 0 |
| 350 | * D7 - ~KEY Pressed |
| 351 | */ |
| 352 | return lx383_key[lx383_scan_counter]; |
| 353 | } |
| 354 | |
| 355 | //#define ATTR_UNUSED __attribute__((__unused__)) |
| 356 | WRITE8_HANDLER( lx383_w ) |
| 357 | { |
| 358 | /* |
| 359 | * First 8 locations (F0-F7) are mapped to a dual-port 8-byte RAM |
| 360 | * The 1KHz NE-555 astable oscillator circuit drive |
| 361 | * a 4-bit 74LS93 binary counter. |
| 362 | * The 3 least sigificant bits of the counter are connected |
| 363 | * both to the read addres of the dual-port ram and to |
| 364 | * a 74LS156 3 to 8 binary decoder driving the cathode |
| 365 | * of 8 7-segments LEDS. |
| 366 | * The data output of the dual-port ram drive the anodes |
| 367 | * of the LEDS through 74LS07 buffers. |
| 368 | * LED segments - dual-port RAM bit: |
| 369 | * A 0x01 |
| 370 | * B 0x02 |
| 371 | * C 0x04 |
| 372 | * D 0x08 |
| 373 | * E 0x10 |
| 374 | * F 0x20 |
| 375 | * G 0x40 |
| 376 | * P 0x80 (represented by DP in original schematics) |
| 377 | * |
| 378 | * A write in the range F0-FF starts a 74LS90 counter |
| 379 | * that trigger the NMI line of the CPU afther 2 instruction |
| 380 | * fetch cycles for single step execution. |
| 381 | */ |
| 382 | |
| 383 | if ( offset < 8 ) |
| 384 | output_set_digit_value( offset, data ^ 0xff ); |
| 385 | else |
| 386 | /* after writing to port 0xF8 and the first ~M1 cycles strike a NMI for single step execution */ |
| 387 | nmi_delay_counter = 1; |
| 388 | memory_set_direct_update_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM),nmi_delay_count); |
| 389 | } |
| 390 | |
| 391 | |
| 392 | /* LX.385 Cassette tape interface */ |
| 393 | /* |
| 394 | * NE555 is connected to a 74LS93 binary counter |
| 395 | * 74LS93 output: |
| 396 | * QA-QC: colum index for LEDs and keyboard |
| 397 | * QD: keyboard row select |
| 398 | * |
| 399 | * Port EE: UART Data Read/Write |
| 400 | * Port EF: Status/Control |
| 401 | * read, UART status bits read |
| 402 | * 0 OR Overrun |
| 403 | * 1 FE Framing Error |
| 404 | * 2 PE Parity Error |
| 405 | * 3 TBMT Transmitter Buffer Empty |
| 406 | * 4 DAV Data Available |
| 407 | * 5 EOC End Of Character |
| 408 | * 6 1 |
| 409 | * 7 1 |
| 410 | * write, UART control bits / Tape Unit select / Modulation control |
| 411 | * 0 bit1=0, bit0=0 UART Reset pulse |
| 412 | * 1 bit1=0, bit0=1 UART RDAV (Reset Data Available) pulse |
| 413 | * 2 Tape modulation enable |
| 414 | * 3 *TAPEA Enable (active low) (at reset: low) |
| 415 | * 4 *TAPEB Enable (active low) (at reset: low) |
| 416 | * Cassette is connected to the uart data input and output via the cassette |
| 417 | * interface hardware. |
| 418 | * |
| 419 | * The cassette interface hardware converts square-wave pulses into bits which the uart receives. |
| 420 | * |
| 421 | * 1. the cassette format: "frequency shift" is converted |
| 422 | into the uart data format "non-return to zero" |
| 423 | |
| 424 | 2. on cassette a 1 data bit is stored as 8 2400 Hz pulses |
| 425 | and a 0 data bit as 4 1200 Hz pulses |
| 426 | - At 1200 baud, a logic 1 is 1 cycle of 1200 Hz and a logic 0 is 1/2 cycle of 600 Hz. |
| 427 | - At 300 baud, a logic 1 is 8 cycles of 2400 Hz and a logic 0 is 4 cycles of 1200 Hz. |
| 428 | |
| 429 | Attenuation is applied to the signal and the square wave edges are rounded. |
| 430 | |
| 431 | A manchester encoder is used. A flip-flop synchronises input |
| 432 | data on the positive-edge of the clock pulse. |
| 433 | * |
| 434 | */ |
| 435 | READ8_HANDLER(lx385_data_r) |
| 436 | { |
| 437 | return ay31015_get_received_data( z80ne_ay31015 ); |
| 438 | } |
| 439 | |
| 440 | READ8_HANDLER(lx385_ctrl_r) |
| 441 | { |
| 442 | /* set unused bits high */ |
| 443 | UINT8 data = 0xc0; |
| 444 | // UINT8 olddata = 0xc0; |
| 445 | |
| 446 | ay31015_set_input_pin( z80ne_ay31015, AY31015_SWE, 0 ); |
| 447 | data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_OR ) ? 0x01 : 0); |
| 448 | data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_FE ) ? 0x02 : 0); |
| 449 | data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_PE ) ? 0x04 : 0); |
| 450 | data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_TBMT ) ? 0x08 : 0); |
| 451 | data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_DAV ) ? 0x10 : 0); |
| 452 | data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_EOC ) ? 0x20 : 0); |
| 453 | ay31015_set_input_pin( z80ne_ay31015, AY31015_SWE, 1 ); |
| 454 | |
| 455 | return data; |
| 456 | } |
| 457 | WRITE8_HANDLER(lx385_data_w) |
| 458 | { |
| 459 | ay31015_set_transmit_data( z80ne_ay31015, data ); |
| 460 | } |
| 461 | |
| 462 | #define LX385_CASSETTE_MOTOR_MASK ((1<<3)|(1<<4)) |
| 463 | |
| 464 | WRITE8_HANDLER(lx385_ctrl_w) |
| 465 | { |
| 466 | /* Translate data to control signals |
| 467 | * 0 bit1=0, bit0=0 UART Reset pulse |
| 468 | * 1 bit1=0, bit0=1 UART RDAV (Reset Data Available) pulse |
| 469 | * 2 UART Tx Clock Enable (active high) |
| 470 | * 3 *TAPEA Enable (active low) (at reset: low) |
| 471 | * 4 *TAPEB Enable (active low) (at reset: low) |
| 472 | */ |
| 473 | UINT8 uart_reset, uart_rdav, uart_tx_clock; |
| 474 | UINT8 motor_a, motor_b; |
| 475 | UINT8 changed_bits = (lx385_ctrl ^ data) & 0x1C; |
| 476 | lx385_ctrl = data; |
| 477 | |
| 478 | uart_reset = ((data & 0x03) == 0x00); |
| 479 | uart_rdav = ((data & 0x03) == 0x01); |
| 480 | uart_tx_clock = ((data & 0x04) == 0x04); |
| 481 | motor_a = ((data & 0x08) == 0x00); |
| 482 | motor_b = ((data & 0x10) == 0x00); |
| 483 | |
| 484 | /* UART Reset and RDAV */ |
| 485 | if(uart_reset) |
| 486 | { |
| 487 | ay31015_set_input_pin( z80ne_ay31015, AY31015_XR, 1 ); |
| 488 | ay31015_set_input_pin( z80ne_ay31015, AY31015_XR, 0 ); |
| 489 | } |
| 490 | |
| 491 | if(uart_rdav) |
| 492 | { |
| 493 | ay31015_set_input_pin( z80ne_ay31015, AY31015_RDAV, 1 ); |
| 494 | ay31015_set_input_pin( z80ne_ay31015, AY31015_RDAV, 0 ); |
| 495 | } |
| 496 | |
| 497 | if (!changed_bits) return; |
| 498 | |
| 499 | /* UART Tx Clock enable/disable */ |
| 500 | if(changed_bits & 0x04) |
| 501 | ay31015_set_transmitter_clock( z80ne_ay31015, uart_tx_clock ? cass_data.speed * 16.0 : 0.0); |
| 502 | |
| 503 | /* motors */ |
| 504 | if(changed_bits & 0x18) |
| 505 | { |
| 506 | cassette_change_state(devtag_get_device(space->machine, "cassettea"), |
| 507 | (motor_a) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); |
| 508 | |
| 509 | cassette_change_state(devtag_get_device(space->machine, "cassetteb"), |
| 510 | (motor_b) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); |
| 511 | |
| 512 | if (motor_a || motor_b) |
| 513 | timer_adjust_periodic(cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(LX385_TAPE_SAMPLE_FREQ)); |
| 514 | else |
| 515 | timer_adjust_oneshot(cassette_timer, attotime_zero, 0); |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | READ8_HANDLER(lx388_data_r) |
| 520 | { |
| 521 | UINT8 data; |
| 522 | |
| 523 | data = kr2376_data_r(lx388_kr2376, 0) & 0x7f; |
| 524 | data |= kr2376_get_output_pin(lx388_kr2376, KR2376_SO) << 7; |
| 525 | return data; |
| 526 | } |
| 527 | |
| 528 | READ8_HANDLER(lx388_read_field_sync) |
| 529 | { |
| 530 | UINT8 data; |
| 531 | |
| 532 | data = m6847_get_field_sync(space->machine) ? 0x00 : 0x80; |
| 533 | return data; |
| 534 | } |
src/mess/layout/z80ne.lay
| r0 | r4461 | |
| 1 | <?xml version="1.0"?> |
| 2 | <!-- z80ne.lay --> |
| 3 | <!-- 2009-01-16: Initial version. [Roberto Lavarone] --> |
| 4 | |
| 5 | <mamelayout version="2"> |
| 6 | |
| 7 | <element name="button" defstate="1" /> |
| 8 | |
| 9 | <element name="black"> |
| 10 | <rect> |
| 11 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 12 | <color red="0.0" green="0.0" blue="0.0" /> |
| 13 | </rect> |
| 14 | </element> |
| 15 | |
| 16 | <element name="gray"> |
| 17 | <rect> |
| 18 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 19 | <color red="0.15" green="0.15" blue="0.15" /> |
| 20 | </rect> |
| 21 | </element> |
| 22 | |
| 23 | <element name="digit_back"> |
| 24 | <rect> |
| 25 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 26 | <color red="0.584" green="0.631" blue="0.690" /> |
| 27 | </rect> |
| 28 | </element> |
| 29 | |
| 30 | <element name="digit" defstate="0"> |
| 31 | <led7seg> |
| 32 | <color red="0.75" green="0.0" blue="0.0"/> |
| 33 | </led7seg> |
| 34 | </element> |
| 35 | |
| 36 | <element name="back"> |
| 37 | <rect> |
| 38 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 39 | <color red="0.0" green="0.0" blue="0.0" /> |
| 40 | </rect> |
| 41 | </element> |
| 42 | |
| 43 | <element name="pushbutton" defstate="1"> |
| 44 | <rect> |
| 45 | <bounds x="2" y="2" width="48" height="48"/> |
| 46 | <color red="0.1" green="0.1" blue="0.1" /> |
| 47 | </rect> |
| 48 | <rect state="0"> |
| 49 | <bounds x="0" y="0" width="48" height="48"/> |
| 50 | <color red="0.75" green="0.75" blue="0.0" /> |
| 51 | </rect> |
| 52 | <rect state="1"> |
| 53 | <bounds x="2" y="2" width="48" height="48"/> |
| 54 | <color red="0.75" green="0.75" blue="0.0" /> |
| 55 | </rect> |
| 56 | </element> |
| 57 | |
| 58 | <element name="pushbuttonCTRL" defstate="1"> |
| 59 | <rect> |
| 60 | <bounds x="2" y="2" width="48" height="48"/> |
| 61 | <color red="0.1" green="0.1" blue="0.1" /> |
| 62 | </rect> |
| 63 | <rect state="0"> |
| 64 | <bounds x="0" y="0" width="48" height="48"/> |
| 65 | <color red="0.25" green="0.25" blue="0.25" /> |
| 66 | </rect> |
| 67 | <text string="CTRL" state="0"> |
| 68 | <bounds x="8" y="24" width="40" height="20"/> |
| 69 | <color red="1.0" green="1.0" blue="1.0" /> |
| 70 | </text> |
| 71 | <rect state="1"> |
| 72 | <bounds x="2" y="2" width="48" height="48"/> |
| 73 | <color red="0.25" green="0.25" blue="0.25" /> |
| 74 | </rect> |
| 75 | <text string="CTRL" state="1"> |
| 76 | <bounds x="10" y="26" width="40" height="20"/> |
| 77 | <color red="1.0" green="1.0" blue="1.0" /> |
| 78 | </text> |
| 79 | </element> |
| 80 | |
| 81 | <element name="pushbuttonRST" defstate="1"> |
| 82 | <rect> |
| 83 | <bounds x="2" y="2" width="48" height="48"/> |
| 84 | <color red="0.1" green="0.1" blue="0.1" /> |
| 85 | </rect> |
| 86 | <rect state="0"> |
| 87 | <bounds x="0" y="0" width="48" height="48"/> |
| 88 | <color red="0.75" green="0" blue="0" /> |
| 89 | </rect> |
| 90 | <text string="RST " state="0"> |
| 91 | <bounds x="8" y="24" width="40" height="20"/> |
| 92 | <color red="1.0" green="1.0" blue="1.0" /> |
| 93 | </text> |
| 94 | <rect state="1"> |
| 95 | <bounds x="2" y="2" width="48" height="48"/> |
| 96 | <color red="0.75" green="0" blue="0" /> |
| 97 | </rect> |
| 98 | <text string="RST " state="1"> |
| 99 | <bounds x="10" y="26" width="40" height="20"/> |
| 100 | <color red="1.0" green="1.0" blue="1.0" /> |
| 101 | </text> |
| 102 | </element> |
| 103 | |
| 104 | <element name="pushbutton0" defstate="1"> |
| 105 | <rect> |
| 106 | <bounds x="2" y="2" width="48" height="48"/> |
| 107 | <color red="0.1" green="0.1" blue="0.1" /> |
| 108 | </rect> |
| 109 | <rect state="0"> |
| 110 | <bounds x="0" y="0" width="48" height="48"/> |
| 111 | <color red="0.0" green="0.0" blue="0.75" /> |
| 112 | </rect> |
| 113 | <text string=" 0 " state="0"> |
| 114 | <bounds x="8" y="24" width="40" height="20"/> |
| 115 | <color red="1.0" green="1.0" blue="1.0" /> |
| 116 | </text> |
| 117 | <rect state="1"> |
| 118 | <bounds x="2" y="2" width="48" height="48"/> |
| 119 | <color red="0.0" green="0.0" blue="0.75" /> |
| 120 | </rect> |
| 121 | <text string=" 0 " state="1"> |
| 122 | <bounds x="10" y="26" width="40" height="20"/> |
| 123 | <color red="1.0" green="1.0" blue="1.0" /> |
| 124 | </text> |
| 125 | </element> |
| 126 | |
| 127 | <element name="pushbutton1" defstate="1"> |
| 128 | <rect> |
| 129 | <bounds x="2" y="2" width="48" height="48"/> |
| 130 | <color red="0.1" green="0.1" blue="0.1" /> |
| 131 | </rect> |
| 132 | <rect state="0"> |
| 133 | <bounds x="0" y="0" width="48" height="48"/> |
| 134 | <color red="0.0" green="0.0" blue="0.75" /> |
| 135 | </rect> |
| 136 | <text string=" 1 " state="0"> |
| 137 | <bounds x="8" y="24" width="40" height="20"/> |
| 138 | <color red="1.0" green="1.0" blue="1.0" /> |
| 139 | </text> |
| 140 | <rect state="1"> |
| 141 | <bounds x="2" y="2" width="48" height="48"/> |
| 142 | <color red="0.0" green="0.0" blue="0.75" /> |
| 143 | </rect> |
| 144 | <text string=" 1 " state="1"> |
| 145 | <bounds x="10" y="26" width="40" height="20"/> |
| 146 | <color red="1.0" green="1.0" blue="1.0" /> |
| 147 | </text> |
| 148 | </element> |
| 149 | |
| 150 | <element name="pushbutton2" defstate="1"> |
| 151 | <rect> |
| 152 | <bounds x="2" y="2" width="48" height="48"/> |
| 153 | <color red="0.1" green="0.1" blue="0.1" /> |
| 154 | </rect> |
| 155 | <rect state="0"> |
| 156 | <bounds x="0" y="0" width="48" height="48"/> |
| 157 | <color red="0.0" green="0.0" blue="0.75" /> |
| 158 | </rect> |
| 159 | <text string=" 2 " state="0"> |
| 160 | <bounds x="8" y="24" width="40" height="20"/> |
| 161 | <color red="1.0" green="1.0" blue="1.0" /> |
| 162 | </text> |
| 163 | <rect state="1"> |
| 164 | <bounds x="2" y="2" width="48" height="48"/> |
| 165 | <color red="0.0" green="0.0" blue="0.75" /> |
| 166 | </rect> |
| 167 | <text string=" 2 " state="1"> |
| 168 | <bounds x="10" y="26" width="40" height="20"/> |
| 169 | <color red="1.0" green="1.0" blue="1.0" /> |
| 170 | </text> |
| 171 | </element> |
| 172 | |
| 173 | <element name="pushbutton3" defstate="1"> |
| 174 | <rect> |
| 175 | <bounds x="2" y="2" width="48" height="48"/> |
| 176 | <color red="0.1" green="0.1" blue="0.1" /> |
| 177 | </rect> |
| 178 | <rect state="0"> |
| 179 | <bounds x="0" y="0" width="48" height="48"/> |
| 180 | <color red="0.0" green="0.0" blue="0.75" /> |
| 181 | </rect> |
| 182 | <text string=" 3 " state="0"> |
| 183 | <bounds x="8" y="24" width="40" height="20"/> |
| 184 | <color red="1.0" green="1.0" blue="1.0" /> |
| 185 | </text> |
| 186 | <rect state="1"> |
| 187 | <bounds x="2" y="2" width="48" height="48"/> |
| 188 | <color red="0.0" green="0.0" blue="0.75" /> |
| 189 | </rect> |
| 190 | <text string=" 3 " state="1"> |
| 191 | <bounds x="10" y="26" width="40" height="20"/> |
| 192 | <color red="1.0" green="1.0" blue="1.0" /> |
| 193 | </text> |
| 194 | </element> |
| 195 | |
| 196 | <element name="pushbutton4" defstate="1"> |
| 197 | <rect> |
| 198 | <bounds x="2" y="2" width="48" height="48"/> |
| 199 | <color red="0.1" green="0.1" blue="0.1" /> |
| 200 | </rect> |
| 201 | <rect state="0"> |
| 202 | <bounds x="0" y="0" width="48" height="48"/> |
| 203 | <color red="0.0" green="0.0" blue="0.75" /> |
| 204 | </rect> |
| 205 | <text string=" 4 " state="0"> |
| 206 | <bounds x="8" y="24" width="40" height="20"/> |
| 207 | <color red="1.0" green="1.0" blue="1.0" /> |
| 208 | </text> |
| 209 | <rect state="1"> |
| 210 | <bounds x="2" y="2" width="48" height="48"/> |
| 211 | <color red="0.0" green="0.0" blue="0.75" /> |
| 212 | </rect> |
| 213 | <text string=" 4 " state="1"> |
| 214 | <bounds x="10" y="26" width="40" height="20"/> |
| 215 | <color red="1.0" green="1.0" blue="1.0" /> |
| 216 | </text> |
| 217 | </element> |
| 218 | |
| 219 | <element name="pushbutton5" defstate="1"> |
| 220 | <rect> |
| 221 | <bounds x="2" y="2" width="48" height="48"/> |
| 222 | <color red="0.1" green="0.1" blue="0.1" /> |
| 223 | </rect> |
| 224 | <rect state="0"> |
| 225 | <bounds x="0" y="0" width="48" height="48"/> |
| 226 | <color red="0.0" green="0.0" blue="0.75" /> |
| 227 | </rect> |
| 228 | <text string=" 5 " state="0"> |
| 229 | <bounds x="8" y="24" width="40" height="20"/> |
| 230 | <color red="1.0" green="1.0" blue="1.0" /> |
| 231 | </text> |
| 232 | <rect state="1"> |
| 233 | <bounds x="2" y="2" width="48" height="48"/> |
| 234 | <color red="0.0" green="0.0" blue="0.75" /> |
| 235 | </rect> |
| 236 | <text string=" 5 " state="1"> |
| 237 | <bounds x="10" y="26" width="40" height="20"/> |
| 238 | <color red="1.0" green="1.0" blue="1.0" /> |
| 239 | </text> |
| 240 | </element> |
| 241 | |
| 242 | <element name="pushbutton6" defstate="1"> |
| 243 | <rect> |
| 244 | <bounds x="2" y="2" width="48" height="48"/> |
| 245 | <color red="0.1" green="0.1" blue="0.1" /> |
| 246 | </rect> |
| 247 | <rect state="0"> |
| 248 | <bounds x="0" y="0" width="48" height="48"/> |
| 249 | <color red="0.0" green="0.0" blue="0.75" /> |
| 250 | </rect> |
| 251 | <text string=" 6 " state="0"> |
| 252 | <bounds x="8" y="24" width="40" height="20"/> |
| 253 | <color red="1.0" green="1.0" blue="1.0" /> |
| 254 | </text> |
| 255 | <rect state="1"> |
| 256 | <bounds x="2" y="2" width="48" height="48"/> |
| 257 | <color red="0.0" green="0.0" blue="0.75" /> |
| 258 | </rect> |
| 259 | <text string=" 6 " state="1"> |
| 260 | <bounds x="10" y="26" width="40" height="20"/> |
| 261 | <color red="1.0" green="1.0" blue="1.0" /> |
| 262 | </text> |
| 263 | </element> |
| 264 | |
| 265 | <element name="pushbutton7" defstate="1"> |
| 266 | <rect> |
| 267 | <bounds x="2" y="2" width="48" height="48"/> |
| 268 | <color red="0.1" green="0.1" blue="0.1" /> |
| 269 | </rect> |
| 270 | <rect state="0"> |
| 271 | <bounds x="0" y="0" width="48" height="48"/> |
| 272 | <color red="0.0" green="0.0" blue="0.75" /> |
| 273 | </rect> |
| 274 | <text string=" 7 " state="0"> |
| 275 | <bounds x="8" y="24" width="40" height="20"/> |
| 276 | <color red="1.0" green="1.0" blue="1.0" /> |
| 277 | </text> |
| 278 | <rect state="1"> |
| 279 | <bounds x="2" y="2" width="48" height="48"/> |
| 280 | <color red="0.0" green="0.0" blue="0.75" /> |
| 281 | </rect> |
| 282 | <text string=" 7 " state="1"> |
| 283 | <bounds x="10" y="26" width="40" height="20"/> |
| 284 | <color red="1.0" green="1.0" blue="1.0" /> |
| 285 | </text> |
| 286 | </element> |
| 287 | |
| 288 | <element name="pushbutton8" defstate="1"> |
| 289 | <rect> |
| 290 | <bounds x="2" y="2" width="48" height="48"/> |
| 291 | <color red="0.1" green="0.1" blue="0.1" /> |
| 292 | </rect> |
| 293 | <rect state="0"> |
| 294 | <bounds x="0" y="0" width="48" height="48"/> |
| 295 | <color red="0.0" green="0.0" blue="0.75" /> |
| 296 | </rect> |
| 297 | <text string=" 8 " state="0"> |
| 298 | <bounds x="8" y="24" width="40" height="20"/> |
| 299 | <color red="1.0" green="1.0" blue="1.0" /> |
| 300 | </text> |
| 301 | <rect state="1"> |
| 302 | <bounds x="2" y="2" width="48" height="48"/> |
| 303 | <color red="0.0" green="0.0" blue="0.75" /> |
| 304 | </rect> |
| 305 | <text string=" 8 " state="1"> |
| 306 | <bounds x="10" y="26" width="40" height="20"/> |
| 307 | <color red="1.0" green="1.0" blue="1.0" /> |
| 308 | </text> |
| 309 | </element> |
| 310 | |
| 311 | <element name="pushbutton9" defstate="1"> |
| 312 | <rect> |
| 313 | <bounds x="2" y="2" width="48" height="48"/> |
| 314 | <color red="0.1" green="0.1" blue="0.1" /> |
| 315 | </rect> |
| 316 | <rect state="0"> |
| 317 | <bounds x="0" y="0" width="48" height="48"/> |
| 318 | <color red="0.0" green="0.0" blue="0.75" /> |
| 319 | </rect> |
| 320 | <text string=" 9 " state="0"> |
| 321 | <bounds x="8" y="24" width="40" height="20"/> |
| 322 | <color red="1.0" green="1.0" blue="1.0" /> |
| 323 | </text> |
| 324 | <rect state="1"> |
| 325 | <bounds x="2" y="2" width="48" height="48"/> |
| 326 | <color red="0.0" green="0.0" blue="0.75" /> |
| 327 | </rect> |
| 328 | <text string=" 9 " state="1"> |
| 329 | <bounds x="10" y="26" width="40" height="20"/> |
| 330 | <color red="1.0" green="1.0" blue="1.0" /> |
| 331 | </text> |
| 332 | </element> |
| 333 | |
| 334 | <element name="pushbuttonA" defstate="1"> |
| 335 | <rect> |
| 336 | <bounds x="2" y="2" width="48" height="48"/> |
| 337 | <color red="0.1" green="0.1" blue="0.1" /> |
| 338 | </rect> |
| 339 | <rect state="0"> |
| 340 | <bounds x="0" y="0" width="48" height="48"/> |
| 341 | <color red="0.0" green="0.0" blue="0.75" /> |
| 342 | </rect> |
| 343 | <text string=" A " state="0"> |
| 344 | <bounds x="8" y="24" width="40" height="20"/> |
| 345 | <color red="1.0" green="1.0" blue="1.0" /> |
| 346 | </text> |
| 347 | <rect state="1"> |
| 348 | <bounds x="2" y="2" width="48" height="48"/> |
| 349 | <color red="0.0" green="0.0" blue="0.75" /> |
| 350 | </rect> |
| 351 | <text string=" A " state="1"> |
| 352 | <bounds x="10" y="26" width="40" height="20"/> |
| 353 | <color red="1.0" green="1.0" blue="1.0" /> |
| 354 | </text> |
| 355 | </element> |
| 356 | |
| 357 | <element name="pushbuttonB" defstate="1"> |
| 358 | <rect> |
| 359 | <bounds x="2" y="2" width="48" height="48"/> |
| 360 | <color red="0.1" green="0.1" blue="0.1" /> |
| 361 | </rect> |
| 362 | <rect state="0"> |
| 363 | <bounds x="0" y="0" width="48" height="48"/> |
| 364 | <color red="0.0" green="0.0" blue="0.75" /> |
| 365 | </rect> |
| 366 | <text string=" B " state="0"> |
| 367 | <bounds x="8" y="24" width="40" height="20"/> |
| 368 | <color red="1.0" green="1.0" blue="1.0" /> |
| 369 | </text> |
| 370 | <rect state="1"> |
| 371 | <bounds x="2" y="2" width="48" height="48"/> |
| 372 | <color red="0.0" green="0.0" blue="0.75" /> |
| 373 | </rect> |
| 374 | <text string=" B " state="1"> |
| 375 | <bounds x="10" y="26" width="40" height="20"/> |
| 376 | <color red="1.0" green="1.0" blue="1.0" /> |
| 377 | </text> |
| 378 | </element> |
| 379 | |
| 380 | <element name="pushbuttonC" defstate="1"> |
| 381 | <rect> |
| 382 | <bounds x="2" y="2" width="48" height="48"/> |
| 383 | <color red="0.1" green="0.1" blue="0.1" /> |
| 384 | </rect> |
| 385 | <rect state="0"> |
| 386 | <bounds x="0" y="0" width="48" height="48"/> |
| 387 | <color red="0.0" green="0.0" blue="0.75" /> |
| 388 | </rect> |
| 389 | <text string=" C " state="0"> |
| 390 | <bounds x="8" y="24" width="40" height="20"/> |
| 391 | <color red="1.0" green="1.0" blue="1.0" /> |
| 392 | </text> |
| 393 | <rect state="1"> |
| 394 | <bounds x="2" y="2" width="48" height="48"/> |
| 395 | <color red="0.0" green="0.0" blue="0.75" /> |
| 396 | </rect> |
| 397 | <text string=" C " state="1"> |
| 398 | <bounds x="10" y="26" width="40" height="20"/> |
| 399 | <color red="1.0" green="1.0" blue="1.0" /> |
| 400 | </text> |
| 401 | </element> |
| 402 | |
| 403 | <element name="pushbuttonD" defstate="1"> |
| 404 | <rect> |
| 405 | <bounds x="2" y="2" width="48" height="48"/> |
| 406 | <color red="0.1" green="0.1" blue="0.1" /> |
| 407 | </rect> |
| 408 | <rect state="0"> |
| 409 | <bounds x="0" y="0" width="48" height="48"/> |
| 410 | <color red="0.0" green="0.0" blue="0.75" /> |
| 411 | </rect> |
| 412 | <text string=" D " state="0"> |
| 413 | <bounds x="8" y="24" width="40" height="20"/> |
| 414 | <color red="1.0" green="1.0" blue="1.0" /> |
| 415 | </text> |
| 416 | <rect state="1"> |
| 417 | <bounds x="2" y="2" width="48" height="48"/> |
| 418 | <color red="0.0" green="0.0" blue="0.75" /> |
| 419 | </rect> |
| 420 | <text string=" D " state="1"> |
| 421 | <bounds x="10" y="26" width="40" height="20"/> |
| 422 | <color red="1.0" green="1.0" blue="1.0" /> |
| 423 | </text> |
| 424 | </element> |
| 425 | |
| 426 | <element name="pushbuttonE" defstate="1"> |
| 427 | <rect> |
| 428 | <bounds x="2" y="2" width="48" height="48"/> |
| 429 | <color red="0.1" green="0.1" blue="0.1" /> |
| 430 | </rect> |
| 431 | <rect state="0"> |
| 432 | <bounds x="0" y="0" width="48" height="48"/> |
| 433 | <color red="0.0" green="0.0" blue="0.75" /> |
| 434 | </rect> |
| 435 | <text string=" E " state="0"> |
| 436 | <bounds x="8" y="24" width="40" height="20"/> |
| 437 | <color red="1.0" green="1.0" blue="1.0" /> |
| 438 | </text> |
| 439 | <rect state="1"> |
| 440 | <bounds x="2" y="2" width="48" height="48"/> |
| 441 | <color red="0.0" green="0.0" blue="0.75" /> |
| 442 | </rect> |
| 443 | <text string=" E " state="1"> |
| 444 | <bounds x="10" y="26" width="40" height="20"/> |
| 445 | <color red="1.0" green="1.0" blue="1.0" /> |
| 446 | </text> |
| 447 | </element> |
| 448 | |
| 449 | <element name="pushbuttonF" defstate="1"> |
| 450 | <rect> |
| 451 | <bounds x="2" y="2" width="48" height="48"/> |
| 452 | <color red="0.1" green="0.1" blue="0.1" /> |
| 453 | </rect> |
| 454 | <rect state="0"> |
| 455 | <bounds x="0" y="0" width="48" height="48"/> |
| 456 | <color red="0.0" green="0.0" blue="0.75" /> |
| 457 | </rect> |
| 458 | <text string=" F " state="0"> |
| 459 | <bounds x="8" y="24" width="40" height="20"/> |
| 460 | <color red="1.0" green="1.0" blue="1.0" /> |
| 461 | </text> |
| 462 | <rect state="1"> |
| 463 | <bounds x="2" y="2" width="48" height="48"/> |
| 464 | <color red="0.0" green="0.0" blue="0.75" /> |
| 465 | </rect> |
| 466 | <text string=" F " state="1"> |
| 467 | <bounds x="10" y="26" width="40" height="20"/> |
| 468 | <color red="1.0" green="1.0" blue="1.0" /> |
| 469 | </text> |
| 470 | </element> |
| 471 | |
| 472 | <element name="flatbackground"> |
| 473 | <rect> |
| 474 | <bounds left="-10" top="-10" right="587" bottom="813" /> |
| 475 | <color red="0.1" green="0.1" blue="0.1" /> |
| 476 | </rect> |
| 477 | <rect> |
| 478 | <bounds left="5" top="5" right="577" bottom="803" /> |
| 479 | <color red="0.1" green="0.2" blue="0.1" /> |
| 480 | </rect> |
| 481 | <rect> |
| 482 | <bounds left="0" top="0" right="572" bottom="798" /> |
| 483 | <color red="0.1" green="0.3" blue="0.1" /> |
| 484 | </rect> |
| 485 | </element> |
| 486 | |
| 487 | <element name="LX.384"> |
| 488 | <text string="LX.384"> |
| 489 | <bounds x="0" y="0" width="120" height="40"/> |
| 490 | <color red="1.0" green="1.0" blue="1.0" /> |
| 491 | </text> |
| 492 | </element> |
| 493 | |
| 494 | <view name="Standard"> |
| 495 | <backdrop element="flatbackground"> |
| 496 | <bounds x="704" y="50" width="420" height="400" /> |
| 497 | </backdrop> |
| 498 | |
| 499 | <backdrop element="gray"> |
| 500 | <bounds x="724" y="74" width="375" height="350" /> |
| 501 | </backdrop> |
| 502 | |
| 503 | <bezel element="LX.384"> |
| 504 | <bounds x="726" y="80" width="90" height="30" /> |
| 505 | </bezel> |
| 506 | |
| 507 | <!-- LEDs --> |
| 508 | <!-- LEDs --> <!-- x step = 40 --> |
| 509 | <bezel element="digit_back"> |
| 510 | <bounds x="740" y="119" width="36" height="52" /> |
| 511 | </bezel> |
| 512 | <bezel element="digit_back"> |
| 513 | <bounds x="784" y="119" width="36" height="52" /> |
| 514 | </bezel> |
| 515 | <bezel element="digit_back"> |
| 516 | <bounds x="828" y="119" width="36" height="52" /> |
| 517 | </bezel> |
| 518 | <bezel element="digit_back"> |
| 519 | <bounds x="872" y="119" width="36" height="52" /> |
| 520 | </bezel> |
| 521 | <bezel element="digit_back"> |
| 522 | <bounds x="916" y="119" width="36" height="52" /> |
| 523 | </bezel> |
| 524 | <bezel element="digit_back"> |
| 525 | <bounds x="960" y="119" width="36" height="52" /> |
| 526 | </bezel> |
| 527 | <bezel element="digit_back"> |
| 528 | <bounds x="1004" y="119" width="36" height="52" /> |
| 529 | </bezel> |
| 530 | <bezel element="digit_back"> |
| 531 | <bounds x="1048" y="119" width="36" height="52" /> |
| 532 | </bezel> |
| 533 | <bezel name="digit7" element="digit"> |
| 534 | <bounds x="743" y="126" width="30" height="40" /> |
| 535 | </bezel> |
| 536 | <bezel name="digit6" element="digit"> |
| 537 | <bounds x="787" y="126" width="30" height="40" /> |
| 538 | </bezel> |
| 539 | <bezel name="digit5" element="digit"> |
| 540 | <bounds x="831" y="126" width="30" height="40" /> |
| 541 | </bezel> |
| 542 | <bezel name="digit4" element="digit"> |
| 543 | <bounds x="875" y="126" width="30" height="40" /> |
| 544 | </bezel> |
| 545 | <bezel name="digit3" element="digit"> |
| 546 | <bounds x="919" y="126" width="30" height="40" /> |
| 547 | </bezel> |
| 548 | <bezel name="digit2" element="digit"> |
| 549 | <bounds x="963" y="126" width="30" height="40" /> |
| 550 | </bezel> |
| 551 | <bezel name="digit1" element="digit"> |
| 552 | <bounds x="1007" y="126" width="30" height="40" /> |
| 553 | </bezel> |
| 554 | <bezel name="digit0" element="digit"> |
| 555 | <bounds x="1051" y="126" width="30" height="40" /> |
| 556 | </bezel> |
| 557 | |
| 558 | |
| 559 | <!-- Buttons --> |
| 560 | |
| 561 | <!-- "Control" --> |
| 562 | <bezel element="pushbuttonCTRL" inputtag="CTRL" inputmask="0x10"> |
| 563 | <bounds x="765" y="338" width="40" height="40"/> |
| 564 | </bezel> |
| 565 | |
| 566 | <!-- "Reset" --> |
| 567 | <bezel element="pushbuttonRST" inputtag="RST" inputmask="0x01"> |
| 568 | <bounds x="765" y="210" width="40" height="40"/> |
| 569 | </bezel> |
| 570 | |
| 571 | |
| 572 | <!-- Row 0 : 0 1 2 3 4 5 6 7 --> <!-- xstep=45, ystep=43 --> |
| 573 | <!-- "0" --> |
| 574 | <bezel element="pushbutton0" inputtag="ROW0" inputmask="0x01"> |
| 575 | <bounds x="886" y="339" width="40" height="40"/> |
| 576 | </bezel> |
| 577 | |
| 578 | <!-- "1" --> |
| 579 | <bezel element="pushbutton1" inputtag="ROW0" inputmask="0x02"> |
| 580 | <bounds x="886" y="296" width="40" height="40"/> |
| 581 | </bezel> |
| 582 | |
| 583 | <!-- "2" --> |
| 584 | <bezel element="pushbutton2" inputtag="ROW0" inputmask="0x04"> |
| 585 | <bounds x="931" y="296" width="40" height="40"/> |
| 586 | </bezel> |
| 587 | |
| 588 | <!-- "3" --> |
| 589 | <bezel element="pushbutton3" inputtag="ROW0" inputmask="0x08"> |
| 590 | <bounds x="976" y="296" width="40" height="40"/> |
| 591 | </bezel> |
| 592 | |
| 593 | <!-- "4" --> |
| 594 | <bezel element="pushbutton4" inputtag="ROW0" inputmask="0x10"> |
| 595 | <bounds x="886" y="253" width="40" height="40"/> |
| 596 | </bezel> |
| 597 | |
| 598 | <!-- "5" --> |
| 599 | <bezel element="pushbutton5" inputtag="ROW0" inputmask="0x20"> |
| 600 | <bounds x="931" y="253" width="40" height="40"/> |
| 601 | </bezel> |
| 602 | |
| 603 | <!-- "6" --> |
| 604 | <bezel element="pushbutton6" inputtag="ROW0" inputmask="0x40"> |
| 605 | <bounds x="976" y="253" width="40" height="40"/> |
| 606 | </bezel> |
| 607 | |
| 608 | <!-- "7" --> |
| 609 | <bezel element="pushbutton7" inputtag="ROW0" inputmask="0x80"> |
| 610 | <bounds x="886" y="210" width="40" height="40"/> |
| 611 | </bezel> |
| 612 | |
| 613 | |
| 614 | |
| 615 | <!-- Buttons --> |
| 616 | <!-- Row 1 : 8 9 A B C D E F --> |
| 617 | <!-- "8" --> |
| 618 | <bezel element="pushbutton8" inputtag="ROW1" inputmask="0x01"> |
| 619 | <bounds x="931" y="210" width="40" height="40"/> |
| 620 | </bezel> |
| 621 | |
| 622 | <!-- "9" --> |
| 623 | <bezel element="pushbutton9" inputtag="ROW1" inputmask="0x02"> |
| 624 | <bounds x="976" y="210" width="40" height="40"/> |
| 625 | </bezel> |
| 626 | |
| 627 | <!-- "A" --> |
| 628 | <bezel element="pushbuttonA" inputtag="ROW1" inputmask="0x04"> |
| 629 | <bounds x="1021" y="210" width="40" height="40"/> |
| 630 | </bezel> |
| 631 | |
| 632 | <!-- "B" --> |
| 633 | <bezel element="pushbuttonB" inputtag="ROW1" inputmask="0x08"> |
| 634 | <bounds x="1021" y="253" width="40" height="40"/> |
| 635 | </bezel> |
| 636 | |
| 637 | <!-- "C" --> |
| 638 | <bezel element="pushbuttonC" inputtag="ROW1" inputmask="0x10"> |
| 639 | <bounds x="1021" y="296" width="40" height="40"/> |
| 640 | </bezel> |
| 641 | |
| 642 | <!-- "D" --> |
| 643 | <bezel element="pushbuttonD" inputtag="ROW1" inputmask="0x20"> |
| 644 | <bounds x="1021" y="339" width="40" height="40"/> |
| 645 | </bezel> |
| 646 | |
| 647 | <!-- "E" --> |
| 648 | <bezel element="pushbuttonE" inputtag="ROW1" inputmask="0x40"> |
| 649 | <bounds x="976" y="339" width="40" height="40"/> |
| 650 | </bezel> |
| 651 | |
| 652 | <!-- "F" --> |
| 653 | <bezel element="pushbuttonF" inputtag="ROW1" inputmask="0x80"> |
| 654 | <bounds x="931" y="339" width="40" height="40"/> |
| 655 | </bezel> |
| 656 | |
| 657 | </view> |
| 658 | |
| 659 | </mamelayout> |
src/mess/layout/z80net.lay
| r0 | r4461 | |
| 1 | <?xml version="1.0"?> |
| 2 | <!-- z80ne.lay --> |
| 3 | <!-- 2009-01-16: Initial version. [Roberto Lavarone] --> |
| 4 | |
| 5 | <mamelayout version="2"> |
| 6 | |
| 7 | <element name="gray"> |
| 8 | <rect> |
| 9 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 10 | <color red="0.15" green="0.15" blue="0.15" /> |
| 11 | </rect> |
| 12 | </element> |
| 13 | |
| 14 | <element name="digit_back"> |
| 15 | <rect> |
| 16 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 17 | <color red="0.584" green="0.631" blue="0.690" /> |
| 18 | </rect> |
| 19 | </element> |
| 20 | |
| 21 | <element name="digit" defstate="0"> |
| 22 | <led7seg> |
| 23 | <color red="0.75" green="0.0" blue="0.0"/> |
| 24 | </led7seg> |
| 25 | </element> |
| 26 | |
| 27 | <element name="back"> |
| 28 | <rect> |
| 29 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 30 | <color red="0.0" green="0.0" blue="0.0" /> |
| 31 | </rect> |
| 32 | </element> |
| 33 | |
| 34 | <element name="pushbutton" defstate="1"> |
| 35 | <rect> |
| 36 | <bounds x="2" y="2" width="48" height="48"/> |
| 37 | <color red="0.1" green="0.1" blue="0.1" /> |
| 38 | </rect> |
| 39 | <rect state="0"> |
| 40 | <bounds x="0" y="0" width="48" height="48"/> |
| 41 | <color red="0.75" green="0.75" blue="0.0" /> |
| 42 | </rect> |
| 43 | <rect state="1"> |
| 44 | <bounds x="2" y="2" width="48" height="48"/> |
| 45 | <color red="0.75" green="0.75" blue="0.0" /> |
| 46 | </rect> |
| 47 | </element> |
| 48 | |
| 49 | <element name="pushbuttonCTRL" defstate="1"> |
| 50 | <rect> |
| 51 | <bounds x="2" y="2" width="48" height="48"/> |
| 52 | <color red="0.1" green="0.1" blue="0.1" /> |
| 53 | </rect> |
| 54 | <rect state="0"> |
| 55 | <bounds x="0" y="0" width="48" height="48"/> |
| 56 | <color red="0.25" green="0.25" blue="0.25" /> |
| 57 | </rect> |
| 58 | <text string="CTRL" state="0"> |
| 59 | <bounds x="8" y="24" width="40" height="20"/> |
| 60 | <color red="1.0" green="1.0" blue="1.0" /> |
| 61 | </text> |
| 62 | <rect state="1"> |
| 63 | <bounds x="2" y="2" width="48" height="48"/> |
| 64 | <color red="0.25" green="0.25" blue="0.25" /> |
| 65 | </rect> |
| 66 | <text string="CTRL" state="1"> |
| 67 | <bounds x="10" y="26" width="40" height="20"/> |
| 68 | <color red="1.0" green="1.0" blue="1.0" /> |
| 69 | </text> |
| 70 | </element> |
| 71 | |
| 72 | <element name="pushbuttonRST" defstate="1"> |
| 73 | <rect> |
| 74 | <bounds x="2" y="2" width="48" height="48"/> |
| 75 | <color red="0.1" green="0.1" blue="0.1" /> |
| 76 | </rect> |
| 77 | <rect state="0"> |
| 78 | <bounds x="0" y="0" width="48" height="48"/> |
| 79 | <color red="0.75" green="0" blue="0" /> |
| 80 | </rect> |
| 81 | <text string="RST " state="0"> |
| 82 | <bounds x="8" y="24" width="40" height="20"/> |
| 83 | <color red="1.0" green="1.0" blue="1.0" /> |
| 84 | </text> |
| 85 | <rect state="1"> |
| 86 | <bounds x="2" y="2" width="48" height="48"/> |
| 87 | <color red="0.75" green="0" blue="0" /> |
| 88 | </rect> |
| 89 | <text string="RST " state="1"> |
| 90 | <bounds x="10" y="26" width="40" height="20"/> |
| 91 | <color red="1.0" green="1.0" blue="1.0" /> |
| 92 | </text> |
| 93 | </element> |
| 94 | |
| 95 | <element name="pushbutton0" defstate="1"> |
| 96 | <rect> |
| 97 | <bounds x="2" y="2" width="48" height="48"/> |
| 98 | <color red="0.1" green="0.1" blue="0.1" /> |
| 99 | </rect> |
| 100 | <rect state="0"> |
| 101 | <bounds x="0" y="0" width="48" height="48"/> |
| 102 | <color red="0.0" green="0.0" blue="0.75" /> |
| 103 | </rect> |
| 104 | <text string=" 0 " state="0"> |
| 105 | <bounds x="8" y="24" width="40" height="20"/> |
| 106 | <color red="1.0" green="1.0" blue="1.0" /> |
| 107 | </text> |
| 108 | <rect state="1"> |
| 109 | <bounds x="2" y="2" width="48" height="48"/> |
| 110 | <color red="0.0" green="0.0" blue="0.75" /> |
| 111 | </rect> |
| 112 | <text string=" 0 " state="1"> |
| 113 | <bounds x="10" y="26" width="40" height="20"/> |
| 114 | <color red="1.0" green="1.0" blue="1.0" /> |
| 115 | </text> |
| 116 | </element> |
| 117 | |
| 118 | <element name="pushbutton1" defstate="1"> |
| 119 | <rect> |
| 120 | <bounds x="2" y="2" width="48" height="48"/> |
| 121 | <color red="0.1" green="0.1" blue="0.1" /> |
| 122 | </rect> |
| 123 | <rect state="0"> |
| 124 | <bounds x="0" y="0" width="48" height="48"/> |
| 125 | <color red="0.0" green="0.0" blue="0.75" /> |
| 126 | </rect> |
| 127 | <text string=" 1 " state="0"> |
| 128 | <bounds x="8" y="24" width="40" height="20"/> |
| 129 | <color red="1.0" green="1.0" blue="1.0" /> |
| 130 | </text> |
| 131 | <rect state="1"> |
| 132 | <bounds x="2" y="2" width="48" height="48"/> |
| 133 | <color red="0.0" green="0.0" blue="0.75" /> |
| 134 | </rect> |
| 135 | <text string=" 1 " state="1"> |
| 136 | <bounds x="10" y="26" width="40" height="20"/> |
| 137 | <color red="1.0" green="1.0" blue="1.0" /> |
| 138 | </text> |
| 139 | </element> |
| 140 | |
| 141 | <element name="pushbutton2" defstate="1"> |
| 142 | <rect> |
| 143 | <bounds x="2" y="2" width="48" height="48"/> |
| 144 | <color red="0.1" green="0.1" blue="0.1" /> |
| 145 | </rect> |
| 146 | <rect state="0"> |
| 147 | <bounds x="0" y="0" width="48" height="48"/> |
| 148 | <color red="0.0" green="0.0" blue="0.75" /> |
| 149 | </rect> |
| 150 | <text string=" 2 " state="0"> |
| 151 | <bounds x="8" y="24" width="40" height="20"/> |
| 152 | <color red="1.0" green="1.0" blue="1.0" /> |
| 153 | </text> |
| 154 | <rect state="1"> |
| 155 | <bounds x="2" y="2" width="48" height="48"/> |
| 156 | <color red="0.0" green="0.0" blue="0.75" /> |
| 157 | </rect> |
| 158 | <text string=" 2 " state="1"> |
| 159 | <bounds x="10" y="26" width="40" height="20"/> |
| 160 | <color red="1.0" green="1.0" blue="1.0" /> |
| 161 | </text> |
| 162 | </element> |
| 163 | |
| 164 | <element name="pushbutton3" defstate="1"> |
| 165 | <rect> |
| 166 | <bounds x="2" y="2" width="48" height="48"/> |
| 167 | <color red="0.1" green="0.1" blue="0.1" /> |
| 168 | </rect> |
| 169 | <rect state="0"> |
| 170 | <bounds x="0" y="0" width="48" height="48"/> |
| 171 | <color red="0.0" green="0.0" blue="0.75" /> |
| 172 | </rect> |
| 173 | <text string=" 3 " state="0"> |
| 174 | <bounds x="8" y="24" width="40" height="20"/> |
| 175 | <color red="1.0" green="1.0" blue="1.0" /> |
| 176 | </text> |
| 177 | <rect state="1"> |
| 178 | <bounds x="2" y="2" width="48" height="48"/> |
| 179 | <color red="0.0" green="0.0" blue="0.75" /> |
| 180 | </rect> |
| 181 | <text string=" 3 " state="1"> |
| 182 | <bounds x="10" y="26" width="40" height="20"/> |
| 183 | <color red="1.0" green="1.0" blue="1.0" /> |
| 184 | </text> |
| 185 | </element> |
| 186 | |
| 187 | <element name="pushbutton4" defstate="1"> |
| 188 | <rect> |
| 189 | <bounds x="2" y="2" width="48" height="48"/> |
| 190 | <color red="0.1" green="0.1" blue="0.1" /> |
| 191 | </rect> |
| 192 | <rect state="0"> |
| 193 | <bounds x="0" y="0" width="48" height="48"/> |
| 194 | <color red="0.0" green="0.0" blue="0.75" /> |
| 195 | </rect> |
| 196 | <text string=" 4 " state="0"> |
| 197 | <bounds x="8" y="24" width="40" height="20"/> |
| 198 | <color red="1.0" green="1.0" blue="1.0" /> |
| 199 | </text> |
| 200 | <rect state="1"> |
| 201 | <bounds x="2" y="2" width="48" height="48"/> |
| 202 | <color red="0.0" green="0.0" blue="0.75" /> |
| 203 | </rect> |
| 204 | <text string=" 4 " state="1"> |
| 205 | <bounds x="10" y="26" width="40" height="20"/> |
| 206 | <color red="1.0" green="1.0" blue="1.0" /> |
| 207 | </text> |
| 208 | </element> |
| 209 | |
| 210 | <element name="pushbutton5" defstate="1"> |
| 211 | <rect> |
| 212 | <bounds x="2" y="2" width="48" height="48"/> |
| 213 | <color red="0.1" green="0.1" blue="0.1" /> |
| 214 | </rect> |
| 215 | <rect state="0"> |
| 216 | <bounds x="0" y="0" width="48" height="48"/> |
| 217 | <color red="0.0" green="0.0" blue="0.75" /> |
| 218 | </rect> |
| 219 | <text string=" 5 " state="0"> |
| 220 | <bounds x="8" y="24" width="40" height="20"/> |
| 221 | <color red="1.0" green="1.0" blue="1.0" /> |
| 222 | </text> |
| 223 | <rect state="1"> |
| 224 | <bounds x="2" y="2" width="48" height="48"/> |
| 225 | <color red="0.0" green="0.0" blue="0.75" /> |
| 226 | </rect> |
| 227 | <text string=" 5 " state="1"> |
| 228 | <bounds x="10" y="26" width="40" height="20"/> |
| 229 | <color red="1.0" green="1.0" blue="1.0" /> |
| 230 | </text> |
| 231 | </element> |
| 232 | |
| 233 | <element name="pushbutton6" defstate="1"> |
| 234 | <rect> |
| 235 | <bounds x="2" y="2" width="48" height="48"/> |
| 236 | <color red="0.1" green="0.1" blue="0.1" /> |
| 237 | </rect> |
| 238 | <rect state="0"> |
| 239 | <bounds x="0" y="0" width="48" height="48"/> |
| 240 | <color red="0.0" green="0.0" blue="0.75" /> |
| 241 | </rect> |
| 242 | <text string=" 6 " state="0"> |
| 243 | <bounds x="8" y="24" width="40" height="20"/> |
| 244 | <color red="1.0" green="1.0" blue="1.0" /> |
| 245 | </text> |
| 246 | <rect state="1"> |
| 247 | <bounds x="2" y="2" width="48" height="48"/> |
| 248 | <color red="0.0" green="0.0" blue="0.75" /> |
| 249 | </rect> |
| 250 | <text string=" 6 " state="1"> |
| 251 | <bounds x="10" y="26" width="40" height="20"/> |
| 252 | <color red="1.0" green="1.0" blue="1.0" /> |
| 253 | </text> |
| 254 | </element> |
| 255 | |
| 256 | <element name="pushbutton7" defstate="1"> |
| 257 | <rect> |
| 258 | <bounds x="2" y="2" width="48" height="48"/> |
| 259 | <color red="0.1" green="0.1" blue="0.1" /> |
| 260 | </rect> |
| 261 | <rect state="0"> |
| 262 | <bounds x="0" y="0" width="48" height="48"/> |
| 263 | <color red="0.0" green="0.0" blue="0.75" /> |
| 264 | </rect> |
| 265 | <text string=" 7 " state="0"> |
| 266 | <bounds x="8" y="24" width="40" height="20"/> |
| 267 | <color red="1.0" green="1.0" blue="1.0" /> |
| 268 | </text> |
| 269 | <rect state="1"> |
| 270 | <bounds x="2" y="2" width="48" height="48"/> |
| 271 | <color red="0.0" green="0.0" blue="0.75" /> |
| 272 | </rect> |
| 273 | <text string=" 7 " state="1"> |
| 274 | <bounds x="10" y="26" width="40" height="20"/> |
| 275 | <color red="1.0" green="1.0" blue="1.0" /> |
| 276 | </text> |
| 277 | </element> |
| 278 | |
| 279 | <element name="pushbutton8" defstate="1"> |
| 280 | <rect> |
| 281 | <bounds x="2" y="2" width="48" height="48"/> |
| 282 | <color red="0.1" green="0.1" blue="0.1" /> |
| 283 | </rect> |
| 284 | <rect state="0"> |
| 285 | <bounds x="0" y="0" width="48" height="48"/> |
| 286 | <color red="0.0" green="0.0" blue="0.75" /> |
| 287 | </rect> |
| 288 | <text string=" 8 " state="0"> |
| 289 | <bounds x="8" y="24" width="40" height="20"/> |
| 290 | <color red="1.0" green="1.0" blue="1.0" /> |
| 291 | </text> |
| 292 | <rect state="1"> |
| 293 | <bounds x="2" y="2" width="48" height="48"/> |
| 294 | <color red="0.0" green="0.0" blue="0.75" /> |
| 295 | </rect> |
| 296 | <text string=" 8 " state="1"> |
| 297 | <bounds x="10" y="26" width="40" height="20"/> |
| 298 | <color red="1.0" green="1.0" blue="1.0" /> |
| 299 | </text> |
| 300 | </element> |
| 301 | |
| 302 | <element name="pushbutton9" defstate="1"> |
| 303 | <rect> |
| 304 | <bounds x="2" y="2" width="48" height="48"/> |
| 305 | <color red="0.1" green="0.1" blue="0.1" /> |
| 306 | </rect> |
| 307 | <rect state="0"> |
| 308 | <bounds x="0" y="0" width="48" height="48"/> |
| 309 | <color red="0.0" green="0.0" blue="0.75" /> |
| 310 | </rect> |
| 311 | <text string=" 9 " state="0"> |
| 312 | <bounds x="8" y="24" width="40" height="20"/> |
| 313 | <color red="1.0" green="1.0" blue="1.0" /> |
| 314 | </text> |
| 315 | <rect state="1"> |
| 316 | <bounds x="2" y="2" width="48" height="48"/> |
| 317 | <color red="0.0" green="0.0" blue="0.75" /> |
| 318 | </rect> |
| 319 | <text string=" 9 " state="1"> |
| 320 | <bounds x="10" y="26" width="40" height="20"/> |
| 321 | <color red="1.0" green="1.0" blue="1.0" /> |
| 322 | </text> |
| 323 | </element> |
| 324 | |
| 325 | <element name="pushbuttonA" defstate="1"> |
| 326 | <rect> |
| 327 | <bounds x="2" y="2" width="48" height="48"/> |
| 328 | <color red="0.1" green="0.1" blue="0.1" /> |
| 329 | </rect> |
| 330 | <rect state="0"> |
| 331 | <bounds x="0" y="0" width="48" height="48"/> |
| 332 | <color red="0.0" green="0.0" blue="0.75" /> |
| 333 | </rect> |
| 334 | <text string=" A " state="0"> |
| 335 | <bounds x="8" y="24" width="40" height="20"/> |
| 336 | <color red="1.0" green="1.0" blue="1.0" /> |
| 337 | </text> |
| 338 | <rect state="1"> |
| 339 | <bounds x="2" y="2" width="48" height="48"/> |
| 340 | <color red="0.0" green="0.0" blue="0.75" /> |
| 341 | </rect> |
| 342 | <text string=" A " state="1"> |
| 343 | <bounds x="10" y="26" width="40" height="20"/> |
| 344 | <color red="1.0" green="1.0" blue="1.0" /> |
| 345 | </text> |
| 346 | </element> |
| 347 | |
| 348 | <element name="pushbuttonB" defstate="1"> |
| 349 | <rect> |
| 350 | <bounds x="2" y="2" width="48" height="48"/> |
| 351 | <color red="0.1" green="0.1" blue="0.1" /> |
| 352 | </rect> |
| 353 | <rect state="0"> |
| 354 | <bounds x="0" y="0" width="48" height="48"/> |
| 355 | <color red="0.0" green="0.0" blue="0.75" /> |
| 356 | </rect> |
| 357 | <text string=" B " state="0"> |
| 358 | <bounds x="8" y="24" width="40" height="20"/> |
| 359 | <color red="1.0" green="1.0" blue="1.0" /> |
| 360 | </text> |
| 361 | <rect state="1"> |
| 362 | <bounds x="2" y="2" width="48" height="48"/> |
| 363 | <color red="0.0" green="0.0" blue="0.75" /> |
| 364 | </rect> |
| 365 | <text string=" B " state="1"> |
| 366 | <bounds x="10" y="26" width="40" height="20"/> |
| 367 | <color red="1.0" green="1.0" blue="1.0" /> |
| 368 | </text> |
| 369 | </element> |
| 370 | |
| 371 | <element name="pushbuttonC" defstate="1"> |
| 372 | <rect> |
| 373 | <bounds x="2" y="2" width="48" height="48"/> |
| 374 | <color red="0.1" green="0.1" blue="0.1" /> |
| 375 | </rect> |
| 376 | <rect state="0"> |
| 377 | <bounds x="0" y="0" width="48" height="48"/> |
| 378 | <color red="0.0" green="0.0" blue="0.75" /> |
| 379 | </rect> |
| 380 | <text string=" C " state="0"> |
| 381 | <bounds x="8" y="24" width="40" height="20"/> |
| 382 | <color red="1.0" green="1.0" blue="1.0" /> |
| 383 | </text> |
| 384 | <rect state="1"> |
| 385 | <bounds x="2" y="2" width="48" height="48"/> |
| 386 | <color red="0.0" green="0.0" blue="0.75" /> |
| 387 | </rect> |
| 388 | <text string=" C " state="1"> |
| 389 | <bounds x="10" y="26" width="40" height="20"/> |
| 390 | <color red="1.0" green="1.0" blue="1.0" /> |
| 391 | </text> |
| 392 | </element> |
| 393 | |
| 394 | <element name="pushbuttonD" defstate="1"> |
| 395 | <rect> |
| 396 | <bounds x="2" y="2" width="48" height="48"/> |
| 397 | <color red="0.1" green="0.1" blue="0.1" /> |
| 398 | </rect> |
| 399 | <rect state="0"> |
| 400 | <bounds x="0" y="0" width="48" height="48"/> |
| 401 | <color red="0.0" green="0.0" blue="0.75" /> |
| 402 | </rect> |
| 403 | <text string=" D " state="0"> |
| 404 | <bounds x="8" y="24" width="40" height="20"/> |
| 405 | <color red="1.0" green="1.0" blue="1.0" /> |
| 406 | </text> |
| 407 | <rect state="1"> |
| 408 | <bounds x="2" y="2" width="48" height="48"/> |
| 409 | <color red="0.0" green="0.0" blue="0.75" /> |
| 410 | </rect> |
| 411 | <text string=" D " state="1"> |
| 412 | <bounds x="10" y="26" width="40" height="20"/> |
| 413 | <color red="1.0" green="1.0" blue="1.0" /> |
| 414 | </text> |
| 415 | </element> |
| 416 | |
| 417 | <element name="pushbuttonE" defstate="1"> |
| 418 | <rect> |
| 419 | <bounds x="2" y="2" width="48" height="48"/> |
| 420 | <color red="0.1" green="0.1" blue="0.1" /> |
| 421 | </rect> |
| 422 | <rect state="0"> |
| 423 | <bounds x="0" y="0" width="48" height="48"/> |
| 424 | <color red="0.0" green="0.0" blue="0.75" /> |
| 425 | </rect> |
| 426 | <text string=" E " state="0"> |
| 427 | <bounds x="8" y="24" width="40" height="20"/> |
| 428 | <color red="1.0" green="1.0" blue="1.0" /> |
| 429 | </text> |
| 430 | <rect state="1"> |
| 431 | <bounds x="2" y="2" width="48" height="48"/> |
| 432 | <color red="0.0" green="0.0" blue="0.75" /> |
| 433 | </rect> |
| 434 | <text string=" E " state="1"> |
| 435 | <bounds x="10" y="26" width="40" height="20"/> |
| 436 | <color red="1.0" green="1.0" blue="1.0" /> |
| 437 | </text> |
| 438 | </element> |
| 439 | |
| 440 | <element name="pushbuttonF" defstate="1"> |
| 441 | <rect> |
| 442 | <bounds x="2" y="2" width="48" height="48"/> |
| 443 | <color red="0.1" green="0.1" blue="0.1" /> |
| 444 | </rect> |
| 445 | <rect state="0"> |
| 446 | <bounds x="0" y="0" width="48" height="48"/> |
| 447 | <color red="0.0" green="0.0" blue="0.75" /> |
| 448 | </rect> |
| 449 | <text string=" F " state="0"> |
| 450 | <bounds x="8" y="24" width="40" height="20"/> |
| 451 | <color red="1.0" green="1.0" blue="1.0" /> |
| 452 | </text> |
| 453 | <rect state="1"> |
| 454 | <bounds x="2" y="2" width="48" height="48"/> |
| 455 | <color red="0.0" green="0.0" blue="0.75" /> |
| 456 | </rect> |
| 457 | <text string=" F " state="1"> |
| 458 | <bounds x="10" y="26" width="40" height="20"/> |
| 459 | <color red="1.0" green="1.0" blue="1.0" /> |
| 460 | </text> |
| 461 | </element> |
| 462 | |
| 463 | <element name="flatbackground"> |
| 464 | <rect> |
| 465 | <bounds left="-10" top="-10" right="587" bottom="813" /> |
| 466 | <color red="0.1" green="0.1" blue="0.1" /> |
| 467 | </rect> |
| 468 | <rect> |
| 469 | <bounds left="5" top="5" right="577" bottom="803" /> |
| 470 | <color red="0.1" green="0.2" blue="0.1" /> |
| 471 | </rect> |
| 472 | <rect> |
| 473 | <bounds left="0" top="0" right="572" bottom="798" /> |
| 474 | <color red="0.1" green="0.3" blue="0.1" /> |
| 475 | </rect> |
| 476 | </element> |
| 477 | |
| 478 | <element name="LX.384"> |
| 479 | <text string="LX.384"> |
| 480 | <bounds x="0" y="0" width="120" height="40"/> |
| 481 | <color red="1.0" green="1.0" blue="1.0" /> |
| 482 | </text> |
| 483 | </element> |
| 484 | |
| 485 | <element name="LX.388"> |
| 486 | <text string="LX.388"> |
| 487 | <bounds x="0" y="0" width="120" height="40"/> |
| 488 | <color red="1.0" green="1.0" blue="1.0" /> |
| 489 | </text> |
| 490 | </element> |
| 491 | |
| 492 | <view name="Standard"> |
| 493 | <backdrop element="flatbackground"> |
| 494 | <bounds x="0" y="20" width="1175" height="590" /> |
| 495 | </backdrop> |
| 496 | |
| 497 | <backdrop element="gray"> |
| 498 | <bounds x="65" y="74" width="640" height="480" /> |
| 499 | </backdrop> |
| 500 | |
| 501 | <bezel element="LX.388"> |
| 502 | <bounds x="67" y="80" width="90" height="30" /> |
| 503 | </bezel> |
| 504 | |
| 505 | <screen index="0"> |
| 506 | <bounds x="65" y="74" width="640" height="480" /> |
| 507 | </screen> |
| 508 | |
| 509 | <backdrop element="gray"> |
| 510 | <bounds x="724" y="74" width="375" height="480" /> |
| 511 | </backdrop> |
| 512 | |
| 513 | <bezel element="LX.384"> |
| 514 | <bounds x="726" y="80" width="90" height="30" /> |
| 515 | </bezel> |
| 516 | |
| 517 | <!-- LEDs --> |
| 518 | <!-- LEDs --> <!-- x step = 40 --> |
| 519 | <bezel element="digit_back"> |
| 520 | <bounds x="740" y="119" width="36" height="52" /> |
| 521 | </bezel> |
| 522 | <bezel element="digit_back"> |
| 523 | <bounds x="784" y="119" width="36" height="52" /> |
| 524 | </bezel> |
| 525 | <bezel element="digit_back"> |
| 526 | <bounds x="828" y="119" width="36" height="52" /> |
| 527 | </bezel> |
| 528 | <bezel element="digit_back"> |
| 529 | <bounds x="872" y="119" width="36" height="52" /> |
| 530 | </bezel> |
| 531 | <bezel element="digit_back"> |
| 532 | <bounds x="916" y="119" width="36" height="52" /> |
| 533 | </bezel> |
| 534 | <bezel element="digit_back"> |
| 535 | <bounds x="960" y="119" width="36" height="52" /> |
| 536 | </bezel> |
| 537 | <bezel element="digit_back"> |
| 538 | <bounds x="1004" y="119" width="36" height="52" /> |
| 539 | </bezel> |
| 540 | <bezel element="digit_back"> |
| 541 | <bounds x="1048" y="119" width="36" height="52" /> |
| 542 | </bezel> |
| 543 | <bezel name="digit7" element="digit"> |
| 544 | <bounds x="743" y="126" width="30" height="40" /> |
| 545 | </bezel> |
| 546 | <bezel name="digit6" element="digit"> |
| 547 | <bounds x="787" y="126" width="30" height="40" /> |
| 548 | </bezel> |
| 549 | <bezel name="digit5" element="digit"> |
| 550 | <bounds x="831" y="126" width="30" height="40" /> |
| 551 | </bezel> |
| 552 | <bezel name="digit4" element="digit"> |
| 553 | <bounds x="875" y="126" width="30" height="40" /> |
| 554 | </bezel> |
| 555 | <bezel name="digit3" element="digit"> |
| 556 | <bounds x="919" y="126" width="30" height="40" /> |
| 557 | </bezel> |
| 558 | <bezel name="digit2" element="digit"> |
| 559 | <bounds x="963" y="126" width="30" height="40" /> |
| 560 | </bezel> |
| 561 | <bezel name="digit1" element="digit"> |
| 562 | <bounds x="1007" y="126" width="30" height="40" /> |
| 563 | </bezel> |
| 564 | <bezel name="digit0" element="digit"> |
| 565 | <bounds x="1051" y="126" width="30" height="40" /> |
| 566 | </bezel> |
| 567 | |
| 568 | |
| 569 | <!-- Buttons --> |
| 570 | |
| 571 | <!-- "Control" --> |
| 572 | <bezel element="pushbuttonCTRL" inputtag="CTRL" inputmask="0x10"> |
| 573 | <bounds x="765" y="338" width="40" height="40"/> |
| 574 | </bezel> |
| 575 | |
| 576 | <!-- "Reset" --> |
| 577 | <bezel element="pushbuttonRST" inputtag="RST" inputmask="0x01"> |
| 578 | <bounds x="765" y="210" width="40" height="40"/> |
| 579 | </bezel> |
| 580 | |
| 581 | |
| 582 | <!-- Row 0 : 0 1 2 3 4 5 6 7 --> <!-- xstep=45, ystep=43 --> |
| 583 | <!-- "0" --> |
| 584 | <bezel element="pushbutton0" inputtag="ROW0" inputmask="0x01"> |
| 585 | <bounds x="886" y="339" width="40" height="40"/> |
| 586 | </bezel> |
| 587 | |
| 588 | <!-- "1" --> |
| 589 | <bezel element="pushbutton1" inputtag="ROW0" inputmask="0x02"> |
| 590 | <bounds x="886" y="296" width="40" height="40"/> |
| 591 | </bezel> |
| 592 | |
| 593 | <!-- "2" --> |
| 594 | <bezel element="pushbutton2" inputtag="ROW0" inputmask="0x04"> |
| 595 | <bounds x="931" y="296" width="40" height="40"/> |
| 596 | </bezel> |
| 597 | |
| 598 | <!-- "3" --> |
| 599 | <bezel element="pushbutton3" inputtag="ROW0" inputmask="0x08"> |
| 600 | <bounds x="976" y="296" width="40" height="40"/> |
| 601 | </bezel> |
| 602 | |
| 603 | <!-- "4" --> |
| 604 | <bezel element="pushbutton4" inputtag="ROW0" inputmask="0x10"> |
| 605 | <bounds x="886" y="253" width="40" height="40"/> |
| 606 | </bezel> |
| 607 | |
| 608 | <!-- "5" --> |
| 609 | <bezel element="pushbutton5" inputtag="ROW0" inputmask="0x20"> |
| 610 | <bounds x="931" y="253" width="40" height="40"/> |
| 611 | </bezel> |
| 612 | |
| 613 | <!-- "6" --> |
| 614 | <bezel element="pushbutton6" inputtag="ROW0" inputmask="0x40"> |
| 615 | <bounds x="976" y="253" width="40" height="40"/> |
| 616 | </bezel> |
| 617 | |
| 618 | <!-- "7" --> |
| 619 | <bezel element="pushbutton7" inputtag="ROW0" inputmask="0x80"> |
| 620 | <bounds x="886" y="210" width="40" height="40"/> |
| 621 | </bezel> |
| 622 | |
| 623 | |
| 624 | |
| 625 | <!-- Buttons --> |
| 626 | <!-- Row 1 : 8 9 A B C D E F --> |
| 627 | <!-- "8" --> |
| 628 | <bezel element="pushbutton8" inputtag="ROW1" inputmask="0x01"> |
| 629 | <bounds x="931" y="210" width="40" height="40"/> |
| 630 | </bezel> |
| 631 | |
| 632 | <!-- "9" --> |
| 633 | <bezel element="pushbutton9" inputtag="ROW1" inputmask="0x02"> |
| 634 | <bounds x="976" y="210" width="40" height="40"/> |
| 635 | </bezel> |
| 636 | |
| 637 | <!-- "A" --> |
| 638 | <bezel element="pushbuttonA" inputtag="ROW1" inputmask="0x04"> |
| 639 | <bounds x="1021" y="210" width="40" height="40"/> |
| 640 | </bezel> |
| 641 | |
| 642 | <!-- "B" --> |
| 643 | <bezel element="pushbuttonB" inputtag="ROW1" inputmask="0x08"> |
| 644 | <bounds x="1021" y="253" width="40" height="40"/> |
| 645 | </bezel> |
| 646 | |
| 647 | <!-- "C" --> |
| 648 | <bezel element="pushbuttonC" inputtag="ROW1" inputmask="0x10"> |
| 649 | <bounds x="1021" y="296" width="40" height="40"/> |
| 650 | </bezel> |
| 651 | |
| 652 | <!-- "D" --> |
| 653 | <bezel element="pushbuttonD" inputtag="ROW1" inputmask="0x20"> |
| 654 | <bounds x="1021" y="339" width="40" height="40"/> |
| 655 | </bezel> |
| 656 | |
| 657 | <!-- "E" --> |
| 658 | <bezel element="pushbuttonE" inputtag="ROW1" inputmask="0x40"> |
| 659 | <bounds x="976" y="339" width="40" height="40"/> |
| 660 | </bezel> |
| 661 | |
| 662 | <!-- "F" --> |
| 663 | <bezel element="pushbuttonF" inputtag="ROW1" inputmask="0x80"> |
| 664 | <bounds x="931" y="339" width="40" height="40"/> |
| 665 | </bezel> |
| 666 | |
| 667 | </view> |
| 668 | |
| 669 | |
| 670 | </mamelayout> |
src/mess/drivers/z80ne.c
| r0 | r4461 | |
| 1 | /****************************************************************************** |
| 2 | Nuova Elettronica Z80NE system driver |
| 3 | |
| 4 | Preliminary driver |
| 5 | |
| 6 | Roberto Lavarone, 2009-01-05 |
| 7 | |
| 8 | Thanks go to: |
| 9 | Roberto Bazzano: www.z80ne.com |
| 10 | |
| 11 | Z80NE memory map |
| 12 | |
| 13 | LX.382 CPU board |
| 14 | range short description |
| 15 | 0000-03FF RAM |
| 16 | 8000-83FF EPROM firmware |
| 17 | |
| 18 | LX.383 HEX keyboard and display controller for LX.384 hex keyboard and display |
| 19 | range short description |
| 20 | F0-F7 I/O 7-segment LED dual-port RAM write |
| 21 | F0 I/O keyboard read |
| 22 | F8 I/O enable single step for next instruction |
| 23 | |
| 24 | LX.385 Cassette interface |
| 25 | range short description |
| 26 | EE I/O UART Data Read/Write |
| 27 | EF I/O UART Status/Control - Cassette Tape Control |
| 28 | |
| 29 | LX.392 32K Memory expansion board |
| 30 | range short description |
| 31 | |
| 32 | |
| 33 | LX.389 Printer Interface |
| 34 | range short description |
| 35 | 02-03 |
| 36 | 06-07 |
| 37 | 0A-0B |
| 38 | 0E-0F |
| 39 | 12-13 |
| 40 | 16-17 |
| 41 | 1A-1B |
| 42 | 1E-1F |
| 43 | |
| 44 | LX.548 16K Basic eprom |
| 45 | range short description |
| 46 | 0000-3FFF EPROM firmware |
| 47 | |
| 48 | LX.388 Video Interface |
| 49 | range short description |
| 50 | EC00-EDFF RAM |
| 51 | EA I/O keyboard |
| 52 | EB I/O video retrace |
| 53 | |
| 54 | LX.529 Graphics Video and Printer Interface |
| 55 | range short description |
| 56 | 80 I/O PIO 0 port A data (ram 0) |
| 57 | 81 I/O PIO 0 port A control (ram 0) |
| 58 | 82 I/O PIO 0 port B data (printer) |
| 59 | 83 I/O PIO 0 port B control (printer) |
| 60 | 84 I/O PIO 1 port A data (ram 1) |
| 61 | 85 I/O PIO 1 port A control (ram 1) |
| 62 | 86 I/O PIO 1 port B data (keyboard) |
| 63 | 87 I/O PIO 1 port B control (keyboard) |
| 64 | 88 I/O PIO 2 port A data (ram 2) |
| 65 | 89 I/O PIO 2 port A control (ram 2) |
| 66 | 8A I/O PIO 2 port B data (printer busy + 40/80 video chars) |
| 67 | 8B I/O PIO 2 port B control (printer busy + 40/40 video chars) |
| 68 | 8C I/O SY6845 address and status register |
| 69 | 8D I/O SY6845 data register |
| 70 | 8E I/O RAM 3 character attribute |
| 71 | 8F I/O beeper |
| 72 | |
| 73 | LX.390 Floppy Interface |
| 74 | range short description |
| 75 | F000-F3FF EPROM firmware |
| 76 | D0 I/O command/status register |
| 77 | D1 I/O trace register |
| 78 | D2 I/O sector register |
| 79 | D3 I/O data register (write only if controller idle) |
| 80 | D6 I/O drive select / drive side one select |
| 81 | D7 I/O data register (write always) |
| 82 | |
| 83 | LX.394-395 EPROM Programmer |
| 84 | range short description |
| 85 | 9000-9FFF EPROM EPROM to be written |
| 86 | 8400-8FFF EPROM firmware |
| 87 | |
| 88 | |
| 89 | ******************************************************************************/ |
| 90 | |
| 91 | /* Core includes */ |
| 92 | #include "driver.h" |
| 93 | #include "cpu/z80/z80.h" |
| 94 | #include "includes/z80ne.h" |
| 95 | #include "devices/cassette.h" |
| 96 | |
| 97 | /* peripheral chips */ |
| 98 | #include "machine/ay31015.h" |
| 99 | #include "machine/kr2376.h" |
| 100 | #include "video/m6847.h" |
| 101 | #include "machine/wd17xx.h" |
| 102 | |
| 103 | /* Layout */ |
| 104 | #include "z80ne.lh" |
| 105 | #include "z80net.lh" |
| 106 | #include "z80netb.lh" |
| 107 | |
| 108 | |
| 109 | /****************************************************************************** |
| 110 | Memory Maps |
| 111 | ******************************************************************************/ |
| 112 | |
| 113 | |
| 114 | /* LX.382 CPU Board RAM */ |
| 115 | /* LX.382 CPU Board EPROM */ |
| 116 | #if 0 |
| 117 | static ADDRESS_MAP_START( z80ne_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 118 | AM_RANGE( 0x0000, 0x03ff ) AM_RAMBANK(1) |
| 119 | AM_RANGE( 0x0400, 0x7fff ) AM_READWRITE(SMH_NOP, SMH_NOP) |
| 120 | AM_RANGE( 0x8000, 0x83ff ) AM_ROM |
| 121 | AM_RANGE( 0x8400, 0xebff ) AM_READWRITE(SMH_NOP, SMH_NOP) |
| 122 | AM_RANGE( 0xec00, 0xedff ) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* (6847) */ |
| 123 | AM_RANGE( 0xee00, 0xffff ) AM_READWRITE(SMH_NOP, SMH_NOP) |
| 124 | |
| 125 | ADDRESS_MAP_END |
| 126 | #endif |
| 127 | |
| 128 | static ADDRESS_MAP_START( z80ne_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 129 | AM_RANGE( 0x0000, 0x7fff ) AM_RAMBANK(1) |
| 130 | AM_RANGE( 0x8000, 0x83ff ) AM_ROM |
| 131 | // AM_RANGE( 0x8400, 0xebff ) AM_READWRITE(SMH_NOP, SMH_NOP) |
| 132 | AM_RANGE( 0x8400, 0xebff ) AM_RAM |
| 133 | AM_RANGE( 0xec00, 0xedff ) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* (6847) */ |
| 134 | // AM_RANGE( 0xee00, 0xffff ) AM_READWRITE(SMH_NOP, SMH_NOP) |
| 135 | AM_RANGE( 0xee00, 0xffff ) AM_RAM |
| 136 | ADDRESS_MAP_END |
| 137 | |
| 138 | static ADDRESS_MAP_START( z80netb_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 139 | AM_RANGE( 0x0000, 0x3fff ) AM_ROM |
| 140 | AM_RANGE( 0x4000, 0xebff ) AM_RAM |
| 141 | AM_RANGE( 0xec00, 0xedff ) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* (6847) */ |
| 142 | AM_RANGE( 0xee00, 0xffff ) AM_RAM |
| 143 | ADDRESS_MAP_END |
| 144 | |
| 145 | static ADDRESS_MAP_START( z80ne_io, ADDRESS_SPACE_IO, 8 ) |
| 146 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 147 | AM_RANGE(0xee, 0xee) AM_READWRITE( lx385_data_r, lx385_data_w ) |
| 148 | AM_RANGE(0xef, 0xef) AM_READWRITE( lx385_ctrl_r, lx385_ctrl_w ) |
| 149 | AM_RANGE(0xf0, 0xff) AM_READWRITE( lx383_r, lx383_w ) |
| 150 | ADDRESS_MAP_END |
| 151 | |
| 152 | static ADDRESS_MAP_START( z80net_io, ADDRESS_SPACE_IO, 8 ) |
| 153 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 154 | AM_RANGE(0xea, 0xea) AM_READ( lx388_data_r ) |
| 155 | AM_RANGE(0xeb, 0xeb) AM_READ( lx388_read_field_sync ) |
| 156 | AM_RANGE(0xee, 0xee) AM_READWRITE( lx385_data_r, lx385_data_w ) |
| 157 | AM_RANGE(0xef, 0xef) AM_READWRITE( lx385_ctrl_r, lx385_ctrl_w ) |
| 158 | AM_RANGE(0xf0, 0xff) AM_READWRITE( lx383_r, lx383_w ) |
| 159 | ADDRESS_MAP_END |
| 160 | |
| 161 | |
| 162 | |
| 163 | /****************************************************************************** |
| 164 | Input Ports |
| 165 | ******************************************************************************/ |
| 166 | |
| 167 | |
| 168 | static INPUT_PORTS_START( z80ne ) |
| 169 | /* LX.384 Hex Keyboard and Display */ |
| 170 | PORT_START("ROW0") /* IN0 keys row 0 */ |
| 171 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 172 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 173 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 174 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 175 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 176 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 177 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 178 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 179 | |
| 180 | PORT_START("ROW1") /* IN1 keys row 1 */ |
| 181 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 182 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 183 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 184 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 185 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) |
| 186 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) |
| 187 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) |
| 188 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) |
| 189 | |
| 190 | PORT_START("CTRL") /* CONTROL key */ |
| 191 | PORT_BIT( 0x80, 0x80, IPT_UNUSED ) |
| 192 | PORT_BIT( 0x40, 0x40, IPT_UNUSED ) |
| 193 | PORT_BIT( 0x20, 0x20, IPT_UNUSED ) |
| 194 | PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) |
| 195 | PORT_BIT( 0x08, 0x08, IPT_UNUSED ) |
| 196 | PORT_BIT( 0x04, 0x04, IPT_UNUSED ) |
| 197 | PORT_BIT( 0x02, 0x02, IPT_UNUSED ) |
| 198 | PORT_BIT( 0x01, 0x01, IPT_UNUSED ) |
| 199 | |
| 200 | PORT_START("RST") /* RESET key */ |
| 201 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_CHANGED(z80ne_reset, NULL) |
| 202 | |
| 203 | /* Settings */ |
| 204 | PORT_START("LX.385") |
| 205 | PORT_DIPNAME(0x07, 0x01 , "LX.385: P1,P3 Data Rate") |
| 206 | PORT_DIPSETTING( 0x01, "A-B: 300 bps") |
| 207 | PORT_DIPSETTING( 0x02, "A-C: 600 bps") |
| 208 | PORT_DIPSETTING( 0x04, "A-D: 1200 bps") |
| 209 | PORT_DIPNAME( 0x08, 0x00, "LX.385: P4 Parity Check") |
| 210 | PORT_DIPSETTING( 0x00, "Parity Check Enabled") |
| 211 | PORT_DIPSETTING( 0x08, "Parity Check Disabled") |
| 212 | |
| 213 | INPUT_PORTS_END |
| 214 | |
| 215 | |
| 216 | static INPUT_PORTS_START( z80net ) |
| 217 | |
| 218 | PORT_INCLUDE( z80ne ) |
| 219 | |
| 220 | /* LX.388 Keyboard BREAK key */ |
| 221 | PORT_START("LX388_BRK") |
| 222 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_STOP) PORT_CHANGED(z80ne_nmi, NULL) |
| 223 | |
| 224 | /* LX.388 Keyboard (Encoded by KR2376) */ |
| 225 | PORT_START("X0") |
| 226 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 227 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 228 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 229 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 230 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 231 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 232 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 233 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 234 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 235 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 236 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 237 | |
| 238 | PORT_START("X1") |
| 239 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 240 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 241 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 242 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 243 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 244 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 245 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 246 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 247 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 248 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 249 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 250 | |
| 251 | |
| 252 | PORT_START("X2") |
| 253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 258 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 259 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 260 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 261 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 262 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 263 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 264 | |
| 265 | PORT_START("X3") |
| 266 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 267 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') |
| 268 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 269 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("- Delete") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('_') |
| 270 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('@') PORT_CHAR('`') |
| 271 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 272 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') |
| 273 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') |
| 274 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Carriage Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 275 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10) |
| 276 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) |
| 277 | |
| 278 | PORT_START("X4") |
| 279 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(';') PORT_CHAR('+') |
| 280 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 281 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 282 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 283 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 284 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 285 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 286 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 287 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 288 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 289 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 290 | |
| 291 | |
| 292 | PORT_START("X5") |
| 293 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 294 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 295 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 296 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 297 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 298 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 299 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 300 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 301 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 302 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) |
| 303 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) |
| 304 | |
| 305 | |
| 306 | PORT_START("X6") |
| 307 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 308 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 309 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 310 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 311 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 312 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 313 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 314 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 315 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 316 | |
| 317 | PORT_START("X7") |
| 318 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 319 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 320 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(0xFFFD) |
| 321 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 322 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 323 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 324 | PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 325 | PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') |
| 326 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 327 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~') |
| 328 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') |
| 329 | |
| 330 | PORT_START("MODIFIERS") |
| 331 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 332 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) |
| 333 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| 334 | |
| 335 | INPUT_PORTS_END |
| 336 | |
| 337 | /****************************************************************************** |
| 338 | Machine Drivers |
| 339 | ******************************************************************************/ |
| 340 | |
| 341 | |
| 342 | static const ay31015_config z80ne_ay31015_config = |
| 343 | { |
| 344 | AY_3_1015, |
| 345 | 4800.0, |
| 346 | 4800.0, |
| 347 | NULL, |
| 348 | NULL, |
| 349 | NULL |
| 350 | }; |
| 351 | |
| 352 | static const cassette_config z80ne_cassettea_config = |
| 353 | { |
| 354 | cassette_default_formats, |
| 355 | NULL, |
| 356 | CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED |
| 357 | }; |
| 358 | |
| 359 | static const cassette_config z80ne_cassetteb_config = |
| 360 | { |
| 361 | cassette_default_formats, |
| 362 | NULL, |
| 363 | CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED |
| 364 | }; |
| 365 | |
| 366 | static const kr2376_interface lx388_kr2376_interface = |
| 367 | { |
| 368 | 50000, |
| 369 | NULL |
| 370 | }; |
| 371 | |
| 372 | static MACHINE_DRIVER_START( z80ne ) |
| 373 | /* basic machine hardware */ |
| 374 | MDRV_CPU_ADD("z80ne", Z80, Z80NE_CPU_SPEED_HZ) |
| 375 | MDRV_CPU_PROGRAM_MAP(z80ne_mem, 0) |
| 376 | MDRV_CPU_IO_MAP(z80ne_io, 0) |
| 377 | |
| 378 | MDRV_MACHINE_START(z80ne) |
| 379 | MDRV_MACHINE_RESET(z80ne) |
| 380 | |
| 381 | MDRV_AY31015_ADD( "ay_3_1015", z80ne_ay31015_config ) |
| 382 | |
| 383 | MDRV_CASSETTE_ADD( "cassettea", z80ne_cassettea_config ) |
| 384 | MDRV_CASSETTE_ADD( "cassetteb", z80ne_cassetteb_config ) |
| 385 | |
| 386 | MDRV_DEFAULT_LAYOUT(layout_z80ne) |
| 387 | MACHINE_DRIVER_END |
| 388 | |
| 389 | static MACHINE_DRIVER_START( z80net ) |
| 390 | MDRV_IMPORT_FROM( z80ne ) |
| 391 | |
| 392 | MDRV_CPU_MODIFY("z80ne") |
| 393 | MDRV_CPU_IO_MAP(z80net_io, 0) |
| 394 | |
| 395 | MDRV_MACHINE_START( z80net ) |
| 396 | MDRV_MACHINE_RESET( z80net ) |
| 397 | |
| 398 | MDRV_KR2376_ADD( "lx388_kr2376", lx388_kr2376_interface) |
| 399 | |
| 400 | /* video hardware */ |
| 401 | MDRV_SCREEN_ADD("lx388", RASTER) |
| 402 | MDRV_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 403 | |
| 404 | MDRV_VIDEO_START(lx388) |
| 405 | MDRV_VIDEO_UPDATE(m6847) |
| 406 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 407 | MDRV_SCREEN_SIZE(320, 25+192+26) |
| 408 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 409 | |
| 410 | MDRV_DEFAULT_LAYOUT(layout_z80net) |
| 411 | //MDRV_WD179X_ADD("wd179x", z80ne_wd17xx_interface ) |
| 412 | |
| 413 | MACHINE_DRIVER_END |
| 414 | |
| 415 | static MACHINE_DRIVER_START( z80netb ) |
| 416 | /* basic machine hardware */ |
| 417 | MDRV_CPU_ADD("z80ne", Z80, Z80NE_CPU_SPEED_HZ) |
| 418 | MDRV_CPU_PROGRAM_MAP(z80netb_mem, 0) |
| 419 | MDRV_CPU_IO_MAP(z80net_io, 0) |
| 420 | |
| 421 | MDRV_MACHINE_START(z80netb) |
| 422 | MDRV_MACHINE_RESET(z80netb) |
| 423 | |
| 424 | MDRV_AY31015_ADD( "ay_3_1015", z80ne_ay31015_config ) |
| 425 | |
| 426 | MDRV_CASSETTE_ADD( "cassettea", z80ne_cassettea_config ) |
| 427 | MDRV_CASSETTE_ADD( "cassetteb", z80ne_cassetteb_config ) |
| 428 | |
| 429 | MDRV_KR2376_ADD( "lx388_kr2376", lx388_kr2376_interface) |
| 430 | |
| 431 | /* video hardware */ |
| 432 | MDRV_SCREEN_ADD("lx388", RASTER) |
| 433 | MDRV_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 434 | |
| 435 | MDRV_VIDEO_START(lx388) |
| 436 | MDRV_VIDEO_UPDATE(m6847) |
| 437 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 438 | MDRV_SCREEN_SIZE(320, 25+192+26) |
| 439 | MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 440 | MDRV_DEFAULT_LAYOUT(layout_z80netb) |
| 441 | MACHINE_DRIVER_END |
| 442 | |
| 443 | /****************************************************************************** |
| 444 | ROM Definitions |
| 445 | ******************************************************************************/ |
| 446 | |
| 447 | |
| 448 | ROM_START( z80ne ) |
| 449 | ROM_REGION(0x10000, "z80ne", 0) |
| 450 | ROM_LOAD( "ep382.ic5", 0x8000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) ) |
| 451 | ROM_END |
| 452 | |
| 453 | ROM_START( z80net ) |
| 454 | ROM_REGION(0x10000, "z80ne", 0) |
| 455 | ROM_LOAD( "ep382.ic5", 0x8000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) ) |
| 456 | ROM_END |
| 457 | |
| 458 | ROM_START( z80netb ) |
| 459 | /* |
| 460 | * 16k Basic |
| 461 | */ |
| 462 | ROM_REGION(0x10000, "z80ne", 0) |
| 463 | ROM_LOAD( "548-1.ic1", 0x0000, 0x0800, CRC(868cad39) SHA1(0ea8af010786a080f823a879a4211f5712d260da) ) |
| 464 | ROM_LOAD( "548-2.ic2", 0x0800, 0x0800, CRC(ac297d99) SHA1(ccf31d3f9d02c3b68a0ee3be4984424df0e83ab0) ) |
| 465 | ROM_LOAD( "548-3.ic3", 0x1000, 0x0800, CRC(9c1fe511) SHA1(ff5b6e49a137c2ff9cb760c39bfd85ce4b52bb7d) ) |
| 466 | ROM_LOAD( "548-4.ic4", 0x1800, 0x0800, CRC(cb5e0de3) SHA1(0beaa8927faaf61f6c3fc0ea1d3d5670f901aae3) ) |
| 467 | ROM_LOAD( "548-5.ic5", 0x2000, 0x0800, CRC(0bd4559c) SHA1(e736a3124819ffb43e96a8114cd188f18d538053) ) |
| 468 | ROM_LOAD( "548-6.ic6", 0x2800, 0x0800, CRC(6d663034) SHA1(57588be4e360658dbb313946d7a608e36c1fdd68) ) |
| 469 | ROM_LOAD( "548-7.ic7", 0x3000, 0x0800, CRC(0bab06c0) SHA1(d52f1519c798e91f25648e996b1db174d90ce0f5) ) |
| 470 | ROM_LOAD( "548-8.ic8", 0x3800, 0x0800, CRC(f381b594) SHA1(2de7a8941ba48d463974c73d62e994d3cbe2868d) ) |
| 471 | ROM_END |
| 472 | |
| 473 | |
| 474 | /****************************************************************************** |
| 475 | System Config |
| 476 | ******************************************************************************/ |
| 477 | |
| 478 | |
| 479 | static SYSTEM_CONFIG_START( z80ne ) |
| 480 | CONFIG_RAM_DEFAULT( 32 * 1024 ) |
| 481 | CONFIG_RAM( 1 * 1024 ) |
| 482 | SYSTEM_CONFIG_END |
| 483 | |
| 484 | static SYSTEM_CONFIG_START( z80net ) |
| 485 | CONFIG_RAM_DEFAULT( 32 * 1024 ) |
| 486 | CONFIG_RAM( 1 * 1024 ) |
| 487 | SYSTEM_CONFIG_END |
| 488 | |
| 489 | static SYSTEM_CONFIG_START( z80netb ) |
| 490 | CONFIG_RAM_DEFAULT( 32 * 1024 ) |
| 491 | CONFIG_RAM( 1 * 1024 ) |
| 492 | SYSTEM_CONFIG_END |
| 493 | |
| 494 | |
| 495 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 496 | COMP( 1980, z80ne, 0, 0, z80ne, z80ne, z80ne, z80ne, "Nuova Elettronica", "Z80NE", GAME_NO_SOUND ) |
| 497 | COMP( 1980, z80net, z80ne, 0, z80net, z80net, z80net, z80net, "Nuova Elettronica", "Z80NE + LX.388", GAME_NO_SOUND | GAME_COMPUTER) |
| 498 | COMP( 1980, z80netb, z80ne, 0, z80netb, z80net, z80netb, z80netb, "Nuova Elettronica", "Z80NE + LX.388 + Basic 16k", GAME_NO_SOUND | GAME_COMPUTER) |