From bfa262e513738ff1eef70456445986ef9166f6c3 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 22 Jun 2023 11:59:39 +0200 Subject: popeye: set screen always_update flag depending on interlace config --- src/mame/nintendo/popeye.cpp | 34 ++++++++++++++++++++-------------- src/mame/nintendo/popeye.h | 14 +++++++++++++- src/mame/nintendo/popeye_v.cpp | 7 ++----- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/mame/nintendo/popeye.cpp b/src/mame/nintendo/popeye.cpp index 70b59fe3e37..c9cf6a4a7a1 100644 --- a/src/mame/nintendo/popeye.cpp +++ b/src/mame/nintendo/popeye.cpp @@ -17,10 +17,11 @@ Notes: #include "emu.h" #include "popeye.h" + #include "machine/eepromser.h" #include "machine/netlist.h" #include "netlist/devices/net_lib.h" -#include "screen.h" + #include "speaker.h" #include "nl_popeye.h" @@ -281,6 +282,11 @@ protected: }; +INPUT_CHANGED_MEMBER(tnx1_state::change_il) +{ + m_screen->set_video_attributes((newval == 2) ? VIDEO_ALWAYS_UPDATE : 0); +} + int tnx1_state::dsw1_read() { return m_io_dsw1->read() >> m_dswbit; @@ -363,13 +369,14 @@ static INPUT_PORTS_START( skyskipr ) PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) PORT_START("MCONF") - PORT_CONFNAME( 0x03, 0x00, "Interlace mode" ) + PORT_CONFNAME( 0x03, 0x00, "Interlace mode" ) PORT_CHANGED_MEMBER(DEVICE_SELF, tnx1_state, change_il, 0) PORT_CONFSETTING( 0x00, "False Progressive" ) PORT_CONFSETTING( 0x01, "Interlaced (scanline skip)" ) PORT_CONFSETTING( 0x02, "Interlaced (bitmap)" ) INPUT_PORTS_END -int tnx1_state::pop_field_r() + +int tpp1_state::pop_field_r() { return m_field ^ 1; } @@ -400,7 +407,7 @@ static INPUT_PORTS_START( popeye ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* probably unused */ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(tnx1_state, pop_field_r) // inverted init e/o signal (even odd) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(tpp1_state, pop_field_r) // inverted init e/o signal (even odd) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -448,11 +455,10 @@ static INPUT_PORTS_START( popeye ) PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) PORT_START("MCONF") - PORT_CONFNAME( 0x03, 0x00, "Interlace mode" ) + PORT_CONFNAME( 0x03, 0x00, "Interlace mode" ) PORT_CHANGED_MEMBER(DEVICE_SELF, tnx1_state, change_il, 0) PORT_CONFSETTING( 0x00, "False Progressive" ) PORT_CONFSETTING( 0x01, "Interlaced (scanline skip)" ) PORT_CONFSETTING( 0x02, "Interlaced (bitmap)" ) - INPUT_PORTS_END @@ -539,14 +545,14 @@ void tnx1_state::config(machine_config &config) /* video hardware */ // FIXME: 59.94 screen refresh 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)); + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(59.94); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(32*16, 32*16); + m_screen->set_visarea(0*16, 32*16-1, 2*16, 30*16-1); + m_screen->set_palette(m_palette); + m_screen->set_screen_update(FUNC(tnx1_state::screen_update)); + m_screen->screen_vblank().set(FUNC(tnx1_state::screen_vblank)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_popeye); PALETTE(config, m_palette, FUNC(tnx1_state::tnx1_palette), 16 + 16*2 + 8*4); diff --git a/src/mame/nintendo/popeye.h b/src/mame/nintendo/popeye.h index 6223570faab..5b285add527 100644 --- a/src/mame/nintendo/popeye.h +++ b/src/mame/nintendo/popeye.h @@ -9,7 +9,9 @@ #include "cpu/z80/z80.h" #include "sound/ay8910.h" #include "video/resnet.h" + #include "emupal.h" +#include "screen.h" #include "tilemap.h" #include @@ -23,6 +25,7 @@ public: m_aysnd(*this, "aysnd"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), + m_screen(*this, "screen"), m_dmasource(*this, "dmasource"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), @@ -42,8 +45,8 @@ public: m_field(0) { } + DECLARE_INPUT_CHANGED_MEMBER(change_il); int dsw1_read(); - int pop_field_r(); virtual void config(machine_config &config); @@ -52,6 +55,7 @@ protected: required_device m_aysnd; required_device m_gfxdecode; required_device m_palette; + required_device m_screen; required_shared_ptr m_dmasource; required_shared_ptr m_videoram; required_shared_ptr m_colorram; @@ -111,6 +115,10 @@ protected: class tpp1_state : public tnx1_state { using tnx1_state::tnx1_state; + +public: + int pop_field_r(); + protected: virtual void tnx1_palette(palette_device &palette) override; virtual void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect) override; @@ -122,8 +130,10 @@ protected: class popeyebl_state : public tpp1_state { using tpp1_state::tpp1_state; + public: virtual void config(machine_config& config) override; + protected: virtual void decrypt_rom() override; virtual void maincpu_program_map(address_map &map) override; @@ -135,8 +145,10 @@ protected: class tpp2_state : public tpp1_state { using tpp1_state::tpp1_state; + public: virtual void config(machine_config &config) override; + protected: bool m_watchdog_enabled = false; uint8_t m_watchdog_counter = 0; diff --git a/src/mame/nintendo/popeye_v.cpp b/src/mame/nintendo/popeye_v.cpp index 025fa4760a8..44427141856 100644 --- a/src/mame/nintendo/popeye_v.cpp +++ b/src/mame/nintendo/popeye_v.cpp @@ -362,11 +362,8 @@ void tnx1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) void tnx1_state::draw_field(bitmap_ind16 &bitmap, const rectangle &cliprect) { - int x; - int y; - - for (y=(cliprect.min_y & ~1) + m_field; y<=cliprect.max_y; y += 2) - for (x=cliprect.min_x; x<=cliprect.max_x; x++) + for (int y = (cliprect.min_y & ~1) + m_field; y <= cliprect.max_y; y += 2) + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) bitmap.pix(y, x) = 0; } -- cgit v1.2.3