The tcDspRomFs class provides a mechanism to register a precompiled ROM filesystem with the TI DSP BIOS standard I/O libraries. Use of this routine will allow files to be accessed using standard fopen(), fread(), and fwrite() style function calls, as well as C++ stream operators.
This is a simple example of tcDspRomFs usage:
{ { // read in external ROM filesystem class built from make_romfs tool // alternatively, one might reference a MityDSP application data sector // with preloaded filesystem data on it... extern tsDspRomFsNode MyFileSystem[]; char buffer[128]; tcDspRomFs* lpRomFs = new tcDspRomFs(MyFileSystem); lpRomFs->RegisterFileSystem("ROMFS"); // read / parse data file... FILE* lpFile = fopen("ROMFS:data.txt","r"); while(!feof(lpFile)) { fread(lpBuff,1,128,lpFile); // Do something with the data... } fclose(lpFile); // typically, RomFs classes are not destroyed, they occupy a minimum amount // of memory... ... }