Skip to content

Commit

Permalink
Do not clear and reset CR4 and the PSE enable bool on CPU config chan…
Browse files Browse the repository at this point in the history
…ge. That explains the bug where changing the cycle count using the configuration GUI causes Windows XP to immediately crash, because the handler was resetting CR4 and the PSE state.
  • Loading branch information
joncampbell123 committed Dec 26, 2024
1 parent ac6f282 commit 1968d02
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/cpu/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3616,9 +3616,16 @@ class CPU: public Module_base {
mainMenu.alloc_item(DOSBoxMenu::item_type_id,"cputype_experimental").
set_text("Experimental").set_callback_function(CpuType_ByName);

do_pse = false;
enable_pse = false;

CPU::Change_Config(configuration);
CPU_JMP(false,0,0,0); //Setup the first cpu core
menu_update_dynamic();

if(CPU_ArchitectureType >= CPU_ARCHTYPE_486NEW) {
cpu.cr4 = 0;
}
}
bool Change_Config(Section* newconfig) override {
const Section_prop * section=static_cast<Section_prop *>(newconfig);
Expand Down Expand Up @@ -4134,13 +4141,10 @@ class CPU: public Module_base {

if (enable_cmpxchg8b && CPU_ArchitectureType >= CPU_ARCHTYPE_PENTIUM) LOG_MSG("Pentium CMPXCHG8B emulation is enabled");

if (CPU_ArchitectureType >= CPU_ARCHTYPE_486NEW) {
do_pse = false;
cpu.cr4 = 0;
}
else {
enable_pse = false;
}
if (CPU_ArchitectureType < CPU_ARCHTYPE_486NEW) {
do_pse = false;
enable_pse = false;
}

menu_update_core();
menu_update_cputype();
Expand Down

0 comments on commit 1968d02

Please sign in to comment.