Commit 50b28fbb authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Updates

parent 72e15f24
#include "libretro/libretro.h"
#include "libretro/reicast.h"
#include "types.h"
#include <cstdio>
#include <cstdarg>
#include "types.h"
#include <libco.h>
#include "libretro.h"
uint32_t video_width = 640;
uint32_t video_height = 480;
......@@ -16,6 +18,44 @@ retro_input_state_t input_cb = NULL;
retro_audio_sample_batch_t audio_batch_cb = NULL;
retro_environment_t environ_cb = NULL;
void common_linux_setup();
int dc_init(int argc,wchar* argv[]);
void dc_run();
static cothread_t ct_main;
static cothread_t ct_dc;
static int co_argc;
static wchar** co_argv;
static void co_dc_thread(void)
{
dc_init(co_argc,co_argv);
co_switch(ct_main);
dc_run();
}
static void co_dc_init(int argc,wchar* argv[])
{
ct_main = co_active();
ct_dc = co_create(1024*1024/*why does libco demand me to know this*/, co_dc_thread);
co_argc=argc;
co_argv=argv;
co_switch(ct_dc);
}
void co_dc_run(void)
{
puts("ENTER LOOP");
co_switch(ct_dc);
}
void co_dc_yield(void)
{
co_switch(ct_main);
}
void retro_set_video_refresh(retro_video_refresh_t cb)
{
video_cb = cb;
......@@ -245,3 +285,12 @@ int msgboxf(const char* text, unsigned int type, ...)
}
return 0;
}
int get_mic_data(u8* buffer) { return 0; }
int push_vmu_screen(u8* buffer) { return 0; }
void os_DebugBreak(void)
{
printf("DEBUGBREAK!\n");
exit(-1);
}
This diff is collapsed.
CXX = ${CC_PREFIX}g++
CC = ${CC_PREFIX}gcc
CC_AS ?= $(CC)
STRIP = ${CC_PREFIX}strip
LD = ${CC}
MFLAGS :=
ASFLAGS :=
LDFLAGS :=
INCFLAGS :=
LIBS :=
CFLAGS :=
CXXFLAGS :=
# Platform auto-detection
# Can be overridden by using:
# make platform=x64
ifeq (,$(platform))
ARCH = $(shell uname -m)
ifeq ($(ARCH), $(filter $(ARCH), i386 i686))
platform = x86
else ifeq ($(ARCH), $(filter $(ARCH), x86_64 AMD64))
platform = x64
else ifneq (,$(findstring arm,$(ARCH)))
HARDWARE = $(shell grep Hardware /proc/cpuinfo)
ifneq (,$(findstring BCM2709,$(HARDWARE)))
platform = rpi2
else ifneq (,$(findstring AM33XX,$(HARDWARE)))
platform = beagle
else ifneq (,$(findstring Pandora,$(HARDWARE)))
platform = pandora
else ifneq (,$(findstring ODROIDC,$(HARDWARE)))
platform = odroidc1
else ifneq (,$(findstring ODROID-XU3,$(HARDWARE)))
platform = odroidxu3
else ifneq (,$(findstring ODROIDXU,$(HARDWARE)))
platform = odroidxu
else ifneq (,$(findstring ODROIDX2,$(HARDWARE)))
platform = odroidx2
else ifneq (,$(findstring ODROIDX,$(HARDWARE)))
platform = odroidx
else ifneq (,$(findstring ODROID-U2/U3,$(HARDWARE)))
platform = odroidu2
else ifneq (,$(findstring ODROIDU2,$(HARDWARE)))
platform = odroidu2
else
platform = armv7h
endif
else
$(error Unsupported CPU architecture)
endif
endif
$(info Platform: $(platform))
# Generic 32 bit x86 (a.k.a. i386/i486/i686)
ifneq (,$(findstring x86,$(platform)))
WITH_DYNAREC := x86
USE_X11 := 1
MFLAGS += -m32
ASFLAGS += --32
LDFLAGS += -m32
CFLAGS += -m32 -D TARGET_LINUX_x86 -D TARGET_NO_AREC -fsingle-precision-constant
CXXFLAGS += -fno-exceptions
# Generic 64 bit x86 (a.k.a. x64/AMD64/x86_64/Intel64/EM64T)
else ifneq (,$(findstring x64,$(platform)))
WITH_DYNAREC := x64
USE_X11 := 1
CFLAGS += -D TARGET_LINUX_x64 -D TARGET_NO_AREC -fsingle-precision-constant
CXXFLAGS += -fexceptions
# Generic 32 bit ARMhf (a.k.a. ARMv7h)
else ifneq (,$(findstring armv7h,$(platform)))
WITH_DYNAREC := arm
MFLAGS += -marm -mfloat-abi=hard -march=armv7-a -funroll-loops
ASFLAGS += -mfloat-abi=hard -march=armv7-a
ifneq (,$(findstring neon,$(platform)))
MFLAGS += -mfpu=neon
ASFLAGS += -mfpu=neon
endif
CFLAGS += -D TARGET_BEAGLE -D TARGET_LINUX_ARMELv7 -DARM_HARDFP -fsingle-precision-constant
USE_GLES := 1
# Raspberry Pi 2
else ifneq (,$(findstring rpi2,$(platform)))
WITH_DYNAREC := arm
MFLAGS += -marm -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -funroll-loops
ASFLAGS += -march=armv7-a -mfpu=neon -mfloat-abi=softfp
CFLAGS += -D TARGET_BEAGLE -D TARGET_LINUX_ARMELv7 -DARM_HARDFP -fsingle-precision-constant
INCFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -I../linux-deps/include
LIBS += -L/opt/vc/lib/ -L../linux-deps/lib -lbcm_host
USE_GLES := 1
# BeagleBone Black
else ifneq (,$(findstring beagle,$(platform)))
WITH_DYNAREC := arm
CC_PREFIX ?= arm-none-linux-gnueabi-
MFLAGS += -marm -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp -funroll-loops
ASFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=softfp
CFLAGS += -D TARGET_BEAGLE -fsingle-precision-constant
USE_GLES := 1
# ODROIDs
else ifneq (,$(findstring odroid,$(platform)))
WITH_DYNAREC := arm
MFLAGS += -marm -mfpu=neon -mfloat-abi=hard -funroll-loops
ASFLAGS += -mfpu=neon -mfloat-abi=hard
CFLAGS += -D TARGET_BEAGLE -D TARGET_LINUX_ARMELv7 -DARM_HARDFP -fsingle-precision-constant
USE_GLES := 1
# ODROID-XU3, -XU3 Lite & -XU4
ifneq (,$(findstring odroidxu3,$(platform)))
MFLAGS += -march=armv7ve -mtune=cortex-a15.cortex-a7
ASFLAGS += -march=armv7ve
# Other ODROIDs
else
MFLAGS += -march=armv7-a
ASFLAGS += -march=armv7-a
# ODROID-C1 & -C1+
ifneq (,$(findstring odroidc1,$(platform)))
MFLAGS += -mtune=cortex-a5
# ODROID-U2, -U3, -X & -X2
else
MFLAGS += -mtune=cortex-a9
endif
endif
else
$(error Unknown platform)
endif
CORE_DIR := ../../core
DYNAREC_USED = 0
include Makefile.common
RZDCY_CFLAGS := $(CFLAGS) -c -O3 -DRELEASE -frename-registers -fsingle-precision-constant -ffast-math -ftree-vectorize -fomit-frame-pointer -D__LIBRETRO__
ifeq ($(WITH_DYNAREC), arm)
RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16
RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7
else
RZDCY_CFLAGS += -DTARGET_LINUX_x86
endif
ifdef NO_REC
RZDCY_CFLAGS += -DTARGET_NO_REC
endif
ifdef USE_GLES
RZDCY_CFLAGS += -DGLES
endif
RZDCY_CXXFLAGS := $(RZDCY_CFLAGS) -fno-exceptions -fno-rtti -std=gnu++11
LDFLAGS += -g -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common
CFLAGS += -g -O3 -D RELEASE -c
CFLAGS += -frename-registers -fno-strict-aliasing -ffast-math -ftree-vectorize
CXXFLAGS += -fno-rtti -fpermissive -fno-operator-names
LIBS += -lm -lrt -lpthread
PREFIX ?= /usr/local
ifeq ($(WITH_DYNAREC), arm)
else
AS=${CC_PREFIX}gcc
ASFLAGS += $(CFLAGS)
endif
ifdef PGO_MAKE
CFLAGS += -fprofile-generate -pg
LDFLAGS += -fprofile-generate
else
CFLAGS += -fomit-frame-pointer
endif
ifdef PGO_USE
CFLAGS += -fprofile-use
endif
ifdef LTO_TEST
CFLAGS += -flto -fwhole-program
LDFLAGS +=-flto -fwhole-program
endif
# GLES on x11?
ifdef USE_GLES
CXXFLAGS += -DGLES
CFLAGS += -DGLES
GL_LIB += -lEGL -lGLESv2
else
GL_LIB += -ldl -lGL #for desktop gl
endif
ifdef NAOMI
CFLAGS += -D TARGET_NAOMI
DC_PLATFORM=naomi
TARGET=reicast_naomi.elf
TARGET_NAME=reicast-naomi
else
DC_PLATFORM=dreamcast
TARGET=reicast.elf
TARGET_NAME=reicast
endif
OBJECTS := $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o) $(SOURCES_ASM:.S=.o)
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CXX) $(MFLAGS) $(EXTRAFLAGS) $(LDFLAGS) $(GL_LIB) $(OBJECTS) $(LIBS) -o $@
%.o: %.cpp
$(CXX) $(EXTRAFLAGS) $(INCFLAGS) $(CFLAGS) $(MFLAGS) $(CXXFLAGS) $< -o $@
%.o: %.c
$(CC) $(EXTRAFLAGS) $(INCFLAGS) $(CFLAGS) $< -o $@
%.o: %.S
$(CC_AS) $(ASFLAGS) $(INCFLAGS) $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) .map
INCFLAGS += -I$(CORE_DIR) \
-I$(CORE_DIR)/deps \
-I$(CORE_DIR)/khronos \
-I$(CORE_DIR)/libretro-common/include
SOURCES_CXX := $(CORE_DIR)/cfg/cfg.cpp \
$(CORE_DIR)/cfg/ini.cpp \
$(CORE_DIR)/cfg/cl.cpp \
\
$(CORE_DIR)/hw/arm7/arm_mem.cpp \
$(CORE_DIR)/hw/arm7/virt_arm.cpp \
$(CORE_DIR)/hw/arm7/arm7.cpp \
$(CORE_DIR)/hw/arm7/vbaARM.cpp \
\
$(CORE_DIR)/hw/aica/aica_mem.cpp \
$(CORE_DIR)/hw/aica/dsp.cpp \
$(CORE_DIR)/hw/aica/aica.cpp \
$(CORE_DIR)/hw/aica/sgc_if.cpp \
$(CORE_DIR)/hw/aica/aica_if.cpp \
\
$(CORE_DIR)/hw/holly/sb.cpp \
$(CORE_DIR)/hw/holly/sb_dma.cpp \
$(CORE_DIR)/hw/holly/holly_intc.cpp \
$(CORE_DIR)/hw/holly/sb_mem.cpp \
\
$(CORE_DIR)/hw/gdrom/gdrom_response.cpp \
$(CORE_DIR)/hw/gdrom/gdromv3.cpp \
\
$(CORE_DIR)/hw/maple/maple_helper.cpp \
$(CORE_DIR)/hw/maple/maple_devs.cpp \
$(CORE_DIR)/hw/maple/maple_if.cpp \
$(CORE_DIR)/hw/maple/maple_cfg.cpp \
\
$(CORE_DIR)/hw/mem/_vmem.cpp \
\
$(CORE_DIR)/hw/pvr/pvr_regs.cpp \
$(CORE_DIR)/hw/pvr/Renderer_if.cpp \
$(CORE_DIR)/hw/pvr/ta_ctx.cpp \
$(CORE_DIR)/hw/pvr/ta_vtx.cpp \
$(CORE_DIR)/hw/pvr/pvr_sb_regs.cpp \
$(CORE_DIR)/hw/pvr/pvr_mem.cpp \
$(CORE_DIR)/hw/pvr/spg.cpp \
$(CORE_DIR)/hw/pvr/ta.cpp \
$(CORE_DIR)/hw/pvr/drkPvr.cpp \
\
$(CORE_DIR)/hw/sh4/sh4_mmr.cpp \
$(CORE_DIR)/hw/sh4/sh4_mem.cpp \
$(CORE_DIR)/hw/sh4/sh4_interrupts.cpp \
$(CORE_DIR)/hw/sh4/sh4_rom.cpp \
$(CORE_DIR)/hw/sh4/sh4_core_regs.cpp \
$(CORE_DIR)/hw/sh4/sh4_sched.cpp \
$(CORE_DIR)/hw/sh4/sh4_opcode_list.cpp \
$(CORE_DIR)/hw/sh4/interpr/sh4_interpreter.cpp \
$(CORE_DIR)/hw/sh4/interpr/sh4_fpu.cpp \
$(CORE_DIR)/hw/sh4/interpr/sh4_opcodes.cpp \
$(CORE_DIR)/hw/sh4/modules/serial.cpp \
$(CORE_DIR)/hw/sh4/modules/rtc.cpp \
$(CORE_DIR)/hw/sh4/modules/bsc.cpp \
$(CORE_DIR)/hw/sh4/modules/tmu.cpp \
$(CORE_DIR)/hw/sh4/modules/ccn.cpp \
$(CORE_DIR)/hw/sh4/modules/intc.cpp \
$(CORE_DIR)/hw/sh4/modules/ubc.cpp \
$(CORE_DIR)/hw/sh4/modules/cpg.cpp \
$(CORE_DIR)/hw/sh4/modules/dmac.cpp \
$(CORE_DIR)/hw/sh4/modules/mmu.cpp \
\
$(CORE_DIR)/profiler/profiler.cpp \
\
$(CORE_DIR)/oslib/audiostream.cpp \
\
$(CORE_DIR)/imgread/ImgReader.cpp \
$(CORE_DIR)/imgread/cdi.cpp \
$(CORE_DIR)/imgread/ioctl.cpp \
$(CORE_DIR)/imgread/chd.cpp \
$(CORE_DIR)/imgread/common.cpp \
$(CORE_DIR)/imgread/gdi.cpp \
\
$(CORE_DIR)/nullDC.cpp \
$(CORE_DIR)/stdclass.cpp \
\
$(CORE_DIR)/deps/coreio/coreio.cpp \
$(CORE_DIR)/deps/chdr/chdr.cpp \
$(CORE_DIR)/deps/crypto/sha1.cpp \
$(CORE_DIR)/deps/crypto/sha256.cpp \
$(CORE_DIR)/deps/crypto/md5.cpp \
$(CORE_DIR)/deps/libelf/elf.cpp \
$(CORE_DIR)/deps/libelf/elf32.cpp \
$(CORE_DIR)/deps/libelf/elf64.cpp \
$(CORE_DIR)/deps/chdpsr/cdipsr.cpp \
\
$(CORE_DIR)/rend/TexCache.cpp \
\
$(CORE_DIR)/reios/reios_elf.cpp \
$(CORE_DIR)/reios/reios.cpp \
$(CORE_DIR)/reios/gdrom_hle.cpp \
$(CORE_DIR)/reios/descrambl.cpp \
\
$(CORE_DIR)/rend/gles/gldraw.cpp \
$(CORE_DIR)/rend/gles/gles.cpp \
$(CORE_DIR)/rend/gles/gltex.cpp
# Recompiler (x64)
ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), x86_64 x64))
DYNAREC_USED = 1
SOURCES_CXX += $(CORE_DIR)/rec-x64/rec_x64.cpp
endif
# Recompiler (ARM)
ifeq ($(WITH_DYNAREC), arm)
DYNAREC_USED = 1
SOURCES_CXX += $(CORE_DIR)/rec-ARM/rec-arm.cpp
SOURCES_ASM += $(CORE_DIR)/rec-ARM/ngen_arm.S
endif
# Recompiler (x86 32bit)
#
ifeq ($(WITH_DYNAREC), $(filter $(WITH_DYNAREC), i386 i686 x86))
DYNAREC_USED = 1
SOURCES_CXX += $(CORE_DIR)/rec-x86/rec_x86_asm.cpp \
$(CORE_DIR)/rec-x86/rec_x86_driver.cpp \
$(CORE_DIR)/rec-x86/rec_x86_il.cpp
SOURCES_ASM += $(CORE_DIR)/rec-x86/rec_lin86_asm.S
endif
ifeq ($(DYNAREC_USED),1)
# Dynarec
SOURCES_CXX += $(CORE_DIR)/hw/sh4/dyna/decoder.cpp \
$(CORE_DIR)/hw/sh4/dyna/driver.cpp \
$(CORE_DIR)/hw/sh4/dyna/blockmanager.cpp \
$(CORE_DIR)/hw/sh4/dyna/shil.cpp
endif
SOURCES_CXX += $(CORE_DIR)/libretro/libretro.cpp \
$(CORE_DIR)/linux/common.cpp \
$(CORE_DIR)/linux/context.cpp
SOURCES_C += $(CORE_DIR)/libretro-common/libco/libco.c \
$(CORE_DIR)/libretro-common/memmap/memalign.c \
$(CORE_DIR)/libretro-common/rthreads/rthreads.c
SOURCES_C += $(CORE_DIR)/deps/zlib/deflate.c \
$(CORE_DIR)/deps/zlib/gzlib.c \
$(CORE_DIR)/deps/zlib/uncompr.c \
$(CORE_DIR)/deps/zlib/zutil.c \
$(CORE_DIR)/deps/zlib/inffast.c \
$(CORE_DIR)/deps/zlib/gzread.c \
$(CORE_DIR)/deps/zlib/crc32.c \
$(CORE_DIR)/deps/zlib/gzwrite.c \
$(CORE_DIR)/deps/zlib/inflate.c \
$(CORE_DIR)/deps/zlib/infback.c \
$(CORE_DIR)/deps/zlib/inftrees.c \
$(CORE_DIR)/deps/zlib/trees.c \
$(CORE_DIR)/deps/zlib/gzclose.c \
$(CORE_DIR)/deps/zlib/compress.c \
$(CORE_DIR)/deps/zlib/adler32.c
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