diff --git a/include/c64/iecbus.c b/include/c64/iecbus.c index bfd18de..a5b9e97 100644 --- a/include/c64/iecbus.c +++ b/include/c64/iecbus.c @@ -103,19 +103,19 @@ static bool iec_writeb(char b) while (!data_in()); + delay(5); for(char i=0; i<8; i++) { - delay(8); clock_false(); - delay(8); + delay(4); if (b & 1) data_true(); else data_false(); clock_true(); b >>= 1; + delay(4); } - delay(8); clock_false(); data_true(); diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 6ad4feb..87e8b9c 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -5020,6 +5020,22 @@ bool InterInstruction::ConstantFolding(void) return true; } break; + case IC_TYPECAST: + if (mSrc[0].mTemp < 0) + { + if (mDst.mType == IT_POINTER && IsIntegerType(mSrc[0].mType)) + { + mCode = IC_CONSTANT; + mConst.mType = IT_POINTER; + mConst.mMemory = IM_ABSOLUTE; + mConst.mIntConst = mSrc[0].mIntConst; + mConst.mLinkerObject = nullptr; + mConst.mOperandSize = 2; + mNumOperands = 0; + return true; + } + } + break; case IC_LOAD_TEMPORARY: if (mDst.mTemp == mSrc[0].mTemp) { @@ -21000,7 +21016,7 @@ void InterCodeProcedure::Close(void) { GrowingTypeArray tstack(IT_NONE); - CheckFunc = !strcmp(mIdent->mString, "_menuShowSprites"); + CheckFunc = !strcmp(mIdent->mString, "main"); CheckCase = false; mEntryBlock = mBlocks[0];