Previous 15994 Revisions Next

r15583 Thursday 12th July, 2012 at 21:38:59 UTC by Michael Zapf
tms99xx: Introduced symbolic constants for interrupt lines. Added a special RESET line which is handled by the CPU, not by the emulator core.
tms9928a/v9938: Introduced dedicated RESET line. [Michael Zapf]
[src/emu/cpu/tms9900]tms9900.c tms9900.h tms9995.c tms9995.h
[src/emu/video]tms9928a.h v9938.h

src/emu/cpu/tms9900/tms9995.c
r15582r15583
11181118            }
11191119         }
11201120      }
1121   } while (m_icount>0);
1121   } while (m_icount>0 && !m_reset);
11221122   if (VERBOSE>5) LOG("tms9995: cycles expired; will return soon.\n");
11231123}
11241124
r15582r15583
11331133*/
11341134void tms9995_device::execute_set_input(int irqline, int state)
11351135{
1136   if (irqline == INPUT_LINE_NMI)
1136   if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE)
11371137   {
1138      m_nmi_active = (state==ASSERT_LINE);
1139      if (VERBOSE>3) LOG("tms9995: NMI interrupt line state=%d\n", state);
1138      m_reset = true;
11401139   }
11411140   else
11421141   {
1143      if (irqline == 1)
1142      if (irqline == INPUT_LINE_NMI)
11441143      {
1145         m_int1_active = m_flag[2] = (state==ASSERT_LINE);
1146         if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state);
1144         m_nmi_active = (state==ASSERT_LINE);
1145         if (VERBOSE>3) LOG("tms9995: NMI interrupt line state=%d\n", state);
11471146      }
11481147      else
11491148      {
1150         if (irqline == 4)
1149         if (irqline == INPUT_LINE_99XX_INT1)
11511150         {
1152            if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state);
1153            if (m_flag[0]==false)
1151            m_int1_active = m_flag[2] = (state==ASSERT_LINE);
1152            if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state);
1153         }
1154         else
1155         {
1156            if (irqline == INPUT_LINE_99XX_INT4)
11541157            {
1155               if (VERBOSE>7) LOG("tms9995: set as interrupt\n");
1156               m_int4_active = m_flag[4] = (state==ASSERT_LINE);
1158               if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state);
1159               if (m_flag[0]==false)
1160               {
1161                  if (VERBOSE>7) LOG("tms9995: set as interrupt\n");
1162                  m_int4_active = m_flag[4] = (state==ASSERT_LINE);
1163               }
1164               else
1165               {
1166                  if (VERBOSE>7) LOG("tms9995: set as event count\n");
1167                  trigger_decrementer();
1168               }
11571169            }
11581170            else
11591171            {
1160               if (VERBOSE>7) LOG("tms9995: set as event count\n");
1161               trigger_decrementer();
1172               if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline);
11621173            }
11631174         }
1164         else
1165         {
1166            if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline);
1167         }
11681175      }
11691176   }
11701177}
src/emu/cpu/tms9900/tms9900.c
r15582r15583
11541154            }
11551155         }
11561156      }
1157   } while (m_icount>0);
1157   } while (m_icount>0 && !m_reset);
11581158   if (VERBOSE>6) LOG("tms99xx: cycles expired; will return soon.\n");
11591159}
11601160
r15582r15583
11651165*/
11661166void tms99xx_device::execute_set_input(int irqline, int state)
11671167{
1168   if (irqline == INPUT_LINE_NMI)
1168   if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE)
11691169   {
1170      m_load_state = (state==ASSERT_LINE);
1171      m_irq_level = -1;
1170      m_reset = true;
11721171   }
11731172   else
11741173   {
1175      m_irq_state = (state==ASSERT_LINE);
1176      if (state==ASSERT_LINE)
1174      if (irqline == INPUT_LINE_NMI)
11771175      {
1178         m_irq_level = get_intlevel(state);
1179         if (VERBOSE>6) LOG("tms99xx: interrupt line %d = %d, level=%d, ST=%04x\n", irqline, state, m_irq_level, ST);
1176         m_load_state = (state==ASSERT_LINE);
1177         m_irq_level = -1;
11801178      }
11811179      else
11821180      {
1183         if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline);
1181         m_irq_state = (state==ASSERT_LINE);
1182         if (state==ASSERT_LINE)
1183         {
1184            m_irq_level = get_intlevel(state);
1185            if (VERBOSE>6) LOG("tms99xx: interrupt line %d = %d, level=%d, ST=%04x\n", irqline, state, m_irq_level, ST);
1186         }
1187         else
1188         {
1189            if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline);
1190         }
11841191      }
11851192   }
11861193}
r15582r15583
25432550
25442551UINT32 tms99xx_device::execute_input_lines() const
25452552{
2546   return 1;
2553   return 2;
25472554}
25482555
25492556// clocks to cycles, cycles to clocks = id
src/emu/cpu/tms9900/tms9995.h
r15582r15583
1111#include "emu.h"
1212#include "debugger.h"
1313 
14/*
15    Define symbols for interrupt lines.
16 
17    We use a separate RESET signal which is not captured by the core.
18 
19    Caution: Check irqline in set_input_line of each driver using this CPU.
20    Values have changed. Use these symbols instead.
21*/
1422enum
1523{
24   INPUT_LINE_99XX_RESET = 0,
25   INPUT_LINE_99XX_INTREQ = 1,
26   INPUT_LINE_99XX_INT1 = 2,
27   INPUT_LINE_99XX_INT4 = 3
28};
29 
30enum
31{
1632   TI990_10_ID = 1,
1733   TMS9900_ID = 3,
1834   TMS9940_ID = 4,
src/emu/cpu/tms9900/tms9900.h
r15582r15583
4747#include "emu.h"
4848#include "debugger.h"
4949
50/*
51    Define symbols for interrupt lines.
52
53    We use a separate RESET signal which is not captured by the core.
54
55    Caution: Check irqline in set_input_line of each driver using this CPU.
56    Values have changed. Use these symbols instead.
57*/
5058enum
5159{
60   INPUT_LINE_99XX_RESET = 0,
61   INPUT_LINE_99XX_INTREQ = 1,
62   INPUT_LINE_99XX_INT1 = 2,
63   INPUT_LINE_99XX_INT4 = 3
64};
65
66enum
67{
5268   LOAD_INT = -1,
5369   RESET_INT = -2
5470};
src/emu/video/tms9928a.h
r15582r15583
107107   UINT32 screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
108108   bitmap_ind16 &get_bitmap() { return m_tmpbmp; }
109109
110   /* RESET pin */
111   void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); }
112
110113protected:
111114   // device-level overrides
112115   virtual void device_config_complete();
src/emu/video/v9938.h
r15582r15583
9696   static void static_set_vram_size(device_t &device, UINT32 vram_size);
9797   static void static_set_interrupt_callback(device_t &device, v99x8_interrupt_delegate callback, const char *device_name);
9898
99   /* RESET pin */
100   void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); }
101
99102protected:
100103   const address_space_config      m_space_config;
101104   address_space*               m_vram_space;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team