ati-vga: Fix frame buffer endianness for big endian target

The extended mode frame buffer should be little endian even when
emulating big endian machine (such as PPC). This fixes color problems
with MorphOS.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: 439aa85061f103446df7b42632d730971a372432.1562151410.git.balaton@eik.bme.hu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
BALATON Zoltan 2019-07-03 12:56:50 +02:00 committed by Gerd Hoffmann
parent c799d2ee7e
commit a38127414b
2 changed files with 6 additions and 5 deletions

View File

@ -89,6 +89,7 @@ static void ati_vga_switch_mode(ATIVGAState *s)
DPRINTF("Switching to %dx%d %d %d @ %x\n", h, v, stride, bpp, offs); DPRINTF("Switching to %dx%d %d %d @ %x\n", h, v, stride, bpp, offs);
vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_ENABLE); vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_ENABLE);
vbe_ioport_write_data(&s->vga, 0, VBE_DISPI_DISABLED); vbe_ioport_write_data(&s->vga, 0, VBE_DISPI_DISABLED);
s->vga.big_endian_fb = false;
/* reset VBE regs then set up mode */ /* reset VBE regs then set up mode */
s->vga.vbe_regs[VBE_DISPI_INDEX_XRES] = h; s->vga.vbe_regs[VBE_DISPI_INDEX_XRES] = h;
s->vga.vbe_regs[VBE_DISPI_INDEX_YRES] = v; s->vga.vbe_regs[VBE_DISPI_INDEX_YRES] = v;

View File

@ -124,15 +124,15 @@ void ati_2d_blt(ATIVGAState *s)
switch (s->regs.dp_mix & GMC_ROP3_MASK) { switch (s->regs.dp_mix & GMC_ROP3_MASK) {
case ROP3_PATCOPY: case ROP3_PATCOPY:
filler = bswap32(s->regs.dp_brush_frgd_clr); filler = s->regs.dp_brush_frgd_clr;
break; break;
case ROP3_BLACKNESS: case ROP3_BLACKNESS:
filler = rgb_to_pixel32(s->vga.palette[0], s->vga.palette[1], filler = 0xffUL << 24 | rgb_to_pixel32(s->vga.palette[0],
s->vga.palette[2]) << 8 | 0xff; s->vga.palette[1], s->vga.palette[2]);
break; break;
case ROP3_WHITENESS: case ROP3_WHITENESS:
filler = rgb_to_pixel32(s->vga.palette[3], s->vga.palette[4], filler = 0xffUL << 24 | rgb_to_pixel32(s->vga.palette[3],
s->vga.palette[5]) << 8 | 0xff; s->vga.palette[4], s->vga.palette[5]);
break; break;
} }