59 char * p = strstr(objectFileName,
".asm");
62 remove( objectFileName );
70 }
else if( access(
"run6502.exe", F_OK ) == 0 ) {
71 sprintf(executableName,
"%s",
"run6502.exe" );
73 sprintf(executableName,
"%s",
"run6502" );
76 sprintf( commandLine,
"\"%s\" -X 0000 -R 080d -l 07ff \"%s\" -u \"%s\" -p \"%s\" %d",
85 printf(
"The profiling of assembly program failed.\n\n");
97 FILE * prgHandle = fopen(_environment->
exeFileName,
"rb");
98 fseek( prgHandle, 0, SEEK_END );
99 int prgSize = ftell( prgHandle );
100 fseek( prgHandle, 0, SEEK_SET );
101 unsigned char * prgContent =
malloc( prgSize );
102 (void)!fread( prgContent, prgSize, 1, prgHandle );
107 char * p = strstr( d64FileName,
".d64" );
109 strcat( d64FileName,
".d64");
122 printf(
"%s\n", d64FileName );
132 while( fileStorage ) {
138 memset( buffer, 0,
size );
139 memcpy( &buffer[2], fileStorage->
content, fileStorage->
size );
141 FILE * file = fopen( fileStorage->
sourceName,
"rb" );
145 fseek( file, 0, SEEK_END );
146 size = ftell( file );
147 fseek( file, 0, SEEK_SET );
149 memset( buffer, 0,
size + 2 );
150 (void)!fread( &buffer[2],
size, 1, file );
155 fileStorage = fileStorage->
next;
159 strcopy( filemask, d64FileName );
165 strcat( basePath, storage->
fileName );
167 strcat( basePath,
"disk%d.d64" );
173 strcopy( filemask,
"disk%d.d64" );
176 sprintf( buffer, filemask, i );
177 if ( !strstr( buffer,
".d64" ) ) {
178 strcat( buffer,
".d64" );
182 printf(
"%s\n", buffer );
185 storage = storage->
next;
int system_call(Environment *_environment, char *_commandline)
Call an external executable.
char * find_last_path_separator(char *_path)
void target_linkage(Environment *_environment)
Convert C64's assembly to executable.
void target_cleanup(Environment *_environment)
void target_analysis(Environment *_environment)
void generate_prg(Environment *_environment)
void generate_d64(Environment *_environment)
D64Handle * d64_create(D64Format _format)
Create a new D64 disk image.
void d64_output(D64Handle *_handle, unsigned char *_filename)
void d64_free(D64Handle *_handle)
Free the disk image resources.
int d64_write_file(D64Handle *_handle, unsigned char *_filename, D64FileType _type, unsigned char *_buffer, int _size)
Write a block of memory on a file on the D64 disk image.
struct _D64Handle D64Handle
char * configurationFileName
OutputFileType outputFileType
struct _FileStorage * next
#define BUILD_SAFE_REMOVE(_environment, filename)
#define MAX_TEMPORARY_STORAGE
#define CRITICAL_DLOAD_MISSING_FILE(f)
#define BUILD_TOOLCHAIN_CC65_GET_EXECUTABLE(_environment, executableName)
#define BUILD_TOOLCHAIN_CC65_GET_LISTING_FILE(_environment, listingFileName)
struct _Environment Environment
Structure of compilation environment.
struct _Storage Storage
Structure of a single storage.
#define BUILD_TOOLCHAIN_CC65_EXEC(_environment, target, executableName, listingFileName, additionalParameters)
struct _FileStorage FileStorage
Structure of a single file inside a storage.
#define CRITICAL_UNSUPPORTED_OUTPUT_FILE_TYPE(t)
char OUTPUT_FILE_TYPE_AS_STRING[][16]
char * strcopy(char *_dest, char *_source)