(04-13-2024, 03:31 PM)TerryRitchie Wrote: While working with legacy screens I noticed something odd. Circles are not circles. They need to be forced to an aspect ratio of 1 to become true circles.
I realize these screens were stretched onto CRT monitors with 4:3 aspect ratios. Is that why the default circle is squashed?
Code: (Select All)SCREEN 2
CIRCLE (100, 99), 50 ' not a circle
CIRCLE (300, 99), 50, , , , .418 ' this seems to be the default aspect ratio
CIRCLE (500, 99), 50, , , , 1 ' forced to an aspect ratio of 1:1, now a circle
That would be a little bit of legacy from GW-BASIC not implemented in QB64, I think.
Run GW-BASIC at the Internet Archive. (You might find it interesting to try this with BAM too, because it, as per wwwBASIC, has the same CIRCLE behaviour as GW-BASIC for compatibility.)
Enter the following program and run it. Notice how the CIRCLE looks like a semi-decent CIRCLE, but the square does not look like a square at all.
Code: (Select All)
10 screen 2
20 circle (100,100),50
30 line (50,50)-(150,150),,B
Now modify that program and run again. Notice how it is a somewhat decent CIRCLE, and a somewhat decent square.
Code: (Select All)
10 screen 7
20 circle (100,100),50
30 line (50,50)-(150,150),,B
Run both of those programs in QB64.
What you are seeing is QB64 not implementing CIRCLE in the same way as CIRCLE was implemented in GW-BASIC to work with different screen modes.
In GW-BASIC, it does its very best to draw a proportionally correct circle no matter the screen mode. To do that, the CIRCLE implementation adjusts the number of vertical pixels to a number that works (aspect wise) correctly for the number of horizontal pixels.
Screenshots from BAM (which fairly match results from GW-BASIC hosted at the Internet Archive):