Previous 199869 Revisions Next

r21883 Saturday 16th March, 2013 at 08:39:28 UTC by David Haywood
deco_mlc - checkpoint
[src/mame/drivers]deco_mlc.c
[src/mame/includes]deco_mlc.h
[src/mame/video]deco_mlc.c

trunk/src/mame/drivers/deco_mlc.c
r21882r21883
395395
396396   MCFG_GFXDECODE(deco_mlc)
397397   MCFG_PALETTE_LENGTH(2048)
398//   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
398399
399400   MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
400401
r21882r21883
427428
428429   MCFG_GFXDECODE(deco_mlc)
429430   MCFG_PALETTE_LENGTH(2048)
431//   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
430432
431433   MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
432434
trunk/src/mame/includes/deco_mlc.h
r21882r21883
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);
43   void draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect, int scanline);
4444   void descramble_sound(  );
4545};
trunk/src/mame/video/deco_mlc.c
r21882r21883
158158}
159159
160160
161void deco_mlc_state::draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect)
161void deco_mlc_state::draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect, int scanline)
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;
r21882r21883
368368      if (!ratio)
369369         continue;
370370
371      for (int bby=0; bby<full_sprite_screen_height>>16; bby++)
372      {
373         int srcline = ((bby<<16) / ratio);
371      int bby = scanline - (full_realybase>>16);
372
373      if (bby < 0)
374         continue;
375
376      if (bby >= full_sprite_screen_height>>16)
377         continue;
378
379
380
381     
382      int srcline = ((bby<<16) / ratio);
374383         
375         by = srcline >> 4;
384      by = srcline >> 4;
376385         
377         int y = (full_realybase>>16)+bby;
386      int y = (full_realybase>>16)+bby;
378387
379         rectangle myclip;
380         myclip = user_clip;
381         myclip &= bitmap.cliprect();
388      rectangle myclip;
389      myclip = user_clip;
390      myclip &= bitmap.cliprect();
382391
383         if( y < myclip.min_y )
384            continue;
392      if( y < myclip.min_y )
393         continue;
385394
386         if( y > myclip.max_y+1 )
387            continue;
395      if( y > myclip.max_y+1 )
396         continue;
388397
389         UINT32 *dest = &bitmap.pix32(y);
398      UINT32 *dest = &bitmap.pix32(y);
390399
391         srcline &=0xf;
392         if( fy )
400      srcline &=0xf;
401      if( fy )
402      {
403         srcline = 15 - srcline;
404      }
405
406
407      for (bx=0; bx<w; bx++) {
408           
409         int realxbase = xbase + bx * xinc;
410         int count = 0;
411         if (fx)
393412         {
394            srcline = 15 - srcline;
413            if (fy)
414               count = (h-1-by) * w + (w-1-bx);
415            else
416               count = by * w + (w-1-bx);
395417         }
418         else
419         {
420            if (fy)
421               count = (h-1-by) * w + bx;
422            else
423               count = by * w + bx;
424         }
396425
426         int tile=sprite + count;
427         int tile2=sprite2 + count;
397428
398         for (bx=0; bx<w; bx++) {
399           
400            int realxbase = xbase + bx * xinc;
401            int count = 0;
402            if (fx)
429         if (blockIsTilemapIndex) {
430            if (useIndicesInRom)
403431            {
404               if (fy)
405                  count = (h-1-by) * w + (w-1-bx);
432               const UINT8* ptr=rawrom+(tile*2);
433               tile=(*ptr) + ((*(ptr+1))<<8);
434
435               if (use8bppMode) {
436                  const UINT8* ptr2=rawrom+(tile2*2);
437                  tile2=(*ptr2) + ((*(ptr2+1))<<8);
438               }
406439               else
407                  count = by * w + (w-1-bx);
440               {
441                  tile2=0;
442               }
443
444               if (tileFormat)
445               {
446                  colorOffset=(tile&0xf000)>>12;
447                  tile=(tile&0x0fff)|hibits;
448                  tile2=(tile2&0x0fff)|hibits;
449               }
450               else
451               {
452                  colorOffset=0;
453                  tile=(tile&0xffff)|(hibits<<2);
454                  tile2=(tile2&0xffff)|(hibits<<2);
455               }
408456            }
409457            else
410458            {
411               if (fy)
412                  count = (h-1-by) * w + bx;
413               else
414                  count = by * w + bx;
415            }
459               const UINT32* ptr=m_mlc_vram + ((tile)&0x7fff);
460               tile=(*ptr)&0xffff;
416461
417            int tile=sprite + count;
418            int tile2=sprite2 + count;
419
420            if (blockIsTilemapIndex) {
421               if (useIndicesInRom)
462               if (tileFormat)
422463               {
423                  const UINT8* ptr=rawrom+(tile*2);
424                  tile=(*ptr) + ((*(ptr+1))<<8);
425
426                  if (use8bppMode) {
427                     const UINT8* ptr2=rawrom+(tile2*2);
428                     tile2=(*ptr2) + ((*(ptr2+1))<<8);
429                  }
430                  else
431                  {
432                     tile2=0;
433                  }
434
435                  if (tileFormat)
436                  {
437                     colorOffset=(tile&0xf000)>>12;
438                     tile=(tile&0x0fff)|hibits;
439                     tile2=(tile2&0x0fff)|hibits;
440                  }
441                  else
442                  {
443                     colorOffset=0;
444                     tile=(tile&0xffff)|(hibits<<2);
445                     tile2=(tile2&0xffff)|(hibits<<2);
446                  }
464                  colorOffset=(tile&0xf000)>>12;
465                  tile=(tile&0x0fff)|hibits;
447466               }
448467               else
449468               {
450                  const UINT32* ptr=m_mlc_vram + ((tile)&0x7fff);
451                  tile=(*ptr)&0xffff;
452
453                  if (tileFormat)
454                  {
455                     colorOffset=(tile&0xf000)>>12;
456                     tile=(tile&0x0fff)|hibits;
457                  }
458                  else
459                  {
460                     colorOffset=0;
461                     tile=(tile&0xffff)|(hibits<<2);
462                  }
463
464                  tile2=0;
469                  colorOffset=0;
470                  tile=(tile&0xffff)|(hibits<<2);
465471               }
466            }
467472
468
469
470
471            mlc_drawgfxzoomline(
472                        dest,user_clip,machine().gfx[0],
473                        tile,tile2,
474                        color + colorOffset,fx,realxbase,
475                        0,
476                        use8bppMode,(xscale<<8),alpha, srcline);
477
473               tile2=0;
474            }
478475         }
479476
480                     
477         mlc_drawgfxzoomline(
478                     dest,user_clip,machine().gfx[0],
479                     tile,tile2,
480                     color + colorOffset,fx,realxbase,
481                     0,
482                     use8bppMode,(xscale<<8),alpha, srcline);
481483
482484      }
483485
484//      if (lastRasterMode!=0 && rasterDirty)
485//      {
486//          blitRaster(machine, bitmap, rasterMode);
487//          temp_bitmap->fill(0, cliprect);
488//          rasterDirty=0;
489//      }
490//      lastRasterMode=rasterMode;
491
492486      if (use8bppMode)
493487         offs-=8;
494488   }
r21882r21883
512506{
513507//  temp_bitmap->fill(0, cliprect);
514508   bitmap.fill(machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
515   draw_sprites(bitmap,cliprect);
509
510   for (int i=0;i<256;i++)
511   {
512      draw_sprites(bitmap,cliprect, i);
513   }
516514   return 0;
517515}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team