Previous 199869 Revisions Next

r31036 Thursday 19th June, 2014 at 10:18:51 UTC by David Haywood
use custom roz implementation to allow for further tweaking, whatever this does it doesn't appear to be standard (I still haven't figured it out properly after 10 years) so will need it (nw)
[src/mame/video]mb60553.c mb60553.h

trunk/src/mame/video/mb60553.c
r31035r31036
181181   m_m_gfx_region = gfx_region;
182182}
183183
184
185
186
187
188void mb60553_zooming_tilemap_device::draw_roz_core(screen_device &screen, bitmap_ind16 &destbitmap, const rectangle &cliprect,
189      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound)
190{
191   // pre-cache all the inner loop values
192   //const rgb_t *clut = m_palette->palette()->entry_list_adjusted();
193   const int xmask = m_tmap->pixmap().width() - 1;
194   const int ymask = m_tmap->pixmap().height() - 1;
195   const int widthshifted = m_tmap->pixmap().width() << 16;
196   const int heightshifted = m_tmap->pixmap().height() << 16;
197   UINT8 mask = 0x1f;// blit.mask;
198   UINT8 value = 0x10;// blit.value;
199   bitmap_ind16 &srcbitmap = m_tmap->pixmap();
200   bitmap_ind8 &flagsbitmap = m_tmap->flagsmap();
201
202   // pre-advance based on the cliprect
203   startx += cliprect.min_x * incxx + cliprect.min_y * incyx;
204   starty += cliprect.min_x * incxy + cliprect.min_y * incyy;
205
206   // extract start/end points
207   int sx = cliprect.min_x;
208   int sy = cliprect.min_y;
209   int ex = cliprect.max_x;
210   int ey = cliprect.max_y;
211
212   // loop over rows
213   while (sy <= ey)
214   {
215      // initialize X counters
216      int x = sx;
217      UINT32 cx = startx;
218      UINT32 cy = starty;
219
220      // get dest and priority pointers
221      UINT16 *dest = &destbitmap.pix(sy, sx);
222
223      // loop over columns
224      while (x <= ex)
225      {
226         if (wraparound)
227         {
228            if ((flagsbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
229            {
230               *dest = (srcbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask));
231            }
232         }
233         else
234         {
235            if (cx < widthshifted && cy < heightshifted)
236            {
237               if ((flagsbitmap.pix(cy >> 16, cx >> 16) & mask) == value)
238               {
239                  *dest = (srcbitmap.pix(cy >> 16, cx >> 16));
240               }
241            }
242         }
243
244         // advance in X
245         cx += incxx;
246         cy += incxy;
247         x++;
248         dest++;
249         //pri++;
250      }
251
252      // advance in Y
253      startx += incyx;
254      starty += incyy;
255      sy++;
256   }
257}
258
259
260
261
262
184263/* THIS IS STILL WRONG! */
185264void mb60553_zooming_tilemap_device::draw( screen_device &screen, bitmap_ind16& bitmap, const rectangle &cliprect, int priority)
186265{
r31035r31036
211290
212291      clip.min_y = clip.max_y = line;
213292
214      m_tmap->draw_roz(screen, bitmap, clip, startx<<12,starty<<12,
293      draw_roz_core(screen, bitmap, clip, startx<<12,starty<<12,
215294            incxx,0,0,incyy,
216            1,
217            0,priority);
295            1
296            );
218297
219298   }
220
221
222
223299}
224300
225301tilemap_t* mb60553_zooming_tilemap_device::get_tilemap()
trunk/src/mame/video/mb60553.h
r31035r31036
3333   DECLARE_READ16_MEMBER(vram_r);
3434   DECLARE_READ16_MEMBER(line_r);
3535
36   void draw_roz_core(screen_device &screen, bitmap_ind16 &destbitmap, const rectangle &cliprect,
37      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound);
38
3639protected:
3740   virtual void device_start();
3841   virtual void device_reset();

Previous 199869 Revisions Next


© 1997-2024 The MAME Team