From 4efaa4ab67ed4f998e32edc300a84eb7f3479ac2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 12 Mar 2014 12:25:38 +0100 Subject: [PATCH 01/19] (Android) Don't do -O3 - unsafe --- libretro/jni/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro/jni/Android.mk b/libretro/jni/Android.mk index 24da555..270c981 100644 --- a/libretro/jni/Android.mk +++ b/libretro/jni/Android.mk @@ -73,6 +73,6 @@ LOCAL_C_INCLUDES = $(LOCAL_PATH)/$(GENPLUS_SRC_DIR) \ $(LOCAL_PATH)/$(GENPLUS_SRC_DIR)/ntsc \ $(LOCAL_PATH)/$(LIBRETRO_DIR) -LOCAL_CFLAGS = -ffast-math -O3 -funroll-loops -DINLINE="static inline" -DUSE_16BPP_RENDERING -DLSB_FIRST -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DALIGN_LONG -DALIGN_WORD +LOCAL_CFLAGS = -ffast-math -O2 -funroll-loops -DINLINE="static inline" -DUSE_16BPP_RENDERING -DLSB_FIRST -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DALIGN_LONG -DALIGN_WORD include $(BUILD_SHARED_LIBRARY) From 6e32d98903ecfe1b5ed5d0d31d1982c5f9c2974f Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sat, 15 Mar 2014 14:15:18 +0100 Subject: [PATCH 02/19] (MSVC 2010) Update MSVC 2010 solution --- libretro/msvc/msvc-2010/msvc-2010.vcxproj | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libretro/msvc/msvc-2010/msvc-2010.vcxproj b/libretro/msvc/msvc-2010/msvc-2010.vcxproj index bb77921..92220ea 100644 --- a/libretro/msvc/msvc-2010/msvc-2010.vcxproj +++ b/libretro/msvc/msvc-2010/msvc-2010.vcxproj @@ -65,7 +65,7 @@ {29DF2EE7-2930-4BD3-8AC5-81A2534ACC99} Win32Proj msvc2010 - genesis-next-msvc-2010 + msvc-2010 @@ -89,14 +89,6 @@ - - true - libretro - - - false - libretro - From f4bf6aef18d05c58f0507b690c90e7dd1305d74a Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sat, 15 Mar 2014 19:24:41 +0100 Subject: [PATCH 03/19] (MSVC) Update solutions for libretro-super --- .../msvc-2003-xbox1/msvc-2003-xbox1.vcproj | 10 +- .../msvc/msvc-2010-360/msvc-2010-360.vcxproj | 12 +- libretro/msvc/msvc-2010.bat | 124 ++++++++++++++++++ libretro/msvc/msvc-2010/libretro.def | 2 +- libretro/msvc/msvc-2010/msvc-2010.vcxproj | 8 +- 5 files changed, 143 insertions(+), 13 deletions(-) create mode 100644 libretro/msvc/msvc-2010.bat diff --git a/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj b/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj index f8b8762..2a16177 100644 --- a/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj +++ b/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj @@ -36,7 +36,7 @@ Name="VCCustomBuildTool"/> + OutputFile="$(OutDir)/msvc-2003-xbox1.lib"/> + OutputFile="$(OutDir)/msvc-2003-xbox1.lib"/> + OutputFile="$(OutDir)/msvc-2003-xbox1.lib"/> + OutputFile="$(OutDir)/msvc-2003-xbox1.lib"/> + OutputFile="$(OutDir)/msvc-2003-xbox1.lib"/> - $(OutDir)genesis_plus_gx_libretro_xdk360$(TargetExt) + $(OutDir)msvc-2010-360$(TargetExt) - $(OutDir)genesis_plus_gx_libretro_xdk360$(TargetExt) + $(OutDir)msvc-2010-360$(TargetExt) - $(OutDir)genesis_plus_gx_libretro_xdk360$(TargetExt) + $(OutDir)msvc-2010-360$(TargetExt) - $(OutDir)genesis_plus_gx_libretro_xdk360$(TargetExt) + $(OutDir)msvc-2010-360$(TargetExt) - $(OutDir)genesis_plus_gx_libretro_xdk360$(TargetExt) + $(OutDir)msvc-2010-360$(TargetExt) - $(OutDir)genesis_plus_gx_libretro_xdk360$(TargetExt) + $(OutDir)msvc-2010-360$(TargetExt) diff --git a/libretro/msvc/msvc-2010.bat b/libretro/msvc/msvc-2010.bat new file mode 100644 index 0000000..a4b0822 --- /dev/null +++ b/libretro/msvc/msvc-2010.bat @@ -0,0 +1,124 @@ +@echo off + +@echo Setting environment for using Microsoft Visual Studio 2010 x86 tools. + +@call :GetVSCommonToolsDir +@if "%VS100COMNTOOLS%"=="" goto error_no_VS100COMNTOOLSDIR + +@call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit + +@if "%VSINSTALLDIR%"=="" goto error_no_VSINSTALLDIR +@if "%FrameworkDir32%"=="" goto error_no_FrameworkDIR32 +@if "%FrameworkVersion32%"=="" goto error_no_FrameworkVer32 +@if "%Framework35Version%"=="" goto error_no_Framework35Version + +@set FrameworkDir=%FrameworkDir32% +@set FrameworkVersion=%FrameworkVersion32% + +@if not "%WindowsSdkDir%" == "" ( + @set "PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools;%WindowsSdkDir%bin;%PATH%" + @set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%" + @set "LIB=%WindowsSdkDir%lib;%LIB%" +) + +@rem +@rem Root of Visual Studio IDE installed files. +@rem +@set DevEnvDir=%VSINSTALLDIR%Common7\IDE\ + +@rem PATH +@rem ---- +@if exist "%VSINSTALLDIR%Team Tools\Performance Tools" ( + @set "PATH=%VSINSTALLDIR%Team Tools\Performance Tools;%PATH%" +) +@if exist "%ProgramFiles%\HTML Help Workshop" set PATH=%ProgramFiles%\HTML Help Workshop;%PATH% +@if exist "%ProgramFiles(x86)%\HTML Help Workshop" set PATH=%ProgramFiles(x86)%\HTML Help Workshop;%PATH% +@if exist "%VCINSTALLDIR%VCPackages" set PATH=%VCINSTALLDIR%VCPackages;%PATH% +@set PATH=%FrameworkDir%%Framework35Version%;%PATH% +@set PATH=%FrameworkDir%%FrameworkVersion%;%PATH% +@set PATH=%VSINSTALLDIR%Common7\Tools;%PATH% +@if exist "%VCINSTALLDIR%BIN" set PATH=%VCINSTALLDIR%BIN;%PATH% +@set PATH=%DevEnvDir%;%PATH% + +@if exist "%VSINSTALLDIR%VSTSDB\Deploy" ( + @set "PATH=%VSINSTALLDIR%VSTSDB\Deploy;%PATH%" +) + +@if not "%FSHARPINSTALLDIR%" == "" ( + @set "PATH=%FSHARPINSTALLDIR%;%PATH%" +) + +@rem INCLUDE +@rem ------- +@if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE% +@if exist "%VCINSTALLDIR%INCLUDE" set INCLUDE=%VCINSTALLDIR%INCLUDE;%INCLUDE% + +@rem LIB +@rem --- +@if exist "%VCINSTALLDIR%ATLMFC\LIB" set LIB=%VCINSTALLDIR%ATLMFC\LIB;%LIB% +@if exist "%VCINSTALLDIR%LIB" set LIB=%VCINSTALLDIR%LIB;%LIB% + +@rem LIBPATH +@rem ------- +@if exist "%VCINSTALLDIR%ATLMFC\LIB" set LIBPATH=%VCINSTALLDIR%ATLMFC\LIB;%LIBPATH% +@if exist "%VCINSTALLDIR%LIB" set LIBPATH=%VCINSTALLDIR%LIB;%LIBPATH% +@set LIBPATH=%FrameworkDir%%Framework35Version%;%LIBPATH% +@set LIBPATH=%FrameworkDir%%FrameworkVersion%;%LIBPATH% + +@goto end + +@REM ----------------------------------------------------------------------- +:GetVSCommonToolsDir +@set VS100COMNTOOLS= +@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1 +@if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1 +@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1 +@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1 +@exit /B 0 + +:GetVSCommonToolsDirHelper32 +@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO ( + @if "%%i"=="10.0" ( + @SET "VS100COMNTOOLS=%%k" + ) +) +@if "%VS100COMNTOOLS%"=="" exit /B 1 +@SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\" +@exit /B 0 + +:GetVSCommonToolsDirHelper64 +@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO ( + @if "%%i"=="10.0" ( + @SET "VS100COMNTOOLS=%%k" + ) +) +@if "%VS100COMNTOOLS%"=="" exit /B 1 +@SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\" +@exit /B 0 + +@REM ----------------------------------------------------------------------- +:error_no_VS100COMNTOOLSDIR +@echo ERROR: Cannot determine the location of the VS Common Tools folder. +@goto end + +:error_no_VSINSTALLDIR +@echo ERROR: Cannot determine the location of the VS installation. +@goto end + +:error_no_FrameworkDIR32 +@echo ERROR: Cannot determine the location of the .NET Framework 32bit installation. +@goto end + +:error_no_FrameworkVer32 +@echo ERROR: Cannot determine the version of the .NET Framework 32bit installation. +@goto end + +:error_no_Framework35Version +@echo ERROR: Cannot determine the .NET Framework 3.5 version. +@goto end + +:end + +msbuild msvc-2010.sln /p:Configuration=Release /target:clean +msbuild msvc-2010.sln /p:Configuration=Release +exit diff --git a/libretro/msvc/msvc-2010/libretro.def b/libretro/msvc/msvc-2010/libretro.def index 2a71c09..70f6699 100644 --- a/libretro/msvc/msvc-2010/libretro.def +++ b/libretro/msvc/msvc-2010/libretro.def @@ -1,4 +1,4 @@ -LIBRARY "libretro-prboom msvc2010" +LIBRARY "msvc-2010" EXPORTS retro_set_environment retro_set_video_refresh diff --git a/libretro/msvc/msvc-2010/msvc-2010.vcxproj b/libretro/msvc/msvc-2010/msvc-2010.vcxproj index 92220ea..fbd29b1 100644 --- a/libretro/msvc/msvc-2010/msvc-2010.vcxproj +++ b/libretro/msvc/msvc-2010/msvc-2010.vcxproj @@ -89,6 +89,12 @@ + + $(SolutionDir)msvc-2010\$(Configuration)\ + + + $(SolutionDir)msvc-2010\$(Configuration)\ + @@ -126,4 +132,4 @@ - + \ No newline at end of file From 48542416069eab7144030308765c59edd3342b1b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 14 Apr 2014 05:47:00 +0200 Subject: [PATCH 04/19] (OSX) Add PPC detection --- Makefile.libretro | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile.libretro b/Makefile.libretro index db398e2..bdd204a 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -17,6 +17,10 @@ else ifneq ($(findstring MINGW,$(shell uname -a)),) platform = win else ifneq ($(findstring Darwin,$(shell uname -a)),) platform = osx + arch = intel +ifeq ($(shell uname -p),powerpc) + arch = ppc +endif else ifneq ($(findstring win,$(shell uname -a)),) platform = win endif @@ -29,6 +33,10 @@ EXE_EXT = .exe system_platform = win else ifneq ($(findstring Darwin,$(shell uname -a)),) system_platform = osx + arch = intel +ifeq ($(shell uname -p),powerpc) + arch = ppc +endif else ifneq ($(findstring MINGW,$(shell uname -a)),) system_platform = win endif @@ -43,9 +51,12 @@ ifeq ($(platform), unix) PLATFORM_DEFINES := -DHAVE_ZLIB else ifeq ($(platform), osx) TARGET := $(TARGET_NAME)_libretro.dylib - fpic := -fPIC -mmacosx-version-min=10.6 + fpic := -fPIC SHARED := -dynamiclib -lz +ifneq ($(arch),ppc) + fpic += -mmacosx-version-min=10.6 ENDIANNESS_DEFINES := -DLSB_FIRST +endif PLATFORM_DEFINES := -DHAVE_ZLIB else ifeq ($(platform), ios) TARGET := $(TARGET_NAME)_libretro_ios.dylib From 011cc39a19e61e94ce09c592daba2bede8b4c4ca Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 26 Apr 2014 04:23:30 +0200 Subject: [PATCH 05/19] Add OSX version minor detection in Makefile --- Makefile.libretro | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index bdd204a..40588bf 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -54,18 +54,27 @@ else ifeq ($(platform), osx) fpic := -fPIC SHARED := -dynamiclib -lz ifneq ($(arch),ppc) - fpic += -mmacosx-version-min=10.6 ENDIANNESS_DEFINES := -DLSB_FIRST endif PLATFORM_DEFINES := -DHAVE_ZLIB + +OSXVER = `sw_vers -productVersion | cut -c 4` +ifneq ($(OSXVER),9) + fpic += -mmacosx-version-min=10.5 +endif else ifeq ($(platform), ios) TARGET := $(TARGET_NAME)_libretro_ios.dylib fpic := -fPIC SHARED := -dynamiclib -lz ENDIANNESS_DEFINES := -DLSB_FIRST - PLATFORM_DEFINES := -DHAVE_ZLIB -miphoneos-version-min=5.0 + PLATFORM_DEFINES := -DHAVE_ZLIB - CC = clang -arch armv7 -isysroot $(IOSSDK) -miphoneos-version-min=5.0 + CC = clang -arch armv7 -isysroot $(IOSSDK) +OSXVER = `sw_vers -productVersion | cut -c 4` +ifneq ($(OSXVER),9) + CC += -miphoneos-version-min=5.0 + PLATFORM_DEFINES += -miphoneos-version-min=5.0 +endif else ifeq ($(platform), qnx) TARGET := $(TARGET_NAME)_libretro_qnx.so fpic := -fPIC From 26b50b39807417093999c015623ec33f8136836b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 29 Apr 2014 23:49:47 +0200 Subject: [PATCH 06/19] Bake in libtremor for regular Makefile and Android --- Makefile.libretro | 45 ++++++++++++++++++++++++++++++----------- core/tremor/misc.h | 2 ++ libretro/jni/Android.mk | 18 ++++++++++++++++- libretro/libretro.c | 3 +++ 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 40588bf..472a6ce 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -3,6 +3,7 @@ LOGSOUND = 0 FRONTEND_SUPPORTS_RGB565 = 1 GENPLUS_SRC_DIR := core +TREMOR_SRC_DIR := $(GENPLUS_SRC_DIR)/tremor LIBRETRO_DIR := libretro ifneq ($(EMSCRIPTEN),) @@ -47,14 +48,16 @@ ifeq ($(platform), unix) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN PLATFORM_DEFINES := -DHAVE_ZLIB else ifeq ($(platform), osx) TARGET := $(TARGET_NAME)_libretro.dylib fpic := -fPIC SHARED := -dynamiclib -lz -ifneq ($(arch),ppc) - ENDIANNESS_DEFINES := -DLSB_FIRST +ifeq ($(arch),ppc) + ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN +else + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN endif PLATFORM_DEFINES := -DHAVE_ZLIB @@ -66,7 +69,7 @@ else ifeq ($(platform), ios) TARGET := $(TARGET_NAME)_libretro_ios.dylib fpic := -fPIC SHARED := -dynamiclib -lz - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN PLATFORM_DEFINES := -DHAVE_ZLIB CC = clang -arch armv7 -isysroot $(IOSSDK) @@ -79,7 +82,7 @@ else ifeq ($(platform), qnx) TARGET := $(TARGET_NAME)_libretro_qnx.so fpic := -fPIC SHARED := -lm -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN PLATFORM_DEFINES := -DHAVE_ZLIB CC = qcc -Vgcc_ntoarmv7le AR = qcc -Vgcc_ntoarmv7le @@ -88,13 +91,13 @@ else ifeq ($(platform), ps3) TARGET := $(TARGET_NAME)_libretro_ps3.a CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe - PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER + PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), sncps3) TARGET := $(TARGET_NAME)_libretro_ps3.a CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe - PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER + PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), psl1ght) TARGET := $(TARGET_NAME)_libretro_psl1ght.a$(EXE_EXT) @@ -106,7 +109,7 @@ else ifeq ($(platform), psp1) TARGET := $(TARGET_NAME)_libretro_psp1.a$(EXE_EXT) CC = psp-gcc$(EXE_EXT) AR = psp-ar$(EXE_EXT) - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN PLATFORM_DEFINES := -DPSP CFLAGS += -G0 STATIC_LINKING = 1 @@ -115,11 +118,13 @@ else ifeq ($(platform), xenon) CC = xenon-gcc$(EXE_EXT) AR = xenon-ar$(EXE_EXT) PLATFORM_DEFINES := -D__LIBXENON__ -DALT_RENDER + ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), ngc) TARGET := $(TARGET_NAME)_libretro_ngc.a CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) + ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN PLATFORM_DEFINES := -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER STATIC_LINKING = 1 else ifeq ($(platform), wii) @@ -127,12 +132,13 @@ else ifeq ($(platform), wii) CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) PLATFORM_DEFINES := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER + ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifneq (,$(findstring armv,$(platform))) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN PLATFORM_DEFINES := -DHAVE_ZLIB CC = gcc ifneq (,$(findstring cortexa8,$(platform))) @@ -153,13 +159,13 @@ endif PLATFORM_DEFINES += -DARM else ifeq ($(platform), emscripten) TARGET := $(TARGET_NAME)_libretro_emscripten.bc - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN else TARGET := $(TARGET_NAME)_libretro.dll CC = gcc SHARED := -shared -static-libgcc -static-libstdc++ -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz - ENDIANNESS_DEFINES := -DLSB_FIRST + ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN PLATFORM_DEFINES := -DHAVE_ZLIB endif @@ -220,6 +226,21 @@ LIBRETRO_SRC := $(GENPLUS_SRC_DIR)/genesis.c \ $(GENPLUS_SRC_DIR)/z80/z80.c \ $(GENPLUS_SRC_DIR)/m68k/m68kcpu.c \ $(GENPLUS_SRC_DIR)/m68k/s68kcpu.c \ + $(TREMOR_SRC_DIR)/bitwise.c \ + $(TREMOR_SRC_DIR)/block.c \ + $(TREMOR_SRC_DIR)/codebook.c \ + $(TREMOR_SRC_DIR)/floor0.c \ + $(TREMOR_SRC_DIR)/floor1.c \ + $(TREMOR_SRC_DIR)/framing.c \ + $(TREMOR_SRC_DIR)/info.c \ + $(TREMOR_SRC_DIR)/mapping0.c \ + $(TREMOR_SRC_DIR)/mdct.c \ + $(TREMOR_SRC_DIR)/registry.c \ + $(TREMOR_SRC_DIR)/res012.c \ + $(TREMOR_SRC_DIR)/sharedbook.c \ + $(TREMOR_SRC_DIR)/synthesis.c \ + $(TREMOR_SRC_DIR)/vorbisfile.c \ + $(TREMOR_SRC_DIR)/window.c \ $(LIBRETRO_DIR)/libretro.c LIBRETRO_OBJ := $(LIBRETRO_SRC:.c=.o) @@ -228,7 +249,7 @@ ifeq ($(LOGSOUND), 1) LIBRETRO_CFLAGS := -DLOGSOUND endif -DEFINES := +DEFINES := -DUSE_LIBTREMOR CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES) ifeq ($(FRONTEND_SUPPORTS_RGB565), 1) diff --git a/core/tremor/misc.h b/core/tremor/misc.h index 12856d9..f762913 100644 --- a/core/tremor/misc.h +++ b/core/tremor/misc.h @@ -47,6 +47,7 @@ union magic { }; #endif +#ifndef ANDROID #if BYTE_ORDER==BIG_ENDIAN union magic { struct { @@ -56,6 +57,7 @@ union magic { ogg_int64_t whole; }; #endif +#endif STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { union magic magic; diff --git a/libretro/jni/Android.mk b/libretro/jni/Android.mk index 270c981..da28065 100644 --- a/libretro/jni/Android.mk +++ b/libretro/jni/Android.mk @@ -3,6 +3,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) GENPLUS_SRC_DIR := ../../core +TREMOR_SRC_DIR := $(GENPLUS_SRC_DIR)/tremor LIBRETRO_DIR := ../ LOCAL_MODULE := retro @@ -59,6 +60,21 @@ LOCAL_SRC_FILES := $(GENPLUS_SRC_DIR)/genesis.c \ $(GENPLUS_SRC_DIR)/z80/z80.c \ $(GENPLUS_SRC_DIR)/m68k/m68kcpu.c \ $(GENPLUS_SRC_DIR)/m68k/s68kcpu.c \ + $(TREMOR_SRC_DIR)/bitwise.c \ + $(TREMOR_SRC_DIR)/block.c \ + $(TREMOR_SRC_DIR)/codebook.c \ + $(TREMOR_SRC_DIR)/floor0.c \ + $(TREMOR_SRC_DIR)/floor1.c \ + $(TREMOR_SRC_DIR)/framing.c \ + $(TREMOR_SRC_DIR)/info.c \ + $(TREMOR_SRC_DIR)/mapping0.c \ + $(TREMOR_SRC_DIR)/mdct.c \ + $(TREMOR_SRC_DIR)/registry.c \ + $(TREMOR_SRC_DIR)/res012.c \ + $(TREMOR_SRC_DIR)/sharedbook.c \ + $(TREMOR_SRC_DIR)/synthesis.c \ + $(TREMOR_SRC_DIR)/vorbisfile.c \ + $(TREMOR_SRC_DIR)/window.c \ $(LIBRETRO_DIR)/libretro.c \ $(LIBRETRO_DIR)/scrc32.c @@ -73,6 +89,6 @@ LOCAL_C_INCLUDES = $(LOCAL_PATH)/$(GENPLUS_SRC_DIR) \ $(LOCAL_PATH)/$(GENPLUS_SRC_DIR)/ntsc \ $(LOCAL_PATH)/$(LIBRETRO_DIR) -LOCAL_CFLAGS = -ffast-math -O2 -funroll-loops -DINLINE="static inline" -DUSE_16BPP_RENDERING -DLSB_FIRST -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DALIGN_LONG -DALIGN_WORD +LOCAL_CFLAGS = -ffast-math -O2 -funroll-loops -DINLINE="static inline" -DUSE_LIBTREMOR -DUSE_16BPP_RENDERING -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DALIGN_LONG -DALIGN_WORD include $(BUILD_SHARED_LIBRARY) diff --git a/libretro/libretro.c b/libretro/libretro.c index e8b68e5..68e3692 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -69,6 +69,7 @@ static retro_audio_sample_batch_t audio_cb; /************************************ * Genesis Plus GX implementation ************************************/ +#undef CHUNKSIZE #define CHUNKSIZE (0x10000) void error(char * fmt, ...) @@ -1024,3 +1025,5 @@ void retro_run(void) configure_controls(); } } + +#undef CHUNKSIZE From c5cecd7870ee44aad23f072c38d89faed99d0e3d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Apr 2014 00:07:36 +0200 Subject: [PATCH 07/19] (MSVC) Bake in libtremor support --- core/tremor/misc.h | 4 +- core/tremor/os.h | 2 + core/tremor/os_types.h | 4 ++ .../msvc-2003-xbox1/msvc-2003-xbox1.vcproj | 59 +++++++++++++++++-- .../msvc/msvc-2010-360/msvc-2010-360.vcxproj | 29 ++++++--- .../msvc-2010-360.vcxproj.filters | 50 +++++++++++++++- libretro/msvc/msvc-2010/msvc-2010.vcxproj | 19 +++++- .../msvc/msvc-2010/msvc-2010.vcxproj.filters | 50 +++++++++++++++- 8 files changed, 200 insertions(+), 17 deletions(-) diff --git a/core/tremor/misc.h b/core/tremor/misc.h index f762913..2253c88 100644 --- a/core/tremor/misc.h +++ b/core/tremor/misc.h @@ -37,6 +37,7 @@ #include #endif +#ifndef _XBOX360 #if BYTE_ORDER==LITTLE_ENDIAN union magic { struct { @@ -45,7 +46,8 @@ union magic { } halves; ogg_int64_t whole; }; -#endif +#endif +#endif #ifndef ANDROID #if BYTE_ORDER==BIG_ENDIAN diff --git a/core/tremor/os.h b/core/tremor/os.h index 95e6e27..48d8f54 100644 --- a/core/tremor/os.h +++ b/core/tremor/os.h @@ -41,9 +41,11 @@ # define rint(x) (floor((x)+0.5f)) # define NO_FLOAT_MATH_LIB # define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b)) +#ifndef _XBOX360 # define LITTLE_ENDIAN 1 # define BYTE_ORDER LITTLE_ENDIAN #endif +#endif #ifdef HAVE_ALLOCA_H # include diff --git a/core/tremor/os_types.h b/core/tremor/os_types.h index 8af2893..151e59b 100644 --- a/core/tremor/os_types.h +++ b/core/tremor/os_types.h @@ -32,7 +32,11 @@ #define _ogg_realloc realloc #define _ogg_free free +#if defined(_WIN32) && defined(__LIBRETRO__) +#include +#else #include +#endif typedef int64_t ogg_int64_t; typedef int32_t ogg_int32_t; diff --git a/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj b/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj index 2a16177..7a597ad 100644 --- a/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj +++ b/libretro/msvc/msvc-2003-xbox1/msvc-2003-xbox1.vcproj @@ -22,7 +22,7 @@ Optimization="0" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\core";"$(SolutionDir)\..\..\core\cd_hw";"$(SolutionDir)\..\..\core\cart_hw";"$(SolutionDir)\..\..\core\sound";"$(SolutionDir)\..\..\core\z80";"$(SolutionDir)\..\..\";"$(SolutionDir)";"$(SolutionDir)\..\..\core\m68k";"$(SolutionDir)\..\..\core\input_hw";"$(SolutionDir)\..\..\core\cart_hw\svp";"$(SolutionDir)\..\..\core\ntsc";"$(SolutionDir)\..\..\libretro";"$(SolutionDir)\msvc-2003-xbox1"" - PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565" + PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -56,7 +56,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\core";"$(SolutionDir)\..\..\core\cd_hw";"$(SolutionDir)\..\..\core\cart_hw";"$(SolutionDir)\..\..\core\sound";"$(SolutionDir)\..\..\core\z80";"$(SolutionDir)\..\..\";"$(SolutionDir)";"$(SolutionDir)\..\..\core\m68k";"$(SolutionDir)\..\..\core\input_hw";"$(SolutionDir)\..\..\core\cart_hw\svp";"$(SolutionDir)\..\..\core\ntsc";"$(SolutionDir)\..\..\libretro";"$(SolutionDir)\msvc-2003-xbox1"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;PROFILE;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;PROFILE;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -91,7 +91,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\core";"$(SolutionDir)\..\..\core\cd_hw";"$(SolutionDir)\..\..\core\cart_hw";"$(SolutionDir)\..\..\core\sound";"$(SolutionDir)\..\..\core\z80";"$(SolutionDir)\..\..\";"$(SolutionDir)";"$(SolutionDir)\..\..\core\m68k";"$(SolutionDir)\..\..\core\input_hw";"$(SolutionDir)\..\..\core\cart_hw\svp";"$(SolutionDir)\..\..\core\ntsc";"$(SolutionDir)\..\..\libretro";"$(SolutionDir)\msvc-2003-xbox1"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;PROFILE;FASTCAP;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;PROFILE;FASTCAP;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -127,7 +127,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\core";"$(SolutionDir)\..\..\core\cd_hw";"$(SolutionDir)\..\..\core\cart_hw";"$(SolutionDir)\..\..\core\sound";"$(SolutionDir)\..\..\core\z80";"$(SolutionDir)\..\..\";"$(SolutionDir)";"$(SolutionDir)\..\..\core\m68k";"$(SolutionDir)\..\..\core\input_hw";"$(SolutionDir)\..\..\core\cart_hw\svp";"$(SolutionDir)\..\..\core\ntsc";"$(SolutionDir)\..\..\libretro";"$(SolutionDir)\msvc-2003-xbox1"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -163,7 +163,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\core";"$(SolutionDir)\..\..\core\cd_hw";"$(SolutionDir)\..\..\core\cart_hw";"$(SolutionDir)\..\..\core\sound";"$(SolutionDir)\..\..\core\z80";"$(SolutionDir)\..\..\";"$(SolutionDir)";"$(SolutionDir)\..\..\core\m68k";"$(SolutionDir)\..\..\core\input_hw";"$(SolutionDir)\..\..\core\cart_hw\svp";"$(SolutionDir)\..\..\core\ntsc";"$(SolutionDir)\..\..\libretro";"$(SolutionDir)\msvc-2003-xbox1"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;LTCG;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;LTCG;_LIB;__LIBRETRO__;LSB_FIRST;USE_16BPP_RENDERING;INLINE=static _inline;__restrict=;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -527,6 +527,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -242,7 +257,7 @@ false $(OutDir)$(ProjectName).pch MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + _DEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -263,7 +278,7 @@ false $(OutDir)$(ProjectName).pch MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565 + _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -285,7 +300,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -311,7 +326,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -334,7 +349,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + NDEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -357,7 +372,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -370,4 +385,4 @@ - + \ No newline at end of file diff --git a/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj.filters b/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj.filters index 657a081..cd37e39 100644 --- a/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj.filters +++ b/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj.filters @@ -36,6 +36,9 @@ {d8d4356b-c678-422e-aa12-9f52ba60fdbc} + + {d1768684-24bc-4639-8b7c-481d2281d4cf} + @@ -182,5 +185,50 @@ Source Files\cart_hw + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + - + \ No newline at end of file diff --git a/libretro/msvc/msvc-2010/msvc-2010.vcxproj b/libretro/msvc/msvc-2010/msvc-2010.vcxproj index fbd29b1..11ed4df 100644 --- a/libretro/msvc/msvc-2010/msvc-2010.vcxproj +++ b/libretro/msvc/msvc-2010/msvc-2010.vcxproj @@ -55,6 +55,21 @@ + + + + + + + + + + + + + + + @@ -101,7 +116,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;_CRT_SECURE_NO_WARNINGS;INLINE=static _inline;__inline__=_inline;__extension__=;LSB_FIRST;__LIBRETRO__;USE_16BPP_RENDERING;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;_CRT_SECURE_NO_WARNINGS;INLINE=static _inline;__inline__=_inline;__extension__=;LSB_FIRST;__LIBRETRO__;USE_16BPP_RENDERING;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN $(SolutionDir)/../../core;$(SolutionDir)/../../utils/zlib;$(SolutionDir)/../../core/cart_hw/svp;$(SolutionDir)/../../libretro;$(SolutionDir)/../../core/m68k;$(SolutionDir)/../../core/z80;$(SolutionDir)/../../core/input_hw;$(SolutionDir)/../../core/cart_hw;$(SolutionDir)/../../core/sound;$(SolutionDir)/../../core/ntsc;$(SolutionDir)/../../core/cd_hw;%(AdditionalIncludeDirectories) @@ -118,7 +133,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;_CRT_SECURE_NO_WARNINGS;INLINE=static _inline;__inline__=_inline;__extension__=;LSB_FIRST;__LIBRETRO__;USE_16BPP_RENDERING;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;MSVC2010_EXPORTS;_CRT_SECURE_NO_WARNINGS;INLINE=static _inline;__inline__=_inline;__extension__=;LSB_FIRST;__LIBRETRO__;USE_16BPP_RENDERING;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=LITTLE_ENDIAN $(SolutionDir)/../../core;$(SolutionDir)/../../utils/zlib;$(SolutionDir)/../../core/cart_hw/svp;$(SolutionDir)/../../libretro;$(SolutionDir)/../../core/m68k;$(SolutionDir)/../../core/z80;$(SolutionDir)/../../core/input_hw;$(SolutionDir)/../../core/cart_hw;$(SolutionDir)/../../core/sound;$(SolutionDir)/../../core/ntsc;$(SolutionDir)/../../core/cd_hw;%(AdditionalIncludeDirectories) diff --git a/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters b/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters index 42f5874..262e025 100644 --- a/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters +++ b/libretro/msvc/msvc-2010/msvc-2010.vcxproj.filters @@ -40,6 +40,9 @@ {eba4b43d-dbd8-4170-9853-e3234db6dfc0} + + {c4a5e1da-1ff3-4c81-893c-97364ed7ed4b} + @@ -189,5 +192,50 @@ Source Files\sound + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + + + Source Files\tremor + - + \ No newline at end of file From 7948c690e78db2b148f7a213e13ff4a5585d50c3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Apr 2014 00:24:03 +0200 Subject: [PATCH 08/19] This Tremor header file should probably be properly rewritten to either define union magic for MSB_FIRST or LSB_FIRST - the current way of doing it is a goddamn mess --- core/tremor/misc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/tremor/misc.h b/core/tremor/misc.h index 2253c88..cb6dfcc 100644 --- a/core/tremor/misc.h +++ b/core/tremor/misc.h @@ -23,7 +23,7 @@ #include "asm_arm.h" #include /* for abs() */ -#ifdef GEKKO +#if defined(GEKKO) && !defined(__LIBRETRO__) #include #endif @@ -37,6 +37,8 @@ #include #endif +#if !defined(__LIBRETRO__) && defined(GEKKO) +#ifndef __CELLOS_LV2__ #ifndef _XBOX360 #if BYTE_ORDER==LITTLE_ENDIAN union magic { @@ -48,6 +50,8 @@ union magic { }; #endif #endif +#endif +#endif #ifndef ANDROID #if BYTE_ORDER==BIG_ENDIAN From 167ec024254e806a1a7298ff8a4f78051d2f9200 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Apr 2014 00:27:19 +0200 Subject: [PATCH 09/19] Going to just use MSB_FIRST or LSB_FIRST here as an ifdef - this is too much of a PITA --- core/tremor/misc.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/core/tremor/misc.h b/core/tremor/misc.h index cb6dfcc..c4a70c7 100644 --- a/core/tremor/misc.h +++ b/core/tremor/misc.h @@ -37,10 +37,7 @@ #include #endif -#if !defined(__LIBRETRO__) && defined(GEKKO) -#ifndef __CELLOS_LV2__ -#ifndef _XBOX360 -#if BYTE_ORDER==LITTLE_ENDIAN +#if defined(LSB_FIRST) union magic { struct { ogg_int32_t lo; @@ -48,13 +45,7 @@ union magic { } halves; ogg_int64_t whole; }; -#endif -#endif -#endif -#endif - -#ifndef ANDROID -#if BYTE_ORDER==BIG_ENDIAN +#elif defined(MSB_FIRST) union magic { struct { ogg_int32_t hi; @@ -63,7 +54,6 @@ union magic { ogg_int64_t whole; }; #endif -#endif STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { union magic magic; From 97d0e566502dacdfae7fe1c2f1bddc6973cdfebb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Apr 2014 00:28:46 +0200 Subject: [PATCH 10/19] Define MSB_FIRST for Xbox 360 --- Makefile.libretro | 2 +- libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 472a6ce..62b7646 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -103,7 +103,7 @@ else ifeq ($(platform), psl1ght) TARGET := $(TARGET_NAME)_libretro_psl1ght.a$(EXE_EXT) CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) - PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER + PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), psp1) TARGET := $(TARGET_NAME)_libretro_psp1.a$(EXE_EXT) diff --git a/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj b/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj index d1476bf..7bb1e32 100644 --- a/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj +++ b/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj @@ -257,7 +257,7 @@ false $(OutDir)$(ProjectName).pch MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN + _DEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -278,7 +278,7 @@ false $(OutDir)$(ProjectName).pch MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN + _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -300,7 +300,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN + NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -326,7 +326,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN + NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -349,7 +349,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN + NDEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -372,7 +372,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN + NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -385,4 +385,4 @@ - \ No newline at end of file + From f9320178452c278068264939e191cd2f592446af Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 May 2014 03:13:37 +0200 Subject: [PATCH 11/19] Reimplement multitap/controller settings - now implements RETRO_SET_CONTROLLER_INFO --- libretro/libretro.c | 167 +++++++++++++++++++++++------------ libretro/libretro.h | 208 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 277 insertions(+), 98 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 68e3692..0444f88 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -13,6 +13,17 @@ #include #endif +#define RETRO_DEVICE_MDPAD_3B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 0) +#define RETRO_DEVICE_MDPAD_6B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1) +#define RETRO_DEVICE_PAD_AUTO RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 2) +#define RETRO_DEVICE_PORT_NONE RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 3) +#define RETRO_DEVICE_SMSPAD_2B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 4) +#define RETRO_DEVICE_MDPAD_3B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 5) +#define RETRO_DEVICE_MDPAD_6B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 6) +#define RETRO_DEVICE_MDPAD_3B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 7) +#define RETRO_DEVICE_MDPAD_6B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 8) +#define RETRO_DEVICE_SMSPAD_4P RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 9) + #include "shared.h" #include "libretro.h" #include "state.h" @@ -713,50 +724,6 @@ static void check_variables(void) } } -static void configure_controls(void) -{ - int i; - struct retro_variable var; - - input.system[0] = SYSTEM_GAMEPAD; - input.system[1] = SYSTEM_GAMEPAD; - - var.key = "padtype"; - environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); - if (!strcmp(var.value, "6-buttons")) - for(i = 0; i < MAX_INPUTS; i++) - config.input[i].padtype = DEVICE_PAD6B; - else if (!strcmp(var.value, "3-buttons")) - for(i = 0; i < MAX_INPUTS; i++) - config.input[i].padtype = DEVICE_PAD3B; - else if (!strcmp(var.value, "2-buttons")) - for(i = 0; i < MAX_INPUTS; i++) - config.input[i].padtype = DEVICE_PAD2B; - else - for(i = 0; i < MAX_INPUTS; i++) - config.input[i].padtype = DEVICE_PAD2B | DEVICE_PAD3B | DEVICE_PAD6B; - - var.key = "multitap"; - environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); - if (!strcmp(var.value, "4-wayplay")) - input.system[0] = input.system[1] = SYSTEM_WAYPLAY; - else if (!strcmp(var.value, "teamplayer 1")) - input.system[0] = SYSTEM_TEAMPLAYER; - else if (!strcmp(var.value, "teamplayer 2")) - input.system[1] = SYSTEM_TEAMPLAYER; - else if (!strcmp(var.value, "teamplayer 1&2")) - input.system[0] = input.system[1] = SYSTEM_TEAMPLAYER; - else if (!strcmp(var.value, "master system 4p")) - input.system[0] = SYSTEM_MS4PLAY; - - var.key = "portb"; - environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); - if (!strcmp(var.value, "disabled")) - input.system[1] = NO_SYSTEM; - - input_init(); -} - /************************************ * libretro implementation ************************************/ @@ -770,9 +737,6 @@ void retro_set_environment(retro_environment_t cb) { "force_dtack", "System lockups; enabled|disabled" }, { "addr_error", "68k address error; enabled|disabled" }, { "lock_on", "Cartridge lock-on; disabled|game genie|action replay (pro)|sonic & knuckles" }, - { "padtype", "Gamepad type; auto|6-buttons|3-buttons|2-buttons" }, - { "multitap", "Multi Tap; disabled|4-wayplay|teamplayer (port 1)|teamplayer (port 2)|teamplayer (both)|master system 4p" }, - { "portb", "Control Port 2; enabled|disabled" }, { "ym2413", "Master System FM; auto|disabled|enabled" }, { "dac_bits", "YM2612 DAC quantization; disabled|enabled" }, { "blargg_ntsc_filter", "Blargg NTSC filter; disabled|monochrome|composite|svideo|rgb" }, @@ -782,8 +746,43 @@ void retro_set_environment(retro_environment_t cb) { NULL, NULL }, }; + + static const struct retro_controller_description port_1[] = { + { "MD Joypad 3 Button", RETRO_DEVICE_MDPAD_3B }, + { "MD Joypad 6 Button", RETRO_DEVICE_MDPAD_6B }, + { "Joypad Auto", RETRO_DEVICE_PAD_AUTO }, + { "Joypad Port Empty", RETRO_DEVICE_PORT_NONE }, + { "SMS Joypad 2 Button", RETRO_DEVICE_SMSPAD_2B }, + { "MD Joypad 3 Button + WayPlay", RETRO_DEVICE_MDPAD_3B_WAYPLAY }, + { "MD Joypad 6 Button + WayPlay", RETRO_DEVICE_MDPAD_6B_WAYPLAY }, + { "MD Joypad 3 Button + Teamplayer", RETRO_DEVICE_MDPAD_3B_TEAMPLAYER }, + { "MD Joypad 6 Button + Teamplayer", RETRO_DEVICE_MDPAD_6B_TEAMPLAYER }, + { "SMS Joypad 4 Player", RETRO_DEVICE_SMSPAD_4P }, + { "RetroPad", RETRO_DEVICE_JOYPAD }, + }; + + static const struct retro_controller_description port_2[] = { + { "MD Joypad 3 Button", RETRO_DEVICE_MDPAD_3B }, + { "MD Joypad 6 Button", RETRO_DEVICE_MDPAD_6B }, + { "Joypad Auto", RETRO_DEVICE_PAD_AUTO }, + { "Joypad Port Empty", RETRO_DEVICE_PORT_NONE }, + { "SMS Joypad 2 Button", RETRO_DEVICE_SMSPAD_2B }, + { "MD Joypad 3 Button + WayPlay", RETRO_DEVICE_MDPAD_3B_WAYPLAY }, + { "MD Joypad 6 Button + WayPlay", RETRO_DEVICE_MDPAD_6B_WAYPLAY }, + { "MD Joypad 3 Button + Teamplayer", RETRO_DEVICE_MDPAD_3B_TEAMPLAYER }, + { "MD Joypad 6 Button + Teamplayer", RETRO_DEVICE_MDPAD_6B_TEAMPLAYER }, + { "RetroPad", RETRO_DEVICE_JOYPAD }, + }; + + static const struct retro_controller_info ports[] = { + { port_1, 11 }, + { port_2, 10 }, + { 0 }, + }; + environ_cb = cb; cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars); + environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports); } void retro_set_video_refresh(retro_video_refresh_t cb) { video_cb = cb; } @@ -814,8 +813,63 @@ void retro_get_system_av_info(struct retro_system_av_info *info) void retro_set_controller_port_device(unsigned port, unsigned device) { - (void)port; - (void)device; + switch(device) + { + case RETRO_DEVICE_JOYPAD: + case RETRO_DEVICE_MDPAD_3B: + default: + config.input[port].padtype = DEVICE_PAD3B; + input.dev[port] = DEVICE_PAD3B; + input.system[port] = SYSTEM_GAMEPAD; + break; + case RETRO_DEVICE_MDPAD_6B: + config.input[port].padtype = DEVICE_PAD6B; + input.dev[port] = DEVICE_PAD6B; + input.system[port] = SYSTEM_GAMEPAD; + break; + case RETRO_DEVICE_PAD_AUTO: + config.input[port].padtype = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; + input.dev[port] = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; + input.system[port] = SYSTEM_GAMEPAD; + break; + case RETRO_DEVICE_PORT_NONE: + config.input[port].padtype = 0; + input.dev[port] = 0; + input.system[port] = NO_SYSTEM; + break; + case RETRO_DEVICE_SMSPAD_2B: + config.input[port].padtype = DEVICE_PAD2B; + input.dev[port] = DEVICE_PAD2B; + input.system[port] = SYSTEM_GAMEPAD; + break; + case RETRO_DEVICE_MDPAD_3B_WAYPLAY: + config.input[port].padtype = DEVICE_PAD3B; + input.dev[port] = DEVICE_PAD3B; + input.system[0] = input.system[1] = SYSTEM_WAYPLAY; + break; + case RETRO_DEVICE_MDPAD_6B_WAYPLAY: + config.input[port].padtype = DEVICE_PAD6B; + input.dev[port] = DEVICE_PAD6B; + input.system[0] = input.system[1] = SYSTEM_WAYPLAY; + break; + case RETRO_DEVICE_MDPAD_3B_TEAMPLAYER: + config.input[port].padtype = DEVICE_PAD3B; + input.dev[port] = DEVICE_PAD3B; + input.system[port] = SYSTEM_TEAMPLAYER; + break; + case RETRO_DEVICE_MDPAD_6B_TEAMPLAYER: + config.input[port].padtype = DEVICE_PAD6B; + input.dev[port] = DEVICE_PAD6B; + input.system[port] = SYSTEM_TEAMPLAYER; + break; + case RETRO_DEVICE_SMSPAD_4P: + config.input[port].padtype = DEVICE_PAD2B; + input.dev[port] = DEVICE_PAD2B; + input.system[0] = SYSTEM_MS4PLAY; + break; + } + + input_init(); } size_t retro_serialize_size(void) { return STATE_SIZE; } @@ -898,8 +952,9 @@ bool retro_load_game(const struct retro_game_info *info) if (!load_rom((char *)info->path)) return false; - configure_controls(); - + for (i = 0; i < 2; i++) + retro_set_controller_port_device(i, input.dev[i]); + audio_init(44100, vdp_pal ? pal_fps : ntsc_fps); system_init(); system_reset(); @@ -987,8 +1042,11 @@ void retro_init(void) void retro_deinit(void) { audio_shutdown(); - free(md_ntsc); - free(sms_ntsc); + if (md_ntsc) + free(md_ntsc); + if (sms_ntsc) + free(sms_ntsc); + } void retro_reset(void) { system_reset(); } @@ -1020,10 +1078,7 @@ void retro_run(void) environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated); if (updated) - { check_variables(); - configure_controls(); - } } #undef CHUNKSIZE diff --git a/libretro/libretro.h b/libretro/libretro.h index 4a50847..a0a7483 100755 --- a/libretro/libretro.h +++ b/libretro/libretro.h @@ -46,8 +46,22 @@ extern "C" { // It is not incremented for compatible changes to the API. #define RETRO_API_VERSION 1 -// Libretro's fundamental device abstractions. -#define RETRO_DEVICE_MASK 0xff +// +// Libretros fundamental device abstractions. +///////// +// +// Libretros input system consists of some standardized device types such as a joypad (with/without analog), +// mouse, keyboard, lightgun and a pointer. The functionality of these devices are fixed, and individual cores map +// their own concept of a controller to libretros abstractions. +// This makes it possible for frontends to map the abstract types to a real input device, +// and not having to worry about binding input correctly to arbitrary controller layouts. + + +#define RETRO_DEVICE_TYPE_SHIFT 8 +#define RETRO_DEVICE_MASK ((1 << RETRO_DEVICE_TYPE_SHIFT) - 1) +#define RETRO_DEVICE_SUBCLASS(base, id) (((id + 1) << RETRO_DEVICE_TYPE_SHIFT) | base) + +// Input disabled. #define RETRO_DEVICE_NONE 0 // The JOYPAD is called RetroPad. It is essentially a Super Nintendo controller, @@ -62,6 +76,7 @@ extern "C" { // KEYBOARD device lets one poll for raw key pressed. // It is poll based, so input callback will return with the current pressed state. +// For event/text based keyboard input, see RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK. #define RETRO_DEVICE_KEYBOARD 3 // Lightgun X/Y coordinates are reported relatively to last poll, similar to mouse. @@ -87,7 +102,7 @@ extern "C" { // // To check if the pointer coordinates are valid (e.g. a touch display actually being touched), // PRESSED returns 1 or 0. -// If using a mouse, PRESSED will usually correspond to the left mouse button. +// If using a mouse on a desktop, PRESSED will usually correspond to the left mouse button, but this is a frontend decision. // PRESSED will only return 1 if the pointer is inside the game screen. // // For multi-touch, the index variable can be used to successively query more presses. @@ -96,16 +111,6 @@ extern "C" { // Eventually _PRESSED will return false for an index. No further presses are registered at this point. #define RETRO_DEVICE_POINTER 6 -// These device types are specializations of the base types above. -// They should only be used in retro_set_controller_type() to inform libretro implementations -// about use of a very specific device type. -// -// In input state callback, however, only the base type should be used in the 'device' field. -#define RETRO_DEVICE_JOYPAD_MULTITAP ((1 << 8) | RETRO_DEVICE_JOYPAD) -#define RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE ((1 << 8) | RETRO_DEVICE_LIGHTGUN) -#define RETRO_DEVICE_LIGHTGUN_JUSTIFIER ((2 << 8) | RETRO_DEVICE_LIGHTGUN) -#define RETRO_DEVICE_LIGHTGUN_JUSTIFIERS ((3 << 8) | RETRO_DEVICE_LIGHTGUN) - // Buttons for the RetroPad (JOYPAD). // The placement of these is equivalent to placements on the Super Nintendo controller. // L2/R2/L3/R3 buttons correspond to the PS1 DualShock. @@ -133,10 +138,13 @@ extern "C" { #define RETRO_DEVICE_ID_ANALOG_Y 1 // Id values for MOUSE. -#define RETRO_DEVICE_ID_MOUSE_X 0 -#define RETRO_DEVICE_ID_MOUSE_Y 1 -#define RETRO_DEVICE_ID_MOUSE_LEFT 2 -#define RETRO_DEVICE_ID_MOUSE_RIGHT 3 +#define RETRO_DEVICE_ID_MOUSE_X 0 +#define RETRO_DEVICE_ID_MOUSE_Y 1 +#define RETRO_DEVICE_ID_MOUSE_LEFT 2 +#define RETRO_DEVICE_ID_MOUSE_RIGHT 3 +#define RETRO_DEVICE_ID_MOUSE_WHEELUP 4 +#define RETRO_DEVICE_ID_MOUSE_WHEELDOWN 5 +#define RETRO_DEVICE_ID_MOUSE_MIDDLE 6 // Id values for LIGHTGUN types. #define RETRO_DEVICE_ID_LIGHTGUN_X 0 @@ -162,7 +170,7 @@ extern "C" { // Regular save ram. This ram is usually found on a game cartridge, backed up by a battery. // If save game data is too complex for a single memory buffer, -// the SYSTEM_DIRECTORY environment callback can be used. +// the SAVE_DIRECTORY (preferably) or SYSTEM_DIRECTORY environment callback can be used. #define RETRO_MEMORY_SAVE_RAM 0 // Some games have a built-in clock to keep track of time. @@ -175,21 +183,6 @@ extern "C" { // Video ram lets a frontend peek into a game systems video RAM (VRAM). #define RETRO_MEMORY_VIDEO_RAM 3 -// Special memory types. -#define RETRO_MEMORY_SNES_BSX_RAM ((1 << 8) | RETRO_MEMORY_SAVE_RAM) -#define RETRO_MEMORY_SNES_BSX_PRAM ((2 << 8) | RETRO_MEMORY_SAVE_RAM) -#define RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM ((3 << 8) | RETRO_MEMORY_SAVE_RAM) -#define RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM ((4 << 8) | RETRO_MEMORY_SAVE_RAM) -#define RETRO_MEMORY_SNES_GAME_BOY_RAM ((5 << 8) | RETRO_MEMORY_SAVE_RAM) -#define RETRO_MEMORY_SNES_GAME_BOY_RTC ((6 << 8) | RETRO_MEMORY_RTC) - -// Special game types passed into retro_load_game_special(). -// Only used when multiple ROMs are required. -#define RETRO_GAME_TYPE_BSX 0x101 -#define RETRO_GAME_TYPE_BSX_SLOTTED 0x102 -#define RETRO_GAME_TYPE_SUFAMI_TURBO 0x103 -#define RETRO_GAME_TYPE_SUPER_GAME_BOY 0x104 - // Keysyms used for ID in input state callback when polling RETRO_KEYBOARD. enum retro_key { @@ -563,12 +556,12 @@ enum retro_mod // If this interface is not used, libretro cores should log to stderr as desired. #define RETRO_ENVIRONMENT_GET_PERF_INTERFACE 28 // struct retro_perf_callback * -- - // Gets an interface for performance counters. This is useful for performance logging in a + // Gets an interface for performance counters. This is useful for performance logging in a // cross-platform way and for detecting architecture-specific features, such as SIMD support. #define RETRO_ENVIRONMENT_GET_LOCATION_INTERFACE 29 // struct retro_location_callback * -- // Gets access to the location interface. - // The purpose of this interface is to be able to retrieve location-based information from the host device, + // The purpose of this interface is to be able to retrieve location-based information from the host device, // such as current latitude / longitude. // #define RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY 30 @@ -607,6 +600,116 @@ enum retro_mod // This call is not a free pass for not trying to provide correct values in retro_get_system_av_info(). // // If this returns false, the frontend does not acknowledge a changed av_info struct. +#define RETRO_ENVIRONMENT_SET_PROC_ADDRESS_CALLBACK 33 + // const struct retro_get_proc_address_interface * -- + // Allows a libretro core to announce support for the get_proc_address() interface. + // This interface allows for a standard way to extend libretro where use of environment calls are too indirect, + // e.g. for cases where the frontend wants to call directly into the core. + // + // If a core wants to expose this interface, SET_PROC_ADDRESS_CALLBACK **MUST** be called from within retro_set_environment(). + // +#define RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO 34 + // const struct retro_subsystem_info * -- + // This environment call introduces the concept of libretro "subsystems". + // A subsystem is a variant of a libretro core which supports different kinds of games. + // The purpose of this is to support e.g. emulators which might have special needs, e.g. Super Nintendos Super GameBoy, Sufami Turbo. + // It can also be used to pick among subsystems in an explicit way if the libretro implementation is a multi-system emulator itself. + // + // Loading a game via a subsystem is done with retro_load_game_special(), + // and this environment call allows a libretro core to expose which subsystems are supported for use with retro_load_game_special(). + // A core passes an array of retro_game_special_info which is terminated with a zeroed out retro_game_special_info struct. + // + // If a core wants to use this functionality, SET_SUBSYSTEM_INFO **MUST** be called from within retro_set_environment(). + // +#define RETRO_ENVIRONMENT_SET_CONTROLLER_INFO 35 + // const struct retro_controller_info * -- + // This environment call lets a libretro core tell the frontend which + // controller types are recognized in calls to retro_set_controller_port_device(). + // + // Some emulators such as Super Nintendo + // support multiple lightgun types which must be specifically selected from. + // It is therefore sometimes necessary for a frontend to be able to tell + // the core about a special kind of input device which is not covered by the + // libretro input API. + // + // In order for a frontend to understand the workings of an input device, + // it must be a specialized type + // of the generic device types already defined in the libretro API. + // + // Which devices are supported can vary per input port. + // The core must pass an array of const struct retro_controller_info which is terminated with + // a blanked out struct. Each element of the struct corresponds to an ascending port index to retro_set_controller_port_device(). + // Even if special device types are set in the libretro core, libretro should only poll input based on the base input device types. + +struct retro_controller_description +{ + // Human-readable description of the controller. Even if using a generic input device type, this can be + // set to the particular device type the core uses. + const char *desc; + + // Device type passed to retro_set_controller_port_device(). If the device type is a sub-class of a generic input device type, + // use the RETRO_DEVICE_SUBCLASS macro to create an ID. E.g. RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1). + unsigned id; +}; + +struct retro_controller_info +{ + const struct retro_controller_description *types; + unsigned num_types; +}; + +struct retro_subsystem_memory_info +{ + const char *extension; // The extension associated with a memory type, e.g. "psram". + unsigned type; // The memory type for retro_get_memory(). This should be at least 0x100 to avoid conflict with standardized libretro memory types. +}; + +struct retro_subsystem_rom_info +{ + const char *desc; // Describes what the ROM is (SGB bios, GB rom, etc). + const char *valid_extensions; // Same definition as retro_get_system_info(). + bool need_fullpath; // Same definition as retro_get_system_info(). + bool block_extract; // Same definition as retro_get_system_info(). + bool required; // This is set if the ROM is required to load a game. If this is set to false, a zeroed-out retro_game_info can be passed. + + // ROMs can have multiple associated persistent memory types (retro_get_memory()). + const struct retro_subsystem_memory_info *memory; + unsigned num_memory; +}; + +struct retro_subsystem_info +{ + const char *desc; // Human-readable string of the subsystem type, e.g. "Super GameBoy" + // A computer friendly short string identifier for the subsystem type. + // This name must be [a-z]. + // E.g. if desc is "Super GameBoy", this can be "sgb". + // This identifier can be used for command-line interfaces, etc. + const char *ident; + + // Infos for each ROM. The first entry is assumed to be the "most significant" ROM for frontend purposes. + // E.g. with Super GameBoy, the first ROM should be the GameBoy ROM, as it is the most "significant" ROM to a user. + // If a frontend creates new file paths based on the ROM used (e.g. savestates), it should use the path for the first ROM to do so. + const struct retro_subsystem_rom_info *roms; + + unsigned num_roms; // Number of ROMs associated with a subsystem. + unsigned id; // The type passed to retro_load_game_special(). +}; + +typedef void (*retro_proc_address_t)(void); +// libretro API extension functions: +// (None here so far). +////// + +// Get a symbol from a libretro core. +// Cores should only return symbols which are actual extensions to the libretro API. +// Frontends should not use this to obtain symbols to standard libretro entry points (static linking or dlsym). +// The symbol name must be equal to the function name, e.g. if void retro_foo(void); exists, the symbol must be called "retro_foo". +// The returned function pointer must be cast to the corresponding type. +typedef retro_proc_address_t (*retro_get_proc_address_t)(const char *sym); +struct retro_get_proc_address_interface +{ + retro_get_proc_address_t get_proc_address; +}; enum retro_log_level { @@ -643,6 +746,7 @@ struct retro_log_callback #define RETRO_SIMD_SSE42 (1 << 11) #define RETRO_SIMD_AVX2 (1 << 12) #define RETRO_SIMD_VFPU (1 << 13) +#define RETRO_SIMD_PS (1 << 14) typedef uint64_t retro_perf_tick_t; typedef int64_t retro_time_t; @@ -768,7 +872,7 @@ typedef void (*retro_camera_frame_raw_framebuffer_t)(const uint32_t *buffer, uns // // texture_target is the texture target for the GL texture. // These can include e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE, and possibly more depending on extensions. -// +// // affine points to a packed 3x3 column-major matrix used to apply an affine transform to texture coordinates. (affine_matrix * vec3(coord_x, coord_y, 1.0)) // After transform, normalized texture coord (0, 0) should be bottom-left and (1, 1) should be top-right (or (width, height) for RECTANGLE). // @@ -796,7 +900,7 @@ struct retro_camera_callback }; // Sets the interval of time and/or distance at which to update/poll location-based data. -// To ensure compatibility with all location-based implementations, values for both +// To ensure compatibility with all location-based implementations, values for both // interval_ms and interval_distance should be provided. // interval_ms is the interval expressed in milliseconds. // interval_distance is the distance interval expressed in meters. @@ -824,7 +928,7 @@ struct retro_location_callback retro_location_start_t start; retro_location_stop_t stop; retro_location_get_position_t get_position; - retro_location_set_interval_t set_interval; + retro_location_set_interval_t set_interval; retro_location_lifetime_status_t initialized; retro_location_lifetime_status_t deinitialized; @@ -889,7 +993,6 @@ typedef void (*retro_hw_context_reset_t)(void); typedef uintptr_t (*retro_hw_get_current_framebuffer_t)(void); // Get a symbol from HW context. -typedef void (*retro_proc_address_t)(void); typedef retro_proc_address_t (*retro_hw_get_proc_address_t)(const char *sym); enum retro_hw_context_type @@ -906,7 +1009,17 @@ enum retro_hw_context_type struct retro_hw_render_callback { enum retro_hw_context_type context_type; // Which API to use. Set by libretro core. - retro_hw_context_reset_t context_reset; // Called when a context has been created or when it has been reset. + + // Called when a context has been created or when it has been reset. + // An OpenGL context is only valid after context_reset() has been called. + // + // When context_reset is called, OpenGL resources in the libretro implementation are guaranteed to be invalid. + // It is possible that context_reset is called multiple times during an application lifecycle. + // If context_reset is called without any notification (context_destroy), + // the OpenGL context was lost and resources should just be recreated + // without any attempt to "free" old resources. + retro_hw_context_reset_t context_reset; + retro_hw_get_current_framebuffer_t get_current_framebuffer; // Set by frontend. retro_hw_get_proc_address_t get_proc_address; // Set by frontend. bool depth; // Set if render buffers should have depth component attached. @@ -917,9 +1030,18 @@ struct retro_hw_render_callback unsigned version_minor; // Minor version number for core GL context. bool cache_context; // If this is true, the frontend will go very far to avoid resetting context in scenarios like toggling fullscreen, etc. - // The reset callback might still be called in extreme situations such as if the context is lost beyond recovery. + // The reset callback might still be called in extreme situations such as if the context is lost beyond recovery. // For optimal stability, set this to false, and allow context to be reset at any time. - retro_hw_context_reset_t context_destroy; // A callback to be called before the context is destroyed. Resources can be deinitialized at this step. This can be set to NULL, in which resources will just be destroyed without any notification. + + retro_hw_context_reset_t context_destroy; // A callback to be called before the context is destroyed in a controlled way by the frontend. + // OpenGL resources can be deinitialized cleanly at this step. + // context_destroy can be set to NULL, in which resources will just be destroyed without any notification. + // + // Even when context_destroy is non-NULL, it is possible that context_reset is called without any destroy notification. + // This happens if context is lost by external factors (such as notified by GL_ARB_robustness). + // In this case, the context is assumed to be already dead, + // and the libretro implementation must not try to free any OpenGL resources in the subsequent context_reset. + bool debug_context; // Creates a debug context. }; @@ -1150,6 +1272,8 @@ void retro_get_system_info(struct retro_system_info *info); void retro_get_system_av_info(struct retro_system_av_info *info); // Sets device to be used for player 'port'. +// By default, RETRO_DEVICE_JOYPAD is assumed to be plugged into all available ports. +// Setting a particular device type is not a guarantee that libretro cores will only poll input based on that particular device type. It is only a hint to the libretro core when a core cannot automatically detect the appropriate input device type on its own. It is also relevant when a core can change its behavior depending on device type. void retro_set_controller_port_device(unsigned port, unsigned device); // Resets the current game. From f0b1641809cd7ff2327f27a04a01f5e620b94cb9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 May 2014 03:20:17 +0200 Subject: [PATCH 12/19] Set RETRO_DEVICE_JOYPAD to "Joypad Auto" --- libretro/libretro.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 0444f88..6da64b5 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -15,14 +15,13 @@ #define RETRO_DEVICE_MDPAD_3B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 0) #define RETRO_DEVICE_MDPAD_6B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1) -#define RETRO_DEVICE_PAD_AUTO RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 2) +#define RETRO_DEVICE_SMSPAD_2B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 2) #define RETRO_DEVICE_PORT_NONE RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 3) -#define RETRO_DEVICE_SMSPAD_2B RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 4) -#define RETRO_DEVICE_MDPAD_3B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 5) -#define RETRO_DEVICE_MDPAD_6B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 6) -#define RETRO_DEVICE_MDPAD_3B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 7) -#define RETRO_DEVICE_MDPAD_6B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 8) -#define RETRO_DEVICE_SMSPAD_4P RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 9) +#define RETRO_DEVICE_MDPAD_3B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 4) +#define RETRO_DEVICE_MDPAD_6B_WAYPLAY RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 5) +#define RETRO_DEVICE_MDPAD_3B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 6) +#define RETRO_DEVICE_MDPAD_6B_TEAMPLAYER RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 7) +#define RETRO_DEVICE_SMSPAD_4P RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 8) #include "shared.h" #include "libretro.h" @@ -750,7 +749,7 @@ void retro_set_environment(retro_environment_t cb) static const struct retro_controller_description port_1[] = { { "MD Joypad 3 Button", RETRO_DEVICE_MDPAD_3B }, { "MD Joypad 6 Button", RETRO_DEVICE_MDPAD_6B }, - { "Joypad Auto", RETRO_DEVICE_PAD_AUTO }, + { "Joypad Auto", RETRO_DEVICE_JOYPAD }, { "Joypad Port Empty", RETRO_DEVICE_PORT_NONE }, { "SMS Joypad 2 Button", RETRO_DEVICE_SMSPAD_2B }, { "MD Joypad 3 Button + WayPlay", RETRO_DEVICE_MDPAD_3B_WAYPLAY }, @@ -758,25 +757,23 @@ void retro_set_environment(retro_environment_t cb) { "MD Joypad 3 Button + Teamplayer", RETRO_DEVICE_MDPAD_3B_TEAMPLAYER }, { "MD Joypad 6 Button + Teamplayer", RETRO_DEVICE_MDPAD_6B_TEAMPLAYER }, { "SMS Joypad 4 Player", RETRO_DEVICE_SMSPAD_4P }, - { "RetroPad", RETRO_DEVICE_JOYPAD }, }; static const struct retro_controller_description port_2[] = { { "MD Joypad 3 Button", RETRO_DEVICE_MDPAD_3B }, { "MD Joypad 6 Button", RETRO_DEVICE_MDPAD_6B }, - { "Joypad Auto", RETRO_DEVICE_PAD_AUTO }, + { "Joypad Auto", RETRO_DEVICE_JOYPAD }, { "Joypad Port Empty", RETRO_DEVICE_PORT_NONE }, { "SMS Joypad 2 Button", RETRO_DEVICE_SMSPAD_2B }, { "MD Joypad 3 Button + WayPlay", RETRO_DEVICE_MDPAD_3B_WAYPLAY }, { "MD Joypad 6 Button + WayPlay", RETRO_DEVICE_MDPAD_6B_WAYPLAY }, { "MD Joypad 3 Button + Teamplayer", RETRO_DEVICE_MDPAD_3B_TEAMPLAYER }, { "MD Joypad 6 Button + Teamplayer", RETRO_DEVICE_MDPAD_6B_TEAMPLAYER }, - { "RetroPad", RETRO_DEVICE_JOYPAD }, }; static const struct retro_controller_info ports[] = { - { port_1, 11 }, - { port_2, 10 }, + { port_1, 10 }, + { port_2, 9 }, { 0 }, }; @@ -815,9 +812,7 @@ void retro_set_controller_port_device(unsigned port, unsigned device) { switch(device) { - case RETRO_DEVICE_JOYPAD: case RETRO_DEVICE_MDPAD_3B: - default: config.input[port].padtype = DEVICE_PAD3B; input.dev[port] = DEVICE_PAD3B; input.system[port] = SYSTEM_GAMEPAD; @@ -827,11 +822,6 @@ void retro_set_controller_port_device(unsigned port, unsigned device) input.dev[port] = DEVICE_PAD6B; input.system[port] = SYSTEM_GAMEPAD; break; - case RETRO_DEVICE_PAD_AUTO: - config.input[port].padtype = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; - input.dev[port] = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; - input.system[port] = SYSTEM_GAMEPAD; - break; case RETRO_DEVICE_PORT_NONE: config.input[port].padtype = 0; input.dev[port] = 0; @@ -867,6 +857,12 @@ void retro_set_controller_port_device(unsigned port, unsigned device) input.dev[port] = DEVICE_PAD2B; input.system[0] = SYSTEM_MS4PLAY; break; + case RETRO_DEVICE_JOYPAD: + default: + config.input[port].padtype = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; + input.dev[port] = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; + input.system[port] = SYSTEM_GAMEPAD; + break; } input_init(); From 693ce4d78fd832981eb1efb9207c532e9325d4de Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 8 May 2014 02:32:39 +0200 Subject: [PATCH 13/19] Do AV change only for vertical resolution changes - RETRO_SET_SYSTEM_AV_INFO is way too expensive to be abused like this - this is causing flashing in fullscreen mode for some video drivers --- libretro/libretro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 6da64b5..1c4aa6e 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -475,7 +475,7 @@ static bool update_viewport(void) vheight = vheight * 2; } - return ((ow != vwidth) || (oh != vheight)); + return (oh != vheight); } static void check_variables(void) From 7cfe8b409779a5169f63f288af51be6e122682bd Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 23 Jun 2014 15:03:17 +0200 Subject: [PATCH 14/19] Set performance level --- libretro/libretro.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libretro/libretro.c b/libretro/libretro.c index 1c4aa6e..e4bb026 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -1009,6 +1009,12 @@ size_t retro_get_memory_size(unsigned id) } } +static void check_system_specs(void) +{ + unsigned level = 7; + environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level); +} + void retro_init(void) { struct retro_log_callback log; @@ -1033,6 +1039,7 @@ void retro_init(void) if (log_cb) log_cb(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n"); #endif + check_system_specs(); } void retro_deinit(void) From 1103246f92e792832a9ea198e1ffdadd2391ddc5 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Mon, 14 Jul 2014 22:44:17 -0300 Subject: [PATCH 15/19] Added debian folder from hunterk PPA, updated packaging and fixed lintian errors. --- debian/changelog | 14 ++++ debian/compat | 1 + debian/control | 16 +++++ debian/copyright | 60 +++++++++++++++++ debian/dirs | 1 + debian/genesis_plus_gx_libretro.info | 34 ++++++++++ debian/libretro-genesisplusgx.postinst | 9 +++ debian/rules | 90 ++++++++++++++++++++++++++ debian/source/format | 1 + 9 files changed, 226 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/genesis_plus_gx_libretro.info create mode 100755 debian/libretro-genesisplusgx.postinst create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..024eefa --- /dev/null +++ b/debian/changelog @@ -0,0 +1,14 @@ +libretro-genesisplusgx (1.7.4-0ubuntu3) UNRELEASED; urgency=low + + * Updated to latest git. + * Debian folder from hunterk PPA to upstream + * Updated debian package and fixed lintian errors/warnings + + -- Sergio Benjamim Mon, 14 Jul 2014 22:40:00 -0300 + + +libretro-genesisplusgx (1.7.4-0ubuntu2) UNRELEASED; urgency=low + + * Updated to latest git. + + -- Hunter Kaller (hizzlekizzle) Wed, 12 Mar 2014 13:24:59 -0500 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..ed32002 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: libretro-genesisplusgx +Section: otherosfs +Priority: extra +Maintainer: Hunter Kaller (hizzlekizzle) +Build-Depends: debhelper (>= 9), zlib1g-dev +Standards-Version: 3.9.5 +Homepage: https://code.google.com/p/genplus-gx/ +Vcs-Git: git://github.com/libretro/Genesis-Plus-GX.git +Vcs-Browser: https://github.com/libretro/Genesis-Plus-GX + +Package: libretro-genesisplusgx +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Libretro wrapper for Genesis Plus GX. + This wrapper makes Genesis Plus GX API compatible with libretro, + thus allowing its use with libretro frontends, such as RetroArch. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..7b3af4a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,60 @@ +This package was debianized by Hunter Kaller (hizzlekizzle) on +Tue, 14 Apr 2010 11:03:43 -0500. + +It was downloaded from https://github.com/libretro/Genesis-Plus-GX.git + +Upstream Authors: + + Genesis Plus GX development team + Hans-Kristian Arntzen (Themaister) + Daniel De Matteis (Squarepusher aka twinaphex) + +Copyright: + + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles MacDonald + Some portions copyright Nicola Salmoria and the MAME team + All rights reserved. + Copyright (c) 2007-2013 Eke-Eke + All rights reserved. + +License: + + Unless otherwise explicitly stated, all code in Genesis Plus GX is released + under the following license: + . + Redistribution and use of this code or any derivative works are permitted + provided that the following conditions are met: + . + * Redistributions may not be sold, nor may they be used in a commercial + product or activity. + . + * Redistributions that are modified from the original source must include the + complete source code, including the source code for all components used by a + binary built from the modified sources. However, as a special exception, the + source code distributed need not include anything that is normally distributed + (in either source or binary form) with the major components (compiler, kernel, + and so on) of the operating system on which the executable runs, unless that + component itself accompanies the executable. + . + * Redistributions must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other + materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +The Debian packaging is: + + Copyright (C) 2009 Hunter Kaller (hizzlekizzle) + +and is licensed under the GPL version 3, +see `/usr/share/common-licenses/GPL-3'. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..0b66d81 --- /dev/null +++ b/debian/dirs @@ -0,0 +1 @@ +usr/lib/libretro diff --git a/debian/genesis_plus_gx_libretro.info b/debian/genesis_plus_gx_libretro.info new file mode 100644 index 0000000..8e1aff0 --- /dev/null +++ b/debian/genesis_plus_gx_libretro.info @@ -0,0 +1,34 @@ +display_name = "Sega MS/GG/MD/CD (Genesis Plus GX)" +authors = "Charles McDonald|Eke-Eke" +supported_extensions = "mdx|md|smd|gen|bin|cue|iso|sms|gg|sg" +corename = "Genesis Plus GX" +manufacturer = "Sega" +systemname = "Sega 8/16bit (Various)" +license = "Non-commercial" +permissions = "" +display:version = "v1.7.4" +need_fullpath = "true" +block_extract = "false" +supports_no_game = "false" +firmware_count = 7 +firmware0_desc = "bios_CD_E.bin (MegaCD EU BIOS)" +firmware0_path = "bios_CD_E.bin" +firmware0_opt = "false" +firmware1_desc = "bios_CD_U.bin (SegaCD US BIOS)" +firmware1_path = "bios_CD_U.bin" +firmware1_opt = "false" +firmware2_desc = "bios_CD_J.bin (MegaCD JP BIOS)" +firmware2_path = "bios_CD_J.bin" +firmware2_opt = "false" +firmware3_desc = "bios_E.sms (MasterSystem EU BIOS)" +firmware3_path = "bios_E.sms" +firmware3_opt = "true" +firmware4_desc = "bios_U.sms (MasterSystem US BIOS)" +firmware4_path = "bios_U.sms" +firmware4_opt = "true" +firmware5_desc = "bios_J.sms (MasterSystem JP BIOS)" +firmware5_path = "bios_J.sms" +firmware5_opt = "true" +firmware6=desc = "bios.gg (GameGear BIOS)" +firmware6_path = "bios.gg" +firmware6_opt = "true" diff --git a/debian/libretro-genesisplusgx.postinst b/debian/libretro-genesisplusgx.postinst new file mode 100755 index 0000000..f41a197 --- /dev/null +++ b/debian/libretro-genesisplusgx.postinst @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +update-alternatives --install /usr/lib/libretro.so libretro /usr/lib/libretro/genesis_plus_gx_libretro.so 10 + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..7c58407 --- /dev/null +++ b/debian/rules @@ -0,0 +1,90 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + touch configure-stamp + +build: build-arch build-indep + +build-arch: build-stamp + +build-indep: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) -f Makefile.libretro + #docbook-to-man debian/libretro-genesisplusgx.sgml > libretro-genesisplusgx + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) -f Makefile.libretro clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + # Add here commands to install the package into debian/libretro-genesisplusgx. + cp genesis_plus_gx_libretro.so $(CURDIR)/debian/libretro-genesisplusgx/usr/lib/libretro/ + cp $(CURDIR)/debian/genesis_plus_gx_libretro.info $(CURDIR)/debian/libretro-genesisplusgx/usr/lib/libretro/ + +# Build architecture-independent files here. +binary-indep: install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs +# dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo +# dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) From d8c1ac61857e14f781e38d78d7ed9ed280533964 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Tue, 15 Jul 2014 00:52:55 -0300 Subject: [PATCH 16/19] fixed copyright --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index 7b3af4a..b7da73c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,7 @@ This package was debianized by Hunter Kaller (hizzlekizzle) on Tue, 14 Apr 2010 11:03:43 -0500. -It was downloaded from https://github.com/libretro/Genesis-Plus-GX.git +It was downloaded from Upstream Authors: From d6fe4325c5e4f70d18abbdf0bd3f493aeff09a33 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 18 Jul 2014 02:12:14 +0200 Subject: [PATCH 17/19] Revert "Going to just use MSB_FIRST or LSB_FIRST here as an ifdef - this" This reverts commit 167ec024254e806a1a7298ff8a4f78051d2f9200. --- core/tremor/misc.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/tremor/misc.h b/core/tremor/misc.h index c4a70c7..cb6dfcc 100644 --- a/core/tremor/misc.h +++ b/core/tremor/misc.h @@ -37,7 +37,10 @@ #include #endif -#if defined(LSB_FIRST) +#if !defined(__LIBRETRO__) && defined(GEKKO) +#ifndef __CELLOS_LV2__ +#ifndef _XBOX360 +#if BYTE_ORDER==LITTLE_ENDIAN union magic { struct { ogg_int32_t lo; @@ -45,7 +48,13 @@ union magic { } halves; ogg_int64_t whole; }; -#elif defined(MSB_FIRST) +#endif +#endif +#endif +#endif + +#ifndef ANDROID +#if BYTE_ORDER==BIG_ENDIAN union magic { struct { ogg_int32_t hi; @@ -54,6 +63,7 @@ union magic { ogg_int64_t whole; }; #endif +#endif STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { union magic magic; From b82a58cf8fe509a864504093620a7a16f1d629d0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 18 Jul 2014 02:12:31 +0200 Subject: [PATCH 18/19] Revert "Define MSB_FIRST for Xbox 360" This reverts commit 97d0e566502dacdfae7fe1c2f1bddc6973cdfebb. --- Makefile.libretro | 2 +- libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 62b7646..472a6ce 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -103,7 +103,7 @@ else ifeq ($(platform), psl1ght) TARGET := $(TARGET_NAME)_libretro_psl1ght.a$(EXE_EXT) CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) - PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER STATIC_LINKING = 1 else ifeq ($(platform), psp1) TARGET := $(TARGET_NAME)_libretro_psp1.a$(EXE_EXT) diff --git a/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj b/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj index 7bb1e32..d1476bf 100644 --- a/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj +++ b/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj @@ -257,7 +257,7 @@ false $(OutDir)$(ProjectName).pch MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST + _DEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -278,7 +278,7 @@ false $(OutDir)$(ProjectName).pch MultiThreadedDebug - _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST + _DEBUG;_XBOX;_XBOX360;_LIB;%(PreprocessorDefinitions);INLINE=static _inline;__attribute__=;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -300,7 +300,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST + NDEBUG;_XBOX;_XBOX360;PROFILE;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN Callcap $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -326,7 +326,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST + NDEBUG;_XBOX;_XBOX360;PROFILE;FASTCAP;_LIB;__LIBRETRO__;USE_16BPP_RENDERING;INLINE=static _inline;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -349,7 +349,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST + NDEBUG;_XBOX;_XBOX360;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -372,7 +372,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN;MSB_FIRST + NDEBUG;_XBOX;_XBOX360;LTCG;_LIB;INLINE=static _inline;__inline__=_inline;__extension__=;USE_16BPP_RENDERING;__LIBRETRO__;FRONTEND_SUPPORTS_RGB565;%(PreprocessorDefinitions);USE_LIBTREMOR;BYTE_ORDER=BIG_ENDIAN $(SolutionDir)\..\..\core;$(SolutionDir)\..\..\core\cd_hw;$(SolutionDir)\..\..\core\cart_hw;$(SolutionDir)\..\..\core\sound;$(SolutionDir)\..\..\core\z80;$(SolutionDir)\..\..\core\m68k;$(SolutionDir)\..\..\core\input_hw;$(SolutionDir)\..\..\core\cart_hw\svp;$(SolutionDir)\..\..\core\ntsc;$(SolutionDir)\..\;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) CompileAsC @@ -385,4 +385,4 @@ - + \ No newline at end of file From b264a22b53e552a6db742306fd044b4c7e2dac0a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 18 Jul 2014 17:35:40 +0200 Subject: [PATCH 19/19] Cleanups --- Makefile.libretro | 12 ++++++------ {debian => libretro/debian}/changelog | 0 {debian => libretro/debian}/compat | 0 {debian => libretro/debian}/control | 0 {debian => libretro/debian}/copyright | 0 {debian => libretro/debian}/dirs | 0 .../debian}/genesis_plus_gx_libretro.info | 0 .../debian}/libretro-genesisplusgx.postinst | 0 {debian => libretro/debian}/rules | 0 {debian => libretro/debian}/source/format | 0 10 files changed, 6 insertions(+), 6 deletions(-) rename {debian => libretro/debian}/changelog (100%) rename {debian => libretro/debian}/compat (100%) rename {debian => libretro/debian}/control (100%) rename {debian => libretro/debian}/copyright (100%) rename {debian => libretro/debian}/dirs (100%) rename {debian => libretro/debian}/genesis_plus_gx_libretro.info (100%) rename {debian => libretro/debian}/libretro-genesisplusgx.postinst (100%) rename {debian => libretro/debian}/rules (100%) rename {debian => libretro/debian}/source/format (100%) diff --git a/Makefile.libretro b/Makefile.libretro index 472a6ce..335990d 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -55,7 +55,7 @@ else ifeq ($(platform), osx) fpic := -fPIC SHARED := -dynamiclib -lz ifeq ($(arch),ppc) - ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN else ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN endif @@ -91,13 +91,13 @@ else ifeq ($(platform), ps3) TARGET := $(TARGET_NAME)_libretro_ps3.a CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe - PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), sncps3) TARGET := $(TARGET_NAME)_libretro_ps3.a CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe - PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), psl1ght) TARGET := $(TARGET_NAME)_libretro_psl1ght.a$(EXE_EXT) @@ -118,13 +118,13 @@ else ifeq ($(platform), xenon) CC = xenon-gcc$(EXE_EXT) AR = xenon-ar$(EXE_EXT) PLATFORM_DEFINES := -D__LIBXENON__ -DALT_RENDER - ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifeq ($(platform), ngc) TARGET := $(TARGET_NAME)_libretro_ngc.a CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) - ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN PLATFORM_DEFINES := -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER STATIC_LINKING = 1 else ifeq ($(platform), wii) @@ -132,7 +132,7 @@ else ifeq ($(platform), wii) CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) PLATFORM_DEFINES := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER - ENDIANNESS_DEFINES := -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN + ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN STATIC_LINKING = 1 else ifneq (,$(findstring armv,$(platform))) TARGET := $(TARGET_NAME)_libretro.so diff --git a/debian/changelog b/libretro/debian/changelog similarity index 100% rename from debian/changelog rename to libretro/debian/changelog diff --git a/debian/compat b/libretro/debian/compat similarity index 100% rename from debian/compat rename to libretro/debian/compat diff --git a/debian/control b/libretro/debian/control similarity index 100% rename from debian/control rename to libretro/debian/control diff --git a/debian/copyright b/libretro/debian/copyright similarity index 100% rename from debian/copyright rename to libretro/debian/copyright diff --git a/debian/dirs b/libretro/debian/dirs similarity index 100% rename from debian/dirs rename to libretro/debian/dirs diff --git a/debian/genesis_plus_gx_libretro.info b/libretro/debian/genesis_plus_gx_libretro.info similarity index 100% rename from debian/genesis_plus_gx_libretro.info rename to libretro/debian/genesis_plus_gx_libretro.info diff --git a/debian/libretro-genesisplusgx.postinst b/libretro/debian/libretro-genesisplusgx.postinst similarity index 100% rename from debian/libretro-genesisplusgx.postinst rename to libretro/debian/libretro-genesisplusgx.postinst diff --git a/debian/rules b/libretro/debian/rules similarity index 100% rename from debian/rules rename to libretro/debian/rules diff --git a/debian/source/format b/libretro/debian/source/format similarity index 100% rename from debian/source/format rename to libretro/debian/source/format