diff --git a/src/mame/includes/sms.h b/src/mame/includes/sms.h index ec9ae68..556652c 100644 --- a/src/mame/includes/sms.h +++ b/src/mame/includes/sms.h @@ -92,10 +92,6 @@ public: bitmap_rgb32 m_prevleft_bitmap; bitmap_rgb32 m_prevright_bitmap; - // for gamegear LCD persistence hack - bitmap_rgb32 m_prev_bitmap; - bool m_prev_bitmap_copied; - // for gamegear SMS mode scaling bitmap_rgb32 m_gg_sms_mode_bitmap; // line_buffer will be used to hold 4 lines of line data as a kind of cache for diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index bf50bb1..30db83e 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -1301,24 +1301,15 @@ UINT32 sms_state::screen_update_sms(screen_device &screen, bitmap_rgb32 &bitmap, VIDEO_START_MEMBER(sms_state,gamegear) { - m_prev_bitmap_copied = false; - m_main_scr->register_screen_bitmap(m_prev_bitmap); m_main_scr->register_screen_bitmap(m_gg_sms_mode_bitmap); m_line_buffer = std::make_unique(160 * 4); - save_item(NAME(m_prev_bitmap_copied)); - save_item(NAME(m_prev_bitmap)); save_item(NAME(m_gg_sms_mode_bitmap)); save_pointer(NAME(m_line_buffer.get()), 160 * 4); } VIDEO_RESET_MEMBER(sms_state,gamegear) { - if (m_prev_bitmap_copied) - { - m_prev_bitmap.fill(rgb_t::black); - m_prev_bitmap_copied = false; - } if (m_cartslot->exists() && m_cartslot->m_cart->get_sms_mode()) { m_gg_sms_mode_bitmap.fill(rgb_t::black); @@ -1478,47 +1469,7 @@ UINT32 sms_state::screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bi source_bitmap = &m_vdp->get_bitmap(); } - if (!m_port_persist->read()) - { - copybitmap(bitmap, *source_bitmap, 0, 0, 0, 0, cliprect); - if (m_prev_bitmap_copied) - { - m_prev_bitmap.fill(rgb_t::black); - m_prev_bitmap_copied = false; - } - } - else if (!m_prev_bitmap_copied) - { - copybitmap(bitmap, *source_bitmap, 0, 0, 0, 0, cliprect); - copybitmap(m_prev_bitmap, *source_bitmap, 0, 0, 0, 0, cliprect); - m_prev_bitmap_copied = true; - } - else - { - // HACK: fake LCD persistence effect - // (it would be better to generalize this in the core, to be used for all LCD systems) - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - UINT32 *linedst = &bitmap.pix32(y); - UINT32 *line0 = &source_bitmap->pix32(y); - UINT32 *line1 = &m_prev_bitmap.pix32(y); - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) - { - UINT32 color0 = line0[x]; - UINT32 color1 = line1[x]; - UINT16 r0 = (color0 >> 16) & 0x000000ff; - UINT16 g0 = (color0 >> 8) & 0x000000ff; - UINT16 b0 = (color0 >> 0) & 0x000000ff; - UINT16 r1 = (color1 >> 16) & 0x000000ff; - UINT16 g1 = (color1 >> 8) & 0x000000ff; - UINT16 b1 = (color1 >> 0) & 0x000000ff; - UINT8 r = (UINT8)((r0 + r1) >> 1); - UINT8 g = (UINT8)((g0 + g1) >> 1); - UINT8 b = (UINT8)((b0 + b1) >> 1); - linedst[x] = (r << 16) | (g << 8) | b; - } - } - copybitmap(m_prev_bitmap, *source_bitmap, 0, 0, 0, 0, cliprect); - } + copybitmap(bitmap, *source_bitmap, 0, 0, 0, 0, cliprect); + return 0; } diff --git a/src/mame/video/tia.cpp b/src/mame/video/tia.cpp index c616ce6..3fcd707 100644 --- a/src/mame/video/tia.cpp +++ b/src/mame/video/tia.cpp @@ -429,9 +429,7 @@ void tia_video_device::device_start() int cx = m_screen->width(); screen_height = m_screen->height(); - helper[0] = std::make_unique(cx, TIA_MAX_SCREEN_HEIGHT); - helper[1] = std::make_unique(cx, TIA_MAX_SCREEN_HEIGHT); - helper[2] = std::make_unique(cx, TIA_MAX_SCREEN_HEIGHT); + screen_bitmap = std::make_unique(cx, TIA_MAX_SCREEN_HEIGHT); register_save_state(); } @@ -444,7 +442,7 @@ void tia_video_device::device_start() UINT32 tia_video_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_height = screen.height(); - copybitmap(bitmap, *helper[2], 0, 0, 0, 0, cliprect); + copybitmap(bitmap, *screen_bitmap, 0, 0, 0, 0, cliprect); return 0; } @@ -980,31 +978,12 @@ void tia_video_device::update_bitmap(int next_x, int next_y) if (collision_check(lineM0, lineM1, colx1, x2)) CXPPMM |= 0x40; - p = &helper[current_bitmap]->pix16(y % screen_height, 34); + p = &screen_bitmap->pix16(y % screen_height, 34); for (x = x1; x < x2; x++) { p[x] = temp[x]; } - - if ( x2 == 160 && y % screen_height == (screen_height - 1) ) { - int t_y; - for ( t_y = 0; t_y < helper[2]->height(); t_y++ ) { - UINT16* l0 = &helper[current_bitmap]->pix16(t_y); - UINT16* l1 = &helper[1 - current_bitmap]->pix16(t_y); - UINT16* l2 = &helper[2]->pix16(t_y); - int t_x; - for( t_x = 0; t_x < helper[2]->width(); t_x++ ) { - if ( l0[t_x] != l1[t_x] ) { - /* Combine both entries */ - l2[t_x] = ( ( l0[t_x] + 1 ) << 7 ) | l1[t_x]; - } else { - l2[t_x] = l0[t_x]; - } - } - } - current_bitmap ^= 1; - } } prev_x = next_x; @@ -1349,7 +1328,7 @@ WRITE8_MEMBER( tia_video_device::HMOVE_w ) } if (curr_y < screen_height) { - memset(&helper[current_bitmap]->pix16(curr_y, 34), 0, 16); + memset(&screen_bitmap->pix16(curr_y, 34), 0, 16); } prev_x = 8; @@ -2143,8 +2122,6 @@ void tia_video_device::device_reset() p1gfx.size[i] = 1; } - current_bitmap = 0; - NUSIZx_changed = 0; VBLANK = 0; @@ -2213,7 +2190,6 @@ void tia_video_device::register_save_state() save_item(NAME(skipclipP1)); save_item(NAME(skipM0delay)); save_item(NAME(skipM1delay)); - save_item(NAME(current_bitmap)); save_item(NAME(prev_x)); save_item(NAME(prev_y)); save_item(NAME(VSYNC)); diff --git a/src/mame/video/tia.h b/src/mame/video/tia.h index 4ed1797..f4f3236 100644 --- a/src/mame/video/tia.h +++ b/src/mame/video/tia.h @@ -139,8 +139,6 @@ private: int skipM0delay; int skipM1delay; - int current_bitmap; - int prev_x; int prev_y; @@ -198,7 +196,7 @@ private: UINT8 REFLECT; /* Should playfield be reflected or not */ UINT8 NUSIZx_changed; - std::unique_ptr helper[3]; + std::unique_ptr screen_bitmap; UINT16 screen_height;