Legacy screens and circles - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Legacy screens and circles (/showthread.php?tid=2593) |
Legacy screens and circles - TerryRitchie - 04-13-2024 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 RE: Legacy screens and circles - CharlieJV - 04-13-2024 (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. 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 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 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): RE: Legacy screens and circles - CharlieJV - 04-13-2024 Come to think of it, it looks like QB64 is taking the GW-BASIC screen 2 and squishing it vertically, which then gives a proper square but then the squishing turns the circle into an ellipse. So it looks like QB64 is implementing CIRCLE the same way as GW-BASIC, however the screen 2 mode in QB64 does not match the pixel width to pixel height ratio of the GW-BASIC screen 2 mode. I'm thinking that any GW-BASIC program using whatever screen mode will never look "right" (I.e. as it looks in GW-BASIC), as-is, in QB64. In BAM (as per wwwBASIC), screen mode 2: pixels are 2.4 times taller than they are wide. So, to have a "proper" circle, the CIRCLE statement does some pretty special math to maintain proper aspect appearance. For example, if the radius is 24 at the horizontal, the radius must be 10 at the vertical. Something like that ... Screenshot of QB64: |