v86 icon indicating copy to clipboard operation
v86 copied to clipboard

screen mode problems

Open EymenWinnerYT opened this issue 8 months ago • 4 comments

When it switches to video mode lower than 8- bit color, it still shows that it is 8-bit (eg. 640x200x8 instead of 640x480x1) at the right on the vm. please fix this

EymenWinnerYT avatar Apr 23 '25 09:04 EymenWinnerYT

Could you provide a program/OS invocation that reproduces this?

copy avatar Apr 23 '25 13:04 copy

it is caused by the site itself lemme send a screenshot

Image

windows 1.0 doesnt support vga video modes by default but it says it is 8-bit video mode but it is 4-bit

EymenWinnerYT avatar Apr 24 '25 15:04 EymenWinnerYT

I think the problem is right here in src/vga.js where a non-SVGA video mode is set. The last argument 8 in that function call is the bpp argument, and this shouldn't be a constant as we can derive bpp from a VGA register.

Bit 6 8BIT of the VGA attribute mode register indicates 8-bit color mode, and bit 1 MONO indicates monochrome mode. If neither of these two bits is set I assume it means 4-bit color mode.

So it's really easy to distinguish 8-, 4- and 1-bit color modes.

I've tested it locally and it seems to work (I get 4 bpp in Windows 1.01 now), I just need to test it a bit more and will submit a PR when done.

EDIT: Tested 8-bit (320x200x8) and 4-bit (640x350x4) modes.

chschnell avatar Apr 26 '25 17:04 chschnell

Ok it's fixed, two example screenshots (click to zoom):

320x200x8: Image

640x350x4: Image

Monochrome is untested, and I'm not sure if it would work. On osdev it says about the MONO bit:

It is present and programmable in all of the hardware but it apparently does nothing. The internal palette is used to provide monochrome emulation instead.

I'll leave it as a TODO.

chschnell avatar Apr 28 '25 16:04 chschnell

Seems to be fixed, thanks @chschnell

copy avatar Jun 24 '25 16:06 copy