Prospero Pascal BEEP

Anything QL Software or Programming Related.
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Prospero Pascal BEEP

Post by tofro »

NormanDunbar wrote:There's a missing 'e' in "KeyPressd" when Regs.D0 <> 0. :(
.
Yeah. Apparently, I missed a KeyPrss. :D

Thanks, Norm. Fixed.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Prospero Pascal BEEP

Post by NormanDunbar »

I alwys mss out some ky prsses!


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Prospero Pascal BEEP

Post by stevepoole »

Hi Folks,

Thanks to Tofro, we now have both BEEP and INKEY$ routines for Prospero Pascal which work fine.

So now we can produce Pascal games (with the equivalent of RANDOMISE), with full sound...

Our aim is to transcode QL programs to run on other systems.... DONE !

But we write our code first on QLs, which are great for prototyping...

QL Forever !

Steve.


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

Re: Prospero Pascal BEEP

Post by stevepoole »

Hi everybody,

1) Turtle graphics, (pendown, penup, turnto, turn and move), are missing on Prospero Pascal.
Has anyone been able to implement these for that language ?

2) Restore, read and data are also missing, but I doubt if they can be emulated ?
(Workarounds are possible, if clumsy) !

Many thanks for past advice.
Steve.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Prospero Pascal BEEP

Post by tofro »

Turtle graphics are not part of QDOS - They are implemented by the SuperBASIC interpreter. If you want them in Pascal, you'll need to implement a library (nice little educational task, btw).

RESTORE, READ and DATA are "interpreted-language constructs" and are entirely not needed in Pascal - Everything these statements do can much easier be implemented using CONST expressions in Pascal. (BTW: I rather think the BASIC way of storing constant data in the interpreted program is "clumsy". For every constant in DATA you need twice the amount of memory than you need in Pascal - a CONST is only stored once.)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: Prospero Pascal BEEP

Post by stevepoole »

Hi Tofro,

Many thanks for your advice. It will save a lot of thrashing around !

I can convert turtle graphics using standard geometry routines. (I did such things many years ago, but they are lost on microtapes, so I will need to do them again...).
As for reading data, I must study the Pascal Manuals again, to see how to grab huge amounts of data using nested FOR loops. This is new domain for me, and I hope to find some useful examples, with any luck.

All this is needed for a program which produces optical illusions, with very short code, a few turtle instructions, but masses of data...

If the holiday weather turns foul, I will start work on it earnestly before autumn...
Regards,
Steve.


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

Re: Prospero Pascal BEEP

Post by stevepoole »

Hi Tofro,

The Illusion program is now transcoded into Prospero Pascal, after the usual teething troubles :

Routines have to be entered in reverse call order. Apparently their is a Forward command to avoid this !
PENUP means calculating LINES, but not drawing them : Easy when twigged...
Turtle commands are easily calculated using cumulative trigonometry, even though verbose.
Restore, Read & Data : arrays were avoided using string-type integers to keep the code short,
For loops with STEP: meant using 'repeat-until' loops, with various counters.

Finally your 'keypressed' function has proved very useful for debugging !
My learning curve is improving rapidly now.
Many thanks again for your help.

Steve.


Post Reply