/* common */
#include "chartype.h"
#include "check.h"
+#include "fname.h"
#include "print.h"
#include "version.h"
#include "xmalloc.h"
/* Write the correct option length */
switch (OS) {
- case O65OS_CC65:
+ case O65OS_CC65:
/* Set the 16 bit id */
Opt[2] = (unsigned char) Id;
Opt[3] = (unsigned char) (Id >> 8);
- O65SetOption (D, O65OPT_OS, Opt, 4);
- break;
+ O65SetOption (D, O65OPT_OS, Opt, 4);
+ break;
- default:
+ default:
/* No id for OS/A65, Lunix, and unknown OSes */
O65SetOption (D, O65OPT_OS, Opt, 2);
- break;
+ break;
}
}
char OptBuf [256]; /* Buffer for option strings */
unsigned OptLen;
time_t T;
+ const char* Name;
/* Place the filename in the control structure */
D->Filename = GetString (F->Name);
/* Keep the user happy */
Print (stdout, 1, "Opened `%s'...\n", D->Filename);
- /* Define some more options: A timestamp and the linker version */
+ /* Define some more options: A timestamp, the linker version and the
+ * filename
+ */
T = time (0);
strcpy (OptBuf, ctime (&T));
OptLen = strlen (OptBuf);
O65SetOption (D, O65OPT_TIMESTAMP, OptBuf, OptLen + 1);
sprintf (OptBuf, "ld65 V%s", GetVersionAsString ());
O65SetOption (D, O65OPT_ASM, OptBuf, strlen (OptBuf) + 1);
+ Name = FindName (D->Filename);
+ O65SetOption (D, O65OPT_FILENAME, Name, strlen (Name) + 1);
/* Write the header */
O65WriteHeader (D);