Added 'sim6502' and 'sim65C02' targets.

The targets allow to run cc65 programs in the sim65 exection
einvironment. As there are no "real" i/o facilities there's no
need for header files. Paravirtualized entry points are mapped
to $FFF0 ff. There's a large cc65 progam area from $0200-$FFEF.

The binary format includes a one-byte header indicating the required
execution environment: The value 0 means 6502 and the value 1
means 65C02. The load adress for the binary is fixed to $0200.

Note: Running sim65C02 programs currently doesn't work bcause
sim65 doesn't actually implement 65C02 opcodes.
This commit is contained in:
Oliver Schmidt
2013-05-20 20:35:42 +02:00
parent 3a028fb621
commit 55f9e6ac25
13 changed files with 331 additions and 1 deletions

View File

@@ -283,6 +283,14 @@ static void SetSys (const char* Sys)
NewSymbol ("__LYNX__", 1);
break;
case TGT_SIM6502:
NewSymbol ("__SIM6502__", 1);
break;
case TGT_SIM65C02:
NewSymbol ("__SIM65C02__", 1);
break;
default:
AbEnd ("Invalid target name: `%s'", Sys);

View File

@@ -239,6 +239,14 @@ static void SetSys (const char* Sys)
DefineNumericMacro ("__LYNX__", 1);
break;
case TGT_SIM6502:
DefineNumericMacro ("__SIM6502__", 1);
break;
case TGT_SIM65C02:
DefineNumericMacro ("__SIM65C02__", 1);
break;
default:
AbEnd ("Unknown target system type %d", Target);
}

View File

@@ -142,6 +142,8 @@ static const TargetEntry TargetMap[] = {
{ "none", TGT_NONE },
{ "pet", TGT_PET },
{ "plus4", TGT_PLUS4 },
{ "sim6502", TGT_SIM6502 },
{ "sim65c02", TGT_SIM65C02 },
{ "supervision", TGT_SUPERVISION },
{ "vc20", TGT_VIC20 },
{ "vic20", TGT_VIC20 },
@@ -172,6 +174,8 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
{ "nes", CPU_6502, BINFMT_BINARY, CTNone },
{ "supervision", CPU_65SC02, BINFMT_BINARY, CTNone },
{ "lynx", CPU_65C02, BINFMT_BINARY, CTNone },
{ "sim6502", CPU_6502, BINFMT_BINARY, CTNone },
{ "sim65c02", CPU_65C02, BINFMT_BINARY, CTNone },
};
/* Target system */

View File

@@ -73,6 +73,8 @@ typedef enum {
TGT_NES,
TGT_SUPERVISION,
TGT_LYNX,
TGT_SIM6502,
TGT_SIM65C02,
TGT_COUNT /* Number of target systems */
} target_t;