Merge pull request #217 from CTalkobt/main
Initial patch to add -tm=mega65 support
This commit is contained in:
commit
01d187cf83
|
@ -523,6 +523,12 @@ bool Compiler::GenerateCode(void)
|
||||||
{
|
{
|
||||||
switch (mTargetMachine)
|
switch (mTargetMachine)
|
||||||
{
|
{
|
||||||
|
case TMACH_MEGA65:
|
||||||
|
if (mCompilerOptions & COPT_NATIVE)
|
||||||
|
regionStartup = mLinker->AddRegion(identStartup, 0x2001, 0x2080);
|
||||||
|
else
|
||||||
|
regionStartup = mLinker->AddRegion(identStartup, 0x2001, 0x2100);
|
||||||
|
break;
|
||||||
case TMACH_C64:
|
case TMACH_C64:
|
||||||
case TMACH_X16:
|
case TMACH_X16:
|
||||||
if (mCompilerOptions & COPT_NATIVE)
|
if (mCompilerOptions & COPT_NATIVE)
|
||||||
|
@ -625,6 +631,9 @@ bool Compiler::GenerateCode(void)
|
||||||
{
|
{
|
||||||
switch (mTargetMachine)
|
switch (mTargetMachine)
|
||||||
{
|
{
|
||||||
|
case TMACH_MEGA65:
|
||||||
|
regionBytecode = mLinker->AddRegion(identBytecode, 0x2100, 0x2200);
|
||||||
|
break;
|
||||||
case TMACH_C64:
|
case TMACH_C64:
|
||||||
case TMACH_X16:
|
case TMACH_X16:
|
||||||
regionBytecode = mLinker->AddRegion(identBytecode, 0x0900, 0x0a00);
|
regionBytecode = mLinker->AddRegion(identBytecode, 0x0900, 0x0a00);
|
||||||
|
@ -686,6 +695,9 @@ bool Compiler::GenerateCode(void)
|
||||||
{
|
{
|
||||||
switch (mTargetMachine)
|
switch (mTargetMachine)
|
||||||
{
|
{
|
||||||
|
case TMACH_MEGA65:
|
||||||
|
regionMain = mLinker->AddRegion(identMain, 0x2300, 0xe000);
|
||||||
|
break;
|
||||||
case TMACH_C64:
|
case TMACH_C64:
|
||||||
regionMain = mLinker->AddRegion(identMain, 0x0a00, 0xa000);
|
regionMain = mLinker->AddRegion(identMain, 0x0a00, 0xa000);
|
||||||
break;
|
break;
|
||||||
|
@ -737,6 +749,14 @@ bool Compiler::GenerateCode(void)
|
||||||
{
|
{
|
||||||
switch (mTargetMachine)
|
switch (mTargetMachine)
|
||||||
{
|
{
|
||||||
|
case TMACH_MEGA65:
|
||||||
|
// TODO: Disable M65 cartridges for now.
|
||||||
|
//
|
||||||
|
// if (mCompilerOptions & (COPT_TARGET_CRT8 | COPT_TARGET_CRT16))
|
||||||
|
// regionMain = mLinker->AddRegion(identMain, 0x2666, 0xff00);
|
||||||
|
// else
|
||||||
|
regionMain = mLinker->AddRegion(identMain, 0x2080, 0xe000);
|
||||||
|
break;
|
||||||
case TMACH_C64:
|
case TMACH_C64:
|
||||||
|
|
||||||
if (mCompilerOptions & (COPT_TARGET_CRT8 | COPT_TARGET_CRT16))
|
if (mCompilerOptions & (COPT_TARGET_CRT8 | COPT_TARGET_CRT16))
|
||||||
|
|
|
@ -78,7 +78,8 @@ enum TargetMachine
|
||||||
TMACH_NES_MMC1,
|
TMACH_NES_MMC1,
|
||||||
TMACH_NES_MMC3,
|
TMACH_NES_MMC3,
|
||||||
TMACH_ATARI,
|
TMACH_ATARI,
|
||||||
TMACH_X16
|
TMACH_X16,
|
||||||
|
TMACH_MEGA65
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -446,6 +446,12 @@ int main2(int argc, const char** argv)
|
||||||
compiler->mTargetMachine = TMACH_PLUS4;
|
compiler->mTargetMachine = TMACH_PLUS4;
|
||||||
compiler->AddDefine(Ident::Unique("__PLUS4__"), "1");
|
compiler->AddDefine(Ident::Unique("__PLUS4__"), "1");
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(targetMachine, "mega65"))
|
||||||
|
{
|
||||||
|
strcpy_s(basicStart, "0x2001");
|
||||||
|
compiler->mTargetMachine = TMACH_MEGA65;
|
||||||
|
compiler->AddDefine(Ident::Unique("__MEGA65__"), "1");
|
||||||
|
}
|
||||||
else if (!strcmp(targetMachine, "x16"))
|
else if (!strcmp(targetMachine, "x16"))
|
||||||
{
|
{
|
||||||
strcpy_s(basicStart, "0x0801");
|
strcpy_s(basicStart, "0x0801");
|
||||||
|
|
Loading…
Reference in New Issue