Christmas Fun

Anything QL Software or Programming Related.
User avatar
Andrew
QL Wafer Drive
Posts: 1032
Joined: Tue Jul 17, 2018 9:10 pm

Christmas Fun

Post 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.
Attachments
santa.zip
(47.45 KiB) Downloaded 110 times
Error.jpg


User avatar
dilwyn
Mr QL
Posts: 3056
Joined: Wed Dec 01, 2010 10:39 pm

Re: Christmas Fun

Post 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).


User avatar
Andrew
QL Wafer Drive
Posts: 1032
Joined: Tue Jul 17, 2018 9:10 pm

Re: Christmas Fun

Post 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? :D


User avatar
dilwyn
Mr QL
Posts: 3056
Joined: Wed Dec 01, 2010 10:39 pm

Re: Christmas Fun

Post 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.


User avatar
Andrew
QL Wafer Drive
Posts: 1032
Joined: Tue Jul 17, 2018 9:10 pm

Re: Christmas Fun

Post 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.


User avatar
Andrew
QL Wafer Drive
Posts: 1032
Joined: Tue Jul 17, 2018 9:10 pm

Re: Christmas Fun

Post 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%
 


stevepoole
Aurora
Posts: 888
Joined: Mon Nov 24, 2014 2:03 pm

Re: Christmas Fun

Post 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.
_______________________________________________


User avatar
Andrew
QL Wafer Drive
Posts: 1032
Joined: Tue Jul 17, 2018 9:10 pm

Re: Christmas Fun

Post 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:
qpcsettings.jpg


User avatar
dilwyn
Mr QL
Posts: 3056
Joined: Wed Dec 01, 2010 10:39 pm

Re: Christmas Fun

Post 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.


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

Re: Christmas Fun

Post 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...


Regards,

Derek
Post Reply