videogamer555 wrote on 2023-02-20, 21:43:
I would like to point out that your mode numbers are not being used correctly. For example mode 0x010F is supposed to be a 24bpp 320x200 mode. However in DosBox it incorrectly is a 32bpp 320x200 mode. While the official VESA specs may no longer require supporting every standard mode, I think they require that the use of any of the standard mode numbers must conform to the official specification for those modes. While VESA does allow for 32bpp modes, it doesn't have any in their list of standard modes.
This is not how VESA BIOSes behaved back in the 90s. S3 graphics chips used a 4 bytes per pixel in 16M color modes, mostly because that's required for VRAM based cards with direct DAC data path. Cirrus Logic used 3 bytes per pixel in 16M color modes. The VESA mode number 0x010F was supported by both kind of cards, and the application had to check for the number of bytes per pixel. I can't find the VESA 1.2 specification only (that one added standard mode numbers for high-color and true-color modes), so I can't quote an explicit permission to use both 3-bytes-per-pixel and 4-bytes-per-pixel variations of the 16M color modes in the specification, but for sure both variations were used in practice. All modes (except mode 6A/102) are not meant to be used "blindly" by just setting the mode, but you were required to parse some information from the VESA mode info already in VESA 1.0. For example, the banking granularity was 4KB on Cirrus cards, and 64KB on most other cards. Also, padding at the end of a line was permitted. A 800x600 256-color mode was allowed to be implented with 1024 bytes per line, if the card had enough video memory (i.e. 1MB) for that configuration. Furthermore, some cards allowed to select different banks numbers for reading and writing, whereas other cards allowed different bank numbers for the bottom half of the A000 segment (A000-A7FF) and the top half (A800-AFFF). That's why you have "window A" and "window B" in the VESA mode info, which might be read-only, write-only or read-write.
Graphics chips were not built to implement "the one VESA standard", but VESA was built to provide an abstraction layer over different kind of Super-VGA cards. Applications that previously needed to have hard-coded knowledge about different Super-VGA implementations could now ask the Super-VGA card for their implementation details - but the applications still had to support the different approaches implemented in different cards. So while the hard-coded mode numbers fix some parameters of the video mode, like the number of displayable colors, the memory model (16-color mode use VGA-like planar design, higher color modes use unbanked linear memory) and the resolution, other parameters of the video mode are not fixed. The presence/absence of a reserved fourth bytes in 16M color modes is one of these non-fixed parameters. As DOSBox obviously intends to mimic a S3 video card, implementing 16M color modes at 4 bytes per pixel is exactly the right thing to do. If you use a physical S3 Vision964 card in a 486 or Pentium computer, you will also get 4 bytes per pixel in mode 010F.
videogamer555 wrote on 2023-02-20, 21:43:
Therefore, if you want a 320x200 32bpp mode, that mode must be given a number other than one of the numbers from the official VESA specifications. 24bpp modes must have exactly 3 bytes per pixel, while 32bit modes must have exactly 4 bytes per pixel.
As Wikipedia would phrase it: "Citation required". To the best of my knowledge, the quoted statement is not true, and hardware definitely didn't behave that way in the 90s.