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:
Michael Zapf 2012-07-12 21:38:53 +00:00
parent d3764b38d2
commit 265249e1ae
6 changed files with 82 additions and 30 deletions

View File

@ -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"); if (VERBOSE>6) LOG("tms99xx: cycles expired; will return soon.\n");
} }
@ -1165,6 +1165,12 @@ void tms99xx_device::execute_run()
*/ */
void tms99xx_device::execute_set_input(int irqline, int state) void tms99xx_device::execute_set_input(int irqline, int state)
{ {
if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE)
{
m_reset = true;
}
else
{
if (irqline == INPUT_LINE_NMI) if (irqline == INPUT_LINE_NMI)
{ {
m_load_state = (state==ASSERT_LINE); m_load_state = (state==ASSERT_LINE);
@ -1183,6 +1189,7 @@ void tms99xx_device::execute_set_input(int irqline, int state)
if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline); 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 UINT32 tms99xx_device::execute_input_lines() const
{ {
return 1; return 2;
} }
// clocks to cycles, cycles to clocks = id // clocks to cycles, cycles to clocks = id

View File

@ -47,6 +47,22 @@
#include "emu.h" #include "emu.h"
#include "debugger.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 enum
{ {
LOAD_INT = -1, LOAD_INT = -1,

View File

@ -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"); if (VERBOSE>5) LOG("tms9995: cycles expired; will return soon.\n");
} }
@ -1133,6 +1133,12 @@ void tms9995_device::execute_run()
*/ */
void tms9995_device::execute_set_input(int irqline, int state) void tms9995_device::execute_set_input(int irqline, int state)
{ {
if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE)
{
m_reset = true;
}
else
{
if (irqline == INPUT_LINE_NMI) if (irqline == INPUT_LINE_NMI)
{ {
m_nmi_active = (state==ASSERT_LINE); m_nmi_active = (state==ASSERT_LINE);
@ -1140,14 +1146,14 @@ void tms9995_device::execute_set_input(int irqline, int state)
} }
else else
{ {
if (irqline == 1) if (irqline == INPUT_LINE_99XX_INT1)
{ {
m_int1_active = m_flag[2] = (state==ASSERT_LINE); m_int1_active = m_flag[2] = (state==ASSERT_LINE);
if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state); if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state);
} }
else else
{ {
if (irqline == 4) if (irqline == INPUT_LINE_99XX_INT4)
{ {
if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state); if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state);
if (m_flag[0]==false) if (m_flag[0]==false)
@ -1167,6 +1173,7 @@ void tms9995_device::execute_set_input(int irqline, int state)
} }
} }
} }
}
} }
/* /*

View File

@ -11,6 +11,22 @@
#include "emu.h" #include "emu.h"
#include "debugger.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 enum
{ {
TI990_10_ID = 1, TI990_10_ID = 1,

View File

@ -107,6 +107,9 @@ public:
UINT32 screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); UINT32 screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
bitmap_ind16 &get_bitmap() { return m_tmpbmp; } bitmap_ind16 &get_bitmap() { return m_tmpbmp; }
/* RESET pin */
void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); }
protected: protected:
// device-level overrides // device-level overrides
virtual void device_config_complete(); virtual void device_config_complete();

View File

@ -96,6 +96,9 @@ public:
static void static_set_vram_size(device_t &device, UINT32 vram_size); 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); 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: protected:
const address_space_config m_space_config; const address_space_config m_space_config;
address_space* m_vram_space; address_space* m_vram_space;