x86 builds and basically works on Android x86 devices

This commit is contained in:
Aaron Culliney 2015-11-09 22:19:52 -08:00
parent 3bdbe50f0f
commit e4c669f016
5 changed files with 20 additions and 12 deletions

View File

@ -1,4 +1,4 @@
APP_ABI := armeabi armeabi-v7a ## TODO : x86
APP_ABI := armeabi armeabi-v7a x86
# Do not change APP_PLATFORM if we care about Gingerbread (2.3.3) devices! We must compile against android-10,
# otherwise we may encounter runtime load-library errors from symbols that should have been inlined against older

View File

@ -30,6 +30,7 @@ LOCAL_LDLIBS := $(APPLE2_BASE_LDLIBS)
ifeq ($(TARGET_ARCH_ABI),x86)
LOCAL_SRC_FILES += $(APPLE2_X86_SRC)
LOCAL_CFLAGS += -DNO_UNDERSCORES=1
else
LOCAL_SRC_FILES += $(APPLE2_ARM_SRC)
endif

View File

@ -122,7 +122,7 @@ fi
# Symbolicate and move symbols file into location to be deployed on device
SYMFILE=libapple2ix.so.sym
ARCHES_TO_SYMBOLICATE='armeabi armeabi-v7a'
ARCHES_TO_SYMBOLICATE='armeabi armeabi-v7a x86'
for arch in $ARCHES_TO_SYMBOLICATE ; do
SYMDIR=../assets/symbols/$arch/libapple2ix.so

View File

@ -47,6 +47,8 @@
// x86_64 registers
# define _XBP %rbp /* x86_64 base pointer */
# define _XSP %rsp /* x86_64 stack pointer */
# define _XDI %rdi
# define _XSI %rsi
# define _XAX %rax /* scratch */
# define _XBX %rbx /* scratch2 */
# define _X8 %r8
@ -83,6 +85,8 @@
// x86 registers
# define _XBP %ebp /* x86 base pointer */
# define _XSP %esp /* x86 stack pointer */
# define _XDI %edi
# define _XSI %esi
# define _XAX %eax /* scratch */
# define _XBX %ebx /* scratch2 */
// full-length Apple ][ registers

View File

@ -2216,12 +2216,15 @@ ex_irq: testb $I_Flag, F_Reg // Already interrupt
------------------------------------------------------------------------- */
ENTRY(cpu65_run)
#ifdef __LP64__
pushq %rbx
// NOTE: should we be also preserving r12-r15?
#endif
pushLQ _XBP
movLQ _XSP, _XBP
pushLQ _XDI
pushLQ _XSI
pushLQ _XBX
#ifdef __LP64__
// NOTE: should we be also preserving r12-r15?
#endif
// Restore CPU state when being called from C.
movzwLQ SYM(cpu65_ea), EffectiveAddr_X
@ -2256,18 +2259,18 @@ exit_cpu65_run:
// Save CPU state when returning from being called from C
movw PC_Reg, SYM(cpu65_pc)
CommonSaveCPUState
popLQ _XBX
popLQ _XSI
popLQ _XDI
popLQ _XBP
#ifdef __LP64__
popq %rbx
#endif
ret
exit_reinit: movb $0, SYM(cpu65__signal)
movb $1, SYM(emul_reinitialize)
popLQ _XBX
popLQ _XSI
popLQ _XDI
popLQ _XBP
#ifdef __LP64__
popq %rbx
#endif
ret
/* -------------------------------------------------------------------------