mirror of
https://github.com/holub/mame
synced 2025-07-02 00:29:37 +03:00
snes: Added basic Horizontal Mosaic effect, looks better but still not yet perfect.
This commit is contained in:
parent
0803a2bec5
commit
22e08803f4
@ -289,11 +289,26 @@ INLINE void snes_draw_tile_2(UINT8 screen, UINT8 layer, UINT16 tileaddr, INT16 x
|
|||||||
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, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
|
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
|
||||||
|
if( snes_ram[MOSAIC] & (1 << layer) ) // handle horizontal mosaic
|
||||||
|
{
|
||||||
|
int x_mos;
|
||||||
|
|
||||||
|
//TODO: 512 modes has the h values doubled.
|
||||||
|
for(x_mos = 0;x_mos < (((snes_ram[MOSAIC] & 0xf0)>>4)+1) ; x_mos++)
|
||||||
|
{
|
||||||
|
scanlines[screen].buffer[ii + x_mos] = c;
|
||||||
|
scanlines[screen].zbuf[ii + x_mos] = priority;
|
||||||
|
}
|
||||||
|
ii += x_mos - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
scanlines[screen].buffer[ii] = c;
|
scanlines[screen].buffer[ii] = c;
|
||||||
scanlines[screen].zbuf[ii] = priority;
|
scanlines[screen].zbuf[ii] = priority;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************
|
/*****************************************
|
||||||
@ -367,11 +382,25 @@ INLINE void snes_draw_tile_4(UINT8 screen, UINT8 layer, UINT16 tileaddr, INT16 x
|
|||||||
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, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
|
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
|
||||||
|
if( snes_ram[MOSAIC] & (1 << layer) ) // handle horizontal mosaic
|
||||||
|
{
|
||||||
|
int x_mos;
|
||||||
|
//TODO: 512 modes has the h values doubled.
|
||||||
|
for(x_mos = 0;x_mos < (((snes_ram[MOSAIC] & 0xf0)>>4)+1) ; x_mos++)
|
||||||
|
{
|
||||||
|
scanlines[screen].buffer[ii + x_mos] = c;
|
||||||
|
scanlines[screen].zbuf[ii + x_mos] = priority;
|
||||||
|
}
|
||||||
|
ii += x_mos - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
scanlines[screen].buffer[ii] = c;
|
scanlines[screen].buffer[ii] = c;
|
||||||
scanlines[screen].zbuf[ii] = priority;
|
scanlines[screen].zbuf[ii] = priority;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************
|
/*****************************************
|
||||||
@ -453,11 +482,26 @@ INLINE void snes_draw_tile_8(UINT8 screen, UINT8 layer, UINT16 tileaddr, INT16 x
|
|||||||
c = snes_cgram[colour];
|
c = snes_cgram[colour];
|
||||||
if( screen == MAINSCREEN ) /* Only blend main screens */
|
if( screen == MAINSCREEN ) /* Only blend main screens */
|
||||||
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
|
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
|
||||||
|
if( snes_ram[MOSAIC] & (1 << layer) ) // handle horizontal mosaic
|
||||||
|
{
|
||||||
|
int x_mos;
|
||||||
|
|
||||||
|
//TODO: 512 modes has the h values doubled.
|
||||||
|
for(x_mos = 0;x_mos < (((snes_ram[MOSAIC] & 0xf0)>>4)+1) ; x_mos++)
|
||||||
|
{
|
||||||
|
scanlines[screen].buffer[ii + x_mos] = c;
|
||||||
|
scanlines[screen].zbuf[ii + x_mos] = priority;
|
||||||
|
}
|
||||||
|
ii += x_mos - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
scanlines[screen].buffer[ii] = c;
|
scanlines[screen].buffer[ii] = c;
|
||||||
scanlines[screen].zbuf[ii] = priority;
|
scanlines[screen].zbuf[ii] = priority;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************
|
/*****************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user