Skip to content

Commit de5f284

Browse files
committed
[HALX86] Fix x86BiosCall
Properly initialize the segment registers by calling Fast486SetSegment. Fixes graphics initialization on some hardware.
1 parent 6b0ac35 commit de5f284

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hal/halx86/generic/x86bios.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,17 @@ x86BiosCall(
427427
NULL, // FpuCallback,
428428
NULL); // Tlb
429429

430-
/* Copy the registers */
430+
/* Copy the GP registers */
431431
EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Registers->Eax;
432432
EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Registers->Ebx;
433433
EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Registers->Ecx;
434434
EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Registers->Edx;
435435
EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Registers->Esi;
436436
EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Registers->Edi;
437-
EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector = Registers->SegDs;
438-
EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector = Registers->SegEs;
437+
438+
/* Initialize segment registers */
439+
Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Registers->SegDs);
440+
Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Registers->SegEs);
439441

440442
/* Set Eflags */
441443
EmulatorContext.Flags.Long = 0;

0 commit comments

Comments
 (0)