From de5f284ae3760f8ae24cb175a3ce95380571e0e5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 2 Nov 2025 09:48:58 +0200 Subject: [PATCH] [HALX86] Fix x86BiosCall Properly initialize the segment registers by calling Fast486SetSegment. Fixes graphics initialization on some hardware. --- hal/halx86/generic/x86bios.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hal/halx86/generic/x86bios.c b/hal/halx86/generic/x86bios.c index 940ded2def0..66f4dcb5015 100644 --- a/hal/halx86/generic/x86bios.c +++ b/hal/halx86/generic/x86bios.c @@ -427,15 +427,17 @@ x86BiosCall( NULL, // FpuCallback, NULL); // Tlb - /* Copy the registers */ + /* Copy the GP registers */ EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Registers->Eax; EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Registers->Ebx; EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Registers->Ecx; EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Registers->Edx; EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Registers->Esi; EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Registers->Edi; - EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector = Registers->SegDs; - EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector = Registers->SegEs; + + /* Initialize segment registers */ + Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Registers->SegDs); + Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Registers->SegEs); /* Set Eflags */ EmulatorContext.Flags.Long = 0;