SCREEN1 = SYSVAR @ JSROM

Anything QL Software or Programming Related.
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: SCREEN1 = SYSVAR @ JSROM

Post by janbredenbeek »

Also bear in mind that the pixels of the original QL screen are not square-shaped. The original QL screen was made for a 4:3 television screen (the actual aspect ratio was about 3:2, which caused the horizontal overscan on TVs). However, the X/Y pixel ratio in MODE 4 is 2:1 (indeed, QDOS also assumes 512 logical pixels across in MODE 8). The graphics coordinate system compensates for this so that, say, 50 units in the system correspond to the same distance in both X and Y direction... on the original QL screen!

But now take an emulator on a PC, with modern 16:9 screen and 1920x1080 resolution. You see that 1920/1080 is exactly 16:9, so the pixels are square-shaped. A 512x256 emulated QL screen will now have an aspect ratio of 2:1, so wider than the original 3:2. Thus, a circle drawn in QDOS will look like an ellipse in QPC2.

(actually, Qemulator squeezes the QL screen horizontally so it retains the 3:2 ratio, and SMSQ/E has a system variable in which you can set the aspect ratio so you will get perfect circles again).

Jan.


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: SCREEN1 = SYSVAR @ JSROM

Post by RalfR »

janbredenbeek wrote:SMSQ/E has a system variable in which you can set the aspect ratio so you will get perfect circles again.
And how do you start this?


4E75 7000
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: SCREEN1 = SYSVAR @ JSROM

Post by janbredenbeek »

Ralf R. wrote:
janbredenbeek wrote:SMSQ/E has a system variable in which you can set the aspect ratio so you will get perfect circles again.
And how do you start this?
It's a float PT_ASPRT at offset $14a in the CON linkage block pointed to by the system variable SYS_CLNK at $280c4.
So you can read it out using PEEK_F(!$c4!$14a) and set using POKE_F !$c4!$14a,X where X is the pixel aspect ratio.

If you have a screen resolution with square-shaped pixels, then POKE_F !$c4!$14a,1 will get you a perfect circle.
(POKE_F !196!330,1 might be a bit more readable :) ).

Jan.


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: SCREEN1 = SYSVAR @ JSROM

Post by RalfR »

POKE_F !196!330,1 (and also POKE_F !$c4!$14a,1) gives ERR.BP in QPC2.


4E75 7000
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: SCREEN1 = SYSVAR @ JSROM

Post by janbredenbeek »

Ralf R. wrote:POKE_F !196!330,1 (and also POKE_F !$c4!$14a,1) gives ERR.BP in QPC2.
That's interesting. Which version are you using? (the aspect ratio POKE is only supported from SMSQ/E 3.00 onwards, and not in QDOS/Minerva anyway).
It does work in SMSQmulator too (even with no extensions from BOOT file loaded).

Jan


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: SCREEN1 = SYSVAR @ JSROM

Post by mk79 »

Ralf R. wrote:POKE_F !196!330,1 (and also POKE_F !$c4!$14a,1) gives ERR.BP in QPC2.
Turbo extension comes with its own POKE_F that doesn't have quite as many features as the SMSQ version, so try not loading that.


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: SCREEN1 = SYSVAR @ JSROM

Post by RalfR »

mk79 wrote:Turbo extension comes with its own POKE_F that doesn't have quite as many features as the SMSQ version, so try not loading that.
Ah, that is the reason, why. I have loaded Turbo toolkit for Cash Trader. I should probably take that out.


4E75 7000
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: SCREEN1 = SYSVAR @ JSROM

Post by Martin_Head »

There's a program here http://www.dilwyn.me.uk/graphics/g_ratio.zip that corrects circles in QPC2. I assume it does the POKE.


tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: SCREEN1 = SYSVAR @ JSROM

Post by tcat »

Hi Jan,
However, the X/Y pixel ratio in MODE 4 is 2:1
I believe it is mode 8, that has wider pixels across.
As I count 0,1,2..256 pixels in mode 8, I unified the code, using now ellipse for circles as well. For mode 8, I just halve the ellipse width (a - excentricity). Actually, now thinking more general to also halve x coordinates as Tobias pointed out.
Tomas


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: SCREEN1 = SYSVAR @ JSROM

Post by Derek_Stewart »

Martin_Head wrote:There's a program here http://www.dilwyn.me.uk/graphics/g_ratio.zip that corrects circles in QPC2. I assume it does the POKE.
Here is the DISA disassembley of the G_RATIO extension:
G_RATIO_dis.zip
G_RATIO disassembley, using DISA...
(659 Bytes) Downloaded 118 times


Regards,

Derek
Post Reply