More code reorganization.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1605 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-12-20 12:10:59 +00:00
parent f0bb8f430a
commit 614dc1069e
16 changed files with 203 additions and 199 deletions

View File

@ -496,7 +496,9 @@ void CCodeWindow::OnJITOff(wxCommandEvent& event)
// creates the SCoreStartupParameter as a game is loaded
GetMenuBar()->Check(event.GetId(),!event.IsChecked());
wxMessageBox(_T("Please start a game before changing mode."));
} else {
}
else
{
if (Core::GetState() != Core::CORE_RUN)
{
switch (event.GetId())
@ -504,9 +506,8 @@ void CCodeWindow::OnJITOff(wxCommandEvent& event)
case IDM_JITUNLIMITED:
Core::g_CoreStartupParameter.bJITUnlimitedCache = event.IsChecked();
jit.ClearCache(); // allow InitCache() even after the game has started
jit.InitCache();
GetMenuBar()->Enable(event.GetId(),!event.IsChecked());
break;
return; // avoid a second jit.ClearCache
case IDM_JITOFF:
Core::g_CoreStartupParameter.bJITOff = event.IsChecked(); break;
case IDM_JITLSOFF:
@ -531,15 +532,15 @@ void CCodeWindow::OnJITOff(wxCommandEvent& event)
Core::g_CoreStartupParameter.bJITSystemRegistersOff = event.IsChecked(); break;
}
jit.ClearCache();
} else {
}
else
{
//event.Skip(); // this doesn't work
GetMenuBar()->Check(event.GetId(),!event.IsChecked());
wxMessageBox(_T("Please pause the emulator before changing mode."));
}
}
}
// ==============
void CCodeWindow::OnJitMenu(wxCommandEvent& event)
{

View File

@ -138,16 +138,16 @@ void CJitWindow::Compare(u32 em_address)
disassembler x64disasm;
x64disasm.set_syntax_intel();
int block_num = jit.GetBlockNumberFromAddress(em_address);
int block_num = jit.GetBlockCache()->GetBlockNumberFromAddress(em_address);
if (block_num < 0)
{
for (int i = 0; i < 500; i++) {
block_num = jit.GetBlockNumberFromAddress(em_address - 4 * i);
block_num = jit.GetBlockCache()->GetBlockNumberFromAddress(em_address - 4 * i);
if (block_num >= 0)
break;
}
if (block_num >= 0) {
Jit64::JitBlock *block = jit.GetBlock(block_num);
JitBlock *block = jit.GetBlockCache()->GetBlock(block_num);
if (!(block->originalAddress <= em_address && block->originalSize + block->originalAddress >= em_address))
block_num = -1;
}
@ -158,13 +158,13 @@ void CJitWindow::Compare(u32 em_address)
return;
}
}
Jit64::JitBlock *block = jit.GetBlock(block_num);
JitBlock *block = jit.GetBlockCache()->GetBlock(block_num);
// 800031f0
// == Fill in x86 box
memset(xDis, 0, 65536);
const u8 *code = (const u8 *)jit.GetCompiledCodeFromBlock(block_num);
const u8 *code = (const u8 *)jit.GetBlockCache()->GetCompiledCodeFromBlock(block_num);
u64 disasmPtr = (u64)code;
int size = block->codeSize;
const u8 *end = code + size;