Page 1 of 1

How to read a part of a files with sedoric

Posted: Fri Jul 11, 2014 7:34 pm
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

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

Posted: Fri Jul 11, 2014 8:37 pm
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?

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

Posted: Sat Jul 12, 2014 3:01 am
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)

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

Posted: Sat Jul 12, 2014 8:30 am
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)..

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

Posted: Sat Jul 12, 2014 9:45 am
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?

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

Posted: Sat Jul 12, 2014 10:03 am
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.

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

Posted: Sat Jul 12, 2014 11:09 am
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

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

Posted: Sat Jul 12, 2014 11:36 am
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.

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

Posted: Sun Jul 13, 2014 6:34 am
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)

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

Posted: Sun Jul 13, 2014 7:43 am
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.