Re: [hatari-devel] VDI 2-planes mode

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On 02/03/2013 22:24, Eero Tamminen wrote:
This change in the patch Vincent contributed earlier:
+     VDICharHeight = HeightRequest < 400 ? 8 : 16;

Works fine in VDI 2-plane mode for EmuTOS under TT/Falcon emulation.

However, that same change breaks BIOS text size in 2-plane VDI mode
under ST/STE emulation, both for EmuTOS and normal TOS, and for TOS v3
under TT emulation.

The main point is to boot using a standard video mode which is similar to the extended one, regarding to the font and color depth. So the OS picks up the right font size and palette. After that, the OS can be safely patched to extend the screen dimensions.

For example, if you want a 1024x768 extended screen, you have to boot in ST_HIGH to get the right font (the big one, suitable for high resolutions). But you have to boot in ST_MEDIUM to have the right colors. So the problem seems to be insoluble.

You can get good results by forcing "bUseHighRes = true" in Configuration_Apply(). Doing that, you boot in ST_HIGH then you patch it for 4 colors. The font is right, but the palette is not strictly correct because it was not initialized at startup (ST_HIGH does not use the palette).

On the other hand, Hatari already hacks the screen ratio in extended 4 color video mode. If you select extended 640x200 4 color video mode, you don't get ST_MEDIUM. Instead, you get an extra wide ST_LOW patched for 4 colors.

IMHO, the best possible thing is to keep the current behaviour for boot video mode: ST_LOW for 16 and 4 color modes, ST_HIGH for 2 color mode.

Then *avoid* hacking VDICharHeight to keep the right value determined by the OS at startup, depending on the boot video mode. As I told previously, only the screen dimensions should be hacked by the extended mode patch, not other characteristics such as as VDICharHeight.

In src/vdi.c, function VDI_LineA(), I propose to do:

//STMemory_WriteWord(linea-46, VDICharHeight);          /* v_cel_ht */
VDICharHeight = STMemory_ReadWord(linea-46);
STMemory_WriteWord(linea-44, (VDIWidth/8)-1);         /* v_cel_mx (cols-1)
....

Instead of forcing VDICharHeight, we read it from the OS and we determine the other values accordingly, using the new screen dimensions.

As a result, the small font is used even in high resolutions, but that's the best we can get. Anyway, extended 4 color modes will be rarely used in practice.

--
Vincent Rivière



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/