|Re: [hatari-devel] VDI 2-planes mode|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] VDI 2-planes mode
- From: Vincent Rivière <vincent.riviere@xxxxxxxxxxx>
- Date: Wed, 06 Mar 2013 01:23:03 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=1wSwMrO48BMcdeV6pMfXhKp4eXeh6sLjb/5JQXWc/dU=; b=ZrNkpIBpH4wsimZbQxYAw4i/p1agV3Ahha77ZkC4fjG3byx/aFmNTh1bxJfidmzGOi EcOhuFivLSEkf+4EGcr30Geh/DIRc2HBqnOxZADEOnWNIwab0A81GZ1d4KAJl5tLf+O8 cLgLocUxr2lF7kuAQLchxmEXPfKl4dMIPnPFQuuzX+19/Q8MzgOPAyjF2eUpaMIbBU0J lcoGayZuSw6ZVhPKxzSG2fF2V6PzwwAdlK09+Vm1z8eWfotJCan94HK2JvV+tObv0aB1 fUiUCF+KJyvpVwmYU90XOk4fGNkdqI4F+IuaIuQcO/qJGUmoYnZmiOd0ucauGdAlgyYh ZpRQ==
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.