summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-02-21 19:48:04 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-02-21 19:48:06 -0500
commit03178a2e75dde8d9550bbb60275e116d4c0f0188 (patch)
tree472aeb1d7f0d7ef7506628a06f0e628a45c54e29
parentbac8c7fa9b95dac2ef56957e3708d83cb801b4fb (diff)
hd63484: Add external skew kludge to prevent display cutoff in kothello
-rw-r--r--src/devices/video/hd63484.cpp11
-rw-r--r--src/devices/video/hd63484.h5
-rw-r--r--src/mame/drivers/shanghai.cpp1
3 files changed, 13 insertions, 4 deletions
diff --git a/src/devices/video/hd63484.cpp b/src/devices/video/hd63484.cpp
index 7db29a13052..873904d3793 100644
--- a/src/devices/video/hd63484.cpp
+++ b/src/devices/video/hd63484.cpp
@@ -29,6 +29,7 @@ hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, d
device_memory_interface(mconfig, *this),
device_video_interface(mconfig, *this),
m_auto_configure_screen(true),
+ m_external_skew(0),
m_ar(0),
m_sr(0),
m_fifo_ptr(-1),
@@ -525,11 +526,12 @@ inline void hd63484_device::recompute_parameters()
int ppw = 16 / get_bpp();
int ppmc = ppw * (1 << gai) / acm; // TODO: GAI > 3
int vbstart = m_vds + m_sp[1];
+ int hbend = (m_hsw + m_hds + m_external_skew) * ppmc;
if (BIT(m_dcr, 13)) vbstart += m_sp[0];
if (BIT(m_dcr, 11)) vbstart += m_sp[2];
rectangle visarea = screen().visible_area();
- visarea.set((m_hsw + m_hds) * ppmc, (m_hsw + m_hds + m_hdw) * ppmc - 1, m_vds, vbstart - 1);
+ visarea.set(hbend, hbend + (m_hdw * ppmc) - 1, m_vds, vbstart - 1);
attoseconds_t frame_period = screen().frame_period().attoseconds(); // TODO: use clock() to calculate the frame_period
screen().configure(m_hc * ppmc, m_vc, visarea, frame_period);
}
@@ -1827,6 +1829,7 @@ void hd63484_device::video_registers_w(int offset)
break;
case 0x04:
+ logerror("OMR: %04x\n", vreg_data);
m_omr = vreg_data;
break;
@@ -2052,12 +2055,12 @@ void hd63484_device::draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &c
int bpp = get_bpp();
int ppw = 16 / bpp;
uint32_t mask = (1 << bpp) - 1;
- uint32_t base_offs = m_sar[layer_n] + (y - vs) * m_mwr[layer_n];
- uint32_t wind_offs = m_sar[3] + (y - m_vws) * m_mwr[3];
+ uint32_t base_offs = m_sar[layer_n] + (y - vs) * m_mwr[layer_n] + m_external_skew;
+ uint32_t wind_offs = m_sar[3] + (y - m_vws) * m_mwr[3] + m_external_skew;
int step = (m_omr & 0x08) ? 2 : 1;
int gai = (m_omr>>4) & 0x07;
int ppmc = ppw * (1 << gai) / step; // TODO: GAI > 3
- int ws = m_hsw + m_hws;
+ int ws = m_hsw + m_hws + m_external_skew;
if (m_omr & 0x08)
{
diff --git a/src/devices/video/hd63484.h b/src/devices/video/hd63484.h
index 8ea0f4110ed..7188f4ae1f8 100644
--- a/src/devices/video/hd63484.h
+++ b/src/devices/video/hd63484.h
@@ -33,6 +33,9 @@
#define HD63484_DISPLAY_PIXELS_MEMBER(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int x, uint16_t data)
+#define MCFG_HD63484_EXTERNAL_SKEW(_val) \
+ hd63484_device::static_set_external_skew(*device, _val);
+
// ======================> hd63484_device
@@ -48,6 +51,7 @@ public:
static void static_set_display_callback(device_t &device, display_delegate &&cb) { downcast<hd63484_device &>(device).m_display_cb = std::move(cb); }
static void static_set_auto_configure_screen(device_t &device, bool auto_configure_screen) { downcast<hd63484_device &>(device).m_auto_configure_screen = auto_configure_screen; }
+ static void static_set_external_skew(device_t &device, int skew) { downcast<hd63484_device &>(device).m_external_skew = skew; }
DECLARE_WRITE16_MEMBER( address16_w );
DECLARE_WRITE16_MEMBER( data16_w );
@@ -115,6 +119,7 @@ private:
display_delegate m_display_cb;
bool m_auto_configure_screen;
+ int m_external_skew;
uint8_t m_ar;
uint8_t m_vreg[0x100];
diff --git a/src/mame/drivers/shanghai.cpp b/src/mame/drivers/shanghai.cpp
index f0b466bb8cb..1213adeb016 100644
--- a/src/mame/drivers/shanghai.cpp
+++ b/src/mame/drivers/shanghai.cpp
@@ -484,6 +484,7 @@ MACHINE_CONFIG_START(shanghai_state::kothello)
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
MCFG_HD63484_ADD("hd63484", 0, hd63484_map)
+ MCFG_HD63484_EXTERNAL_SKEW(2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")