mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
tms99xx: Introduced symbolic constants for interrupt lines. Added a
special RESET line handled by the CPU, not by the emulator core. tms9928a/v9938: Introduced dedicated RESET line. [Michael Zapf]
This commit is contained in:
parent
d3764b38d2
commit
265249e1ae
@ -1154,7 +1154,7 @@ void tms99xx_device::execute_run()
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (m_icount>0);
|
||||
} while (m_icount>0 && !m_reset);
|
||||
if (VERBOSE>6) LOG("tms99xx: cycles expired; will return soon.\n");
|
||||
}
|
||||
|
||||
@ -1165,22 +1165,29 @@ void tms99xx_device::execute_run()
|
||||
*/
|
||||
void tms99xx_device::execute_set_input(int irqline, int state)
|
||||
{
|
||||
if (irqline == INPUT_LINE_NMI)
|
||||
if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE)
|
||||
{
|
||||
m_load_state = (state==ASSERT_LINE);
|
||||
m_irq_level = -1;
|
||||
m_reset = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_irq_state = (state==ASSERT_LINE);
|
||||
if (state==ASSERT_LINE)
|
||||
if (irqline == INPUT_LINE_NMI)
|
||||
{
|
||||
m_irq_level = get_intlevel(state);
|
||||
if (VERBOSE>6) LOG("tms99xx: interrupt line %d = %d, level=%d, ST=%04x\n", irqline, state, m_irq_level, ST);
|
||||
m_load_state = (state==ASSERT_LINE);
|
||||
m_irq_level = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline);
|
||||
m_irq_state = (state==ASSERT_LINE);
|
||||
if (state==ASSERT_LINE)
|
||||
{
|
||||
m_irq_level = get_intlevel(state);
|
||||
if (VERBOSE>6) LOG("tms99xx: interrupt line %d = %d, level=%d, ST=%04x\n", irqline, state, m_irq_level, ST);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2543,7 +2550,7 @@ UINT32 tms99xx_device::execute_max_cycles() const
|
||||
|
||||
UINT32 tms99xx_device::execute_input_lines() const
|
||||
{
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
// clocks to cycles, cycles to clocks = id
|
||||
|
@ -47,6 +47,22 @@
|
||||
#include "emu.h"
|
||||
#include "debugger.h"
|
||||
|
||||
/*
|
||||
Define symbols for interrupt lines.
|
||||
|
||||
We use a separate RESET signal which is not captured by the core.
|
||||
|
||||
Caution: Check irqline in set_input_line of each driver using this CPU.
|
||||
Values have changed. Use these symbols instead.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
INPUT_LINE_99XX_RESET = 0,
|
||||
INPUT_LINE_99XX_INTREQ = 1,
|
||||
INPUT_LINE_99XX_INT1 = 2,
|
||||
INPUT_LINE_99XX_INT4 = 3
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
LOAD_INT = -1,
|
||||
|
@ -1118,7 +1118,7 @@ void tms9995_device::execute_run()
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (m_icount>0);
|
||||
} while (m_icount>0 && !m_reset);
|
||||
if (VERBOSE>5) LOG("tms9995: cycles expired; will return soon.\n");
|
||||
}
|
||||
|
||||
@ -1133,37 +1133,44 @@ void tms9995_device::execute_run()
|
||||
*/
|
||||
void tms9995_device::execute_set_input(int irqline, int state)
|
||||
{
|
||||
if (irqline == INPUT_LINE_NMI)
|
||||
if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE)
|
||||
{
|
||||
m_nmi_active = (state==ASSERT_LINE);
|
||||
if (VERBOSE>3) LOG("tms9995: NMI interrupt line state=%d\n", state);
|
||||
m_reset = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (irqline == 1)
|
||||
if (irqline == INPUT_LINE_NMI)
|
||||
{
|
||||
m_int1_active = m_flag[2] = (state==ASSERT_LINE);
|
||||
if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state);
|
||||
m_nmi_active = (state==ASSERT_LINE);
|
||||
if (VERBOSE>3) LOG("tms9995: NMI interrupt line state=%d\n", state);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (irqline == 4)
|
||||
if (irqline == INPUT_LINE_99XX_INT1)
|
||||
{
|
||||
if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state);
|
||||
if (m_flag[0]==false)
|
||||
{
|
||||
if (VERBOSE>7) LOG("tms9995: set as interrupt\n");
|
||||
m_int4_active = m_flag[4] = (state==ASSERT_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VERBOSE>7) LOG("tms9995: set as event count\n");
|
||||
trigger_decrementer();
|
||||
}
|
||||
m_int1_active = m_flag[2] = (state==ASSERT_LINE);
|
||||
if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline);
|
||||
if (irqline == INPUT_LINE_99XX_INT4)
|
||||
{
|
||||
if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state);
|
||||
if (m_flag[0]==false)
|
||||
{
|
||||
if (VERBOSE>7) LOG("tms9995: set as interrupt\n");
|
||||
m_int4_active = m_flag[4] = (state==ASSERT_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VERBOSE>7) LOG("tms9995: set as event count\n");
|
||||
trigger_decrementer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,22 @@
|
||||
#include "emu.h"
|
||||
#include "debugger.h"
|
||||
|
||||
/*
|
||||
Define symbols for interrupt lines.
|
||||
|
||||
We use a separate RESET signal which is not captured by the core.
|
||||
|
||||
Caution: Check irqline in set_input_line of each driver using this CPU.
|
||||
Values have changed. Use these symbols instead.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
INPUT_LINE_99XX_RESET = 0,
|
||||
INPUT_LINE_99XX_INTREQ = 1,
|
||||
INPUT_LINE_99XX_INT1 = 2,
|
||||
INPUT_LINE_99XX_INT4 = 3
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TI990_10_ID = 1,
|
||||
|
@ -107,6 +107,9 @@ public:
|
||||
UINT32 screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
bitmap_ind16 &get_bitmap() { return m_tmpbmp; }
|
||||
|
||||
/* RESET pin */
|
||||
void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
|
@ -96,6 +96,9 @@ public:
|
||||
static void static_set_vram_size(device_t &device, UINT32 vram_size);
|
||||
static void static_set_interrupt_callback(device_t &device, v99x8_interrupt_delegate callback, const char *device_name);
|
||||
|
||||
/* RESET pin */
|
||||
void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); }
|
||||
|
||||
protected:
|
||||
const address_space_config m_space_config;
|
||||
address_space* m_vram_space;
|
||||
|
Loading…
Reference in New Issue
Block a user