From 913612c42bc287fb6ee51acc449c6cf30cd0fb0c Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 8 Mar 2025 18:27:52 +0100 Subject: [PATCH] nec/pc88va_v.cpp: draw sprites to odd lines when MG is 1 --- src/mame/nec/pc88va_v.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index 53dbd000393..52c2b7ee878 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -246,6 +246,7 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } + // TODO: std::function if(md) // 1bpp mode { int fg_col = (tvram[(offs + i + 6) / 2] & 0xf0) >> 4; @@ -268,19 +269,22 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) for(int x_s = 0; x_s < 16; x_s++) { int res_x = xp + x_i + x_s; - // TODO: MG actually doubles Y size int res_y = (yp + y_i) << m_tsp.spr_mg; - if (!cliprect.contains(res_x, res_y)) - continue; - const u32 data_offset = ((spda + spr_count) & 0xffff) / 2; u8 pen = (bitswap<16>(tvram[data_offset],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8) >> (15 - x_s)) & 1; pen = pen & 1 ? fg_col : (bc) ? 8 : 0; if(pen != 0) - bitmap.pix(res_y, res_x) = m_palette->pen(pen + layer_pal_bank); + { + for (int mg = 0; mg < m_tsp.spr_mg + 1; mg ++) + { + if (!cliprect.contains(res_x, res_y + mg)) + continue; + bitmap.pix(res_y + mg, res_x) = m_palette->pen(pen + layer_pal_bank); + } + } } spr_count += 2; @@ -304,16 +308,20 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) int res_x = xp + x_i + x_s; int res_y = (yp + y_i) << m_tsp.spr_mg; - if (!cliprect.contains(res_x, res_y)) - continue; - const u32 data_offset = ((spda + spr_count) & 0xffff) / 2; int pen = (bitswap<16>(tvram[data_offset],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8)) >> (12 - (x_s * 4)) & 0xf; //if (pen != 0 && pen != m_text_transpen) if (pen != 0) - bitmap.pix(res_y, res_x) = m_palette->pen(pen + layer_pal_bank); + { + for (int mg = 0; mg < m_tsp.spr_mg + 1; mg ++) + { + if (!cliprect.contains(res_x, res_y + mg)) + continue; + bitmap.pix(res_y + mg, res_x) = m_palette->pen(pen + layer_pal_bank); + } + } } spr_count += 2; @@ -725,7 +733,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli , layer_pal_bank ); -// m_graphic_bitmap[which].fill(m_palette->pen(layer_pal_bank), cliprect); +// m_graphic_bitmap[which].fill(m_palette->pen(layer_pal_bank), cliprect); m_graphic_bitmap[which].fill(0, cliprect); const int layer_inc = (!is_5bpp) + 1;