summaryrefslogtreecommitdiffstatshomepage
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
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.
-rw-r--r--src/mame/drivers/popeye.cpp28
-rw-r--r--src/mame/includes/popeye.h15
-rw-r--r--src/mame/nl.lst6
-rw-r--r--src/mame/video/popeye.cpp63
4 files changed, 86 insertions, 26 deletions
diff --git a/src/mame/drivers/popeye.cpp b/src/mame/drivers/popeye.cpp
index 06712fd4b8d..d385cc296f4 100644
--- a/src/mame/drivers/popeye.cpp
+++ b/src/mame/drivers/popeye.cpp
@@ -355,6 +355,12 @@ static INPUT_PORTS_START( skyskipr )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
+
+ PORT_START("MCONF")
+ PORT_CONFNAME( 0x03, 0x00, "Interlace mode" )
+ PORT_CONFSETTING( 0x00, "False Progressive" )
+ PORT_CONFSETTING( 0x01, "Interlaced (scanline skip)" )
+ PORT_CONFSETTING( 0x02, "Interlaced (bitmap)" )
INPUT_PORTS_END
READ_LINE_MEMBER( tnx1_state::pop_field_r )
@@ -434,6 +440,13 @@ static INPUT_PORTS_START( popeye )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
+
+ PORT_START("MCONF")
+ PORT_CONFNAME( 0x03, 0x00, "Interlace mode" )
+ PORT_CONFSETTING( 0x00, "False Progressive" )
+ PORT_CONFSETTING( 0x01, "Interlaced (scanline skip)" )
+ PORT_CONFSETTING( 0x02, "Interlaced (bitmap)" )
+
INPUT_PORTS_END
@@ -519,13 +532,14 @@ void tnx1_state::config(machine_config &config)
m_maincpu->refresh_cb().set(FUNC(tnx1_state::refresh_w));
/* video hardware */
- screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_refresh_hz(60);
- screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
- screen.set_size(32*16, 32*16);
- screen.set_visarea(0*16, 32*16-1, 2*16, 30*16-1);
- screen.set_screen_update(FUNC(tnx1_state::screen_update));
- screen.set_palette(m_palette);
+ // FIXME: 59.94 screen refresch is the NTSC standard
+ auto &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(59.94)
+ .set_vblank_time(ATTOSECONDS_IN_USEC(0))
+ .set_size(32*16, 32*16)
+ .set_visarea(0*16, 32*16-1, 2*16, 30*16-1)
+ .set_palette(m_palette)
+ .set_screen_update(FUNC(tnx1_state::screen_update));
screen.screen_vblank().set(FUNC(tnx1_state::screen_vblank));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_popeye);
diff --git a/src/mame/includes/popeye.h b/src/mame/includes/popeye.h
index de3d341a735..7b09497d135 100644
--- a/src/mame/includes/popeye.h
+++ b/src/mame/includes/popeye.h
@@ -25,7 +25,17 @@ public:
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_color_prom(*this, "proms"),
- m_color_prom_spr(*this, "sprpal")
+ m_color_prom_spr(*this, "sprpal"),
+ m_background_scroll{0,0,0},
+ m_fg_tilemap(nullptr),
+ m_palette_bank(0),
+ m_palette_bank_cache(0),
+ m_prot0(0),
+ m_prot1(0),
+ m_prot_shift(0),
+ m_dswbit(0),
+ m_nmi_enabled(false),
+ m_field(0)
{ }
DECLARE_READ_LINE_MEMBER(dsw1_read);
@@ -58,12 +68,13 @@ protected:
tilemap_t *m_fg_tilemap;
uint8_t m_palette_bank;
uint8_t m_palette_bank_cache;
- int m_field;
uint8_t m_prot0;
uint8_t m_prot1;
uint8_t m_prot_shift;
uint8_t m_dswbit;
bool m_nmi_enabled;
+ int m_field;
+ std::unique_ptr<bitmap_ind16> m_bitmap[2]; // bitmaps for fields
virtual DECLARE_WRITE8_MEMBER(refresh_w);
DECLARE_READ8_MEMBER(protection_r);
diff --git a/src/mame/nl.lst b/src/mame/nl.lst
index 06b9c762942..ae847034bcc 100644
--- a/src/mame/nl.lst
+++ b/src/mame/nl.lst
@@ -61,10 +61,16 @@ masao // bootleg
palestra
@source:popeye.cpp
+skyskipr
popeye // (c) 1982
popeyeu // (c) 1982
popeyef // (c) 1982
popeyebl // bootleg
+popeyeb2 // bootleg
+popeyeb3 // bootleg
+popeyej
+popeyejo
+popeyehs
@source:testpat.cpp
tp1983
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;
}