Skip to content

[WIP] feature: VESA VBE 1.2#1983

Merged
maximilien-noal merged 2 commits intofeat/VBE_VESA_1.2from
copilot/sub-pr-1587-again
Mar 16, 2026
Merged

[WIP] feature: VESA VBE 1.2#1983
maximilien-noal merged 2 commits intofeat/VBE_VESA_1.2from
copilot/sub-pr-1587-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 16, 2026

Description of Changes

Implements VESA BIOS Extension (VBE) 1.2 support for the VGA BIOS, enabling Super VGA modes for games like Rules of Engagement 2. Addresses reviewer feedback from the initial implementation:

  • BIOS-owned OEM string & mode list: VbeGetControllerInfo previously wrote OEM string and mode list beyond the caller's 256-byte buffer (overflow risk) and computed far pointers via (ushort)(DI + offset) (wraparound if DI ≥ 0xFF00). Now, InitializeVbeData() (called from constructor) writes both to fixed offsets within StaticFunctionalityTableSegment; VbeGetControllerInfo only writes the 256-byte VbeInfoBlock to ES:DI and sets far pointers to the BIOS-owned location.

  • Complete mode list: VbeGetControllerInfo previously advertised only mode 0x102, while VbeGetModeInfo reported 23 modes as supported. The mode list now includes all 23 VBE 1.2 standard modes.

  • Bit0Mask constant: Added BiosConstants.Bit0Mask = 0x01 for generic bit-0 checks. UpdateCursorPositionFlag (same value, cursor-specific semantics) is now used only where it describes cursor position updates; all other bit-0 tests (palette intensity, P5P4 select, gray scales, video enable, etc.) use Bit0Mask.

  • Documentation fixes: VbeInfoBlock.Version comment no longer says "BCD format" (it's a binary field per spec). VesaFunctions summary corrected from "VBE 1.0" to "VBE 1.2". VbeConstants.Version12 comment updated to match.

Rationale behind Changes

Fixes correctness bugs (buffer overflow, pointer wraparound, incomplete mode enumeration) and improves maintainability (misnamed constant, incorrect doc comments).

Suggested Testing Steps

Already tested with Rules of Engagement 2.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…, doc fixes, complete mode list

Co-authored-by: maximilien-noal <1087524+maximilien-noal@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] [WIP] Add VESA VBE 1.2 support to VGA BIOS [WIP] feature: VESA VBE 1.2 Mar 16, 2026
Copilot AI requested a review from maximilien-noal March 16, 2026 07:09
@maximilien-noal maximilien-noal marked this pull request as ready for review March 16, 2026 07:13
Copilot AI review requested due to automatic review settings March 16, 2026 07:13
@maximilien-noal maximilien-noal merged commit a856ea5 into feat/VBE_VESA_1.2 Mar 16, 2026
@maximilien-noal maximilien-noal deleted the copilot/sub-pr-1587-again branch March 16, 2026 07:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the INT 10h VESA VBE implementation in VgaBios toward VBE 1.2 compliance, primarily by moving OEM string + mode list into BIOS-owned storage to avoid caller-buffer overflow and pointer wraparound issues.

Changes:

  • Store VBE OEM string and full 23-mode list in BIOS-owned memory and return far pointers to that storage from VbeGetControllerInfo.
  • Expand the advertised mode list to match the modes already reported by VbeGetModeInfo.
  • Introduce BiosConstants.Bit0Mask for generic bit-0 checks and fix several VBE/VGA-related doc comments.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 1586 to 1590
var vbeInfo = new VbeInfoBlock(Memory, address);

// Fill VBE Info Block (VBE 1.2)
// Fill VBE Info Block (VBE 1.2) - only the 256-byte structure at ES:DI
vbeInfo.Signature = "VESA";
vbeInfo.Version = VbeConstants.Version12;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants