I'm reading the current screenmode via OS_ReadModeVariable thus :
SYS "OS_ReadModeVariable", -1, 11 TO,, xsize%
SYS "OS_ReadModeVariable", -1, 12 TO,, ysize%
SYS "OS_ReadModeVariable", -1, 1 TO,, textcols%
SYS "OS_ReadModeVariable", -1, 2 TO,, textrows%
This seems to return the correct values for the current screen mode,
whether it is set, e.g. MODE 20, or
MODE MODE.
I'm doing this currently with Virtual Acorn on a laptop, but the
results seem the same on the Iyonix.
The text window seems to work OK with these returned values, but the
returned sizes for the graphics produce a window about half the
expected size. For example my laptop screen is 1440 * 900, and xsize
and ysize are returned correctly as 1439 and 899, but these values in
VDU24 give a rectangle only filling half the screen.
What am I missing?
cheers
George Pearce
> I'm reading the current screenmode via OS_ReadModeVariable thus :
>
> SYS "OS_ReadModeVariable", -1, 11 TO,, xsize%
> SYS "OS_ReadModeVariable", -1, 12 TO,, ysize%
> SYS "OS_ReadModeVariable", -1, 1 TO,, textcols%
> SYS "OS_ReadModeVariable", -1, 2 TO,, textrows%
[snip]
> The text window seems to work OK with these returned values, but the
> returned sizes for the graphics produce a window about half the expected
> size. For example my laptop screen is 1440 * 900, and xsize and ysize are
> returned correctly as 1439 and 899, but these values in VDU24 give a
> rectangle only filling half the screen.
VDU 24 (as with most graphics operations) operates in OS units, which are
not the same as pixels. In most modern modes one OS unit = 2 pixels, but
you shouldn't rely on this. Remember than in old modes like Mode 2, pixels
were 8 x 4 OS units, and so on.
What you need to do is take the number of pixels and convert them to OS
units using the eigenvalues:
SYS "OS_ReadModeVariable", -1, 11 TO ,,xpix%
SYS "OS_ReadModeVariable", -1, 4 TO ,,xeig%
SYS "OS_ReadModeVariable", -1, 12 TO ,,ypix%
SYS "OS_ReadModeVariable", -1, 5 TO ,,yeig%
xsize% = xpix% << xeig%
ysize% = ypix% << yeig%
--
Steve Fryatt - Leeds, England
> VDU 24 (as with most graphics operations) operates in OS units, which are
> not the same as pixels. In most modern modes one OS unit = 2 pixels, but
^^^^^^^^^^^^^^^^^^^^^^
Or maybe even 2 OS units = 1 pixel. D'oh.
Thanks Steve - Sorted!!
George Pearce