Commit feb7ddab authored by aliaspider's avatar aliaspider
Browse files

build bix for non ARM platforms.

(still not functional)
parent 9adfbb8d
......@@ -15,9 +15,13 @@ endif
endif
ifeq ($(platform), unix)
TARGET := libretro.so
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=libretro/link.T
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
CFLAGS += -fno-builtin \
-fno-exceptions -ffunction-sections \
-fomit-frame-pointer -fgcse-sm -fgcse-las -fgcse-after-reload \
-fweb -fpeel-loops
else ifeq ($(platform), osx)
TARGET := libretro.dylib
fpic := -fPIC
......@@ -87,7 +91,7 @@ $(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm
endif
%.o: %.c
......
......@@ -32,6 +32,14 @@ SOURCES += $(CORE_DIR)/snapshot.c
SOURCES += $(CORE_DIR)/soundux.c
SOURCES += $(CORE_DIR)/spc700.c
SOURCES += $(CORE_DIR)/srtc.c
SOURCES += $(CORE_DIR)/rops.c
SOURCES += $(LIBRETRO_DIR)/libretro.c
SOURCES += $(LIBRETRO_DIR)/memstream.c
ifeq ($(ARM_ASM), 1)
SOURCES += $(CORE_DIR)/spc700a.s
SOURCES += $(CORE_DIR)/spc_decode.S
SOURCES += $(CORE_DIR)/mode7new.c
SOURCES += $(CORE_DIR)/mode7.c
SOURCES += $(CORE_DIR)/mode7add.c
......@@ -44,13 +52,6 @@ SOURCES += $(CORE_DIR)/mode7add1_2prio.c
SOURCES += $(CORE_DIR)/mode7subprio.c
SOURCES += $(CORE_DIR)/mode7sub1_2prio.c
SOURCES += $(CORE_DIR)/gfx16.c
SOURCES += $(CORE_DIR)/rops.c
SOURCES += $(LIBRETRO_DIR)/libretro.c
SOURCES += $(LIBRETRO_DIR)/memstream.c
ifeq ($(ARM_ASM), 1)
SOURCES += $(CORE_DIR)/spc700a.s \
$(CORE_DIR)/spc_decode.S
SOURCES += $(CORE_DIR)/tile16.c
SOURCES += $(CORE_DIR)/tile16add.c
......@@ -59,9 +60,6 @@ SOURCES += $(CORE_DIR)/tile16fadd1_2.c
SOURCES += $(CORE_DIR)/tile16sub.c
SOURCES += $(CORE_DIR)/tile16sub1_2.c
SOURCES += $(CORE_DIR)/tile16fsub1_2.c
else
SOURCES += $(CORE_DIR)/tile_c.c
endif
SOURCES += $(CORE_DIR)/os9x_65c816_global.s
SOURCES += $(CORE_DIR)/os9x_65c816_spcasm.s
......@@ -71,6 +69,12 @@ SOURCES += $(CORE_DIR)/os9x_65c816_spcc.s
SOURCES += $(CORE_DIR)/os9x_asm_cpu.c
else
SOURCES += $(CORE_DIR)/gfx.c
SOURCES += $(CORE_DIR)/tile.c
endif
#DEFINES += -D__GP2X__
#DEFINES += -DASMCPU
#DEFINES += -DVAR_CYCLES
......@@ -91,6 +95,7 @@ DEFINES += -DHAVE_STRINGS_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -D__LIBRETRO__
#DEFINES += -DRIGHTSHIFT_IS_SAR
DEFINES += -DUSE_SA1
ifeq ($(ARM_ASM), 1)
DEFINES += -mstructure-size-boundary=32
DEFINES += -DARM_ASM
......
......@@ -28,7 +28,7 @@ LIBRETRO_DIR := ../libretro
include ../Makefile.common
LOCAL_SRC_FILES := $(SOURCES)
LOCAL_CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES)
LOCAL_CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) -std=c99
LOCAL_ASFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES)
include $(BUILD_SHARED_LIBRARY)
......@@ -107,8 +107,9 @@ STATIC inline void S9xAPUUnpackStatus()
{
IAPU._Zero = ((IAPU.P & Zero) == 0) | (IAPU.P & Negative);
#ifdef ASMCPU
if (!Settings.asmspc700)
#endif
{
IAPU._Carry = (IAPU.P & Carry);
IAPU._Overflow = (IAPU.P & Overflow);
......@@ -117,6 +118,7 @@ STATIC inline void S9xAPUUnpackStatus()
STATIC inline void S9xAPUPackStatus()
{
#ifdef ASMCPU
if (Settings.asmspc700)
{
IAPU.P &= ~(Zero | Negative);
......@@ -125,6 +127,7 @@ STATIC inline void S9xAPUPackStatus()
}
else
#endif
{
IAPU.P &= ~(Zero | Negative | Carry | Overflow);
if (IAPU._Carry) IAPU.P |= Carry;
......
......@@ -204,10 +204,10 @@
); _dst; \
})
#else
#define memset32(_dst, _c, _count) memset(_dst, _c, _count)
#define memset16(_dst, _c, _count) memset(_dst, _c, _count)
#define memcpy32(_dst, _src, _count) memcpy(_dst, _src, _count)
#define memcpy16(_dst, _src, _count) memcpy(_dst, _src, _count)
#define memset32(_dst, _c, _count) memset(_dst, _c, (_count)<<2)
#define memset16(_dst, _c, _count) memset(_dst, _c, (_count)<<1)
#define memcpy32(_dst, _src, _count) memcpy(_dst, _src, (_count)<<2)
#define memcpy16(_dst, _src, _count) memcpy(_dst, _src, (_count)<<1)
#endif
#endif
......@@ -332,7 +332,8 @@ S9xMainLoop(void)
if (Settings.APUEnabled == 1)
{
#ifdef USE_SA1
if (Settings.SA1) S9xMainLoop_SA1_APU();
if (Settings.SA1)
S9xMainLoop_SA1_APU();
else
#endif
S9xMainLoop_NoSA1_APU();
......@@ -340,10 +341,11 @@ S9xMainLoop(void)
else
{
#ifdef USE_SA1
if (Settings.SA1) S9xMainLoop_SA1_NoAPU();
else S9xMainLoop_NoSA1_NoAPU();
if (Settings.SA1)
S9xMainLoop_SA1_NoAPU();
else
#endif
S9xMainLoop_NoSA1_NoAPU();
}
#else
if (Settings.asmspc700) asmMainLoop_spcAsm(&CPU);
......
......@@ -190,7 +190,7 @@ extern "C" {
void asm_APU_EXECUTE(int Mode);
void asm_APU_EXECUTE2(void);
}*/
#ifdef ASMCPU
#define asm_APU_EXECUTE(MODE)\
{\
if (CPU.APU_APUExecuting == MODE) {\
......@@ -231,6 +231,24 @@ void asm_APU_EXECUTE2(void);
}\
}\
}
#else
#define asm_APU_EXECUTE(MODE)\
do { if (CPU.APU_APUExecuting == MODE) \
while (CPU.APU_Cycles <= CPU.Cycles)\
{\
CPU.APU_Cycles += S9xAPUCycles [*IAPU.PC];\
(*S9xApuOpcodes[*IAPU.PC]) ();\
}}while(0)
#define asm_APU_EXECUTE2() \
if (CPU.APU_APUExecuting == 1) do\
{\
CPU.APU_Cycles += S9xAPUCycles [*IAPU.PC];\
(*S9xApuOpcodes[*IAPU.PC]) ();\
} while (CPU.APU_Cycles < CPU.NextEvent)
#endif
#endif
......@@ -395,8 +395,9 @@ typedef struct
bool8 DaffyDuck;
uint8 APURAMInitialValue;
bool8 SDD1Pack;
#ifdef ASMCPU
bool8 asmspc700;
#endif
bool8 SpeedHacks;
#ifdef __WIN32__
int SoundDriver;
......
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