/* Parse the o65 format section */
{
static const IdentTok Attributes [] = {
- { "EXPORT", CFGTOK_EXPORT },
- { "IMPORT", CFGTOK_IMPORT },
- { "TYPE", CFGTOK_TYPE },
- { "OS", CFGTOK_OS },
+ { "EXPORT", CFGTOK_EXPORT },
+ { "IMPORT", CFGTOK_IMPORT },
+ { "TYPE", CFGTOK_TYPE },
+ { "OS", CFGTOK_OS },
};
static const IdentTok Types [] = {
- { "SMALL", CFGTOK_SMALL },
- { "LARGE", CFGTOK_LARGE },
+ { "SMALL", CFGTOK_SMALL },
+ { "LARGE", CFGTOK_LARGE },
};
static const IdentTok OperatingSystems [] = {
- { "LUNIX", CFGTOK_LUNIX },
- { "OSA65", CFGTOK_OSA65 },
+ { "LUNIX", CFGTOK_LUNIX },
+ { "OSA65", CFGTOK_OSA65 },
+ { "CC65", CFGTOK_CC65 },
};
while (CfgTok == CFGTOK_IDENT) {
break;
case CFGTOK_LARGE:
- O65SetLargeModel (O65FmtDesc);
+ O65SetLargeModel (O65FmtDesc);
break;
default:
switch (CfgTok) {
case CFGTOK_LUNIX:
- O65SetOS (O65FmtDesc, O65OS_LUNIX);
- break;
+ O65SetOS (O65FmtDesc, O65OS_LUNIX);
+ break;
case CFGTOK_OSA65:
- O65SetOS (O65FmtDesc, O65OS_OSA65);
- break;
+ O65SetOS (O65FmtDesc, O65OS_OSA65);
+ break;
+
+ case CFGTOK_CC65:
+ O65SetOS (O65FmtDesc, O65OS_CC65);
+ break;
default:
CfgError ("Unexpected OS token");
#define O65RELOC_WORD 0x80
#define O65RELOC_HIGH 0x40
#define O65RELOC_LOW 0x20
-#define O65RELOC_SEGADR 0xc0
-#define O65RELOC_SEG 0xa0
-#define O65RELOC_MASK 0xc0
+#define O65RELOC_SEGADR 0xC0
+#define O65RELOC_SEG 0xA0
+#define O65RELOC_MASK 0xE0
/* O65 executable file header */
typedef struct O65Header O65Header;
{
static const unsigned char OSA65 [2] = { O65OS_OSA65, 0 };
static const unsigned char Lunix [2] = { O65OS_LUNIX, 0 };
+ static const unsigned char CC65 [4] = { O65OS_CC65, 0, 0, 0 };
/* Write the correct option */
switch (OS) {
O65SetOption (D, O65OPT_OS, Lunix, sizeof (Lunix));
break;
+ case O65OS_CC65:
+ O65SetOption (D, O65OPT_OS, CC65, sizeof (CC65));
+ break;
+
default:
Internal ("Trying to set invalid O65 operating system: %u", OS);