hd63484: Add external skew kludge to prevent display cutoff in kothello

This commit is contained in:
AJR 2018-02-21 19:48:04 -05:00
parent bac8c7fa9b
commit 03178a2e75
3 changed files with 13 additions and 4 deletions

View File

@ -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)
{

View File

@ -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];

View File

@ -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")