Commit 53700c15 authored by Flyinghead's avatar Flyinghead
Browse files

Fix x86 build on android

parent 4a020d40
......@@ -96,8 +96,10 @@ ngen_mainloop:
mov ecx,[0xA0000000] # PC
mov dword ptr cycle_counter, 448 #SH4_TIMESLICE
mov dword ptr loop_no_update,offset no_update
mov dword ptr intc_sched,offset intc_sched_offs
lea eax, no_update
mov dword ptr loop_no_update, eax
lea eax, intc_sched_offs
mov dword ptr intc_sched, eax
mov eax,0
......
......@@ -728,7 +728,7 @@ bool ngen_Rewrite(size_t& addr,size_t retadr,size_t acc)
//found !
if ((acc >> 26) == 0x38 && !w) {
printf("WARNING: SQ AREA READ, %08X from sh4:%08X. THIS IS UNDEFINED ON A REAL DREACMAST.\n", acc, bm_GetBlock(x86e->x86_buff)->addr);
printf("WARNING: SQ AREA READ, %08X from sh4:%08X. THIS IS UNDEFINED ON A REAL DREACMAST.\n", acc, bm_GetBlock2(x86e->x86_buff)->addr);
}
if ((acc >> 26) == 0x38) //sq ?
......
......@@ -511,21 +511,21 @@ void ngen_opcode(RuntimeBlockInfo* block, shil_opcode* op,x86_block* x86e, bool
switch(size)
{
case 1:
if (!fuct) fuct=ReadMem8;
if (!fuct) fuct=(void*)ReadMem8;
x86e->Emit(op_call,x86_ptr_imm(fuct));
x86e->Emit(op_movsx8to32,EAX,EAX);
break;
case 2:
if (!fuct) fuct=ReadMem16;
if (!fuct) fuct=(void*)ReadMem16;
x86e->Emit(op_call,x86_ptr_imm(fuct));
x86e->Emit(op_movsx16to32,EAX,EAX);
break;
case 4:
if (!fuct) fuct=ReadMem32;
if (!fuct) fuct=(void*)ReadMem32;
x86e->Emit(op_call,x86_ptr_imm(fuct));
break;
case 8:
if (!fuct) fuct=ReadMem64;
if (!fuct) fuct=(void*)ReadMem64;
x86e->Emit(op_call,x86_ptr_imm(fuct));
break;
default:
......
......@@ -228,6 +228,22 @@ struct /*__declspec(dllexport)*/ x86_ptr_imm
{
this->ptr=ptr;
}
#if HOST_CPU == CPU_X86
#if !defined(WIN32) && !defined(TARGET_OS_MAC)
template<typename Rv, typename ...Args>
x86_ptr_imm(Rv(* ptr)(Args...))
{
this->ptr= reinterpret_cast<void*>(ptr);
}
#endif
template<typename Rv, typename ...Args>
x86_ptr_imm(Rv(DYNACALL * ptr)(Args...))
{
this->ptr= reinterpret_cast<void*>(ptr);
}
#endif
};
enum x86_mrm_mod
......
......@@ -25,6 +25,7 @@ HOST_CPU_ARM=0x20000002
HOST_CPU_MIPS=0x20000003
HOST_CPU_X64=0x20000004
HOST_CPU_ARM64=0x20000006
platform := unix
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
WITH_DYNAREC := arm64
......@@ -60,7 +61,7 @@ ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), x86_64 x64))
endif
ifeq ($(WITH_DYNAREC), x86)
COREFLAGS += -DHOST_CPU=$(HOST_CPU_X86)
COREFLAGS += -DHOST_CPU=$(HOST_CPU_X86) -DTARGET_NO_AREC
endif
ifeq ($(WITH_DYNAREC), arm)
......@@ -94,6 +95,7 @@ LOCAL_LDLIBS := -lGLESv2 -llog
LOCAL_CPP_FEATURES := exceptions
LOCAL_ARM_NEON := true
LOCAL_ARM_MODE := arm
LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
ifeq ($(NO_THREADS),1)
else
......
APP_ABI := armeabi-v7a arm64-v8a x86_64
APP_ABI := armeabi-v7a arm64-v8a x86_64 x86
APP_STL := gnustl_static
APP_PLATFORM := android-19
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment