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:

SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

TLDR: Can somebody point me to syntax samples and code examples of the extended BASIC commands provided by SEDORIC?

I did find these resources:
http://oric.free.fr/DISKS/sedoric.html
This gives a nice English SEDORIC manual. Alas it is very sparse in syntax samples of the added BASIC commands.

https://www.defence-force.org/computing ... /index.htm
This is much more extensive, also giving some syntax samples. But would still love to see more samples as not everything is clear to me. The French language also does not help. Can follow it mostly in French, Google translate helps a bit for the rest (although it confuses more often than clarifying), but some bits I just can not get to work (see below).

I also see that both seem to describe rather old SEDORIC versions. Also would like to understand the differences between SEDORIC versions 1, 2, 3 and 4. Especially in the added BASIC commands.

Any suggestions?

Longer background

At the moment I am busy with a project porting one of my old Commdore 128 BASIC7 listings (written in 1992) to the Oric.
The listing is a port of the Ludo game. So nothing groundbreaking, just a fun excercise. But did see that the Software archive on Oric.org actually only lists one Ludo clone under that name which is not downloadable, so maybe it actually does add something. Will share source of course if I am confident enough to share it.

I obviously encounter some nice challenges, the most obvious ones being:
1. The biggest one: the C128 has 80 colums screenwidth instead of just 40 on the Oric. Need for some serious rework on screendesign therefore;
2. I used user defined charsets on the C128 for the graphics. Obviously can do the same on the Oric, but converting 8x8 pixel based charsets to 6x8 pixel based charsets gives need for compromises. As also the screendimension is 40 width instead of 80, graphics need to be rededigned anyhow;
3. On my C128 listings of that time, I borrowed some windowing routines that made a menu and windowing system by basically storing the screen in the upper 64k RAM bank (that was mostly unused by BASIC anyhow), plotting the menu and restoring the screen to remove the menu. Menus could get up to three 'deep', meaning three full screen dumps stored in memory. Obviously such ample memory space to store up to three screendumps would be an issue with the memory size of the Oric. So need to find an alternative.
4. Obviously the BASIC dialects differ: Commodore BASIC 7.0 is actually not that different from Oric Atmos BASIC and while some commands are not exactly the same, similar commands exist. For example DO...WHILE (C128) becomes REPEAT...UNTIL (Atmos). But what gives my biggest search for alternatives right now have been INSTR (to search in a string) and RESTORE Linenumber, which both do not exist in standard Atmos basic.
5. Another big challenge is screen printing and especially using colors. Replacing al those nice Commodore cursor steering characters and color characters to print@ and CHR$(27) sequences is doable, just cumbersome. So far no issue. But something that I completely had forgotten from my old Atmos days is that changing paper and color via CHR$(27) sequences and PRINT@ changes the color for the remainder of the line. Which is a headache if you are printing a pop-up window over existing graphics. Have to find solutions for that or ways to minimize the impact (such as placing popups only completely to the right of the screen as much as possible).

I think I am able to solve the charset issues and the screen dimension issues myself with some trial and error and manually converting each char of the C128 charsets to the Oric charset and the Oric alternative charset.

In my search I found that SEDORIC actually provides some additional BASIC commands that promise to help me with some of the other issues. Managed to figure out some, but others I can not get working whatever I try.
Which is ideal, as I use a Cumana Reborn so wanted to create my program with disk support using SEDORIC anyway.

My present coding workflow is to copy paste and adapt the BASIC sources in VS Code on my PC and building the BASIC source to a SEDORIC disc using OSDK. Testing on Oricutron before I transfer to my real hardware.
Editing the character sets with https://forum.defence-force.org/viewtop ... 638#p22638

INSTR:
This one I actually did figure out. Was clueless with the English manual before, but the more extended French one learned me that I needed to use the IN variable to find out the position of one string in another string.
I used this to translate a character input routine waiting for a key pressed that corresponds to a character in an input string like this. Works, to be added is joystick support later but no clue yet how to do that and can not test that either as my joystick support options for the Atmos are in pre-order still.

Code: Select all

 15360 REM "--- ASK FOR KEYPRESS OR JOYSTICK ---
 15370 :
 15380 REPEAT
 15390 : GETAW$: INSTR TT$,AW$,1
 15400 : REM PLACEHOLDER FOR READING JOYSTICK, TO BE ADAPTED LATER
 15470 UNTIL IN>0
 15480 RETURN
 
Windows and menu routines:
First I got excited by seeing the CREATEW and WINDOW commands listed as new, as that looks like something to use as subsitute for the C128 windows routines I use. From both manuals I do only not understand exactly what these commands do, what to use them for and how to use them with what syntax. My trial and error attempts either did nothing or gave syntax errors.

Then I thought that, if I obviously can not use internal RAM to store anything above three screens, I might just save the screens to disk if I use disk anyway. Cheating maybe, but with flash on my Cumana Reborn it is probably also quick enough.
And voila, SEDORIC has an additional command to store screens to disc, ESAVE.

So now did this, the AD variable being the adress counter variable in my C128 routines originally, that I now use as screen counter just starting at one:

Code: Select all

 15030 REM "--- SAVE SCREEN ---
 15040 :
 15050 ESAVE "LUDOSCR"+STR$(AD): AD=AD+1: RETURN
 15060 :
 15070 REM "--- LOAD SCREEN BACK ---
 15080 :
 15090 AD=AD-1:LOAD "LUDOSCR"+STR$(AD): DESTROY "LUDOSCR"+STR$(AD):RETURN
 15100 :
 
But gladly would here suggestions for alternatives. Even better if there are BASIC usable machine language libraries for it. Was already thinking that IF I wanted to have any chance to do this in memory, it would be needed not to save the whole screen everytime, but only the part that I actually use for the pop-up menu.

And still searching for a solution that if I print anything in my pop-op menu in different colors than the background of that menu, everything after any menu line becomes the colors used in the last time I changed color in that menu line. Of course that is solved by loading the original screen back after the menu is closed, but it is a nuance aesthetically for the time the menu is showed.

RESTORE to linenumber
Not a big issue, but my original listing reads DATA lines not in the order that those DATA lines are present by pointing to those datalines with RESTORE linenumber.
Did not chose to to this deliberately, but was caused as the windowing routines have been borrowed from work from somebody else, including the DATA lines used for the menudata.
As all data is only read once as far as I know, in principle I can easily solve this by reordering the READ statements in the proper order of the DATA lines. Less clumsy code anyhow.

But SEDORIC listing RESTORE linenumber as additional command triggered me to actually use this instead.
However, regardless the syntaxt I try, the only thing I get is SYNTAX error. Any ideas?
Tried RESTORE 16670 , RESTORE16670 and RESTORE (16670). And 16670 is an existing line number with a DATA statement (which according to the SEDORIC manual is not even mandatory).

Sequential file handling
Did not come to conversion of this part yet, so do not know yet if I will figure this out correctly myself or not. The C128 listing uses sequential files on disk for save games.
But also samples on how to best use the SEDORIC commands for sequential file creation, manipulation and reading would be welcome.


Any ideas, suggestions and pointers to additional resources are welcome!
Also feel free if you have way better alternatives to do stuff I am trying to do. Apart from converting my listing to C or assembly ;-) Want to start simple with BASIC to BASIC first.
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 »

Cool project, and nice to hear your thoughts. For my part, I've also been bashing away at some Oric things over the years, and had a period of interest in SED programming on Oric, but lately I am finding the OSDK C compiler mixed with Assembly to be a bit more appealing. Old and grump factor, I suppose.

As usual, I find myself referring to the knowledge of Twilighte:

http://twilighte.oric.org/twinew/demos.htm

He developed a few demo ideas along a similar line as you've described, it seems he was particularly competent at throwing together his screens and demo's with good ol' SED (and Assembly, like a bad-ass), and you just cannot go far into the Oric and indeed SEDORIC territory without seeing his lines in the sand before you:

http://twilighte.oric.org/twinew/wurldemo.htm

Check out the wurlde.dsk demo, or indeed any of the demo's that use load-from-disk design to scroll through images.

He also had tackled the windowing issue, but I can't for the life of me find the one demo he had that did super fast menu's .. I'm positive I've seen his demo's using SED for menu functionality.

Anyway, keep up the great work, and keep us posted!
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 »

Thanks @ibisum !

While not an answer on SEDORIC syntax you actually helped me a lot!

Forgot all that complicated attributes stuff, especially the part that attributes actually take space on the screen.
Yikes! Now I understand why my pop-ups kept misaligning by oe space or two, that is the attribute character....
Comes all back now, completely forgotten it after 35 years of not programming an Oric.

So much for directly converting the Commodore color codes.
Did look into the BASIC code of Twilighte GULP demo. See that his screen layout leaves spaces between the blocks for the color attributes. Smart. Will use that, certainly possible to leave spaces between the game board spots (but makes using only 40 chars screen width even more challenging).
Also found this excellent article: https://osdk.org/index.php?page=articles&ref=ART9

So I guess I have now to find a clever color scheme to make my design as colorfull as possible while minimizing the spaces left by the control attributes. And think of the best plotting method to print. Certainly will have a look into the use of the inverted colors now.
Almost tenpted to go easy and go monochrome.... but that would be a shame.

All in all more work than expected. But looked positively: more challenge in the project ;-)

Also now understand why most Oric games tend to use the same colorschemes.
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 »

Also found this other gem from Twilighte on this forum: https://forum.defence-force.org/viewtop ... f=14&t=533

Works fine. Will use that one to design my main screen map. That already spares plotting headaches on that one. And will be memory effective as in the BASIC listing of course just loading this map from disk is way shorter than coding the whole screen in BASIC.

By the way: anyone who ported those Twilighte graphic editing tools or similar to a Windows IDE? Of course working in Oricutron is doable, but an integrated IDE with GUI, OSDK, Charedit and these graphic utils would be sweet..... Especially as I am spoiled with such tools for Commodore development already.
I am not one of those people who think the only way to be cool is to use the hard core retro style tools..... I am fully pragmatic as long as the end result works on original hardware :D But again: as I am also not going to write them myself I am not allowed to complain either....

(indeed impressed more and more by Twilighte. Also missed his work and influence completely in the past 35 years. Shame he is no longer around)
User avatar
Chema
Game master
Posts: 3014
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by Chema »

About Twiligthe... it was a devastating loss. I just cannot imagine all the wonders that could have come out from his talented mind if he were still here...

He will always be missed.

:(
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 »

Twilighte was a font of glorious knowledge for us Oric hackers. Fortunately he pushed a lot of stuff to his repo's - there is deep, deep knowledge to be gained by reading the sources of his projects. If you haven't already, check out the amazing use of attributes in PULSOIDS and Wurlde .. he was truly in a stratospheric league. I have spent many days reading his code in wonder ..

As for his HIDE tooling: USE THE ORIC, ya bum! :) /ducks
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 »

Update:
Made progress on the screen design. At least the BASIC game I can now fit using the intended colors with all attribute spaces needed.
I now use both standard and alternate charset, so next challenge will be to see if I can place pop-up windows on top without destroying graphics underneath. But as leading and traling spaces in the pop-ups are actually not that much an issue I have ideas that maybe work.

Not sure if I am entirely happy with the charsets yet, especially the pawns look rather fat now (even though they already by necessity shrank from 16 pixels to 12 pixels witdh). Font looks completely different than the original coming from 8 width to 6 width, but actually not too unhappy with them. Might tweak somewhat later.
But glad that a Proof of Concept design seems to be workable. Also with enough space left for non-pop up game messages.

Original in VICE 128 emulator (original is in Dutch, but thought that doing an English version makes more sense if I want to share):
screenshot main screen.png
Converted to Oric in the Oricutron emulator:
Screenshot main screen design.png
Screenshot main screen design.png (10.79 KiB) Viewed 6810 times
On my original hardware:
APC_0008.jpg
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 »

Also remember that on real screens, with the real oric, pixels are not square, they are squished (so if you do CIRCLE that you get is not a circle but a flattened ellipse), that being said, I know this game, I played it a lot when I was younger, kept cursing my mum because the kept doing double six dice rolls!
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 »

Last picture is from a real Oric on a real CRT. Not that unhappy with the circles actually.
And I do not use the CIRCLE command (too slow) but alternate char set graphics. All in TEXT mode.
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 »

Coming along nicely - I don't think the pawns are too fat. I look forward to seeing how you handle the menu situation.

Nice work!
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 »

ibisum wrote: Fri Oct 16, 2020 6:22 am I don't think the pawns are too fat.
Might be that I compare to the original too much ;-) But of course 80 times 8 pixels screenwidth is something completely different than 40 times 6....
Begin to remember why I loved C128 80 column mode so much.

On the menus: have some ideas that should work. On the menus actually leading spaces are not that bad and even are looking better. That should give room to change color attributes. Just need to figure out how to best place them as I need three attribute places: change to standard charset instead of alternative, change paper and change ink. And three leading spaces might be a little bit much, especially as I then also need three trailing spaces to look symetrical, already taking 6 spaces of only 40.....

Could of course go for using only capital letter text and use the lower case letters for the graphics instead of an alternate charset. But prefer to try the alternative charset route first as using also lower case letters in the UI looks 'friendlier'.

Looked into using inverse characters: but honestly the inverse colors if not just black and white look plain ugly and 'screaming'. Only Blue/Yellow is somewhat usable next to black/white, but still not entirely my taste. Do understand now why so much Oric software seems to use the black/white/yellow/blue color scheme.
I also now remember why I in my youth never encountered this being a limitation: was working on a black and white CRT TV back then as I was not allowed to use the only color TV in the living room for computers.... Think I might be shocked by the screaming colors of my own programs back then if they would not have been lost in time (did alas not yet found any of my Oric tapes of that time). Green/magenta on a black and white TV probably looked like perfectly acceptable dark versus light grey....
Only got a color monitor with my C128 later, and my original Atmos did already break down by then (shame I did not keep it as I now know most broken Atmosses can actually be repaired).

Thinking now I might 'cheat' a bit and align all pop-ups to the complete right of the screen. At least in that case I do not need to worry about the attributes being incorrect to the right of the pop-up, sparing me the space needed to set charset, ink and paper back. Otherwise it quickly becomes complex. And as screenwidth is limited to begin with I probably already need to align pop-ups to the right just to be able to get sufficient place to fit the text in....
For the pulldown menus on the top I have left a few lines blank before the game board starts, so no need for an attribute to change charsets there as long as I keep the menu options limited to these number of lines....
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 »

> (did alas not yet found any of my Oric tapes of that time).

I rue the day I gave my old tapes to my little sister to "do whatever she wanted with them" .. ah the memories lost.
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 »

Yay! My popups are working to my satisfaction.
Schermafbeelding 2020-10-16 231129.png
Schermafbeelding 2020-10-16 231129.png (11.18 KiB) Viewed 6623 times
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 »

Update: decided that I will not use disk saves for the windows after all. They were fast enough in Oricutron, but a tad too slow for my taste on my real Atmos with the Cumana Reborn.
And more importantly, have added background music and found out that disk operations pause the music. As I use the windows often, this gets quite anoying.

So went for machine code and copying to memory after all. Decided to use the HIRES memory area as target as the windows work in TEXT mode only anyway. My assembly skills are close to zero as I never cared to learn much in the past, but I actually managed to adapt the memcpy routine from the standard OSDK library to my taste and to be able to call it from BASIC with input from BASIC (instead of from the C stack as the library function).
Also decided to only copy the lines which are actually used by the window to limit memory needed.
And it works now! Is indeed faster on original hardware and music keeps playing.

Also pleased that apparently I managed to understand just enough of 6502 assembly to be able to slightly adapt an existing source to my needs. Joined it with the mymplayer source to have both a music player and the windowing memcopy code there. Will of course credit DBug for the OSDK sources.

Next: adapting the main game logic. Is more work than I first thought as Oric BASIC misses some structured programming commands that Commodore 128 BASIC does have.
Commodore 128 BASIC has nice nested multiline IF THEN ELSE structures using BEGIN and BEND commands like:

Code: Select all

 12110 :     ifnr=1thenbegin
 12120 :       ifvn>7thengv=1:elsebegin
 12130 :         form=0to3
 12140 :           ifn<>mandsc(bs,m,0)=1andsc(bs,m,1)<=vnandsc(bs,m,1)>3thengv=1:m=3
 12150 :         nextm
 12160 :       bend
 12170 :     bend
 
So have to redo those nested IF THEN ELSEs with GOTO statements I guess.

(oh, and Commodore uses standard lower case for BASIC commands if converted to ASCII, while lower case if transferred to Oric gives incorrect syntax, but that is luckily just a Transform to Uppercase...)
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 »

Regarding memcpy, I've been thinking in adding a variant of memcpy with two "stride" and a second counter which could be used to copy rectangular areas by automatically skipping some data, basically the equivalent of that, but in assembler:

Code: Select all

void blockcpy(dest,source,width,height,dest_stride,source_stride)
{
   while (height--)
   {
       memcpy(dest,source,width)
       dest+=dest_stride
       source+=source_stride
   }
}
Post Reply