Login
Back to forumReply to this topicGo to last reply

Posted By

MIRKOSOFT
on 2016-11-01
08:44:06
 Text in circle in Basic

I had some free time, so for fun I created program named Text in Circle.
It draws text around circle, but drawing in Basic is slow so who wants to speed up it, must to use Warp mode in emularor, or in case C128 use SCPU, but don't know what to do in case plussy.

I created versions for Commodore TED Series, Commodore 128 in 3 variants: same like 3.5 and Basic 7.80 + Basic 8 for VDC (7.80 version in two versions to draw 50 or 100 characters)
C64 Basic 3.5 version is not yet fixed - there is problem with Baisc 3.5 accesing IO instead chargen, so drawing result is mismatch - if anybody knows how to solve it in Basic please let me know.
Else one verison I have for ZX Spectrum.

You can download D64 with all req'd files here: http://www.mirkosoft.sk/text.d64

Miro

Posted By

SVS
on 2016-11-01
12:23:05
 Re: Text in circle in Basic

Hi Miro,
it seems to not work on Yape. Can you kindly check it?

Posted By

JamesC
on 2016-11-01
12:55:54
 Re: Text in circle in Basic

@SVS - DLOAD"KRUH(3.5) wink

@Mirko - the first file on the .d64 loads to 2048 (and is compiled to run from 2049). This is C64 BASIC starting location, but screen memory on the Plus/4 and 16.

Posted By

Csabo
on 2016-11-01
14:42:34
 Re: Text in circle in Basic

Works, but it really needs some more attention detail.
- Fix the issue JamesC pointed out.
- Line 310 refers to a non-existent line.

The rest is optimization. There's many things that could be done, just a few really glaring ones:
- GOSUB 300 in line 70 should be avoided. GOSUBs are costly, and this routine is only called once. It makes the code unnecessarily slow.
- IF X <> 0, well, when you think about it, X can only be greater than zero, so X>0 would already be better, but in BASIC, the "perfect" solution is "IF X THEN" (which is true for any non-zero number).
- SIN(C) and COS(C) is used twice, but this a very costly calculation. The same exact value is unnecessary calculated 16 times in the loop! You can just pre-calculate both of those in the beginning of the C loop.

Good luck and happy coding!

Posted By

JamesC
on 2016-11-01
15:01:45
 Re: Text in circle in Basic

@Csabo - line 310 resolves to a BASIC 7 command, BANK 14. It'll list incorrectly on a Plus/4 since the Plus/4 doesn't use that token. (On the 364, it resolves to VOC, a Magic Voice command.)

@Mirko - I could not reproduce the I/O error. However, there is no test to ensure A$ is <51 characters ... on the 51st character, a RETURN WITHOUT GOSUB IN 220 error occurs.

Posted By

Csabo
on 2016-11-01
15:34:35
 Re: Text in circle in Basic

Hah, that would explain it, cause I tried to run that line, and it gave a ?SYNTAX ERROR. Regardless, since it's in a file says BASIC 3.5 specifically, it should be removed.

Posted By

MIRKOSOFT
on 2016-11-02
13:12:47
 Re: Text in circle in Basic

Line 310 cannot to be removed - default bank in C128 basic is 15 and in this config is chargen unaccessible - it needs bank 14.
If you set PC to 61 this means program is running on C128 then it produces syntax error in Basic 3.5.
Value in PC checks on which computer is program running, even in case C128 mode 64.
This is for correction required actions to read pixels.

C64 forum cannot help with it's problem and Basic 3.5 is for them slow extension, what is sad.
I see that it allows C64 to do much more things with standard Commodore syntax instead any XYZ-Basic...
C64 version fixed by loading default C64 charset. Use the same link to download - it's updated diskimage.

Miro

Posted By

JamesC
on 2016-11-02
16:33:59
 Re: Text in circle in Basic

The C64 uses BASIC 2, it does not have CIRCLE or other graphic drawing commands. Therefore I do not understand how you are able to run this program on a C64, or a 128 in 64 mode.

Posted By

Mad
on 2016-11-02
16:53:35
 Re: Text in circle in Basic

cool proggy!

Posted By

Csabo
on 2016-11-02
17:11:24
 Re: Text in circle in Basic

I'm pretty confused by all your stuff, Miro. You already have several versions of this program on the disk, and that implies that your ultimate goal is NOT to have a works-everywhere solution. Therefore, you could simply have Plus/4, C64 versions etc.

Doesn't the BANK statement "stick"? (Stick - as in once you issue it, it stays that way until changed again.) If that is the case, having it in the loop that checks every pixel is mindbogglingly bad code. It should be done once, in the beginning of the program.

Posted By

Mad
on 2016-11-02
18:59:25
 Re: Text in circle in Basic

I have no clue about basic at all. If I wanted to do these kinds of stuff I would do it in ML that way you could even animate it, perhaps even with some flashy colors and so on. Perhaps you could atleast double the speed by using perbuilt tables (they can be computed at the initialization of the programm), however I just don't know if that helps in basic.

Posted By

MIRKOSOFT
on 2016-11-02
19:15:39
 Re: Text in circle in Basic

On disk are Basics used:
Basic 3.5 = for Commodore 64 Basic V2 replacement
Basic 7.80 = not so known Basic 7 extension
Basic 8 = known Basic 7 extension.

Program Kruh is targetted to C64, Plussy and C128.
Versions 7.80 and 8 are for video adapter in Commodore 128 - VDC - is too different to VIC or TED in resolution and at all.
This program was made for fun, not for any excellency - only for fun, ZX Spectrum version exists too, but I posted it nowhere, maybe use ZXS Czechoslovak forum.

Miro

Posted By

Mad
on 2016-11-02
21:16:27
 Re: Text in circle in Basic

Yes, and it's fun. Judging by the output it's already good (and perhaps optimizable). Keep on coding, there aren't so many people out there doing this stuff. As said me personally wouldn't do this at all... happy

Posted By

Csabo
on 2016-11-02
22:00:13
 Re: Text in circle in Basic

Ah, okay then. We're all glad you had fun with it happy



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024