On Tue, Mar 12, 2024 at 09:09:23PM -0700, Daniel Verkamp wrote:
On Tue, Mar 12, 2024 at 7:55 AM Kevin O'Connor kevin@koconnor.net wrote:
On Mon, Mar 11, 2024 at 08:26:18PM -0700, Daniel Verkamp wrote:
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
V2: use existing stdvga_dac_read/write() functions
Thanks. How about the below instead? This alternate version checks for CONFIG_VGA_STDVGA_PORTS up front, uses GET/SET_FARVAR(), and directly calls stdvga_dac_read/write() (as vgabios.c does). I don't have a good way to test this.
-Kevin
The alternate version looks good to me and works in my testing. I'm using the freely-available shareware version of Quake (https://archive.org/details/Quake_802) with FreeDOS, if you would like to reproduce the results.
Thanks, I removed the unnecessary call to debug_stub() that I added, and I committed this change.
-Kevin