SEDORIC extended BASIC commands syntax samples/manual?

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Steve M wrote: Mon Nov 02, 2020 8:49 pm So Sedoric v3 is probably the best option for most. I've attached the manual.
Thank you so much! Wish I would have had it earlier, although it was good for my French to struggle with the French version.....
Now finally understand why RESTORE linenumber did not work. Did not understand there needed to be a ! at the start.
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Finally getting hold of the English Sedoric 3 manual (thanks again Steve!) I noticed the KEY OFF and KEY SET commands.

One of the minor things that still nagged me about my program is that if you push a button to often it remembers that button, making the next popup waiting for a key immediately to disappear again.
In my original code on the C128 I had a POKE code for this in the code to clear the keyboard buffer, but did not find an equivalent yet on the Oric.

So the KEY OFF and KEY SET commands seemed a solution, as it bascially shuts off the keyboard, so also no keypress to be remembered. And according to the manual, the code even runs 20% faster with KEY OFF, so great.
Indeed doing this prevents keys to be remembered and pop-ups to disappear directly again.
However, with a big downside, it was completely screwing up the music played. Which sort of makes sense, as KEY OFF / KEY SET interfere with the interrupts, while also the music routine runs via interrupts.
So is it indeed normal behaviour that setting KEY OFF and KEY SET again and again does not play nice with the music playing routines? Anyone tried this? And maybe came with a workaround?

For now removed the KEY OFF and KEY SET commands again as I did not want to sacrifice music for it.
Looking for alternatives, I saw this article on the OSDK site: https://osdk.org/index.php?page=articles&ref=ART16
Nothing on a keyboard buffer there and clearing it, but I did see that the last keypress is apparently at address 735 ("$2DF (735) Contains the ASCII code + 128 of the last pressed key"). So thought, lets try POKEing a zero to 735 and see if that helps.
And yes, it does seem to work. Is this indeed the way to clear a keyboard buffer and remove any last pressed key?

See that the article I refer to is intriguingly called Keyboard handling (1), so will there be a part (2) that maybe also covers this?
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Dbug wrote: Fri Oct 30, 2020 10:22 am Well, you can mix and match labels and line numbers.
You can totally add a label that matches the existing line of a function, and use that for new code
Decided to use labels after all. Makes the code much easier to maintain and much more reusable.
So fully cleaned the code, labelled al GOTOs and GOSUBs and removed the line numbers. Added #optimize as well.

Gives indeed very readable source code and indeed compact target code.
User avatar
ibisum
Wing Commander
Posts: 1645
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by ibisum »

>Nothing on a keyboard buffer there and clearing it, but I did see that the last keypress is apparently at address 735 ("$2DF (735) Contains the ASCII code + 128 of the last pressed key"). So thought, lets try POKEing a zero to 735 and see if that helps. And yes, it does seem to work. Is this indeed the way to clear a keyboard buffer and remove any last pressed key?
Yes, #2DF contains the last keypress. If it is XOR'ed with #80, it sets the char to having been processed (ROM routine sets it OR #80 to indicate needs processing..)
Gives indeed very readable source code and indeed compact target code.
I have to admit to being quite interested in your discoveries with SEDORIC. Will you open the sources when the game is released, or perhaps do other blog/articles on your discoveries? I think SEDORIC gives Oric a bit of heft ..
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by Dbug »

xahmol wrote: Wed Nov 04, 2020 9:09 am See that the article I refer to is intriguingly called Keyboard handling (1), so will there be a part (2) that maybe also covers this?
Yes, there will be a second part, but it's about programming the keyboard 100% in assembler, so not really for BASIC use.

I don't really see why the keyboard buffer is impact you, but at worse you could just make a "debounce" function that empties the buffer before you do a proper wait:

Code: Select all

IF KEY$<>"" THEN GET K$
That should be good enough to eat any key present in the buffer
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Thought of that later as well to use KEY$. Anyhow: the POKE works as well.

And why does it bother me: I noticed that if you by accident press a key the next Wait for key popup automatically goes further. So apparently there is some kind of buffer.
Post Reply