Page 2 of 3
Re: QL Holiday cards
Posted: Fri Dec 15, 2023 11:36 am
by stephen_usher
Andrew wrote: Fri Dec 15, 2023 10:59 am
bwinkel67 wrote: Fri Dec 15, 2023 12:58 am
After that I'll see if I can use Andrew's sprite technique to write a game. Might do it in C though. Might look at PETSCII Robots, though that requires the whole screen to scroll.
Scrolling the whole screen on an unexpended QL requires some routine in assembly - BASIC or C are too slow for this, even when compiled.
It depends upon the C compiler and how you write the code, including how you order the instructions, just as you would in assembler. If your C compiler is dumb and effectively de-optimises your code then you're in trouble.
Andrew wrote: Fri Dec 15, 2023 10:59 am
On a QL with Gold Card or SuperGoldCard or Q68 or better - it is doable in BASIC or C.
Creating something like PETSCII Robots is quite possible, but i guess it requires a different approach than the one I used in Santa animation. Maybe using UDGs is the better approach, as I experimented here:
https://www.theqlforum.com/viewtopic.php?p=43120#p43120
Given that PETSCII Robots was originally designed to use UDG characters on the PET then it makes sense and is appropriate to use them on a QL port.
Re: QL Holiday cards
Posted: Fri Dec 15, 2023 12:12 pm
by Derek_Stewart
HI,
I tried to get the source code to PETSCII Robots, to port it to the QL, but last year, there all sorts of reasons why they would not let me have it.
If you can give me a link to the source code, I will try and port it to the QL.
Re: QL Holiday cards
Posted: Fri Dec 15, 2023 1:03 pm
by bwinkel67
Derek_Stewart wrote: Fri Dec 15, 2023 12:12 pm
HI,
I tried to get the source code to PETSCII Robots, to port it to the QL, but last year, there all sorts of reasons why they would not let me have it.
If you can give me a link to the source code, I will try and port it to the QL.
Here it is. I would think the Amiga version would be closest, but that is also more complex. The assembly versions are in 6502.
https://github.com/zeropolis79
Re: QL Holiday cards
Posted: Fri Dec 15, 2023 3:04 pm
by stevepoole
Hi Folks,
This is not so much a Xmas Card as a SuperBasic Xmas animation..... written weeks ago.
Regards, Steve.
Re: QL Holiday cards
Posted: Fri Dec 15, 2023 8:20 pm
by stevepoole
Hi All,
Just a sceen shot...
Re: QL Holiday cards
Posted: Sun Dec 17, 2023 9:28 am
by bwinkel67
Made some progress. Can you see the blinking Christmas lights?

- Grinch_small.gif (551.6 KiB) Viewed 1908 times
Small GIF.
So a few more things to tinker with...maybe a shade closing, a room light going on or off inside a building. Then I'll include the zip file with the BASIC and all the sprites.
Re: QL Holiday cards
Posted: Mon Dec 18, 2023 1:02 am
by bwinkel67
Ok, here is the final version. It has a bunch of random things happening. You have Christmas lights, you have window lights, and you have window shades. Also, the Grinch doesn't always launch all bombs. I also got rid of the weird mouth on the Grinch since it looked bad.
When running it, it will ask for which device, then whether you need to load Turbo Toolkit or if you wan to rerun it (the latter you can do once Turbo Toolkit is loaded).
Here is the zip file.

- Grinch_small.gif (570.73 KiB) Viewed 1884 times
Here is the small GIF.
Click on this to see the animation.
Re: QL Holiday cards
Posted: Mon Dec 18, 2023 2:31 pm
by Andrew
Nice work, bwinkel67!
i have some remarks:
- line 150: device should end with an underscore
- add a speed variable and add line 545 Pause speed (otherwise it is too fast to run in QPC or even on GC/SGC)
- line 1390 STOP never gets executed (which is rather a good thing, it should't be inside the procedure BLINKLIGHTS)
- lines 1420, 1430, 1440 never get executed and the memory is not released (because of the loop from lines 570-590 the only way to end the program is by terminating it with CTRL-SPACE)
Re: QL Holiday cards
Posted: Mon Dec 18, 2023 8:34 pm
by bwinkel67
Andrew wrote: Mon Dec 18, 2023 2:31 pm
- line 150: device should end with an underscore
Oops, typo.
Andrew wrote:
- add a speed variable and add line 545 Pause speed (otherwise it is too fast to run in QPC or even on GC/SGC)
GC sholdn't be a problem as that's what I'm sort of running it on (i.e. 4x). Don't these have a slowdown mechansim?
Andrew wrote:
- line 1390 STOP never gets executed (which is rather a good thing, it should't be inside the procedure BLINKLIGHTS)
That was for debugging, in case my variable GOTO went astray.
Andrew wrote:
- lines 1420, 1430, 1440 never get executed and the memory is not released (because of the loop from lines 570-590 the only way to end the program is by terminating it with CTRL-SPACE)
I kept searching for the GOTO that would go to these...but in the end, just left them in.
Re: QL Holiday cards
Posted: Mon Dec 18, 2023 9:37 pm
by Andrew
bwinkel67 wrote: Mon Dec 18, 2023 8:34 pm
I kept searching for the GOTO that would go to these...but in the end, just left them in.
Now I noticed a problem: at line 280 you allocate memory using RESPR - Memory allocated using RESPR cannot later be released
So change line 280 to:
280 grinch=ALCHP(6400): backgrd=ALCHP(3200):bomb=ALCHP(84)
And add line
547 if code(inkey$(1))>26 then goto 1410
so any keypress will stop the animation and the program and the memory will be deallocated