-include Makefile.local
+ifndef ARCH
+ARCH = x86
+endif
+
ifeq "$(profile)" "1"
CFLAGS += -O3 -Wall
CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
endif
DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV
CFLAGS += -I../.. -I.
-LDFLAGS += -lX11 -lpthread
+LDFLAGS += -lpthread
+ifeq "$(ARCH)" "arm"
+CFLAGS += -mcpu=arm920t
+DEFINES += ARM
+else
+LDFLAGS += -lX11
+endif
+
+CC = $(CROSS)gcc
# frontend
OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o
# Pico - carthw
OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o
+ifeq "$(ARCH)" "arm"
+OBJS += pico/carthw/svp/stub_arm.o
+endif
# zlib
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
DEFINES += DRC_SH2 DRC_TMP
OBJS += cpu/sh2/mame/sh2pico.o
OBJS += cpu/sh2/compiler.o
-OBJS += cpu/sh2/stub_x86.o
+OBJS += cpu/sh2/stub_$(ARCH).o
ifeq "$(drc_debug)" "1"
DEFINES += DRC_DEBUG=1
OBJS += cpu/sh2/mame/sh2dasm.o
CFLAGS += $(addprefix -D,$(DEFINES))
vpath %.c = ../..
+vpath %.s = ../..
+vpath %.S = ../..
vpath %.asm = ../..
DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
include ../common/revision.mak
-pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c
+pico/carthw/svp/compiler.o : ../../cpu/drc/emit_arm.c
pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
int default_cpu_clock = 123;
void *gp2x_memregs = NULL;
+/* ifndef is for qemu build without video out */
+#ifndef ARM
+
/* faking GP2X pad */
enum { GP2X_UP=0x1, GP2X_LEFT=0x4, GP2X_DOWN=0x10, GP2X_RIGHT=0x40,
GP2X_START=1<<8, GP2X_SELECT=1<<9, GP2X_L=1<<10, GP2X_R=1<<11,
sem_wait(&xlib_sem);
sem_destroy(&xlib_sem);
}
+#endif // !ARM
/* --- */
/* gp2x/emu.c stuff, most to be rm'd */
static void gp2x_video_flip_(void)
{
+#ifndef ARM
unsigned int *image;
int pixel_count, i;
realloc_screen();
ximage_realloc(xlib_display, DefaultVisual(xlib_display, 0));
}
+#endif
}
static void gp2x_video_changemode_ll_(int bpp)
// snd
sndout_oss_init();
+#ifndef ARM
xlib_init();
+#endif
}
void plat_finish(void)
{
}
+void cache_flush_d_inval_i()
+{
+}
+
/* lprintf */
void lprintf(const char *fmt, ...)
{
static struct disassemble_info di;
+#ifdef ARM
+#define print_insn_func print_insn_little_arm
+#define BFD_ARCH bfd_arch_arm
+#define BFD_MACH bfd_mach_arm_4T
+#else
+#define print_insn_func print_insn_i386_intel
+#define BFD_ARCH bfd_arch_i386
+#define BFD_MACH bfd_mach_i386_i386_intel_syntax
+#endif
+
+/* hacks for ARM */
+int floatformat_to_double;
+int floatformat_ieee_single_little;
+
/* symbols */
static asymbol **symbols;
static long symcount;
di.print_address_func = dis_asm_print_address;
// di.symbol_at_address_func = dis_asm_symbol_at_address;
di.read_memory_func = dis_asm_read_memory;
- di.arch = bfd_arch_i386;
- di.mach = bfd_mach_i386_i386_intel_syntax;
+ di.arch = BFD_ARCH;
+ di.mach = BFD_MACH;
di.endian = BFD_ENDIAN_LITTLE;
disassemble_init_for_target(&di);
}
vma_end = vma + len;
while (vma < vma_end) {
printf(" %p ", (void *)(long)vma);
- vma += print_insn_i386_intel(vma, &di);
+ vma += print_insn_func(vma, &di);
printf("\n");
}
}