Previous 199869 Revisions Next

r21422 Sunday 24th February, 2013 at 16:50:51 UTC by Angelo Salese
Added command 0x30/0x34, used for solid pen fills
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21421r21422
481481   int m_gfx_index;
482482   int m_color_bank;
483483   UINT32 m_rgb_ctrl[2];
484   UINT32 m_pen_fill[2];
484485
485486   osd_work_queue *    m_work_queue[2]; // work queue, one per screen
486487   static void *draw_tile_row_threaded(void *param, int threadid);
r21421r21422
567568   base_offset = (which * 0x20000)/2;
568569   m_color_bank = which * 2;
569570
570    for (int y=0;y<64;y++)
571    {
572      for (int x=0;x<128;x++)
571   if(m_pen_fill[which])
572   {
573      int bg_r,bg_g,bg_b;
574      /* logic here is a bit of a guess. */
575      bg_r = (((m_pen_fill[which] >> 16) & 0x7f) << 1) | (((m_pen_fill[which] >> 16) & 0x80) >> 7);
576      bg_g = (((m_pen_fill[which] >> 8) & 0x7f) << 1) | (((m_pen_fill[which] >> 8) & 0x80) >> 7);
577      bg_b = (((m_pen_fill[which] >> 0) & 0x7f) << 1) | (((m_pen_fill[which] >> 0) & 0x80) >> 7);
578      bitmap.fill(MAKE_ARGB(0xff,bg_r,bg_g,bg_b),cliprect);
579   }
580   else
581   {
582       for (int y=0;y<64;y++)
573583       {
574          int res_x,res_y;
584         for (int x=0;x<128;x++)
585          {
586             int res_x,res_y;
575587
576         res_x = (x*16)-scrollx;
577          res_y = (y*16)-scrolly;
588            res_x = (x*16)-scrollx;
589             res_y = (y*16)-scrolly;
578590
579         tile = (m_h1_vram[x+y*128+base_offset] & 0x0fff);
580         color = m_color_bank + ((tile & 0x800) >> 11) * 4;
591            tile = (m_h1_vram[x+y*128+base_offset] & 0x0fff);
592            color = m_color_bank + ((tile & 0x800) >> 11) * 4;
581593
582         drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y);
583         drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y);
584         drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y+1024);
585         drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y+1024);
594            drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y);
595            drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y);
596            drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x,res_y+1024);
597            drawgfx_opaque(bitmap,cliprect,gfx,tile & 0x7ff,color,0,0,res_x+2048,res_y+1024);
598         }
586599      }
587600   }
588601
r21421r21422
19131926
19141927         case 0x04: /* init - value 0x040c80d2 (unknown purpose, slave mode?) */
19151928         case 0x10: /* sets up look-up for tilemap video registers */
1916         case 0x20: /* unknown table */
1917         case 0x24: /* unknown table */
1918         case 0x30: /* screen 1 - 0x80 at boot, then 0x808080  */
1919         case 0x34: /* screen 2 / */
1929         case 0x20: /* screen 1 - linescroll/zoom table? (default values) */
1930         case 0x24: /* screen 2 / */
19201931         case 0x50: /* screen 1 - unknown */
19211932         case 0x54: /* screen 2 / */
1922            //printf("%02x %08x\n",cmd,m_framebuffer_vram[(0+dma_index)/4]);
19231933            dma_index+=4;
19241934            break;
1935         case 0x30: /* screen 1 - 0x80 at boot, then 0x808080  */
1936         case 0x34: /* screen 2 / */
1937            m_pen_fill[(cmd & 4) >> 2] = m_framebuffer_vram[(0+dma_index)/4] & 0xffffff;
1938            dma_index+=4;
1939            break;
19251940         case 0x40: /* screen 1 - almost certainly RGB brightness (at least bits 4 - 0) */
19261941         case 0x44: /* screen 2 / */
19271942            m_rgb_ctrl[(cmd & 4) >> 2] = m_framebuffer_vram[(0+dma_index)/4] & 0xffffff;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team