Happy Birthday!

Tell us about your other hobbies & none QL related items here :)
stevepoole
Gold Card
Posts: 302
Joined: Mon Nov 24, 2014 2:03 pm

Re: Happy Birthday!

Postby stevepoole » Sat Apr 25, 2020 5:00 am

Hi Again,

Change the 'wait' multiplier to 0.1 on Supergoldcard.... to get the sound right.

Fireworks2_bas was first writtten on QPC at 1.8Ghz, then on Qemulator....

On a 128ko QL, experiment with the wait factor !

Regards,

Steve.


User avatar
vanpeebles
Commissario Pebbli
Posts: 2312
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Happy Birthday!

Postby vanpeebles » Sat Apr 25, 2020 7:38 am

Happy Birthday to you! :D


User avatar
vanpeebles
Commissario Pebbli
Posts: 2312
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Happy Birthday!

Postby vanpeebles » Tue May 19, 2020 9:21 am

Happy Birthday to Mister Tim! :D


User avatar
bwinkel67
Gold Card
Posts: 330
Joined: Thu Oct 03, 2019 2:09 am

Re: Happy Birthday!

Postby bwinkel67 » Tue May 19, 2020 9:39 am

stevepoole wrote:Hi Again,

Change the 'wait' multiplier to 0.1 on Supergoldcard.... to get the sound right.

Fireworks2_bas was first writtten on QPC at 1.8Ghz, then on Qemulator....

On a 128ko QL, experiment with the wait factor !

Regards,

Steve.


Weird but I ran this on QLAY2 and it corrupts itself (i.e. the BASIC gets corrupted).


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

Re: Happy Birthday!

Postby stevepoole » Wed May 20, 2020 1:04 am

Hi Bwinkel67,

I don't have QLAY... but have examined the fireworks code, and guess at your bug solution.....

First you mention corruption : Do you get the MIStake keyword inserted, and if so on which lines ?

The type of the formal parameter 'wait' depends on the first calling parameter, the literal 22222, so is integer.

22222*.5 is 11111, also integer. The second call gets 999*.5.... 499.5 which is float ! (The FOR loop is float too...)

If QLAY baulks with the value 77777*.5, it means that QLAY is expecting an integer maximum of 32767 !

Normally, the QL allows coercion in such cases, but maybe QLAY doesn't here? (Try changing 77777 to 32767).

But as I said, I can only guess without having QLAY to experiment with !

Best wishes,

Steve.


User avatar
bwinkel67
Gold Card
Posts: 330
Joined: Thu Oct 03, 2019 2:09 am

Re: Happy Birthday!

Postby bwinkel67 » Wed May 20, 2020 1:18 am

stevepoole wrote:First you mention corruption : Do you get the MIStake keyword inserted, and if so on which lines ?


No, I mean corrupts memory where part of the loaded code becomes gobbledygook.

Corrupt.png


If I save the basic code after running it, here is what it looks like:

Code: Select all

100 ::
110 CLEAR: main: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAR 7: QUIT: REMark fireworks2_bas by S.Poole, v20apr20
115 REMark Change line 560 to 'wait *.5' to speed up screen output on Qemu.
120 :
130 DEFine PROCedure main
140 LOCal p,ik,ct,loop,a,time,x,y,ring,dia,Rink,b,inc,fil
150 LOCal yes,nbr,lng,ov,dwn,i$(1): p=5: ik=255: ct=0
170 ÿÿÿÿ    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADL 512,256,0,0: SCALE 100,-75,-50: FILL 0: ÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAROPEN_INOPEN_NEWCLSCALLRECOL   RANDOMISEPAUSEPOK 0: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAROPEN_INOP 0: CLS
180 REPeat loop
190 FOR a=3 TO 3+RND(5)
200 time=2+RND(3): biz: x=RND(-55 TO 55): y=RND(-25 TO 40)
210 dia=RND(1 TO 80/time): Rink=RND(1 TO 7): ring=RND(6)
220 IF ring: zap x,y,dia: zap x,y,dia: rays x,y,dia
230 FOR b=1 TO 1+RND(12)
240 inc=RND(255): fil=RND(0,1): yes=RND(0,1)
250 nbr=RND(10 TO 19): lng=RND(10 TO 19)
260 IF ring: FOR ov=-1,-1: burst x,y,lng/3,yes,ov,inc: paws 77777
270 spark x,y,lng,inc: i$=INKEY$: IF i$<>"": EXIT loop
280 END FOR b: FOR dwn=1 TO 7: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAROPEN_INOPEN_NEWCLSCALL dwn
290 END FOR a: END REPeat loop: END DEFine
300 :
310 DEFine PROCedure zap(xx,yy,rd)
320 LOCal f: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAR 7,0,3
330 FOR f=-1,-1: ÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAROPEN_INOPEN_NEWCLSCALLRECOL   RANDOMISEPAUSEPOK f: FILL 1: CIRCLE xx,yy,rd: FILL 0: paws 9999
340 ÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAROPEN_INOPEN_NEWCLSCALLRECOL   RANDOMISEPAUSEPOK 0: END DEFine
350 :
360 DEFine PROCedure biz
370 FOR f=0 TO 98 STEP time: BEEP 1024,f: paws 22222
380 FOR f=0 TO 64 STEP time: BEEP 1024,f: paws 999
390 END DEFine
400 :
410 DEFine PROCedure spark(xx,yy,rd,ik)
420 LOCal tn,e: PENUP: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAR ik,ik+4,3: rd=rd/2: FOR tn=5 TO RND(30)
430 e=RND(rd): TURNTO RND(360): MOVE e: CIRCLE_R 0,0,.6: MOVE -e: BEEP 256,255
440 END FOR tn: END DEFine
450 :
460 DEFine PROCedure rays(xx,yy,rd)
470 LOCal tn,e: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAR Rink: POINT xx,yy: PENDOWN
480 FOR tn=1 TO 19+RND(40): e=RND(rd): TURNTO RND(360): MOVE e: MOVE -e
490 PENUP: END DEFine
500 :
510 DEFine PROCedure burst(xx,yy,rd,ys,ov,ik)
520 IF ys: ÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAROPEN_INOPEN_NEWCLSCALLRECOL   RANDOMISEPAUSEPOK ov: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVERCURSORATSCALEPOINTLINEELLIPSECIRCLEARCPOINT_RTURNTURNTOPENUPPENDOWNMOVELISTOPENCLOSEFORMATCOPYCOPY_NDELETEDIREXECEXEC_WLBYTESSEXECSBYTESSAVEMERGEMRUNLOADLRUNNEWCLEAR ik: CIRCLE xx,yy,rd: paws 300
530 END DEFine
540 :
550 DEFine PROCedure paws(wait)
560 LOCal p,dud: FOR p=1 TO wait*1: dud=1
570 END DEFine


...and this is how it went in...

Code: Select all

100 ::
110 CLEAR: main: INK 7: QUIT: REMark fireworks2_bas by S.Poole, v20apr20
115 REMark Change line 560 to 'wait *.5' to speed up screen output on Qemu.
120 :
130 DEFine PROCedure main
140 LOCal p,ik,ct,loop,a,time,x,y,ring,dia,Rink,b,inc,fil
150 LOCal yes,nbr,lng,ov,dwn,i$(1): p=5: ik=255: ct=0
170 WINDOW 512,256,0,0: SCALE 100,-75,-50: FILL 0: OVER 0: PAPER 0: CLS
180 REPeat loop
190 FOR a=3 TO 3+RND(5)
200 time=2+RND(3): biz: x=RND(-55 TO 55): y=RND(-25 TO 40)
210 dia=RND(1 TO 80/time): Rink=RND(1 TO 7): ring=RND(6)
220 IF ring: zap x,y,dia: zap x,y,dia: rays x,y,dia
230 FOR b=1 TO 1+RND(12)
240 inc=RND(255): fil=RND(0,1): yes=RND(0,1)
250 nbr=RND(10 TO 19): lng=RND(10 TO 19)
260 IF ring: FOR ov=-1,-1: burst x,y,lng/3,yes,ov,inc: paws 77777
270 spark x,y,lng,inc: i$=INKEY$: IF i$<>"": EXIT loop
280 END FOR b: FOR dwn=1 TO 7: SCROLL dwn
290 END FOR a: END REPeat loop: END DEFine
300 :
310 DEFine PROCedure zap(xx,yy,rd)
320 LOCal f: INK 7,0,3
330 FOR f=-1,-1: OVER f: FILL 1: CIRCLE xx,yy,rd: FILL 0: paws 9999
340 OVER 0: END DEFine
350 :
360 DEFine PROCedure biz
370 FOR f=0 TO 98 STEP time: BEEP 1024,f: paws 22222
380 FOR f=0 TO 64 STEP time: BEEP 1024,f: paws 999
390 END DEFine
400 :
410 DEFine PROCedure spark(xx,yy,rd,ik)
420 LOCal tn,e: PENUP: INK ik,ik+4,3: rd=rd/2: FOR tn=5 TO RND(30)
430 e=RND(rd): TURNTO RND(360): MOVE e: CIRCLE_R 0,0,.6: MOVE -e: BEEP 256,255
440 END FOR tn: END DEFine
450 :
460 DEFine PROCedure rays(xx,yy,rd)
470 LOCal tn,e: INK Rink: POINT xx,yy: PENDOWN
480 FOR tn=1 TO 19+RND(40): e=RND(rd): TURNTO RND(360): MOVE e: MOVE -e
490 PENUP: END DEFine
500 :
510 DEFine PROCedure burst(xx,yy,rd,ys,ov,ik)
520 IF ys: OVER ov: INK ik: CIRCLE xx,yy,rd: paws 300
530 END DEFine
540 :
550 DEFine PROCedure paws(wait)
560 LOCal p,dud: FOR p=1 TO wait*1: dud=1
570 END DEFine
580 ::::


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

Re: Happy Birthday!

Postby stevepoole » Wed May 20, 2020 6:51 am

Hi Bwinkel67,

Line 420 has the statement INK ik,ik+4,3, where ik+4 can take the value 255+4. ( SMSQ/E converts this within range using MOD. )

So, try changing line 240 to read inc=RND(251) . ( QDOS does not do range checking and conversion, it would appear ).

But I am at a loss to see why that would corrupt the ' OVER ' entry in the name-table to ' ÿVER ' !

Hope this fix will work though...

Steve.


User avatar
tofro
QL Wafer Drive
Posts: 1881
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Happy Birthday!

Postby tofro » Wed May 20, 2020 7:00 am

Depending on the ROM version used, QLAY might simply crash/corrupt the program because of too many LOCale variables in the procedures.
Weird things happen on older (older than JS) ROMs (even on "real" QLs) when more than eight local variables are used.

Using Minerva ROM on the emulator would cure that.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
bwinkel67
Gold Card
Posts: 330
Joined: Thu Oct 03, 2019 2:09 am

Re: Happy Birthday!

Postby bwinkel67 » Wed May 20, 2020 7:46 am

So using Minerva got rid of the corruption but it now crashes at line 420:

At line 420;3
bad parameter

I tried steve's hack and still got the same error. At least it's not corrupting anymore.


User avatar
NormanDunbar
Aurora
Posts: 986
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Happy Birthday!

Postby NormanDunbar » Wed May 20, 2020 8:18 am

This is a polite request!

Gents, you have hijacked the "Happy Birthday" thread. Would it be better to continue this conversation on a new thread? This will help to avoid confusing us old folks who come here looking for good news, happiness and to see who is catching us up in the age stakes! :D (Said the old git!)


Disclaimer: I'm not a forum moderator, nor do I play one on TV.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890

Who is online

Users browsing this forum: No registered users and 8 guests