[DYNAREC] Added BOX64_DYNAREC_NOHOTPAGE to disabled hotpage detection

This commit is contained in:
ptitSeb
2025-10-03 15:45:11 +02:00
parent 6ae0524da6
commit 7bf2caa5c4
6 changed files with 39 additions and 3 deletions

View File

@@ -91,6 +91,13 @@ Allow continue running a block that is unprotected and potentially dirty.
* 1: Allow continue to run a dynablock that write data in the same page as code. It can gets faster in loading time of some game but can also get unexpected crashes.
* 2: Will also, when it detect an HotPage, flag that page as NEVERCLEAN, and so it will not be write protected but Block build from that page will always be tested. It can be faster that way (but soem SMC case might not be trapped).
### BOX64_DYNAREC_NOHOTPAGE
Disable detection of hot page (where code is executed and data written at the same time).
* 0: Detect hot page [Default]
* 1: Do not detect hot page
### BOX64_DYNAREC_FASTNAN
Enable or disable fast NaN handling. Availble in WowBox64.

View File

@@ -197,6 +197,14 @@ Allow continue running a block that is unprotected and potentially dirty.
* 2 : Will also, when it detect an HotPage, flag that page as NEVERCLEAN, and so it will not be write protected but Block build from that page will always be tested. It can be faster that way (but soem SMC case might not be trapped).
=item B<BOX64_DYNAREC_NOHOTPAGE> =I<0|1>
Disable detection of hot page (where code is executed and data written at the same time).
* 0 : Detect hot page [Default]
* 1 : Do not detect hot page
=item B<BOX64_DYNAREC_DIV0> =I<0|1>
Enable or disable the generation of division-by-zero exception. Availble in WowBox64.

View File

@@ -343,6 +343,24 @@
}
]
},
{
"name": "BOX64_DYNAREC_NOHOTPAGE",
"description": "Disable detection of hot page (where code is executed and data written at the same time).",
"category": "Performance",
"wine": false,
"options": [
{
"key": "0",
"description": "Detect hot page",
"default": true
},
{
"key": "1",
"description": "Do not detect hot page",
"default": false
}
]
},
{
"name": "BOX64_DYNAREC_DIV0",
"description": "Enable or disable the generation of division-by-zero exception.",

View File

@@ -2250,6 +2250,8 @@ void CheckHotPage(uintptr_t addr, uint32_t prot)
return;
if(prot&PROT_NEVERCLEAN && BOX64ENV(dynarec_dirty)==2)
return;
if(BOX64ENV(dynarec_nohotpage))
return;
uintptr_t page = addr>>12;
// look for idx
int idx = IdxHotPage(page);

View File

@@ -13,9 +13,9 @@
#define PARITY(x) (((emu->x64emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
#ifdef DYNAREC
#define STEP CheckExec(emu, addr); if(step && !ACCESS_FLAG(F_TF)) return 0;
#define STEP2 CheckExec(emu, addr); if(step && !ACCESS_FLAG(F_TF)) {R_RIP = addr; return 0;}
#define STEP3 CheckExec(emu, addr); if(*step) (*step)++;
#define STEP if(step && !ACCESS_FLAG(F_TF)) return 0; else if((emu->old_ip>>12)!=(addr>>12)) CheckExec(emu, addr);
#define STEP2 if(step && !ACCESS_FLAG(F_TF)) {R_RIP = addr; return 0;} else if((emu->old_ip>>12)!=(addr>>12)) CheckExec(emu, addr);
#define STEP3 if(*step) (*step)++; else if((emu->old_ip>>12)!=(addr>>12)) CheckExec(emu, addr);
#else
#define STEP
#define STEP2

View File

@@ -47,6 +47,7 @@ extern char* ftrace_name;
INTEGER(BOX64_DYNAREC_CALLRET, dynarec_callret, 0, 0, 2, 1) \
BOOLEAN(BOX64_DYNAREC_DF, dynarec_df, 1, 1) \
INTEGER(BOX64_DYNAREC_DIRTY, dynarec_dirty, 0, 0, 2, 0) \
BOOLEAN(BOX64_DYNAREC_NOHOTPAGE, dynarec_nohotpage, 0, 0) \
BOOLEAN(BOX64_DYNAREC_DIV0, dynarec_div0, 0, 1) \
INTEGER(BOX64_DYNAREC_DUMP, dynarec_dump, 0, 0, 2, 1) \
STRING(BOX64_DYNAREC_DUMP_RANGE, dynarec_dump_range, 1) \