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
Dbug
Site Admin
Posts: 3456
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by Dbug »

I've personally never used things like TAKE and PUT, or the equivalent on TAPE, found that way too complicated to use, in general I just use a block of memory that I just load and save directly.

Question: Are you editing the BASIC code directly on the Oric (emulated or not), or are you doing that on a modern machine on a real text editor and then use Bas2Tap to convert the source code?

User avatar
iss
Wing Commander
Posts: 1127
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by iss »

xahmol wrote:
Fri Oct 30, 2020 8:01 am
... will I then also loose those commands?
I've checked with !MOVE#BB81,#BB81+40,#BB80 command after !QUIT and it works fine (i.e. it moves the 'CAPS' label one position to left). So all extended command should work too.
xahmol wrote:
Fri Oct 30, 2020 8:01 am
... the cure is worse than the disease.....
Actually I suggested this approach not as cure but only to help to put the right diagnosis of the problem ;).
But anyway, sometimes '!QUIT' is real painkiller!

xahmol
Pilot Officer
Posts: 114
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 9:25 am
I've personally never used things like TAKE and PUT, or the equivalent on TAPE, found that way too complicated to use, in general I just use a block of memory that I just load and save directly.
That is actually a very good idea and certainly doable! Good suggestion! Just need to find a memory block that is still free then ;-) And find/learn the syntax for saving a memory block to disk.
Will do that if I do not find another fix. Just it irritates me tremendously that my present routine works sometimes and sometimes not. If it did not work alltogether it would be easier to accept.
Dbug wrote:
Fri Oct 30, 2020 9:25 am
Question: Are you editing the BASIC code directly on the Oric (emulated or not), or are you doing that on a modern machine on a real text editor and then use Bas2Tap to convert the source code?
The latter. Use Microsoft VSCode to edit the code, copy pasting in VSCode from the original Commodore BASIC 7.0 code to the Oric code and adapting it.
Then use the make.bat routine from OSDK.

By the way: is it normal behaviour that the OSDK Basic converter inject a character after ' or REM lines to make the line after the remark statement green? Code works so apparently not harmful. And it looks cool as long as the REM line keeps on one line (as the C128D original was written on an 80 column screen, the original REM statements were becoming two line statements on the Oric). But wanted to know if it is normal, or something coming from using VSCode.

Borrowed the Music Player demo build script and adapted it (you probably recognise large parts of the script ;-) ):

Code: Select all

@ECHO OFF


::
:: Initial check.
:: Verify if the SDK is correctly configurated
::
IF "%OSDK%"=="" GOTO ErCfg

::
:: Launch the compilation of files
::
SET OSDKNAME=LUDO
SET OSDKFILE=LUDO
CALL %OSDK%\bin\make.bat LUDO

SET OSDKNAME=LUDOMAIN
SET OSDKFILE=LUDOMAIN
CALL %OSDK%\bin\make.bat LUDOMAIN

::
:: Assemble the music player
::
ECHO Assembling music player
%osdk%\bin\xa mymplayer.s -o build\mymplayer.o
%OSDK%\bin\header -h1 -a0 build\mymplayer.o build\mymplayer.tap $6500


::
:: Convert musics
:: ym1.mym -> 8699 bytes
:: ym2.mym -> 7293 bytes
:: ym3.mym -> 7956 bytes
::
:: HIRES last usable memory area is $9800 / 38912
:: - 8657 -> $762f / 30255
:: Round to -> $7600 / 30208 this gives us $2200 / 8704 bytes for the music
::
:: TEXT last usable memory area is $B400 / 46080
:: $B400-$7600  gives us $3E00 / 15872 bytes for the music
::
:: So we make each music load in $7600
::
:: The depacking buffer for the music requires 256 bytes per register, so 256*14 bytes = $e00 / 3584 bytes
:: If we place the buffer just before the music file, it will start at the location $7600-$e00 = $6800 / 26624
::
:: And just before that we put the music player binary file, which will start by two JMP:
:: - (+0) JMP StartMusic
:: - (+3) JMP StopMusic
::
:: The music player itself is less than 512 bytes without counting the IRQ installation and what nots so could start in $6600, say $6500 for security
::
echo %osdk%

SET YM2MYM=%osdk%\Bin\ym2mym.exe -h1 -m15872

%YM2MYM% "Music\R-Type  2 - level 1.ym" build\R-Type.tap                $7600 "Music1"
%YM2MYM% "Music\Axel F.ym" build\AxelF.tap                              $7600 "Music2"
%YM2MYM% "Music\Wizball 1.ym" build\Wizzball.tap                        $7600 "Music3"

::
:: Rename files so they have friendly names on the disk
::
%OSDK%\bin\taptap ren build\LUDOSCRM.tap "LUDOSCRM" 0
%OSDK%\bin\taptap ren build\LUDOTITL.tap "LUDOTITL" 0
%OSDK%\bin\taptap ren build\LUDOCHRS.tap "LUDOCHRS" 0
%OSDK%\bin\taptap ren build\mymplayer.tap "LUDOMACO" 0

ECHO Building DSK file
%OSDK%\bin\tap2dsk -iCLS:LUDO -c20:3 -nLUDO build\LUDO.tap build\LUDOMAIN.tap LUDOFOTO.hir build\LUDOTITL.tap build\LUDOSCRM.tap build\mymplayer.tap build\R-Type.tap build\AxelF.tap build\Wizzball.tap build\LUDO.dsk
%OSDK%\bin\old2mfm build\LUDO.dsk

GOTO End

::
:: Outputs an error message
::
:ErCfg
ECHO == ERROR ==
ECHO The Oric SDK was not configured properly
ECHO You should have a OSDK environment variable setted to the location of the SDK
IF "%OSDKBRIEF%"=="" PAUSE
GOTO End


:End
pause
Last edited by xahmol on Fri Oct 30, 2020 9:51 am, edited 4 times in total.

xahmol
Pilot Officer
Posts: 114
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

iss wrote:
Fri Oct 30, 2020 9:28 am
Actually I suggested this approach not as cure but only to help to put the right diagnosis of the problem ;).
But anyway, sometimes '!QUIT' is real painkiller!
Did understand that ;-) Was not suggesting not to try, I will.
Just was thinking ahead that if this solves issues, I will have a major headache if that also disables the extended BASIC commands.

Will try to adapt code with ! in front of all Sedoric commands. Is some work, as SEDORIC commands are all over the place in my program, not just the LOAD and SAVE routines. And really need to get some paid work done first....

But grateful already for the constructive and helpful suggestions,

User avatar
Dbug
Site Admin
Posts: 3456
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:
Fri Oct 30, 2020 9:42 am
By the way: is it normal behaviour that the OSDK Basic converter inject a character after ' or REM lines to make the line after the remark statement green? Code works so apparently not harmful. And it looks cool as long as the REM line keeps on one line (as the C128D original was written on an 80 column screen, the original REM statements were becoming two line statements on the Oric). But wanted to know if it is normal, or something coming from using VSCode.
Since we have all the freedom of the world when we are on the PC, I added my own set of tweaks to the OSDK version of bas2tap, including the one you are mentioning which changes the colors of comments to make them appear in color when you list:

https://osdk.org/index.php?page=documen ... ge=bas2tap

The -color[0|1] switch set if the REM and ' statements should be colorized or not

Then when I was working on my "Encounter HD" project, I added auto-numbering with labels, and file size optimization, defines, and some easier way to escape codes without having to use CHR$(27) everywhere.

Using these features, you can easily reduce the size of your program by 20% (but of course the end result on screen become very unreadable since the formatting vanishes), and up to 10% speed increase since all the white spaces and other stuff the parser needs to go through are removed.

xahmol
Pilot Officer
Posts: 114
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Ah. Really should study all documentation first before asking ;-)
Actually did read it at some point, just thought, OK, maybe nice for later and forgot. Especially because I was copy pasting from existing code, so using labels in stead of line numbers would actually increase instead of decrease work. Just now wished I did remember avoiding all those CHR$(something) though. Definately will look into that one.
But thanks!
Will also look at the other options. Less space and faster sounds great. But as indicated, not handy for debugging, so will do only after getting the code at least to a somewhat working state first.
Last edited by xahmol on Fri Oct 30, 2020 10:24 am, edited 1 time in total.

User avatar
Dbug
Site Admin
Posts: 3456
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by Dbug »

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

xahmol
Pilot Officer
Posts: 114
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 9:25 am
in general I just use a block of memory that I just load and save directly.
Did change my code to do that, and it now works flawlessly! Did multiple save and loads without any issue now. So thanks for the hint!
Apparently it is difficult to make stable routines with TAKE and PUT under Sedoric?

@Iss: Thanks also for your constructive thoughts. Did not test the !command approach as now this alternative works.

Can doubtlessly be done better/more elegant/more efficiently, but my save / load routine now is (error handling still to do):

Code: Select all

 12900 'SAVE GAME
 12910 :
 12920 XC=8:YC=8:B=30:H=7:GOSUB16100
 12940 PRINT@10,10;CHR$(130);"Save game.";CHR$(129)
 12960 PRINT@10,12;CHR$(131);"Enter filename:";CHR$(129)
 12970 XC=10:YC=14:ML=8:TT$=AL$:GOSUB15740:GOSUB15090:IFAN$=""THENRETURN
 12980 AN$=AN$+".SAV"
 12990 'ERR SET: ERRGOTO 13320
 13000 SEARCH AN$
 13020 IFEF=0THENGOTO13120
 13030 : XC=8:YC=8:B=30:H=8:GOSUB16100
 13050 : PRINT@10,10;CHR$(131);"Filename exists.";CHR$(129)
 13060 : PRINT@10,11;CHR$(131);"Replace?";CHR$(129)
 13070 : XC=15:YC=13:MN=5:GOSUB15130
 13080 : GOSUB15090
 13090 : IFM=2THENRETURN
 13120 AS=#B001
 13130 POKE #B000,BS
 13140 FORN=0TO3
 13145 : IFNP(N)<0THENPOKEAS,256+NP(N)ELSEPOKEAS,NP(N)
 13150 : AS=AS+1
 13160 NEXTN
 13170 FORN=0TO3
 13180 : FORM=0TO3
 13190 :   POKE AS,SP(N,M):AS=AS+1
 13200 : NEXTM
 13210 NEXTN
 13220 FORN=0TO3
 13230 : FORM=0TO3
 13240 :   POKE AS,SC(N,M,0): AS=AS+1
 13250 :   POKE AS,SC(N,M,1): AS=AS+1
 13260 : NEXTM
 13270 NEXTN
 13280 FORN=0TO3
 13285 : POKE AS,LEN(SP$(N)):AS=AS+1
 13285 : FORM=1TOLEN(SP$(N))
 13290 :   POKE AS,ASC(MID$(SP$(N),M,1)):AS=AS+1
 13295 : NEXTM
 13300 NEXTN
 13310 SAVEO AN$,A#B000,E#B100
 13311 'ERR OFF: RETURN
 13312 'ERROR HANDLING
 13320 'GOSUB16410: ERR OFF
 13330 RETURN
 13340 :
 13350 'LOAD GAME
 13360 :
 13370 XC=8:YC=8:B=30:H=8
 13371 GOSUB16100
 13390 PRINT@10,10;CHR$(131);"Load game.";CHR$(129)
 13391 'TBD. ROUTINE TO SHOW DIR
 13530 PRINT@10,12;CHR$(131);"Filename (without .SAV):";CHR$(129)
 13540 XC=10:YC=14:ML=8:TT$=AL$:GOSUB15740:GOSUB15090:IFAN$=""THENRETURN
 13550 AN$=AN$+".SAV"
 13551 'ERR SET: ERRGOTO 13800
 13552 SEARCH AN$
 13553 IFEF<>0THENGOTO13560
 13554 : XC=8:YC=8:B=30:H=6:GOSUB16100
 13555 : PRINT@10,10;CHR$(131);"File not found.";CHR$(129)
 13556 : PRINT@10,11;CHR$(131);"Press key.";CHR$(129):GOSUB16320
 13557 : GOSUB15090:RETURN
 13560 LOAD AN$
 13600 BS=PEEK(#B000):AS=#B001
 13610 FORN=0TO3
 13620 : NP(N)=PEEK(AS):AS=AS+1
 13625 : IFNP(N)>127THENNP(N)=-(256-NP(N))
 13630 NEXTN
 13640 FORN=0TO3
 13650 : FORM=0TO3
 13660 :   SP(N,M)=PEEK(AS):AS=AS+1
 13670 : NEXTM
 13680 NEXTN
 13690 FORN=0TO3
 13700 : FORM=0TO3
 13710 :   SC(N,M,0)=PEEK(AS):AS=AS+1
 13720 :   SC(N,M,1)=PEEK(AS):AS=AS+1
 13730 : NEXTM
 13740 NEXTN
 13750 FORN=0TO3
 13751 : ML=PEEK(AS):AS=AS+1
 13752 : SP$(N)=""
 13755 : FORM=1TOML
 13760 :   SP$(N)=SP$(N)+CHR$(PEEK(AS)):AS=AS+1
 13770 : NEXTM
 13780 NEXTN
 13790 EI=2
 13794 'ERR OFF
 13795 'RETURN
 13799 'ERROR HANDLING
 13800 'GOSUB16410: ERR OFF
 13810 RETURN
 

xahmol
Pilot Officer
Posts: 114
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Game seems to be working well now, managed to win a first game. Also did a quick test on my real Atmos, works as well there.

Attached a first alpha. Plan to do more testing and some other final touches (such as copying to a Sedoric 4 disc adding additional music), but for those who are curious already my present disk image attached.
LUDO.dsk
(131.5 KiB) Downloaded 17 times

User avatar
jbperin
Flying Officer
Posts: 164
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by jbperin »

Very nice work !

I was just a bit surprised when I was asked which pawn of my computer opponent should move.
Can't the computer decide for itself ? either with a random choice or with a small IA ?

Anyway this game is cool .. the windowing system and the menu are well done.
Congratulations and thank you.

xahmol
Pilot Officer
Posts: 114
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

jbperin wrote:
Sat Oct 31, 2020 7:59 am
I was just a bit surprised when I was asked which pawn of my computer opponent should move.
That should not happen, the game does have simple AI for that.

You did select that player number to be a computer player at game start? It is possible to have more than one human player.
You can see if a computer is playing from a message on line 4 of the screen ‘Computer is playing’.

If yes, apparently a bug I did not encounter yet. Would be grateful for a snapshot to analyse.

User avatar
jbperin
Flying Officer
Posts: 164
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by jbperin »

xahmol wrote:
Sat Oct 31, 2020 8:06 am
You did select that player number to be a computer player at game start?
Oups I might have made the mistake. I tried again paying careful attention to the player selection and I didn't encounter the problem again.
So I think I had done a mistake.

Sorry .. and congrats again.

xahmol
Pilot Officer
Posts: 114
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Great! Thanks!

And no problem: if the player selection is not intuitive enough that is also very valid feedback.

xahmol
Pilot Officer
Posts: 114
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by xahmol »

Link to Github repository:
https://github.com/xahmol/ludo

User avatar
Steve M
Squad Leader
Posts: 638
Joined: Fri Mar 24, 2006 3:33 am
Location: Cumbria, UK
Contact:

Re: SEDORIC extended BASIC commands syntax samples/manual?

Post by Steve M »

xahmol wrote:
Tue Oct 13, 2020 3:57 pm


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.
Sedoric was originally in French for 3" disks.
Jon Haworth translated it and with Allan Whitaker produced an English version V1.7 with code by Dr Ray McLaughlin.
V2.0 was soon followed by V2.1 which allowed formatting of 3.5" floppies - 82 tracks. This was used for a long time.

V3 was a rewrite by Andre Cheramy which was released in French and English with some new commands. If you look at the master disk it should give you details.

V4 is a recent version that incudes folders making it difficult to find anything.

So Sedoric v3 is probably the best option for most. I've attached the manual.
Attachments
SEDORIC3.MAN_complete.pdf
(360.91 KiB) Downloaded 16 times

Post Reply