summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2009-07-19 17:08:46 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2009-07-19 17:08:46 +0000
commit22e08803f4f1a705430e2f08a3e0c4f528a0e095 (patch)
tree96bcfc0503f944ba0510ff834dc6c3448f0e8f0d
parent0803a2bec596a558dc25992765856060f98bb670 (diff)
snes: Added basic Horizontal Mosaic effect, looks better but still not yet perfect.
-rw-r--r--src/mame/video/snes.c56
1 files changed, 50 insertions, 6 deletions
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c
index 3b44d4d5175..588b112ef39 100644
--- a/src/mame/video/snes.c
+++ b/src/mame/video/snes.c
@@ -289,8 +289,23 @@ INLINE void snes_draw_tile_2(UINT8 screen, UINT8 layer, UINT16 tileaddr, INT16 x
c = snes_cgram[pal + colour];
if( screen == MAINSCREEN ) /* Only blend main screens */
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
- scanlines[screen].buffer[ii] = c;
- scanlines[screen].zbuf[ii] = priority;
+ 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].zbuf[ii] = priority;
+ }
}
}
}
@@ -367,8 +382,22 @@ INLINE void snes_draw_tile_4(UINT8 screen, UINT8 layer, UINT16 tileaddr, INT16 x
c = snes_cgram[pal + colour];
if( screen == MAINSCREEN ) /* Only blend main screens */
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
- scanlines[screen].buffer[ii] = c;
- scanlines[screen].zbuf[ii] = priority;
+ 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].zbuf[ii] = priority;
+ }
}
}
}
@@ -453,8 +482,23 @@ INLINE void snes_draw_tile_8(UINT8 screen, UINT8 layer, UINT16 tileaddr, INT16 x
c = snes_cgram[colour];
if( screen == MAINSCREEN ) /* Only blend main screens */
snes_draw_blend(ii, &c, snes_ppu.layer[layer].blend, (snes_ram[CGWSEL] & 0x30) >> 4 );
- scanlines[screen].buffer[ii] = c;
- scanlines[screen].zbuf[ii] = priority;
+ 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].zbuf[ii] = priority;
+ }
}
}
}