Previous 15994 Revisions Next

r2505 Tuesday 29th April, 2008 at 19:54:24 UTC by Wilbert Pol
[PC FAMILY] Rolled back revision 2475 and changed it into a PCJR specific fix.
[src/mess/drivers]pc.c
[src/mess/includes]pc.h
[src/mess/machine]pc.c

src/mess/includes/pc.h
r2504r2505
1717extern const struct pit8253_config pcjr_pit8253_config;
1818extern const struct pic8259_interface pc_pic8259_master_config;
1919extern const struct pic8259_interface pc_pic8259_slave_config;
20extern const struct pic8259_interface pcjr_pic8259_master_config;
2021extern const ins8250_interface ibmpc_com_interface[4];
2122extern const ppi8255_interface pc_ppi8255_interface;
2223extern const ppi8255_interface pcjr_ppi8255_interface;
src/mess/machine/pc.c
r2504r2505
168168 *
169169 *************************************************************/
170170
171static emu_timer   *pc_int_delay_timer;
172
173static 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
178171static PIC8259_SET_INT_LINE( pc_pic8259_master_set_int_line )
179172{
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);
182174}
183175
184176
r2504r2505
202194
203195/*************************************************************
204196 *
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
210static emu_timer   *pc_int_delay_timer;
211
212
213static 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
219static 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
232const struct pic8259_interface pcjr_pic8259_master_config =
233{
234   pcjr_pic8259_master_set_int_line
235};
236
237
238/*************************************************************
239 *
205240 * pit8253 configuration
206241 *
207242 *************************************************************/
r2504r2505
9821017   pc_devices.dma8237_1 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_1" );
9831018   pc_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" );
9841019   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 );
9871020}
9881021
9891022
r2504r2505
9911024{
9921025   MACHINE_RESET_CALL( pc );
9931026   pcjr_keyb_init();
1027   pc_int_delay_timer = timer_alloc( pcjr_delayed_pic8259_irq, NULL );
9941028}
9951029
9961030
src/mess/drivers/pc.c
r2504r2505
17431743   MDRV_DEVICE_CONFIG( pc_dma8237_config )
17441744
17451745   MDRV_DEVICE_ADD( "pic8259_master", PIC8259 )
1746   MDRV_DEVICE_CONFIG( pc_pic8259_master_config )
1746   MDRV_DEVICE_CONFIG( pcjr_pic8259_master_config )
17471747
17481748   MDRV_DEVICE_ADD( "pic8259_slave", PIC8259 )
17491749   MDRV_DEVICE_CONFIG( pc_pic8259_slave_config )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team