From 365accfde23a63444796387818d8a6e4bb089e63 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Sun, 9 Aug 2015 06:26:03 +0200 Subject: [PATCH] windows: fix TARGET_NO_NVMEM --- core/hw/sh4/interpr/sh4_interpreter.cpp | 1 + core/rec-x86/rec_x86_driver.cpp | 8 +++++++- core/rec-x86/rec_x86_il.cpp | 8 +++++++- core/windows/winmain.cpp | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/hw/sh4/interpr/sh4_interpreter.cpp b/core/hw/sh4/interpr/sh4_interpreter.cpp index 918edeeb2..35f572342 100644 --- a/core/hw/sh4/interpr/sh4_interpreter.cpp +++ b/core/hw/sh4/interpr/sh4_interpreter.cpp @@ -250,6 +250,7 @@ void Sh4_int_Init() rtc_schid=sh4_sched_register(0,&DreamcastSecond); sh4_sched_request(rtc_schid,SH4_MAIN_CLOCK); + memset(&p_sh4rcb->cntx, 0, sizeof(p_sh4rcb->cntx)); } void Sh4_int_Term() diff --git a/core/rec-x86/rec_x86_driver.cpp b/core/rec-x86/rec_x86_driver.cpp index b11da90ea..06e799bae 100644 --- a/core/rec-x86/rec_x86_driver.cpp +++ b/core/rec-x86/rec_x86_driver.cpp @@ -556,7 +556,10 @@ u32 DynaRBI::Relink() W F32v2 B,S{,M} */ +#if !defined(TARGET_NO_NVMEM) extern u8* virt_ram_base; +#endif + #include "hw/sh4/sh4_mmr.h" enum mem_op_type @@ -584,6 +587,7 @@ void gen_hande(u32 w, u32 sz, u32 mode) u32 si=x86e->x86_indx; +#ifndef TARGET_NO_NVMEM if (mode==0) { //Buffer @@ -616,7 +620,9 @@ void gen_hande(u32 w, u32 sz, u32 mode) } } } - else if (mode==1) + else +#endif + if (mode==1) { //SQ verify(w==1); diff --git a/core/rec-x86/rec_x86_il.cpp b/core/rec-x86/rec_x86_il.cpp index b90f13859..6419c20fb 100644 --- a/core/rec-x86/rec_x86_il.cpp +++ b/core/rec-x86/rec_x86_il.cpp @@ -179,7 +179,9 @@ void DYNACALL VERIFYME(u32 addr) verify((addr>>26)==0x38); } +#if !defined(TARGET_NO_NVMEM) extern u8* virt_ram_base; +#endif /* @@ -500,6 +502,8 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool if (size==8 && optimise) { + die("unreachable"); +#ifdef OPTIMIZATION_GRAVEYARD verify(op->rd.count()==2 && reg.IsAllocf(op->rd,0) && reg.IsAllocf(op->rd,1)); x86e->Emit(op_mov32,EDX,ECX); @@ -507,6 +511,7 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool x86e->Emit(op_movss,reg.mapfv(op->rd,0),x86_mrm(EDX,x86_ptr(virt_ram_base))); x86e->Emit(op_movss,reg.mapfv(op->rd,1),x86_mrm(EDX,x86_ptr(4+virt_ram_base))); break; +#endif } if (!isram) { @@ -649,7 +654,7 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool break; } #endif - +#ifdef OPTIMIZATION_GRAVEYARD die("woohoo"); /* if (size==8 && optimise) @@ -827,6 +832,7 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool } reg.ThawXMM(); } +#endif } done_writem: break; diff --git a/core/windows/winmain.cpp b/core/windows/winmain.cpp index e35693cd7..58140290a 100644 --- a/core/windows/winmain.cpp +++ b/core/windows/winmain.cpp @@ -126,10 +126,12 @@ LONG ExeptionHandler(EXCEPTION_POINTERS *ExceptionInfo) { return EXCEPTION_CONTINUE_EXECUTION; } +#ifndef TARGET_NO_NVMEM else if (BM_LockedWrite(address)) { return EXCEPTION_CONTINUE_EXECUTION; } +#endif #if FEAT_SHREC == DYNAREC_JIT && HOST_CPU == CPU_X86 else if ( ngen_Rewrite((unat&)ep->ContextRecord->Eip,*(unat*)ep->ContextRecord->Esp,ep->ContextRecord->Eax) ) {