NO_MMU build fixes

This commit is contained in:
Flyinghead 2019-04-19 11:56:11 +02:00
parent 9920880987
commit 553f6054ce
3 changed files with 17 additions and 3 deletions

View File

@ -1057,6 +1057,7 @@ bool dec_DecodeBlock(RuntimeBlockInfo* rbi,u32 max_cycles)
u32 op;
if (!mmu_enabled())
op = IReadMem16(state.cpu.rpc);
#ifndef NO_MMU
else
{
u32 exception_occurred;
@ -1064,6 +1065,7 @@ bool dec_DecodeBlock(RuntimeBlockInfo* rbi,u32 max_cycles)
if (exception_occurred)
return false;
}
#endif
if (op==0 && state.cpu.is_delayslot)
{
printf("Delayslot 0 hack!\n");
@ -1157,7 +1159,7 @@ _end:
if (settings.dynarec.idleskip)
{
//Experimental hash-id based idle skip
if (strstr(idle_hash,blk->hash(false,true)))
if (strstr(idle_hash,blk->hash(false,true))) // FIXME don't hash temp blocks. Use xxhash instead of sha1
{
//printf("IDLESKIP: %08X reloc match %s\n",blk->addr,blk->hash(false,true));
blk->guest_cycles=max_cycles*100;

View File

@ -290,6 +290,7 @@ RuntimeBlockInfo* ngen_AllocateBlock()
template<typename T>
static T ReadMemNoEx(u32 addr, u32 pc)
{
#ifndef NO_MMU
u32 ex;
T rv = mmu_ReadMemNoEx<T>(addr, &ex);
if (ex)
@ -301,11 +302,15 @@ static T ReadMemNoEx(u32 addr, u32 pc)
longjmp(jmp_env, 1);
}
return rv;
#else
return (T)0; // not used
#endif
}
template<typename T>
static void WriteMemNoEx(u32 addr, T data, u32 pc)
{
#ifndef NO_MMU
u32 ex = mmu_WriteMemNoEx<T>(addr, data);
if (ex)
{
@ -315,6 +320,7 @@ static void WriteMemNoEx(u32 addr, T data, u32 pc)
spc = pc;
longjmp(jmp_env, 1);
}
#endif
}
static u32 interpreter_fallback(u16 op, u32 pc)
@ -1619,7 +1625,7 @@ private:
TailCallRuntime(ngen_blockcheckfail);
Bind(&blockcheck_success);
/*
if (mmu_enabled() && block->has_fpu_op)
{
Label fpu_enabled;
@ -1635,7 +1641,6 @@ private:
Bind(&fpu_enabled);
}
*/
}
void shil_param_to_host_reg(const shil_param& param, const Register& reg)

View File

@ -224,6 +224,7 @@ static u32 exception_raised;
template<typename T>
static T ReadMemNoEx(u32 addr, u32 pc)
{
#ifndef NO_MMU
T rv = mmu_ReadMemNoEx<T>(addr, &exception_raised);
if (exception_raised)
{
@ -235,11 +236,16 @@ static T ReadMemNoEx(u32 addr, u32 pc)
longjmp(jmp_env, 1);
}
return rv;
#else
// not used
return (T)0;
#endif
}
template<typename T>
static void WriteMemNoEx(u32 addr, T data, u32 pc)
{
#ifndef NO_MMU
exception_raised = mmu_WriteMemNoEx<T>(addr, data);
if (exception_raised)
{
@ -250,6 +256,7 @@ static void WriteMemNoEx(u32 addr, T data, u32 pc)
spc = pc;
longjmp(jmp_env, 1);
}
#endif
}
static void interpreter_fallback(u16 op, OpCallFP *oph, u32 pc)