mirror of
https://github.com/holub/mame
synced 2025-07-02 16:49:22 +03:00
Fix m68k irq line support.
Before this patch a: cpunum_set_input_line(5, ASSERT_LINE); cpunum_set_input_line(3, ASSERT_LINE); cpunum_set_input_line(3, CLEAR_LINE); loses the state of line 5. This patch fixes it by adding an explicit but optional "virtual irq line" support to the 68k interface. Fix m68k interrupt handling by some drivers. Clearing the NMI line to clear all the IRQ lines worked, but it just doesn't make sense. Now that the irq lines are really independant, the handling can be simplified.
This commit is contained in:
parent
a9d7211726
commit
0941eb004e
@ -1135,7 +1135,11 @@ $(M68KMAKE): $(CPUOBJ)/m68000/m68kmake.o $(LIBOCORE)
|
||||
endif
|
||||
|
||||
# rule to ensure we build the header before building the core CPU file
|
||||
$(CPUOBJ)/m68000/m68kcpu.o: $(CPUOBJ)/m68000/m68kops.c
|
||||
$(CPUOBJ)/m68000/m68kcpu.o: $(CPUOBJ)/m68000/m68kops.c \
|
||||
$(CPUSRC)/m68000/m68kcpu.h
|
||||
|
||||
$(CPUOBJ)/m68000/m68kmame.o: $(CPUSRC)/m68000/m68kmame.c \
|
||||
$(CPUSRC)/m68000/m68kcpu.h
|
||||
|
||||
|
||||
|
||||
|
@ -325,6 +325,12 @@ void m68k_end_timeslice(void); /* End timeslice now */
|
||||
*/
|
||||
void m68k_set_irq(unsigned int int_level);
|
||||
|
||||
/* Set the virtual irq lines, where the highest level
|
||||
* active line is automatically selected. If you use this function,
|
||||
* do not use m68k_set_irq.
|
||||
*/
|
||||
void m68k_set_virq(unsigned int level, unsigned int active);
|
||||
unsigned int m68k_get_virq(unsigned int level);
|
||||
|
||||
/* Halt the CPU as if you pulsed the HALT pin. */
|
||||
void m68k_pulse_halt(void);
|
||||
|
@ -882,6 +882,28 @@ void m68k_set_irq(unsigned int int_level)
|
||||
m68ki_check_interrupts(); /* Level triggered (IRQ) */
|
||||
}
|
||||
|
||||
void m68k_set_virq(unsigned int level, unsigned int active)
|
||||
{
|
||||
uint state = m68ki_cpu.virq_state;
|
||||
uint blevel;
|
||||
|
||||
if(active)
|
||||
state |= 1 << level;
|
||||
else
|
||||
state &= ~(1 << level);
|
||||
m68ki_cpu.virq_state = state;
|
||||
|
||||
for(blevel = 7; blevel > 0; blevel--)
|
||||
if(state & (1 << blevel))
|
||||
break;
|
||||
m68k_set_irq(blevel);
|
||||
}
|
||||
|
||||
unsigned int m68k_get_virq(unsigned int level)
|
||||
{
|
||||
return (m68ki_cpu.virq_state & (1 << level)) ? 1 : 0;
|
||||
}
|
||||
|
||||
void m68k_init(void)
|
||||
{
|
||||
static uint emulation_initialized = 0;
|
||||
@ -919,6 +941,7 @@ void m68k_pulse_reset(void)
|
||||
/* Interrupt mask to level 7 */
|
||||
FLAG_INT_MASK = 0x0700;
|
||||
CPU_INT_LEVEL = 0;
|
||||
m68ki_cpu.virq_state = 0;
|
||||
/* Reset VBR */
|
||||
REG_VBR = 0;
|
||||
/* Go to supervisor mode */
|
||||
|
@ -896,6 +896,10 @@ struct _m68ki_cpu_core
|
||||
uint cyc_movem_l;
|
||||
uint cyc_shift;
|
||||
uint cyc_reset;
|
||||
|
||||
/* Virtual IRQ lines state */
|
||||
uint virq_state;
|
||||
|
||||
const uint8* cyc_instruction;
|
||||
const uint8* cyc_exception;
|
||||
|
||||
|
@ -142,18 +142,8 @@ static void set_irq_line(int irqline, int state)
|
||||
{
|
||||
if (irqline == INPUT_LINE_NMI)
|
||||
irqline = 7;
|
||||
switch(state)
|
||||
{
|
||||
case CLEAR_LINE:
|
||||
m68k_set_irq(0);
|
||||
break;
|
||||
case ASSERT_LINE:
|
||||
m68k_set_irq(irqline);
|
||||
break;
|
||||
default:
|
||||
m68k_set_irq(irqline);
|
||||
break;
|
||||
}
|
||||
|
||||
m68k_set_virq(irqline, state == ASSERT_LINE ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
@ -475,14 +465,14 @@ void m68000_get_info(UINT32 state, cpuinfo *info)
|
||||
case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* there is no level 0 */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = m68k_get_virq(1); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = m68k_get_virq(2); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = m68k_get_virq(3); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = m68k_get_virq(4); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = m68k_get_virq(5); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = m68k_get_virq(6); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = m68k_get_virq(7); break;
|
||||
|
||||
case CPUINFO_INT_PREVIOUSPC: info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
|
||||
|
||||
@ -653,14 +643,14 @@ void m68008_get_info(UINT32 state, cpuinfo *info)
|
||||
case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* there is no level 0 */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = m68k_get_virq(1); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = m68k_get_virq(2); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = m68k_get_virq(3); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = m68k_get_virq(4); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = m68k_get_virq(5); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = m68k_get_virq(6); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = m68k_get_virq(7); break;
|
||||
|
||||
case CPUINFO_INT_PREVIOUSPC: info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
|
||||
|
||||
@ -885,14 +875,14 @@ void m68020_get_info(UINT32 state, cpuinfo *info)
|
||||
case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = 1; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = 2; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = 3; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = 4; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = 5; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = 6; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = 7; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* there is no level 0 */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = m68k_get_virq(1); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = m68k_get_virq(2); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = m68k_get_virq(3); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = m68k_get_virq(4); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = m68k_get_virq(5); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = m68k_get_virq(6); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = m68k_get_virq(7); break;
|
||||
|
||||
case CPUINFO_INT_PREVIOUSPC: info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
|
||||
|
||||
@ -1123,14 +1113,14 @@ void m68040_get_info(UINT32 state, cpuinfo *info)
|
||||
case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break;
|
||||
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = 1; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = 2; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = 3; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = 4; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = 5; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = 6; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = 7; /* fix me */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 0: info->i = 0; /* there is no level 0 */ break;
|
||||
case CPUINFO_INT_INPUT_STATE + 1: info->i = m68k_get_virq(1); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 2: info->i = m68k_get_virq(2); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 3: info->i = m68k_get_virq(3); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 4: info->i = m68k_get_virq(4); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 5: info->i = m68k_get_virq(5); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 6: info->i = m68k_get_virq(6); break;
|
||||
case CPUINFO_INT_INPUT_STATE + 7: info->i = m68k_get_virq(7); break;
|
||||
|
||||
case CPUINFO_INT_PREVIOUSPC: info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
|
||||
|
||||
|
@ -97,17 +97,8 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
|
||||
|
||||
static void update_sound_68k_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (fast_68k_int)
|
||||
newstate |= 6;
|
||||
if (io_68k_int)
|
||||
newstate |= 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 3, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 3, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 3, 6, fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 3, 2, io_68k_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,15 +67,8 @@ void hdsnd_init(running_machine *machine)
|
||||
|
||||
static void update_68k_interrupts(running_machine *machine)
|
||||
{
|
||||
int irqline = 0;
|
||||
|
||||
if (mainflag) irqline = 1;
|
||||
if (irq68k) irqline = 3;
|
||||
|
||||
if (irqline)
|
||||
cpunum_set_input_line(machine, hdcpu_sound, irqline, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, hdcpu_sound, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_sound, 1, mainflag ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_sound, 3, irq68k ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,15 +83,7 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,17 +57,8 @@ static void (*protection_handler)(running_machine *);
|
||||
|
||||
static void update_irq_state(running_machine *machine)
|
||||
{
|
||||
int irq_lines = 0;
|
||||
|
||||
if (tms_irq)
|
||||
irq_lines |= 4;
|
||||
if (hack_irq)
|
||||
irq_lines |= 5;
|
||||
|
||||
if (irq_lines)
|
||||
cpunum_set_input_line(machine, 0, irq_lines, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, tms_irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 5, hack_irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,17 +50,8 @@ static UINT8 bslapstic_primed;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 1;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,17 +51,8 @@ static UINT16 *sloop_base;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 5;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 5, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,19 +56,9 @@ static void cage_irq_callback(running_machine *machine, int reason);
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 3;
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 4;
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,17 +49,8 @@ static UINT32 * protection_base;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 5;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 5, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,23 +157,10 @@ static TIMER_CALLBACK( delayed_joystick_int );
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
/* all interrupts go through an LS148, which gives priority to the highest */
|
||||
if (joystick_int && joystick_int_enable)
|
||||
newstate = 2;
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 3;
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 6;
|
||||
|
||||
/* set the new state of the IRQ lines */
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, joystick_int && joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,17 +120,8 @@ static UINT8 *bank_source_data;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 1;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -612,17 +603,7 @@ GFXDECODE_END
|
||||
|
||||
static void update_interrupts_bootleg(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 1;
|
||||
// if (atarigen_sound_int_state)
|
||||
// newstate = 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,17 +42,8 @@ static UINT16 latch_data;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate |= 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,19 +32,9 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 1;
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 2;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,23 +36,8 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate1 = 0;
|
||||
int newstate2 = 0;
|
||||
|
||||
if (atarigen_sound_int_state)
|
||||
newstate1 |= 1;
|
||||
if (atarigen_video_int_state)
|
||||
newstate2 |= 1;
|
||||
|
||||
if (newstate1)
|
||||
cpunum_set_input_line(machine, 0, newstate1, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
|
||||
if (newstate2)
|
||||
cpunum_set_input_line(machine, 2, newstate2, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 2, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 2, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -73,17 +58,8 @@ static MACHINE_RESET( cyberbal )
|
||||
|
||||
static void cyberb2p_update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate |= 1;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 3;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,17 +62,8 @@ static UINT8 sound_msb_latch;
|
||||
static void update_irq_state(running_machine *machine)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* loop from high priority to low; if we find a live IRQ, assert it */
|
||||
for (i = 4; i >= 0; i--)
|
||||
if (irq_state[i])
|
||||
{
|
||||
cpunum_set_input_line(machine, 0, i, ASSERT_LINE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* otherwise, clear them all */
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
for (i = 1; i < 5; i++)
|
||||
cpunum_set_input_line(machine, 0, i, irq_state[i] ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,23 +44,9 @@ static UINT16 *sync_data;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
int newstate2 = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate |= 4, newstate2 |= 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
|
||||
if (newstate2)
|
||||
cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,17 +114,9 @@ static READ16_HANDLER( nvram_r )
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate |= 1;
|
||||
if (atarigen_video_int_state)
|
||||
newstate |= 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, atarigen_scanline_int_state && atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -147,17 +147,8 @@ static UINT16 sound_reset_val;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate |= 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,18 +69,9 @@ UINT8 *genesis_z80_ram;
|
||||
/* call this whenever the interrupt state has changed */
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int level = 0;
|
||||
|
||||
/* determine which interrupt is active */
|
||||
if (irq2_int) level = 2;
|
||||
if (scanline_int) level = 4;
|
||||
if (vblank_int) level = 6;
|
||||
|
||||
/* either set or clear the appropriate lines */
|
||||
if (level)
|
||||
cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, irq2_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, scanline_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, vblank_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -270,10 +270,6 @@ INLINE int determine_irq_state(int vint, int xint, int qint)
|
||||
{
|
||||
int level = 0;
|
||||
|
||||
/* update the states */
|
||||
if (vint != -1) vint_state = vint;
|
||||
if (xint != -1) xint_state = xint;
|
||||
if (qint != -1) qint_state = qint;
|
||||
|
||||
/* determine which level is active */
|
||||
if (vint_state) level = 1;
|
||||
@ -289,13 +285,20 @@ INLINE int determine_irq_state(int vint, int xint, int qint)
|
||||
|
||||
void itech32_update_interrupts(running_machine *machine, int vint, int xint, int qint)
|
||||
{
|
||||
int level = determine_irq_state(vint, xint, qint);
|
||||
/* update the states */
|
||||
if (vint != -1) vint_state = vint;
|
||||
if (xint != -1) xint_state = xint;
|
||||
if (qint != -1) qint_state = qint;
|
||||
|
||||
/* update it */
|
||||
if (level)
|
||||
cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
if (is_drivedge) {
|
||||
cpunum_set_input_line(machine, 0, 3, vint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, xint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 5, qint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
} else {
|
||||
cpunum_set_input_line(machine, 0, 1, vint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, xint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, qint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -554,17 +554,8 @@ void itech8_update_interrupts(running_machine *machine, int periodic, int tms340
|
||||
/* handle the 68000 case */
|
||||
else
|
||||
{
|
||||
int level = 0;
|
||||
|
||||
/* determine which level is active */
|
||||
if (blitter_int) level = 2;
|
||||
if (periodic_int) level = 3;
|
||||
|
||||
/* update it */
|
||||
if (level)
|
||||
cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, blitter_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, periodic_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,17 +156,8 @@ static struct
|
||||
|
||||
static void update_irqs(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (tms_irq)
|
||||
newstate = 2;
|
||||
if (duart_1_irq)
|
||||
newstate = 5;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, tms_irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 5, duart_1_irq ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,15 +32,7 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state || atarigen_scanline_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state || atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -271,26 +271,9 @@ static MACHINE_RESET( mpu4_vid )
|
||||
|
||||
static void update_mpu68_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (m6840_irq_state)
|
||||
newstate = 1;
|
||||
if (m6850_irq_state)
|
||||
newstate = 2;
|
||||
if (scn2674_irq_state)
|
||||
newstate = 3;
|
||||
|
||||
/* set the new state of the IRQ lines */
|
||||
if (newstate)
|
||||
{
|
||||
LOGSTUFF(("68k IRQ, %x\n", newstate));
|
||||
cpunum_set_input_line(machine, 1, newstate, ASSERT_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGSTUFF(("68k IRQ Clear, %x\n", newstate));
|
||||
cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
|
||||
}
|
||||
cpunum_set_input_line(machine, 1, 1, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 2, m6850_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 3, scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
/* Communications with 6809 board */
|
||||
|
@ -200,18 +200,9 @@ void neogeo_set_display_counter_lsb(running_machine *machine, UINT16 data)
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int level = 0;
|
||||
|
||||
/* determine which interrupt is active - order implies priority */
|
||||
if (vblank_interrupt_pending) level = 1;
|
||||
if (display_position_interrupt_pending) level = 2;
|
||||
if (irq3_pending) level = 3;
|
||||
|
||||
/* either set or clear the appropriate lines */
|
||||
if (level)
|
||||
cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, irq3_pending ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,17 +32,8 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,15 +40,7 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,15 +44,7 @@ static UINT32 adpcm_bank_base;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -169,22 +169,12 @@ static void outrun_generic_init(running_machine *machine)
|
||||
|
||||
static void update_main_irqs(running_machine *machine)
|
||||
{
|
||||
int irq = 0;
|
||||
cpunum_set_input_line(machine, 0, 2, irq2_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, vblank_irq_state || irq2_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* the IRQs are effectively ORed together */
|
||||
if (vblank_irq_state)
|
||||
irq |= 4;
|
||||
if (irq2_state)
|
||||
irq |= 2;
|
||||
|
||||
/* assert the lines that are live, or clear everything if nothing is live */
|
||||
if (irq != 0)
|
||||
{
|
||||
cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
|
||||
if(vblank_irq_state || irq2_state)
|
||||
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
|
||||
}
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,25 +86,14 @@ static void xboard_generic_init(running_machine *machine)
|
||||
|
||||
static void update_main_irqs(running_machine *machine)
|
||||
{
|
||||
int irq = 0;
|
||||
cpunum_set_input_line(machine, 0, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* the IRQs are effectively ORed together */
|
||||
if (vblank_irq_state)
|
||||
irq |= 4;
|
||||
if (timer_irq_state)
|
||||
irq |= 2;
|
||||
if(!gprider_hack)
|
||||
cpunum_set_input_line(machine, 0, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
if (gprider_hack && irq > 4)
|
||||
irq = 4;
|
||||
|
||||
/* assert the lines that are live, or clear everything if nothing is live */
|
||||
if (irq != 0)
|
||||
{
|
||||
cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
|
||||
if(timer_irq_state || vblank_irq_state)
|
||||
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
|
||||
}
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,28 +66,18 @@ static void yboard_generic_init(void)
|
||||
|
||||
static void update_main_irqs(running_machine *machine)
|
||||
{
|
||||
int irq = 0;
|
||||
cpunum_set_input_line(machine, 0, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 2, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 2, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 2, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* the IRQs are effectively ORed together */
|
||||
if (vblank_irq_state)
|
||||
irq |= 4;
|
||||
if (timer_irq_state)
|
||||
irq |= 2;
|
||||
|
||||
/* assert the lines that are live, or clear everything if nothing is live */
|
||||
if (irq != 0)
|
||||
{
|
||||
cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
|
||||
cpunum_set_input_line(machine, 1, irq, ASSERT_LINE);
|
||||
cpunum_set_input_line(machine, 2, irq, ASSERT_LINE);
|
||||
if(timer_irq_state || vblank_irq_state)
|
||||
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
|
||||
}
|
||||
else
|
||||
{
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 2, 7, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,15 +32,7 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,19 +32,9 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate = 1;
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 2;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 4;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,23 +36,9 @@ static UINT16 *rom_base[2];
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
int newstate2 = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate |= 4, newstate2 |= 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
|
||||
if (newstate2)
|
||||
cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 1, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,17 +42,9 @@ static UINT16 *interrupt_scan;
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate |= 1;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, atarigen_scanline_int_state && atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,17 +32,8 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_scanline_int_state)
|
||||
newstate |= 4;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate |= 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,17 +32,8 @@
|
||||
|
||||
static void update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (atarigen_video_int_state)
|
||||
newstate = 1;
|
||||
if (atarigen_sound_int_state)
|
||||
newstate = 2;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -405,50 +405,46 @@ static TIMER_CALLBACK( scanline_callback )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void update_irqs(void)
|
||||
static void update_irqs(running_machine *machine)
|
||||
{
|
||||
int ints = CUSTOM_REG(REG_INTENA) & CUSTOM_REG(REG_INTREQ);
|
||||
int irq = -1;
|
||||
|
||||
/* Master interrupt switch */
|
||||
if (CUSTOM_REG(REG_INTENA) & 0x4000)
|
||||
{
|
||||
/* Serial transmit buffer empty, disk block finished, software interrupts */
|
||||
if (ints & 0x0007)
|
||||
irq = 1;
|
||||
cpunum_set_input_line(machine, 0, 1, ints & 0x0007 ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* I/O ports and timer interrupts */
|
||||
if (ints & 0x0008)
|
||||
irq = 2;
|
||||
cpunum_set_input_line(machine, 0, 2, ints & 0x0008 ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* Copper, VBLANK, blitter interrupts */
|
||||
if (ints & 0x0070)
|
||||
irq = 3;
|
||||
cpunum_set_input_line(machine, 0, 3, ints & 0x0070 ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* Audio interrupts */
|
||||
if (ints & 0x0780)
|
||||
irq = 4;
|
||||
cpunum_set_input_line(machine, 0, 4, ints & 0x0780 ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* Serial receive buffer full, disk sync match */
|
||||
if (ints & 0x1800)
|
||||
irq = 5;
|
||||
cpunum_set_input_line(machine, 0, 5, ints & 0x1800 ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* External interrupts */
|
||||
if (ints & 0x2000)
|
||||
irq = 6;
|
||||
cpunum_set_input_line(machine, 0, 6, ints & 0x2000 ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
/* set the highest IRQ line */
|
||||
if (irq >= 0)
|
||||
cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
|
||||
{
|
||||
cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 2, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 3, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 4, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 5, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, 6, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static TIMER_CALLBACK( amiga_irq_proc )
|
||||
{
|
||||
update_irqs();
|
||||
update_irqs(machine);
|
||||
timer_reset( amiga_irq_timer, attotime_never);
|
||||
}
|
||||
|
||||
@ -1428,7 +1424,7 @@ WRITE16_HANDLER( amiga_custom_w )
|
||||
if ( temp & 0x8000 ) /* if we're enabling irq's, delay a bit */
|
||||
timer_adjust_oneshot( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0);
|
||||
else /* if we're disabling irq's, process right away */
|
||||
update_irqs();
|
||||
update_irqs(machine);
|
||||
break;
|
||||
|
||||
case REG_INTREQ:
|
||||
@ -1445,7 +1441,7 @@ WRITE16_HANDLER( amiga_custom_w )
|
||||
if ( temp & 0x8000 ) /* if we're generating irq's, delay a bit */
|
||||
timer_adjust_oneshot( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0);
|
||||
else /* if we're clearing irq's, process right away */
|
||||
update_irqs();
|
||||
update_irqs(machine);
|
||||
break;
|
||||
|
||||
case REG_ADKCON:
|
||||
|
@ -219,25 +219,12 @@ MACHINE_RESET( harddriv )
|
||||
|
||||
static void hd68k_update_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
if (msp_irq_state)
|
||||
newstate = 1;
|
||||
if (adsp_irq_state)
|
||||
newstate = 2;
|
||||
if (gsp_irq_state)
|
||||
newstate = 3;
|
||||
if (atarigen_sound_int_state) /* /LINKIRQ on STUN Runner */
|
||||
newstate = 4;
|
||||
if (irq_state)
|
||||
newstate = 5;
|
||||
if (duart_irq_state)
|
||||
newstate = 6;
|
||||
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, hdcpu_main, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, hdcpu_main, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_main, 1, msp_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_main, 2, adsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_main, 3, gsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_main, 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE); /* /LINKIRQ on STUN Runner */
|
||||
cpunum_set_input_line(machine, hdcpu_main, 5, irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, hdcpu_main, 6, duart_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -473,19 +473,8 @@ INTERRUPT_GEN( mcr68_interrupt )
|
||||
|
||||
static void update_mcr68_interrupts(running_machine *machine)
|
||||
{
|
||||
int newstate = 0;
|
||||
|
||||
/* all interrupts go through an LS148, which gives priority to the highest */
|
||||
if (v493_irq_state)
|
||||
newstate = v493_irq_vector;
|
||||
if (m6840_irq_state)
|
||||
newstate = m6840_irq_vector;
|
||||
|
||||
/* set the new state of the IRQ lines */
|
||||
if (newstate)
|
||||
cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
|
||||
else
|
||||
cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, v493_irq_vector, v493_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
cpunum_set_input_line(machine, 0, m6840_irq_vector, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user