157 strcat( temporaryPath,
" " );
161 sprintf( bootCodeFilename,
"%sBOOTCODE", temporaryPath );
163 remove( bootCodeFilename );
165 strcat( temporaryPath,
"atr" );
167 mkdir( temporaryPath );
169 mkdir( temporaryPath, 0777 );
171 strcat( temporaryPath,
" " );
178 strcopy( pipes,
">/dev/null 2>/dev/null");
183 sprintf( commandLine,
"del /f /q %s*.* %s", temporaryPath, pipes );
185 sprintf( commandLine,
"rm %s* %s", temporaryPath, pipes );
190 sprintf( mainFilename,
"%sMAIN.EXE", temporaryPath );
193 sprintf( dos25Filename,
"%sDOS.SYS", temporaryPath );
196 sprintf( dup25Filename,
"%sDUP.SYS", temporaryPath );
200 char * p = strstr( atrFileName,
".atr" );
202 strcat( atrFileName,
".atr");
209 fileOut = fopen( bootCodeFilename,
"wb" );
215 fileOut = fopen( dos25Filename,
"wb" );
221 fileOut = fopen( dup25Filename,
"wb" );
228 BUILD_TOOLCHAIN_DIR2ATR( _environment, dir2AtrExecutableName, bootCodeFilename, temporaryPath, atrFileName, pipes );
229 autorun_atr( _environment, atrFileName,
"MAIN EXE" );
231 printf(
"%s\n",atrFileName );
237 while( fileStorage ) {
244 memset( buffer, 0,
size );
245 memcpy( buffer, fileStorage->
content, fileStorage->
size );
247 FILE * file = fopen( fileStorage->
sourceName,
"rb" );
251 fseek( file, 0, SEEK_END );
252 size = ftell( file );
253 fseek( file, 0, SEEK_SET );
255 memset( buffer, 0,
size + 2 );
256 (void)!fread( buffer,
size, 1, file );
260 sprintf( dataFilename,
"%s%s", temporaryPath, fileStorage->
targetName );
261 fileOut = fopen( dataFilename,
"wb" );
263 fwrite( buffer, 1,
size, fileOut );
266 fileStorage = fileStorage->
next;
276 strcat( basePath, storage->
fileName );
278 strcat( basePath,
"disk%d.atr" );
284 strcopy( filemask,
"disk%d.atr" );
287 sprintf( buffer, filemask, i );
288 if ( !strstr( buffer,
".atr" ) ) {
289 strcat( buffer,
".atr" );
291 BUILD_TOOLCHAIN_DIR2ATR( _environment, dir2AtrExecutableName, bootCodeFilename, temporaryPath, buffer, pipes );
293 autorun_atr( _environment, buffer,
"MAIN EXE" );
296 printf(
"%s\n",buffer );
298 storage = storage->
next;
302 sprintf( commandLine,
"del /f /q %s*.* %s", temporaryPath, pipes );
304 sprintf( commandLine,
"rm %s* %s", temporaryPath, pipes );
312 sprintf( commandLine,
"del /f /q %s*.* %s", temporaryPath, pipes );
314 sprintf( commandLine,
"rm %s* %s", temporaryPath, pipes );
318 remove( bootCodeFilename );