src/mess/machine/at.c
| r6048 | r6049 | |
| 497 | 497 | static WRITE8_HANDLER( at_kbdc8042_p2_w ) |
| 498 | 498 | { |
| 499 | 499 | at_state *st = space->machine->driver_data; |
| 500 | | |
| 500 | |
| 501 | 501 | logerror("%04x: writing $%02x to P2\n", cpu_get_pc(cputag_get_cpu(space->machine, "maincpu")), data ); |
| 502 | 502 | |
| 503 | 503 | at_set_gate_a20( space->machine, ( data & 0x02 ) ? 1 : 0 ); |
| r6048 | r6049 | |
| 567 | 567 | static int poll_delay = 4; |
| 568 | 568 | UINT8 data = 0; |
| 569 | 569 | at_state *st = space->machine->driver_data; |
| 570 | | |
| 570 | |
| 571 | 571 | switch ( offset ) |
| 572 | 572 | { |
| 573 | 573 | case 0: /* A2 is wired to 8042 A0 */ |
| r6048 | r6049 | |
| 746 | 746 | }; |
| 747 | 747 | |
| 748 | 748 | init_at_common(machine, &at8042); |
| 749 | | pc_turbo_setup(machine, 0, "DSW2", 0x02, 4.77/12, 1); |
| 749 | pc_turbo_setup(machine, machine->firstcpu, "DSW2", 0x02, 4.77/12, 1); |
| 750 | 750 | pc_vga_init(machine, &vga_interface, NULL); |
| 751 | 751 | |
| 752 | 752 | /* Attach keyboard to the keyboard controller */ |
| r6048 | r6049 | |
| 763 | 763 | KBDC8042_PS2, at_set_gate_a20, at_keyboard_interrupt, at_get_out2 |
| 764 | 764 | }; |
| 765 | 765 | init_at_common(machine, &at8042); |
| 766 | | pc_turbo_setup(machine, 0, "DSW2", 0x02, 4.77/12, 1); |
| 766 | pc_turbo_setup(machine, machine->firstcpu, "DSW2", 0x02, 4.77/12, 1); |
| 767 | 767 | pc_vga_init(machine, &vga_interface, NULL); |
| 768 | 768 | |
| 769 | 769 | /* Attach keyboard to the keyboard controller */ |
src/mess/machine/pc_turbo.c
| r6048 | r6049 | |
| 7 | 7 | **********************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | | #include "mslegacy.h" |
| 11 | 10 | #include "pc_turbo.h" |
| 12 | 11 | |
| 13 | 12 | |
| 14 | 13 | struct pc_turbo_info |
| 15 | 14 | { |
| 16 | | int cpunum; |
| 15 | const device_config *cpu; |
| 17 | 16 | const char *port; |
| 18 | 17 | int mask; |
| 19 | 18 | int cur_val; |
| r6048 | r6049 | |
| 33 | 32 | if (val != ti->cur_val) |
| 34 | 33 | { |
| 35 | 34 | ti->cur_val = val; |
| 36 | | cpu_set_clockscale(cpu_get_by_index(machine, ti->cpunum), val ? ti->on_speed : ti->off_speed); |
| 35 | cpu_set_clockscale(ti->cpu, val ? ti->on_speed : ti->off_speed); |
| 37 | 36 | } |
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | |
| 41 | 40 | |
| 42 | | int pc_turbo_setup(running_machine *machine, int cpunum, const char *port, int mask, double off_speed, double on_speed) |
| 41 | int pc_turbo_setup(running_machine *machine, const device_config *cpu, const char *port, int mask, double off_speed, double on_speed) |
| 43 | 42 | { |
| 44 | 43 | struct pc_turbo_info *ti; |
| 45 | 44 | |
| 46 | 45 | ti = auto_alloc(machine, struct pc_turbo_info); |
| 47 | | ti->cpunum = cpunum; |
| 46 | ti->cpu = cpu; |
| 48 | 47 | ti->port = port; |
| 49 | 48 | ti->mask = mask; |
| 50 | 49 | ti->cur_val = -1; |
src/mess/machine/hd63450.c
| r6048 | r6049 | |
| 4 | 4 | Largely based on documentation of the Sharp X68000 |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | | #include "machine/hd63450.h" |
| 8 | | #include "mslegacy.h" |
| 7 | #include "hd63450.h" |
| 9 | 8 | |
| 10 | 9 | typedef struct _hd63450_regs hd63450_regs; |
| 11 | 10 | struct _hd63450_regs |
| r6048 | r6049 | |
| 250 | 249 | // Burst transfers will halt the CPU until the transfer is complete |
| 251 | 250 | if((dmac->reg[channel].dcr & 0xc0) == 0x00) // Burst transfer |
| 252 | 251 | { |
| 253 | | cpu_set_input_line(cpu_get_by_index(device->machine, dmac->intf->cpu), INPUT_LINE_HALT,ASSERT_LINE); |
| 252 | const device_config *cpu = devtag_get_device(device->machine, dmac->intf->cpu_tag); |
| 253 | cpu_set_input_line(cpu, INPUT_LINE_HALT, ASSERT_LINE); |
| 254 | 254 | timer_adjust_periodic(dmac->timer[channel], attotime_zero, channel, dmac->burst_clock[channel]); |
| 255 | 255 | } |
| 256 | 256 | else |
| r6048 | r6049 | |
| 427 | 427 | dmac->in_progress[x] = 0; |
| 428 | 428 | dmac->reg[x].csr |= 0xe0; // channel operation complete, block transfer complete |
| 429 | 429 | dmac->reg[x].csr &= ~0x08; // channel no longer active |
| 430 | | if((dmac->reg[x].dcr & 0xc0) == 0x00) // Burst transfer |
| 431 | | cpu_set_input_line(cpu_get_by_index(device->machine, dmac->intf->cpu), INPUT_LINE_HALT,CLEAR_LINE); |
| 432 | 430 | |
| 431 | // Burst transfer |
| 432 | if((dmac->reg[x].dcr & 0xc0) == 0x00) |
| 433 | { |
| 434 | const device_config *cpu = devtag_get_device(device->machine, dmac->intf->cpu_tag); |
| 435 | cpu_set_input_line(cpu, INPUT_LINE_HALT, CLEAR_LINE); |
| 436 | } |
| 437 | |
| 433 | 438 | if(dmac->intf->dma_end) |
| 434 | 439 | dmac->intf->dma_end(device->machine,x,dmac->reg[x].ccr & 0x08); |
| 435 | 440 | } |
src/mess/machine/pc.c
| r6048 | r6049 | |
| 605 | 605 | int data = 0xFF; |
| 606 | 606 | running_machine *machine = device->machine; |
| 607 | 607 | pc_state *st = device->machine->driver_data; |
| 608 | | |
| 608 | |
| 609 | 609 | /* KB port A */ |
| 610 | 610 | if (st->ppi_keyboard_clear) |
| 611 | 611 | { |
| r6048 | r6049 | |
| 806 | 806 | static WRITE8_HANDLER( ibm5150_kb_set_data_signal ) |
| 807 | 807 | { |
| 808 | 808 | pc_state *st = space->machine->driver_data; |
| 809 | | |
| 809 | |
| 810 | 810 | st->ppi_data_signal = data; |
| 811 | 811 | |
| 812 | 812 | st->ppi_data_callback( space, 0, st->ppi_data_signal ); |
| r6048 | r6049 | |
| 816 | 816 | static void ibm5150_set_keyboard_interface( running_machine *machine, write8_space_func clock_cb, write8_space_func data_cb ) |
| 817 | 817 | { |
| 818 | 818 | pc_state *st = machine->driver_data; |
| 819 | | |
| 819 | |
| 820 | 820 | st->ppi_clock_callback = clock_cb; |
| 821 | 821 | st->ppi_data_callback = data_cb; |
| 822 | 822 | } |
| r6048 | r6049 | |
| 840 | 840 | int data = 0xFF; |
| 841 | 841 | running_machine *machine = device->machine; |
| 842 | 842 | pc_state *st = device->machine->driver_data; |
| 843 | | |
| 843 | |
| 844 | 844 | /* KB port A */ |
| 845 | 845 | if (st->ppi_keyboard_clear) |
| 846 | 846 | { |
| r6048 | r6049 | |
| 935 | 935 | |
| 936 | 936 | static READ8_DEVICE_HANDLER (pc_ppi_porta_r) |
| 937 | 937 | { |
| 938 | | int data = 0xFF; |
| 938 | int data = 0xFF; |
| 939 | 939 | running_machine *machine = device->machine; |
| 940 | 940 | pc_state *st = device->machine->driver_data; |
| 941 | 941 | |
| r6048 | r6049 | |
| 1181 | 1181 | DRIVER_INIT( bondwell ) |
| 1182 | 1182 | { |
| 1183 | 1183 | mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, NULL, pc_set_irq_line); |
| 1184 | | pc_turbo_setup(machine, 0, "DSW2", 0x02, 4.77/12, 1); |
| 1184 | pc_turbo_setup(machine, machine->firstcpu, "DSW2", 0x02, 4.77/12, 1); |
| 1185 | 1185 | |
| 1186 | 1186 | /* Attach keyboard to the keyboard controller */ |
| 1187 | 1187 | ibm5150_set_keyboard_interface( machine, kb_keytronic_set_clock_signal, kb_keytronic_set_data_signal ); |
| r6048 | r6049 | |
| 1223 | 1223 | DRIVER_INIT( t1000hx ) |
| 1224 | 1224 | { |
| 1225 | 1225 | mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 1226 | | pc_turbo_setup(machine, 0, "DSW2", 0x02, 4.77/12, 1); |
| 1226 | pc_turbo_setup(machine, machine->firstcpu, "DSW2", 0x02, 4.77/12, 1); |
| 1227 | 1227 | } |
| 1228 | 1228 | |
| 1229 | 1229 | DRIVER_INIT( pc200 ) |
| r6048 | r6049 | |
| 1239 | 1239 | memory_install_read16_handler( space, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_r ); |
| 1240 | 1240 | memory_install_write16_handler( space, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_w ); |
| 1241 | 1241 | videoram_size=0x10000; |
| 1242 | | videoram=memory_region(machine, "maincpu")+0xb0000; |
| 1242 | videoram=memory_region(machine, "maincpu")+0xb0000; |
| 1243 | 1243 | mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 1244 | 1244 | } |
| 1245 | 1245 | |
| r6048 | r6049 | |
| 1256 | 1256 | memory_install_read16_handler( space, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_r ); |
| 1257 | 1257 | memory_install_write16_handler( space, 0xb0000, 0xbffff, 0, 0, pc200_videoram16le_w ); |
| 1258 | 1258 | videoram_size=0x10000; |
| 1259 | | videoram=memory_region(machine, "maincpu")+0xb0000; |
| 1259 | videoram=memory_region(machine, "maincpu")+0xb0000; |
| 1260 | 1260 | mess_init_pc_common(machine, PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line); |
| 1261 | 1261 | mc146818_init(machine, MC146818_IGNORE_CENTURY); |
| 1262 | 1262 | } |