Dr. Jim's QL Dumping Ground

Anything QL Software or Programming Related.
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: Dr. Jim's QL Dumping Ground

Post by dilwyn »

EmmBee wrote: Coming back on topic, about the REMarks In TMD2003’s factorising program: they are being used to highlight the start of definitions. Back in the day, many years ago, I also used to do this. Nowadays, however, the modern trend seems to be to have a single line with just one colon “:” to separate the definitions.
Some computers from "back in the day" used to allow "blank" lines, effectively just a line number and a space, to separate structures in this way. S*BASIC doesn't allow this (spaces used for indenting code instead), so we use REMark or : after a line number to do this. Personally, I think the ':' statement is neater in a listing. I don't remember there being any "official" or "recommended" way of doing this. Back in the 1980s at some point I merely started using the ":" as a separator line between structures in my programs after seeing it in listings from Simon Goodwin and Tony Tebby. Good to be able to use both methods I guess.

Would be really useful if changes to QLib were possible to accommodate what has been said about REMark statements with FOR loops etc. Don't use that myself, but have seen plenty of listings where it is used.


User avatar
TMD2003
Trump Card
Posts: 168
Joined: Sat Oct 10, 2020 12:18 pm

Re: Dr. Jim's QL Dumping Ground

Post by TMD2003 »

It looks like I have everything working now - I might have another test this coming evening, but in any case, be prepared for a blast from the past. We're going back to the Wild West, as it's sometimes called here!

(Note: this doesn't mean I've used non-Toolkit II UDGs, just that it's something that could have appeared in the pages of Popular Computing Weekly in 1984.)


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
TMD2003
Trump Card
Posts: 168
Joined: Sat Oct 10, 2020 12:18 pm

Re: Dr. Jim's QL Dumping Ground

Post by TMD2003 »

So here's the program I promised: last time it was Lissajous figures, this time it's Spirograph.

Image

There are two screenshots here forced into the black-box-QL aspect ratio.

It's another conversion from a Spectrum original - here's the original listing - it's short but managed to pack in a (rather messy) intro screen as well as its ability to draw the familiar Spirograph patterns. I've retained everything the original had, including the facility to overprint one pattern onto another (and I don't think I needed to set OVER 1 to do that, although I did), and load and save screens from/to microdrive. (That's why I asked about it before - then I looked in the manual when I had a problem with the syntax of my preferred filename and found it was lurking in there all along... that's now set me thinking as to whether I can POKE directly to the screen. There's no harm in trying. But I digress...) What I've added to this version is the layout - a square main window #1, around which I'd fit everything else - so window #2 is the status display on the right (that's still a usable 27 characters across) and window #0 has been crammed into the bottom right - that's just the input area, as you'd expect.

I wonder whether the formula used to draw the patterns is correct - I've transferred it directly from the Spectrum original and can confirm that the same input of the three radii required will produce the same pattern on both Spectrum and QL. I remember, though, when I had a real Spirograph when I was a nipper, there was some combination of gearwheels with the pen right at the edge of the inner gear that would make narrow loops right the way across the drawing area. I haven't been able to replicate that with any combination of radii that I've tried, and I don't have a real Spirograph to test it with now (and, realistically, why would I?) And I was quite rubbish with Spirograph, really - I never had the coordination to keep the pen in place while keeping the inner gear meshed with the outer gear, so everything I tried to draw looked like the mess that it was always going to be.

I might have a stab at making an SMSQ/E version, so that more colours are available, though how I'm going to compensate for the aspect ratio when a circle is no longer a circle is anyone's guess...


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Dr. Jim's QL Dumping Ground

Post by stevepoole »

Hi TMD,

Nice conversion !

Don't worry! spiro_bas works ok under smsq/e and QPC2, with 8 colours.

For correct aspect ratio, add h=h*0.76 onto line 3070, and that's it !

( I have a much shorter demo program to draw tons of epicyclic constructions.)

But spiro is very good for users to experiment with...

Keep up the good work !

Steve.


qbits
Trump Card
Posts: 171
Joined: Sun Dec 11, 2016 3:32 pm

Re: Dr. Jim's QL Dumping Ground

Post by qbits »

This has been very informative, some of the idiosyncrasies of S/SuperBASIC with different platform and ROM versions is what makes the task of compatibility such an intriguing subject.

QBITS


User avatar
TMD2003
Trump Card
Posts: 168
Joined: Sat Oct 10, 2020 12:18 pm

Re: Dr. Jim's QL Dumping Ground

Post by TMD2003 »

stevepoole wrote:Don't worry! spiro_bas works ok under smsq/e and QPC2, with 8 colours.

For correct aspect ratio, add h=h*0.76 onto line 3070, and that's it !
That's good to know. What I intended to do with a separate SMSQ/E version was resize the windows so that window #1 still appears square, even with the square pixels. I might also reorganise and resize the text in window #2. And, seeing as it'll be OK with more than four colours, I'll throw a few more colours in.

Maybe I'll even experiment with the high-colour mode - I've never had cause to do that before, but there's a first time for everything.


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Dr. Jim's QL Dumping Ground

Post by stevepoole »

Hi TMD,

By slight modifications to just the 'spirograph' procedure loop, the program can be converted into a beautiful randomised repeating 'screen saver'.

If you allow ink colours from 0 to 255, the effect can be quite spectacular too.

Thank you again for your hard work !

Steve.
______________


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

Re: Dr. Jim's QL Dumping Ground

Post by Derek_Stewart »

TMD2003 wrote:
stevepoole wrote:Don't worry! spiro_bas works ok under smsq/e and QPC2, with 8 colours.

For correct aspect ratio, add h=h*0.76 onto line 3070, and that's it !
That's good to know. What I intended to do with a separate SMSQ/E version was resize the windows so that window #1 still appears square, even with the square pixels. I might also reorganise and resize the text in window #2. And, seeing as it'll be OK with more than four colours, I'll throw a few more colours in.

Maybe I'll even experiment with the high-colour mode - I've never had cause to do that before, but there's a first time for everything.
Hi,

Why not open a specific channel(s) for he programme.

The advantage of this is the aspect ratio and scale can be adjusted to suit the ZX Spectrum smaller display, without any changes to channels 0,1,2


Regards,

Derek
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Dr. Jim's QL Dumping Ground

Post by stevepoole »

Hi TMD,

As mentioned before, I have a very short epicyclic orbits program, which I have combined into your spirograph routine.

The result produces MANDALA-type designs which could make a reasonably good screen-saver, if the PAUSE were set to say 250 units.

I hope you like it.... Just extract and RUN it, and hit any key for a new design or 's' to STOP.

All the best, Steve.
_____________________
mandala_bas.zip
(792 Bytes) Downloaded 97 times


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Dr. Jim's QL Dumping Ground

Post by stevepoole »

Hi Folks,

Here is a second version of the MANDALA-spirograph 'screen-saver' program. Colour, detail and transitions are greatly improved.

Tested on QPC2. Ok on SGC with 'aspect' set to 1 for circles. Otherwise set aspect (ratio) to suit your emulator !

The program uses all factors of 360 degrees to get harmonious results, as well as some intermediate values to launch the spirograph.

Many thanks to TMD for making this possible, and to close friends for suggestions...

Steve.
______________
mandala2_bas.zip
(983 Bytes) Downloaded 96 times


Post Reply