diff options
author | Michael Zapf <michael.zapf@mizapf.de> | 2012-07-12 21:38:53 +0000 |
---|---|---|
committer | Michael Zapf <michael.zapf@mizapf.de> | 2012-07-12 21:38:53 +0000 |
commit | 265249e1aec37b2a15ff8d70fd271f949c560066 (patch) | |
tree | 6d6da9602b60224ffda7ae74c2d365d03757daa6 | |
parent | d3764b38d21f94b07179af97ff95597481c8f7b9 (diff) |
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]
-rw-r--r-- | src/emu/cpu/tms9900/tms9900.c | 27 | ||||
-rw-r--r-- | src/emu/cpu/tms9900/tms9900.h | 16 | ||||
-rw-r--r-- | src/emu/cpu/tms9900/tms9995.c | 43 | ||||
-rw-r--r-- | src/emu/cpu/tms9900/tms9995.h | 16 | ||||
-rw-r--r-- | src/emu/video/tms9928a.h | 3 | ||||
-rw-r--r-- | src/emu/video/v9938.h | 3 |
6 files changed, 80 insertions, 28 deletions
diff --git a/src/emu/cpu/tms9900/tms9900.c b/src/emu/cpu/tms9900/tms9900.c index 498e03ae402..ddfb2fac148 100644 --- a/src/emu/cpu/tms9900/tms9900.c +++ b/src/emu/cpu/tms9900/tms9900.c @@ -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 diff --git a/src/emu/cpu/tms9900/tms9900.h b/src/emu/cpu/tms9900/tms9900.h index 29bf97ed9ab..296dd087caa 100644 --- a/src/emu/cpu/tms9900/tms9900.h +++ b/src/emu/cpu/tms9900/tms9900.h @@ -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, diff --git a/src/emu/cpu/tms9900/tms9995.c b/src/emu/cpu/tms9900/tms9995.c index a7f2694d139..650dd2ae615 100644 --- a/src/emu/cpu/tms9900/tms9995.c +++ b/src/emu/cpu/tms9900/tms9995.c @@ -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,38 +1133,45 @@ 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) + m_int1_active = m_flag[2] = (state==ASSERT_LINE); + if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state); + } + else + { + if (irqline == INPUT_LINE_99XX_INT4) { - if (VERBOSE>7) LOG("tms9995: set as interrupt\n"); - m_int4_active = m_flag[4] = (state==ASSERT_LINE); + 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>7) LOG("tms9995: set as event count\n"); - trigger_decrementer(); + if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline); } } - else - { - if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline); - } } } } diff --git a/src/emu/cpu/tms9900/tms9995.h b/src/emu/cpu/tms9900/tms9995.h index b21b0d087f0..7688ba9a90c 100644 --- a/src/emu/cpu/tms9900/tms9995.h +++ b/src/emu/cpu/tms9900/tms9995.h @@ -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, diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h index 5de05889a71..f47c10633e9 100644 --- a/src/emu/video/tms9928a.h +++ b/src/emu/video/tms9928a.h @@ -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(); diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h index 1170ecd7505..8a6aad7b11c 100644 --- a/src/emu/video/v9938.h +++ b/src/emu/video/v9938.h @@ -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; |