Optimize xy before loop index register assignment

This commit is contained in:
drmortalwombat 2024-06-18 16:08:53 +02:00
parent 277afd156d
commit 3f9d042863
3 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,11 @@ void sidfx_init(void)
} }
} }
bool sidfx_idle(byte chn)
{
return channels[chn].state == SIDFX_IDLE;
}
void sidfx_play(byte chn, const SIDFX * fx, byte cnt) void sidfx_play(byte chn, const SIDFX * fx, byte cnt)
{ {
SIDFXState ns = channels[chn].state; SIDFXState ns = channels[chn].state;

View File

@ -14,6 +14,8 @@ struct SIDFX
void sidfx_init(void); void sidfx_init(void);
inline bool sidfx_idle(byte chn);
inline void sidfx_play(byte chn, const SIDFX * fx, byte cnt); inline void sidfx_play(byte chn, const SIDFX * fx, byte cnt);
void sidfx_stop(byte chn); void sidfx_stop(byte chn);

View File

@ -48519,7 +48519,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
mInterProc = proc; mInterProc = proc;
mInterProc->mLinkerObject->mNativeProc = this; mInterProc->mLinkerObject->mNativeProc = this;
CheckFunc = !strcmp(mInterProc->mIdent->mString, "flossiec_read_lzo"); CheckFunc = !strcmp(mInterProc->mIdent->mString, "main");
int nblocks = proc->mBlocks.Size(); int nblocks = proc->mBlocks.Size();
tblocks = new NativeCodeBasicBlock * [nblocks]; tblocks = new NativeCodeBasicBlock * [nblocks];
@ -49773,6 +49773,13 @@ void NativeCodeProcedure::Optimize(void)
changed = true; changed = true;
#endif #endif
if (step == 2 && !changed)
{
ResetVisited();
if (mEntryBlock->CombineSameXY())
changed = true;
}
#if 1 #if 1
if (step >= 5) if (step >= 5)
{ {