From 97cfbb41a1e42fa2fc87ab84894e16b06c3e6486 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 13 Jul 2025 07:55:49 +0200 Subject: [PATCH] XGA: Blitting direction does not affect the order of the bits in memory, fixes the IBM Windows 3.1 XGA driver. --- src/video/vid_xga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index a6c498135..f8698ade7 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -993,12 +993,10 @@ xga_accel_read_pattern_map_pixel(svga_t *svga, int x, int y, uint32_t base, int uint8_t byte; uint8_t px; int skip = 0; - int x_dir = (xga->accel.octant & 0x04) ? -1 : 1; - int y_dir = (xga->accel.octant & 0x02) ? -1 : 1; - int pos = ((y * width * y_dir) + (x * x_dir)); + int pos = (y * width) + x; addr += (pos / 8); - bits = 7 - (abs(pos) & 7); + bits = 7 - (pos & 7); if ((addr < xga->linear_base) || (addr > (xga->linear_base + 0xfffff))) skip = 1;