sh2 drc host disassembler integration for gp2x

This commit is contained in:
kub 2019-03-20 21:12:10 +01:00
parent 5a5d765c23
commit f5939109c4
6 changed files with 26 additions and 11 deletions

View file

@ -122,8 +122,6 @@ OBJS += platform/gp2x/emu.o
OBJS += platform/gp2x/vid_mmsp2.o OBJS += platform/gp2x/vid_mmsp2.o
OBJS += platform/gp2x/vid_pollux.o OBJS += platform/gp2x/vid_pollux.o
OBJS += platform/gp2x/warm.o OBJS += platform/gp2x/warm.o
OBJS += platform/gp2x/host_dasm.o
OBJS += cpu/sh2/mame/sh2dasm.o
USE_FRONTEND = 1 USE_FRONTEND = 1
PLATFORM_MP3 = 1 PLATFORM_MP3 = 1
PLATFORM_ZLIB = 1 PLATFORM_ZLIB = 1

View file

@ -4,10 +4,9 @@ CC = gcc
CXX = g++ CXX = g++
AS = as AS = as
STRIP = strip STRIP = strip
CFLAGS += -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Wno-unused-result -m32 #-DGPERF -pg CFLAGS += -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Wno-unused-result -m32 # -pg
ASFLAGS += ASFLAGS +=
LDFLAGS += -m32 #-pg LDFLAGS += -m32 #-pg
LDLIBS += -L$(HOME)/opt/binutils-i386/usr/lib/ -lbfd-2.24-multiarch -lopcodes-2.24-multiarch
LDLIBS += -L/usr/lib/i386-linux-gnu/debug -L/home/build/opt/lib32 -lSDL-1.2 -lasound -lpng -lz -lm -ldl LDLIBS += -L/usr/lib/i386-linux-gnu/debug -L/home/build/opt/lib32 -lSDL-1.2 -lasound -lpng -lz -lm -ldl
ARCH = x86 ARCH = x86

View file

@ -2744,7 +2744,7 @@ end_op:
if (drcf.pending_branch_direct) if (drcf.pending_branch_direct)
{ {
struct op_data *opd_b = struct op_data *opd_b =
(op_flags[i] & OF_DELAY_OP) ? &ops[i-1] : opd; (op_flags[i] & OF_DELAY_OP) ? opd-1 : opd;
u32 target_pc = opd_b->imm; u32 target_pc = opd_b->imm;
int cond = -1, ncond = -1; int cond = -1, ncond = -1;
void *target = NULL; void *target = NULL;

View file

@ -15,16 +15,17 @@
else if ( val < min ) val = min; \ else if ( val < min ) val = min; \
} }
int mix_32_to_16l_level;
void mix_32_to_16l_stereo(short *dest, int *src, int count) void mix_32_to_16l_stereo_core(short *dest, int *src, int count, int level)
{ {
int l, r; int l, r;
for (; count > 0; count--) for (; count > 0; count--)
{ {
l = r = *dest; l = r = *dest;
l += *src++; l += *src++ >> level;
r += *src++; r += *src++ >> level;
Limit( l, MAXOUT, MINOUT ); Limit( l, MAXOUT, MINOUT );
Limit( r, MAXOUT, MINOUT ); Limit( r, MAXOUT, MINOUT );
*dest++ = l; *dest++ = l;
@ -32,6 +33,15 @@ void mix_32_to_16l_stereo(short *dest, int *src, int count)
} }
} }
void mix_32_to_16l_stereo_lvl(short *dest, int *src, int count)
{
mix_32_to_16l_stereo_core(dest, src, count, mix_32_to_16l_level);
}
void mix_32_to_16l_stereo(short *dest, int *src, int count)
{
mix_32_to_16l_stereo_core(dest, src, count, 0);
}
void mix_32_to_16_mono(short *dest, int *src, int count) void mix_32_to_16_mono(short *dest, int *src, int count)
{ {

View file

@ -161,8 +161,16 @@ SRCS_COMMON += $(R)cpu/sh2/compiler.c
ifdef drc_debug ifdef drc_debug
DEFINES += DRC_DEBUG=$(drc_debug) DEFINES += DRC_DEBUG=$(drc_debug)
SRCS_COMMON += $(R)cpu/sh2/mame/sh2dasm.c SRCS_COMMON += $(R)cpu/sh2/mame/sh2dasm.c
SRCS_COMMON += $(R)platform/libpicofe/linux/host_dasm.c DASM = $(R)platform/libpicofe/linux/host_dasm.c
LDFLAGS += -lbfd -lopcodes -liberty DASMLIBS = -lbfd -lopcodes -liberty
ifeq "$(ARCH)" "arm"
ifeq ($(filter_out $(shell $(CC) --print-file-name=libbfd.so),"/"),)
DASM = $(R)platform/common/host_dasm_arm.c
DASMLIBS =
endif
endif
SRCS_COMMON += $(DASM)
LDFLAGS += $(DASMLIBS)
endif endif
endif # use_sh2drc endif # use_sh2drc
SRCS_COMMON += $(R)cpu/sh2/mame/sh2pico.c SRCS_COMMON += $(R)cpu/sh2/mame/sh2pico.c

View file

@ -2,7 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../common/disarm.c" #include "disarm.c"
/* symbols */ /* symbols */