diff --git a/src/mame/video/ygv608.cpp b/src/mame/video/ygv608.cpp index 6a29eb1aea9..c6aa50353dc 100644 --- a/src/mame/video/ygv608.cpp +++ b/src/mame/video/ygv608.cpp @@ -1030,6 +1030,26 @@ inline void ygv608_device::draw_layer_roz(screen_device &screen, bitmap_ind16 &b source_tilemap->draw(screen, bitmap, cliprect, 0, 0 ); } +void ygv608_device::ygv608_draw_mosaic(bitmap_ind16 &bitmap, const rectangle &cliprect, int n) +{ + int x, y, mask; + + if (n <= 0) + { + return; + } + + // mask to drop the lowest n-bits + mask = ~((1 << n) - 1); + + for (y = cliprect.min_y; y <= cliprect.max_y; y++) + { + for (x = cliprect.min_x; x <= cliprect.max_x; x++) + { + bitmap.pix16(y, x) = bitmap.pix16(y & mask, x & mask); + } + } +} uint32_t ygv608_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { @@ -1175,6 +1195,8 @@ uint32_t ygv608_device::update_screen(screen_device &screen, bitmap_ind16 &bitma else { draw_layer_roz(screen, m_work_bitmap, finalclip, m_tilemap_B); + if(m_mosaic_bplane > 0) + ygv608_draw_mosaic(m_work_bitmap, finalclip, m_mosaic_bplane); if(m_planeB_trans_enable == true) copybitmap_trans( bitmap, m_work_bitmap, 0, 0, 0, 0, finalclip, 0); @@ -1192,6 +1214,8 @@ uint32_t ygv608_device::update_screen(screen_device &screen, bitmap_ind16 &bitma draw_sprites(bitmap, finalclip); draw_layer_roz(screen, m_work_bitmap, finalclip, m_tilemap_A); + if(m_mosaic_aplane > 0) + ygv608_draw_mosaic(m_work_bitmap, finalclip, m_mosaic_aplane); if(m_planeA_trans_enable == true) copybitmap_trans( bitmap, m_work_bitmap, 0, 0, 0, 0, finalclip, 0); @@ -1941,8 +1965,8 @@ WRITE8_MEMBER( ygv608_device::screen_ctrl_10_w ) // check mosaic m_mosaic_bplane = (data & 0xc) >> 2; m_mosaic_aplane = data & 3; - if(m_mosaic_aplane || m_mosaic_bplane) - popmessage("Mosaic effect %02x %02x",m_mosaic_aplane,m_mosaic_bplane); +// if(m_mosaic_aplane || m_mosaic_bplane) +// popmessage("Mosaic effect %02x %02x",m_mosaic_aplane,m_mosaic_bplane); } // R#11R - screen control 11 diff --git a/src/mame/video/ygv608.h b/src/mame/video/ygv608.h index 8a1fee7278c..95519c3a00d 100644 --- a/src/mame/video/ygv608.h +++ b/src/mame/video/ygv608.h @@ -127,6 +127,7 @@ private: void register_state_save(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_layer_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *source_tilemap); + void ygv608_draw_mosaic(bitmap_ind16 &bitmap, const rectangle &cliprect, int n); uint8_t m_namcond1_gfxbank;