66 p = strstr( binaryName,
".asm" );
78 p = strstr( binaryName,
".asm" );
86 p = strstr( binaryName,
".asm" );
90 strcat( p,
"_code_user.bin");
93 FILE * binaryFile = fopen( binaryName,
"rb" );
94 fseek( binaryFile, 0, SEEK_END );
95 long size = ftell( binaryFile );
96 fseek( binaryFile, 0, SEEK_SET );
98 (void)!fread( part,
size, 1, binaryFile );
102 p = strstr( binaryName,
".asm" );
109 binaryFile = fopen( binaryName,
"wb" );
110 fwrite( part,
size, 1, binaryFile );
111 fclose( binaryFile );
114 p = strstr( binaryName,
".asm" );
118 strcat( p,
"_data_user.bin");
121 binaryFile = fopen( binaryName,
"rb" );
122 fseek( binaryFile, 0, SEEK_END );
123 size = ftell( binaryFile );
124 fseek( binaryFile, 0, SEEK_SET );
126 (void)!fread( part,
size, 1, binaryFile );
127 fclose( binaryFile );
130 p = strstr( binaryName,
".asm" );
137 binaryFile = fopen( binaryName,
"a+b" );
138 fwrite( part,
size, 1, binaryFile );
139 fclose( binaryFile );
148 strcopy( pipes,
">/dev/null 2>/dev/null");
152 p = strstr( binaryName,
".asm" );
154 strcat( p,
"_data_user.bin");
159 p = strstr( binaryName,
".asm" );
161 strcat( p,
"_code_user.bin");
178 p = strstr( binaryName,
".asm" );
185 int binaryFileSize =
file_get_size( _environment, binaryName );
186 if ( binaryFileSize > 32768 ) {
189 if ( binaryFileSize < 16384 ) {
190 FILE * fh = fopen( binaryName,
"ab" );
191 while( binaryFileSize < 0x8000 ) {
203 p = strstr( bankName,
".asm" );
208 sprintf(temp,
"%s_BANK_%02X.bin", bankName, bankId );
209 strcpy( bankName, temp );
210 int bankSize = bank->
space;
211 FILE * fh = fopen( bankName,
"wb" );
212 fwrite( bank->
data, 1, bankSize, fh );
213 fwrite( bank2->
data, 1, bankSize, fh );
229 strcopy( pipes,
">/dev/null 2>/dev/null");
232 sprintf( commandLine,
"\"%s\" +msxrom -b \"%s\" %s",
237 p = strstr( binaryName,
".bin" );
245 printf(
"The compilation of assembly program failed.\n\n");
246 printf(
"Please use option '-I' to install chain tool.\n\n");
256 p = strstr( symbolName,
".rom" );
263 p = strstr( binaryName,
".asm" );
274 p = strstr( binaryName,
".asm" );
286 }
else if( access(
"runz80.exe", F_OK ) == 0 ) {
287 sprintf(executableName,
"%s",
"runz80.exe" );
289 sprintf(executableName,
"%s",
"runz80" );
292 sprintf( commandLine,
"\"%s\" -m -p \"%s\" %d -l 4000 \"%s\" -R 4010 -u \"%s\" \"%s\"",
301 printf(
"The profiling of assembly program failed.\n\n");
310 p = strstr( binaryName,
".asm" );
312 strcat( p,
"_data_user.bin");
317 p = strstr( binaryName,
".asm" );
319 strcat( p,
"_code_user.bin");
334 strcopy( pipes,
">/dev/null 2>/dev/null");
339 strcat( temporaryPath,
" " );
341 strcat( temporaryPath,
"dsk" );
343 mkdir( temporaryPath );
345 mkdir( temporaryPath, 0777 );
347 strcat( temporaryPath,
" " );
358 sprintf( commandLine,
"del /f /q %s*.* %s", temporaryPath, pipes );
360 sprintf( commandLine,
"rm %s* %s", temporaryPath, pipes );
367 p = strstr( binaryName,
".asm" );
375 p = strstr( binaryName2,
".asm" );
384 sprintf( commandLine,
"\"%s\" +msx -b \"%s\" -o \"%s\" --org 33024 %s",
390 printf(
"The compilation of assembly program failed.\n\n");
391 printf(
"Please use option '-I' to install chain tool.\n\n");
395 remove( binaryName );
398 p = strstr( binaryName,
".dsk" );
411 sprintf( commandLine,
"\"%s\" \"%s\" \"%s\" %s",
412 diskToolsExecutableName,
417 printf(
"The compilation of assembly program failed.\n\n");
418 printf(
"Please use option '-I' to install chain tool.\n\n");
437 strcat( basePath, storage->
fileName );
439 strcat( basePath,
"disk%d.dsk" );
445 strcopy( filemask,
"disk%d.dsk" );
448 sprintf( diskName, filemask, 0 );
449 if ( !strstr( diskName,
".dsk" ) ) {
450 strcat( diskName,
".dsk" );
454 char * additionalFiles = NULL;
456 additionalFiles = NULL;
458 while( fileStorage ) {
465 memset( buffer, 0,
size );
466 memcpy( buffer, fileStorage->
content, fileStorage->
size );
468 FILE * file = fopen( fileStorage->
sourceName,
"rb" );
472 fseek( file, 0, SEEK_END );
473 size = ftell( file );
474 fseek( file, 0, SEEK_SET );
476 memset( buffer, 0,
size );
477 (void)!fread( buffer,
size, 1, file );
481 sprintf( dataFilename,
"%s%s", temporaryPath, fileStorage->
targetName );
482 FILE * fileOut = fopen( dataFilename,
"wb" );
484 fwrite( buffer, 1,
size, fileOut );
487 if ( additionalFiles ) {
488 additionalFiles = realloc( additionalFiles, strlen(additionalFiles) + strlen( dataFilename ) + 3 );
489 strcat( additionalFiles,
" " );
490 strcat( additionalFiles, dataFilename );
492 additionalFiles = strdup( dataFilename );
494 fileStorage = fileStorage->
next;
497 sprintf( commandLine,
"\"%s\" \"%s\" \"%s\" %s %s",
498 diskToolsExecutableName,
504 printf(
"The compilation of assembly program failed.\n\n");
505 printf(
"Please use option '-I' to install chain tool.\n\n");
510 printf(
"%s\n", diskName );
513 storage = storage->
next;
523 strcat( basePath, storage->
fileName );
525 strcat( basePath,
"disk%d.dsk" );
531 strcopy( filemask,
"disk%d.dsk" );
534 sprintf( diskName, filemask, i );
535 if ( !strstr( diskName,
".dsk" ) ) {
536 strcat( diskName,
".dsk" );
540 sprintf( commandLine,
"del /f /q %s*.* %s", temporaryPath, pipes );
542 sprintf( commandLine,
"rm %s* %s", temporaryPath, pipes );
552 remove( binaryName );