Skip to content

Commit

Permalink
Fixed BS1 hung
Browse files Browse the repository at this point in the history
  • Loading branch information
ogamespec committed Aug 27, 2020
1 parent 96a9fb3 commit c5f82be
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Data/DefaultSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"RSWHACK": true,
"VI_LOG": false,
"VI_XFB": true,
"BOOTROM": "",
"DSP_DROM": "",
"DSP_IROM": "",
"BOOTROM": "Data/gc-ntsc-10.bin",
"DSP_DROM": "Data/dsp_drom.bin",
"DSP_IROM": "Data/dsp_irom.bin",
},

"hle":
Expand Down
2 changes: 1 addition & 1 deletion SRC/GekkoCore/GekkoCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ namespace Gekko
Json::Value* output = new Json::Value();
output->type = Json::ValueType::Int;

output->value.AsInt = pa < RAMSIZE ? (uint64_t)&mi.ram[pa] : 0;
output->value.AsInt = (uint64_t)MITranslatePhysicalAddress(pa, sizeof(uint32_t));

return output;
}
Expand Down
37 changes: 37 additions & 0 deletions SRC/GekkoCore/Interpreter/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,19 @@ namespace Gekko
return;
}

uint32_t oldMsr = Gekko->regs.msr;
Gekko->regs.msr = RRS;

if ((oldMsr & MSR_IR) != (Gekko->regs.msr & MSR_IR))
{
Gekko->itlb.InvalidateAll();
}

if ((oldMsr & MSR_DR) != (Gekko->regs.msr & MSR_DR))
{
Gekko->dtlb.InvalidateAll();
}

Gekko->regs.pc += 4;
}

Expand Down Expand Up @@ -171,6 +183,9 @@ namespace Gekko

Report(Channel::CPU, "SDR <- %08X (IR:%i DR:%i pc:%08X)\n",
RRS, msr_ir, msr_dr, Gekko->regs.pc);

Gekko->dtlb.InvalidateAll();
Gekko->itlb.InvalidateAll();
}
break;

Expand Down Expand Up @@ -281,6 +296,28 @@ namespace Gekko
}
}
break;

case (int)SPR::IBAT0U:
case (int)SPR::IBAT0L:
case (int)SPR::IBAT1U:
case (int)SPR::IBAT1L:
case (int)SPR::IBAT2U:
case (int)SPR::IBAT2L:
case (int)SPR::IBAT3U:
case (int)SPR::IBAT3L:
Gekko->itlb.InvalidateAll();
break;

case (int)SPR::DBAT0U:
case (int)SPR::DBAT0L:
case (int)SPR::DBAT1U:
case (int)SPR::DBAT1L:
case (int)SPR::DBAT2U:
case (int)SPR::DBAT2L:
case (int)SPR::DBAT3U:
case (int)SPR::DBAT3L:
Gekko->dtlb.InvalidateAll();
break;
}

// default
Expand Down

0 comments on commit c5f82be

Please sign in to comment.