mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 06:47:45 -04:00
32x: drc: ARM implementation, start unification with SVP (untested)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@821 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
e2b00b3ae8
commit
6ad8f1d686
3 changed files with 49 additions and 6 deletions
|
@ -9,6 +9,10 @@ drc_debug = 1
|
||||||
|
|
||||||
-include Makefile.local
|
-include Makefile.local
|
||||||
|
|
||||||
|
ifndef ARCH
|
||||||
|
ARCH = x86
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq "$(profile)" "1"
|
ifeq "$(profile)" "1"
|
||||||
CFLAGS += -O3 -Wall
|
CFLAGS += -O3 -Wall
|
||||||
CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
|
CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
|
||||||
|
@ -18,7 +22,15 @@ CFLAGS += -ggdb -Wall -falign-functions=2
|
||||||
endif
|
endif
|
||||||
DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV
|
DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV
|
||||||
CFLAGS += -I../.. -I.
|
CFLAGS += -I../.. -I.
|
||||||
LDFLAGS += -lX11 -lpthread
|
LDFLAGS += -lpthread
|
||||||
|
ifeq "$(ARCH)" "arm"
|
||||||
|
CFLAGS += -mcpu=arm920t
|
||||||
|
DEFINES += ARM
|
||||||
|
else
|
||||||
|
LDFLAGS += -lX11
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC = $(CROSS)gcc
|
||||||
|
|
||||||
# frontend
|
# frontend
|
||||||
OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o
|
OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o
|
||||||
|
@ -50,6 +62,9 @@ OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/m
|
||||||
# Pico - carthw
|
# Pico - carthw
|
||||||
OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
|
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
|
pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o
|
||||||
|
ifeq "$(ARCH)" "arm"
|
||||||
|
OBJS += pico/carthw/svp/stub_arm.o
|
||||||
|
endif
|
||||||
# zlib
|
# zlib
|
||||||
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
|
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
|
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
|
||||||
|
@ -79,7 +94,7 @@ ifeq "$(use_sh2drc)" "1"
|
||||||
DEFINES += DRC_SH2 DRC_TMP
|
DEFINES += DRC_SH2 DRC_TMP
|
||||||
OBJS += cpu/sh2/mame/sh2pico.o
|
OBJS += cpu/sh2/mame/sh2pico.o
|
||||||
OBJS += cpu/sh2/compiler.o
|
OBJS += cpu/sh2/compiler.o
|
||||||
OBJS += cpu/sh2/stub_x86.o
|
OBJS += cpu/sh2/stub_$(ARCH).o
|
||||||
ifeq "$(drc_debug)" "1"
|
ifeq "$(drc_debug)" "1"
|
||||||
DEFINES += DRC_DEBUG=1
|
DEFINES += DRC_DEBUG=1
|
||||||
OBJS += cpu/sh2/mame/sh2dasm.o
|
OBJS += cpu/sh2/mame/sh2dasm.o
|
||||||
|
@ -100,6 +115,8 @@ endif
|
||||||
CFLAGS += $(addprefix -D,$(DEFINES))
|
CFLAGS += $(addprefix -D,$(DEFINES))
|
||||||
|
|
||||||
vpath %.c = ../..
|
vpath %.c = ../..
|
||||||
|
vpath %.s = ../..
|
||||||
|
vpath %.S = ../..
|
||||||
vpath %.asm = ../..
|
vpath %.asm = ../..
|
||||||
|
|
||||||
DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
|
DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
|
||||||
|
@ -122,7 +139,7 @@ mkdirs:
|
||||||
|
|
||||||
include ../common/revision.mak
|
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/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
|
pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
|
||||||
|
|
||||||
|
|
12
linux/gp2x.c
12
linux/gp2x.c
|
@ -33,6 +33,9 @@ int crashed_940 = 0;
|
||||||
int default_cpu_clock = 123;
|
int default_cpu_clock = 123;
|
||||||
void *gp2x_memregs = NULL;
|
void *gp2x_memregs = NULL;
|
||||||
|
|
||||||
|
/* ifndef is for qemu build without video out */
|
||||||
|
#ifndef ARM
|
||||||
|
|
||||||
/* faking GP2X pad */
|
/* faking GP2X pad */
|
||||||
enum { GP2X_UP=0x1, GP2X_LEFT=0x4, GP2X_DOWN=0x10, GP2X_RIGHT=0x40,
|
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,
|
GP2X_START=1<<8, GP2X_SELECT=1<<9, GP2X_L=1<<10, GP2X_R=1<<11,
|
||||||
|
@ -252,6 +255,7 @@ static void xlib_init(void)
|
||||||
sem_wait(&xlib_sem);
|
sem_wait(&xlib_sem);
|
||||||
sem_destroy(&xlib_sem);
|
sem_destroy(&xlib_sem);
|
||||||
}
|
}
|
||||||
|
#endif // !ARM
|
||||||
|
|
||||||
/* --- */
|
/* --- */
|
||||||
|
|
||||||
|
@ -272,6 +276,7 @@ static void realloc_screen(void)
|
||||||
/* gp2x/emu.c stuff, most to be rm'd */
|
/* gp2x/emu.c stuff, most to be rm'd */
|
||||||
static void gp2x_video_flip_(void)
|
static void gp2x_video_flip_(void)
|
||||||
{
|
{
|
||||||
|
#ifndef ARM
|
||||||
unsigned int *image;
|
unsigned int *image;
|
||||||
int pixel_count, i;
|
int pixel_count, i;
|
||||||
|
|
||||||
|
@ -311,6 +316,7 @@ static void gp2x_video_flip_(void)
|
||||||
realloc_screen();
|
realloc_screen();
|
||||||
ximage_realloc(xlib_display, DefaultVisual(xlib_display, 0));
|
ximage_realloc(xlib_display, DefaultVisual(xlib_display, 0));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gp2x_video_changemode_ll_(int bpp)
|
static void gp2x_video_changemode_ll_(int bpp)
|
||||||
|
@ -405,7 +411,9 @@ void plat_init(void)
|
||||||
// snd
|
// snd
|
||||||
sndout_oss_init();
|
sndout_oss_init();
|
||||||
|
|
||||||
|
#ifndef ARM
|
||||||
xlib_init();
|
xlib_init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void plat_finish(void)
|
void plat_finish(void)
|
||||||
|
@ -459,6 +467,10 @@ void mp3_update(int *buffer, int length, int stereo)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cache_flush_d_inval_i()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* lprintf */
|
/* lprintf */
|
||||||
void lprintf(const char *fmt, ...)
|
void lprintf(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,20 @@ extern char **g_argv;
|
||||||
|
|
||||||
static struct disassemble_info di;
|
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 */
|
/* symbols */
|
||||||
static asymbol **symbols;
|
static asymbol **symbols;
|
||||||
static long symcount;
|
static long symcount;
|
||||||
|
@ -141,8 +155,8 @@ static void host_dasm_init(void)
|
||||||
di.print_address_func = dis_asm_print_address;
|
di.print_address_func = dis_asm_print_address;
|
||||||
// di.symbol_at_address_func = dis_asm_symbol_at_address;
|
// di.symbol_at_address_func = dis_asm_symbol_at_address;
|
||||||
di.read_memory_func = dis_asm_read_memory;
|
di.read_memory_func = dis_asm_read_memory;
|
||||||
di.arch = bfd_arch_i386;
|
di.arch = BFD_ARCH;
|
||||||
di.mach = bfd_mach_i386_i386_intel_syntax;
|
di.mach = BFD_MACH;
|
||||||
di.endian = BFD_ENDIAN_LITTLE;
|
di.endian = BFD_ENDIAN_LITTLE;
|
||||||
disassemble_init_for_target(&di);
|
disassemble_init_for_target(&di);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +174,7 @@ void host_dasm(void *addr, int len)
|
||||||
vma_end = vma + len;
|
vma_end = vma + len;
|
||||||
while (vma < vma_end) {
|
while (vma < vma_end) {
|
||||||
printf(" %p ", (void *)(long)vma);
|
printf(" %p ", (void *)(long)vma);
|
||||||
vma += print_insn_i386_intel(vma, &di);
|
vma += print_insn_func(vma, &di);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue