Added INT1, INT2, INT3, DRQ0, DRQ1, TMRIN0, TMRIN1 input and TMROUT0, TMROUT1 output lines to the Intel 80186 CPU interface. [Curt Coder]

This commit is contained in:
Curt Coder 2010-10-06 12:35:12 +00:00
parent 7db585fdde
commit 2fa7094eab
3 changed files with 127 additions and 58 deletions

2
.gitattributes vendored
View File

@ -174,7 +174,7 @@ src/emu/cpu/i86/host.h svneol=native#text/plain
src/emu/cpu/i86/i286.c svneol=native#text/plain
src/emu/cpu/i86/i286.h svneol=native#text/plain
src/emu/cpu/i86/i86.c svneol=native#text/plain
src/emu/cpu/i86/i86.h -text svneol=native#text/plain
src/emu/cpu/i86/i86.h svneol=native#text/plain
src/emu/cpu/i86/i86.txt svneol=native#text/plain
src/emu/cpu/i86/i86priv.h svneol=native#text/plain
src/emu/cpu/i86/i86time.c svneol=native#text/plain

View File

@ -66,6 +66,9 @@ struct _i8086_state
char seg_prefix; /* prefix segment indicator */
unsigned ea;
UINT16 eo; /* HJB 12/13/98 effective offset of the address (before segment is added) */
devcb_resolved_write_line out_tmrout0_func;
devcb_resolved_write_line out_tmrout1_func;
};
INLINE i8086_state *get_safe_token(running_device *device)
@ -209,6 +212,22 @@ static CPU_INIT( i8088 )
cpustate->fetch_xor = 0;
}
static CPU_INIT( i80186 )
{
i8086_state *cpustate = get_safe_token(device);
CPU_INIT_CALL(i8086);
/* resolve callbacks */
i80186_interface *intf = (i80186_interface *) device->baseconfig().static_config();
if (intf != NULL)
{
devcb_resolve_write_line(&cpustate->out_tmrout0_func, &intf->out_tmrout0_func, device);
devcb_resolve_write_line(&cpustate->out_tmrout1_func, &intf->out_tmrout1_func, device);
}
}
static CPU_RESET( i8086 )
{
i8086_state *cpustate = get_safe_token(device);
@ -266,6 +285,16 @@ static void set_irq_line(i8086_state *cpustate, int irqline, int state)
}
}
static void set_drq_line(i8086_state *cpustate, int irqline, int state)
{
// TODO implement me
}
static void set_tmrin_line(i8086_state *cpustate, int irqline, int state)
{
// TODO implement me
}
/* PJB 03/05 */
static void set_test_line(i8086_state *cpustate, int state)
{
@ -598,6 +627,26 @@ CPU_GET_INFO( i8088 )
* CPU-specific get_info/set_info
**************************************************************************/
static CPU_SET_INFO( i80186 )
{
i8086_state *cpustate = get_safe_token(device);
switch (state)
{
/* --- the following bits of info are set as 64-bit signed integers --- */
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_INT0: set_irq_line(cpustate, 0, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_INT1: set_irq_line(cpustate, 1, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_INT2: set_irq_line(cpustate, 2, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_INT3: set_irq_line(cpustate, 3, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_DRQ0: set_drq_line(cpustate, 0, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_DRQ1: set_drq_line(cpustate, 1, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_TMRIN0: set_tmrin_line(cpustate, 0, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_TMRIN1: set_tmrin_line(cpustate, 1, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(cpustate, INPUT_LINE_NMI, info->i); break;
case CPUINFO_INT_INPUT_STATE + INPUT_LINE_TEST: set_test_line(cpustate, info->i); break; /* PJB 03/05 */
}
}
CPU_GET_INFO( i80186 )
{
switch (state)
@ -607,6 +656,8 @@ CPU_GET_INFO( i80186 )
case CPUINFO_INT_CLOCK_DIVIDER: info->i = 2; break;
/* --- the following bits of info are returned as pointers to data or functions --- */
case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i80186); break;
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(i80186); break;
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(i80186); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */

View File

@ -5,7 +5,25 @@
#define __I86INTF_H__
#define INPUT_LINE_INT0 INPUT_LINE_IRQ0
#define INPUT_LINE_INT1 INPUT_LINE_IRQ1
#define INPUT_LINE_INT2 INPUT_LINE_IRQ2
#define INPUT_LINE_INT3 INPUT_LINE_IRQ3
#define INPUT_LINE_TEST 20 /* PJB 03/05 */
#define INPUT_LINE_DRQ0 21
#define INPUT_LINE_DRQ1 22
#define INPUT_LINE_TMRIN0 23
#define INPUT_LINE_TMRIN1 24
typedef struct _i80186_interface i80186_interface;
struct _i80186_interface
{
devcb_write_line out_tmrout0_func;
devcb_write_line out_tmrout1_func;
};
#define I80186_INTERFACE(name) const i80186_interface (name) =
enum
{