Added support for multiboot dols. This allows demo discs, bonus discs etc to be played.

* Flushed the JIT cache on "ICFI" (Flush Instruction Cache)
* Made all instructions one cycle in duration

Fixes issue 233

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6088 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2010-08-11 10:45:27 +00:00
parent 9f57345c11
commit 6918a9e1d6
7 changed files with 20 additions and 4 deletions

View File

@ -660,7 +660,7 @@ u8 *GetPointer(const u32 _Address)
} }
else else
{ {
if (!PanicYesNo("Unknown pointer address prefix %02X, report this to the devs: 0x%08X \n Continue?", (_Address >> 24), _Address)) if (!Core::g_CoreStartupParameter.bMMU && !PanicYesNo("Unknown pointer address prefix %02X, report this to the devs: 0x%08X \n Continue?", (_Address >> 24), _Address))
Crash(); Crash();
return 0; return 0;
} }

View File

@ -455,7 +455,6 @@ void icbi(UGeckoInstruction _inst)
{ {
u32 address = Helper_Get_EA_X(_inst); u32 address = Helper_Get_EA_X(_inst);
PowerPC::ppcState.iCache.Invalidate(address); PowerPC::ppcState.iCache.Invalidate(address);
jit->GetBlockCache()->InvalidateICache(address);
} }
void lbzux(UGeckoInstruction _inst) void lbzux(UGeckoInstruction _inst)

View File

@ -516,7 +516,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
js.op = &ops[i]; js.op = &ops[i];
js.instructionNumber = i; js.instructionNumber = i;
const GekkoOPInfo *opinfo = ops[i].opinfo; const GekkoOPInfo *opinfo = ops[i].opinfo;
js.downcountAmount += (opinfo->numCyclesMinusOne + 1); js.downcountAmount++;
if (i == (int)size - 1) if (i == (int)size - 1)
{ {

View File

@ -138,6 +138,13 @@ bool JitBlock::ContainsAddress(u32 em_address)
memset(blockCodePointers, 0, sizeof(u8*)*MAX_NUM_BLOCKS); memset(blockCodePointers, 0, sizeof(u8*)*MAX_NUM_BLOCKS);
} }
void JitBlockCache::ClearSafe()
{
memset(iCache, JIT_ICACHE_INVALID_BYTE, JIT_ICACHE_SIZE);
memset(iCacheEx, JIT_ICACHE_INVALID_BYTE, JIT_ICACHEEX_SIZE);
memset(iCacheVMEM, JIT_ICACHE_INVALID_BYTE, JIT_ICACHE_SIZE);
}
/*void JitBlockCache::DestroyBlocksWithFlag(BlockFlag death_flag) /*void JitBlockCache::DestroyBlocksWithFlag(BlockFlag death_flag)
{ {
for (int i = 0; i < num_blocks; i++) for (int i = 0; i < num_blocks; i++)

View File

@ -99,6 +99,7 @@ public:
void FinalizeBlock(int block_num, bool block_link, const u8 *code_ptr); void FinalizeBlock(int block_num, bool block_link, const u8 *code_ptr);
void Clear(); void Clear();
void ClearSafe();
void Init(); void Init();
void Shutdown(); void Shutdown();
void Reset(); void Reset();

View File

@ -18,6 +18,8 @@
#include "PPCCache.h" #include "PPCCache.h"
#include "../HW/Memmap.h" #include "../HW/Memmap.h"
#include "PowerPC.h" #include "PowerPC.h"
#include "JitCommon/JitBase.h"
#include "JitCommon/JitCache.h"
namespace PowerPC namespace PowerPC
{ {
@ -74,10 +76,14 @@ namespace PowerPC
memset(lookup_table_ex, 0xff, sizeof(lookup_table_ex)); memset(lookup_table_ex, 0xff, sizeof(lookup_table_ex));
memset(lookup_table_vmem, 0xff, sizeof(lookup_table_vmem)); memset(lookup_table_vmem, 0xff, sizeof(lookup_table_vmem));
#endif #endif
if (jit)
jit->GetBlockCache()->ClearSafe();
} }
void InstructionCache::Invalidate(u32 addr) void InstructionCache::Invalidate(u32 addr)
{ {
if (jit)
jit->GetBlockCache()->InvalidateICache(addr);
if (!HID0.ICE) if (!HID0.ICE)
return; return;
// invalidates the whole set // invalidates the whole set

View File

@ -560,7 +560,10 @@ void CCodeWindow::OnCPUMode(wxCommandEvent& event)
} }
// Clear the JIT cache to enable these changes // Clear the JIT cache to enable these changes
if (jit)
{
jit->ClearCache(); jit->ClearCache();
}
// Update // Update
UpdateButtonStates(); UpdateButtonStates();
} }