Previous 199869 Revisions Next

r31942 Saturday 6th September, 2014 at 06:38:32 UTC by Fabio Priuli
(MESS) maria.c:
-Timeout rendering added. [Mike Saarna]
-Reorganized DMA penalties to support new rendering code [Mike Saarna, Robert Tuccitto]
[src/mess/video]maria.c

trunk/src/mess/video/maria.c
r31941r31942
44
55 
66  - some history:
7    2014-10-03 Mike Saarna, Robert Tuccitto reorganized DMA penalties to
8            support new rendering timeout code.
9
10    2014-08-29 Mike Saarna Timeout rendering added.
711 
812    2014-08-26 Fabio Priuli Converted to device
913
r31941r31942
161165   int d, c, pixel_cell, cells;
162166   int maria_cycles;
163167
164   if (m_offset == 0)
165   {
166      if (READ_MEM(m_dll + 3) & 0x80)
167         maria_cycles = 40; // DMA + maria interrupt overhead
168      else
169         maria_cycles = 19; // DMA
170      }
171      else
172      {
173         maria_cycles = 16; // DMA
174      }
168   // All lines in a zone have the same initial DMA startup time. We'll adjust
169   // cycles for the special last zone line later, as those penalties happen after
170   // MARIA is done rendering, or after its hit the maximum rendering time.
171   maria_cycles = 16;
175172
176173   cells = 0;
177174
r31941r31942
179176   dl = m_dl;
180177
181178   /* DMA */
182   /* Step through DL's */
183   while ((READ_MEM(dl + 1) & 0x5f) != 0)
179   /* Step through DL's while we're within maximum rendering time.   max render time = ( scanline length - DMA start ) */
180   /*                                                                   426          = (     454         -     28    ) */
181
182   while (((READ_MEM(dl + 1) & 0x5f) != 0) && (maria_cycles<426))
184183   {
185184      /* Extended header */
186185      if (!(READ_MEM(dl + 1) & 0x1f))
r31941r31942
210209
211210      for (int x = 0; x < width; x++)
212211      {
212         if (maria_cycles >= 426) // ensure we haven't overrun the maximum render time
213            break;
214
213215         /* Do indirect mode */
214216         if (ind)
215217         {
r31941r31942
217219            data_addr = (m_charbase | c) + (m_offset << 8);
218220            if (is_holey(data_addr))
219221               continue;
220
222           
221223            maria_cycles += 3;
222224            if (m_cwidth) // two data bytes per map byte
223225            {
r31941r31942
245247         }
246248      }
247249   }
250   
251   // Last Line post-render DMA cycle penalties...
252   if (m_offset == 0)
253   {
254      maria_cycles += 3; // extra shutdown time
255      if (READ_MEM(m_dll + 3) & 0x80)
256         maria_cycles += 21; // interrupt overhead
257   }
258
248259   // Spin the CPU for Maria DMA, if it's not already spinning for WSYNC.
249260   // MARIA generates the 6502 clock by dividing its own clock by 4. It needs to HALT and unHALT
250261   // the 6502 on ths same clock phase, so MARIA will wait until its clock divides evenly by 4.

Previous 199869 Revisions Next


© 1997-2024 The MAME Team