How to read a part of a files with sedoric

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
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

How to read a part of a files with sedoric

Post by coco.oric »

Hello,

I'm looking to adapt an old game to the oric with osdk
Support will be DSK file.

I've a big data file of 58ko where i've to read a part of it to put in struct.c, or writing a part for it.
I don't see anything in sedoric information or sedoric_a_nu to do it.

Does anybody have a solution to use this data file or i 'll have to read sectors directly in a special structure of the disk like the demo pushing the envelop ?

Thanks a lot, Didier
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: How to read a part of a files with sedoric

Post by Symoon »

You should try and find the Sedoric manual (not Sedoric à Nu) and look at the files section.
I'm not an expert in Sedoric commands but some may help you maybe?
User avatar
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: How to read a part of a files with sedoric

Post by coco.oric »

Thanks Simon but i didn't find anything in the manual. The file section seems to be limited to classic files (or i didn't understand the possibilities)
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: How to read a part of a files with sedoric

Post by Symoon »

Took a quick look and you're right, I think the only solution is a sector-based one. I used the Sedoric Basic commands long ago and they were working fine (based on OPEN D command to open the disk as a file)..
User avatar
ibisum
Wing Commander
Posts: 1643
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: How to read a part of a files with sedoric

Post by ibisum »

Could this be the point where someone works out some byte-level/sector-level assembly routines for the disk which .. maybe one day .. could be integrated into ContikiOS?
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: How to read a part of a files with sedoric

Post by Chema »

Hi. I am not sure to understand what you want to do.

If you want to load separate pieces of data from disk, that should not be difficult: you save the contents of memory to a file and load them whenever you want wherever you want. So if you want to load just part of that data you can split it in chunks that could be loaded separately in different files. Some logic in your program should care about when to load what and if the currently in memory chunk needs saving...

But I guess what you want is something more complex. In that case you should go for a sector based read/write. If you want I can provide the routines for c or asm.
User avatar
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: How to read a part of a files with sedoric

Post by coco.oric »

But I guess what you want is something more complex. In that case you should go for a sector based read/write. If you want I can provide the routines for c or asm.
@chema : thanks a lot. it seems that it's only with this solution that i can try my adaptation.
Of course, it will be easier to split datas but I don't want it to keep them protected from cheating

Didier
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: How to read a part of a files with sedoric

Post by Chema »

In that case I have been using sector based disc access for quite a long time. Both in Space:1999 and 1337. If you look at the sources in the repository, there's a file called disk.s which works quite well and could be used within a c program.

Only thing is that you need to create the data file in advance, then store it when creating the disk. This way it goes just after Sedoric and you know which sector is the first of your file. All this can be automated within osdk. If you want I can prepare everything for you. I just need the datafile (or a way to create it) and I can prepare a simple c project whit some examples of read/writing.

Of course, I also need some time to spend... But I'd gladly do it.
User avatar
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: How to read a part of a files with sedoric

Post by coco.oric »

Thanks Chema, your help will be appreciated but i'll try before to understand how it works with your softcode. I saw that the solution of "pushing the envelope" will also be a good option.
I have also my datas to rebuild with a sector size of data-blocks.

So i'll :

1/ learning to create a disk with a file at a fixed place
2/ building a new data structure for my game
3/ creating the adaptation with your solution. (i've also a problem to solve with differents programs and variables to exchange between them)
4/ looking at the pushing the enveloppe solution to improve it or no

.. a few months of work 8)
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
Hialmar
Flight Lieutenant
Posts: 349
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: How to read a part of a files with sedoric

Post by Hialmar »

In order to transfer the datafile, I think that assinie's code (which mounts a .dsk under Linux and allows you to copy data files with a cp) is a must.
Hialmar
CEO and Silicium member.
Post Reply