summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2015-11-08 02:44:54 +0100
committertwinaphex2015-11-08 02:44:54 +0100
commitee44145406cbe2c1a77772c02683ed3f578c737d (patch)
tree1ddae5dad067c9d1011f636314709aa4ffdb0f59
parent427472f8d3a4735a9f533b283df884f37731776a (diff)
downloadsnes9x2002-ee44145406cbe2c1a77772c02683ed3f578c737d.tar.gz
snes9x2002-ee44145406cbe2c1a77772c02683ed3f578c737d.tar.bz2
snes9x2002-ee44145406cbe2c1a77772c02683ed3f578c737d.zip
Start adding counterparts to ARM ASM codepaths
-rw-r--r--Makefile7
-rw-r--r--Makefile.common6
-rw-r--r--src/asmmemfuncs.h7
3 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5dd866a..f65cd92 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,8 @@ else ifeq ($(platform), ctr)
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT)
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
- CFLAGS += -DARM11 -D_3DS
+ ARM_ASM = 1
+ CFLAGS += -DARM11 -D_3DS
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard
CFLAGS += -Wall -mword-relocations
CFLAGS += -fomit-frame-pointer -ffast-math
@@ -68,6 +69,10 @@ else
CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
endif
+ifeq ($(ARM_ASM), 1)
+CFLAGS += -DARM_ASM
+endif
+
CORE_DIR := ./src
LIBRETRO_DIR := ./libretro
diff --git a/Makefile.common b/Makefile.common
index 16b27bb..c285ba9 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -31,9 +31,7 @@ SOURCES += $(CORE_DIR)/sdd1emu.cpp
SOURCES += $(CORE_DIR)/snapshot.cpp
SOURCES += $(CORE_DIR)/soundux.cpp
SOURCES += $(CORE_DIR)/spc700.cpp
-SOURCES += $(CORE_DIR)/spc700a.s
SOURCES += $(CORE_DIR)/srtc.cpp
-SOURCES += $(CORE_DIR)/spc_decode.S
SOURCES += $(CORE_DIR)/tile16.cpp
SOURCES += $(CORE_DIR)/tile16add.cpp
SOURCES += $(CORE_DIR)/tile16add1_2.cpp
@@ -57,6 +55,10 @@ SOURCES += $(CORE_DIR)/rops.cpp
SOURCES += $(LIBRETRO_DIR)/libretro.cpp
SOURCES += $(LIBRETRO_DIR)/memstream.c
+ifeq ($(ARM_ASM), 1)
+SOURCES += $(CORE_DIR)/spc700a.s \
+ $(CORE_DIR)/spc_decode.S
+endif
SOURCES += $(CORE_DIR)/os9x_65c816_global.s
SOURCES += $(CORE_DIR)/os9x_65c816_spcasm.s
diff --git a/src/asmmemfuncs.h b/src/asmmemfuncs.h
index f9ff745..0f4e514 100644
--- a/src/asmmemfuncs.h
+++ b/src/asmmemfuncs.h
@@ -1,6 +1,7 @@
#ifndef _ASMMEMFUNCS_H_
#define _ASMMEMFUNCS_H_
+#ifdef ARM_ASM
#define memset32(_dst, _c, _count) \
({ uint32_t *dst = (_dst); register uint32_t c asm ("r7") = (_c); int count = (_count); register uint32_t dummy0 asm ("r4"), dummy1 asm ("r5"), dummy2 asm ("r6"); \
__asm__ __volatile__ ( \
@@ -202,5 +203,11 @@
: "r4", "r5", "r6", "r7", "cc", "memory" \
); _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)
+#endif
#endif