News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_zhulien

programming massive files on CPC

Started by zhulien, 16:49, 24 July 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zhulien

Hi Everyone,


If I wanted to read/write and create massive files on the CPC, how is the best way to do it.


eg: if I wanted to create a 4mb file (don't care of the content for most part, but do want to write markers at 16kb splits - so essentially 256 sections), do i need to write every byte from the CPC or can the CPC just create a 4mb file?  If I wanted to read/write any selected 16kb chunk of that file, how do i seek to any bit to read or write?


From a performance point of view, is it likely faster to have 1 4mb file with 16kb seeks, or 256 x 16kb files within a folder?  (yes, on an X-Mass or M4 card).


Has anyone done such things before? @TFM ?

m_dr_m

Prodatron has posted some routines to read/write by bloc.
It's still sequential, has the same speed than cas_in_bloc/cas_out_bloc, without the memory limitations.



Orgams use similar ones.


To go further (skip uninteresting parts), check Unidos SEEK routines: https://unidos.cpcscene.net/doku.php?id=fr:devel#cmd_cas_in_seek_6




GUNHED

Quote from: zhulien on 16:49, 24 July 21
Has anyone done such things before? @TFM ?
From a performance POV the single 16 KB blocks are a little bit more efficient, because they can be loaded in one run into a 16 KB expansion RAM block. Also it has advantages if you use crunching.
For the 4 MB 'demo' I made I used 256x 16 KB files.

However it's not a problem to make a 4 MB file out of 256 files of 16 KB. Just adapt the directory content to it.

What I use too is to combine 30 blocks of 16 KB to 480 KB of GFX data, to be loaded in one rush.

Well, it shouldn't be hard to write a tool for that. But the more powerful such a tool is, the more time it takes to be developed of course.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod