summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-11-23 00:26:10 +0100
committer couriersud <couriersud@gmx.org>2019-11-23 00:26:10 +0100
commit069da107280ede7d0efcd5339d705eb1adbbc2c2 (patch)
treeb44fdbb43a684c0e72778a9e263dd788d3e20db9 /src/mame/video
parentbd160043519bbe15ce1ac7ac4ecaadeac6756c17 (diff)
popeye: Add interlaced rendering. [Couriersud]
- fixes MT05600 - There are now three rendering modes selectable via machine config: - false progressive: same as before. - Interlaced (scanline skip): only the current field is drawn with the other field's scanlines blacked. This gives the same flickering impression as interlaced display. - Interlaced (bitmap): Bitmap is constructed from odd and even fields. Result is comparable to PAL/NTSC videos played back on progressive displays without additional processing. - Some modernisation, all members initialized in constructor.
Diffstat (limited to 'src/mame/video')
-rw-r--r--src/mame/video/popeye.cpp63
1 files changed, 46 insertions, 17 deletions
diff --git a/src/mame/video/popeye.cpp b/src/mame/video/popeye.cpp
index ed18ca725ae..2b91492acb0 100644
--- a/src/mame/video/popeye.cpp
+++ b/src/mame/video/popeye.cpp
@@ -12,13 +12,6 @@
#include "emu.h"
#include "includes/popeye.h"
-#define USE_NEW_COLOR (1)
-
-// Only enable USE_INTERLACE if you can ensure the game is rendered at an
-// integer multiple of it's original resolution
-#define USE_INTERLACE (0)
-
-
/***************************************************************************
Convert the color PROMs into a more useable format.
@@ -52,6 +45,18 @@
The bootleg is the same, but the outputs are not inverted.
+ system11 left the following comment on mametesters:
+
+ Worth noting that there are at least 3 different types of picture output
+ for this game - and it will be difficult to make it match 'everything' out there.
+ 1) Normal Nintendo board - inverted video output
+ 2) Normal Nintendo board with non-inverted video output - has potentiometers to adjust R/G/B
+ 3) Bootleg board, non inverted non adjustable output
+
+ Additional note: Output for 1) is also adjusted by potentiometers which adjust
+ RGB. With today's bgfx hlsl filters it is easy to individually adjust
+ levels.
+
***************************************************************************/
const res_net_decode_info tnx1_state::mb7051_decode_info =
@@ -92,11 +97,7 @@ const res_net_info tnx1_state::tnx1_bak_mb7051_net_info =
{
{ RES_NET_AMP_DARLINGTON, 470, 0, 3, { 1200, 680, 470 } },
{ RES_NET_AMP_DARLINGTON, 470, 0, 3, { 1200, 680, 470 } },
-#if USE_NEW_COLOR
{ RES_NET_AMP_DARLINGTON, 680, 0, 2, { 680, 470, 0 } }
-#else
- { RES_NET_AMP_DARLINGTON, 680, 0, 2, { 1300, 470, 0 } }
-#endif
}
};
@@ -248,6 +249,9 @@ void tnx1_state::video_start()
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tnx1_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
+ m_bitmap[0] = std::make_unique<bitmap_ind16>(512, 512);
+ m_bitmap[1] = std::make_unique<bitmap_ind16>(512, 512);
+
m_field = 0;
save_item(NAME(m_field));
@@ -446,12 +450,37 @@ void tpp2_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect
uint32_t tnx1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+ const auto ilmode(ioport("MCONF")->read());
+ bitmap_ind16 &bm((ilmode == 0) ? bitmap : *m_bitmap[m_field]);
+
update_palette();
- draw_background(bitmap, cliprect);
- draw_sprites(bitmap, cliprect);
- m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
-#if USE_INTERLACE
- draw_field(bitmap, cliprect);
-#endif
+ draw_background(bm, cliprect);
+ draw_sprites(bm, cliprect);
+ m_fg_tilemap->draw(screen, bm, cliprect, 0, 0);
+ if (ilmode == 1)
+ {
+ for (int y=(cliprect.min_y); y<=cliprect.max_y; y ++)
+ {
+ if ((y & 1) == m_field)
+ for (int x=cliprect.min_x; x<=cliprect.max_x; x++)
+ bitmap.pix(y, x) = 0;
+ else
+ for (int x=cliprect.min_x; x<=cliprect.max_x; x++)
+ bitmap.pix(y, x) = bm.pix(y, x);
+ }
+ }
+ else if (ilmode == 2)
+ {
+ for (int y=(cliprect.min_y); y<=cliprect.max_y; y ++)
+ {
+ auto &bm_last(*m_bitmap[m_field ^ 1]);
+ if ((y & 1) == m_field)
+ for (int x=cliprect.min_x; x<=cliprect.max_x; x++)
+ bitmap.pix(y, x) = bm_last.pix(y, x);
+ else
+ for (int x=cliprect.min_x; x<=cliprect.max_x; x++)
+ bitmap.pix(y, x) = bm.pix(y, x);
+ }
+ }
return 0;
}