Page 1 of 2

CIRCLE/OVAL in BASIC

Posted: Tue Nov 07, 2023 10:23 am
by ahenry3068
Until someone comes along and does an ML module for this or Oval is implemented in ROM.
This is as good as it gets. :)

Implementation of Breshenham Circle Algorithm in Basic. Heavily modified at the cost of a little speed to do Clipping (Can draw a circle thats only partially on screen). Ovals (Using XSquish & YSquish modifiers), Can do filled or open Circles. and by Modifiying Q1,Q2,Q3,Q4 variables prior to calling Partial Circles and limited Arcs can be drawn.
(Its not a TRUE Arc algorithm. But by playing with XSquish & YSquish and the Q variables, I've been able to do anything I've needed to draw)

Line Numbered and BASLOAD version in the archive.

The Line Numbered version is also a little example program. The BASLOAD version is just the Routine.

Heres the code.
CIRCLE.zip
(1.94 KiB) Downloaded 517 times

An additional Example program.
Draws a Smiley Face Calling only BCircle
SMILEY.BAS
(2.47 KiB) Downloaded 384 times
SMILEY.PRG
(1.23 KiB) Downloaded 384 times
smiley.png
smiley.png (6.26 KiB) Viewed 12784 times

Re: CIRCLE/OVAL in BASIC

Posted: Thu Feb 29, 2024 8:39 am
by funkheld
Hi good afternoon.

What kind of basic is this written with?
the basic has no line numbers?

Thanks.
greeting

Re: CIRCLE/OVAL in BASIC

Posted: Thu Feb 29, 2024 9:26 am
by kelli217
There is a program for the X16 called BASLOAD. This program will take text files that do not use line numbers, and can use long variable names, and will convert it into a proper CBM BASIC 2.0 (with X16 extensions) program. The resulting program will have line numbers, and will also make use of those line numbers in place labeled entry points for GOTO and GOSUB statements. Also, all of the variable names will be converted into the standard variable name format, which is only two characters.

Re: CIRCLE/OVAL in BASIC

Posted: Fri Mar 01, 2024 8:38 pm
by funkheld
hello thanks for info.
Where is the executable basload program please?

greeting

Re: CIRCLE/OVAL in BASIC

Posted: Fri Mar 01, 2024 10:12 pm
by ahenry3068
funkheld wrote: Fri Mar 01, 2024 8:38 pm hello thanks for info.
Where is the executable basload program please?

greeting
There are two versions of BASLOAD. One resides in RAM. That version is here viewtopic.php?t=6322

The other version resides in ROM and is available in the latest pre-release ROM. (You have to download and compile it from github).
https://github.com/X16Community/x16-rom


The RAM version works but I'm using the ROM version for my code which is required for some more advanced features (Long variable
names).

Re: CIRCLE/OVAL in BASIC

Posted: Sat Mar 02, 2024 2:21 pm
by mortarm
ahenry3068 wrote: Fri Mar 01, 2024 10:12 pm The RAM version works but I'm using the ROM version for my code which is required for some more advanced features (Long variable names).
According to another post, the variable names are still reduced to two characters at execution, which would make such a feature meaningless.

Re: CIRCLE/OVAL in BASIC

Posted: Sat Mar 02, 2024 3:50 pm
by ahenry3068
mortarm wrote: Sat Mar 02, 2024 2:21 pm
ahenry3068 wrote: Fri Mar 01, 2024 10:12 pm The RAM version works but I'm using the ROM version for my code which is required for some more advanced features (Long variable names).
According to another post, the variable names are still reduced to two characters at execution, which would make such a feature meaningless.
This is true in the Ram version. In the ROM version ALL variables are remapped in the tokenized code and Long Variable names are kept unique even though they are reduced to 2 chars when Tokenized. Believe me it is very useful

Re: CIRCLE/OVAL in BASIC

Posted: Sun Mar 03, 2024 4:37 am
by mortarm
As long as the names remain unique, I agree. I wasn't aware of any distinction between the two versions.

Re: CIRCLE/OVAL in BASIC

Posted: Sun Mar 03, 2024 4:40 am
by ahenry3068
mortarm wrote: Sun Mar 03, 2024 4:37 am As long as the names remain unique, I agree. I wasn't aware of any distinction between the two versions.
If you are doing any BASIC development I strongly recommend downloading and using the Pre R47 ROM. I've been using it almost exclusively for quite some time. It's also what the Production boards are currently shipping with. To use the ROM version its a very simple matter of BASLOAD "MYSOURCE.BAS" in immediate mode.

Very good documentation also.

Re: CIRCLE/OVAL in BASIC

Posted: Mon Mar 04, 2024 3:16 am
by mortarm
ahenry3068 wrote: Sun Mar 03, 2024 4:40 am I strongly recommend downloading and using the Pre R47 ROM.
What's wrong with the R47 ROM?