Previous 199869 Revisions Next

r21262 Thursday 21st February, 2013 at 16:07:54 UTC by Angelo Salese
Added scrolling
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21261r21262
444444   required_shared_ptr<UINT16> m_soundram2;
445445   bitmap_rgb32 m_temp_bitmap_sprites;
446446   bitmap_rgb32 m_temp_bitmap_sprites2;
447   UINT32 m_test_offs;
448447   int m_color;
449448   UINT8 m_vblank;
450449   int m_scsp_last_line;
r21261r21262
499498{
500499   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites);
501500   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2);
502   m_test_offs = 0x2000;
503501}
504502
505503// might be a page 'map / base' setup somewhere, but it's just used for ingame backgrounds
r21261r21262
513511   UINT32 count;
514512   int y,x;
515513   int color;
516   count = m_test_offs/4;
514   count = 0/4;
517515   color = m_color;
516   int scrollx;
517   int scrolly;
518518
519519   if (which==1)
520520   {
r21261r21262
529529
530530   }
531531
532   scrollx = (m_framebuffer_vram[(0x9bac+which*0x40)/4] >> 16) & 0x7ff;
533   scrolly = m_framebuffer_vram[(0x9bac+which*0x40)/4] & 0x3ff;
534
535   /* TODO: optimize! */
532536   for (y=0;y<64;y++)
533537   {
534538      for (x=0;x<128;x+=2)
535539      {
536540         int tile;
541         int res_x,res_y;
537542
543         res_x = ((x+0)*16)-scrollx;
544         res_y = (y*16)-scrolly;
545
538546         tile = (m_h1_vram[count] & 0x0fff0000) >> 16;
539         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,(x+0)*16,y*16);
547         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y);
548         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y);
549         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y+1024);
550         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y+1024);
540551
552         res_x = ((x+1)*16)-scrollx;
553         res_y = (y*16)-scrolly;
554
541555         tile = (m_h1_vram[count] & 0x00000fff) >> 0;
542         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,(x+1)*16,y*16);
556         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y);
557         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y);
558         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x,res_y+1024);
559         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,res_x+2048,res_y+1024);
543560
561
544562         count++;
545563      }
546564   }
r21261r21262
562580UINT32 coolridr_state::screen_update_coolridr1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
563581{
564582#if 0
565   if(machine().input().code_pressed(KEYCODE_Z))
566      m_test_offs+=4;
567
568   if(machine().input().code_pressed(KEYCODE_X))
569      m_test_offs-=4;
570
571   if(machine().input().code_pressed(KEYCODE_C))
572      m_test_offs+=0x40;
573
574   if(machine().input().code_pressed(KEYCODE_V))
575      m_test_offs-=0x40;
576
577   if(machine().input().code_pressed(KEYCODE_B))
578      m_test_offs+=0x400;
579
580   if(machine().input().code_pressed(KEYCODE_N))
581      m_test_offs-=0x400;
582
583583   if(machine().input().code_pressed_once(KEYCODE_A))
584584      m_color++;
585585
586586   if(machine().input().code_pressed_once(KEYCODE_S))
587587      m_color--;
588588
589   if(m_test_offs > 0x100000*4)
590      m_test_offs = 0;
591
592589#endif
593590
594//   popmessage("%08x %04x",m_test_offs,m_color);
591//   popmessage("%04x",m_color);
595592
596593   return screen_update_coolridr(screen,bitmap,cliprect,0);
597594}
r21261r21262
21592156
21602157   for (int i=0;i<(0x800000*8)/2;i++)
21612158   {
2162      m_expanded_10bit_gfx[i] = get_10bit_data( 0, i);
2159      m_expanded_10bit_gfx[i] = get_10bit_data( 0, i);
21632160   }
21642161
21652162   if (0)
r21261r21262
21692166      sprintf(filename,"expanded_%s_gfx", machine().system().name);
21702167      fp=fopen(filename, "w+b");
21712168      if (fp)
2172      {   
2169      {
21732170         for (int i=0;i<(0x800000*8);i++)
21742171         {
21752172            fwrite((UINT8*)m_expanded_10bit_gfx+(i^1), 1, 1, fp);
21762173         }
21772174         fclose(fp);
2178         
2175
21792176      }
21802177   }
21812178

Previous 199869 Revisions Next


© 1997-2024 The MAME Team