Author Topic: programming massive files on CPC  (Read 345 times)

0 Members and 1 Guest are viewing this topic.

Offline zhulien

  • 6128 Plus
  • ******
  • Posts: 873
  • Country: au
  • aka Vorax
    • 8bitology
    • Awards
programming massive files on CPC
« on: 18:49, 24 July 21 »
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 ?
like
0
No reactions

Offline m_dr_m

  • 464 Plus
  • *****
  • Posts: 305
  • Country: gb
  • http://orgams.wikidot.com/
    • OrgaMS!
    • Awards
Re: programming massive files on CPC
« Reply #1 on: 23:23, 24 July 21 »
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



like
0
No reactions

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.836
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
    • Awards
Re: programming massive files on CPC
« Reply #2 on: 19:00, 27 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.
like
0
No reactions
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)