[WIP] feature: VESA VBE 1.2#1983
Merged
maximilien-noal merged 2 commits intofeat/VBE_VESA_1.2from Mar 16, 2026
Merged
Conversation
…, doc fixes, complete mode list Co-authored-by: maximilien-noal <1087524+maximilien-noal@users.noreply.github.com>
Contributor
Author
|
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:
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
maximilien-noal
approved these changes
Mar 16, 2026
Contributor
There was a problem hiding this comment.
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.Bit0Maskfor 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
VbeGetControllerInfopreviously 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 withinStaticFunctionalityTableSegment;VbeGetControllerInfoonly writes the 256-byteVbeInfoBlocktoES:DIand sets far pointers to the BIOS-owned location.Complete mode list:
VbeGetControllerInfopreviously advertised only mode0x102, whileVbeGetModeInforeported 23 modes as supported. The mode list now includes all 23 VBE 1.2 standard modes.Bit0Maskconstant: AddedBiosConstants.Bit0Mask = 0x01for 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.) useBit0Mask.Documentation fixes:
VbeInfoBlock.Versioncomment no longer says "BCD format" (it's a binary field per spec).VesaFunctionssummary corrected from "VBE 1.0" to "VBE 1.2".VbeConstants.Version12comment 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.