• Please review our updated Terms and Rules here

VGA X-Mode 256x240 aspect ratio

carlos12

Experienced Member
Joined
May 10, 2020
Messages
183
Location
Madrid, Spain
Hi. I'm experimenting with a few VGA X-Mode not so usual modes. I currently don't have real hardware to test, so I must relay on emulators.

DosBox 0.74-3: I configured it to maintain the aspect ratio, also avoiding the default Surface rendering engine, using OpenGl or DDraw. When I test the 256x240 mode, it doesn't expand to the full 4:3 screen. It maintains the square pixels but it doesn't stretch, giving both blank stripes on the sides.

Using 86Box: configured to force 4:3 screen ratio, both windowed and full screen, it delivers what promises and the pixels are stretched, filling the entire 4:3 virtual screen.

So my question is, what would be the real DOS+VGA+VGA monitor behaviour? Would it automatically stretch to fill the entire screen, as happens with other modes (or in 86Box...), or the 256x240 mode would behave just like a cut down version of the 320x240 mode, with big blank stripes on the sides (just like DosBos does)?

Thank you very much!
 
Normally the 256x modes will use the same pixel size as 320x modes, but only filling part of the screen. AFAIK there is no way to get to a lower pixel clock using a purely standard VGA card since it only has 25MHz and 28MHz clocks. There are two clock select bits in register 3C2, which leaves room for two additional choices which seem to be 44MHz and 36MHz on SVGA cards.

I remember that Magic Engine for DOS could use a 256x224 mode that filled the entire screen, but it only worked on certain cards like Trident 8900.
 
Don't know the details on this mode, but if the difference from the 320x240 counterpart is only in the Horizontal Displayed and Horizontal Sync Position registers, then yep, I'd expect it to fill only part of the screen horizontally.

Here is one DOS/VGA game that uses 256x240, and IIRC the setup program gives you a couple of options for it (something like "normal" and "wide"?), but it only makes a difference on certain specific chipsets, so that also agrees with bakemono's info.
 
Thank you both for your very interesting and complete responses. For initializing the 256x240 mode I'm using DOS XLib 6.12. It uses the following parameters:

Code:
LABEL X256Y240 word
	db      0e3h    ; dot clock
	db      16      ; Number of CRTC Registers to update
	dw      05f00h  ; horz total
	dw      03f01h  ; horz displayed
	dw      04202h  ; start horz blanking
	dw      09f03h  ; end horz blanking
	dw      04c04h  ; start h sync
	dw      00005h  ; end h sync
	dw      00d06h  ; vertical total
	dw      03e07h  ; overflow (bit 8 of vertical counts)
	dw      04109h  ; cell height (2 to double-scan)
	dw      0ea10h  ; v sync start
	dw      0ac11h  ; v sync end and protect cr0-cr7
	dw      0df12h  ; vertical displayed
	dw      00014h  ; turn off dword mode
	dw      0e715h  ; v blank start
	dw      00616h  ; v blank end
	dw      0e317h  ; turn on byte mode
	dw      256
        dw      240

It's a pity there's no way to force the stretching of the pixels. I think this mode could have a few advantages over the also X-Mode 320x240, even over the classic 320x200. The graphics could be more arcade/console like, and it would also consume less memory. But the fact it does not adapt itself to the 4:3 screen makes it, in my opinion, a lot less attractive.

Thank you again.
 
If you want to play around with VGA, search for "tweak16b.zip". It comes with some tweaked modes as a base.

I disagree that 256x240 stretched to 4:3 would be a good mode; the PAR is too off-square. 256x224 would be a little better, but honestly 320x240 is nearly perfect: It's 60Hz, 3 video pages, fills 4:3 exactly, and uses square pixels. There are no tweakmodes other than 320x240 that I like more (although 320x400 and 360x480 come close).
 
Back
Top