/*This program should program the SanDisk MMC /*there is no bounds checking, so make sure that /*the size does not exceed the size of the MMC /*The directory in which this program is run must contain /*a file named tracks.lst /*in addition to all of the files which are to be included on the MMC /*tracks.lst will consist of the following format: . . . /******************************************************/ #include #include #include #include #include #include "SPImaster.h" #include "MMC.h" using namespace std; void main(void){ char buffer[512]; //buffer of size BLOCK ifstream tracks("tracks.lst"); //track.lst FILE *track, *tmp; char *file=new char(30); string filename; int address=512,size=0,count,MEMused,n; char temp; tmp=fopen("tmp.out","wb"); if(!tracks.is_open()){ cout<<"Could not open tracks.lst."<>filename; for(n=0;n>(8*(3-i))); } address=address+size; } buffer[0]=count; count++; for(int i=0;i<4;i++){ buffer[(4*count-3)+i]=(char)(address>>(8*(3-i))); } MEMused=address; //TOC is completed track=fopen("TOC.txt","wb"); for(int i=0;i<512;i++){ fputc(buffer[i],track); } fclose(track); tracks.close(); fclose(tmp); cout<<"TOC is complete."<