diff --git a/include/crt.c b/include/crt.c index be30c4e..5bb41d8 100644 --- a/include/crt.c +++ b/include/crt.c @@ -219,8 +219,10 @@ w0: sta $ff3f #endif +#if !defined(OSCAR_TARGET_CRT8) && !defined(OSCAR_TARGET_CRT16) tsx stx spentry +#endif #endif diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 8637221..1b8966b 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -17798,7 +17798,7 @@ InterCodeProcedure::InterCodeProcedure(InterCodeModule * mod, const Location & l mNativeProcedure(false), mLeafProcedure(false), mCallsFunctionPointer(false), mCalledFunctions(nullptr), mFastCallProcedure(false), mInterrupt(false), mHardwareInterrupt(false), mCompiled(false), mInterruptCalled(false), mDynamicStack(false), mAssembled(false), mSaveTempsLinkerObject(nullptr), mValueReturn(false), mFramePointer(false), - mCheckUnreachable(true), mReturnType(IT_NONE), mCheapInline(false), + mCheckUnreachable(true), mReturnType(IT_NONE), mCheapInline(false), mNoInline(false), mDeclaration(nullptr), mGlobalsChecked(false), mDispatchedCall(false), mNumRestricted(1) { @@ -19707,7 +19707,7 @@ void InterCodeProcedure::Close(void) mLinkerObject->mFlags |= LOBJF_STATIC_STACK; } - if (!mEntryBlock->mTrueJump) + if (!mNoInline && !mEntryBlock->mTrueJump) { int nconst = 0, nvariables = 0, nparams = 0, ncalls = 0, nret = 0, nother = 0, nops = 0; for (int i = 0; i < mEntryBlock->mInstructions.Size(); i++) diff --git a/oscar64/InterCode.h b/oscar64/InterCode.h index b95c2c2..cd2d3b9 100644 --- a/oscar64/InterCode.h +++ b/oscar64/InterCode.h @@ -638,6 +638,7 @@ public: bool mCheckUnreachable; GrowingInterCodeProcedurePtrArray mCalledFunctions; bool mCheapInline; + bool mNoInline; InterCodeModule * mModule; int mID; diff --git a/oscar64/InterCodeGenerator.cpp b/oscar64/InterCodeGenerator.cpp index 43afdbe..1212e85 100644 --- a/oscar64/InterCodeGenerator.cpp +++ b/oscar64/InterCodeGenerator.cpp @@ -5174,6 +5174,9 @@ InterCodeProcedure* InterCodeGenerator::TranslateProcedure(InterCodeModule * mod if (dec->mFlags & DTF_DYNSTACK) proc->mDynamicStack = true; + if (dec->mFlags & DTF_PREVENT_INLINE) + proc->mNoInline = true; + if (dec->mBase->mFlags & DTF_FASTCALL) { proc->mFastCallProcedure = true; diff --git a/oscar64/Linker.cpp b/oscar64/Linker.cpp index 5a6b4c6..f489308 100644 --- a/oscar64/Linker.cpp +++ b/oscar64/Linker.cpp @@ -1117,6 +1117,9 @@ bool Linker::WriteCrtFile(const char* filename, uint16 id) memset(bootmem, 0, 0x4000); + if (mCartridgeBankUsed[0]) + memcpy(bootmem, mCartridge[0] + 0x8000, 0x4000); + LinkerRegion* mainRegion = FindRegion(Ident::Unique("main")); LinkerRegion* startupRegion = FindRegion(Ident::Unique("startup")); diff --git a/oscar64/Parser.cpp b/oscar64/Parser.cpp index d7da40d..ca3e12a 100644 --- a/oscar64/Parser.cpp +++ b/oscar64/Parser.cpp @@ -4698,6 +4698,8 @@ Declaration* Parser::ParseDeclaration(Declaration * pdec, bool variable, bool ex { if (ndec->mBase->mType == DT_TYPE_FUNCTION) { + ndec->mSection = mCodeSection; + if ((ndec->mFlags & DTF_DEFINED) && !(ndec->mFlags & DTF_REQUEST_INLINE)) { mErrors->Error(mScanner->mLocation, EERR_DUPLICATE_DEFINITION, "Duplicate function definition", ndec->mQualIdent); @@ -10046,6 +10048,7 @@ void Parser::ParseTemplateDeclarationBody(Declaration * tdec, Declaration * pthi mTemplateScope = tdec->mScope; ConsumeTokenIf(TK_INLINE); + ConsumeTokenIf(TK_NOINLINE); ConsumeTokenIf(TK_CONSTEXPR); Declaration* bdec = ParseBaseTypeDeclaration(0, true);