src/mess/machine/z80ne.c
| r4468 | r4469 | |
| 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 | | } |
| 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/drivers/z80ne.c
| r4468 | r4469 | |
| 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) |
| 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)
|