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 ...@@ -15,9 +15,13 @@ endif
endif endif
ifeq ($(platform), unix) ifeq ($(platform), unix)
TARGET := libretro.so TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC 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) else ifeq ($(platform), osx)
TARGET := libretro.dylib TARGET := libretro.dylib
fpic := -fPIC fpic := -fPIC
...@@ -87,7 +91,7 @@ $(TARGET): $(OBJECTS) ...@@ -87,7 +91,7 @@ $(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1) ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS) $(AR) rcs $@ $(OBJECTS)
else else
$(CXX) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm $(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm
endif endif
%.o: %.c %.o: %.c
......
...@@ -32,6 +32,14 @@ SOURCES += $(CORE_DIR)/snapshot.c ...@@ -32,6 +32,14 @@ SOURCES += $(CORE_DIR)/snapshot.c
SOURCES += $(CORE_DIR)/soundux.c SOURCES += $(CORE_DIR)/soundux.c
SOURCES += $(CORE_DIR)/spc700.c SOURCES += $(CORE_DIR)/spc700.c
SOURCES += $(CORE_DIR)/srtc.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)/mode7new.c
SOURCES += $(CORE_DIR)/mode7.c SOURCES += $(CORE_DIR)/mode7.c
SOURCES += $(CORE_DIR)/mode7add.c SOURCES += $(CORE_DIR)/mode7add.c
...@@ -44,13 +52,6 @@ SOURCES += $(CORE_DIR)/mode7add1_2prio.c ...@@ -44,13 +52,6 @@ SOURCES += $(CORE_DIR)/mode7add1_2prio.c
SOURCES += $(CORE_DIR)/mode7subprio.c SOURCES += $(CORE_DIR)/mode7subprio.c
SOURCES += $(CORE_DIR)/mode7sub1_2prio.c SOURCES += $(CORE_DIR)/mode7sub1_2prio.c
SOURCES += $(CORE_DIR)/gfx16.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)/tile16.c
SOURCES += $(CORE_DIR)/tile16add.c SOURCES += $(CORE_DIR)/tile16add.c
...@@ -59,9 +60,6 @@ SOURCES += $(CORE_DIR)/tile16fadd1_2.c ...@@ -59,9 +60,6 @@ SOURCES += $(CORE_DIR)/tile16fadd1_2.c
SOURCES += $(CORE_DIR)/tile16sub.c SOURCES += $(CORE_DIR)/tile16sub.c
SOURCES += $(CORE_DIR)/tile16sub1_2.c SOURCES += $(CORE_DIR)/tile16sub1_2.c
SOURCES += $(CORE_DIR)/tile16fsub1_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_global.s
SOURCES += $(CORE_DIR)/os9x_65c816_spcasm.s SOURCES += $(CORE_DIR)/os9x_65c816_spcasm.s
...@@ -71,6 +69,12 @@ SOURCES += $(CORE_DIR)/os9x_65c816_spcc.s ...@@ -71,6 +69,12 @@ SOURCES += $(CORE_DIR)/os9x_65c816_spcc.s
SOURCES += $(CORE_DIR)/os9x_asm_cpu.c SOURCES += $(CORE_DIR)/os9x_asm_cpu.c
else
SOURCES += $(CORE_DIR)/gfx.c
SOURCES += $(CORE_DIR)/tile.c
endif
#DEFINES += -D__GP2X__ #DEFINES += -D__GP2X__
#DEFINES += -DASMCPU #DEFINES += -DASMCPU
#DEFINES += -DVAR_CYCLES #DEFINES += -DVAR_CYCLES
...@@ -91,6 +95,7 @@ DEFINES += -DHAVE_STRINGS_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -D__LIBRETRO__ ...@@ -91,6 +95,7 @@ DEFINES += -DHAVE_STRINGS_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -D__LIBRETRO__
#DEFINES += -DRIGHTSHIFT_IS_SAR #DEFINES += -DRIGHTSHIFT_IS_SAR
DEFINES += -DUSE_SA1 DEFINES += -DUSE_SA1
ifeq ($(ARM_ASM), 1) ifeq ($(ARM_ASM), 1)
DEFINES += -mstructure-size-boundary=32 DEFINES += -mstructure-size-boundary=32
DEFINES += -DARM_ASM DEFINES += -DARM_ASM
......
...@@ -28,7 +28,7 @@ LIBRETRO_DIR := ../libretro ...@@ -28,7 +28,7 @@ LIBRETRO_DIR := ../libretro
include ../Makefile.common include ../Makefile.common
LOCAL_SRC_FILES := $(SOURCES) LOCAL_SRC_FILES := $(SOURCES)
LOCAL_CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) LOCAL_CFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) -std=c99
LOCAL_ASFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES) LOCAL_ASFLAGS += $(DEFINES) $(COMMON_DEFINES) $(INCLUDES)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
...@@ -107,8 +107,9 @@ STATIC inline void S9xAPUUnpackStatus() ...@@ -107,8 +107,9 @@ STATIC inline void S9xAPUUnpackStatus()
{ {
IAPU._Zero = ((IAPU.P & Zero) == 0) | (IAPU.P & Negative); IAPU._Zero = ((IAPU.P & Zero) == 0) | (IAPU.P & Negative);
#ifdef ASMCPU
if (!Settings.asmspc700) if (!Settings.asmspc700)
#endif
{ {
IAPU._Carry = (IAPU.P & Carry); IAPU._Carry = (IAPU.P & Carry);
IAPU._Overflow = (IAPU.P & Overflow); IAPU._Overflow = (IAPU.P & Overflow);
...@@ -117,6 +118,7 @@ STATIC inline void S9xAPUUnpackStatus() ...@@ -117,6 +118,7 @@ STATIC inline void S9xAPUUnpackStatus()
STATIC inline void S9xAPUPackStatus() STATIC inline void S9xAPUPackStatus()
{ {
#ifdef ASMCPU
if (Settings.asmspc700) if (Settings.asmspc700)
{ {
IAPU.P &= ~(Zero | Negative); IAPU.P &= ~(Zero | Negative);
...@@ -125,6 +127,7 @@ STATIC inline void S9xAPUPackStatus() ...@@ -125,6 +127,7 @@ STATIC inline void S9xAPUPackStatus()
} }
else else
#endif
{ {
IAPU.P &= ~(Zero | Negative | Carry | Overflow); IAPU.P &= ~(Zero | Negative | Carry | Overflow);
if (IAPU._Carry) IAPU.P |= Carry; if (IAPU._Carry) IAPU.P |= Carry;
......
...@@ -204,10 +204,10 @@ ...@@ -204,10 +204,10 @@
); _dst; \ ); _dst; \
}) })
#else #else
#define memset32(_dst, _c, _count) memset(_dst, _c, _count) #define memset32(_dst, _c, _count) memset(_dst, _c, (_count)<<2)
#define memset16(_dst, _c, _count) memset(_dst, _c, _count) #define memset16(_dst, _c, _count) memset(_dst, _c, (_count)<<1)
#define memcpy32(_dst, _src, _count) memcpy(_dst, _src, _count) #define memcpy32(_dst, _src, _count) memcpy(_dst, _src, (_count)<<2)
#define memcpy16(_dst, _src, _count) memcpy(_dst, _src, _count) #define memcpy16(_dst, _src, _count) memcpy(_dst, _src, (_count)<<1)
#endif #endif
#endif #endif
...@@ -332,7 +332,8 @@ S9xMainLoop(void) ...@@ -332,7 +332,8 @@ S9xMainLoop(void)
if (Settings.APUEnabled == 1) if (Settings.APUEnabled == 1)
{ {
#ifdef USE_SA1 #ifdef USE_SA1
if (Settings.SA1) S9xMainLoop_SA1_APU(); if (Settings.SA1)
S9xMainLoop_SA1_APU();
else else
#endif #endif
S9xMainLoop_NoSA1_APU(); S9xMainLoop_NoSA1_APU();
...@@ -340,10 +341,11 @@ S9xMainLoop(void) ...@@ -340,10 +341,11 @@ S9xMainLoop(void)
else else
{ {
#ifdef USE_SA1 #ifdef USE_SA1
if (Settings.SA1) S9xMainLoop_SA1_NoAPU(); if (Settings.SA1)
else S9xMainLoop_NoSA1_NoAPU(); S9xMainLoop_SA1_NoAPU();
else
#endif #endif
S9xMainLoop_NoSA1_NoAPU();
} }
#else #else
if (Settings.asmspc700) asmMainLoop_spcAsm(&CPU); if (Settings.asmspc700) asmMainLoop_spcAsm(&CPU);
......
...@@ -190,7 +190,7 @@ extern "C" { ...@@ -190,7 +190,7 @@ extern "C" {
void asm_APU_EXECUTE(int Mode); void asm_APU_EXECUTE(int Mode);
void asm_APU_EXECUTE2(void); void asm_APU_EXECUTE2(void);
}*/ }*/
#ifdef ASMCPU
#define asm_APU_EXECUTE(MODE)\ #define asm_APU_EXECUTE(MODE)\
{\ {\
if (CPU.APU_APUExecuting == MODE) {\ if (CPU.APU_APUExecuting == MODE) {\
...@@ -231,6 +231,24 @@ void asm_APU_EXECUTE2(void); ...@@ -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 #endif
...@@ -395,8 +395,9 @@ typedef struct ...@@ -395,8 +395,9 @@ typedef struct
bool8 DaffyDuck; bool8 DaffyDuck;
uint8 APURAMInitialValue; uint8 APURAMInitialValue;
bool8 SDD1Pack; bool8 SDD1Pack;
#ifdef ASMCPU
bool8 asmspc700; bool8 asmspc700;
#endif
bool8 SpeedHacks; bool8 SpeedHacks;
#ifdef __WIN32__ #ifdef __WIN32__
int SoundDriver; 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