dflat language update

This is the best place to discuss about the various Oric operating systems like Sedoric, Randos, FT-Dos, and others, as well as serious software, utilities, word processors, disassemblers, etc... that runs on oric computers.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

dflat language update

Post by 6502Nerd »

Hello Oric fans and Happy New Year..

I thought to post a short update as one or two of you have expressed interest in dflat (a new custom language ROM for the Oric-1 and Atmos). To remind, dflat is an integer BASIC with structured and procedural constructs, plus an in-line assembler. With Oric specific commands for sound and graphics (low and high resolution), it is possible to create most types of applications (typically games) directly programming on the Oric like in 1983!

I have an almost stable version which I will package and release soon, and have also been documenting the language on GitHub here : https://github.com/6502Nerd/dflat/wiki

There were some significant limitations, initially because I had emulator output to ORT file which seemed to work via Oricutron tape capture capability, but this would not work for a real Oric of course.

Then I decided to try and understand Oricutron better, especially how the PCH files work to patch the ROM to speed up load and save. It was very interesting but took some time! I am not sure I understand it well, but enough to put in the correct symbol values, which is automatically generated from my assembler's symbol file.

The result is that now with Oricutron as the emulator, it is possible to save and load TAP files. The challenge then remained for how to use on a real Oric. I found the source for tap2wav from the venerable Euphoric emulator also on GitHub which has "Simon & F.Frances" as the authors. This was very old (2007), but I managed to import it to Visual Studio and re-build to deal with dflat file format.

Anyway this evening I was successful. Now I can write code on a real Oric with the dflat ROM, save it as a WAV and load in to dflat running in Oricutron. I can also create programs in the emulator, save as TAP and then use the new dftap2wav utility to create a WAV file that will load on the real Oric.

I will point out in brief the dflat file format, which is block rather than character orientated;
- Four 0x16 sync characters, then the 0x24 ('$') symbol
- Zero up to 15 characters of filename in ASCII
- 0x0 filename terminator
- Block number low,high : integer representing the block number
- 256 bytes of block data
- The next block number and data until the file is done
- I have left out details like how to know when the file is loaded etc. for brevity - happy to explain further.

I will put the binary up on both my hackaday and GitHub shortly, including the dftap2wav converter. I am also writing additional tools;
- Create/edit dflat programs in your favourite editor then convert to TAP format to load in to Oricutron running the dflat ROM
- Binary to TAP converter to allow import of graphics, fonts etc.

Any questions, happy to discuss :-)
GitHub : https://github.com/6502Nerd/dflat
Hackaday : https://hackaday.io/project/175585-oric-1-dflat-system
Last edited by 6502Nerd on Mon Jan 04, 2021 10:01 am, edited 1 time in total.
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: dflat language update

Post by iss »

Congrats! dflat looks cool and I like small caps :).
But I have one recommendation - change the names of ROM/PCH files to dflat.rom/dflat.pch, because:
- dflat sounds not bad as name and is self-explaining for the file content;
- it's really easy to change one line in 'oricutron.cfg', so the custom ROM is used instead the 'standard' one;
- this will avoid spreading 'fake' basic11b.* files around the net.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

Having spent the last week learning Amstrad's MAXAM assembler, I for one welcome a new era of inline assembly into the Oric world! Well done! :)
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

iss wrote: Sun Jan 03, 2021 4:09 am Congrats! dflat looks cool and I like small caps :).
But I have one recommendation - change the names of ROM/PCH files to dflat.rom/dflat.pch, because:
- dflat sounds not bad as name and is self-explaining for the file content;
- it's really easy to change one line in 'oricutron.cfg', so the custom ROM is used instead the 'standard' one;
- this will avoid spreading 'fake' basic11b.* files around the net.
Thanks for the nice words. Also, you are so right about the naming of the ROM, I will sort that out - I wish I had considered the possibility for inadvertent pollution of ROMs!
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

ibisum wrote: Sun Jan 03, 2021 11:25 am Having spent the last week learning Amstrad's MAXAM assembler, I for one welcome a new era of inline assembly into the Oric world! Well done! :)
Thank you! I think in use, dflat feels somewhat like 'BBC BASIC' which was part of the inspiration for the approach I took, but a big difference is there is no GOTO or GOSUB keywords, everything is procedurally driven!
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

I'll enjoy digging into dflat after I finish a few other things on the table .. one question I have is, and sorry if this is ignorant .. but what's the editing like? Can you load/save files to edit?
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

ibisum wrote: Sun Jan 03, 2021 3:13 pm I'll enjoy digging into dflat after I finish a few other things on the table .. one question I have is, and sorry if this is ignorant .. but what's the editing like? Can you load/save files to edit?
I'll be happy to hear of your thought when you have a chance! On the editing, the ROM allows for editing just like in normal Oric BASIC. However, I have already thought about the opportunity to at least edit on a PC text editor (e.g. I like notepad++) then convert the text file to TAP format. As I now understand the TAP format well, it will be a simply utility which I will call dftxt2tap. It may also need some automation to make it easy to move from PC to Oric.

The way dflat loads programs is to read lines as untokenised input, then do tokenisation before storing the line in memory. If there is an error, the load process is aborted - but you will see the line number so can of course go straight their in your editor to fix the problem.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

Ah, thanks for clearing that up - I've spent the subsequent time reading the docs .. so I guess I'd love to see SEDORIC support, so "DFLAT.COM" can be called to run/edit programs, but also has access to FSAVE/FLOAD, from SEDORIC, as well .. not sure how the SEDORIC ROM overlay would work with DFLAT though, maybe one of the guru's can clear it up - is it just a matter of having "DFLAT.COM" to load from SED, and then subsequent SED functions would be available to it for example, to DOS?
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

The Oric-1 was my first computer as a young teenager between 1983-1985 and my set up was the computer, a small TV (not even colour!) and a tape player! Things like disk drives I didn't have until around early 1987 for my Atari 800XL. However, I still own my Oric-1 to this day and even use it (e.g. for testing dflat) but I'm very unfamiliar with things like SEDORIC.

I did a quick read of the SEDORIC manual pages - it's very powerful! However, looking at some of it's extended BASIC features, I would think that it is not going to be compatible with dflat at all - dflat is written from scratch with a unique syntax. dflat also executes faster than Oric BASIC plus of course has the inline assembler, so maybe it will be of interest anyway to some people.

However, I am sure it can be possible to have a dflat.DSK file which loads in to the RAM overlay at 0xC000-0xFFFF - dbug and others have recommended to provide for this so that disk owners can easily load dflat on a real Oric.

So I will look in that surely and any advice is very welcome. I have a 16KB binary file that needs converting to DSK and a small bootloader to enable shadow RAM, copy the binary there, and then do in effect a cold-start.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

I think we need to work out how to get you a disk drive (Cumana Reborn) for your Oric-1 so that you will make DOS integration with dflat a priority feature. ;)

Like you, I also grew up with the Oric-1 and a massive collection of tapes - long since lost to the little sisters Jon Bon Jovi obsession, alas. But when I got a Cumulus for my Oric, it was like a second coming .. I can't describe with words how great it felt to have a DOS on my Oric - it could load files! It could save them! It was truly glorious.

I think any new generation technology for the Oric kind of *has* to have an eye on the DOS side of things. The Oric is about 5x more powerful when it has mass storage and users don't have to deal with tape ..

That said, I will of course test your DFLAT.DSK for you, extensively, if you want to try it out and see what sort of things can be done with SEDORIC+DFLAT together .. if things don't work straight away, at the very least we could work out an assembly shim function, perhaps, that gives DFLAT users a workable means of loading/saving files .. but it would be great to hear what Chema and Dbug think about the effort required to do this, since I'm mostly talking out of my ass .. ;)
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: dflat language update

Post by Dbug »

I'm not a Sedoric expert, far from it, people like André Cheramy and Symoon are much more knowledgeable.

All I know is that the system is "bank" based, so Sedoric is made of multiple modules that are loaded on demand, so technically it's probably possible to build dflat is blocks that could be automatically loaded/discarded on demand, like if it was an extension of Sedoric, like the extensions to the BASIC commands.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Losing tapes to Bob Jovi? :shock:
Having said that, they were also another good memory from the 80s, so can understand your sisters didn't want to miss recording them off the radio! :lol:

Of course I would love a Cumana or similar for my Oric! And I agree with you, proper mass storage makes the Oric and indeed any computer from that era much more productive. I remember getting the disk drive for my Atari 800XL completely changed the experience.

I have been working in parallel on the following;
1. utility to convert tap to wav
2. utility to convert text to tap
3. utility to convert tap to text

The last two utilities open the possibility to do editing on my PC using notepad++ and then quickly and easily convert the text file to .tap which can be loaded on the emulator, and also to go in the other direction. On top, I have added dflat syntax highlighting in notepad++ which means I can edit much more easily on a big screen before trying things out on an emulated Oric [edit - I just realised that OSDK allows for a similar idea!).

The first utility then allows final testing on a real Oric. I will use this approach to create some better examples of what can be done with dflat, it was a bit of a pain to do it on the Oric-1 keyboard and small screen!

Still, this is not DOS integration of course, so happy to investigate further on how to make this happen :)
Last edited by 6502Nerd on Mon Jan 04, 2021 10:53 am, edited 1 time in total.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Dbug wrote: Mon Jan 04, 2021 9:54 am I'm not a Sedoric expert, far from it, people like André Cheramy and Symoon are much more knowledgeable.

All I know is that the system is "bank" based, so Sedoric is made of multiple modules that are loaded on demand, so technically it's probably possible to build dflat is blocks that could be automatically loaded/discarded on demand, like if it was an extension of Sedoric, like the extensions to the BASIC commands.
A possible complication is that dflat provides more than a new language, it's the whole ROM - so all system functions like keyboard, interrupts etc. are custom. So although I have no idea of SEDORIC, it looks like deep integration could be difficult..

Hopefully there is a way though to at least make dflat as a DSK file which can be loaded in to 0xC000 RAM as you've mentioned before...
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: dflat language update

Post by Dbug »

Loading dflat from a DSK as a replacement rom is trivial, you can do that from FloppyBuilder or Sedoric, it's really just a case of loading a 16KB file somewhere in memory and copying it to overlay memory.

The issue is how to access the disk after that, I guess you could have some "file system" modules that could be loaded in main memory, or even in overlay ram if you leave some free disk space, that could be used to access the disk.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Dbug wrote: Mon Jan 04, 2021 10:57 am Loading dflat from a DSK as a replacement rom is trivial, you can do that from FloppyBuilder or Sedoric, it's really just a case of loading a 16KB file somewhere in memory and copying it to overlay memory.

The issue is how to access the disk after that, I guess you could have some "file system" modules that could be loaded in main memory, or even in overlay ram if you leave some free disk space, that could be used to access the disk.
Thank you Dbug for the thoughts - I agree looks like the bigger problem will be how to access disk once dflat is loaded.

Some delays due to some fixes found some decent bugs during the port from my homebrew computer which is 65c02 based, and needed to update the tape handing routines too. You will have maybe seen on Twitter that I updated a program I wrote on the homebrew to Oric dflat as part of my checks.

I will start to look at the DSK approach, but first make a GitHub release of the current binary. It works very well and accurately on Oricutron emulator (which I am impressed with considering I made a custom ROM completely different to any Oric ROM). I have also got smooth integration with Oricutron's tape routines so saving and loading are very fast in the emulator and use the filename specified in dflat.

I will be very happy if folks are able to try it out - ibisum kindly expressed interest.
Post Reply