mirror of
https://github.com/holub/mame
synced 2025-07-06 18:39:28 +03:00
pic8259: replaced pic8259_set_irq_line with pic8259_irX_w write line handlers
This commit is contained in:
parent
bd8232c7c9
commit
b91b1b8018
@ -119,7 +119,7 @@ INLINE void pic8259_set_timer(pic8259_t *pic8259)
|
||||
}
|
||||
|
||||
|
||||
void pic8259_set_irq_line(running_device *device, int irq, int state)
|
||||
static void pic8259_set_irq_line(running_device *device, int irq, int state)
|
||||
{
|
||||
pic8259_t *pic8259 = get_safe_token(device);
|
||||
UINT8 old_irq_lines = pic8259->irq_lines;
|
||||
@ -149,7 +149,14 @@ void pic8259_set_irq_line(running_device *device, int irq, int state)
|
||||
pic8259_set_timer(pic8259);
|
||||
}
|
||||
|
||||
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir0_w ) { pic8259_set_irq_line(device, 0, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir1_w ) { pic8259_set_irq_line(device, 1, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir2_w ) { pic8259_set_irq_line(device, 2, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir3_w ) { pic8259_set_irq_line(device, 3, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir4_w ) { pic8259_set_irq_line(device, 4, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir5_w ) { pic8259_set_irq_line(device, 5, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir6_w ) { pic8259_set_irq_line(device, 6, state); }
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir7_w ) { pic8259_set_irq_line(device, 7, state); }
|
||||
|
||||
int pic8259_acknowledge(running_device *device)
|
||||
{
|
||||
|
@ -1,11 +1,29 @@
|
||||
/**********************************************************************
|
||||
/***************************************************************************
|
||||
|
||||
8259 PIC interface and emulation
|
||||
Intel 8259A
|
||||
|
||||
**********************************************************************/
|
||||
Programmable Interrupt Controller
|
||||
|
||||
#ifndef __PIC8259_H_
|
||||
#define __PIC8259_H_
|
||||
_____ _____
|
||||
_CS 1 |* \_/ | 28 VCC
|
||||
_WR 2 | | 27 A0
|
||||
_RD 3 | | 26 _INTA
|
||||
D7 4 | | 25 IR7
|
||||
D6 5 | | 24 IR6
|
||||
D5 6 | | 23 IR5
|
||||
D4 7 | 8259A | 22 IR4
|
||||
D3 8 | | 21 IR3
|
||||
D2 9 | | 20 IR2
|
||||
D1 10 | | 19 IR1
|
||||
D0 11 | | 18 IR0
|
||||
CAS0 12 | | 17 INT
|
||||
CAS1 13 | | 16 _SP/_EN
|
||||
GND 14 |_____________| 15 CAS2
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __PIC8259_H__
|
||||
#define __PIC8259_H__
|
||||
|
||||
#define PIC8259 DEVICE_GET_INFO_NAME(pic8259)
|
||||
|
||||
@ -37,6 +55,16 @@ DEVICE_GET_INFO(pic8259);
|
||||
READ8_DEVICE_HANDLER( pic8259_r );
|
||||
WRITE8_DEVICE_HANDLER( pic8259_w );
|
||||
int pic8259_acknowledge(running_device *device);
|
||||
void pic8259_set_irq_line(running_device *device, int irq, int state);
|
||||
|
||||
#endif /* __PIC8259_H_ */
|
||||
/* interrupt requests */
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir0_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir1_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir2_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir3_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir4_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir5_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir6_w );
|
||||
WRITE_LINE_DEVICE_HANDLER( pic8259_ir7_w );
|
||||
|
||||
|
||||
#endif /* __PIC8259_H__ */
|
||||
|
@ -579,7 +579,7 @@ static PIC8259_SET_INT_LINE( calchase_pic8259_1_set_int_line ) {
|
||||
|
||||
|
||||
static PIC8259_SET_INT_LINE( calchase_pic8259_2_set_int_line ) {
|
||||
pic8259_set_irq_line( calchase_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(calchase_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
|
||||
@ -601,7 +601,7 @@ static const struct pic8259_interface calchase_pic8259_2_config = {
|
||||
|
||||
static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
|
||||
{
|
||||
pic8259_set_irq_line(calchase_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(calchase_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static const struct pit8253_config calchase_pit8254_config =
|
||||
@ -632,12 +632,12 @@ static void set_gate_a20(running_machine *machine, int a20)
|
||||
|
||||
static void keyboard_interrupt(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(calchase_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(calchase_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static void ide_interrupt(running_device *device, int state)
|
||||
{
|
||||
pic8259_set_irq_line(calchase_devices.pic8259_2, 6, state);
|
||||
pic8259_ir6_w(calchase_devices.pic8259_2, state);
|
||||
}
|
||||
|
||||
static int calchase_get_out2(running_machine *machine) {
|
||||
@ -650,7 +650,7 @@ static const struct kbdc8042_interface at8042 =
|
||||
};
|
||||
|
||||
static void calchase_set_keyb_int(running_machine *machine, int state) {
|
||||
pic8259_set_irq_line(calchase_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(calchase_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
|
||||
|
@ -623,7 +623,7 @@ static PIC8259_SET_INT_LINE( gamecstl_pic8259_1_set_int_line )
|
||||
|
||||
static PIC8259_SET_INT_LINE( gamecstl_pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( gamecstl_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(gamecstl_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
|
||||
@ -645,7 +645,7 @@ static const struct pic8259_interface gamecstl_pic8259_2_config = {
|
||||
|
||||
static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
|
||||
{
|
||||
pic8259_set_irq_line(gamecstl_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(gamecstl_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static const struct pit8253_config gamecstl_pit8254_config =
|
||||
@ -715,12 +715,12 @@ static void set_gate_a20(running_machine *machine, int a20)
|
||||
|
||||
static void keyboard_interrupt(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(gamecstl_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static void ide_interrupt(running_device *device, int state)
|
||||
{
|
||||
pic8259_set_irq_line( gamecstl_devices.pic8259_2, 6, state);
|
||||
pic8259_ir6_w(gamecstl_devices.pic8259_2, state);
|
||||
}
|
||||
|
||||
static int gamecstl_get_out2(running_machine *machine)
|
||||
@ -735,7 +735,7 @@ static const struct kbdc8042_interface at8042 =
|
||||
|
||||
static void gamecstl_set_keyb_int(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(gamecstl_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(gamecstl_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( gamecstl )
|
||||
|
@ -1000,7 +1000,7 @@ static PIC8259_SET_INT_LINE( mediagx_pic8259_1_set_int_line )
|
||||
|
||||
static PIC8259_SET_INT_LINE( mediagx_pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( mediagx_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(mediagx_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
|
||||
@ -1022,7 +1022,7 @@ static const struct pic8259_interface mediagx_pic8259_2_config = {
|
||||
|
||||
static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
|
||||
{
|
||||
pic8259_set_irq_line( mediagx_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(mediagx_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
|
||||
@ -1102,12 +1102,12 @@ static void set_gate_a20(running_machine *machine, int a20)
|
||||
|
||||
static void keyboard_interrupt(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(mediagx_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static void ide_interrupt(running_device *device, int state)
|
||||
{
|
||||
pic8259_set_irq_line(mediagx_devices.pic8259_2, 6, state);
|
||||
pic8259_ir6_w(mediagx_devices.pic8259_2, state);
|
||||
}
|
||||
|
||||
static int mediagx_get_out2(running_machine *machine)
|
||||
@ -1122,7 +1122,7 @@ static const struct kbdc8042_interface at8042 =
|
||||
|
||||
static void mediagx_set_keyb_int(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(mediagx_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static void init_mediagx(running_machine *machine)
|
||||
|
@ -242,7 +242,7 @@ static const struct pic8259_interface pic8259_1_config = {
|
||||
|
||||
static PIC8259_SET_INT_LINE( pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( pcat_dyn_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(pcat_dyn_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
static const struct pic8259_interface pic8259_2_config = {
|
||||
@ -264,7 +264,7 @@ static PIT8253_OUTPUT_CHANGED( at_pit8254_out0_changed )
|
||||
{
|
||||
if ( pcat_dyn_devices.pic8259_1 )
|
||||
{
|
||||
pic8259_set_irq_line(pcat_dyn_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(pcat_dyn_devices.pic8259_1, state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -472,7 +472,7 @@ static PALETTE_INIT(pcat_286)
|
||||
|
||||
static void pcat_dyn_set_keyb_int(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(pcat_dyn_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(pcat_dyn_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
|
||||
|
@ -305,7 +305,7 @@ static const struct pic8259_interface pic8259_1_config = {
|
||||
|
||||
static PIC8259_SET_INT_LINE( pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( streetg2_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(streetg2_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
static const struct pic8259_interface pic8259_2_config = {
|
||||
@ -327,7 +327,7 @@ static PIT8253_OUTPUT_CHANGED( at_pit8254_out0_changed )
|
||||
{
|
||||
if ( streetg2_devices.pic8259_1 )
|
||||
{
|
||||
pic8259_set_irq_line(streetg2_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(streetg2_devices.pic8259_1, state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,7 +532,7 @@ static PALETTE_INIT(pcat_286)
|
||||
|
||||
static void streetg2_set_keyb_int(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(streetg2_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(streetg2_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
|
||||
|
@ -396,7 +396,7 @@ Pit8253
|
||||
|
||||
static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
|
||||
{
|
||||
pic8259_set_irq_line(filetto_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(filetto_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static const struct pit8253_config pc_pit8253_config =
|
||||
@ -653,7 +653,7 @@ static const struct pic8259_interface pic8259_1_config = {
|
||||
};
|
||||
|
||||
static PIC8259_SET_INT_LINE( pic8259_2_set_int_line ) {
|
||||
pic8259_set_irq_line( filetto_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(filetto_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
static const struct pic8259_interface pic8259_2_config = {
|
||||
|
@ -236,7 +236,7 @@ static const struct pic8259_interface pic8259_1_config = {
|
||||
|
||||
static PIC8259_SET_INT_LINE( pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( photoply_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(photoply_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
static const struct pic8259_interface pic8259_2_config = {
|
||||
@ -258,7 +258,7 @@ static PIT8253_OUTPUT_CHANGED( at_pit8254_out0_changed )
|
||||
{
|
||||
if ( photoply_devices.pic8259_1 )
|
||||
{
|
||||
pic8259_set_irq_line(photoply_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(photoply_devices.pic8259_1, state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ static PALETTE_INIT(pcat_286)
|
||||
|
||||
static void photoply_set_keyb_int(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(photoply_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(photoply_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,7 +113,7 @@ static PIC8259_SET_INT_LINE( quakeat_pic8259_1_set_int_line )
|
||||
|
||||
static PIC8259_SET_INT_LINE( quakeat_pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( quakeat_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(quakeat_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
|
||||
|
@ -564,7 +564,7 @@ static PIC8259_SET_INT_LINE( taitowlf_pic8259_1_set_int_line )
|
||||
|
||||
static PIC8259_SET_INT_LINE( taitowlf_pic8259_2_set_int_line )
|
||||
{
|
||||
pic8259_set_irq_line( taitowlf_devices.pic8259_1, 2, interrupt);
|
||||
pic8259_ir2_w(taitowlf_devices.pic8259_1, interrupt);
|
||||
}
|
||||
|
||||
|
||||
@ -586,7 +586,7 @@ static const struct pic8259_interface taitowlf_pic8259_2_config = {
|
||||
|
||||
static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
|
||||
{
|
||||
pic8259_set_irq_line(taitowlf_devices.pic8259_1, 0, state);
|
||||
pic8259_ir0_w(taitowlf_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static const struct pit8253_config taitowlf_pit8254_config =
|
||||
@ -656,12 +656,12 @@ static void set_gate_a20(running_machine *machine, int a20)
|
||||
|
||||
static void keyboard_interrupt(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(taitowlf_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static void ide_interrupt(running_device *device, int state)
|
||||
{
|
||||
pic8259_set_irq_line(taitowlf_devices.pic8259_2, 6, state);
|
||||
pic8259_ir6_w(taitowlf_devices.pic8259_2, state);
|
||||
}
|
||||
|
||||
static int taitowlf_get_out2(running_machine *machine)
|
||||
@ -676,7 +676,7 @@ static const struct kbdc8042_interface at8042 =
|
||||
|
||||
static void taitowlf_set_keyb_int(running_machine *machine, int state)
|
||||
{
|
||||
pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state);
|
||||
pic8259_ir1_w(taitowlf_devices.pic8259_1, state);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( taitowlf )
|
||||
|
Loading…
Reference in New Issue
Block a user