/[projet1]/public/pc/tools/osdk/main/makedisk/FloppyBuilder.cpp
Defence Force logotype

Diff of /public/pc/tools/osdk/main/makedisk/FloppyBuilder.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1013 by dbug, Thu Dec 12 19:35:12 2013 UTC revision 1014 by dbug, Thu Dec 12 20:50:14 2013 UTC
# Line 90  void main(int argc, char *argv[]) Line 90  void main(int argc, char *argv[])
90    
91    std::string outputLayoutFileName;    std::string outputLayoutFileName;
92    
   //  
   // Set some semi sane  
   //  
   int currentTrack =1;  
   int currentSector=1;  
   floppy.SetOffset(currentTrack,currentSector);  
   
93    int lineNumber=0;    int lineNumber=0;
94    for (auto it(script.begin());it!=script.end();++it)    for (auto it(script.begin());it!=script.end();++it)
95    {    {
# Line 153  void main(int argc, char *argv[]) Line 146  void main(int argc, char *argv[])
146        {        {
147          if (tokens.size()==3)          if (tokens.size()==3)
148          {          {
149            currentTrack =std::atoi(tokens[1].c_str());            int currentTrack =std::atoi(tokens[1].c_str());
150            if ( (currentTrack<0) || (currentTrack>41) )            if ( (currentTrack<0) || (currentTrack>41) )
151            {            {
152              ShowError("Syntax error line (%d), TrackNumber has to be between 0 and 41' \n",lineNumber);              ShowError("Syntax error line (%d), TrackNumber has to be between 0 and 41' \n",lineNumber);
153            }            }
154            currentSector=std::atoi(tokens[2].c_str());            int currentSector=std::atoi(tokens[2].c_str());
155            if ( (currentSector<0) || (currentSector>41) )            if ( (currentSector<0) || (currentSector>41) )
156            {            {
157              ShowError("Syntax error line (%d), SectorNumber has to be between 1 and 17' \n",lineNumber);              ShowError("Syntax error line (%d), SectorNumber has to be between 1 and 17' \n",lineNumber);
158            }            }
159            floppy.SetOffset(currentTrack,currentSector);            floppy.SetPosition(currentTrack,currentSector);
160          }          }
161          else          else
162          {          {
# Line 171  void main(int argc, char *argv[]) Line 164  void main(int argc, char *argv[])
164          }          }
165        }        }
166        else        else
167        if (tokens[0]=="SetBootSector")        if (tokens[0]=="WriteSector")
168        {        {
169          if (tokens.size()==3)          if (tokens.size()==2)
170          {          {
171            std::string fileName=tokens[2];            std::string fileName=tokens[1];
172            if (tokens[1]=="Microdisc")            floppy.WriteSector(fileName.c_str());
           {  
             floppy.WriteSector(0,2,fileName.c_str());  
           }  
           else  
           if (tokens[1]=="Jasmin")  
           {  
             floppy.WriteSector(0,1,fileName.c_str());  
           }  
           else  
           {  
             ShowError("Syntax error line (%d), syntax is 'SetBootSector Jasmin|Microdisc FilePath'. '%s' is not a valid type \n",lineNumber,tokens[1].c_str());  
           }  
173          }          }
174          else          else
175          {          {
176            ShowError("Syntax error line (%d), syntax is 'SetBootSector Jasmin|Microdisc FilePath' \n",lineNumber);            ShowError("Syntax error line (%d), syntax is 'SetBootSector FilePath' \n",lineNumber);
177          }          }
178        }        }
179        else        else
# Line 202  void main(int argc, char *argv[]) Line 183  void main(int argc, char *argv[])
183          {          {
184            std::string fileName=tokens[1];            std::string fileName=tokens[1];
185            int loadAddress=ConvertAdress(tokens[2].c_str());            int loadAddress=ConvertAdress(tokens[2].c_str());
186              int nb_sectors_by_files=floppy.WriteFile(fileName.c_str(),loadAddress);
           if (currentSector==taille_piste+1)  
           {  
             currentSector=1;  
             currentTrack++;  
           }  
   
           int nb_sectors_by_files=floppy.WriteFile(fileName.c_str(),currentTrack,currentSector,loadAddress);  
187          }          }
188          else          else
189          {          {

Legend:
Removed from v.1013  
changed lines
  Added in v.1014

  ViewVC Help
Powered by ViewVC 1.1.26