Previous 15994 Revisions Next

r7494 Friday 5th March, 2010 at 07:59:56 UTC by Fabio Priuli
[SNES] drawing routine rewrite, part 2:
* improved hires BG drawing and removed some dead code
[src/mame/video]snes.c

src/mame/video/snes.c
r7493r7494
108108   { (96*32),  (96*32)+32,  (96*32)+64,  (96*32)+96,  (96*32)+128,  (96*32)+160,  (96*32)+192,  (96*32)+224 },
109109   { (112*32), (112*32)+32, (112*32)+64, (112*32)+96, (112*32)+128, (112*32)+160, (112*32)+192, (112*32)+224 }
110110};
111/* Scroll tables                             32x32      64x32              32x64              64x64 */
112static const UINT16 table_hscroll[4][4] = { {0,0,0,0}, {0,0x800,0,0x800}, {0,0,0,0}, {0,0x800,0,0x800} };
113static const UINT16 table_vscroll[4][4] = { {0,0,0,0}, {0,0,0,0}, {0,0x800,0,0x800}, {0,0x1000,0,0x1000} };
114111
115112struct SCANLINE
116113{
117   UINT16 buffer[(SNES_SCR_WIDTH * 2) + 16];
118   UINT8  priority[(SNES_SCR_WIDTH * 2) + 16];
119   UINT8  layer[(SNES_SCR_WIDTH * 2) + 16];
120   UINT8  blend_exception[(SNES_SCR_WIDTH * 2) + 16];
114   UINT16 buffer[(SNES_SCR_WIDTH * 2)];
115   UINT8  priority[(SNES_SCR_WIDTH * 2)];
116   UINT8  layer[(SNES_SCR_WIDTH * 2)];
117   UINT8  blend_exception[(SNES_SCR_WIDTH * 2)];
121118};
122119
123120static struct SCANLINE scanlines[2];
r7493r7494
602599      tile_line <<= 1;
603600
604601      /* below, only color_planes depends on color_depth */
605      if (tile_size)
602      if (hires)   /* Hi-Res: 2bpp & 4bpp */
606603      {
607         snes_draw_tile_x2(screen, color_planes, layer, charaddr + (tile  * 8 * color_planes) + tile_line, ii, priority, hflip, pal, direct_colors, hires);
608         ii += 16;
604         snes_draw_tile_x2(screen, color_planes, layer, charaddr + (tile  * 8 * color_planes) + tile_line, ii * 2, priority, hflip, pal, direct_colors, hires);
605         ii += 8;
609606      }
610607      else   /* tile_size = 0 */
611608      {
612         if (hires)   /* Hi-Res: 2bpp & 4bpp */
609         if (tile_size)
613610         {
614611            snes_draw_tile_x2(screen, color_planes, layer, charaddr + (tile  * 8 * color_planes) + tile_line, ii, priority, hflip, pal, direct_colors, hires);
615612            ii += 16;
r7493r7494
802799      return;
803800#endif /* SNES_LAYER_DEBUG */
804801
805   if (snes_ppu.mode == 5 || snes_ppu.mode == 6)
806      widemode = 1;
802//   if (snes_ppu.mode == 5 || snes_ppu.mode == 6)
803//      widemode = 1;
807804
808805   curline /= snes_ppu.interlace;
809806   curline *= snes_ppu.obj_interlace;
r7493r7494
11991196
12001197      for (x = 0; x < SNES_SCR_WIDTH * 2; x += 2)
12011198      {
1202         if (snes_ppu.mode != 5 && snes_ppu.mode != 6)
1199//         if (snes_ppu.mode != 5 && snes_ppu.mode != 6)
12031200         {
12041201            int r, g, b;
12051202            c = scanline->buffer[x];
r7493r7494
12291226            *BITMAP_ADDR32(bitmap, curline, (x + 1) * 2 + 1) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b));
12301227
12311228         }
1229#if 0
12321230         else
12331231         {
12341232            int r, g, b;
r7493r7494
12591257
12601258            *BITMAP_ADDR32(bitmap, curline, x + 1) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b));
12611259         }
1260#endif
12621261      }
12631262   }
12641263

Previous 15994 Revisions Next


© 1998-2018 The MESS Team