mirror of
https://github.com/holub/mame
synced 2025-05-24 14:56:21 +03:00
Removed the hardcoded dependency on a 8254 device from the 8042kbdc code. Changed the drivers using the 8042kdbc to define their own 8042kdbc - 8254 dependency.
This commit is contained in:
parent
ea8471679b
commit
8dcedabb57
@ -179,7 +179,6 @@
|
|||||||
|
|
||||||
#include "machine/pckeybrd.h"
|
#include "machine/pckeybrd.h"
|
||||||
#include "machine/8042kbdc.h"
|
#include "machine/8042kbdc.h"
|
||||||
#include "machine/pit8253.h"
|
|
||||||
#include "machine/pcshare.h"
|
#include "machine/pcshare.h"
|
||||||
|
|
||||||
|
|
||||||
@ -208,6 +207,7 @@ static struct
|
|||||||
kbdc8042_type_t type;
|
kbdc8042_type_t type;
|
||||||
void (*set_gate_a20)(int a20);
|
void (*set_gate_a20)(int a20);
|
||||||
void (*keyboard_interrupt)(int state);
|
void (*keyboard_interrupt)(int state);
|
||||||
|
int (*get_out2)(running_machine *machine);
|
||||||
|
|
||||||
UINT8 inport, outport, data, command;
|
UINT8 inport, outport, data, command;
|
||||||
|
|
||||||
@ -271,6 +271,7 @@ void kbdc8042_init(const struct kbdc8042_interface *intf)
|
|||||||
kbdc8042.type = intf->type;
|
kbdc8042.type = intf->type;
|
||||||
kbdc8042.set_gate_a20 = intf->set_gate_a20;
|
kbdc8042.set_gate_a20 = intf->set_gate_a20;
|
||||||
kbdc8042.keyboard_interrupt = intf->keyboard_interrupt;
|
kbdc8042.keyboard_interrupt = intf->keyboard_interrupt;
|
||||||
|
kbdc8042.get_out2 = intf->get_out2;
|
||||||
|
|
||||||
/* ibmat bios wants 0x20 set! (keyboard locked when not set) 0x80 */
|
/* ibmat bios wants 0x20 set! (keyboard locked when not set) 0x80 */
|
||||||
kbdc8042.inport = 0xa0;
|
kbdc8042.inport = 0xa0;
|
||||||
@ -386,7 +387,7 @@ READ8_HANDLER(kbdc8042_8_r)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (pit8253_get_output(0, 2))
|
if (kbdc8042.get_out2(machine))
|
||||||
data |= 0x20;
|
data |= 0x20;
|
||||||
else
|
else
|
||||||
data &= ~0x20;
|
data &= ~0x20;
|
||||||
|
@ -23,6 +23,7 @@ struct kbdc8042_interface
|
|||||||
kbdc8042_type_t type;
|
kbdc8042_type_t type;
|
||||||
void (*set_gate_a20)(int a20);
|
void (*set_gate_a20)(int a20);
|
||||||
void (*keyboard_interrupt)(int state);
|
void (*keyboard_interrupt)(int state);
|
||||||
|
int (*get_out2)(running_machine *machine);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -650,9 +650,13 @@ static void ide_interrupt(int state)
|
|||||||
pic8259_set_irq_line(1, 6, state);
|
pic8259_set_irq_line(1, 6, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int gamecstl_get_out2(running_machine *machine) {
|
||||||
|
return pit8253_get_output((device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ), 2 );
|
||||||
|
}
|
||||||
|
|
||||||
static const struct kbdc8042_interface at8042 =
|
static const struct kbdc8042_interface at8042 =
|
||||||
{
|
{
|
||||||
KBDC8042_AT386, set_gate_a20, keyboard_interrupt
|
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, gamecstl_get_out2
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ide_interface ide_intf =
|
static const struct ide_interface ide_intf =
|
||||||
|
@ -1066,9 +1066,13 @@ static void ide_interrupt(int state)
|
|||||||
pic8259_set_irq_line(1, 6, state);
|
pic8259_set_irq_line(1, 6, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mediagx_get_out2(running_machine *machine) {
|
||||||
|
return pit8253_get_output((device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ), 2 );
|
||||||
|
}
|
||||||
|
|
||||||
static const struct kbdc8042_interface at8042 =
|
static const struct kbdc8042_interface at8042 =
|
||||||
{
|
{
|
||||||
KBDC8042_AT386, set_gate_a20, keyboard_interrupt
|
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, mediagx_get_out2
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ide_interface ide_intf =
|
static const struct ide_interface ide_intf =
|
||||||
|
@ -616,9 +616,13 @@ static void ide_interrupt(int state)
|
|||||||
pic8259_set_irq_line(1, 6, state);
|
pic8259_set_irq_line(1, 6, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int taitowlf_get_out2(running_machine *machine) {
|
||||||
|
return pit8253_get_output((device_config*)device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" ), 2 );
|
||||||
|
}
|
||||||
|
|
||||||
static const struct kbdc8042_interface at8042 =
|
static const struct kbdc8042_interface at8042 =
|
||||||
{
|
{
|
||||||
KBDC8042_AT386, set_gate_a20, keyboard_interrupt
|
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, taitowlf_get_out2
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ide_interface ide_intf =
|
static const struct ide_interface ide_intf =
|
||||||
|
Loading…
Reference in New Issue
Block a user