Prospero Pascal BEEP

Anything QL Software or Programming Related.
User avatar
tofro
QL Wafer Drive
Posts: 1964
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Prospero Pascal BEEP

Postby tofro » Tue Jun 30, 2020 11:48 pm

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: 1088
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Prospero Pascal BEEP

Postby NormanDunbar » Wed Jul 01, 2020 8:27 am

I alwys mss out some ky prsses!


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
stevepoole
Gold Card
Posts: 309
Joined: Mon Nov 24, 2014 2:03 pm

Re: Prospero Pascal BEEP

Postby stevepoole » Sat Jul 04, 2020 11:16 pm

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
Gold Card
Posts: 309
Joined: Mon Nov 24, 2014 2:03 pm

Re: Prospero Pascal BEEP

Postby stevepoole » Mon Jul 20, 2020 7:53 am

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
QL Wafer Drive
Posts: 1964
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Prospero Pascal BEEP

Postby tofro » Mon Jul 20, 2020 8:12 am

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
Gold Card
Posts: 309
Joined: Mon Nov 24, 2014 2:03 pm

Re: Prospero Pascal BEEP

Postby stevepoole » Mon Jul 20, 2020 10:35 pm

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
Gold Card
Posts: 309
Joined: Mon Nov 24, 2014 2:03 pm

Re: Prospero Pascal BEEP

Postby stevepoole » Fri Jul 24, 2020 10:36 pm

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.



Who is online

Users browsing this forum: No registered users and 9 guests