Author Topic: CPCTelera support file handling?  (Read 902 times)

0 Members and 1 Guest are viewing this topic.

Offline shifters74

  • CPC664
  • ***
  • Posts: 52
  • Country: gb
  • Liked: 37
  • Likes Given: 24
CPCTelera support file handling?
« on: 18:41, 23 November 19 »
HI all,
Does CPCtelera support file handling i.e. the ability to read and write files on disk?  I have checked the docs, examples etc and can't find anything so i suspect not - any one more knowledgeable about this tool able to give me a firm answer?
cheers
shifters

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 647
  • Country: fr
  • Liked: 560
  • Likes Given: 1172
Re: CPCTelera support file handling?
« Reply #1 on: 22:28, 23 November 19 »
Hi @shifters74,

CPCTelera have not  for now file support but here you can find read file function :
https://github.com/lronaldo/cpctelera/issues/50

Simply copy file
Code: [Select]
cpct_loadBinaryfile.s in your source folder and add function declaration where you need :
Code: [Select]
extern u16 cpct_loadBinaryFile(const char *fileName, void *loadAddr);
If you need Write function, i can find it.

But be careful, to use it you need to have firmware active.

Offline shifters74

  • CPC664
  • ***
  • Posts: 52
  • Country: gb
  • Liked: 37
  • Likes Given: 24
Re: CPCTelera support file handling?
« Reply #2 on: 10:43, 24 November 19 »
HI Arnaud,

a write function would be most helpful if you can provide one!

This is so i can code a read file and write file service for CPLink to and from the raspberry pi that is connected to it. See this thread http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-cplink-a-coprocessor-interface-card-for-all-cpcs/

The aim is too provide services on the PI that the CPC can use through either basic, c, or asm.


Your help most appreciated!!

cheers
shifters
Oops forgot to say thanks for the read file code :-)  :doh:
« Last Edit: 11:24, 24 November 19 by shifters74 »