src/mess/machine/conkort.c
| r3741 | r3742 | |
| 101 | 101 | typedef struct _slow_t slow_t;
|
| 102 | 102 | struct _slow_t
|
| 103 | 103 | {
|
| 104 | | int cpunum; /* CPU index of the Z80 */
|
| 104 | const device_config *cpu; /* CPU of the Z80 */
|
| 105 | 105 | |
| 106 | 106 | UINT8 status; /* ABC BUS status */
|
| 107 | 107 | UINT8 data; /* ABC BUS data */
|
| r3741 | r3742 | |
| 115 | 115 | typedef struct _fast_t fast_t;
|
| 116 | 116 | struct _fast_t
|
| 117 | 117 | {
|
| 118 | | int cpunum; /* CPU index of the Z80 */
|
| 118 | const device_config *cpu; /* CPU of the Z80 */
|
| 119 | 119 | |
| 120 | 120 | UINT8 status; /* ABC BUS status */
|
| 121 | 121 | UINT8 data; /* ABC BUS data */
|
| r3741 | r3742 | |
| 203 | 203 | {
|
| 204 | 204 | slow_t *conkort = get_safe_token_machine_slow(space->machine);
|
| 205 | 205 | |
| 206 | | cpu_set_input_line(space->machine->cpu[conkort->cpunum], INPUT_LINE_NMI, PULSE_LINE);
|
| 206 | cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, PULSE_LINE);
|
| 207 | 207 | }
|
| 208 | 208 | |
| 209 | 209 | static WRITE8_HANDLER( slow_bus_c3_w )
|
| 210 | 210 | {
|
| 211 | 211 | slow_t *conkort = get_safe_token_machine_slow(space->machine);
|
| 212 | 212 | |
| 213 | | cpu_set_input_line(space->machine->cpu[conkort->cpunum], INPUT_LINE_RESET, PULSE_LINE);
|
| 213 | cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, PULSE_LINE);
|
| 214 | 214 | }
|
| 215 | 215 | |
| 216 | 216 | static ABCBUS_CARD_SELECT( luxor_55_10828 )
|
| r3741 | r3742 | |
| 227 | 227 | memory_install_write8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_IO), ABCBUS_C4, ABCBUS_C4, 0x18, 0, SMH_NOP);
|
| 228 | 228 | }
|
| 229 | 229 | |
| 230 | | cpu_set_input_line(device->machine->cpu[conkort->cpunum], INPUT_LINE_RESET, PULSE_LINE);
|
| 230 | cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, PULSE_LINE);
|
| 231 | 231 | }
|
| 232 | 232 | |
| 233 | 233 | static WRITE8_HANDLER( slow_ctrl_w )
|
| r3741 | r3742 | |
| 290 | 290 | conkort->status = data;
|
| 291 | 291 | |
| 292 | 292 | /* interrupt to main CPU */
|
| 293 | | cpu_set_input_line(space->machine->cpu[conkort->cpunum], INPUT_LINE_IRQ0, BIT(data, 7) ? ASSERT_LINE : CLEAR_LINE);
|
| 293 | cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, BIT(data, 7) ? ASSERT_LINE : CLEAR_LINE);
|
| 294 | 294 | }
|
| 295 | 295 | |
| 296 | 296 | /* Fast Controller */
|
| r3741 | r3742 | |
| 330 | 330 | {
|
| 331 | 331 | fast_t *conkort = get_safe_token_machine_fast(space->machine);
|
| 332 | 332 | |
| 333 | | cpu_set_input_line(space->machine->cpu[conkort->cpunum], INPUT_LINE_NMI, PULSE_LINE);
|
| 333 | cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, PULSE_LINE);
|
| 334 | 334 | }
|
| 335 | 335 | |
| 336 | 336 | static WRITE8_HANDLER( fast_bus_c3_w )
|
| 337 | 337 | {
|
| 338 | 338 | fast_t *conkort = get_safe_token_machine_fast(space->machine);
|
| 339 | 339 | |
| 340 | | cpu_set_input_line(space->machine->cpu[conkort->cpunum], INPUT_LINE_RESET, PULSE_LINE);
|
| 340 | cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, PULSE_LINE);
|
| 341 | 341 | }
|
| 342 | 342 | |
| 343 | 343 | static ABCBUS_CARD_SELECT( luxor_55_21046 )
|
| r3741 | r3742 | |
| 354 | 354 | memory_install_write8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_IO), ABCBUS_C4, ABCBUS_C4, 0x18, 0, SMH_NOP);
|
| 355 | 355 | }
|
| 356 | 356 | |
| 357 | | cpu_set_input_line(device->machine->cpu[conkort->cpunum], INPUT_LINE_RESET, PULSE_LINE);
|
| 357 | cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, PULSE_LINE);
|
| 358 | 358 | }
|
| 359 | 359 | |
| 360 | 360 | static READ8_HANDLER( fast_ctrl_r )
|
| r3741 | r3742 | |
| 477 | 477 | {
|
| 478 | 478 | slow_t *conkort = get_safe_token_machine_slow(device->machine);
|
| 479 | 479 | |
| 480 | | cpu_set_input_line(device->machine->cpu[conkort->cpunum], INPUT_LINE_IRQ0, state);
|
| 480 | cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, state);
|
| 481 | 481 | }
|
| 482 | 482 | |
| 483 | 483 | static READ8_DEVICE_HANDLER( pio_port_a_r )
|
| r3741 | r3742 | |
| 614 | 614 | {
|
| 615 | 615 | fast_t *conkort = get_safe_token_machine_fast(device->machine);
|
| 616 | 616 | |
| 617 | | cpu_set_input_line(device->machine->cpu[conkort->cpunum], INPUT_LINE_IRQ0, state);
|
| 617 | cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, state);
|
| 618 | 618 | }
|
| 619 | 619 | |
| 620 | 620 | static READ8_DEVICE_HANDLER( dma_port_a_r )
|
| 621 | 621 | {
|
| 622 | 622 | fast_t *conkort = get_safe_token_machine_fast(device->machine);
|
| 623 | | const address_space *program = cpu_get_address_space(device->machine->cpu[conkort->cpunum], ADDRESS_SPACE_PROGRAM);
|
| 623 | const address_space *program = cpu_get_address_space(conkort->cpu, ADDRESS_SPACE_PROGRAM);
|
| 624 | 624 | |
| 625 | 625 | UINT8 data = 0xff;
|
| 626 | 626 | |
| 627 | | cpu_push_context(device->machine->cpu[conkort->cpunum]);
|
| 627 | cpu_push_context(conkort->cpu);
|
| 628 | 628 | |
| 629 | 629 | data = memory_read_byte_8le(program, offset);
|
| 630 | 630 |
|
| r3741 | r3742 | |
| 636 | 636 | static WRITE8_DEVICE_HANDLER( dma_port_a_w )
|
| 637 | 637 | {
|
| 638 | 638 | fast_t *conkort = get_safe_token_machine_fast(device->machine);
|
| 639 | | const address_space *program = cpu_get_address_space(device->machine->cpu[conkort->cpunum], ADDRESS_SPACE_PROGRAM);
|
| 639 | const address_space *program = cpu_get_address_space(conkort->cpu, ADDRESS_SPACE_PROGRAM);
|
| 640 | 640 | |
| 641 | | cpu_push_context(device->machine->cpu[conkort->cpunum]);
|
| 641 | cpu_push_context(conkort->cpu);
|
| 642 | 642 |
|
| 643 | 643 | memory_write_byte_8le(program, offset, data);
|
| 644 | 644 |
|
| r3741 | r3742 | |
| 648 | 648 | static READ8_DEVICE_HANDLER( dma_port_b_r )
|
| 649 | 649 | {
|
| 650 | 650 | fast_t *conkort = get_safe_token_machine_fast(device->machine);
|
| 651 | | const address_space *io = cpu_get_address_space(device->machine->cpu[conkort->cpunum], ADDRESS_SPACE_IO);
|
| 651 | const address_space *io = cpu_get_address_space(conkort->cpu, ADDRESS_SPACE_IO);
|
| 652 | 652 | |
| 653 | 653 | UINT8 data = 0xff;
|
| 654 | 654 | |
| 655 | | cpu_push_context(device->machine->cpu[conkort->cpunum]);
|
| 655 | cpu_push_context(conkort->cpu);
|
| 656 | 656 | |
| 657 | 657 | data = memory_read_byte_8le(io, offset);
|
| 658 | 658 | |
| r3741 | r3742 | |
| 664 | 664 | static WRITE8_DEVICE_HANDLER( dma_port_b_w )
|
| 665 | 665 | {
|
| 666 | 666 | fast_t *conkort = get_safe_token_machine_fast(device->machine);
|
| 667 | | const address_space *io = cpu_get_address_space(device->machine->cpu[conkort->cpunum], ADDRESS_SPACE_IO);
|
| 667 | const address_space *io = cpu_get_address_space(conkort->cpu, ADDRESS_SPACE_IO);
|
| 668 | 668 | |
| 669 | | cpu_push_context(device->machine->cpu[conkort->cpunum]);
|
| 669 | cpu_push_context(conkort->cpu);
|
| 670 | 670 | |
| 671 | 671 | memory_write_byte_8le(io, offset, data);
|
| 672 | 672 | |
| r3741 | r3742 | |
| 816 | 816 | |
| 817 | 817 | /* find our CPU */
|
| 818 | 818 | astring_printf(tempstring, "%s:%s", device->tag, CONKORT_Z80_TAG);
|
| 819 | | conkort->cpunum = mame_find_cpu_index(device->machine, astring_c(tempstring));
|
| 819 | conkort->cpu = cputag_get_cpu(device->machine, astring_c(tempstring));
|
| 820 | 820 | astring_free(tempstring);
|
| 821 | 821 | |
| 822 | 822 | /* find devices */
|
| r3741 | r3742 | |
| 884 | 884 | |
| 885 | 885 | /* find our CPU */
|
| 886 | 886 | astring_printf(tempstring, "%s:%s", device->tag, CONKORT_Z80_TAG);
|
| 887 | | conkort->cpunum = mame_find_cpu_index(device->machine, astring_c(tempstring));
|
| 887 | conkort->cpu = cputag_get_cpu(device->machine, astring_c(tempstring));
|
| 888 | 888 | astring_free(tempstring);
|
| 889 | 889 | |
| 890 | 890 | /* find devices */
|
src/mess/machine/abc77.c
| r3741 | r3742 | |
| 8 | 8 | { |
| 9 | 9 | const abc77_interface *intf; /* interface */ |
| 10 | 10 | |
| 11 | | int cpunum; /* CPU index of the 8035 */ |
| 11 | const device_config *cpu; /* CPU of the 8035 */ |
| 12 | 12 | |
| 13 | 13 | int keylatch; /* keyboard row latch */ |
| 14 | 14 | int clock; /* transmit clock */ |
| r3741 | r3742 | |
| 48 | 48 | { |
| 49 | 49 | abc77_t *abc77 = get_safe_token(device); |
| 50 | 50 | |
| 51 | | cpu_set_input_line(device->machine->cpu[abc77->cpunum], MCS48_INPUT_IRQ, level ? CLEAR_LINE : ASSERT_LINE); |
| 51 | cpu_set_input_line(abc77->cpu, MCS48_INPUT_IRQ, level ? CLEAR_LINE : ASSERT_LINE); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static TIMER_DEVICE_CALLBACK( clock_tick ) |
| r3741 | r3742 | |
| 64 | 64 | const device_config *device = ptr; |
| 65 | 65 | abc77_t *abc77 = get_safe_token(device); |
| 66 | 66 | |
| 67 | | cpu_set_input_line(device->machine->cpu[abc77->cpunum], INPUT_LINE_RESET, CLEAR_LINE); |
| 67 | cpu_set_input_line(abc77->cpu, INPUT_LINE_RESET, CLEAR_LINE); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | void abc77_reset_w(const device_config *device, int level) |
| r3741 | r3742 | |
| 77 | 77 | int t = 1.1 * RES_K(100) * CAP_N(100) * 1000; // t = 1.1 * R1 * C1 |
| 78 | 78 | int ea = BIT(input_port_read(device->machine, "ABC77_DSW"), 7); |
| 79 | 79 | |
| 80 | | cpu_set_input_line(device->machine->cpu[abc77->cpunum], INPUT_LINE_RESET, ASSERT_LINE); |
| 80 | cpu_set_input_line(abc77->cpu, INPUT_LINE_RESET, ASSERT_LINE); |
| 81 | 81 | timer_adjust_oneshot(abc77->reset_timer, ATTOTIME_IN_MSEC(t), 0); |
| 82 | 82 | |
| 83 | | cpu_set_input_line(device->machine->cpu[abc77->cpunum], MCS48_INPUT_EA, ea ? CLEAR_LINE : ASSERT_LINE); |
| 83 | cpu_set_input_line(abc77->cpu, MCS48_INPUT_EA, ea ? CLEAR_LINE : ASSERT_LINE); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | abc77->reset = level; |
| r3741 | r3742 | |
| 333 | 333 | /* find our CPU */ |
| 334 | 334 | |
| 335 | 335 | astring_printf(tempstring, "%s:%s", device->tag, I8035_TAG); |
| 336 | | abc77->cpunum = mame_find_cpu_index(device->machine, astring_c(tempstring)); |
| 336 | abc77->cpu = cputag_get_cpu(device->machine, astring_c(tempstring)); |
| 337 | 337 | astring_free(tempstring); |
| 338 | 338 | |
| 339 | 339 | /* allocate reset timer */ |