Previous 199869 Revisions Next

r21402 Saturday 23rd February, 2013 at 16:37:46 UTC by Angelo Salese
Part two
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21401r21402
512512{
513513   /* planes seems to basically be at 0x8000 and 0x28000... */
514514   gfx_element *gfx = machine().gfx[0];
515   UINT32 count;
515   UINT32 base_offset;
516   UINT32 tile_offset;
516517   int y,x;
517518   int color;
518519   int scrollx;
519520   int scrolly;
520521
521   count = 0;
522   m_color = 0;
523
524   if (which==1)
525   {
526      count += 0x20000;
527//      color += 0x5e;
528      m_color = 2;
529   }
530   else
531   {
532//      color += 0x4e;
533//      color += 0x0;
534   }
535
536522   scrollx = (m_framebuffer_vram[(0x9bac+which*0x40)/4] >> 16) & 0x7ff;
537523   scrolly = m_framebuffer_vram[(0x9bac+which*0x40)/4] & 0x3ff;
538524
539   /* TODO: optimize! */
525   base_offset = which * 0x20000;
526   m_color = which * 2;
527
540528   for (y=0;y<64;y++)
541529   {
542530      for (x=0;x<128;x++)
543531      {
544532         int tile;
545533         int res_x,res_y;
546         UINT16 cur_ptr;
534         UINT16 cur_tile;
547535
548536         res_x = (x*16)-scrollx;
549537         res_y = (y*16)-scrolly;
538         tile_offset = (x+y*128)*2;
539         tile_offset+= base_offset;
550540
551         cur_ptr = (m_h1_vram[count]<<8)|m_h1_vram[count+1];
541         cur_tile = (m_h1_vram[tile_offset]<<8)|m_h1_vram[tile_offset+1];
552542
553         tile = cur_ptr & 0x07ff;
554         color = m_color + ((cur_ptr & 0x0800) >> 11) * 4;
543         tile = cur_tile & 0x07ff;
544         color = m_color + ((cur_tile & 0x0800) >> 11) * 4;
555545
556546         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y);
557547         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y);
558548         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y+1024);
559549         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y+1024);
560
561         count+=2;
562550      }
563551   }
564552

Previous 199869 Revisions Next


© 1997-2024 The MAME Team