Previous 199869 Revisions Next

r21884 Saturday 16th March, 2013 at 08:57:20 UTC by David Haywood
deco_mlc - renderer is now fully scanline based, should make implementing the raster effects in a clean way much easier.
[src/mame/drivers]deco_mlc.c
[src/mame/includes]deco_mlc.h
[src/mame/video]deco_mlc.c

trunk/src/mame/video/deco_mlc.c
r21883r21884
158158}
159159
160160
161void deco_mlc_state::draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect, int scanline)
161void deco_mlc_state::draw_sprites( const rectangle &cliprect, int scanline, UINT32* dest)
162162{
163163   UINT32 *index_ptr=0;
164164   int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
r21883r21884
244244      however there are space for 8 clipping windows, where is the high bit? (Or is it ~0x400?) */
245245      clipper=((clipper&2)>>1)|((clipper&1)<<1); // Swap low two bits
246246
247      user_clip.min_y=m_mlc_clip_ram[(clipper*4)+0];
248      user_clip.max_y=m_mlc_clip_ram[(clipper*4)+1];
247      int min_y = m_mlc_clip_ram[(clipper*4)+0];
248      int max_y = m_mlc_clip_ram[(clipper*4)+1];
249
250      if (scanline<min_y)
251         continue;
252
253      if (scanline>max_y)
254         continue;
255
256
249257      user_clip.min_x=m_mlc_clip_ram[(clipper*4)+2];
250258      user_clip.max_x=m_mlc_clip_ram[(clipper*4)+3];
251259
r21883r21884
383391         
384392      by = srcline >> 4;
385393         
386      int y = (full_realybase>>16)+bby;
387394
388      rectangle myclip;
389      myclip = user_clip;
390      myclip &= bitmap.cliprect();
391
392      if( y < myclip.min_y )
393         continue;
394
395      if( y > myclip.max_y+1 )
396         continue;
397
398      UINT32 *dest = &bitmap.pix32(y);
399
400395      srcline &=0xf;
401396      if( fy )
402397      {
r21883r21884
507502//  temp_bitmap->fill(0, cliprect);
508503   bitmap.fill(machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
509504
510   for (int i=0;i<256;i++)
505
506
507
508
509   for (int i=cliprect.min_y;i<=cliprect.max_y;i++)
511510   {
512      draw_sprites(bitmap,cliprect, i);
511      UINT32 *dest = &bitmap.pix32(i);
512
513      draw_sprites(cliprect, i, dest);
513514   }
514515   return 0;
515516}
trunk/src/mame/includes/deco_mlc.h
r21883r21884
4040   void screen_eof_mlc(screen_device &screen, bool state);
4141   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
4242   void blitRaster(bitmap_rgb32 &bitmap, int rasterMode);
43   void draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect, int scanline);
43   void draw_sprites( const rectangle &cliprect, int scanline, UINT32* dest);
4444   void descramble_sound(  );
4545};
trunk/src/mame/drivers/deco_mlc.c
r21883r21884
395395
396396   MCFG_GFXDECODE(deco_mlc)
397397   MCFG_PALETTE_LENGTH(2048)
398//   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
398   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
399399
400400   MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
401401
r21883r21884
428428
429429   MCFG_GFXDECODE(deco_mlc)
430430   MCFG_PALETTE_LENGTH(2048)
431//   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
431   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
432432
433433   MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
434434

Previous 199869 Revisions Next


© 1997-2024 The MAME Team