[SNES] minor change: converted color clipping to use struct entries

This commit is contained in:
Fabio Priuli 2009-08-16 11:41:53 +00:00
parent 4a20d195df
commit 100afe3a03

View File

@ -290,7 +290,7 @@ INLINE void snes_draw_tile(UINT8 screen, UINT8 planes, UINT8 layer, UINT16 tilea
c = snes_cgram[pal + colour]; c = snes_cgram[pal + colour];
if (screen == MAINSCREEN) /* Only blend main screens */ if (screen == MAINSCREEN) /* Only blend main screens */
snes_draw_blend(ii/snes_htmult, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4, (snes_ram[CGWSEL] & 0xc0) >> 6); snes_draw_blend(ii/snes_htmult, &c, snes_ppu.layer[layer].blend, snes_ppu.sub_color_mask, snes_ppu.main_color_mask);
if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic
{ {
int x_mos; int x_mos;
@ -390,7 +390,7 @@ INLINE void snes_draw_tile_object(UINT8 screen, UINT16 tileaddr, INT16 x, UINT8
{ {
c = snes_cgram[pal + colour]; c = snes_cgram[pal + colour];
if (blend && screen == MAINSCREEN) /* Only blend main screens */ if (blend && screen == MAINSCREEN) /* Only blend main screens */
snes_draw_blend(ii/snes_htmult, &c, snes_ppu.layer[4].blend, (snes_ram[CGWSEL] & 0x30) >> 4, (snes_ram[CGWSEL] & 0xc0) >> 6); snes_draw_blend(ii/snes_htmult, &c, snes_ppu.layer[4].blend, snes_ppu.sub_color_mask, snes_ppu.main_color_mask);
scanlines[screen].buffer[ii] = c; scanlines[screen].buffer[ii] = c;
scanlines[screen].zbuf[ii] = priority; scanlines[screen].zbuf[ii] = priority;
@ -720,7 +720,7 @@ static void snes_update_line_mode7(UINT8 screen, UINT8 priority_a, UINT8 priorit
clr = snes_cgram[colour]; clr = snes_cgram[colour];
/* Only blend main screens */ /* Only blend main screens */
if (screen == MAINSCREEN) if (screen == MAINSCREEN)
snes_draw_blend(xpos, &clr, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4, (snes_ram[CGWSEL] & 0xc0) >> 6); /* FIXME: Need to support clip mode */ snes_draw_blend(xpos, &clr, snes_ppu.layer[layer].blend, snes_ppu.sub_color_mask, snes_ppu.main_color_mask);
scanlines[screen].buffer[xpos] = clr; scanlines[screen].buffer[xpos] = clr;
scanlines[screen].zbuf[xpos] = priority; scanlines[screen].zbuf[xpos] = priority;
@ -1191,7 +1191,7 @@ static void snes_refresh_scanline( running_machine *machine, bitmap_t *bitmap, U
{ {
for(ii = 0; ii < SNES_SCR_WIDTH * snes_htmult; ii++) for(ii = 0; ii < SNES_SCR_WIDTH * snes_htmult; ii++)
{ {
snes_draw_blend(ii/snes_htmult, &scanlines[MAINSCREEN].buffer[ii], (snes_ram[CGADSUB] & 0x80) ? SNES_BLEND_SUB : SNES_BLEND_ADD, (snes_ram[CGWSEL] & 0x30) >> 4, (snes_ram[CGWSEL] & 0xc0) >> 6); snes_draw_blend(ii/snes_htmult, &scanlines[MAINSCREEN].buffer[ii], (snes_ram[CGADSUB] & 0x80) ? SNES_BLEND_SUB : SNES_BLEND_ADD, snes_ppu.sub_color_mask, snes_ppu.main_color_mask);
} }
} }