Skip to content

feature: VESA VBE 1.2#1978

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

feature: VESA VBE 1.2#1978
maximilien-noal merged 2 commits intofeat/VBE_VESA_1.2from
copilot/sub-pr-1587

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 16, 2026

Implements VESA BIOS Extension (VBE) 1.2 support for the VGA BIOS, enabling Super VGA modes for games like Rules of Engagement 2. Adds three core VBE functions: GetControllerInfo (00h), GetModeInfo (01h), and SetMode (02h), plus memory-mapped data structures for VESA information exchange.

Address reviewer feedback to eliminate magic numbers and fix documentation:

  • VBE version: Reports 0x0102 (VBE 1.2) instead of 0x0100
  • VESA mode constants: All 22 standard mode numbers (0x1000x11B) extracted to named constants in VbeConstants
  • Bits-per-pixel constants: BitsPerPixelPlanar4Bit, BitsPerPixel8/15/16/24/32Bit added to VbeModeInfoConstants
  • Scan line constants: BitsPerByte, BytesPerPixel16/24/32Bit, PlanarModePlanes replace magic numbers in scan line width calculations
  • Color field position constants: RedFieldPositionRgb555/565/24, GreenFieldPositionRgb16/24, BlueFieldPosition make bit layout explicit
  • Magic 0x004F: Replaced with (ushort)VbeStatus.Success for consistency
  • Typo: "YCharSellSize" → "YCharCellSize" in XML doc comments (3 locations)

Rationale behind Changes

Some games try to use VESA VBE (like Rules of Engagement 2). The refactoring addresses reviewer feedback to replace magic numbers with named constants for maintainability and self-documentation.

Suggested Testing Steps

Already tested with Rules of Engagement 2.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

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 feature: VESA VBE 1.2 Mar 16, 2026
Copilot AI requested a review from maximilien-noal March 16, 2026 06:31
@maximilien-noal maximilien-noal marked this pull request as ready for review March 16, 2026 06:34
Copilot AI review requested due to automatic review settings March 16, 2026 06:34
@maximilien-noal maximilien-noal merged commit 3c8a096 into feat/VBE_VESA_1.2 Mar 16, 2026
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

Adds/refines VESA VBE 1.2 support in the VGA BIOS interrupt handler to improve Super VGA compatibility (e.g., enabling games that probe VBE capabilities), primarily by updating reported versioning and replacing magic numbers with named constants.

Changes:

  • Report VBE 1.2 (0x0102) in controller info and update related log/message text.
  • Extract VESA mode numbers and mode-info “magic numbers” (bpp, scanline sizing, RGB field positions) into named constants.
  • Fix the “YCharSellSize” typo in XML documentation.

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

/// </summary>
public const byte BitsPerByte = 8;
/// <summary>
/// Bits per pixel for 4-color planar modes (EGA/VGA 16-color).
Comment on lines +210 to +212
/// VESA mode 111h: 640x480, 16-bit (RGB 5:6:5).
/// </summary>
public const ushort VesaMode640x480x16 = 0x111;
Comment on lines +196 to +200
public const ushort VesaMode320x200x15 = 0x10D;
/// <summary>
/// VESA mode 10Eh: 320x200, 16-bit (RGB 5:6:5).
/// </summary>
public const ushort VesaMode320x200x16 = 0x10E;
@maximilien-noal maximilien-noal deleted the copilot/sub-pr-1587 branch March 16, 2026 18:53
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