Animated Christmas Card

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

Re: Animated Christmas Card

Post by dilwyn »

Cristian wrote:Finally here is my animated Christmas card for the "unofficial forum animation competition" 8-)
I tested also on Qemulator, and it runs much faster than the original QL.
As usual, you may set the speed by changing the "p" parameter at line 200 (for Qemulator I suggest a numeric value of 5 or 6).
Enjoy!
https://dl.dropboxusercontent.com/u/397 ... /MERRY.zip
Very nice indeed Cristian.


User avatar
Cristian
QL Wafer Drive
Posts: 1024
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Animated Christmas Card

Post by Cristian »

Thank you all for your kind appreciations! Please feel free to share the card.
Anyway this "unofficial competition" is still open, so it's possible that someone else could do even better - I hope at least.
If I have time I could also recycle this one for an "happy new year" card ;)


User avatar
Cristian
QL Wafer Drive
Posts: 1024
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Animated Christmas Card

Post by Cristian »

vanpeebles wrote::o :o :o :o :o
QL (& trumpcard) power! 8-)
And a LOT of patience :)


User avatar
pjw
QL Wafer Drive
Posts: 1607
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Animated Christmas Card

Post by pjw »

For those who, like me, cant just run these animations out of the box without re-booting and faffing around, here is an alternative player:

Code: Select all

10 dev$   = 'flp1_'
20 delay  = 10
30 count  = 20
40 :
50 ch = FOPEN('con_')
60 WINDOW#ch; 512,256,0,0
70 RESTORE
80 :
90 REMark Sprite header:
100 REMark   dc.w  $0100,$0000   ;form, time/adaption
110 REMark   dc.w  $0200,$0100   ;x size, y size
120 REMark   dc.w  $0000,$0000   ;x origin, y origin
130 REMark   dc.l  sprite-*      	;pointer to colour pattern
140 REMark   dc.l  0             ;solid
150 REMark   dc.l  0             ;pointer to next definition
160 REMark *
170 REMark sprite                ;sprite data
180 :
190 spr = ALCHP(32768 + 24)
200 DATA 256, 0, 512, 256, 0, 0, 0, 12, 0, 0, 0, 0
210 FOR adr = spr TO spr + 22 STEP 2
220  READ sd%: POKE_W adr, sd%
230 END FOR adr
240 :
250 n = 1: spd = spr + 24
260 REPeat lp
270  LBYTES dev$ & n & '_scr', spd
280  SPRW#ch; 0,0,spr: rem WSPT#ch; 0,0,spr
290  IF CODE(INKEY$(#ch; delay)) = 27: EXIT lp
300  n = n + 1: IF n > count: n = 1
310 END REPeat lp
320 :
330 RECHP spr: CLOSE#ch
340 :
It assumes the naming scheme of the Merry postcard by Cristian (1_scr, 2_scr,..).
Unzip the file (eg Merry.zip) to your chosen device.
Edit the code to set that device [dev$].
Set a suitable delay [delay], and the number of frames [count].
If you have a larger screen than 512x256, you can alter the position of the window (line 60).
If you dont have ptrmen_cde available, you could use my WSPT toolkit from Dilwyn's and alter line 280 accordingly.
Save your changes
From SMSQ/E you could EX the program. Alternatively RUN it.
Merry viewing!


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
dilwyn
Mr QL
Posts: 3056
Joined: Wed Dec 01, 2010 10:39 pm

Re: Animated Christmas Card

Post by dilwyn »

Nice idea converting the screens to a simple mode 4 sprite for display.

Well done, Per!


User avatar
pjw
QL Wafer Drive
Posts: 1607
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Animated Christmas Card

Post by pjw »

dilwyn wrote:Nice idea converting the screens to a simple mode 4 sprite for display.

Well done, Per!
Thanks, Dilwyn. The really clever bit is the SMSQ/E's versatile and flexible sprite drawing routine!
I should perhaps mention that ptrgen V2.02+ is required for this to work, so anyone who tried and failed to get a proper display should make sure theyre using an up-to-date version (currently 2.05). For non-SMSQ/E systems this is available to download from Dilwyn's site. SMSQ/E, of course, has ptrgen built-in.
While I understand the charm of being able to run these animations on virtually naked QLs, aiming a little higher might give them a wider appeal(?) After all, those who wrote the iop.wspt trap's innards went to a lot of trouble to interface various image formats with as many platforms as could physically handle them, and react more or less gracefully when asked the impossible.
But even if not using the WSPT method, it would be a good idea to limit the amount of editing required to get things to work across the board. I have to admit not bothering to view all the different offerings due to the many changes Id have to make to view them while remaining within my normal comfort zone. I dont mean to cause offense by making the following suggestion:

Code: Select all

10 REMark MASTRS_bas
20 :
100 dir$ = 'flp1_'
110 p    = 3
120 :
130 RANDOMISE DATE
140 ch = FOPEN('con_')
150 WINDOW#ch; 512,256,0,0
160 RESTORE
170 :
180 spr = ALCHP(32768 + 24)
190 REMark Sprite header:
200 DATA 256, 0, 512, 256, 0, 0, 0, 12, 0, 0, 0, 0
210 FOR adr = spr TO spr + 22 STEP 2
220  READ sh%: POKE_W adr, sh%
230 END FOR adr
240 :
250 spd = spr + 24
260 REPeat film
270   FOR glove=0 TO 2
280      Show "a", RND(5 TO 55)
290      Show "b", 3
300      Show "c", RND(5 TO 88)
310      Show "b", 3
320   END FOR glove
330   Pse 50
340   Show "scr_t1", 100
350   Show "scr_t2", 6
360   Show "scr_t3", 100
370   Show "scr_01", 50
380   Show "scr_02", p+3
390   Show "scr_03", p
400   Show "scr_04", p
410   Show "scr_05", p
420   Show "scr_06", 80
430   Show "scr_05", 3
440   Show "scr_07", 2
450   Show "scr_08", 2
460   FOR spin = 0 TO 15
470      Show "scr_11", 1
480      Show "G6", 2
490      Show "G4", 2
500   END FOR spin
510 END REPeat film
520 :
530 DEFine PROCedure Show(fnm$, t)
540 LBYTES dir$ & fnm$, spd: WSPT#ch; 0,0,spr: Pse t
550 END DEFine Show
560 :
570 DEFine PROCedure Pse(t)
580 IF CODE(INKEY$(#ch; t)) = 27 THEN
590  RECHP spr: CLOSE#ch
600  STOP
610 END IF
620 END DEFine Pse
630 :
Here only a single line (100), easily found, needs to be altered to suit a different setup. In my case I unzipped MASTRS to a virtual foppy, as most emulators support: No need to copy to ram disk for most of us. (In fact it runs ALMOST satisfactorily directly off my super slow USB floppy). Id have to alter a single line (540) to LBYTES dev$ & fnm$, 131072, and perhaps REM out* a few redundant lines, to switch back to riding bare-backed. (*Simpler might be: 155 IF 0 THEN, and 255 END IF to effectively REM out multiple lines)
Of course the above code is somewhat different to the original, but its the idea of generalising things through procedures and functions Im getting at.
Nice animations, BTW ;)


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
Cristian
QL Wafer Drive
Posts: 1024
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Animated Christmas Card

Post by Cristian »

pjw wrote:For those who, like me, cant just run these animations out of the box without re-booting and faffing around, here is an alternative player:

Code: Select all

10 dev$   = 'flp1_'
20 delay  = 10
30 count  = 20
40 :
50 ch = FOPEN('con_')
60 WINDOW#ch; 512,256,0,0
70 RESTORE
80 :
90 REMark Sprite header:
100 REMark   dc.w  $0100,$0000   ;form, time/adaption
110 REMark   dc.w  $0200,$0100   ;x size, y size
120 REMark   dc.w  $0000,$0000   ;x origin, y origin
130 REMark   dc.l  sprite-*      	;pointer to colour pattern
140 REMark   dc.l  0             ;solid
150 REMark   dc.l  0             ;pointer to next definition
160 REMark *
170 REMark sprite                ;sprite data
180 :
190 spr = ALCHP(32768 + 24)
200 DATA 256, 0, 512, 256, 0, 0, 0, 12, 0, 0, 0, 0
210 FOR adr = spr TO spr + 22 STEP 2
220  READ sd%: POKE_W adr, sd%
230 END FOR adr
240 :
250 n = 1: spd = spr + 24
260 REPeat lp
270  LBYTES dev$ & n & '_scr', spd
280  SPRW#ch; 0,0,spr: rem WSPT#ch; 0,0,spr
290  IF CODE(INKEY$(#ch; delay)) = 27: EXIT lp
300  n = n + 1: IF n > count: n = 1
310 END REPeat lp
320 :
330 RECHP spr: CLOSE#ch
340 :
Hi Per,
to satisfy my curiosity I tried your program on my almost plain QL. It's really slow, but it works! :-)


User avatar
pjw
QL Wafer Drive
Posts: 1607
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Animated Christmas Card

Post by pjw »

Cristian wrote:
pjw wrote:For those who, like me, cant just run these animations out of the box without re-booting and faffing around, here is an alternative player: <>
Hi Per,
to satisfy my curiosity I tried your program on my almost plain QL. It's really slow, but it works! :-)
Im glad it worked. If you WCOPYed the files to ramdisk first, itd be a lot faster. But many of us have emulators with virtual floppies, and they work almost as fast as ramdisks, so no need.

My main point, however, was to encourage the use of procedures, parameters and variables to reduce the amount of unnecessary repetition. That makes things so much easier to change. :)


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Post Reply