src/mess/machine/pc.c
| r2504 | r2505 | |
| 168 | 168 | * |
| 169 | 169 | *************************************************************/ |
| 170 | 170 | |
| 171 | | static emu_timer *pc_int_delay_timer; |
| 172 | | |
| 173 | | static TIMER_CALLBACK( pc_delayed_pic8259_irq ) |
| 174 | | { |
| 175 | | cpunum_set_input_line(pc_devices.pic8259_master->machine, 0, 0, param ? HOLD_LINE : CLEAR_LINE); |
| 176 | | } |
| 177 | | |
| 178 | 171 | static PIC8259_SET_INT_LINE( pc_pic8259_master_set_int_line ) |
| 179 | 172 | { |
| 180 | | timer_adjust_oneshot( pc_int_delay_timer, ATTOTIME_IN_CYCLES(1,0), interrupt ); |
| 181 | | // cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 173 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 182 | 174 | } |
| 183 | 175 | |
| 184 | 176 | |
| r2504 | r2505 | |
| 202 | 194 | |
| 203 | 195 | /************************************************************* |
| 204 | 196 | * |
| 197 | * PCJR pic8259 configuration |
| 198 | * |
| 199 | * Part of the PCJR CRT POST test at address F0452/F0454 writes |
| 200 | * to the PIC enabling an IRQ which is then immediately fired, |
| 201 | * however it is expected that the actual IRQ is taken one |
| 202 | * instruction later (the irq bit is reset by the instruction |
| 203 | * at F0454). Delaying taking of an IRQ by one instruction for |
| 204 | * all cases breaks floppy emulation. This seems to be a really |
| 205 | * tight corner case. For now we delay the IRQ by one instruction |
| 206 | * only for the PCJR and only when it's inside the POST checks. |
| 207 | * |
| 208 | *************************************************************/ |
| 209 | |
| 210 | static emu_timer *pc_int_delay_timer; |
| 211 | |
| 212 | |
| 213 | static TIMER_CALLBACK( pcjr_delayed_pic8259_irq ) |
| 214 | { |
| 215 | cpunum_set_input_line(pc_devices.pic8259_master->machine, 0, 0, param ? HOLD_LINE : CLEAR_LINE); |
| 216 | } |
| 217 | |
| 218 | |
| 219 | static PIC8259_SET_INT_LINE( pcjr_pic8259_master_set_int_line ) |
| 220 | { |
| 221 | if ( cpunum_get_reg( 0, REG_PC ) == 0xF0454 ) |
| 222 | { |
| 223 | timer_adjust_oneshot( pc_int_delay_timer, ATTOTIME_IN_CYCLES(1,0), interrupt ); |
| 224 | } |
| 225 | else |
| 226 | { |
| 227 | cpunum_set_input_line(device->machine, 0, 0, interrupt ? HOLD_LINE : CLEAR_LINE); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | |
| 232 | const struct pic8259_interface pcjr_pic8259_master_config = |
| 233 | { |
| 234 | pcjr_pic8259_master_set_int_line |
| 235 | }; |
| 236 | |
| 237 | |
| 238 | /************************************************************* |
| 239 | * |
| 205 | 240 | * pit8253 configuration |
| 206 | 241 | * |
| 207 | 242 | *************************************************************/ |
| r2504 | r2505 | |
| 982 | 1017 | pc_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" ); |
| 983 | 1018 | pc_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" ); |
| 984 | 1019 | pc_mouse_set_serial_port( device_list_find_by_tag( machine->config->devicelist, INS8250, "ins8250_0" ) ); |
| 985 | | |
| 986 | | pc_int_delay_timer = timer_alloc( pc_delayed_pic8259_irq, NULL ); |
| 987 | 1020 | } |
| 988 | 1021 | |
| 989 | 1022 | |
| r2504 | r2505 | |
| 991 | 1024 | { |
| 992 | 1025 | MACHINE_RESET_CALL( pc ); |
| 993 | 1026 | pcjr_keyb_init(); |
| 1027 | pc_int_delay_timer = timer_alloc( pcjr_delayed_pic8259_irq, NULL ); |
| 994 | 1028 | } |
| 995 | 1029 | |
| 996 | 1030 | |