summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libretro.c1
-rw-r--r--main.h1
-rw-r--r--video.c1
-rw-r--r--x86/Makefile38
4 files changed, 25 insertions, 16 deletions
diff --git a/libretro.c b/libretro.c
index 381a471..abe130d 100644
--- a/libretro.c
+++ b/libretro.c
@@ -43,6 +43,7 @@ static inline void switch_to_cpu_thread(void)
static void cpu_thread_entry(void)
{
execute_arm_translate(execute_cycles);
+ execute_arm(execute_cycles);
}
static inline void init_context_switch(void)
diff --git a/main.h b/main.h
index ab57067..2a81cec 100644
--- a/main.h
+++ b/main.h
@@ -92,6 +92,7 @@ u32 update_gba();
void reset_gba();
#ifdef __LIBRETRO__
#define synchronize()
+void init_main();
#else
void synchronize();
#endif
diff --git a/video.c b/video.c
index 96ef006..14018b3 100644
--- a/video.c
+++ b/video.c
@@ -101,7 +101,6 @@ const u32 video_scale = 1;
#define get_screen_pitch() \
(screen->pitch / 2) \
-#endif
#endif
diff --git a/x86/Makefile b/x86/Makefile
index 319a4a7..53d2dd8 100644
--- a/x86/Makefile
+++ b/x86/Makefile
@@ -8,8 +8,8 @@ STRIP = strip
AS = as
PREFIX = /usr
-OBJS = main.o cpu.o memory.o video.o input.o sound.o \
- cpu_threaded.o gui.o x86_stub.o cheats.o zip.o
+OBJS = ../main.o ../cpu.o ../memory.o ../video.o ../input.o ../sound.o \
+ ../cpu_threaded.o ../gui.o x86_stub.o ../cheats.o ../zip.o
# Platform specific definitions
@@ -23,30 +23,38 @@ endif
BIN ?= gpsp$(EXE_EXT)
-VPATH += ..
CFLAGS += -DPC_BUILD -Wall -m32
-INCLUDES = -I${PREFIX}/include `sdl-config --cflags`
-LIBS = -L${PREFIX}/lib32 `sdl-config --libs` -lz -m32
+INCLUDES = -I$(PREFIX)/include `sdl-config --cflags`
+LIBS = -L$(PREFIX)/lib32 `sdl-config --libs` -lz -m32
# Compilation:
+ifeq ($(DEBUG), 1)
+OPTIMIZE := -O0 -g
+OPTIMIZE_SAFE := -O0 -g
+else
+OPTIMIZE := -O3
+OPTIMIZE_SAFE := -O2
+endif
-.SUFFIXES: .c .S
-
-all: ${BIN}
+all: $(BIN)
%.o: %.c
- ${CC} ${CFLAGS} ${INCLUDES} -c -o $@ $<
+ $(CC) $(CFLAGS) $(OPTIMIZE) $(INCLUDES) -c -o $@ $<
%.o: %.S
- ${CC} ${CFLAGS} -c -o $@ $<
+ $(CC) $(CFLAGS) $(OPTIMIZE) -c -o $@ $<
+
+../cpu.o: ../cpu.c
+ $(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCLUDES)
+
+../cpu_threaded.o: ../cpu_threaded.c
+ $(CC) -c -o $@ $< $(CFLAGS) -Wno-unused-variable -Wno-unused-label $(OPTIMIZE_SAFE) $(INCLUDES)
-cpu.o cpu_threaded.o: CFLAGS += -Wno-unused-variable -Wno-unused-label
-${BIN}: ${OBJS}
- ${CC} ${OBJS} ${LIBS} -o ${BIN}
-# ${STRIP} ${BIN}
+$(BIN): $(OBJS)
+ $(CC) $(OBJS) $(LIBS) -o $(BIN)
clean:
- rm -f *.o ${BIN}
+ rm -f $(OBJS) $(BIN)