From 636ef261349705ac74672809f1cddbd9e5a1fc7b Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 10 Nov 2024 14:02:55 +0100 Subject: video/upd7220.cpp: backport pitch shift from pc9821 PEGC * fix pc9821:os2warp3 installation & chkdsk screens --- src/devices/video/upd7220.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index 9193350e928..8e0d9fe919a 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -1852,6 +1852,9 @@ void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &clip LOGAREA("%s: AREA=%d BSY=%4d SAD=%06x len=%04x im=%d wd=%d\n", this->tag(), area, bsy, sad, len, im, wd); + // pc9821:aitd (256 color mode) and pc9821:os2warp3 (16, installation screens) wants this shift + const u8 pitch_shift = force_bitmap ? im : mixed; + if(im || force_bitmap) { // according to documentation only areas 0-1-2 can be drawn in bitmap mode @@ -1879,14 +1882,14 @@ void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &clip // pc98 quarth doesn't seem to use pitch here and it definitely wants bsy to be /2 to make scrolling to work. // pc98 xevious wants the pitch to be fixed at 80, and wants bsy to be /1 // pc98 dbuster contradicts with Xevious with regards of the pitch tho ... - uint32_t const addr = (sad & 0x3ffff) + ((y / (mixed ? 1 : m_lr)) * (m_pitch >> mixed)); + uint32_t const addr = (sad & 0x3ffff) + ((y / (mixed ? 1 : m_lr)) * (m_pitch >> pitch_shift)); for(int z = 0; z <= m_disp; ++z) { int yval = (y*zoom)+z + (bsy + m_vbp); // pc9801:duel sets up bitmap layer with height 384 vs. 400 of text layer // so we scissor here, interlace wants it bumped x2 (microbx2) if(yval <= cliprect.bottom() && (yval - m_vbp) < m_al << interlace) - draw_graphics_line(bitmap, addr, yval, wd, mixed); + draw_graphics_line(bitmap, addr, yval, wd, pitch_shift); } } } -- cgit v1.2.3