QL Holiday cards

A place to discuss general QL issues.
stephen_usher
Gold Card
Posts: 433
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: QL Holiday cards

Post 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.qlforum.co.uk/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.


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

Re: QL Holiday cards

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


Regards,

Derek
User avatar
bwinkel67
QL Wafer Drive
Posts: 1202
Joined: Thu Oct 03, 2019 2:09 am

Re: QL Holiday cards

Post 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


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

Re: QL Holiday cards

Post by stevepoole »

Hi Folks,
This is not so much a Xmas Card as a SuperBasic Xmas animation..... written weeks ago.
Xmas23.zip
(1.71 KiB) Downloaded 53 times
Regards, Steve.


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

Re: QL Holiday cards

Post by stevepoole »

Hi All,

Just a sceen shot...
Capture d’écran (157).png


User avatar
bwinkel67
QL Wafer Drive
Posts: 1202
Joined: Thu Oct 03, 2019 2:09 am

Re: QL Holiday cards

Post by bwinkel67 »

Made some progress. Can you see the blinking Christmas lights?

Grinch_small.gif
Grinch_small.gif (551.6 KiB) Viewed 1010 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.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1202
Joined: Thu Oct 03, 2019 2:09 am

Re: QL Holiday cards

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

Grinch.zip
(18.88 KiB) Downloaded 31 times
Here is the zip file.

Grinch_small.gif
Grinch_small.gif (570.73 KiB) Viewed 986 times
Here is the small GIF.

Grinch.gif
Click on this to see the animation.


User avatar
Andrew
Aurora
Posts: 796
Joined: Tue Jul 17, 2018 9:10 pm

Re: QL Holiday cards

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


User avatar
bwinkel67
QL Wafer Drive
Posts: 1202
Joined: Thu Oct 03, 2019 2:09 am

Re: QL Holiday cards

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


User avatar
Andrew
Aurora
Posts: 796
Joined: Tue Jul 17, 2018 9:10 pm

Re: QL Holiday cards

Post 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


Post Reply