Skip to content

[Bug]: VGA emulation does not correctly emulate Chain Odd/Even on writes #610

@logiclrd

Description

@logiclrd

Version

trunk/main

Host OS Type

Windows

Host OS name + version

Windows 10 Version 22H2 (Build 19045.6332)

Host Architecture

x86

Guest OS Type

other

Guest Architecture

x86

Guest OS name + version

MS-DOS 6.22

Component

Other

What happened?

A program which rewrites the VGA text mode font for graphical purposes had a bug in it. I didn't know that it had a bug in it, because it appeared to work when running inside a VirtualBox VM. However, under DOSBox-X and on real hardware, the bug became apparent. The program was setting the Sequencer register "Odd/Even Host Memory Write Adressing Disable", then mapping plane 2 to B800:0000 and writing font bitmap data. This seemed to work perfectly, but it turns out that on actual hardware, this register bit is only in charge of which plane writes go to. The address is still masked based on the value of the Graphics Controller Misc Graphics register, specifically the "Chain Odd/Even" field.

How can we reproduce this?

  1. Set up a 16-bit DOS VM. Install MS-DOS 6.2 and QuickBASIC 4.5 or 7.1.

  2. Transfer the following version of PIPELINE.BAS into the VM (e.g. via a floppy disk image):

https://github.com/logiclrd/QBX/blob/14f3b0c727a3fd06abcc65129558111b7803c8fe/Samples/PIPELINE.BAS

  1. Run QuickBASIC, load PIPELINE.BAS and run it.

Expected

This version of PIPELINE.BAS contains a bug. It should produce output that looks like this:

Image

Actual

VirtualBox displays output inconsistent with the proper operation of the VGA chipset, and which makes it look like PIPELINE.BAS does not contain a bug:

Image

Did you upload all of your necessary log files, screenshots, etc.?

  • Yes, I've uploaded all pertinent files to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions