Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Here you can ask questions or provide insights about how to use efficiently 6502 assembly code on the Oric.
User avatar
Symoon
Archivist
Posts: 1861
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Symoon » Wed May 20, 2020 2:45 pm

8bit-Dude wrote:
Wed May 20, 2020 1:58 pm
Chema wrote:
Wed May 20, 2020 12:28 pm
https://github.com/teiram/oric-dsk-manager
I already have this app. But it is not really useful for what I am trying to do (plus it is buggy).
For now, I can generate files with OPEN in Oricutron, and save the Disk again. By I am having a hard time figuring out what exactly is different between tap2disk files, and OPEN files...
You definitely should read Sedoric manual, it's explained.
From memory, these are "sequential files", which allow to save (PUT ?) user-defined recordings one after another.
This doesn't exist on tape and has been specifically created with disk usage, so you can't have any of these file types in a TAP file.

TAP files are basic or memory block (CSAVE), or tables (STORE)

User avatar
8bit-Dude
Pilot Officer
Posts: 98
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by 8bit-Dude » Wed May 20, 2020 4:35 pm

Dbug wrote:
Wed May 20, 2020 2:34 pm
Have you tried a binary diff between the two DSK files?
Of course. But there are large blocks being changed even when I generated a files with 1 or 2 bytes of data...

User avatar
8bit-Dude
Pilot Officer
Posts: 98
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by 8bit-Dude » Wed May 20, 2020 4:36 pm

Symoon wrote:
Wed May 20, 2020 2:45 pm
From memory, these are "sequential files", which allow to save (PUT ?) user-defined recordings one after another.
This doesn't exist on tape and has been specifically created with disk usage, so you can't have any of these file types in a TAP file.
TAP files are basic or memory block (CSAVE), or tables (STORE)
I use TAP2DSK to store all kind of files on the disk, including binary programs, music tracks, bitmaps...
So they are not TAP files, but the software makes them all look like binary program AFAIK.

User avatar
Chema
Game master
Posts: 2614
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Chema » Wed May 20, 2020 4:37 pm

Which version are you using? I am not aware of any bug in version 0.7, and it would be great to report to the author. And it let's you add files with no header (you can specify load and exec addresses by hand if needed).

Now that I mentioned it, I went to the app and noticed you could change only 3 of the status bits: Protected Executable and Block (whatever that means), but not the rest. I went to Sedoric manual here, and it says:

Code: Select all

Annexe 4 : CODAGE D'UN FICHIER

L'octet d'état (STATUS Byte) d'un fichier est en fait un code binaire établi selon les règles ci-dessous L'Octet est représenté sous sa forme classique b7 b6 b5 b4 b3 b2 b1 b0

Le bit est actif s'il est à 1.

b0 : exécution automatique
b1 : inutilisé
b2 : inutilisé
b3 : direct
b4 : séquentiel
b5 : window (b6 = 1 aussi)
b6 : bloc de données
b7 : Basic
So you might want to set bit 4 to make it sequential. In the manual it also states that if you open a file of the wrong type, you get the FILE TYPE MISMATCH ERROR.

Hope it helps. I will let the author of DSK manager that it would be nice to also have these flags implemented in the app.

User avatar
Symoon
Archivist
Posts: 1861
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Symoon » Wed May 20, 2020 4:52 pm

8bit-Dude wrote:
Wed May 20, 2020 4:36 pm
I use TAP2DSK to store all kind of files on the disk, including binary programs, music tracks, bitmaps...
So they are not TAP files, but the software makes them all look like binary program AFAIK.
Ah it must be a fork then; I was referring to Fabrice's TAP2DSK, see readme here (TAP2DSK = TAP to DSK = TAP file as input!)
https://sourceforge.net/projects/euphor ... ic%20tool/

User avatar
8bit-Dude
Pilot Officer
Posts: 98
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by 8bit-Dude » Thu May 21, 2020 12:50 am

Chema wrote:
Wed May 20, 2020 4:37 pm
I went to Sedoric manual here
AH, Just what I needed! The version of the manual I found was incomplete and did not contain this annex.

I tried it in tap2dsk and it worked by just modifying this line:

descriptor[3]=(basic?0x80:0x00)+(block?0x40:0x00)+(seq?0x10:0x00)+(dir?0x08:0x00)+(exec?0x01:0x00);

I have attached my modified tap2dsk.c (see "8bit-dude" for my edit). It works out file type from the file extension.
And oh... another thing I did was to prevent the renaming of file extensions!!
Attachments
tap2dsk.zip
(3.72 KiB) Downloaded 4 times

User avatar
8bit-Dude
Pilot Officer
Posts: 98
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by 8bit-Dude » Thu May 21, 2020 3:10 am

Funnily, the Sequential file reading does not help me at all! (the file needs to be formatted accordingly).

But now that I understand the directory, I can figure out how to use OPEN D,Track,Sector.
I found the memory location of the buffer, so I think I can exploit this to implement proper fopen(), fread(), fclose() functions.

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

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Dbug » Thu May 21, 2020 8:05 am

Ok, your changes are based on Fabrice release, I guess I should probably add "OSDK" in all the versions of Fabrice tools I modified, so it's clear.
I'll try to see if I can integrate some of these changes, will need to see if it still works 100% with the existing first :)

User avatar
Chema
Game master
Posts: 2614
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Chema » Thu May 21, 2020 10:29 am

tap2dsk is designed to convert tap files (cloadable mostly) into disk files that can be loaded within sedoric, handling things like multi-taps. I am not sure if it makes sense to add all this complexity, and mostly how to do it.

As I only used this to add binary data into my disk and then load it with sector read routines, I think I always generated this data with header (as a tap file by using the header.exe tool).

But I guess you'd need to specify individual flags for each file you want to add, so maybe using the command line is not the best option anymore. What about some kind of config file with options for some files?

So, my two euro-cents is... what about a command line tool which is able to:
- Create a dsk with a given geometry, make it bootable, add INIST, etc.
- Add files to a dsk from a list <filename> <flags> <filename-in-oric-dsk>
- Maybe also support adding files from a tap file?

Basically what oric DSK Manager does, but from command-line, for developers.

If 8bit-Dude is able to come up with some C library for buffered input with proper fopen, fread, etc... (I'd go for system-based open, read, which might be simpler, but anyway) such a tool might become invaluable!

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

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Dbug » Thu May 21, 2020 11:33 am

INIST is already supported in Tap2Dsk (-i parameter)

User avatar
Chema
Game master
Posts: 2614
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Assembly functions for Sedoric OPEN, TAKE, PUT, CLOSE

Post by Chema » Thu May 21, 2020 1:36 pm

Dbug wrote:
Thu May 21, 2020 11:33 am
INIST is already supported in Tap2Dsk (-i parameter)
Yeah. I knew that (it is used in Space:1999 and 1337), only trying to list what a new tool could have :)

Post Reply