/* */
/* */
/* */
-/* (C) 2003 Ullrich von Bassewitz */
-/* Römerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 2003-2011, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
static const char* RelocExpr (const O65Data* D, unsigned char SegID,
unsigned long Val, const O65Reloc* R)
/* Generate the segment relative relocation expression. R is only used if the
- * expression contains am import, and may be NULL if this is an error (which
- * is then flagged).
- */
+** expression contains am import, and may be NULL if this is an error (which
+** is then flagged).
+*/
{
const O65Import* Import;
if (Model == O65_MODEL_CC65_MODULE) {
/* o65 files of type cc65-module are linked together with a definition
- * file for the zero page, but the zero page is not allocated in the
- * module itself, but the locations are mapped to the zp locations of
- * the main file.
- */
+ ** file for the zero page, but the zero page is not allocated in the
+ ** module itself, but the locations are mapped to the zp locations of
+ ** the main file.
+ */
fprintf (F, ".import\t__ZP_START__\t\t; Linker generated symbol\n");
fprintf (F, "%s = __ZP_START__\n", ZeropageLabel);
} else {
char* Author = 0;
/* For now, we do only accept o65 files generated by the ld65 linker which
- * have a specific format.
- */
+ ** have a specific format.
+ */
if (!Debug && D->Header.mode != O65_MODE_CC65) {
Error ("Cannot convert o65 files of this type");
}
PrintO65Stats (D);
/* Walk through the options and print them if verbose mode is enabled.
- * Check for a os=cc65 option and bail out if we didn't find one (for
- * now - later we switch to special handling).
- */
+ ** Check for a os=cc65 option and bail out if we didn't find one (for
+ ** now - later we switch to special handling).
+ */
for (I = 0; I < CollCount (&D->Options); ++I) {
/* Get the next option */
}
/* Open the output file */
- F = fopen (OutputName, "wb");
+ F = fopen (OutputName, "w");
if (F == 0) {
Error ("Cannot open `%s': %s", OutputName, strerror (errno));
}
/* Create a header */
- fprintf (F, ";\n; File generated by co65 v %u.%u.%u using model `%s'\n;\n",
- VER_MAJOR, VER_MINOR, VER_PATCH, GetModelName (Model));
+ fprintf (F, ";\n; File generated by co65 v %s using model `%s'\n;\n",
+ GetVersionAsString (), GetModelName (Model));
/* Select the CPU */
if ((D->Header.mode & O65_CPU_MASK) == O65_CPU_65816) {
- fprintf (F, ".p816\n");
+ fprintf (F, ".p816\n");
}
/* Object file options */
- fprintf (F, ".fopt\t\tcompiler,\"co65 v %u.%u.%u\"\n",
- VER_MAJOR, VER_MINOR, VER_PATCH);
+ fprintf (F, ".fopt\t\tcompiler,\"co65 v %s\"\n", GetVersionAsString ());
if (Author) {
fprintf (F, ".fopt\t\tauthor, \"%s\"\n", Author);
xfree (Author);
fprintf (F, ".end\n");
fclose (F);
}
-
-
-