]> xenbits.xensource.com Git - seabios.git/commit
vbe: implement function 09h (get/set palette data)
authorDaniel Verkamp <daniel@drv.nu>
Tue, 12 Mar 2024 03:26:18 +0000 (20:26 -0700)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 15 Mar 2024 14:27:52 +0000 (10:27 -0400)
commit192e23b78418abc23a92a7174ae2294fabe4b8a3
tree7f2da3085815b1118794db01db823328d95ed9d3
parent3722c21de19ba64de56495502c0c025b913a9b15
vbe: implement function 09h (get/set palette data)

Since the VBE mode attributes indicate that all modes are not VGA
compatible, applications must use VBE function 09h to manipulate the
palette rather than directly accessing the VGA registers.

This implementation uses the standard VGA registers for all hardware,
which may not be appropriate; I only verified qemu -device VGA.

Without this patch, the get/set palette function returns an error code,
so programs that use 8-bit indexed color modes fail. For example, Quake
(DOS) printed "Error: Unable to load VESA palette" and exited when
trying to set a SVGA mode like 640x480, but with the patch it succeeds.
This fixes qemu issue #251 and #1862.

<https://gitlab.com/qemu-project/qemu/-/issues/251>
<https://gitlab.com/qemu-project/qemu/-/issues/1862>

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/vbe.c