Motion piQtures

Anything QL Software or Programming Related.
User avatar
pjw
QL Wafer Drive
Posts: 1320
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Motion piQtures

Post by pjw »

vanpeebles wrote:I think we should have a forum Christmas animation competition based on Cristians program. Does anyone else agree? :)
Heres one way. Requires Easymenu's ptrmen_rext. Convert the screens to sprites (using Bob Spelten's SQRview, for example) and then:

Code: Select all

10 name$ =  '***  D R I N K  ***'
11 REMark    ~~~~~~~~~~~~~~~~~~~
12 REMark by pjw, November 23rd 2016
13 REMark Requires Easyptr's ptrmen_rext toolkit
14 :
15 REMark Init
16 p    = 5
17 nf%  = 9
19 dev$ = 'ram1_'
20 DIM addr(nf%)
21 :
22 ch = JobHeader(512, 256, name$)
23 :
24 :
25 REMark Load frames
26 FOR i% = 1 TO nf%
27  er = LoadSpr(i%, dev$ & 'scr_0' & i% & '_spr')
28  IF er < 0: CLCHP: EXIT i%
29 END FOR i%
30 ERT er
31 :
32 :
33 REMark Display
34 REPeat main
35  FOR i% = 1 TO nf%
36   SPRW#ch; 0, 0, addr(i%)
37   k% = CODE(INKEY$(#ch; p))
38   SELect ON k%
39    = 10, 32: IF CODE(INKEY$(#ch; -1)) = 27: QUIT
40    = 27: QUIT
41    = 26, 90, 122: EXEP 'button_sleep': REMark CTR+z, Z, z
42    = 77, 109, 245: WMOV#ch: REMark CTR+F4, M, m
43   END SELect
44  END FOR i%
45 END REPeat main
46 CLCHP
47 :
48 :
49 DEFine FuNction LoadSpr(n%, fnm$)
50 LOCal er
51 REMark GLOBal nf%, po%, addr
52 er = FTEST(fnm$): IF er < 0: RETurn er
53 IF n% > nf%: RETurn -5: REMark Err BF
54 addr(n%) = FLEN(\ fnm$)
55 addr(n%) = ALCHP(addr(n%))
56 IF addr(n%) <= 0: RETurn -4: REMark Err OM
57 LBYTES fnm$, addr(n%)
58 RETurn 0
59 END DEFine LoadSpr
60 :
61 :
62 DEFine FuNction JobHeader(xsz%, ysz%, nm$)
63 LOCal ch, x%, y%, xs%, ys%, wd
64 JOB_NAME nm$
65 xs% = xsz% + 4: ys% = ysz% + 2
66 x% = -1: y% = -1
67 ch = FOPEN("con_")
68 OUTLN#ch; xs%, ys% + 14, 0, 0, 10, 10
69 RDPT#ch; 48, x%, y%, 0: WMOV#ch; x%, y%: REMark EXEP needs WMOV
70 wd = MWDEF(#ch)
71 BORDER#ch; 1, 2
72 WM_PAPER#ch; 516: REMark Title background
73 WM_STRIP#ch; 517: REMark Title text background
74 WM_INK#ch; 518: REMark Title foreground
75 CSIZE#ch; 1, 0: CLS#ch
76 CURSOR#ch; (xs% - LEN(nm$) * 8) DIV 2, 2
77 PRINT#ch; nm$
78 x% = PEEK_W(wd + 36): y% = PEEK_W(wd + 38)
79 WINDOW#ch; xs%, ys%, x%, y% + 14
80 PAPER#ch; 0: CLS#ch: CSIZE#ch; 0, 0: BORDER#ch; 1, 2
81 RETurn ch
82 END DEFine JobHeader
83 :
84 :
Not very clean programming, I know, but this is just a demonstration of concept

Per


Per
dont be happy. worry
- ?
User avatar
pjw
QL Wafer Drive
Posts: 1320
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Motion piQtures

Post by pjw »

I should have said: The program above, as it stands, assumes a screen size larger than the 512x256 QL standard. To make the program run on a QL, remove the fancy window stuff. It also assumed that the Pointer Interface is loaded.

Since all the frames are sprites here (and they should all have the same dimensions) it is easy enough to determine the size of screen required and adjust the window size automatically. That would allow this program to run smaller sized animations on a QL.

Per


Per
dont be happy. worry
- ?
User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Motion piQtures

Post by Cristian »

pjw wrote: Not very clean programming, I know, but this is just a demonstration of concept
"Please excuse the crudity of this model. I didn't have time to build it to scale or paint it."
Dr. Emmet Brown (Back to the Future)
:mrgreen:


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

Re: Motion piQtures

Post by pjw »

Cristian wrote:
pjw wrote: Not very clean programming, I know, but this is just a demonstration of concept
"Please excuse the crudity of this model. I didn't have time to build it to scale or paint it."
Dr. Emmet Brown (Back to the Future)
:mrgreen:
Thats exactly it ;)

Things here have moved on a little. Ive watched my first film on a QL. The same film that I saw for the first time on any computer, namely Goodtime, from Windows 95. Its 3.14 minutes long and "streems" seamlessly from disk under QPC2 & SMSQ/E at 10 frames per second. No sound yet, nor am I particularly hopeful of achieving anything genuinely useful by this method, but it was a fun waste of a wet afternoon. :D

Per


Per
dont be happy. worry
- ?
User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Motion piQtures

Post by Cristian »

pjw wrote:Ive watched my first film on a QL.
:o :o :o
pjw wrote: but it was a fun waste of a wet afternoon. :D
:)


RWAP
RWAP Master
Posts: 2839
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Motion piQtures

Post by RWAP »

RWAP wrote:With QubIDE and QL-SD interfaces, maybe someone should look at porting Dragon's Lair to the QL - it has been ported to the ZX81..... :)
The easy option for this (as a stop-gap solution) might be to trace Dr Carlo Delhez and get the source code for Xtricator. It would need adapting to run the ZXPand ROM, but could then run the ZX81 version of Dragon's Lair on the QL


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

Re: Motion piQtures

Post by Derek_Stewart »

pjw wrote:
vanpeebles wrote:I think we should have a forum Christmas animation competition based on Cristians program. Does anyone else agree? :)
Heres one way. Requires Easymenu's ptrmen_rext. Convert the screens to sprites (using Bob Spelten's SQRview, for example) and then:

Code: Select all

10 name$ =  '***  D R I N K  ***'
11 REMark    ~~~~~~~~~~~~~~~~~~~
12 REMark by pjw, November 23rd 2016
13 REMark Requires Easyptr's ptrmen_rext toolkit
14 :
15 REMark Init
16 p    = 5
17 nf%  = 9
19 dev$ = 'ram1_'
20 DIM addr(nf%)
21 :
22 ch = JobHeader(512, 256, name$)
23 :
24 :
25 REMark Load frames
26 FOR i% = 1 TO nf%
27  er = LoadSpr(i%, dev$ & 'scr_0' & i% & '_spr')
28  IF er < 0: CLCHP: EXIT i%
29 END FOR i%
30 ERT er
31 :
32 :
33 REMark Display
34 REPeat main
35  FOR i% = 1 TO nf%
36   SPRW#ch; 0, 0, addr(i%)
37   k% = CODE(INKEY$(#ch; p))
38   SELect ON k%
39    = 10, 32: IF CODE(INKEY$(#ch; -1)) = 27: QUIT
40    = 27: QUIT
41    = 26, 90, 122: EXEP 'button_sleep': REMark CTR+z, Z, z
42    = 77, 109, 245: WMOV#ch: REMark CTR+F4, M, m
43   END SELect
44  END FOR i%
45 END REPeat main
46 CLCHP
47 :
48 :
49 DEFine FuNction LoadSpr(n%, fnm$)
50 LOCal er
51 REMark GLOBal nf%, po%, addr
52 er = FTEST(fnm$): IF er < 0: RETurn er
53 IF n% > nf%: RETurn -5: REMark Err BF
54 addr(n%) = FLEN(\ fnm$)
55 addr(n%) = ALCHP(addr(n%))
56 IF addr(n%) <= 0: RETurn -4: REMark Err OM
57 LBYTES fnm$, addr(n%)
58 RETurn 0
59 END DEFine LoadSpr
60 :
61 :
62 DEFine FuNction JobHeader(xsz%, ysz%, nm$)
63 LOCal ch, x%, y%, xs%, ys%, wd
64 JOB_NAME nm$
65 xs% = xsz% + 4: ys% = ysz% + 2
66 x% = -1: y% = -1
67 ch = FOPEN("con_")
68 OUTLN#ch; xs%, ys% + 14, 0, 0, 10, 10
69 RDPT#ch; 48, x%, y%, 0: WMOV#ch; x%, y%: REMark EXEP needs WMOV
70 wd = MWDEF(#ch)
71 BORDER#ch; 1, 2
72 WM_PAPER#ch; 516: REMark Title background
73 WM_STRIP#ch; 517: REMark Title text background
74 WM_INK#ch; 518: REMark Title foreground
75 CSIZE#ch; 1, 0: CLS#ch
76 CURSOR#ch; (xs% - LEN(nm$) * 8) DIV 2, 2
77 PRINT#ch; nm$
78 x% = PEEK_W(wd + 36): y% = PEEK_W(wd + 38)
79 WINDOW#ch; xs%, ys%, x%, y% + 14
80 PAPER#ch; 0: CLS#ch: CSIZE#ch; 0, 0: BORDER#ch; 1, 2
81 RETurn ch
82 END DEFine JobHeader
83 :
84 :
Not very clean programming, I know, but this is just a demonstration of concept

Per

Hi Per,

I tried your programme in QPC2 and SMSQmulator with ptrmen_cde loaded, the programme stops at line 68 giving error message Out Range??


Regards,

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

Re: Motion piQtures

Post by Derek_Stewart »

RWAP wrote:
RWAP wrote:With QubIDE and QL-SD interfaces, maybe someone should look at porting Dragon's Lair to the QL - it has been ported to the ZX81..... :)
The easy option for this (as a stop-gap solution) might be to trace Dr Carlo Delhez and get the source code for Xtricator. It would need adapting to run the ZXPand ROM, but could then run the ZX81 version of Dragon's Lair on the QL
Hi Rich,

Was the the source code was released some where, I thought Carlo had died, as stated in the QL Users Mailing LIst:

https://www.mail-archive.com/ql-users@l ... 15342.html


Regards,

Derek
RWAP
RWAP Master
Posts: 2839
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Motion piQtures

Post by RWAP »

Derek_Stewart wrote:
RWAP wrote:
RWAP wrote:With QubIDE and QL-SD interfaces, maybe someone should look at porting Dragon's Lair to the QL - it has been ported to the ZX81..... :)
The easy option for this (as a stop-gap solution) might be to trace Dr Carlo Delhez and get the source code for Xtricator. It would need adapting to run the ZXPand ROM, but could then run the ZX81 version of Dragon's Lair on the QL
Hi Rich,

Was the the source code was released some where, I thought Carlo had died, as stated in the QL Users Mailing LIst:

https://www.mail-archive.com/ql-users@l ... 15342.html

Oh dear - yes it looks like that was the case. No idea what happened to the source code etc then


User avatar
Cristian
Aurora
Posts: 965
Joined: Mon Feb 16, 2015 1:40 pm
Location: Veneto

Re: Motion piQtures

Post by Cristian »

Derek_Stewart wrote: Tried all the files on QEMulator under Wine on a Linux machine, works really well.
Tkanks
Derek_Stewart wrote: I remember a while back, there was talk about using the Minerva enabled second screen flicker free animation. I think the idea was to write one image to the SCR1 and SCR2 at the same time and flip the screen after the raster scan.
I wrote some assembler extension to copy SCR1 to SCR2, quite trivial really. Maybe worth revisiting the idea.
This is almost the same idea expressed by Rich, I suppose. Well, I do have Minerva, but alas not many programming skills: may someone suggest me how exactly could I realize this "trick" please?


Post Reply