Previous 15994 Revisions Next

r6261 Monday 2nd November, 2009 at 17:50:26 UTC by Harmony
[SMS/GG] Bugzilla #65: lack of LCD persistence emulation [Harmony]
This fixes a number of graphical issues in Game Gear games, including the title screen in Ayrton Senna's Super Monaco GP II and the score in Halley's Comet.
[src/mess/video]smsvdp.c

src/mess/video/smsvdp.c
r6260r6261
235235READ8_DEVICE_HANDLER( sms_vdp_hcount_latch_r )
236236{
237237   smsvdp_t *smsvdp = get_safe_token(device);
238   
238
239239   return smsvdp->hcounter;
240240}
241241
242242WRITE8_DEVICE_HANDLER( sms_vdp_hcount_latch_w )
243243{
244244   smsvdp_t *smsvdp = get_safe_token(device);
245   
245
246246   smsvdp->hcounter = data;
247247}
248248
r6260r6261
639639         if (palette_selected)
640640            pen_selected |= 0x10;
641641
642         
642
643643         if (!horiz_selected)
644644         {
645645            pixel_plot_x = pixel_x;
r6260r6261
13201320   int height = video_screen_get_height(screen);
13211321   int x, y;
13221322
1323   if (smsvdp->prev_bitmap_saved)
1323   if (IS_GAMEGEAR_VDP)
13241324   {
13251325      for (y = 0; y < height; y++)
13261326      {
1327         UINT32 *line0 = BITMAP_ADDR32(smsvdp->tmpbitmap, y, 0);
1328         UINT32 *line1 = BITMAP_ADDR32(smsvdp->prev_bitmap, y, 0);
13271329         for (x = 0; x < width; x++)
13281330         {
1329            *BITMAP_ADDR32(bitmap, y, x) = (*BITMAP_ADDR32(smsvdp->tmpbitmap, y, x) + *BITMAP_ADDR32(smsvdp->prev_bitmap, y, x)) >> 2;
1330            logerror("%x %x %x\n", *BITMAP_ADDR32(smsvdp->tmpbitmap, y, x), *BITMAP_ADDR32(smsvdp->prev_bitmap, y, x), (*BITMAP_ADDR32(smsvdp->tmpbitmap, y, x) + *BITMAP_ADDR32(smsvdp->prev_bitmap, y, x)) >> 2);
1331            UINT32 color0 = line0[x];
1332            UINT32 color1 = line1[x];
1333            UINT16 r0 = (color0 >> 16) & 0x000000ff;
1334            UINT16 g0 = (color0 >>  8) & 0x000000ff;
1335            UINT16 b0 = (color0 >>  0) & 0x000000ff;
1336            UINT16 r1 = (color1 >> 16) & 0x000000ff;
1337            UINT16 g1 = (color1 >>  8) & 0x000000ff;
1338            UINT16 b1 = (color1 >>  0) & 0x000000ff;
1339            UINT8 r = (UINT8)((r0 + r1) >> 1);
1340            UINT8 g = (UINT8)((g0 + g1) >> 1);
1341            UINT8 b = (UINT8)((b0 + b1) >> 1);
1342            *BITMAP_ADDR32(bitmap, y, x) = (r << 16) | (g << 8) | b;
13311343         }
13321344      }
1345
1346      copybitmap(smsvdp->prev_bitmap, smsvdp->tmpbitmap, 0, 0, 0, 0, cliprect);
13331347   }
13341348   else
13351349   {
13361350      copybitmap(bitmap, smsvdp->tmpbitmap, 0, 0, 0, 0, cliprect);
13371351   }
13381352
1339   if (!smsvdp->prev_bitmap_saved)
1340   {
1341      copybitmap(smsvdp->prev_bitmap, smsvdp->tmpbitmap, 0, 0, 0, 0, cliprect);
1342   //smsvdp->prev_bitmap_saved = 1;
1343   }
1344
13451353   return 0;
13461354}
13471355
r6260r6261
14241432   smsvdp->line_counter = 0;
14251433   smsvdp->prev_bitmap_saved = 0;
14261434
1427   /* for light gun input with "Hang-On & Safari Hunt", hcounter seems to
1435   /* for light gun input with "Hang-On & Safari Hunt", hcounter seems to
14281436    need initialization to some value */
1429   smsvdp->hcounter = 0x40;
1430   
1437   smsvdp->hcounter = 0x40;
1438
14311439   for (i = 0; i < 0x20; i++)
14321440      smsvdp->current_palette[i] = 0;
14331441

Previous 15994 Revisions Next


© 1998-2018 The MESS Team