Add new o65 operating system
git-svn-id: svn://svn.cc65.org/cc65/trunk@1253 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -802,18 +802,19 @@ static void ParseO65 (void)
|
|||||||
/* Parse the o65 format section */
|
/* Parse the o65 format section */
|
||||||
{
|
{
|
||||||
static const IdentTok Attributes [] = {
|
static const IdentTok Attributes [] = {
|
||||||
{ "EXPORT", CFGTOK_EXPORT },
|
{ "EXPORT", CFGTOK_EXPORT },
|
||||||
{ "IMPORT", CFGTOK_IMPORT },
|
{ "IMPORT", CFGTOK_IMPORT },
|
||||||
{ "TYPE", CFGTOK_TYPE },
|
{ "TYPE", CFGTOK_TYPE },
|
||||||
{ "OS", CFGTOK_OS },
|
{ "OS", CFGTOK_OS },
|
||||||
};
|
};
|
||||||
static const IdentTok Types [] = {
|
static const IdentTok Types [] = {
|
||||||
{ "SMALL", CFGTOK_SMALL },
|
{ "SMALL", CFGTOK_SMALL },
|
||||||
{ "LARGE", CFGTOK_LARGE },
|
{ "LARGE", CFGTOK_LARGE },
|
||||||
};
|
};
|
||||||
static const IdentTok OperatingSystems [] = {
|
static const IdentTok OperatingSystems [] = {
|
||||||
{ "LUNIX", CFGTOK_LUNIX },
|
{ "LUNIX", CFGTOK_LUNIX },
|
||||||
{ "OSA65", CFGTOK_OSA65 },
|
{ "OSA65", CFGTOK_OSA65 },
|
||||||
|
{ "CC65", CFGTOK_CC65 },
|
||||||
};
|
};
|
||||||
|
|
||||||
while (CfgTok == CFGTOK_IDENT) {
|
while (CfgTok == CFGTOK_IDENT) {
|
||||||
@@ -878,7 +879,7 @@ static void ParseO65 (void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CFGTOK_LARGE:
|
case CFGTOK_LARGE:
|
||||||
O65SetLargeModel (O65FmtDesc);
|
O65SetLargeModel (O65FmtDesc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -894,12 +895,16 @@ static void ParseO65 (void)
|
|||||||
switch (CfgTok) {
|
switch (CfgTok) {
|
||||||
|
|
||||||
case CFGTOK_LUNIX:
|
case CFGTOK_LUNIX:
|
||||||
O65SetOS (O65FmtDesc, O65OS_LUNIX);
|
O65SetOS (O65FmtDesc, O65OS_LUNIX);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CFGTOK_OSA65:
|
case CFGTOK_OSA65:
|
||||||
O65SetOS (O65FmtDesc, O65OS_OSA65);
|
O65SetOS (O65FmtDesc, O65OS_OSA65);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CFGTOK_CC65:
|
||||||
|
O65SetOS (O65FmtDesc, O65OS_CC65);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CfgError ("Unexpected OS token");
|
CfgError ("Unexpected OS token");
|
||||||
|
|||||||
@@ -90,9 +90,9 @@
|
|||||||
#define O65RELOC_WORD 0x80
|
#define O65RELOC_WORD 0x80
|
||||||
#define O65RELOC_HIGH 0x40
|
#define O65RELOC_HIGH 0x40
|
||||||
#define O65RELOC_LOW 0x20
|
#define O65RELOC_LOW 0x20
|
||||||
#define O65RELOC_SEGADR 0xc0
|
#define O65RELOC_SEGADR 0xC0
|
||||||
#define O65RELOC_SEG 0xa0
|
#define O65RELOC_SEG 0xA0
|
||||||
#define O65RELOC_MASK 0xc0
|
#define O65RELOC_MASK 0xE0
|
||||||
|
|
||||||
/* O65 executable file header */
|
/* O65 executable file header */
|
||||||
typedef struct O65Header O65Header;
|
typedef struct O65Header O65Header;
|
||||||
@@ -1013,6 +1013,7 @@ void O65SetOS (O65Desc* D, unsigned OS)
|
|||||||
{
|
{
|
||||||
static const unsigned char OSA65 [2] = { O65OS_OSA65, 0 };
|
static const unsigned char OSA65 [2] = { O65OS_OSA65, 0 };
|
||||||
static const unsigned char Lunix [2] = { O65OS_LUNIX, 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 */
|
/* Write the correct option */
|
||||||
switch (OS) {
|
switch (OS) {
|
||||||
@@ -1025,6 +1026,10 @@ void O65SetOS (O65Desc* D, unsigned OS)
|
|||||||
O65SetOption (D, O65OPT_OS, Lunix, sizeof (Lunix));
|
O65SetOption (D, O65OPT_OS, Lunix, sizeof (Lunix));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case O65OS_CC65:
|
||||||
|
O65SetOption (D, O65OPT_OS, CC65, sizeof (CC65));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Internal ("Trying to set invalid O65 operating system: %u", OS);
|
Internal ("Trying to set invalid O65 operating system: %u", OS);
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ typedef struct O65Desc O65Desc;
|
|||||||
/* Operating system codes for O65OPT_OS */
|
/* Operating system codes for O65OPT_OS */
|
||||||
#define O65OS_OSA65 1
|
#define O65OS_OSA65 1
|
||||||
#define O65OS_LUNIX 2
|
#define O65OS_LUNIX 2
|
||||||
|
#define O65OS_CC65 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ typedef enum {
|
|||||||
|
|
||||||
CFGTOK_LUNIX,
|
CFGTOK_LUNIX,
|
||||||
CFGTOK_OSA65,
|
CFGTOK_OSA65,
|
||||||
|
CFGTOK_CC65,
|
||||||
|
|
||||||
CFGTOK_CONDES,
|
CFGTOK_CONDES,
|
||||||
CFGTOK_SEGMENT,
|
CFGTOK_SEGMENT,
|
||||||
|
|||||||
Reference in New Issue
Block a user