Previous 199869 Revisions Next

r19822 Wednesday 26th December, 2012 at 03:57:59 UTC by hap
fix table mask on 91xx
[src/emu/video]tms9928a.c tms9928a.h

trunk/src/emu/video/tms9928a.c
r19821r19822
1818** - Colours are incorrect. [fixed by R Nabet ?]
1919** - Sprites 8-31 are ghosted/cloned in mode 3 when using less than
2020**   three pattern tables. Exact behaviour is not known.
21** - On TMS99xxA, the colortable mask in mode 3 acts as a nametable
22**   mask as well (does not happen on TMS91xx)
2321** - Address scrambling when setting TMS99xxA to 4K (not on TMS91xx)
2422*/
2523
r19821r19822
9290   RGB_WHITE
9391};
9492
95tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz, bool is_reva )
93tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz, bool is_reva, bool is_99 )
9694   : device_t( mconfig, type, name, tag, owner, clock ),
9795     device_memory_interface(mconfig, *this),
9896      m_space_config("vram",ENDIANNESS_BIG, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(memmap))
9997{
10098   m_50hz = is_50hz;
10199   m_reva = is_reva;
100   m_99 = is_99;
102101//  static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
103102}
104103
r19821r19822
110109{
111110   m_50hz = false;
112111   m_reva = true;
112   m_99 = true;
113113//  static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
114114}
115115
r19821r19822
169169}
170170
171171
172void tms9928a_device::update_table_masks()
173{
174   m_colourmask = ( (m_Regs[3] & 0x7f) << 3 ) | 7;
175   
176   // on 91xx family, the colour table mask doesn't affect the pattern table mask
177   m_patternmask = ( (m_Regs[4] & 3) << 8 ) | ( m_99 ? (m_colourmask & 0xff) : 0xff );
178}
179
180
172181void tms9928a_device::change_register(UINT8 reg, UINT8 val)
173182{
174183   static const UINT8 Mask[8] =
r19821r19822
194203      if (val & 2)
195204      {
196205         m_colour = ((m_Regs[3] & 0x80) * 64) & (m_vram_size - 1);
197         m_colourmask = (m_Regs[3] & 0x7f) * 8 | 7;
198206         m_pattern = ((m_Regs[4] & 4) * 2048) & (m_vram_size - 1);
199         m_patternmask = ( (m_Regs[4] & 3) << 8 ) | (m_colourmask & 0xff);
207         update_table_masks();
200208      }
201209      else
202210      {
r19821r19822
220228      if (m_Regs[0] & 2)
221229      {
222230         m_colour = ((val & 0x80) * 64) & (m_vram_size - 1);
223         m_colourmask = ( (val & 0x7f) * 8 ) | 7;
231         update_table_masks();
224232      }
225233      else
226234      {
227235         m_colour = (val * 64) & (m_vram_size - 1);
228236      }
229      m_patternmask = ( (m_Regs[4] & 3) * 256 ) | (m_colourmask & 255);
230237      break;
231238   case 4:
232239      if (m_Regs[0] & 2)
233240      {
234241         m_pattern = ((val & 4) * 2048) & (m_vram_size - 1);
235         m_patternmask = ( (val & 3) * 256 ) | 255;
242         update_table_masks();
236243      }
237244      else
238245      {
r19821r19822
664671   m_colour = 0;
665672   m_spritepattern = 0;
666673   m_spriteattribute = 0;
667   m_colourmask = 0;
668   m_patternmask = 0;
674   m_colourmask = 0x3fff;
675   m_patternmask = 0x3fff;
669676   m_Addr = 0;
670677   m_ReadAhead = 0;
671678   m_INT = 0;
trunk/src/emu/video/tms9928a.h
r19821r19822
8989public:
9090   // construction/destruction
9191   tms9928a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
92   tms9928a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz = false, bool is_reva = true);
92   tms9928a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz = false, bool is_reva = true, bool is_99 = true);
9393
9494   DECLARE_READ8_MEMBER( vram_read );
9595   DECLARE_WRITE8_MEMBER( vram_write );
r19821r19822
117117   void change_register(UINT8 reg, UINT8 val);
118118   void check_interrupt();
119119   void update_backdrop();
120   void update_table_masks();
120121
121122   static const device_timer_id TIMER_LINE = 0;
122123
r19821r19822
140141   devcb_resolved_write_line   m_irq_changed;
141142   bool   m_50hz;
142143   bool   m_reva;
144   bool   m_99;
143145   rgb_t   m_palette[16];
144146
145147   /* memory */
r19821r19822
160162{
161163public:
162164   tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
163      : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false ) { }
165      : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false, true ) { }
164166};
165167
166168
r19821r19822
168170{
169171public:
170172   tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
171      : tms9928a_device( mconfig, TMS9918A, "TMS9918a", tag, owner, clock, false, true ) { }
173      : tms9928a_device( mconfig, TMS9918A, "TMS9918A", tag, owner, clock, false, true, true ) { }
172174};
173175
174176
r19821r19822
176178{
177179public:
178180   tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
179      : tms9928a_device( mconfig, TMS9118, "TMS9118", tag, owner, clock, false, true ) { }
181      : tms9928a_device( mconfig, TMS9118, "TMS9118", tag, owner, clock, false, true, false ) { }
180182};
181183
182184
r19821r19822
184186{
185187public:
186188   tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
187      : tms9928a_device( mconfig, TMS9128, "TMS9128", tag, owner, clock, false, true ) { }
189      : tms9928a_device( mconfig, TMS9128, "TMS9128", tag, owner, clock, false, true, false ) { }
188190};
189191
190192
r19821r19822
192194{
193195public:
194196   tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
195      : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false ) { }
197      : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false, true ) { }
196198};
197199
198200
r19821r19822
200202{
201203public:
202204   tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
203      : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true ) { }
205      : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true ) { }
204206};
205207
206208
r19821r19822
208210{
209211public:
210212   tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
211      : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true ) { }
213      : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true, false ) { }
212214};
213215
214216

Previous 199869 Revisions Next


© 1997-2024 The MAME Team