From a602cb058013fa9904b2cc715b6f3a23f54cd9b6 Mon Sep 17 00:00:00 2001 From: SarahW Date: Sat, 16 Dec 2017 17:26:42 +0000 Subject: [PATCH] Tweaked recompiler block lookup. Fixes massive slowdown seen on some Windows 9x installations at startup & possibly some other slowdowns. --- src/codegen.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/codegen.h b/src/codegen.h index 3a8a955..c5ad1ed 100644 --- a/src/codegen.h +++ b/src/codegen.h @@ -84,8 +84,12 @@ static inline codeblock_t *codeblock_tree_find(uint32_t phys, uint32_t _cs) while (block) { if (a == block->cmp) - break; - else if (a < block->cmp) + { + if (!((block->status ^ cpu_cur_status) & CPU_STATUS_FLAGS) && + ((block->status & cpu_cur_status & CPU_STATUS_MASK) == (cpu_cur_status & CPU_STATUS_MASK))) + break; + } + if (a < block->cmp) block = block->left; else block = block->right;