From c0f6452c11740862861329d02ca705565d00baa9 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 23 Nov 2017 14:20:07 -0500 Subject: vmetal: Workaround for recent video regression (nw) --- src/devices/video/imagetek_i4100.cpp | 14 +++++++++++--- src/devices/video/imagetek_i4100.h | 7 ++++++- src/mame/drivers/metro.cpp | 5 +++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp index ad6973d4ec7..565dfda76cd 100644 --- a/src/devices/video/imagetek_i4100.cpp +++ b/src/devices/video/imagetek_i4100.cpp @@ -211,10 +211,9 @@ imagetek_i4100_device::imagetek_i4100_device(const machine_config &mconfig, devi , m_blit_irq_cb(*this) , m_support_8bpp( has_ext_tiles ) , m_support_16x16( has_ext_tiles ) + , m_tilemap_scrolldx{0, 0, 0} + , m_tilemap_scrolldy{0, 0, 0} { - m_tilemap_scrolldx[0] = 0; - m_tilemap_scrolldx[1] = 0; - m_tilemap_scrolldx[2] = 0; } imagetek_i4100_device::imagetek_i4100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -263,6 +262,14 @@ void imagetek_i4100_device::static_set_tmap_xoffsets(device_t &device, int x1, i } +void imagetek_i4100_device::static_set_tmap_yoffsets(device_t &device, int y1, int y2, int y3) +{ + downcast(device).m_tilemap_scrolldy[0] = y1; + downcast(device).m_tilemap_scrolldy[1] = y2; + downcast(device).m_tilemap_scrolldy[2] = y3; +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -1065,6 +1072,7 @@ void imagetek_i4100_device::draw_tilemap( screen_device &screen, bitmap_ind16 &b int windowheight = height >> 3; sx += m_tilemap_scrolldx[layer] * (m_screen_flip ? 1 : -1); + sy += m_tilemap_scrolldy[layer] * (m_screen_flip ? 1 : -1); for (y = 0; y < scrheight; y++) { diff --git a/src/devices/video/imagetek_i4100.h b/src/devices/video/imagetek_i4100.h index f858353c87b..1aeb2634be6 100644 --- a/src/devices/video/imagetek_i4100.h +++ b/src/devices/video/imagetek_i4100.h @@ -26,7 +26,10 @@ #define MCFG_I4100_TILEMAP_XOFFSETS(_a, _b, _c) \ imagetek_i4100_device::static_set_tmap_xoffsets(*device, _a, _b, _c); - + +#define MCFG_I4100_TILEMAP_YOFFSETS(_a, _b, _c) \ + imagetek_i4100_device::static_set_tmap_yoffsets(*device, _a, _b, _c); + //************************************************************************** // TYPE DEFINITIONS @@ -45,6 +48,7 @@ public: static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_tmap_xoffsets(device_t &device, int x1, int x2, int x3); + static void static_set_tmap_yoffsets(device_t &device, int y1, int y2, int y3); template static devcb_base &static_set_blitter_irq_callback(device_t &device, Object &&cb) { return downcast(device).m_blit_irq_cb.set_callback(std::forward(cb)); } @@ -148,6 +152,7 @@ protected: bool m_screen_flip; const bool m_support_8bpp, m_support_16x16; int m_tilemap_scrolldx[3]; + int m_tilemap_scrolldy[3]; void blt_write( address_space &space, const int tmap, const offs_t offs, const uint16_t data, const uint16_t mask ); diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp index ab6e7447679..6c14e0104ed 100644 --- a/src/mame/drivers/metro.cpp +++ b/src/mame/drivers/metro.cpp @@ -3632,10 +3632,11 @@ static MACHINE_CONFIG_START( vmetal ) /* video hardware */ MCFG_FRAGMENT_ADD( i4220_config_304x224 ) - + MCFG_DEVICE_MODIFY("vdp2") MCFG_I4100_TILEMAP_XOFFSETS(-16,-16,-16) - + MCFG_I4100_TILEMAP_YOFFSETS(-16,-16,-16) + /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") -- cgit v1.2.3