Previous 15994 Revisions Next

r5432 Friday 14th August, 2009 at 17:27:00 UTC by Angelo Salese
[SNES]: Fixed a blending bug involving main/sub color maths
[src/mame/video]snes.c

src/mame/video/snes.c
r5431r5432
152152      (clip == SNES_CLIP_OUT && snes_ppu.clipmasks[5][offset]) )
153153   {
154154      UINT16 r, g, b;
155
155156      if( mode == SNES_BLEND_ADD )
156157      {
157158         if( snes_ppu.sub_add_mode ) /* Subscreen*/
r5431r5432
159160            r = (*colour & 0x1f) + (scanlines[SUBSCREEN].buffer[offset] & 0x1f);
160161            g = ((*colour & 0x3e0) >> 5) + ((scanlines[SUBSCREEN].buffer[offset] & 0x3e0) >> 5);
161162            b = ((*colour & 0x7c00) >> 10) + ((scanlines[SUBSCREEN].buffer[offset] & 0x7c00) >> 10);
162            if( (snes_ram[CGADSUB] & 0x40) && (scanlines[SUBSCREEN].zbuf[offset]) ) /* FIXME: We shouldn't halve for the back colour */
163            if( (snes_ram[CGADSUB] & 0x40) && (scanlines[SUBSCREEN].buffer[offset]) ) /* FIXME: We shouldn't halve for the back colour */
163164            {
164165               r >>= 1;
165166               g >>= 1;
r5431r5432
193194            if( r > 0x1f ) r = 0;
194195            if( g > 0x1f ) g = 0;
195196            if( b > 0x1f ) b = 0;
196            if( (snes_ram[CGADSUB] & 0x40) && (scanlines[SUBSCREEN].zbuf[offset]) ) /* FIXME: We shouldn't halve for the back colour */
197            if( (snes_ram[CGADSUB] & 0x40) && (scanlines[SUBSCREEN].buffer[offset]) ) /* FIXME: We shouldn't halve for the back colour */
197198            {
198199               r >>= 1;
199200               g >>= 1;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team