Page 1 of 5
Christmas Fun
Posted: Sun Dec 18, 2022 8:10 pm
by Andrew
Just some Christmas fun programming
The program is compiled with Liberator with RTM. Source is included .
Merry Christmas !
PS I tried to compile with Turbo, but failed. Codegen_task raises the error from the image. If anyone can explain me why, I will be most grateful
Any ideas on how to create a faster animation in Superbasic are more than welcome.
Re: Christmas Fun
Posted: Sun Dec 18, 2022 9:14 pm
by dilwyn
He he, nice seasonal work.
Needs Turbo Toolkit installed (MOVE_MEMORY command).
Assuming the error really refers to line 350, looks like it'll be because Turbo can't compile integer FOR loop variables, as that's the first line with one. Probably better to use IMPLICIT% with a non-integer loop variable name, possibly. Or DEF_INTEGER in QLib (I think that's the name, I didn't check the manuals before writing).
Re: Christmas Fun
Posted: Sun Dec 18, 2022 9:26 pm
by Andrew
dilwyn wrote: Sun Dec 18, 2022 9:14 pm
He he, nice seasonal work.
Assuming the error really refers to line 350, looks like it'll be because Turbo can't compile integer FOR loop variables, as that's the first line with one. Probably better to use IMPLICIT% with a non-integer loop variable name, possibly. Or DEF_INTEGER in QLib (I think that's the name, I didn't check the manuals before writing).
Thank you Dilwyn.
Drawing the animated raindeer was a great pain in the ... back.
No, I have checked that and the error is not because of the integer for loop. Turbo raises the same error at the same line regardless of using i , j or i%, j%
The first program version used no integer FOR loops.
Have you recognised all of the tree ornaments?

Re: Christmas Fun
Posted: Sun Dec 18, 2022 10:38 pm
by dilwyn
The ornaments: I noticed a QL, Sir Clive and a tennis player (Matchpoint?)
Reason I mentioned the integer variables was that I ran it in QemuLator as my QPC2 was busy doing something else at the time, and the integer FOR variables generated MISTake lines in the BASIC in QDOS.
It's some time since I used Turbo, I can't remember if it correctly handles int for loops or not.
Re: Christmas Fun
Posted: Sun Dec 18, 2022 10:50 pm
by Andrew
dilwyn wrote: Sun Dec 18, 2022 10:38 pm
The ornaments: I noticed a QL, Sir Clive and a tennis player (Matchpoint?
Yes, that is from Matchpoint. You missed the Knight Flight, Karate and Night Nurse.
Re: Christmas Fun
Posted: Sun Dec 18, 2022 10:55 pm
by Andrew
Errata:
I forgot to declare i% in lines 1000 and 1080
Please change the lines to
Code: Select all
1000 LOCal pos, i%
.........
1080 LOCal pos, i%
Re: Christmas Fun
Posted: Mon Dec 19, 2022 6:13 am
by stevepoole
Hi Andrew,
Just ran your program OK on QPC2, (with Turbo_sms_code LRESPRed)., after a few tweaks :
All occurrences of the screen_base at 131072 need to be replaced by SCR_BASE. Otherwise integer for loops are quite ok.
BUT, with 8 times larger screen definition, my PC shows your loaded screens only as large as postage stamps....( QPC set to 512x256).
Will try it on SGC later today... Thanks, Steve.
_______________________________________________
Re: Christmas Fun
Posted: Mon Dec 19, 2022 10:19 am
by Andrew
stevepoole wrote: Mon Dec 19, 2022 6:13 am
Hi Andrew,
Just ran your program OK on QPC2, (with Turbo_sms_code LRESPRed)., after a few tweaks :
All occurrences of the screen_base at 131072 need to be replaced by SCR_BASE. Otherwise integer for loops are quite ok.
BUT, with 8 times larger screen definition, my PC shows your loaded screens only as large as postage stamps....( QPC set to 512x256).
Will try it on SGC later today... Thanks, Steve.
_______________________________________________
Strange. The program is for QL colours (mode 4/8). In this mode SCR_BASE=131072
Are you using QPC in 8 bit color or High Colour mode?
Try using these settings:
Re: Christmas Fun
Posted: Mon Dec 19, 2022 11:25 am
by dilwyn
This only holds true for the 512x256 resolution in QL colour mode of course. Even 512x384 resolution will have the screen base at a different address.
I daresay you could code something like this to check in the program (I know it's only a bit of Christmas fun):
Code: Select all
screen_address=131072
IF VER$='HBA' : screen_address=SCR_BASE
IF screen_address<>131072 THEN PRINT"Sorry, screen not at address 131072! Merry Christmas." : STOP
The IF VER$= ... protects the compiled job from non-existent extensions (SCR_BASE in this case) on QLib. Again, not sure about Turbo.
Re: Christmas Fun
Posted: Mon Dec 19, 2022 1:46 pm
by Derek_Stewart
Hi,
I just did QPC_QLSCREMU 8 and all seemed to run okay.
The problem with the Turbo compiling, I will have read the manual. But a quick look at the Turbo Ref manual does not yield anything.
Maybe this is a similiar problem as Turbo compiling QPTR programs, which use arrays to transfer data, which Turbo does do. However this does seem the case in this program
So back to reading manuals...