From d773ab41c5e47aaa6e741ba4a1ad2ed9347ffc9e Mon Sep 17 00:00:00 2001 From: Couriersud Date: Fri, 12 Feb 2010 23:18:36 +0000 Subject: [PATCH] Fix compile error on OSX DEBUG=1 build --- src/mame/video/snes.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c index 2b3302d5871..5ac06841620 100644 --- a/src/mame/video/snes.c +++ b/src/mame/video/snes.c @@ -158,22 +158,23 @@ INLINE void snes_draw_blend(UINT16 offset, UINT16 *colour, UINT8 factor, UINT8 c if (snes_ppu.sub_add_mode) /* SNES_SUBSCREEN*/ { - switch (snes_ppu.color_modes & 0x80) + if (snes_ppu.color_modes & 0x80 == 0x00) { - case 0x00: /* add */ + /* add */ r = (*colour & 0x1f) + (scanlines[SNES_SUBSCREEN].buffer[offset] & 0x1f); g = ((*colour & 0x3e0) >> 5) + ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x3e0) >> 5); b = ((*colour & 0x7c00) >> 10) + ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x7c00) >> 10); clip_max = 1; - break; - case 0x80: /* sub */ + } + else + { + /* 0x80 sub */ r = (*colour & 0x1f) - (scanlines[SNES_SUBSCREEN].buffer[offset] & 0x1f); g = ((*colour & 0x3e0) >> 5) - ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x3e0) >> 5); b = ((*colour & 0x7c00) >> 10) - ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x7c00) >> 10); if (r > 0x1f) r = 0; if (g > 0x1f) g = 0; if (b > 0x1f) b = 0; - break; } /* only halve if the color is not the back colour */ if ((snes_ppu.color_modes & 0x40) && (scanlines[SNES_SUBSCREEN].buffer[offset] != snes_cgram[FIXED_COLOUR])) @@ -185,22 +186,23 @@ INLINE void snes_draw_blend(UINT16 offset, UINT16 *colour, UINT8 factor, UINT8 c } else /* Fixed colour */ { - switch (snes_ppu.color_modes & 0x80) + if (snes_ppu.color_modes & 0x80 == 0x00) { - case 0x00: /* add */ + /* add */ r = (*colour & 0x1f) + (snes_cgram[FIXED_COLOUR] & 0x1f); g = ((*colour & 0x3e0) >> 5) + ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5); b = ((*colour & 0x7c00) >> 10) + ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10); clip_max = 1; - break; - case 0x80: /* sub */ + } + else + { + /* 0x80: sub */ r = (*colour & 0x1f) - (snes_cgram[FIXED_COLOUR] & 0x1f); g = ((*colour & 0x3e0) >> 5) - ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5); b = ((*colour & 0x7c00) >> 10) - ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10); if (r > 0x1f) r = 0; if (g > 0x1f) g = 0; if (b > 0x1f) b = 0; - break; } /* halve if necessary */ if (snes_ppu.color_modes & 0x40)