diff --git a/.gitignore b/.gitignore index 28188376c9..637caa2cd6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ .tmp .tmp.c .tmp.cxx +.moc.h +.moc.cpp config.log /.project /.externalToolBuilders/ @@ -74,6 +76,7 @@ libretro-super run.sh convert_rumble.awk *~ +assets # Wii U *.depend @@ -119,7 +122,6 @@ wiiu/wut/elf2rpl/elf2rpl /media/libretrodb/ pkg/apple/iOS/build/ -pkg/apple/iOS/modules/ pkg/apple/build/ ui/drivers/qt/moc_* ui/drivers/moc_* @@ -163,3 +165,13 @@ retroarch_switch.lst retroarch_switch.nacp retroarch_switch.nro retroarch_switch.nso + +# Wayland +gfx/common/wayland/idle-inhibit-unstable-v1.c +gfx/common/wayland/idle-inhibit-unstable-v1.h +gfx/common/wayland/xdg-shell-unstable-v6.c +gfx/common/wayland/xdg-shell-unstable-v6.h +gfx/common/wayland/xdg-decoration-unstable-v1.h +gfx/common/wayland/xdg-decoration-unstable-v1.c +gfx/common/wayland/xdg-shell.c +gfx/common/wayland/xdg-shell.h diff --git a/.travis.yml b/.travis.yml index 82072d146a..7be5f133d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,9 @@ matrix: - g++-mingw-w64-i686 - mingw-w64-i686-dev script: - - CROSS_COMPILE=i686-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501" ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 && make HAVE_ZLIB=1 HAVE_BUILTINZLIB=1 HAVE_RPNG=1 + - ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 --enable-builtinzlib + - make + env: CROSS_COMPILE=i686-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501" - compiler: mingw-x64 addons: apt: @@ -18,41 +20,33 @@ matrix: - g++-mingw-w64-x86-64 - mingw-w64-x86-64-dev script: - - CROSS_COMPILE=x86_64-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501" ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 && make HAVE_ZLIB=1 HAVE_BUILTINZLIB=1 HAVE_RPNG=1 + - ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 --enable-builtinzlib + - make + env: CROSS_COMPILE=x86_64-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501" - compiler: gcc - addons: - # Install a more recent gcc than the default - apt: - packages: - - g++-7 - sources: - - ubuntu-toolchain-r-test + # Install a more recent gcc than the default + before_install: + - sudo apt-get install -y g++-8 + env: CC=gcc-8 CXX=g++-8 - compiler: clang - addons: - # Install a more recent clang than the default - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: COMPILER_NAME=clang-3.8 CXX=clang++-3.8 CC=clang-3.8 + # Install a more recent clang than the default + before_install: + - sudo apt-get install -y libstdc++-7-dev + - sudo apt-get install -y clang-6.0 + env: CC=clang-6.0 CXX=clang++-6.0 - os: osx - osx_image: xcode7.3 + osx_image: xcode8 script: - - xcodebuild -target RetroArch -configuration Release -project pkg/apple/RetroArch.xcodeproj + - xcodebuild -target RetroArch -configuration Release -project pkg/apple/RetroArch.xcodeproj - os: osx - osx_image: xcode9.3 + osx_image: xcode10.1 script: - - cd ~/ - brew install --force-bottle qt5 - - git clone --depth=50 https://github.com/libretro/libretro-super - - cd libretro-super/travis - - ./build-retroarch-metal.sh + - xcodebuild -target RetroArchQt -configuration Release -project pkg/apple/RetroArch_Metal.xcodeproj deploy: skip_cleanup: true provider: script - script: cd ../retroarch; bash travis_metal_deploy.sh + script: bash travis_metal_deploy.sh on: branch: master @@ -67,19 +61,13 @@ env: addons: apt: packages: - - curl - - pkg-config - - libglu1-mesa-dev - - freeglut3-dev - - mesa-common-dev - - libsdl1.2-dev - - libsdl-image1.2-dev - - libsdl-mixer1.2-dev - - libsdl-ttf2.0-dev + - libsdl2-dev - libusb-1.0-0-dev - - qt5-default - - qt5-qmake - - qtbase5-dev-tools + - qtbase5-dev + - qtdeclarative5-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-6.0 coverity_scan: project: name: "RetroArch" diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 2e6b11d97a..eec6a8bb70 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -29,7 +29,9 @@ "includePath": [ "/usr/include", "/usr/local/include", - "${workspaceRoot}" + "${workspaceRoot}", + "${workspaceFolder}/libretro-common/include", + "${workspaceRoot}/libretro-common/include" ], "defines": [], "intelliSenseMode": "clang-x64", @@ -50,7 +52,8 @@ "C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/ucrt", "C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/shared", "C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/winrt", - "${workspaceRoot}" + "${workspaceRoot}", + "${workspaceFolder}/libretro-common/include" ], "defines": [ "_DEBUG", diff --git a/.vscode/launch.json b/.vscode/launch.json index e7552247cc..d55f87de4e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -13,7 +13,7 @@ "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], - "externalConsole": false, + "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe", "setupCommands": [ diff --git a/.vscode/settings.json b/.vscode/settings.json index 148f4b83ea..386e8341f9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "terminal.integrated.cursorBlinking": true, "editor.tabSize": 3, + "editor.detectIndentation": false, "editor.renderWhitespace": "all", "editor.insertSpaces": true, "files.associations": { @@ -22,7 +23,26 @@ "ios": "c", "list": "c", "input_driver.h": "c", - "video_driver.h": "c" + "video_driver.h": "c", + "menu_driver.h": "c", + "file_path.h": "c", + "unordered_map": "c", + "unordered_set": "c", + "sstream": "cpp", + "hash_map": "c", + "hash_set": "c", + "initializer_list": "c", + "string_view": "c", + "utility": "c", + "menu_input.h": "c", + "tasks_internal.h": "c", + "ozone.h": "c", + "ozone_theme.h": "c", + "ozone_texture.h": "c", + "string_list.h": "c", + "core_info.h": "c" + "thread": "c", + "xlocale": "c" }, "C_Cpp.dimInactiveRegions": false, } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b271c66e8f..a90e515b1b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,12 +4,49 @@ "version": "2.0.0", "tasks": [ { - "taskName": "msys2-mingw64 build", + "label": "linux clean build", + "type": "shell", + "group": "build", + "command": "make clean && ./configure && make -j12" + }, + { + "label": "linux clean", + "type": "shell", + "group": "build", + "command": "make clean" + }, + { + "label": "linux build with debug symbols", + "type": "shell", + "group": "build", + "command": "DEBUG=1 make -j12" + }, + { + "label": "linux build", + "type": "shell", + "group": "build", + "command": "make -j12" + }, + { + "label": "linux build and run", + "type": "shell", + "group": "build", + "command": "make -j12 && ./retroarch -v" + }, + { + "label": "linux build and run with debug symbols", + "type": "shell", + "group": "build", + "command": "DEBUG=1 make -j12 && ./retroarch -v" + }, + { + "label": "msys2-mingw64 build", "type": "shell", "group": { "kind": "build", - "isDefault": true }, + "isDefault": true + }, "command": "./configure; make -j2", "options": { @@ -20,9 +57,9 @@ ] } } - } + }, { - "taskName": "msys2-mingw64 build with debug symbols", + "label": "msys2-mingw64 build with debug symbols", "type": "shell", "group": "build", @@ -36,9 +73,9 @@ ] } } - } + }, { - "taskName": "msys2-mingw64 rebuild", + "label": "msys2-mingw64 rebuild", "type": "shell", "group": "build", @@ -52,9 +89,9 @@ ] } } - } + }, { - "taskName": "msys2-mingw64 clean", + "label": "msys2-mingw64 clean", "type": "shell", "group": "build", @@ -68,9 +105,9 @@ ] } } - } + }, { - "taskName": "msys2-mingw64 run", + "label": "msys2-mingw64 run", "type": "shell", "group": { diff --git a/10bpc-gl.diff b/10bpc-gl.diff new file mode 100644 index 0000000000..9436f12f82 --- /dev/null +++ b/10bpc-gl.diff @@ -0,0 +1,96 @@ +diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c +index b90a8e40c3..e57c4df194 100644 +--- a/gfx/drivers_context/wgl_ctx.c ++++ b/gfx/drivers_context/wgl_ctx.c +@@ -78,6 +78,47 @@ + #ifndef WGL_CONTEXT_DEBUG_BIT_ARB + #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 + #endif ++ ++#ifndef WGL_ACCELERATION_ARB ++#define WGL_ACCELERATION_ARB 0x2003 ++#endif ++ ++#ifndef WGL_FULL_ACCELERATION_ARB ++#define WGL_FULL_ACCELERATION_ARB 0x2027 ++#endif ++ ++#ifndef WGL_DRAW_TO_WINDOW_ARB ++#define WGL_DRAW_TO_WINDOW_ARB 0x2001 ++#endif ++ ++#ifndef WGL_DOUBLE_BUFFER_ARB ++#define WGL_DOUBLE_BUFFER_ARB 0x2011 ++#endif ++ ++#ifndef WGL_RED_BITS_ARB ++#define WGL_RED_BITS_ARB 0x2015 ++#endif ++ ++#ifndef WGL_GREEN_BITS_ARB ++#define WGL_GREEN_BITS_ARB 0x2017 ++#endif ++ ++#ifndef WGL_BLUE_BITS_ARB ++#define WGL_BLUE_BITS_ARB 0x2019 ++#endif ++ ++#ifndef WGL_ALPHA_BITS_ARB ++#define WGL_ALPHA_BITS_ARB 0x201B ++#endif ++ ++#ifndef WGL_PIXEL_TYPE_ARB ++#define WGL_PIXEL_TYPE_ARB 0x2013 ++#endif ++ ++#ifndef WGL_TYPE_RGBA_ARB ++#define WGL_TYPE_RGBA_ARB 0x202B ++#endif ++ + #endif + + #if defined(HAVE_OPENGL) +@@ -313,6 +354,43 @@ static void create_gl_context(HWND hwnd, bool *quit) + RARCH_LOG("[WGL]: Adaptive VSync supported.\n"); + wgl_adaptive_vsync = true; + } ++ if (wgl_has_extension("WGL_ARB_pixel_format", extensions)) ++ { ++ BOOL (WINAPI * wglChoosePixelFormatARB) ++ (HDC hdc, ++ const int *piAttribIList, ++ const FLOAT *pfAttribFList, ++ UINT nMaxFormats, ++ int *piFormats, ++ UINT *nNumFormats); ++ UINT nMatchingFormats; ++ int index = 0; ++ int attribsDesired[] = { ++ WGL_DRAW_TO_WINDOW_ARB, 1, ++ WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB, ++ WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, ++ WGL_RED_BITS_ARB, 10, ++ WGL_GREEN_BITS_ARB, 10, ++ WGL_BLUE_BITS_ARB, 10, ++ WGL_ALPHA_BITS_ARB, 2, ++ WGL_DOUBLE_BUFFER_ARB, 1, ++ 0,0 ++ }; ++ wglChoosePixelFormatARB = (BOOL (WINAPI *) (HDC, const int *, ++ const FLOAT*, UINT, int*, UINT*)) ++ gfx_ctx_wgl_get_proc_address("wglChoosePixelFormatARB"); ++ ++ RARCH_LOG("[WGL]: ARB pixel format supported.\n"); ++ ++ if (wglChoosePixelFormatARB(win32_hdc, attribsDesired, ++ NULL, 1, &index, &nMatchingFormats)) ++ { ++ if (nMatchingFormats == 0) ++ { ++ RARCH_WARN("No 10bpc WGL_ARB_pixel_formats found!\n"); ++ } ++ } ++ } + } + } + #endif diff --git a/AUTHORS.h b/AUTHORS.h index a7f3298fb4..c9eee84309 100644 --- a/AUTHORS.h +++ b/AUTHORS.h @@ -25,6 +25,7 @@ Amiga1200Gamer (amigagamer) Andre Leiradella (leiradel) Andrés (fr500) Anthony J. Bentley (bentley) +Antonio Jose Ramos Marquez (psxdev) AridRayne Arto Vainiolehto (arakerlu) asako (asakous) @@ -94,6 +95,7 @@ FIX94 Flame Sage (chris062689) flyinghead Francisco José García García (frangarcj) +Francisco Javier Trujillo Mata (fjtrujy) GameDragon2k Garrett Brown (garbear) gblues @@ -141,6 +143,7 @@ JuanVCS Justin Jacobs (dorkster) Justin Weiss (justinweiss) Ken Rossato (rossato) +Krzysztof Haładyn (krzys_h) kurumushi kwyxz l3iggs diff --git a/CHANGES.md b/CHANGES.md index 01287f3df7..d5b8122b4d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,17 +1,79 @@ -# 1.7.6 (future) +# 1.7.7 (future) + +# 1.7.6 +- ANDROID: Fix Xperia Play input binding. +- CHEEVOS: Reset when hardcore mode is toggled. +- CHEEVOS: Update the hashing methods to identify NES, SNES and Lynx games (more accurate and accepting headerless ROMs). +- COMMON: Add new JSON playlist format. +- COMMON: Fix playlist corruption when deleting items. +- COMMON: Fix archive progress display calculation. +- COMMON: Fix playlist entries appearing with previously used names. +- COMMON: Fix screenshot filename with no core or content. +- COMMON: Allow compiling without menu support. +- CORE UPDATER: Allow sideloading cores from the menu. +- CPU FILTERS: Add Normal2x filter. +- CRT/LINUX: New Linux switching method partially implemented. +- CRT/LINUX: Linux restore desktop resolution fixed. +- CRT/LINUX: Monitor index switching and auto enumerate for output detection in Linux (still working on the windows method). +- CRT/RASPBERRY PI: Initial support. - DATE: Add Date / Time style options. -- MIDI: Add a Linux ALSA driver for MIDI. +- DEBUGGING: Add an integrated crash handler for debug builds (see https://docs.libretro.com/tech/debugging) +- DISCORD: Register the application name properly. +- DISK CONTROL: Remember the last used folder / current active folder to make disk-swapping faster. +- INPUT: Add new menu toggle (hold start button for 2 seconds) +- INPUT: Fix arrow keys being incorrectly bound as numpad keys +- INPUT/SDL: Flush the joypad events. Decreases cpu usage over time with the SDL joypad driver. - LOCALIZATION: Add Greek translation. - LOCALIZATION: Update German translation. - LOCALIZATION: Update Italian translation. -- LOCALIZATION: Update Simplified Chinese translation. - LOCALIZATION: Update Japanese translation. +- LOCALIZATION: Update Simplified Chinese translation. +- LOCALIZATION: Update Spanish translation. +- MENU: New "ozone" menu driver. +- MENU: Only show CRT SwitchRes if video display server is implemented (Windows/Linux for now) +- MENU: User Interface -> Appearance -> 'Menu Font Green/Blue Color' settings now work properly. +- MENU: Add option to enable in-menu sound effects. +- MENU/D3D: Scissoring support (will be used for Ozone and menu widgets). +- MENU/QT/WIMP: Allow building with MSVC2017. +- MENU/QT/WIMP: Add detailed file browser table. +- MENU/QT/WIMP: New grid view implementation that is faster and loads thumbnails on-demand. +- MENU/QT/WIMP: Thumbnail drag and drop support. +- MENU/RGUI: Overhaul custom theme interface + add wallpaper support. +- MENU/RGUI: Thumbnail support and thumbnail downscaling. +- MENU: Hide password values. +- MENU/SOUNDS: Implement in-menu sound effects (not enabled by default for now, still experimental). +- MIDI: Add a Linux ALSA driver for MIDI. +- NETPLAY: Force fast-save-states when netplay is enabled. +- NETPLAY: Allow quick joining subsystem lobbies. +- OSX: Initial CoreAudio V3 audio driver (not yet used in release builds). +- OSX: OpenGL 3.2 Core support for cores. +- PS2: Initial PlayStation2 port. +- PS4: Initial PlayStation4 port. +- RECORDING: Implement recording options in the menu complete with quality profiles, streaming, and proper file naming - SCANNER: Fix GDI disc scanning. +- SHADERS: Fix auto shader preset loading on D3D10, D3D11, D3D12 +- SUBSYSTEM: Allow more than 10 subsystems +- SUBSYSTEM: Cores that use subsystem for complex scenarios can now load content without starting a regular content first +- SUBSYSTEM: Remember the last used folder to make loading subsystem type content faster - SWITCH/LIBNX: Improve touch scaling calculation. - SWITCH: Proper button labels. +- TVOS: Initial tvOS port. - VULKAN: Fix RGUI crashing at startup. -- WINDOWS/WSA: Network Information info is blank until first network operation. +- VULKAN/RGUI: Enable 'Menu Linear Filter' option. +- VULKAN: Fix secondary screens in overlays not working. +- WAYLAND: Implement idle-inhibit support (needed for screensaver suspend). +- WAYLAND: Fix fullscreen toggle. - WIIU: Initial netplay peer-to-peer support. Network information working. +- WINDOWS/WSA: Network Information info is blank until first network operation. +- WINDOWS: Fix an ancient bug that caused wrong mappings for keyboard arrows. +- WINDOWS: Remember window size and position if so desired. +- WINDOWS: SSL/TLS connections now work properly. +- WINDOWS: Fall back to GDI driver if no accelerated graphics driver is found. +- UWP: Initial UWP port. +- VFS: Update to version 3. +- XBONE: Initial Xbox One port. +- XMB/OZONE: Add more icons. +- ???: Easter Egg. # 1.7.5 - CAMERA: Fix Video4Linux2 driver that broke years ago. diff --git a/Makefile b/Makefile index 7e66bdb181..9f457d9503 100644 --- a/Makefile +++ b/Makefile @@ -16,26 +16,36 @@ include config.mk TARGET = retroarch +OBJ := +LIBS := +DEF_FLAGS := +ASFLAGS := +DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 +DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"' + OBJDIR_BASE := obj-unix ifeq ($(DEBUG), 1) OBJDIR := $(OBJDIR_BASE)/debug + CFLAGS ?= -O0 -g + CXXFLAGS ?= -O0 -g + DEFINES += -DDEBUG -D_DEBUG else OBJDIR := $(OBJDIR_BASE)/release + CFLAGS ?= -O3 + CXXFLAGS ?= -O3 + DEF_FLAGS += -ffast-math endif -OBJ := -LIBS := -DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"' - ifneq ($(findstring BSD,$(OS)),) - CFLAGS += -DBSD + DEF_FLAGS += -DBSD LDFLAGS += -L/usr/local/lib + UDEV_CFLAGS += -I/usr/local/include/libepoll-shim + UDEV_LIBS += -lepoll-shim endif ifneq ($(findstring DOS,$(OS)),) - CFLAGS += -march=i386 + DEF_FLAGS += -march=i386 LDFLAGS += -lemu endif @@ -75,21 +85,19 @@ ifneq ($(V),1) Q := @ endif -ifeq ($(DEBUG), 1) - OPTIMIZE_FLAG = -O0 -g - DEFINES += -DDEBUG -D_DEBUG -else - OPTIMIZE_FLAG = -O3 -ffast-math +ifeq ($(HAVE_DRMINGW), 1) + DEF_FLAGS += -DHAVE_DRMINGW + LDFLAGS += $(DRMINGW_LIBS) endif ifneq ($(findstring Win32,$(OS)),) LDFLAGS += -mwindows endif -CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb +DEF_FLAGS += -Wall $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb -APPEND_CFLAGS := $(CFLAGS) -CXXFLAGS += $(APPEND_CFLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS +CFLAGS += $(DEF_FLAGS) +CXXFLAGS += $(DEF_FLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS ifeq ($(HAVE_CXX), 1) @@ -164,7 +172,7 @@ all: $(TARGET) config.mk $(MOC_SRC): @$(if $(Q), $(shell echo echo MOC $<),) $(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@)) - $(Q)$(MOC) -o $(MOC_TMP) $< + $(Q)QT_SELECT=$(QT_VERSION) $(MOC) -o $(MOC_TMP) $< $(foreach x,$(join $(addsuffix :,$(MOC_SRC)),$(MOC_HEADERS)),$(eval $x)) @@ -243,12 +251,24 @@ install: $(TARGET) chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch.6 chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch-cg2glsl.6 chmod 644 $(DESTDIR)$(DATA_DIR)/pixmaps/retroarch.svg - @if test -d media/assets; then \ + @if test -d media/assets && test $(HAVE_ASSETS); then \ echo "Installing media assets..."; \ - mkdir -p $(DESTDIR)$(ASSETS_DIR)/assets/xmb; \ - mkdir -p $(DESTDIR)$(ASSETS_DIR)/assets/glui; \ - cp -r media/assets/xmb/ $(DESTDIR)$(ASSETS_DIR)/assets; \ - cp -r media/assets/glui/ $(DESTDIR)$(ASSETS_DIR)/assets; \ + mkdir -p $(DESTDIR)$(ASSETS_DIR)/assets; \ + if test $(HAVE_ZARCH) = 1; then \ + cp -r media/assets/zarch/ $(DESTDIR)$(ASSETS_DIR)/assets; \ + fi; \ + if test $(HAVE_MATERIALUI) = 1; then \ + cp -r media/assets/glui/ $(DESTDIR)$(ASSETS_DIR)/assets; \ + fi; \ + if test $(HAVE_NUKLEAR) = 1; then \ + cp -r media/assets/nuklear/ $(DESTDIR)$(ASSETS_DIR)/assets; \ + fi; \ + if test $(HAVE_XMB) = 1; then \ + cp -r media/assets/xmb/ $(DESTDIR)$(ASSETS_DIR)/assets; \ + fi; \ + if test $(HAVE_OZONE) = 1; then \ + cp -r media/assets/ozone/ $(DESTDIR)$(ASSETS_DIR)/assets; \ + fi; \ cp media/assets/COPYING $(DESTDIR)$(DOC_DIR)/COPYING.assets; \ echo "Asset copying done."; \ fi diff --git a/Makefile.classic_armv7_a7 b/Makefile.classic_armv7_a7 new file mode 100644 index 0000000000..ce76bb4242 --- /dev/null +++ b/Makefile.classic_armv7_a7 @@ -0,0 +1,113 @@ +# This build was put together and is maintained by ModMyClassic.com for Libretro. +# The purpose is to give Libretro a proper "official" build platform for classic consoles. +# If you need any help in building for the classics or have any questions then please visit +# https://modmyclassic.com/comp and we will help in any way possible! + +# Building Prerequisites ############## +# arm-linux-gnueabihf-gcc-8 +# arm-linux-gnueabihf-g++-8 +# arm-linux-gnueabihf-as +# arm-linux-gnueabihf-strip +# patchelf +# bc + +include version.all + +# Classic Readme Variables ############ +CLASSIC_ALT_VER := $(shell echo $(RARCH_VERSION) | tr . _) +CLASSIC_MODS_VER := Official_Retroarch_v$(CLASSIC_ALT_VER)c_COptimised +CLASSIC_MODS_NAME := RetroArch v$(RARCH_VERSION)c \(Official Classic Optimised\) +CLASSIC_VERSION := $(RARCH_VERSION)c \(Classic+\) +MOD_CREATOR := Libretro + ModMyClassic +MOD_CATEGORY := RetroArch +GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`") + +# Platform dependant Variables ######## +HAKCHI_DIR := RA_Platform-Hakchi +HAKCHI_GIT := https://github.com/Classicmods/RA_Platform-Hakchi + +# General Shared Variables ############ +TARGET := retroarch +CC_V = arm-linux-gnueabihf-gcc-8 +CXX_V = arm-linux-gnueabihf-g++-8 +AS_V = arm-linux-gnueabihf-as +CC_AS_V = arm-linux-gnueabihf-gcc-8 + +# Libretro Defines #################### +#HAVE_CLASSIC = Classic Hook, disable some features +#HAVE_C_A7A7 = Classic Armv7 Cortex A7 optimisation override +#HAVE_HAKCHI = Hakchi Hook, change default configurations etc (TODO) + +all: $(TARGET) + +retroarch: + #Backup vanilla version files + ammend version + cp version.all version_BACKUP.all && cp version.dtd version_BACKUP.dtd + sed -i -e 's/RARCH_VERSION="[^"]*"/RARCH_VERSION="$(CLASSIC_VERSION)"/g' version.all + sed -i -e 's/PACKAGE_VERSION "[^"]*"/PACKAGE_VERSION "$(CLASSIC_VERSION)"/g' version.all + sed -i -e 's/ENTITY version "[^"]*"/ENTITY version "$(CLASSIC_VERSION)"/g' version.dtd + #Build the RetroArch Binary for cross platform classics (ARMv7 Cortex A7) + patchelf --version #Check if you have patchelf installed... (sudo apt-get install patchelf) + ./configure --host=arm-linux-gnueabihf --enable-mali_fbdev --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard --disable-discord + make CC=$(CC_V) CXX=$(CXX_V) AS=$(AS_V) CC_AS=$(CC_AS_V) LDFLAGS_SDL=-lSDL2 HAVE_CLASSIC=1 HAVE_C_A7A7=1 HAVE_HAKCHI=1 -j #Cook it + arm-linux-gnueabihf-strip -v retroarch + patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary... + + #HAKCHI BUILD (NESC, SNESC) + #FYI this build was originally known as RetroArch 'Neo' for Hakchi. + @echo "** BUILDING CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **" + rm -fr /tmp/$(HAKCHI_DIR) + cd /tmp/; git clone $(HAKCHI_GIT) + cp retroarch /tmp/$(HAKCHI_DIR)/bin/retroarch + echo $$(echo "Built by: " $$USER @ $$(date) \\\\\\ Git Commit: $(GIT_COMMIT)) > /tmp/$(HAKCHI_DIR)/etc/libretro/retroarch_version + cp /tmp/$(HAKCHI_DIR)/readme.md /tmp/$(HAKCHI_DIR)/readme_COPY.md + printf "%s\n" \ + "---" \ + "Name: $(CLASSIC_MODS_NAME)" \ + "Creator: $(MOD_CREATOR)" \ + "Category: $(MOD_CATEGORY)" \ + "Version: $(CLASSIC_MODS_VER)" \ + "Built on: $(shell date)" \ + "Git commit: $(GIT_COMMIT)" \ + "---" > /tmp/$(HAKCHI_DIR)/readme.md + cat /tmp/$(HAKCHI_DIR)/readme_COPY.md >> /tmp/$(HAKCHI_DIR)/readme.md + rm /tmp/$(HAKCHI_DIR)/readme_COPY.md + @echo "** COMPRESSING $(CLASSIC_MODS_VER) HMOD PACKAGE **" + cd /tmp/$(HAKCHI_DIR)/; tar -czvf "$(CLASSIC_MODS_VER).hmod" * + mv /tmp/$(HAKCHI_DIR)/$(CLASSIC_MODS_VER).hmod . + @echo "** BUILT CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **" + rm -fr /tmp/$(HAKCHI_DIR) #clean up tmp + + #COMMODORE 64 MINI BUILD (WIP) + + #Clean down dirty files + rm -f version.all version.dtd + mv version_BACKUP.all version.all && mv version_BACKUP.dtd version.dtd + @echo "*********************************************************************" + @echo "*** Classic ARM7 Cortex A7 build and packages built successfully! ***" + @echo "****************** Winner, Winner, Chicken Dinner! ******************" + @echo "*********************************************************************" +clean: + rm -rf obj-unix + rm -f *.d + rm -f *.o + rm -f audio/*.o + rm -f conf/*.o + rm -f gfx/*.o + rm -f gfx/drivers_font/*.o + rm -f gfx/drivers_font_renderer/*.o + rm -f gfx/drivers_context/*.o + rm -f gfx/py_state/*.o + rm -f compat/*.o + rm -f record/*.o + rm -f input/*.o + rm -f tools/*.o + rm -f $(BINDIR)/retroarch + rm -f $(BINDIR)/retroarch-joyconfig + rm -f $(PNDDIR)/readme.html + rm -f retroarch + rm -f $(CLASSIC_MODS_VER).hmod + rm -f version.all version.dtd + mv -f version_BACKUP.all version.all || echo "Backup Doesn't Exist - Ignoring..." + mv -f version_BACKUP.dtd version.dtd || echo "Backup Doesn't Exist - Ignoring..." + rm -f *_BACKUP* diff --git a/Makefile.common b/Makefile.common index 361de1abb5..18e76d66c6 100644 --- a/Makefile.common +++ b/Makefile.common @@ -4,11 +4,7 @@ LIBRETRO_COMM_DIR := $(ROOT_DIR)/libretro-common WANT_WGL = 0 ifeq ($(HAVE_STACK_USAGE), 1) -CFLAGS += -fstack-usage -endif - -ifeq ($(HAVE_HAKCHI), 1) -CFLAGS += -DHAVE_HAKCHI + DEF_FLAGS += -fstack-usage endif ifeq ($(HAVE_GL_CONTEXT),) @@ -31,17 +27,8 @@ ifeq ($(HAVE_LIBRETRODB),) HAVE_LIBRETRODB = 1 endif -ifeq ($(HAVE_VIDEO_PROCESSOR), 1) - DEFINES += -DHAVE_VIDEO_PROCESSOR -endif - -ifeq ($(HAVE_MENU), 1) - DEFINES += -DHAVE_MENU - HAVE_MENU_COMMON = 1 -endif - ifeq ($(HAVE_SOCKET_LEGACY), 1) - DEFINES += -DHAVE_SOCKET_LEGACY + DEFINES += -DHAVE_SOCKET_LEGACY endif ifeq ($(HAVE_HID), 1) @@ -53,7 +40,7 @@ ifeq ($(HAVE_LIBRETRODB), 1) endif ifeq ($(HAVE_VITA2D), 1) - DEFINES += -DHAVE_VITA2D + DEFINES += -DHAVE_VITA2D endif ifeq ($(HAVE_DYLIB), 1) @@ -64,23 +51,26 @@ ifeq ($(SCALER_NO_SIMD), 1) DEFINES += -DSCALER_NO_SIMD endif - ifeq ($(HAVE_PRESERVE_DYLIB),1) DEFINES += -DNO_DLCLOSE endif ifeq ($(GL_DEBUG), 1) - CFLAGS += -DGL_DEBUG - CXXFLAGS += -DGL_DEBUG + DEF_FLAGS += -DGL_DEBUG endif ifeq ($(VULKAN_DEBUG), 1) - CFLAGS += -DVULKAN_DEBUG - CXXFLAGS += -DVULKAN_DEBUG + DEF_FLAGS += -DVULKAN_DEBUG endif -ifeq ($(HAVE_HARD_FLOAT), 1) - DEFINES += -mfloat-abi=hard +ifeq ($(HAVE_FLOATHARD), 1) + DEF_FLAGS += $(FLOATHARD_CFLAGS) + ASFLAGS += $(FLOATHARD_CFLAGS) +endif + +ifeq ($(HAVE_FLOATSOFTFP), 1) + DEF_FLAGS += $(FLOATSOFTFP_CFLAGS) + ASFLAGS += $(FLOATSOFTFP_CFLAGS) endif ifeq ($(TDM_GCC),) @@ -88,23 +78,23 @@ ifeq ($(TDM_GCC),) endif ifeq ($(HAVE_FILE_LOGGER), 1) - CFLAGS += -DHAVE_FILE_LOGGER + DEF_FLAGS += -DHAVE_FILE_LOGGER endif ifeq ($(HAVE_SHADERPIPELINE), 1) - CFLAGS += -DHAVE_SHADERPIPELINE + DEF_FLAGS += -DHAVE_SHADERPIPELINE endif -CFLAGS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR) +DEF_FLAGS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR) # Switches # ifeq ($(HAVE_NETPLAYDISCOVERY), 1) - CFLAGS += -DHAVE_NETPLAYDISCOVERY + DEF_FLAGS += -DHAVE_NETPLAYDISCOVERY endif ifeq ($(HAVE_NETLOGGER), 1) - CFLAGS += -DHAVE_LOGGER + DEF_FLAGS += -DHAVE_LOGGER DEFINES += -DHAVE_LOGGER OBJ += network/net_logger.o endif @@ -113,7 +103,7 @@ endif ifneq ($(findstring BSD,$(OS)),) BSD_LOCAL_INC += -I/usr/local/include - HAVE_UNIX = 1 + HAVE_UNIX = 1 endif ifneq ($(findstring Darwin,$(OS)),) @@ -125,7 +115,7 @@ endif ifneq ($(findstring Haiku,$(OS)),) LIBS += -lroot -lnetwork - HAVE_UNIX = 1 + HAVE_UNIX = 1 else LIBS += -lm endif @@ -135,15 +125,15 @@ ifneq ($(findstring Linux,$(OS)),) OBJ += input/drivers/linuxraw_input.o \ input/common/linux_common.o \ input/drivers_joypad/linuxraw_joypad.o - HAVE_UNIX = 1 + HAVE_UNIX = 1 endif ifeq ($(HAVE_UNIX), 1) - OBJ += frontend/drivers/platform_unix.o + OBJ += frontend/drivers/platform_unix.o endif ifeq ($(TARGET), retroarch_3ds) - OBJ += frontend/drivers/platform_ctr.o + OBJ += frontend/drivers/platform_ctr.o endif # Git @@ -156,7 +146,7 @@ endif # General object files DEFINES += -DHAVE_DR_MP3 -CFLAGS += -DHAVE_DR_MP3 +DEF_FLAGS += -DHAVE_DR_MP3 OBJ += frontend/frontend.o \ frontend/frontend_driver.o \ @@ -169,8 +159,8 @@ OBJ += frontend/frontend.o \ ui/drivers/null/ui_null_application.o \ core_impl.o \ retroarch.o \ - dirs.o \ - paths.o \ + dirs.o \ + paths.o \ command.o \ msg_hash.o \ intl/msg_hash_us.o \ @@ -195,12 +185,13 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/lists/string_list.o \ $(LIBRETRO_COMM_DIR)/string/stdstring.o \ $(LIBRETRO_COMM_DIR)/memmap/memalign.o \ - setting_list.o \ + setting_list.o \ list_special.o \ $(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o \ $(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o \ $(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o \ $(LIBRETRO_COMM_DIR)/file/nbio/nbio_windowsmmap.o \ + $(LIBRETRO_COMM_DIR)/file/nbio/nbio_orbis.o \ $(LIBRETRO_COMM_DIR)/file/nbio/nbio_intf.o \ $(LIBRETRO_COMM_DIR)/file/file_path.o \ file_path_special.o \ @@ -210,13 +201,13 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/audio/audio_mixer.o \ input/common/input_common.o \ input/input_driver.o \ - input/input_mapper.o \ + input/input_mapper.o \ led/led_driver.o \ led/drivers/led_null.o \ gfx/video_coord_array.o \ gfx/video_display_server.o \ gfx/video_driver.o \ - gfx/video_crt_switch.o \ + gfx/video_crt_switch.o \ camera/camera_driver.o \ wifi/wifi_driver.o \ location/location_driver.o \ @@ -226,11 +217,11 @@ OBJ += frontend/frontend.o \ dynamic.o \ cores/dynamic_dummy.o \ $(LIBRETRO_COMM_DIR)/queues/message_queue.o \ - managers/core_manager.o \ + managers/core_manager.o \ managers/state_manager.o \ gfx/drivers_font_renderer/bitmapfont.o \ tasks/task_autodetect.o \ - input/input_autodetect_builtin.o \ + input/input_autodetect_builtin.o \ input/input_keymaps.o \ input/input_remapping.o \ $(LIBRETRO_COMM_DIR)/queues/fifo_queue.o \ @@ -256,7 +247,7 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o \ $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o \ $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/null_resampler.o \ - $(LIBRETRO_COMM_DIR)/utils/md5.o \ + $(LIBRETRO_COMM_DIR)/utils/md5.o \ location/drivers/nulllocation.o \ camera/drivers/nullcamera.o \ wifi/drivers/nullwifi.o \ @@ -277,221 +268,220 @@ OBJ += frontend/frontend.o \ midi/drivers/null_midi.o ifeq ($(HAVE_RUNAHEAD), 1) -DEFINES += -DHAVE_RUNAHEAD -OBJ += runahead/copy_load_info.o \ - runahead/dirty_input.o \ - runahead/mem_util.o \ - runahead/mylist.o \ - runahead/run_ahead.o \ - runahead/secondary_core.o + DEFINES += -DHAVE_RUNAHEAD + OBJ += runahead/copy_load_info.o \ + runahead/dirty_input.o \ + runahead/mem_util.o \ + runahead/mylist.o \ + runahead/run_ahead.o \ + runahead/secondary_core.o endif - - ifeq ($(HAVE_CC_RESAMPLER), 1) -DEFINES += -DHAVE_CC_RESAMPLER -OBJ += audio/drivers_resampler/cc_resampler.o + DEFINES += -DHAVE_CC_RESAMPLER + OBJ += audio/drivers_resampler/cc_resampler.o endif ifeq ($(HAVE_LANGEXTRA), 1) -DEFINES += -DHAVE_LANGEXTRA -DEFINES += -finput-charset=UTF-8 - -OBJ += intl/msg_hash_de.o \ - intl/msg_hash_eo.o \ - intl/msg_hash_es.o \ - intl/msg_hash_fr.o \ - intl/msg_hash_it.o \ - intl/msg_hash_ja.o \ - intl/msg_hash_ko.o \ - intl/msg_hash_nl.o \ - intl/msg_hash_pl.o \ - intl/msg_hash_pt_br.o \ - intl/msg_hash_pt_pt.o \ - intl/msg_hash_ru.o \ - intl/msg_hash_vn.o \ - intl/msg_hash_chs.o \ - intl/msg_hash_cht.o \ - intl/msg_hash_ar.o \ - intl/msg_hash_el.o + DEFINES += -DHAVE_LANGEXTRA + DEFINES += -finput-charset=UTF-8 + OBJ += intl/msg_hash_de.o \ + intl/msg_hash_eo.o \ + intl/msg_hash_es.o \ + intl/msg_hash_fr.o \ + intl/msg_hash_it.o \ + intl/msg_hash_ja.o \ + intl/msg_hash_ko.o \ + intl/msg_hash_nl.o \ + intl/msg_hash_pl.o \ + intl/msg_hash_pt_br.o \ + intl/msg_hash_pt_pt.o \ + intl/msg_hash_ru.o \ + intl/msg_hash_vn.o \ + intl/msg_hash_chs.o \ + intl/msg_hash_cht.o \ + intl/msg_hash_ar.o \ + intl/msg_hash_el.o endif ifneq ($(HAVE_GETOPT_LONG), 1) -OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_getopt.o + OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_getopt.o endif ifneq ($(HAVE_STRCASESTR), 1) -OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.o + OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.o endif ifneq ($(HAVE_STRL), 1) -OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strl.o + OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strl.o endif OBJ += $(LIBRETRO_COMM_DIR)/formats/image_texture.o ifeq ($(HAVE_IMAGEVIEWER), 1) -DEFINES += -DHAVE_IMAGEVIEWER -OBJ += cores/libretro-imageviewer/image_core.o + DEFINES += -DHAVE_IMAGEVIEWER + OBJ += cores/libretro-imageviewer/image_core.o endif # Qt WIMP GUI ifeq ($(HAVE_OPENSSL), 1) -DEFINES += $(OPENSSL_CFLAGS) -LIBS += $(OPENSSL_LIBS) + DEFINES += $(OPENSSL_CFLAGS) + LIBS += $(OPENSSL_LIBS) endif ifeq ($(HAVE_QT), 1) -OBJ += ui/drivers/ui_qt.o \ - ui/drivers/qt/ui_qt_application.o \ - ui/drivers/qt/ui_qt_window.o \ - ui/drivers/qt/ui_qt_browser_window.o \ - ui/drivers/qt/ui_qt_load_core_window.o \ - ui/drivers/qt/ui_qt_msg_window.o \ - ui/drivers/qt/flowlayout.o \ - ui/drivers/qt/shaderparamsdialog.o \ - ui/drivers/qt/coreoptionsdialog.o \ - ui/drivers/qt/filedropwidget.o \ - ui/drivers/qt/coreinfodialog.o \ - ui/drivers/qt/playlistentrydialog.o \ - ui/drivers/qt/viewoptionsdialog.o \ - ui/drivers/qt/playlist.o \ - ui/drivers/qt/updateretroarch.o \ - ui/drivers/qt/thumbnaildownload.o \ - ui/drivers/qt/thumbnailpackdownload.o \ - ui/drivers/qt/playlistthumbnaildownload.o + OBJ += ui/drivers/ui_qt.o \ + ui/drivers/qt/ui_qt_application.o \ + ui/drivers/qt/ui_qt_window.o \ + ui/drivers/qt/ui_qt_browser_window.o \ + ui/drivers/qt/ui_qt_load_core_window.o \ + ui/drivers/qt/ui_qt_msg_window.o \ + ui/drivers/qt/gridview.o \ + ui/drivers/qt/shaderparamsdialog.o \ + ui/drivers/qt/coreoptionsdialog.o \ + ui/drivers/qt/filedropwidget.o \ + ui/drivers/qt/coreinfodialog.o \ + ui/drivers/qt/playlistentrydialog.o \ + ui/drivers/qt/viewoptionsdialog.o \ + ui/drivers/qt/qt_playlist.o \ + ui/drivers/qt/updateretroarch.o \ + ui/drivers/qt/thumbnaildownload.o \ + ui/drivers/qt/thumbnailpackdownload.o \ + ui/drivers/qt/playlistthumbnaildownload.o -MOC_HEADERS += ui/drivers/ui_qt.h \ - ui/drivers/qt/ui_qt_load_core_window.h \ - ui/drivers/qt/flowlayout.h \ - ui/drivers/qt/shaderparamsdialog.h \ - ui/drivers/qt/coreoptionsdialog.h \ - ui/drivers/qt/filedropwidget.h \ - ui/drivers/qt/coreinfodialog.h \ - ui/drivers/qt/playlistentrydialog.h \ - ui/drivers/qt/viewoptionsdialog.h + MOC_HEADERS += ui/drivers/ui_qt.h \ + ui/drivers/qt/ui_qt_load_core_window.h \ + ui/drivers/qt/gridview.h \ + ui/drivers/qt/shaderparamsdialog.h \ + ui/drivers/qt/coreoptionsdialog.h \ + ui/drivers/qt/filedropwidget.h \ + ui/drivers/qt/coreinfodialog.h \ + ui/drivers/qt/playlistentrydialog.h \ + ui/drivers/qt/viewoptionsdialog.h -DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS) -DHAVE_MAIN -#DEFINES += $(QT5WEBENGINE_CFLAGS) -LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) $(QT5CONCURRENT_LIBS) $(QT5NETWORK_LIBS) -#LIBS += $(QT5WEBENGINE_LIBS) -NEED_CXX_LINKER = 1 + DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS) -DHAVE_MAIN + #DEFINES += $(QT5WEBENGINE_CFLAGS) + LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) $(QT5CONCURRENT_LIBS) $(QT5NETWORK_LIBS) + #LIBS += $(QT5WEBENGINE_LIBS) + NEED_CXX_LINKER = 1 -ifneq ($(findstring Linux,$(OS)),) -DEFINES += -fPIC -endif + ifneq ($(findstring Linux,$(OS)),) + DEFINES += -fPIC + endif endif ifeq ($(HAVE_SSA),1) -LIBS += $(SSA_LIBS) + LIBS += $(SSA_LIBS) +endif + +ifeq ($(HAVE_SSE),1) + DEF_FLAGS += $(SSE_LIBS) endif # LibretroDB ifeq ($(HAVE_LIBRETRODB), 1) -OBJ += libretro-db/bintree.o \ - libretro-db/libretrodb.o \ - libretro-db/query.o \ - libretro-db/rmsgpack.o \ - libretro-db/rmsgpack_dom.o \ - database_info.o \ - tasks/task_database.o \ - tasks/task_database_cue.o + OBJ += libretro-db/bintree.o \ + libretro-db/libretrodb.o \ + libretro-db/query.o \ + libretro-db/rmsgpack.o \ + libretro-db/rmsgpack_dom.o \ + database_info.o \ + tasks/task_database.o \ + tasks/task_database_cue.o endif -ifneq ($(C89_BUILD), 1) -HAVE_GTKPLUS = 0 +ifeq ($(HAVE_BUILTINMBEDTLS), 1) + HAVE_SSL = 1 + DEFINES += -DHAVE_SSL -ifeq ($(HAVE_SSL), 1) -ifeq ($(HAVE_NETWORKING), 1) -DEFINES += -DHAVE_SSL + ifeq ($(DEBUG), 1) + DEFINES += -DMBEDTLS_SSL_DEBUG_ALL + endif -ifeq ($(DEBUG), 1) - DEFINES += -DMBEDTLS_SSL_DEBUG_ALL -endif + # MinGW requires this for some reason, even though the include paths are relative to the source + INCLUDE_DIRS += -Ideps/mbedtls -# MinGW requires this for some reason, even though the include paths are relative to the source -INCLUDE_DIRS += -Ideps/mbedtls + OBJS_TLS_CRYPTO = deps/mbedtls/aes.o \ + deps/mbedtls/aesni.o \ + deps/mbedtls/arc4.o \ + deps/mbedtls/asn1parse.o \ + deps/mbedtls/asn1write.o \ + deps/mbedtls/base64.o \ + deps/mbedtls/bignum.o \ + deps/mbedtls/blowfish.o \ + deps/mbedtls/camellia.o \ + deps/mbedtls/ccm.o \ + deps/mbedtls/cipher.o \ + deps/mbedtls/cipher_wrap.o \ + deps/mbedtls/cmac.o \ + deps/mbedtls/ctr_drbg.o \ + deps/mbedtls/des.o \ + deps/mbedtls/dhm.o \ + deps/mbedtls/ecdh.o \ + deps/mbedtls/ecdsa.o \ + deps/mbedtls/ecjpake.o \ + deps/mbedtls/ecp.o \ + deps/mbedtls/ecp_curves.o \ + deps/mbedtls/entropy.o \ + deps/mbedtls/entropy_poll.o \ + deps/mbedtls/error.o \ + deps/mbedtls/gcm.o \ + deps/mbedtls/havege.o \ + deps/mbedtls/hmac_drbg.o \ + deps/mbedtls/md.o \ + deps/mbedtls/md2.o \ + deps/mbedtls/md4.o \ + deps/mbedtls/md5.o \ + deps/mbedtls/md_wrap.o \ + deps/mbedtls/memory_buffer_alloc.o \ + deps/mbedtls/oid.o \ + deps/mbedtls/padlock.o \ + deps/mbedtls/pem.o \ + deps/mbedtls/pk.o \ + deps/mbedtls/pk_wrap.o \ + deps/mbedtls/pkcs12.o \ + deps/mbedtls/pkcs5.o \ + deps/mbedtls/pkparse.o \ + deps/mbedtls/pkwrite.o \ + deps/mbedtls/platform.o \ + deps/mbedtls/ripemd160.o \ + deps/mbedtls/rsa.o \ + deps/mbedtls/sha1.o \ + deps/mbedtls/sha256.o \ + deps/mbedtls/sha512.o \ + deps/mbedtls/threading.o \ + deps/mbedtls/timing.o \ + deps/mbedtls/version.o \ + deps/mbedtls/version_features.o \ + deps/mbedtls/xtea.o -OBJS_TLS_CRYPTO = deps/mbedtls/aes.o \ - deps/mbedtls/aesni.o \ - deps/mbedtls/arc4.o \ - deps/mbedtls/asn1parse.o \ - deps/mbedtls/asn1write.o \ - deps/mbedtls/base64.o \ - deps/mbedtls/bignum.o \ - deps/mbedtls/blowfish.o \ - deps/mbedtls/camellia.o \ - deps/mbedtls/ccm.o \ - deps/mbedtls/cipher.o \ - deps/mbedtls/cipher_wrap.o \ - deps/mbedtls/cmac.o \ - deps/mbedtls/ctr_drbg.o \ - deps/mbedtls/des.o \ - deps/mbedtls/dhm.o \ - deps/mbedtls/ecdh.o \ - deps/mbedtls/ecdsa.o \ - deps/mbedtls/ecjpake.o \ - deps/mbedtls/ecp.o \ - deps/mbedtls/ecp_curves.o \ - deps/mbedtls/entropy.o \ - deps/mbedtls/entropy_poll.o \ - deps/mbedtls/error.o \ - deps/mbedtls/gcm.o \ - deps/mbedtls/havege.o \ - deps/mbedtls/hmac_drbg.o \ - deps/mbedtls/md.o \ - deps/mbedtls/md2.o \ - deps/mbedtls/md4.o \ - deps/mbedtls/md5.o \ - deps/mbedtls/md_wrap.o \ - deps/mbedtls/memory_buffer_alloc.o \ - deps/mbedtls/oid.o \ - deps/mbedtls/padlock.o \ - deps/mbedtls/pem.o \ - deps/mbedtls/pk.o \ - deps/mbedtls/pk_wrap.o \ - deps/mbedtls/pkcs12.o \ - deps/mbedtls/pkcs5.o \ - deps/mbedtls/pkparse.o \ - deps/mbedtls/pkwrite.o \ - deps/mbedtls/platform.o \ - deps/mbedtls/ripemd160.o \ - deps/mbedtls/rsa.o \ - deps/mbedtls/sha1.o \ - deps/mbedtls/sha256.o \ - deps/mbedtls/sha512.o \ - deps/mbedtls/threading.o \ - deps/mbedtls/timing.o \ - deps/mbedtls/version.o \ - deps/mbedtls/version_features.o \ - deps/mbedtls/xtea.o + OBJS_TLS_X509 = deps/mbedtls/certs.o \ + deps/mbedtls/pkcs11.o \ + deps/mbedtls/x509.o \ + deps/mbedtls/x509_create.o \ + deps/mbedtls/x509_crl.o \ + deps/mbedtls/x509_crt.o \ + deps/mbedtls/x509_csr.o \ + deps/mbedtls/x509write_crt.o \ + deps/mbedtls/x509write_csr.o -OBJS_TLS_X509 = deps/mbedtls/certs.o \ - deps/mbedtls/pkcs11.o \ - deps/mbedtls/x509.o \ - deps/mbedtls/x509_create.o \ - deps/mbedtls/x509_crl.o \ - deps/mbedtls/x509_crt.o \ - deps/mbedtls/x509_csr.o \ - deps/mbedtls/x509write_crt.o \ - deps/mbedtls/x509write_csr.o + OBJS_TLS = deps/mbedtls/debug.o \ + deps/mbedtls/net_sockets.o \ + deps/mbedtls/ssl_cache.o \ + deps/mbedtls/ssl_ciphersuites.o \ + deps/mbedtls/ssl_cli.o \ + deps/mbedtls/ssl_cookie.o \ + deps/mbedtls/ssl_srv.o \ + deps/mbedtls/ssl_ticket.o \ + deps/mbedtls/ssl_tls.o -OBJS_TLS = deps/mbedtls/debug.o \ - deps/mbedtls/net_sockets.o \ - deps/mbedtls/ssl_cache.o \ - deps/mbedtls/ssl_ciphersuites.o \ - deps/mbedtls/ssl_cli.o \ - deps/mbedtls/ssl_cookie.o \ - deps/mbedtls/ssl_srv.o \ - deps/mbedtls/ssl_ticket.o \ - deps/mbedtls/ssl_tls.o - -OBJ += $(OBJS_TLS_CRYPTO) $(OBJS_TLS_X509) $(OBJS_TLS) -endif -endif + OBJ += $(OBJS_TLS_CRYPTO) $(OBJS_TLS_X509) $(OBJS_TLS) +else ifeq ($(HAVE_SSL), 1) + DEFINES += -DHAVE_SSL + LIBS += $(MBEDTLS_LIBS) $(MBEDX509_LIBS) $(MBEDCRYPTO_LIBS) endif # Miscellaneous @@ -507,22 +497,32 @@ ifeq ($(HAVE_PYTHON), 1) endif ifeq ($(HAVE_EMSCRIPTEN), 1) -OBJ += frontend/drivers/platform_emscripten.o \ - input/drivers/rwebinput_input.o \ - input/drivers_joypad/rwebpad_joypad.o \ - audio/drivers/rwebaudio.o \ - camera/drivers/rwebcam.o + OBJ += frontend/drivers/platform_emscripten.o \ + input/drivers/rwebinput_input.o \ + input/drivers_joypad/rwebpad_joypad.o \ + audio/drivers/rwebaudio.o \ + camera/drivers/rwebcam.o endif ifeq ($(HAVE_LAKKA), 1) -OBJ += wifi/drivers/connmanctl.o + OBJ += wifi/drivers/connmanctl.o endif # Audio -# + + ifeq ($(HAVE_COREAUDIO), 1) OBJ += audio/drivers/coreaudio.o - LIBS += -framework CoreServices -framework CoreAudio -framework AudioUnit + HAVE_COREAUDIO_LIBS = 1 +endif + +ifeq ($(HAVE_COREAUDIO3), 1) + OBJ += audio/drivers/coreaudio3.o + HAVE_COREAUDIO_LIBS = 1 +endif + +ifeq ($(HAVE_COREAUDIO_LIBS), 1) + LIBS += -framework CoreServices -framework CoreAudio -framework AudioUnit endif ifeq ($(HAVE_CORETEXT), 1) @@ -530,11 +530,15 @@ ifeq ($(HAVE_CORETEXT), 1) endif ifeq ($(TARGET), retroarch_3ds) - OBJ += gfx/drivers_font/ctr_font.o + OBJ += gfx/drivers_font/ctr_font.o endif ifeq ($(HAVE_LIBNX), 1) - OBJ += gfx/drivers_font/switch_font.o + OBJ += gfx/drivers_font/switch_font.o +endif + +ifeq ($(HAVE_AUDIOIO), 1) + OBJ += audio/drivers/audioio.o endif ifeq ($(HAVE_OSS), 1) @@ -544,24 +548,25 @@ else ifeq ($(HAVE_OSS_BSD), 1) endif ifeq ($(TARGET), retroarch_3ds) - OBJ += audio/drivers/ctr_csnd_audio.o \ - audio/drivers/ctr_dsp_audio.o + OBJ += audio/drivers/ctr_csnd_audio.o \ + audio/drivers/ctr_dsp_audio.o endif ifeq ($(HAVE_ALSA), 1) OBJ += audio/drivers/alsa.o OBJ += midi/drivers/alsa_midi.o -ifeq ($(HAVE_THREADS), 1) - OBJ += audio/drivers/alsathread.o -endif + ifeq ($(HAVE_THREADS), 1) + OBJ += audio/drivers/alsathread.o + endif + LIBS += $(ALSA_LIBS) DEFINES += $(ALSA_CFLAGS) endif ifeq ($(HAVE_TINYALSA), 1) - OBJ += audio/drivers/tinyalsa.o - DEFINES += -DHAVE_TINYALSA + OBJ += audio/drivers/tinyalsa.o + DEFINES += -DHAVE_TINYALSA endif ifeq ($(HAVE_ROAR), 1) @@ -608,7 +613,7 @@ endif ifeq ($(HAVE_DSOUND), 1) OBJ += audio/drivers/dsound.o DEFINES += -DHAVE_DSOUND - HAVE_DX_COMMON = 1 + HAVE_DX_COMMON = 1 LIBS += -ldsound endif @@ -636,91 +641,123 @@ ifeq ($(HAVE_NEON),1) OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_neon.o \ audio/drivers_resampler/cc_resampler_neon.o \ memory/neon/memcpy-neon.o - DEFINES += -DHAVE_NEON + + DEFINES += -DHAVE_NEON + ASFLAGS += $(NEON_ASFLAGS) + DEF_FLAGS += $(NEON_CFLAGS) endif OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \ - $(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o \ - $(LIBRETRO_COMM_DIR)/audio/audio_mix.o \ - $(LIBRETRO_COMM_DIR)/formats/wav/rwav.o + $(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o \ + $(LIBRETRO_COMM_DIR)/audio/audio_mix.o \ + $(LIBRETRO_COMM_DIR)/formats/wav/rwav.o ifeq ($(HAVE_NEON),1) OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float_neon.o \ $(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16_neon.o endif -HW_CONTEXT_MENU_DRIVERS=$(HAVE_RGUI) +HW_CONTEXT_MENU_DRIVERS=$(HAVE_MENU) ifeq ($(HW_CONTEXT_MENU_DRIVERS),0) -ifeq ($(HAVE_GL_CONTEXT),1) - HW_CONTEXT_MENU_DRIVERS=1 -endif -ifeq ($(HAVE_VULKAN),1) - HW_CONTEXT_MENU_DRIVERS=1 -endif + ifeq ($(HAVE_GL_CONTEXT),1) + HW_CONTEXT_MENU_DRIVERS=1 + endif + ifeq ($(HAVE_VULKAN),1) + HW_CONTEXT_MENU_DRIVERS=1 + endif endif # XMB and MaterialUI are always enabled if supported and not explicitly disabled ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1) ifeq ($(HAVE_ZARCH),) - HAVE_ZARCH = 1 + HAVE_ZARCH = 0 + endif + + ifeq ($(HAVE_RGUI),) + HAVE_RGUI = 1 endif ifeq ($(HAVE_MATERIALUI),) HAVE_MATERIALUI = 1 endif - #ifeq ($(HAVE_NUKLEAR),) - #HAVE_NUKLEAR = 1 - #endif + ifeq ($(HAVE_NUKLEAR),) + HAVE_NUKLEAR = 0 + endif ifeq ($(HAVE_XMB),) HAVE_XMB = 1 endif ifeq ($(HAVE_STRIPES),) - HAVE_STRIPES = 1 + HAVE_STRIPES = 0 + endif + + ifeq ($(HAVE_OZONE),) + HAVE_OZONE = 1 endif else - HAVE_ZARCH ?= 0 + HAVE_ZARCH ?= 0 + HAVE_RGUI ?= 0 HAVE_MATERIALUI ?= 0 - #HAVE_NUKLEAR ?= 0 - HAVE_XMB ?= 0 - HAVE_STRIPES ?= 0 + HAVE_NUKLEAR ?= 0 + HAVE_XMB ?= 0 + HAVE_STRIPES ?= 0 + HAVE_OZONE ?= 0 endif -ifeq ($(HAVE_RGUI), 1) - OBJ += menu/drivers/rgui.o - DEFINES += -DHAVE_MENU -DHAVE_RGUI +ifeq ($(HAVE_MENU), 1) + DEFINES += -DHAVE_MENU HAVE_MENU_COMMON = 1 -ifeq ($(HAVE_MATERIALUI), 1) - OBJ += menu/drivers/materialui.o - DEFINES += -DHAVE_MATERIALUI - HAVE_MENU_COMMON = 1 -endif -ifeq ($(HAVE_NUKLEAR), 1) - OBJ += menu/drivers/nuklear/nk_common.o - OBJ += menu/drivers/nuklear/nk_menu.o - OBJ += menu/drivers/nuklear/nk_wnd_debug.o - OBJ += menu/drivers/nuklear.o - DEFINES += -DHAVE_NUKLEAR -endif -ifeq ($(HAVE_ZARCH), 1) - OBJ += menu/drivers/zarch.o - DEFINES += -DHAVE_ZARCH -endif -endif + ifeq ($(HAVE_RGUI), 1) + OBJ += menu/drivers/rgui.o + DEFINES += -DHAVE_RGUI + endif -ifeq ($(HAVE_XMB), 1) - OBJ += menu/drivers/xmb.o - DEFINES += -DHAVE_XMB - HAVE_MENU_COMMON = 1 -endif + ifeq ($(HAVE_MATERIALUI), 1) + OBJ += menu/drivers/materialui.o + DEFINES += -DHAVE_MATERIALUI + HAVE_ASSETS = 1 + endif -ifeq ($(HAVE_STRIPES), 1) - OBJ += menu/drivers/stripes.o - DEFINES += -DHAVE_STRIPES + ifeq ($(HAVE_NUKLEAR), 1) + OBJ += menu/drivers/nuklear/nk_common.o \ + menu/drivers/nuklear/nk_menu.o \ + menu/drivers/nuklear/nk_wnd_debug.o \ + menu/drivers/nuklear.o + DEFINES += -DHAVE_NUKLEAR + HAVE_ASSETS = 1 + endif + + ifeq ($(HAVE_ZARCH), 1) + OBJ += menu/drivers/zarch.o + DEFINES += -DHAVE_ZARCH + HAVE_ASSETS = 1 + endif + + ifeq ($(HAVE_XMB), 1) + OBJ += menu/drivers/xmb.o + DEFINES += -DHAVE_XMB + HAVE_ASSETS = 1 + endif + + ifeq ($(HAVE_OZONE), 1) + OBJ += menu/drivers/ozone/ozone.o \ + menu/drivers/ozone/ozone_entries.o \ + menu/drivers/ozone/ozone_display.o \ + menu/drivers/ozone/ozone_texture.o \ + menu/drivers/ozone/ozone_theme.o \ + menu/drivers/ozone/ozone_sidebar.o + DEFINES += -DHAVE_OZONE + HAVE_ASSETS = 1 + endif + + ifeq ($(HAVE_STRIPES), 1) + OBJ += menu/drivers/stripes.o + DEFINES += -DHAVE_STRIPES + endif endif ifeq ($(HAVE_LAKKA), 1) @@ -731,6 +768,8 @@ ifeq ($(HAVE_LAKKA_SWITCH), 1) DEFINES += -DHAVE_LAKKA_SWITCH endif +OBJ += menu/menu_shader.o + ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/menu_driver.o \ menu/menu_content.o \ @@ -738,13 +777,12 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/menu_entries.o \ menu/menu_setting.o \ menu/menu_networking.o \ - menu/menu_shader.o \ - menu/widgets/menu_filebrowser.o \ - menu/widgets/menu_dialog.o \ - menu/widgets/menu_input_dialog.o \ - menu/widgets/menu_input_bind_dialog.o \ + menu/widgets/menu_filebrowser.o \ + menu/widgets/menu_dialog.o \ + menu/widgets/menu_input_dialog.o \ + menu/widgets/menu_input_bind_dialog.o \ menu/widgets/menu_entry.o \ - menu/widgets/menu_osk.o \ + menu/widgets/menu_osk.o \ menu/menu_cbs.o \ menu/cbs/menu_cbs_ok.o \ menu/cbs/menu_cbs_cancel.o \ @@ -765,15 +803,17 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/cbs/menu_cbs_contentlist_switch.o \ menu/menu_displaylist.o \ menu/menu_animation.o \ - menu/drivers_display/menu_display_null.o \ menu/drivers/menu_generic.o \ menu/drivers/null.o + + ifeq ($(HAVE_MENU_COMMON),1) + OBJ += menu/drivers_display/menu_display_null.o + endif endif ifeq ($(HAVE_OVERLAY), 1) DEFINES += -DHAVE_OVERLAY - OBJ += \ - tasks/task_overlay.o \ + OBJ += tasks/task_overlay.o \ input/input_overlay.o \ led/drivers/led_overlay.o endif @@ -805,70 +845,80 @@ ifeq ($(HAVE_THREAD_STORAGE), 1) endif ifeq ($(HAVE_VITA2D), 1) - OBJ += $(DEPS_DIR)/libvita2d/source/vita2d.o \ - $(DEPS_DIR)/libvita2d/source/vita2d_texture.o \ - $(DEPS_DIR)/libvita2d/source/vita2d_draw.o \ - $(DEPS_DIR)/libvita2d/source/utils.o + OBJ += $(DEPS_DIR)/libvita2d/source/vita2d.o \ + $(DEPS_DIR)/libvita2d/source/vita2d_texture.o \ + $(DEPS_DIR)/libvita2d/source/vita2d_draw.o \ + $(DEPS_DIR)/libvita2d/source/utils.o - OBJ += $(DEPS_DIR)/libvita2d/shader/clear_v_gxp.o \ - $(DEPS_DIR)/libvita2d/shader/clear_f_gxp.o \ - $(DEPS_DIR)/libvita2d/shader/color_v_gxp.o \ - $(DEPS_DIR)/libvita2d/shader/color_f_gxp.o \ - $(DEPS_DIR)/libvita2d/shader/texture_v_gxp.o \ - $(DEPS_DIR)/libvita2d/shader/texture_f_gxp.o \ - $(DEPS_DIR)/libvita2d/shader/texture_tint_f_gxp.o + OBJ += $(DEPS_DIR)/libvita2d/shader/clear_v_gxp.o \ + $(DEPS_DIR)/libvita2d/shader/clear_f_gxp.o \ + $(DEPS_DIR)/libvita2d/shader/color_v_gxp.o \ + $(DEPS_DIR)/libvita2d/shader/color_f_gxp.o \ + $(DEPS_DIR)/libvita2d/shader/texture_v_gxp.o \ + $(DEPS_DIR)/libvita2d/shader/texture_f_gxp.o \ + $(DEPS_DIR)/libvita2d/shader/texture_tint_f_gxp.o -ifeq ($(HAVE_MENU),1) - OBJ += menu/drivers_display/menu_display_vita2d.o -endif + ifeq ($(HAVE_MENU_COMMON),1) + OBJ += menu/drivers_display/menu_display_vita2d.o + endif - OBJ += gfx/drivers/vita2d_gfx.o \ - gfx/drivers_font/vita2d_font.o + OBJ += gfx/drivers/vita2d_gfx.o \ + gfx/drivers_font/vita2d_font.o - CFLAGS += -I$(DEPS_DIR)/libvita2d/include + DEF_FLAGS += -I$(DEPS_DIR)/libvita2d/include endif ifeq ($(TARGET), retroarch_3ds) - OBJ += gfx/drivers/ctr_gfx.o \ - menu/drivers_display/menu_display_ctr.o \ - input/drivers/ctr_input.o \ - input/drivers_joypad/ctr_joypad.o + OBJ += gfx/drivers/ctr_gfx.o \ + menu/drivers_display/menu_display_ctr.o \ + input/drivers/ctr_input.o \ + input/drivers_joypad/ctr_joypad.o endif ifeq ($(TARGET), retroarch_switch) - ifeq ($(HAVE_LIBNX), 1) - OBJ += menu/drivers_display/menu_display_switch.o \ - gfx/drivers/switch_nx_gfx.o + ifeq ($(HAVE_LIBNX), 1) + OBJ += menu/drivers_display/menu_display_switch.o \ + gfx/drivers/switch_nx_gfx.o ifeq ($(HAVE_OPENGL), 1) - OBJ += gfx/drivers_context/switch_ctx.o + OBJ += gfx/drivers_context/switch_ctx.o endif ifeq ($(HAVE_THREADS), 1) - OBJ += $(LIBRETRO_COMM_DIR)/rthreads/switch_pthread.o + OBJ += $(LIBRETRO_COMM_DIR)/rthreads/switch_pthread.o endif - else - OBJ += gfx/drivers/switch_gfx.o - endif - OBJ += audio/drivers/switch_audio.o \ - audio/drivers/switch_thread_audio.o \ - input/drivers/switch_input.o \ - input/drivers_joypad/switch_joypad.o \ - frontend/drivers/platform_switch.o + else + OBJ += gfx/drivers/switch_gfx.o + endif + OBJ += audio/drivers/switch_audio.o \ + audio/drivers/switch_thread_audio.o \ + input/drivers/switch_input.o \ + input/drivers_joypad/switch_joypad.o \ + frontend/drivers/platform_switch.o +endif + +ifeq ($(TARGET), retroarch_orbis) + OBJ += gfx/drivers_context/orbis_ctx.o \ + frontend/drivers/platform_orbis.o endif ifeq ($(HAVE_WAYLAND), 1) OBJ += gfx/drivers_context/wayland_ctx.o \ - input/drivers/wayland_input.o + input/drivers/wayland_input.o \ + gfx/common/wayland/xdg-shell.o \ + gfx/common/wayland/xdg-shell-unstable-v6.o \ + gfx/common/wayland/idle-inhibit-unstable-v1.o \ + gfx/common/wayland/xdg-decoration-unstable-v1.o ifeq ($(HAVE_EGL), 1) LIBS += $(EGL_LIBS) endif DEFINES += $(WAYLAND_CFLAGS) $(WAYLAND_CURSOR_CFLAGS) LIBS += $(WAYLAND_LIBS) $(WAYLAND_CURSOR_LIBS) + endif #Input ifeq ($(HAVE_DINPUT), 1) - HAVE_DX_COMMON = 1 + HAVE_DX_COMMON = 1 LIBS += -ldinput8 -lole32 DEFINES += -DHAVE_DINPUT OBJ += input/drivers/dinput.o \ @@ -893,14 +943,14 @@ ifeq ($(HAVE_X11), 1) gfx/common/xinerama_common.o \ gfx/display_servers/dispserv_x11.o - LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS) + LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS) $(XRANDR_LIBS) DEFINES += -DHAVE_X11 $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS) -ifeq ($(HAVE_XCB),1) - LIBS += -lX11-xcb -endif -ifneq ($(HAVE_OPENGLES), 1) - OBJ += gfx/drivers_context/x_ctx.o -endif + ifeq ($(HAVE_XCB),1) + LIBS += -lX11-xcb + endif + ifneq ($(HAVE_OPENGLES), 1) + OBJ += gfx/drivers_context/x_ctx.o + endif endif ifeq ($(HAVE_XCB),1) @@ -915,9 +965,9 @@ ifeq ($(HAVE_XKBCOMMON), 1) endif ifeq ($(HAVE_DBUS), 1) - LIBS += $(DBUS_LIBS) - CFLAGS += $(DBUS_CFLAGS) - OBJ += gfx/common/dbus_common.o + LIBS += $(DBUS_LIBS) + DEF_FLAGS += $(DBUS_CFLAGS) + OBJ += gfx/common/dbus_common.o endif ifeq ($(HAVE_UDEV), 1) @@ -928,25 +978,25 @@ ifeq ($(HAVE_UDEV), 1) endif ifeq ($(HAVE_LIBUSB), 1) -ifeq ($(HAVE_THREADS), 1) -ifeq ($(HAVE_HID), 1) - DEFINES += -DHAVE_LIBUSB - OBJ += input/drivers_hid/libusb_hid.o - ifneq ($(findstring BSD,$(OS)),) - LIBS += -lusb - else - LIBS += -lusb-1.0 + ifeq ($(HAVE_THREADS), 1) + ifeq ($(HAVE_HID), 1) + DEFINES += -DHAVE_LIBUSB + OBJ += input/drivers_hid/libusb_hid.o + ifneq ($(findstring BSD,$(OS)),) + LIBS += -lusb + else + LIBS += -lusb-1.0 + endif + endif endif endif -endif -endif ifeq ($(HAVE_IOHIDMANAGER), 1) -ifeq ($(HAVE_HID), 1) - DEFINES += -DHAVE_IOHIDMANAGER - OBJ += input/drivers_hid/iohidmanager_hid.o - LIBS += -framework IOKit -endif + ifeq ($(HAVE_HID), 1) + DEFINES += -DHAVE_IOHIDMANAGER + OBJ += input/drivers_hid/iohidmanager_hid.o + LIBS += -framework IOKit + endif endif ifeq ($(HAVE_CORELOCATION), 1) @@ -956,17 +1006,17 @@ endif ifeq ($(HAVE_HID), 1) DEFINES += -DHAVE_HID - OBJ += input/drivers_joypad/hid_joypad.o \ - input/connect/joypad_connection.o \ - input/connect/connect_ps2adapter.o \ - input/connect/connect_psxadapter.o \ - input/connect/connect_ps3.o \ - input/connect/connect_ps4.o \ - input/connect/connect_wii.o \ - input/connect/connect_nesusb.o \ - input/connect/connect_snesusb.o \ - input/connect/connect_wiiupro.o \ - input/connect/connect_wiiugca.o + OBJ += input/drivers_joypad/hid_joypad.o \ + input/connect/joypad_connection.o \ + input/connect/connect_ps2adapter.o \ + input/connect/connect_psxadapter.o \ + input/connect/connect_ps3.o \ + input/connect/connect_ps4.o \ + input/connect/connect_wii.o \ + input/connect/connect_nesusb.o \ + input/connect/connect_snesusb.o \ + input/connect/connect_wiiupro.o \ + input/connect/connect_wiiugca.o endif ifeq ($(HAVE_PARPORT), 1) @@ -980,11 +1030,11 @@ endif # Companion UI ifneq ($(findstring Win32,$(OS)),) -OBJ += ui/drivers/ui_win32.o \ - ui/drivers/win32/ui_win32_window.o \ - ui/drivers/win32/ui_win32_browser_window.o \ - ui/drivers/win32/ui_win32_msg_window.o \ - ui/drivers/win32/ui_win32_application.o + OBJ += ui/drivers/ui_win32.o \ + ui/drivers/win32/ui_win32_window.o \ + ui/drivers/win32/ui_win32_browser_window.o \ + ui/drivers/win32/ui_win32_msg_window.o \ + ui/drivers/win32/ui_win32_application.o endif # Video @@ -1011,7 +1061,7 @@ endif ifeq ($(HAVE_SIXEL), 1) DEFINES += -DHAVE_SIXEL - CFLAGS += -I/usr/include/sixel + DEF_FLAGS += -I/usr/include/sixel OBJ += gfx/drivers/sixel_gfx.o gfx/drivers_font/sixel_font.o \ gfx/drivers_context/sixel_ctx.o LIBS += -lsixel @@ -1023,15 +1073,15 @@ endif ifeq ($(HAVE_PLAIN_DRM), 1) OBJ += gfx/drivers/drm_gfx.o - CFLAGS += -I/usr/include/libdrm + DEF_FLAGS += -I/usr/include/libdrm LIBS += -ldrm endif ifeq ($(HAVE_GL_CONTEXT), 1) DEFINES += -DHAVE_OPENGL -DHAVE_GLSL OBJ += gfx/drivers/gl.o \ - gfx/drivers_renderchain/gl2_renderchain.o \ - $(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \ + gfx/drivers_renderchain/gl2_renderchain.o \ + $(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \ gfx/common/gl_common.o \ gfx/drivers_font/gl_raster_font.o \ $(LIBRETRO_COMM_DIR)/glsym/rglgen.o @@ -1069,38 +1119,41 @@ ifeq ($(HAVE_GL_CONTEXT), 1) LIBS += $(EGL_LIBS) endif endif + ifeq ($(HAVE_OSMESA), 1) OBJ += gfx/drivers_context/osmesa_ctx.o LIBS += -lOSMesa endif -ifeq ($(HAVE_FFMPEG), 1) -ifneq ($(C89_BUILD), 1) -ifneq ($(HAVE_OPENGLES), 1) - OBJ += cores/libretro-ffmpeg/ffmpeg_fft.o - DEFINES += -I$(DEPS_DIR) -DHAVE_GL_FFT -endif -endif -endif -ifeq ($(HAVE_METAL), 1) - DEFINES += -DHAVE_METAL - OBJ += gfx/common/metal/Context.o \ - gfx/common/metal/Filter.o \ - gfx/common/metal/RendererCommon.o \ - gfx/common/metal/View.o \ - gfx/common/metal/TexturedView.o \ - gfx/common/metal/MenuDisplay.o \ - gfx/common/metal_common.o \ - gfx/drivers/metal.o \ - menu/drivers_display/menu_display_metal.o \ - gfx/drivers_font/metal_raster_font.o -endif + ifeq ($(HAVE_FFMPEG), 1) + ifneq ($(HAVE_OPENGLES), 1) + OBJ += cores/libretro-ffmpeg/ffmpeg_fft.o + DEFINES += -I$(DEPS_DIR) -DHAVE_GL_FFT + endif + endif -ifeq ($(HAVE_MPV), 1) - OBJ += cores/libretro-mpv/mpv-libretro.o - DEFINES += -I$(DEPS_DIR) -DHAVE_MPV - LIBS += -lmpv -endif + ifeq ($(HAVE_METAL), 1) + DEFINES += -DHAVE_METAL + OBJ += gfx/common/metal/Context.o \ + gfx/common/metal/Filter.o \ + gfx/common/metal/RendererCommon.o \ + gfx/common/metal/View.o \ + gfx/common/metal/TexturedView.o \ + gfx/common/metal/MenuDisplay.o \ + gfx/common/metal_common.o \ + gfx/drivers/metal.o \ + gfx/drivers_font/metal_raster_font.o + + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_metal.o + endif + endif + + ifeq ($(HAVE_MPV), 1) + OBJ += cores/libretro-mpv/mpv-libretro.o + DEFINES += -I$(DEPS_DIR) -DHAVE_MPV + LIBS += -lmpv + endif ifeq ($(HAVE_OPENGLES), 1) LIBS += $(OPENGLES_LIBS) @@ -1126,7 +1179,6 @@ endif endif OBJ += gfx/drivers_shader/shader_glsl.o - DEFINES += -DHAVE_GLSL endif ifeq ($(HAVE_EGL), 1) @@ -1136,36 +1188,27 @@ ifeq ($(HAVE_EGL), 1) endif ifeq ($(HAVE_SDL2), 1) - HAVE_SDL=0 -endif - -ifeq ($(HAVE_SDL), 1) - OBJ += gfx/drivers/sdl_gfx.o \ - input/drivers/sdl_input.o \ - input/drivers_joypad/sdl_joypad.o \ - audio/drivers/sdl_audio.o - - ifeq ($(HAVE_GL_CONTEXT), 1) - OBJ += gfx/drivers_context/sdl_gl_ctx.o - endif - - DEFINES += $(SDL_CFLAGS) $(BSD_LOCAL_INC) + HAVE_SDL_COMMON = 1 + OBJ += gfx/drivers/sdl2_gfx.o + DEFINES += $(SDL2_CFLAGS) + LIBS += $(SDL2_LIBS) +else ifeq ($(HAVE_SDL), 1) + HAVE_SDL_COMMON = 1 + OBJ += gfx/drivers/sdl_gfx.o + DEFINES += $(SDL_CFLAGS) LIBS += $(SDL_LIBS) endif -ifeq ($(HAVE_SDL2), 1) - OBJ += gfx/drivers/sdl2_gfx.o \ - input/drivers/sdl_input.o \ +ifeq ($(HAVE_SDL_COMMON), 1) + OBJ += input/drivers/sdl_input.o \ input/drivers_joypad/sdl_joypad.o \ audio/drivers/sdl_audio.o ifeq ($(HAVE_GL_CONTEXT), 1) - OBJ += gfx/drivers_context/sdl_gl_ctx.o + OBJ += gfx/drivers_context/sdl_gl_ctx.o endif - DEFINES += $(SDL2_CFLAGS) $(BSD_LOCAL_INC) - LIBS += $(SDL2_LIBS) - HAVE_SDL = 0 + DEFINES += $(BSD_LOCAL_INC) endif ifeq ($(HAVE_XSHM), 1) @@ -1220,8 +1263,6 @@ endif ifeq ($(HAVE_DISPMANX), 1) OBJ += gfx/drivers/dispmanx_gfx.o HAVE_VIDEOCORE = 1 - LIBS += $(DISPMANX_LIBS) - DEFINES += $(DISPMANX_CFLAGS) endif ifeq ($(HAVE_SUNXI), 1) @@ -1248,19 +1289,19 @@ ifeq ($(HAVE_CG), 1) endif ifeq ($(HAVE_D3D9), 1) - HAVE_D3D_COMMON = 1 - HAVE_D3DX = 1 + HAVE_D3D_COMMON = 1 + HAVE_D3DX = 1 DEFINES += -DHAVE_D3D9 -ifeq ($(HAVE_D3DX), 1) - DEFINES += -DHAVE_D3DX -endif -ifneq ($(HAVE_DYLIB), 1) - LIBS += -ld3d9 -ifeq ($(HAVE_D3DX), 1) - LIBS += -ld3dx9 -endif -endif - HAVE_DX_COMMON = 1 + ifeq ($(HAVE_D3DX), 1) + DEFINES += -DHAVE_D3DX + endif + ifneq ($(HAVE_DYLIB), 1) + LIBS += -ld3d9 + ifeq ($(HAVE_D3DX), 1) + LIBS += -ld3dx9 + endif + endif + HAVE_DX_COMMON = 1 OBJ += gfx/drivers_font/d3d_w32_font.o ifeq ($(HAVE_CG), 1) LIBS += -lcgD3D9 @@ -1274,17 +1315,21 @@ endif ifeq ($(HAVE_D3D10), 1) OBJ += gfx/drivers/d3d10.o \ - gfx/common/d3d10_common.o \ - gfx/drivers_font/d3d10_font.o \ - menu/drivers_display/menu_display_d3d10.o + gfx/common/d3d10_common.o \ + gfx/drivers_font/d3d10_font.o + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_d3d10.o + endif DEFINES += -DHAVE_D3D10 endif ifeq ($(HAVE_D3D11), 1) OBJ += gfx/drivers/d3d11.o \ - gfx/common/d3d11_common.o \ - gfx/drivers_font/d3d11_font.o \ - menu/drivers_display/menu_display_d3d11.o + gfx/common/d3d11_common.o \ + gfx/drivers_font/d3d11_font.o + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_d3d11.o + endif DEFINES += -DHAVE_D3D11 HAVE_SLANG = 1 HAVE_GLSLANG = 1 @@ -1293,9 +1338,11 @@ endif ifeq ($(HAVE_D3D12), 1) OBJ += gfx/drivers/d3d12.o \ - gfx/common/d3d12_common.o \ - gfx/drivers_font/d3d12_font.o \ - menu/drivers_display/menu_display_d3d12.o + gfx/common/d3d12_common.o \ + gfx/drivers_font/d3d12_font.o + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_d3d12.o + endif DEFINES += -DHAVE_D3D12 HAVE_SLANG = 1 HAVE_GLSLANG = 1 @@ -1305,49 +1352,49 @@ endif ifneq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),) INCLUDE_DIRS += -isystemgfx/include/dxsdk OBJ += gfx/common/d3dcompiler_common.o \ - gfx/common/dxgi_common.o - CFLAGS += -Wno-unknown-pragmas + gfx/common/dxgi_common.o + DEF_FLAGS += -Wno-unknown-pragmas endif ifeq ($(HAVE_D3D8), 1) - HAVE_D3D_COMMON = 1 + HAVE_D3D_COMMON = 1 HAVE_DX_COMMON = 1 DEFINES += -DHAVE_D3D8 -ifneq ($(HAVE_DYLIB), 1) - LIBS += -ld3d8 -ifeq ($(HAVE_D3DX), 1) - LIBS += -ld3dx8 -endif -endif + ifneq ($(HAVE_DYLIB), 1) + LIBS += -ld3d8 + ifeq ($(HAVE_D3DX), 1) + LIBS += -ld3dx8 + endif + endif endif ifeq ($(HAVE_DX_COMMON), 1) - LIBS += -ldxguid + LIBS += -ldxguid endif ifeq ($(HAVE_D3D8), 1) - DEFINES += -DHAVE_D3D8 - OBJ += gfx/drivers/d3d8.o - OBJ += gfx/common/d3d8_common.o + DEFINES += -DHAVE_D3D8 + OBJ += gfx/drivers/d3d8.o + OBJ += gfx/common/d3d8_common.o -ifeq ($(HAVE_MENU_COMMON), 1) - OBJ += menu/drivers_display/menu_display_d3d8.o -endif + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_d3d8.o + endif endif ifeq ($(HAVE_D3D9), 1) - DEFINES += -DHAVE_D3D9 - OBJ += gfx/drivers/d3d9.o - OBJ += gfx/common/d3d9_common.o + DEFINES += -DHAVE_D3D9 + OBJ += gfx/drivers/d3d9.o + OBJ += gfx/common/d3d9_common.o -ifeq ($(HAVE_MENU_COMMON), 1) - OBJ += menu/drivers_display/menu_display_d3d9.o -endif + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_d3d9.o + endif endif ifeq ($(HAVE_D3D_COMMON), 1) - DEFINES += -DHAVE_D3D - OBJ += gfx/common/d3d_common.o + DEFINES += -DHAVE_D3D + OBJ += gfx/common/d3d_common.o endif ifeq ($(HAVE_SLANG),1) @@ -1359,7 +1406,7 @@ ifeq ($(HAVE_SLANG),1) endif ifeq ($(HAVE_GLSLANG), 1) - DEFINES += -DHAVE_GLSLANG + DEFINES += -DHAVE_GLSLANG ifneq ($(findstring Win32,$(OS)),) GLSLANG_PLATFORM := Windows @@ -1385,17 +1432,16 @@ ifeq ($(HAVE_GLSLANG), 1) $(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \ $(wildcard $(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp) -ifneq ($(findstring Win32,$(OS)),) -DEFINES += -DENABLE_HLSL -GLSLANG_SOURCES += $(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp) -endif - + ifneq ($(findstring Win32,$(OS)),) + DEFINES += -DENABLE_HLSL + GLSLANG_SOURCES += $(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp) + endif OBJ += $(GLSLANG_SOURCES:.cpp=.o) endif ifeq ($(HAVE_SPIRV_CROSS), 1) - DEFINES += -DHAVE_SPIRV_CROSS + DEFINES += -DHAVE_SPIRV_CROSS INCLUDE_DIRS += -I$(DEPS_DIR)/SPIRV-Cross OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_cross.o OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_cfg.o @@ -1405,7 +1451,7 @@ ifeq ($(HAVE_SPIRV_CROSS), 1) endif ifeq ($(WANT_WGL), 1) - OBJ += gfx/drivers_context/wgl_ctx.o + OBJ += gfx/drivers_context/wgl_ctx.o LIBS += -lcomctl32 endif @@ -1423,7 +1469,7 @@ OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file.o \ $(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.o ifeq ($(HAVE_7ZIP),1) - CFLAGS += -I$(DEPS_DIR)/7zip + DEF_FLAGS += -I$(DEPS_DIR)/7zip HAVE_COMPRESSION = 1 DEFINES += -DHAVE_7ZIP -D_7ZIP_ST 7ZOBJ = $(DEPS_DIR)/7zip/7zIn.o \ @@ -1439,9 +1485,9 @@ ifeq ($(HAVE_7ZIP),1) $(DEPS_DIR)/7zip/Bcj2.o \ $(DEPS_DIR)/7zip/7zCrc.o \ $(DEPS_DIR)/7zip/Lzma2Dec.o \ - $(DEPS_DIR)/7zip/7zBuf.o + $(DEPS_DIR)/7zip/7zBuf.o OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_7z.o \ - $(7ZOBJ) + $(7ZOBJ) endif ifeq ($(HAVE_IBXM), 1) @@ -1451,9 +1497,9 @@ endif ifeq ($(HAVE_BUILTINFLAC),1) HAVE_FLAC = 1 - DEFINES += -DHAVE_DR_FLAC -I$(DEPS_DIR) - CFLAGS += -DHAVE_DR_FLAC - CFLAGS += -DHAVE_FLAC -I$(DEPS_DIR)/libFLAC/include + DEFINES += -DHAVE_DR_FLAC -I$(DEPS_DIR) + DEF_FLAGS += -DHAVE_DR_FLAC + DEF_FLAGS += -DHAVE_FLAC -I$(DEPS_DIR)/libFLAC/include DEFINES += -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 \ -DFLAC_PACKAGE_VERSION="\"retroarch\"" FLACOBJ = $(DEPS_DIR)/libFLAC/bitmath.o \ @@ -1511,8 +1557,8 @@ ifeq ($(HAVE_ZLIB), 1) endif ifeq ($(HAVE_CHD), 1) - CFLAGS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr - DEFINES += -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR + DEF_FLAGS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr + DEFINES += -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_bitstream.o \ $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_cdrom.o \ $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_chd.o \ @@ -1521,7 +1567,7 @@ ifeq ($(HAVE_CHD), 1) ifeq ($(HAVE_FLAC), 1) OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac.o \ - $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac_codec.o + $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac_codec.o endif ifeq ($(HAVE_7ZIP), 1) @@ -1563,18 +1609,24 @@ ifdef HAVE_COMPRESSION DEFINES += -DHAVE_COMPRESSION endif +# Easter Egg +ifeq ($(HAVE_EASTEREGG),1) + DEFINES += -DHAVE_EASTEREGG + OBJ += cores/libretro-gong/gong.o +endif + # Video4Linux 2 ifeq ($(HAVE_V4L2),1) OBJ += camera/drivers/video4linux2.o -ifeq ($(HAVE_VIDEO_PROCESSOR),1) - OBJ += cores/libretro-video-processor/video_processor_v4l2.o -endif + ifeq ($(HAVE_VIDEOPROCESSOR),1) + DEFINES += -DHAVE_VIDEOPROCESSOR + OBJ += cores/libretro-video-processor/video_processor_v4l2.o + endif DEFINES += -DHAVE_V4L2 LIBS += $(V4L2_LIBS) endif - # Things that depend on network availability ifeq ($(HAVE_NETWORKING), 1) @@ -1583,25 +1635,25 @@ ifeq ($(HAVE_NETWORKING), 1) $(LIBRETRO_COMM_DIR)/net/net_http.o \ $(LIBRETRO_COMM_DIR)/net/net_http_parse.o \ $(LIBRETRO_COMM_DIR)/net/net_socket.o \ - $(LIBRETRO_COMM_DIR)/net/net_natt.o \ - network/net_http_special.o \ - tasks/task_http.o \ - tasks/task_netplay_lan_scan.o \ - tasks/task_netplay_nat_traversal.o \ - tasks/task_wifi.o \ - tasks/task_netplay_find_content.o + $(LIBRETRO_COMM_DIR)/net/net_natt.o \ + network/net_http_special.o \ + tasks/task_http.o \ + tasks/task_netplay_lan_scan.o \ + tasks/task_netplay_nat_traversal.o \ + tasks/task_wifi.o \ + tasks/task_netplay_find_content.o ifeq ($(HAVE_SSL), 1) - OBJ += $(LIBRETRO_COMM_DIR)/net/net_socket_ssl.o + OBJ += $(LIBRETRO_COMM_DIR)/net/net_socket_ssl.o endif ifneq ($(HAVE_SOCKET_LEGACY),1) - OBJ += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o + OBJ += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o endif ifeq ($(WANT_IFADDRS), 1) - DEFINES += -DWANT_IFADDRS - OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_ifaddrs.o + DEFINES += -DWANT_IFADDRS + OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_ifaddrs.o endif ifneq ($(findstring Win32,$(OS)),) @@ -1611,91 +1663,118 @@ ifeq ($(HAVE_NETWORKING), 1) # Netplay DEFINES += -DHAVE_NETWORK_CMD OBJ += network/netplay/netplay_delta.o \ - network/netplay/netplay_frontend.o \ - network/netplay/netplay_handshake.o \ - network/netplay/netplay_init.o \ - network/netplay/netplay_io.o \ - network/netplay/netplay_keyboard.o \ - network/netplay/netplay_sync.o \ - network/netplay/netplay_discovery.o \ - network/netplay/netplay_buf.o \ - network/netplay/netplay_room_parse.o + network/netplay/netplay_frontend.o \ + network/netplay/netplay_handshake.o \ + network/netplay/netplay_init.o \ + network/netplay/netplay_io.o \ + network/netplay/netplay_keyboard.o \ + network/netplay/netplay_sync.o \ + network/netplay/netplay_discovery.o \ + network/netplay/netplay_buf.o \ + network/netplay/netplay_room_parse.o - # Retro Achievements + # RetroAchievements ifeq ($(HAVE_CHEEVOS), 1) DEFINES += -DHAVE_CHEEVOS - - OBJ += cheevos/cheevos.o \ - cheevos/badges.o \ - cheevos/var.o \ - cheevos/cond.o + ifeq ($(HAVE_NEW_CHEEVOS), 1) + DEFINES += -DHAVE_NEW_CHEEVOS \ + -Ideps/rcheevos/include \ + -Ideps/lua/src + OBJ += cheevos-new/cheevos.o \ + cheevos-new/badges.o \ + cheevos-new/fixup.o \ + cheevos-new/parser.o \ + cheevos-new/hash.o \ + deps/rcheevos/src/rcheevos/trigger.o \ + deps/rcheevos/src/rcheevos/condset.o \ + deps/rcheevos/src/rcheevos/condition.o \ + deps/rcheevos/src/rcheevos/operand.o \ + deps/rcheevos/src/rcheevos/term.o \ + deps/rcheevos/src/rcheevos/expression.o \ + deps/rcheevos/src/rcheevos/value.o \ + deps/rcheevos/src/rcheevos/lboard.o \ + deps/rcheevos/src/rcheevos/alloc.o \ + deps/rcheevos/src/rcheevos/format.o \ + deps/rcheevos/src/rurl/url.o - ifeq ($(HAVE_LUA), 1) - DEFINES += -DHAVE_LUA \ - -DLUA_32BITS \ - -Ideps/lua/src - OBJ += deps/lua/src/lapi.o \ - deps/lua/src/lcode.o \ - deps/lua/src/lctype.o \ - deps/lua/src/ldebug.o \ - deps/lua/src/ldo.o \ - deps/lua/src/ldump.o \ - deps/lua/src/lfunc.o \ - deps/lua/src/lgc.o \ - deps/lua/src/llex.o \ - deps/lua/src/lmem.o \ - deps/lua/src/lobject.o \ - deps/lua/src/lopcodes.o \ - deps/lua/src/lparser.o \ - deps/lua/src/lstate.o \ - deps/lua/src/lstring.o \ - deps/lua/src/ltable.o \ - deps/lua/src/ltm.o \ - deps/lua/src/lundump.o \ - deps/lua/src/lvm.o \ - deps/lua/src/lzio.o \ - deps/lua/src/lauxlib.o \ - deps/lua/src/lbaselib.o \ - deps/lua/src/lbitlib.o \ - deps/lua/src/lcorolib.o \ - deps/lua/src/ldblib.o \ - deps/lua/src/liolib.o \ - deps/lua/src/lmathlib.o \ - deps/lua/src/loslib.o \ - deps/lua/src/lstrlib.o \ - deps/lua/src/ltablib.o \ - deps/lua/src/lutf8lib.o \ - deps/lua/src/loadlib.o \ - deps/lua/src/linit.o - else - DEFINES += -DRC_DISABLE_LUA + ifeq ($(HAVE_LUA), 1) + DEFINES += -DHAVE_LUA \ + -DLUA_32BITS \ + -Ideps/lua/src + OBJ += deps/lua/src/lapi.o \ + deps/lua/src/lcode.o \ + deps/lua/src/lctype.o \ + deps/lua/src/ldebug.o \ + deps/lua/src/ldo.o \ + deps/lua/src/ldump.o \ + deps/lua/src/lfunc.o \ + deps/lua/src/lgc.o \ + deps/lua/src/llex.o \ + deps/lua/src/lmem.o \ + deps/lua/src/lobject.o \ + deps/lua/src/lopcodes.o \ + deps/lua/src/lparser.o \ + deps/lua/src/lstate.o \ + deps/lua/src/lstring.o \ + deps/lua/src/ltable.o \ + deps/lua/src/ltm.o \ + deps/lua/src/lundump.o \ + deps/lua/src/lvm.o \ + deps/lua/src/lzio.o \ + deps/lua/src/lauxlib.o \ + deps/lua/src/lbaselib.o \ + deps/lua/src/lbitlib.o \ + deps/lua/src/lcorolib.o \ + deps/lua/src/ldblib.o \ + deps/lua/src/liolib.o \ + deps/lua/src/lmathlib.o \ + deps/lua/src/loslib.o \ + deps/lua/src/lstrlib.o \ + deps/lua/src/ltablib.o \ + deps/lua/src/lutf8lib.o \ + deps/lua/src/loadlib.o \ + deps/lua/src/linit.o + else + DEFINES += -DRC_DISABLE_LUA + endif + + # if not HAVE_NEW_CHEEVOS + else + OBJ += cheevos/cheevos.o \ + cheevos/badges.o \ + cheevos/var.o \ + cheevos/cond.o + endif endif - endif - ifeq ($(HAVE_DISCORD), 1) NEED_CXX_LINKER = 1 DEFINES += -DHAVE_DISCORD DEFINES += -Ideps/discord-rpc/include/ -Ideps/discord-rpc/thirdparty/rapidjson-1.1.0/include/ - OBJ += deps/discord-rpc/src/discord_rpc.o \ - deps/discord-rpc/src/rpc_connection.o \ - deps/discord-rpc/src/serialization.o \ - discord/discord.o -ifneq ($(findstring Win32,$(OS)),) - OBJ += deps/discord-rpc/src/discord_register_win.o \ - deps/discord-rpc/src/connection_win.o - LIBS += -lpsapi -ladvapi32 -endif -ifneq ($(findstring Linux,$(OS)),) - OBJ += deps/discord-rpc/src/discord_register_linux.o \ - deps/discord-rpc/src/connection_unix.o -endif -ifneq ($(findstring Darwin,$(OS)),) - OBJ += deps/discord-rpc/src/discord_register_osx.o \ - deps/discord-rpc/src/connection_unix.o -endif + ifneq ($(HAVE_THREADS), 1) + DEFINES += -DDISCORD_DISABLE_IO_THREAD + endif + + OBJ += deps/discord-rpc/src/discord_rpc.o \ + deps/discord-rpc/src/rpc_connection.o \ + deps/discord-rpc/src/serialization.o \ + discord/discord.o + + ifneq ($(findstring Win32,$(OS)),) + OBJ += deps/discord-rpc/src/discord_register_win.o \ + deps/discord-rpc/src/connection_win.o + LIBS += -lpsapi -ladvapi32 + endif + ifneq ($(findstring Linux,$(OS)),) + OBJ += deps/discord-rpc/src/discord_register_linux.o \ + deps/discord-rpc/src/connection_unix.o + endif + ifneq ($(findstring Darwin,$(OS)),) + OBJ += deps/discord-rpc/src/discord_register_osx.o \ + deps/discord-rpc/src/connection_unix.o + endif endif ifeq ($(HAVE_NETWORKGAMEPAD), 1) @@ -1733,19 +1812,21 @@ ifneq ($(findstring Win32,$(OS)),) OBJ += gfx/drivers/gdi_gfx.o \ gfx/drivers_context/gdi_ctx.o \ gfx/drivers_font/gdi_font.o \ - gfx/display_servers/dispserv_win32.o \ - menu/drivers_display/menu_display_gdi.o + gfx/display_servers/dispserv_win32.o + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_gdi.o + endif LIBS += -lmsimg32 -lhid -lsetupapi endif ifeq ($(HAVE_AVFOUNDATION), 1) -ifeq ($(HAVE_COCOA), 1) - DEFINES += -DHAVE_AVFOUNDATION - LIBS += -framework AVFoundation - LIBS += -framework CoreVideo - LIBS += -framework CoreMedia -endif + ifeq ($(HAVE_COCOA), 1) + DEFINES += -DHAVE_AVFOUNDATION + LIBS += -framework AVFoundation + LIBS += -framework CoreVideo + LIBS += -framework CoreMedia + endif endif # Record @@ -1754,13 +1835,11 @@ ifeq ($(HAVE_FFMPEG), 1) OBJ += record/drivers/record_ffmpeg.o \ cores/libretro-ffmpeg/ffmpeg_core.o - LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS) DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS) DEFINES += -Wno-deprecated-declarations -DHAVE_FFMPEG -Iffmpeg endif - ifeq ($(HAVE_COMPRESSION), 1) DEFINES += -DHAVE_COMPRESSION OBJ += tasks/task_decompress.o @@ -1769,20 +1848,23 @@ endif ifeq ($(HAVE_COCOA),1) DEFINES += -DHAVE_MAIN OBJ += input/drivers/cocoa_input.o \ - input/drivers_keyboard/keyboard_event_apple.o \ - ui/drivers/ui_cocoa.o \ - ui/drivers/cocoa/ui_cocoa_window.o \ - ui/drivers/cocoa/ui_cocoa_browser_window.o \ - ui/drivers/cocoa/ui_cocoa_msg_window.o \ - ui/drivers/cocoa/ui_cocoa_application.o \ - ui/drivers/cocoa/cocoa_common.o \ - gfx/drivers_context/cocoa_gl_ctx.o + input/drivers_keyboard/keyboard_event_apple.o \ + ui/drivers/ui_cocoa.o \ + ui/drivers/cocoa/ui_cocoa_window.o \ + ui/drivers/cocoa/ui_cocoa_browser_window.o \ + ui/drivers/cocoa/ui_cocoa_msg_window.o \ + ui/drivers/cocoa/ui_cocoa_application.o \ + ui/drivers/cocoa/cocoa_common.o \ + gfx/drivers_context/cocoa_gl_ctx.o endif ifneq ($(findstring DOS,$(OS)),) - OBJ += gfx/drivers/vga_gfx.o gfx/drivers_font/vga_font.o \ - input/drivers/dos_input.o input/drivers_joypad/dos_joypad.o \ - frontend/drivers/platform_dos.o input/drivers_keyboard/keyboard_event_dos.o + OBJ += gfx/drivers/vga_gfx.o \ + gfx/drivers_font/vga_font.o \ + input/drivers/dos_input.o \ + input/drivers_joypad/dos_joypad.o \ + frontend/drivers/platform_dos.o \ + input/drivers_keyboard/keyboard_event_dos.o ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/drivers_display/menu_display_vga.o @@ -1790,52 +1872,88 @@ ifneq ($(findstring DOS,$(OS)),) endif ifeq ($(HAVE_STATIC_VIDEO_FILTERS), 1) -OBJ += gfx/video_filters/2xsai.o \ - gfx/video_filters/super2xsai.o \ - gfx/video_filters/supereagle.o \ - gfx/video_filters/2xbr.o \ - gfx/video_filters/darken.o \ - gfx/video_filters/epx.o \ - gfx/video_filters/scale2x.o \ - gfx/video_filters/blargg_ntsc_snes.o \ - gfx/video_filters/lq2x.o \ - gfx/video_filters/phosphor2x.o + OBJ += gfx/video_filters/2xsai.o \ + gfx/video_filters/super2xsai.o \ + gfx/video_filters/supereagle.o \ + gfx/video_filters/2xbr.o \ + gfx/video_filters/darken.o \ + gfx/video_filters/epx.o \ + gfx/video_filters/scale2x.o \ + gfx/video_filters/blargg_ntsc_snes.o \ + gfx/video_filters/lq2x.o \ + gfx/video_filters/phosphor2x.o \ + gfx/video_filters/normal2x.o endif ifeq ($(WANT_IOSUHAX), 1) -DEFINES += -I$(DEPS_DIR)/libiosuhax -CFLAGS += -I$(DEPS_DIR)/libiosuhax -OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \ - $(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \ - $(DEPS_DIR)/libiosuhax/iosuhax_disc_interface.o + DEFINES += -I$(DEPS_DIR)/libiosuhax + DEF_FLAGS += -I$(DEPS_DIR)/libiosuhax + OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \ + $(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \ + $(DEPS_DIR)/libiosuhax/iosuhax_disc_interface.o endif ifeq ($(WANT_LIBFAT), 1) -DEFINES += -I$(DEPS_DIR)/libfat/include -CFLAGS += -I$(DEPS_DIR)/libfat/include -OBJ += $(DEPS_DIR)/libfat/cache.o \ - $(DEPS_DIR)/libfat/directory.o \ - $(DEPS_DIR)/libfat/disc.o \ - $(DEPS_DIR)/libfat/fatdir.o \ - $(DEPS_DIR)/libfat/fatfile.o \ - $(DEPS_DIR)/libfat/file_allocation_table.o \ - $(DEPS_DIR)/libfat/filetime.o \ - $(DEPS_DIR)/libfat/libfat.o \ - $(DEPS_DIR)/libfat/lock.o \ - $(DEPS_DIR)/libfat/partition.o + DEFINES += -I$(DEPS_DIR)/libfat/include + DEF_FLAGS += -I$(DEPS_DIR)/libfat/include + OBJ += $(DEPS_DIR)/libfat/cache.o \ + $(DEPS_DIR)/libfat/directory.o \ + $(DEPS_DIR)/libfat/disc.o \ + $(DEPS_DIR)/libfat/fatdir.o \ + $(DEPS_DIR)/libfat/fatfile.o \ + $(DEPS_DIR)/libfat/file_allocation_table.o \ + $(DEPS_DIR)/libfat/filetime.o \ + $(DEPS_DIR)/libfat/libfat.o \ + $(DEPS_DIR)/libfat/lock.o \ + $(DEPS_DIR)/libfat/partition.o endif ifeq ($(HAVE_STATIC_AUDIO_FILTERS), 1) -OBJ += libretro-common/audio/dsp_filters/echo.o \ - libretro-common/audio/dsp_filters/eq.o \ - libretro-common/audio/dsp_filters/chorus.o \ - libretro-common/audio/dsp_filters/iir.o \ - libretro-common/audio/dsp_filters/panning.o \ - libretro-common/audio/dsp_filters/phaser.o \ - libretro-common/audio/dsp_filters/reverb.o \ - libretro-common/audio/dsp_filters/wahwah.o + OBJ += libretro-common/audio/dsp_filters/echo.o \ + libretro-common/audio/dsp_filters/eq.o \ + libretro-common/audio/dsp_filters/chorus.o \ + libretro-common/audio/dsp_filters/iir.o \ + libretro-common/audio/dsp_filters/panning.o \ + libretro-common/audio/dsp_filters/phaser.o \ + libretro-common/audio/dsp_filters/reverb.o \ + libretro-common/audio/dsp_filters/wahwah.o endif ifeq ($(HAVE_RPILED), 1) OBJ += led/drivers/led_rpi.o endif + +################################## +### Classic Platform specifics ### +###############WIP################ +# Help at https://modmyclassic.com/comp + +ifeq ($(HAVE_CLASSIC), 1) + DEF_FLAGS += -DHAVE_CLASSIC +endif + +ifeq ($(HAVE_C_A7A7), 1) + C_A7A7_OPT = -Ofast \ + -fno-lto \ + -fdata-sections -ffunction-sections -Wl,--gc-sections \ + -fno-stack-protector -fno-ident -fomit-frame-pointer \ + -falign-functions=1 -falign-jumps=1 -falign-loops=1 \ + -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \ + -fmerge-all-constants -fno-math-errno \ + -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard + DEF_FLAGS += $(C_A7A7_OPT) + ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1) + DEF_FLAGS += -march=armv7-a + else + DEF_FLAGS += -march=armv7ve + # If gcc is 5.0 or later + ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1) + LDFLAGS += -static-libgcc -static-libstdc++ + endif + endif +endif + +ifeq ($(HAVE_HAKCHI), 1) + DEF_FLAGS += -DHAVE_HAKCHI +endif +################################## diff --git a/Makefile.ctr b/Makefile.ctr index 2427e235cc..63d072b6e4 100644 --- a/Makefile.ctr +++ b/Makefile.ctr @@ -53,7 +53,7 @@ ifeq ($(GRIFFIN_BUILD), 1) DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB #DEFINES += -DHAVE_NETWORKING -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_SOCKET_LEGACY -DHAVE_THREADS - #-DHAVE_SSL -DMBEDTLS_SSL_DEBUG_ALL + #-DHAVE_SSL -DHAVE_BUILTINMBEDTLS -DMBEDTLS_SSL_DEBUG_ALL #ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file else HAVE_CC_RESAMPLER = 1 @@ -62,6 +62,7 @@ else HAVE_RPNG = 1 HAVE_RJPEG = 1 HAVE_RBMP = 1 + HAVE_MENU = 1 HAVE_RGUI = 1 HAVE_ZLIB = 1 HAVE_7ZIP = 1 @@ -77,8 +78,10 @@ else #HAVE_SOCKET_LEGACY = 1 #HAVE_THREADS = 1 #HAVE_SSL = 1 + #HAVE_BUILTINMBEDTLS = 1 include Makefile.common + CFLAGS += $(DEF_FLAGS) BLACKLIST := BLACKLIST += input/input_overlay.o BLACKLIST += tasks/task_overlay.o @@ -104,7 +107,6 @@ MAKEROM_ARGS_COMMON = -rsf $(APP_RSF) -exefslogo -elf $(TARGET).elf -icon $(TARG INCDIRS := -I$(CTRULIB)/include LIBDIRS := -L. -L$(CTRULIB)/lib - ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft CFLAGS += -mword-relocations \ @@ -135,7 +137,6 @@ CFLAGS += -I. \ -Ideps/libz \ -Ideps/7zip \ -Ideps/stb \ - -Ideps/rcheevos/include \ -Ilibretro-common/include CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE @@ -148,7 +149,6 @@ LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) CFLAGS += -std=gnu99 -ffast-math - LIBS := $(WHOLE_START) -lretro_ctr $(WHOLE_END) -lm ifeq ($(DEBUG), 1) @@ -157,7 +157,6 @@ else LIBS += -lctru endif - ifeq ($(BUILD_3DSX), 1) TARGET_3DSX := $(TARGET).3dsx $(TARGET).smdh endif @@ -267,7 +266,6 @@ $(TARGET).3ds: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF) $(TARGET).cia: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF) $(MAKEROM) -f cia -o $@ $(MAKEROM_ARGS_COMMON) -DAPP_ENCRYPTED=false - clean: rm -f $(OBJ) rm -f $(TARGET).3dsx @@ -281,5 +279,3 @@ clean: rm -f ctr/3dsx_custom_crt0.o .PHONY: clean - - diff --git a/Makefile.ctr.salamander b/Makefile.ctr.salamander index 2c45a1bfe2..090f4a0c04 100644 --- a/Makefile.ctr.salamander +++ b/Makefile.ctr.salamander @@ -27,6 +27,7 @@ OBJ := ctr/ctr_system.o \ frontend/drivers/platform_null.o \ libretro-common/encodings/encoding_utf.o \ libretro-common/compat/compat_strcasestr.o \ + libretro-common/compat/fopen_utf8.o \ libretro-common/file/file_path.o \ libretro-common/string/stdstring.o \ libretro-common/lists/string_list.o \ @@ -94,10 +95,8 @@ LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) CFLAGS += -std=gnu99 -ffast-math - LIBS := -lctru -lm - ifeq ($(BUILD_3DSX), 1) TARGET_3DSX := $(TARGET).3dsx $(TARGET).smdh endif @@ -220,5 +219,3 @@ clean: rm -f ctr/3dsx_custom_crt0.o .PHONY: clean - - diff --git a/Makefile.emscripten b/Makefile.emscripten index c935759ab1..28d5698702 100644 --- a/Makefile.emscripten +++ b/Makefile.emscripten @@ -16,6 +16,7 @@ HAVE_OPENGLES = 1 HAVE_RJPEG = 0 HAVE_RPNG = 1 HAVE_EMSCRIPTEN = 1 +HAVE_MENU = 1 HAVE_RGUI = 1 HAVE_SDL = 0 HAVE_SDL2 = 0 @@ -57,7 +58,7 @@ endif include Makefile.common -CFLAGS += -Ideps/libz -Ideps -Ideps/stb +CFLAGS += $(DEF_FLAGS) -Ideps/libz -Ideps -Ideps/stb libretro = libretro_emscripten.bc ifneq ($(V), 1) diff --git a/Makefile.griffin b/Makefile.griffin index 03d6d22d8d..c77f6c73c1 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -158,8 +158,6 @@ else ifeq ($(libogc_platform), 1) endif endif - LIBS += -logc - ifeq ($(EXTERNAL_LIBOGC), 1) LIBS += -lfat endif @@ -176,6 +174,8 @@ else ifeq ($(libogc_platform), 1) endif endif + LIBS += -logc + CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int HAVE_RUNAHEAD := 1 @@ -430,8 +430,8 @@ else ifeq ($(platform), windows_msvc2005_x86) CXX = cl.exe LD = link.exe - PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS - LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib + PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -DHAVE_EASTEREGG + LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib msimg32.lib PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH) PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE") @@ -479,7 +479,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform))) LD = link.exe PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS - PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 + PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib PlatformSuffix = $(subst windows_msvc2010_,,$(platform)) @@ -550,7 +550,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform))) LD = link.exe PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS - PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 + PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib PlatformSuffix = $(subst windows_msvc2012_,,$(platform)) @@ -625,7 +625,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform))) LD = link.exe PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS - PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 + PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib PlatformSuffix = $(subst windows_msvc2013_,,$(platform)) @@ -700,7 +700,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform))) LD = link.exe PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS - PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 + PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib PlatformSuffix = $(subst windows_msvc2015_,,$(platform)) @@ -1074,7 +1074,6 @@ overlays-checkout: $(GIT) clone git://github.com/libretro/common-overlays.git $(OVERLAY_DIR); \ fi - clean: rm -f $(EXT_TARGET) rm -f $(EXT_INTER_TARGET) diff --git a/Makefile.libnx b/Makefile.libnx index d417ee1a5e..a15b596cde 100644 --- a/Makefile.libnx +++ b/Makefile.libnx @@ -1,3 +1,5 @@ +include version.all + #--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- @@ -20,7 +22,7 @@ OBJ := # For threading we need to overwrite some vars with global defines because devkitPro's includes # make it hard for us. This works for the pthread wrapper DEFINES_THREAD := -Dpthread_t=Thread -Dpthread_mutex_t=Mutex -Dpthread_mutexattr_t='void*' -Dpthread_attr_t=int -Dpthread_cond_t=CondVar -Dpthread_condattr_t='int' -D_SYS__PTHREADTYPES_H_ -DEFINES := -D__SWITCH__=1 -U__linux__ -U__linux -DGLM_FORCE_PURE=1 -DRARCH_CONSOLE -DRARCH_INTERNAL -DGLOBAL_CONFIG_DIR='"/switch"' $(DEFINES_THREAD) +DEFINES := -D__SWITCH__=1 -U__linux__ -U__linux -DGLM_FORCE_PURE=1 -DRARCH_CONSOLE -DRARCH_INTERNAL -DGLOBAL_CONFIG_DIR='"/switch"' $(DEFINES_THREAD) -DHAVE_STB_VORBIS HAVE_CC_RESAMPLER = 1 HAVE_MENU_COMMON = 1 @@ -39,6 +41,8 @@ HAVE_NETWORKING = 1 HAVE_NETPLAYDISCOVERY = 1 HAVE_STB_FONT = 1 HAVE_CHEEVOS = 1 +HAVE_CHD = 0 # disabled due to static libretro-common and libchdr conflicts between different cores +HAVE_STB_VORBIS = 1 # RetroArch libnx useful flags HAVE_THREADS = 1 @@ -56,9 +60,8 @@ ifeq ($(HAVE_OPENGL), 1) HAVE_RGUI = 1 HAVE_MATERIALUI = 1 - HAVE_ZARCH = 0 HAVE_XMB = 1 - HAVE_STRIPES = 0 + HAVE_OZONE = 1 HAVE_OVERLAY = 1 else @@ -67,6 +70,7 @@ else HAVE_ZARCH = 0 HAVE_MATERIALUI = 0 HAVE_XMB = 0 + HAVE_OZONE = 0 HAVE_STRIPES = 0 endif @@ -104,7 +108,7 @@ EXEFS_SRC := exefs_src #ROMFS := switch/romfs APP_TITLE := RetroArch -APP_VERSION := 1.7.5 +APP_VERSION := $(RARCH_VERSION) APP_AUTHOR := libretro Team APP_ICON := pkg/libnx/retroarch.jpg @@ -222,7 +226,8 @@ ifneq ($(ROMFS),) export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS) endif -DEPENDS := $(OFILES:.o=.d) +DEPENDS_TMP := $(OFILES:.o=.d) +DEPENDS := $(filter-out libretro_libnx.a,$(DEPENDS_TMP)) .PHONY: clean all @@ -244,7 +249,7 @@ endif $(OUTPUT).elf : $(OBJ) clean: - rm -f $(OBJ) $(OUTPUT).pfs0 $(OUTPUT).nro $(OUTPUT).elf + rm -f $(DEPENDS) $(OBJ) $(OUTPUT).pfs0 $(OUTPUT).nro $(OUTPUT).elf #--------------------------------------------------------------------------------- # you need a rule like this for each extension you use as binary data diff --git a/Makefile.libogc b/Makefile.libogc index 77d3bf6c5f..70c846c461 100644 --- a/Makefile.libogc +++ b/Makefile.libogc @@ -45,7 +45,6 @@ export CXX := $(PREFIX)g++ export AR := $(PREFIX)ar export OBJCOPY := $(PREFIX)objcopy - ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH)) #--------------------------------------------------------------------------------- @@ -131,7 +130,6 @@ INCLUDES := $(DEFINCS) \ MACHDEP := -DBIGENDIAN -DGEKKO -mcpu=750 -meabi -msdata=eabi -mhard-float -ffunction-sections -fdata-sections - ifeq ($(PLATFORM),wii) MACHDEP += -DHW_RVL endif @@ -159,7 +157,6 @@ VPATH := $(LWIPDIR) \ $(LIBWIIKEYB) \ $(STUBSDIR) - #--------------------------------------------------------------------------------- SOURCES_LWIP := $(LWIPDIR)/network.c \ $(LWIPDIR)/netio.c \ @@ -264,7 +261,6 @@ SOURCES_OGC_ASM := $(OGCDIR)/cache_asm.S \ $(OGCDIR)/system_asm.S \ $(OGCDIR)/video_asm.S - ifneq ($(BUILD_LITE), 1) SOURCES_OGC += $(OGCDIR)/dvd.c endif diff --git a/Makefile.msvc b/Makefile.msvc index 3ece3af7a4..02361fe30e 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -7,7 +7,6 @@ ARCH = amd64 BUILD_DIR = objs/msvc CXX_BUILD = 0 - WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING) WindowsSDKVersion := 10.0.14393.0\$(NOTHING) VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING) @@ -30,6 +29,7 @@ HAVE_WINMM := 1 HAVE_RPNG := 1 HAVE_ZLIB := 1 WANT_ZLIB := 1 +HAVE_MENU := 1 HAVE_RGUI := 1 HAVE_XMB := 1 HAVE_MATERIALUI := 1 @@ -59,7 +59,7 @@ HAVE_IMAGEVIEWER := 1 include Makefile.common INCLUDE_DIRS := $(patsubst -isystem%,-I%,$(INCLUDE_DIRS)) -CFLAGS := $(filter-out -Wno-unknown-pragmas,$(CFLAGS)) +CFLAGS := $(filter-out -Wno-unknown-pragmas,$(DEF_FLAGS)) CXXFLAGS := $(filter-out -fpermissive -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses,$(CXXFLAGS)) LIBS := $(filter-out -lstdc++,$(LIBS)) @@ -90,14 +90,12 @@ ifeq ($(ARCH),x86) CROSS = endif - INCLUDE := $(VCINSTALLDIR)include;$(VCINSTALLDIR)atlmfc\include;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um; LIB := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\$(TARGET_ARCH2);$(WindowsSdkDir)lib\$(WindowsSDKVersion)um\$(TARGET_ARCH2);C:\Program Files (x86)\NVIDIA Corporation\Cg\lib.$(TARGET_ARCH2);C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Lib\$(TARGET_ARCH2); LIBPATH := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS); PATH := $(shell IFS=$$'\n'; cygpath "$(VCINSTALLDIR)bin\\$(CROSS)"):$(shell IFS=$$'\n'; cygpath "$(WindowsSdkDir)\bin\\$(ARCH2)"):$(PATH) - export INCLUDE := $(INCLUDE) export LIB := $(LIB) export LIBPATH := $(LIBPATH) @@ -144,7 +142,6 @@ RC = rc.exe LIBS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib LDFLAGS += -nologo -wx -nxcompat -machine:$(TARGET_ARCH2) - ifeq ($(DEBUG),1) FLAGS += -GS -Gy -Od -RTC1 -D_SECURE_SCL=1 -Zi FLAGS += -MDd @@ -155,7 +152,6 @@ else FLAGS += -MD endif - ifeq ($(DEBUG),1) BUILD_DIR := $(BUILD_DIR)-debug endif @@ -170,7 +166,6 @@ ifneq ($(V), 1) Q := @ endif - ifeq ($(GRIFFIN_BUILD), 1) OBJ := griffin/griffin.o griffin/griffin_cpp.o DEFINES += -DHAVE_GRIFFIN -DUSE_MATH_DEFINES @@ -188,9 +183,6 @@ OBJ := $(patsubst %rarch.o,%rarch.res,$(OBJ)) OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ)) OBJ := $(OBJ:.o=.obj) - - - LDFLAGS += -WX -SUBSYSTEM:WINDOWS -ENTRY:mainCRTStartup DEFINES := $(patsubst -f%,,$(DEFINES)) @@ -198,7 +190,6 @@ LDFLAGS := $(patsubst -l%,%.lib,$(LDFLAGS)) LIBS := $(filter-out -lm,$(LIBS)) LIBS := $(patsubst -l%,%.lib,$(LIBS)) - #$(info INCLUDE_DIRS : $(INCLUDE_DIRS)) #$(info DEFINES : $(DEFINES)) #$(info CFLAGS : $(CFLAGS)) diff --git a/Makefile.nintendoc b/Makefile.nintendoc deleted file mode 100644 index 4f971984a4..0000000000 --- a/Makefile.nintendoc +++ /dev/null @@ -1,62 +0,0 @@ -# Hakchi version added to ease confusion amongst Hakchi community due to messy past... -# -# Make sure you have readelf installed (sudo apt-get install readelf) to patch the binary -# Might not be needed for your build but it's a useful tool and for safety it should be -# run anyway to ensure the SDL2 link isn't broken... - -HAKCHI_VER := Hakchi_Retroarch_Neo_v1_7_3b -HAKCHI_NAME := "Hakchi RetroArch 'Neo' v1.7.3b -MOD_CREATOR := TheOtherGuys -MOD_CATEGORY := RetroArch - -HAKCHI_DIR := hakchi -TARGET := retroarch -GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`") - -all: $(TARGET) - -retroarch: - readelf -v #Check if you have readelf installed... (sudo apt-get install readelf) - ./configure --host=arm-linux-gnueabihf --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard - make -f Makefile -j HAVE_HAKCHI=1 - patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary... - #/usr/bin/arm-linux-gnueabihf-strip retroarch - rm -f $(HAKCHI_DIR)/bin/retroarch - cp retroarch $(HAKCHI_DIR)/bin/retroarch - echo $$(echo "Built by: " $$USER @ $$(date) \\\\\\ Git Commit: $(GIT_COMMIT)) > $(HAKCHI_DIR)/etc/libretro/retroarch_version - cp $(HAKCHI_DIR)/readme.md $(HAKCHI_DIR)/readme_COPY.md - printf "%s\n" \ - "---" \ - "Name: $(HAKCHI_VER)" \ - "Creator: $(MOD_CREATOR)" \ - "Category: $(MOD_CATEGORY)" \ - "Version: $(HAKCHI_VER)" \ - "Built on: $(shell date)" \ - "Git commit: $(GIT_COMMIT)" \ - "---" > $(HAKCHI_DIR)/readme.md - cat $(HAKCHI_DIR)/readme_COPY.md >> $(HAKCHI_DIR)/readme.md - rm $(HAKCHI_DIR)/readme_COPY.md - @echo "** BUILDING HAKCHI $(HAKCHI_VER) HMOD PACKAGE **" - cd $(HAKCHI_DIR)/; tar -czvf "$(HAKCHI_VER).hmod" * - mv $(HAKCHI_DIR)/$(HAKCHI_VER).hmod . - @echo "** BUILT HAKCHI $(HAKCHI_VER) HMOD PACKAGE **" -clean: - rm -f *.o - rm -f audio/*.o - rm -f conf/*.o - rm -f gfx/*.o - rm -f gfx/drivers_font/*.o - rm -f gfx/drivers_font_renderer/*.o - rm -f gfx/drivers_context/*.o - rm -f gfx/py_state/*.o - rm -f compat/*.o - rm -f record/*.o - rm -f input/*.o - rm -f tools/*.o - rm -f $(BINDIR)/retroarch - rm -f $(BINDIR)/retroarch-joyconfig - rm -f $(PNDDIR)/readme.html - rm -f retroarch - rm -f $(HAKCHI_DIR)/bin/retroarch - rm -f $(HAKCHI_VER).hmod - rm -f $(HAKCHI_DIR)/etc/libretro/retroarch_version diff --git a/Makefile.orbis b/Makefile.orbis new file mode 100644 index 0000000000..ee0e5a8a44 --- /dev/null +++ b/Makefile.orbis @@ -0,0 +1,167 @@ +TARGET := retroarch_orbis +DEBUG ?= 0 +GRIFFIN_BUILD = 0 +WHOLE_ARCHIVE_LINK = 0 + +PS4_TITLE_ID := RETROARCH +PS4_TITLE_NAME := RetroArch + +PC_DEVELOPMENT_IP_ADDRESS = +PC_DEVELOPMENT_UDP_PORT = + +OBJ := + +DEFINES := + +ifeq ($(GRIFFIN_BUILD), 1) + OBJ += griffin/griffin.o + DEFINES += -DHAVE_GRIFFIN=1 + DEFINES += -DHAVE_MENU -DHAVE_LIBRETRODB + DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER + ifeq ($(DEBUG), 1) + DEFINES += -DHAVE_NETLOGGER + endif +else + + HAVE_FILTERS_BUILTIN := 1 + HAVE_LANGEXTRA := 0 + HAVE_RPNG := 1 + HAVE_RJPEG := 1 + HAVE_RBMP := 1 + HAVE_RTGA := 1 + HAVE_ZLIB := 1 + HAVE_OVERLAY := 1 + HAVE_7ZIP := 1 + HAVE_EGL := 1 + HAVE_OPENGLES := 1 + HAVE_NETWORKING := 0 + HAVE_SOCKET_LEGACY := 0 + HAVE_MENU := 1 + HAVE_MENU_COMMON := 1 + HAVE_RGUI := 0 + HAVE_MATERIALUI := 0 + HAVE_XMB := 1 + HAVE_ZARCH := 0 + HAVE_THREADS := 1 + HAVE_LIBRETRODB := 1 + HAVE_CC_RESAMPLER := 1 + HAVE_CHEEVOS := 1 + RARCH_CONSOLE := 1 + HAVE_STATIC_VIDEO_FILTERS = 1 + HAVE_STATIC_AUDIO_FILTERS = 1 + + ifeq ($(DEBUG), 1) + HAVE_NETLOGGER = 1 + endif + + include Makefile.common + CFLAGS += $(DEF_FLAGS) + BLACKLIST := + OBJ := $(filter-out $(BLACKLIST),$(OBJ)) + + OBJ += input/drivers/ps4_input.o + OBJ += input/drivers_joypad/ps4_joypad.o + OBJ += audio/drivers/psp_audio.o + #OBJ += frontend/drivers/platform_orbis.o +endif + +ifeq ($(strip $(PS4SDK)),) +$(error "Please set PS4SDK in your environment. export PS4SDK=ps4sdk") +endif + +export PATH := $(PATH):$(PS4SDK)/bin + +PREFIX := + +CC := $(PREFIX)clang +CXX := $(PREFIX)clang +AS := $(PREFIX)clang +AR := $(PREFIX)ar +OBJCOPY := $(PREFIX)objcopy +STRIP := $(PREFIX)strip +NM := $(PREFIX)nm +LD := $(CXX) + +INCDIRS := -I. -Ideps/libz -Ideps/7zip -Ilibretro-common/include -Ideps/stb +LIBDIRS := -L. + +ARCHFLAGS := -m64 -DORBIS +CFLAGS += $(ARCHFLAGS) -std=c11 -mcmodel=large -ffreestanding -nostdlib -nostdinc -fno-builtin -fno-stack-protector + +ifeq ($(DEBUG), 1) + CFLAGS += -O2 -g +else + CFLAGS += -O3 +endif + +ASFLAGS := $(ARCHFLAGS) -I$(PS4SDK)/include -target x86_64-scei-ps4-elf -fPIE +LDFLAGS := -O3 -Wall -m64 -nostartfiles -nostdlib -L$(PS4SDK)/lib -pie +ARFLAGS := rcs + +CRTFILE ?= $(PS4SDK)/crt0.s + +CFLAGS += -Wall -pedantic -Wno-zero-length-array -Wno-format-pedantic +CFLAGS += -D__PS4__ -I$(PS4SDK)/include -I $(PS4SDK)/include/sce +CFLAGS += -target x86_64-scei-ps4-elf -fPIE +CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE +CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES) + +ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),) + CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"' +endif + +ifneq ($(PC_DEVELOPMENT_UDP_PORT),) + CFLAGS += -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) +endif + +ifeq ($(WHOLE_ARCHIVE_LINK), 1) + WHOLE_START := -Wl,--whole-archive + WHOLE_END := -Wl,--no-whole-archive +endif +CXXFLAGS := $(CFLAGS) + +PS4_LIBS := -lps4link -ldebugnet -lorbisFile -lelfloader -lorbisKeyboard -lorbis2d -lpng -lz -lorbisGl -lorbisPad -lorbisAudio -lmod -lorbisFileBrowser -lorbisXbmFont -lSceNet_stub -lScePigletv2VSH_stub -lSceSystemService_stub -lSceUserService_stub -lScePad_stub -lSceAudioOut_stub -lSceIme_stub -lSceSysmodule_stub \ + -lPs4_extension_kernel_call_standard -lPs4_extension_kernel_execute_dynlib_prepare_dlclose -lPs4_common_kernel -lPs4_common_user -lPs4_common_generic -lPs4LibCInternalAdaptive_stub -lPs4LibKernelAdaptive_stub -lSceLibcInternal_stub -lkernel_stub -lps4Kernel_stub -lPs4_base_stub_resolve_minimal -lPs4_base_kernel_dlsym_standard -lPs4_base_kernel_seek_elf_address_standard -lPs4_base_assembler_register_parameter_standard -lPs4_base_assembler_system_call_standard + +LIBS := $(WHOLE_START) -lretro_orbis $(WHOLE_END) $(PS4_LIBS) + +TARGETS := $(TARGET).elf + +DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend +POSTCOMPILE = mv -f $*.Tdepend $*.depend + +all: $(TARGETS) + +%.o: %.cpp +%.o: %.cpp %.depend + $(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS) + $(POSTCOMPILE) + +%.o: %.c +%.o: %.c %.depend + $(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS) + $(POSTCOMPILE) + +%.o: %.S +%.o: %.S %.depend + $(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS) + $(POSTCOMPILE) + +%.o: %.s +%.o: %.s %.depend + $(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS) + $(POSTCOMPILE) + +%.depend: ; + +$(TARGET).elf: $(OBJ) libretro_orbis.a + $(LD) $(CRTFILE) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@ + +clean: + rm -f $(OBJ) $(TARGET).elf + rm -f $(OBJ:.o=.depend) + +.PHONY: clean all +.PRECIOUS: %.depend + +-include $(OBJ:.o=.depend) diff --git a/Makefile.pandora b/Makefile.pandora index 5c6da85a7f..33ed75bd69 100644 --- a/Makefile.pandora +++ b/Makefile.pandora @@ -52,4 +52,3 @@ clean: rm -f $(BINDIR)/retroarch-joyconfig rm -f $(PNDDIR)/readme.html rm -f retroarch - diff --git a/Makefile.ps2 b/Makefile.ps2 new file mode 100644 index 0000000000..094536e00c --- /dev/null +++ b/Makefile.ps2 @@ -0,0 +1,114 @@ +BUILD_PRX = 0 +DEBUG = 0 +HAVE_KERNEL_PRX = 0 +HAVE_LOGGER = 0 +HAVE_FILE_LOGGER = 0 +HAVE_THREADS = 0 +BIG_STACK = 0 +MUTE_WARNINGS = 0 +PS2_IP = 192.168.1.150 + +#Configuration for IRX +EE_BIN2O = bin2o +IRX_DIR = $(PS2SDK)/iop/irx + +TARGET = retroarchps2.elf +TARGET_RELEASE = retroarchps2-release.elf + +ifeq ($(DEBUG), 1) + OPTIMIZE_LV := -O0 -g + RARCH_DEFINES += -DDEBUG +else + OPTIMIZE_LV := -O2 + LDFLAGS := -s +endif + +ifeq ($(MUTE_WARNINGS), 1) + DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses +endif + +INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include +INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include +INCDIR += -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper +GPVAL = -G0 +CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant +ASFLAGS = $(CFLAGS) + +RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB +RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER + +LIBDIR = +LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L. +LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lpad -lmc -lhdd -lsdl -lfileXio -lpatches -lpoweroff + +#IRX modules +# IRX modules - modules have to be in IRX_DIR +IRX = iomanX.irx fileXio.irx mcman.irx mcserv.irx usbd.irx usbhdfsd.irx freesd.irx audsrv.irx poweroff.irx ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx +IRX_OBJ = $(IRX:.irx=.o) +EE_OBJS += $(IRX_OBJ) + +ifeq ($(HAVE_THREADS), 1) +RARCH_DEFINES += -DHAVE_THREADS +endif + +ifeq ($(HAVE_FILE_LOGGER), 1) +CFLAGS += -DHAVE_FILE_LOGGER +endif + +ifeq ($(HAVE_KERNEL_PRX), 1) +CFLAGS += -DHAVE_KERNEL_PRX +endif + +ifeq ($(BIG_STACK), 1) +CFLAGS += -DBIG_STACK +endif + +CFLAGS += $(RARCH_DEFINES) + +# Missing objecst on the PS2SDK +EE_OBJS += ps2/compat_files/compat_ctype.o ps2/compat_files/time.o + +#EE_OBJS = griffin/griffin.o bootstrap/ps2/kernel_functions.o +EE_OBJS += griffin/griffin.o + +EE_CFLAGS = $(CFLAGS) +EE_CXXFLAGS = $(CFLAGS) +EE_LDFLAGS = $(LDFLAGS) +EE_LIBS = $(LIBS) +EE_ASFLAGS = $(ASFLAGS) +EE_INCS = $(INCDIR) +EE_IRX_OBJ = $(IRX_OBJ) +EE_BIN = $(TARGET) +EE_GPVAL = $(GPVAL) + +all: $(EE_IRX_OBJ) $(EE_BIN) + +clean: + rm -f $(EE_BIN) $(EE_OBJS) + +prepare: + ps2client -h $(PS2_IP) reset + ps2client -h $(PS2_IP) netdump + +run: + ps2client -h $(PS2_IP) execee host:$(EE_BIN) + +debug: clean prepare all run + +package: + ps2-packer $(EE_BIN) $(TARGET_RELEASE) + +release: clean all package + +#Specific file name and output per IRX Module +$(EE_IRX_OBJ): + $(EE_BIN2O) $(EE_GPVAL) $(IRX_DIR)/$(@:.o=.irx) $@ $(@:.o=_irx) + +#Include preferences +include $(PS2SDK)/samples/Makefile.pref +include $(PS2SDK)/samples/Makefile.eeglobal + +#Linking with C++ +$(EE_BIN): $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o + $(EE_CXX) $(EE_NO_CRT) -T$(PS2SDK)/ee/startup/linkfile $(EE_CXXFLAGS) \ + -o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(EE_OBJS) $(CRTEND_OBJ) $(CRTN_OBJ) $(EE_LDFLAGS) $(EE_LIBS) diff --git a/Makefile.ps3.salamander b/Makefile.ps3.salamander index c769ff105c..37778bf6f4 100644 --- a/Makefile.ps3.salamander +++ b/Makefile.ps3.salamander @@ -55,6 +55,7 @@ PPU_SRCS = frontend/frontend_salamander.c \ libretro-common/encodings/encoding_utf.c \ libretro-common/compat/compat_strl.c \ libretro-common/compat/compat_strcasestr.c \ + libretro-common/compat/fopen_utf8.c \ libretro-common/streams/file_stream.c \ libretro-common/vfs/vfs_implementation.c \ libretro-common/file/config_file.c \ diff --git a/Makefile.psl1ght b/Makefile.psl1ght index 2676bac26d..16e06e4cb0 100644 --- a/Makefile.psl1ght +++ b/Makefile.psl1ght @@ -128,4 +128,3 @@ clean: rm -f $(OBJ) .PHONY: clean - diff --git a/Makefile.psp1 b/Makefile.psp1 index be0ae8e25a..e239278e3c 100644 --- a/Makefile.psp1 +++ b/Makefile.psp1 @@ -49,7 +49,6 @@ endif CFLAGS += $(RARCH_DEFINES) - EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = RetroArch PSP1 diff --git a/Makefile.psp1.salamander b/Makefile.psp1.salamander index 7bcc29a0e8..525d2a1ac6 100644 --- a/Makefile.psp1.salamander +++ b/Makefile.psp1.salamander @@ -42,6 +42,7 @@ OBJS = frontend/frontend_salamander.o \ libretro-common/lists/dir_list.o \ libretro-common/file/retro_dirent.o \ libretro-common/encodings/encoding_utf.o \ + libretro-common/compat/fopen_utf8.o \ libretro-common/compat/compat_strl.o \ libretro-common/compat/compat_strcasestr.o \ libretro-common/file/config_file.o \ diff --git a/Makefile.switch b/Makefile.switch index 0e12f5a448..fb27990459 100644 --- a/Makefile.switch +++ b/Makefile.switch @@ -34,13 +34,13 @@ else HAVE_DYNAMIC = 1 include Makefile.common - BLACKLIST := + CFLAGS += $(DEF_FLAGS) + BLACKLIST := BLACKLIST += input/input_overlay.o - BLACKLIST += tasks/task_overlay.o + BLACKLIST += tasks/task_overlay.o OBJ := $(filter-out $(BLACKLIST),$(OBJ)) endif - ifeq ($(strip $(LIBTRANSISTOR_HOME)),) $(error "Please set LIBTRANSISTOR_HOME in your environment. export LIBTRANSISTOR_HOME=") endif diff --git a/Makefile.vita b/Makefile.vita index 5645c9cabd..abc953ccec 100644 --- a/Makefile.vita +++ b/Makefile.vita @@ -55,6 +55,7 @@ else endif include Makefile.common + CFLAGS += $(DEF_FLAGS) BLACKLIST := OBJ := $(filter-out $(BLACKLIST),$(OBJ)) @@ -64,7 +65,6 @@ else OBJ += frontend/drivers/platform_psp.o endif - ifeq ($(strip $(VITASDK)),) $(error "Please set VITASDK in your environment. export VITASDK=vitasdk") endif @@ -127,7 +127,6 @@ TARGETS := $(TARGET).vpk DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend POSTCOMPILE = mv -f $*.Tdepend $*.depend - all: $(TARGETS) %.o: %.cpp @@ -140,7 +139,6 @@ all: $(TARGETS) $(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS) $(POSTCOMPILE) - %.o: %.S %.o: %.S %.depend $(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS) diff --git a/Makefile.vita.salamander b/Makefile.vita.salamander index a443c2c0f7..20160de36e 100644 --- a/Makefile.vita.salamander +++ b/Makefile.vita.salamander @@ -44,6 +44,7 @@ OBJS = frontend/frontend_salamander.o \ libretro-common/encodings/encoding_utf.o \ libretro-common/compat/compat_strl.o \ libretro-common/compat/compat_strcasestr.o \ + libretro-common/compat/fopen_utf8.o \ libretro-common/file/config_file.o \ libretro-common/streams/file_stream.o \ libretro-common/vfs/vfs_implementation.o \ diff --git a/Makefile.wii.salamander b/Makefile.wii.salamander index e39c30bdc8..9003714261 100644 --- a/Makefile.wii.salamander +++ b/Makefile.wii.salamander @@ -42,12 +42,13 @@ endif MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE) LDFLAGS := $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map -LIBS := -lwiiuse -logc -lbte ifeq ($(EXTERNAL_LIBOGC), 1) -LIBS += -lfat +LIBS := -lfat endif +LIBS += -lwiiuse -logc -lbte + APP_BOOTER_DIR = wii/app_booter OBJ = frontend/frontend_salamander.o \ @@ -66,6 +67,7 @@ OBJ = frontend/frontend_salamander.o \ libretro-common/encodings/encoding_utf.o \ libretro-common/compat/compat_strl.o \ libretro-common/compat/compat_strcasestr.o \ + libretro-common/compat/fopen_utf8.o \ libretro-common/file/config_file.o \ file_path_str.o \ verbosity.o \ diff --git a/Makefile.wiiu b/Makefile.wiiu index e77be12ea9..58412548df 100644 --- a/Makefile.wiiu +++ b/Makefile.wiiu @@ -64,6 +64,7 @@ ifeq ($(SALAMANDER_BUILD),1) OBJ += frontend/drivers/platform_null.o OBJ += libretro-common/encodings/encoding_utf.o OBJ += libretro-common/compat/compat_strcasestr.o + OBJ += libretro-common/compat/fopen_utf8.o OBJ += libretro-common/file/file_path.o OBJ += libretro-common/string/stdstring.o OBJ += libretro-common/lists/string_list.o @@ -115,6 +116,7 @@ endif HAVE_RPNG = 1 HAVE_RJPEG = 1 HAVE_RBMP = 1 + HAVE_MENU = 1 HAVE_RGUI = 1 HAVE_ZLIB = 1 HAVE_7ZIP = 1 @@ -241,7 +243,6 @@ ifneq ($(WANT_IOSUHAX), 1) LIBS += -liosuhax endif - RPX_OBJ = $(BUILD_DIR)/wiiu/system/stubs_rpl.o HBL_ELF_OBJ = $(BUILD_DIR)/wiiu/system/dynamic.o $(BUILD_DIR)/wiiu/system/stubs_elf.o @@ -263,13 +264,11 @@ endif DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)/$*.depend - all: $(TARGETS) %: $(BUILD_DIR)/% cp $< $@ - $(BUILD_DIR)/%.o: %.cpp %.depend @$(if $(Q), echo CXX $<,) @mkdir -p $(dir $@) diff --git a/Makefile.win b/Makefile.win index 02d70bde7f..bdab1a775b 100644 --- a/Makefile.win +++ b/Makefile.win @@ -12,6 +12,7 @@ HAVE_NETPLAYDISCOVERY = 1 HAVE_STDIN_CMD = 1 HAVE_COMMAND = 1 HAVE_THREADS = 1 +HAVE_MENU = 1 HAVE_RGUI = 1 HAVE_MATERIALUI = 1 HAVE_7ZIP = 1 @@ -102,7 +103,6 @@ else WINDRES = windres endif - libretro ?= -lretro ifeq ($(DYNAMIC), 1) @@ -123,7 +123,7 @@ else CXXFLAGS += -O3 -ffast-math endif -CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps +CFLAGS += $(DEF_FLAGS) -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps CXXFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps -std=c++98 -D__STDC_CONSTANT_MACROS ifeq ($(CXX_BUILD), 1) CFLAGS += -std=c++98 -xc++ -D__STDC_CONSTANT_MACROS @@ -172,4 +172,3 @@ clean: rm -f *.d .PHONY: all install uninstall clean - diff --git a/README.md b/README.md index 1e4105cc53..c7fcf261c5 100644 --- a/README.md +++ b/README.md @@ -189,46 +189,46 @@ The default super resolution is 2560. It is displayed just under the CRT switch If native resolutions are activated you will need a whole new set of modelines: -- 512 x 240 @ 50.006977 SNESpal +- 256 x 240 @ 50.006977 SNESpal +- 256 x 448 @ 50.006977 SNESpal - 512 x 224 @ 50.006977 SNESpal +- 512 x 240 @ 50.006977 SNESpal - 512 x 448 @ 50.006977 SNESpal +- 256 x 240 @ 60.098812 SNESntsc +- 256 x 448 @ 60.098812 SNESntsc - 512 x 240 @ 60.098812 SNESntsc - 512 x 224 @ 60.098812 SNESntsc - 512 x 448 @ 60.098812 SNESntsc -- 256 x 240 @ 50.006977 SNESpal -- 256 x 448 @ 50.006977 SNESpal -- 256 x 240 @ 60.098812 SNESntsc -- 256 x 448 @ 60.098812 SNESntsc -- 320 x 240 @ 59.922745 MDntsc -- 320 x 448 @ 59.922745 MDntp -- 320 x 480 @ 59.922745 MDntsc - 256 x 192 @ 59.922745 MDntsc -- 320 x 224 @ 59.922745 MDntsc - 256 x 224 @ 59.922745 MDntsc -- 320 x 288 @ 49.701458 MDpal -- 320 x 576 @ 49.701458 MDpal +- 320 x 224 @ 59.922745 MDntsc +- 320 x 240 @ 59.922745 MDntsc +- 320 x 448 @ 59.922745 MDntsc +- 320 x 480 @ 59.922745 MDntsc - 256 x 192 @ 49.701458 MDpal +- 256 x 224 @ 49.701458 MDpal - 320 x 224 @ 49.701458 MDpal - 320 x 240 @ 49.701458 MDpal +- 320 x 288 @ 49.701458 MDpal - 320 x 448 @ 49.701458 MDpal - 320 x 480 @ 49.701458 MDpal -- 256 x 224 @ 49.701458 MDpal +- 320 x 576 @ 49.701458 MDpal - 256 x 288 @ 49.701458 MSYSpal - 256 x 240 @ 60.098812 NESntsc - 256 x 240 @ 50.006977 NESpal -- 640 x 480 @ 60.130001 N64ntsc - 640 x 237 @ 60.130001 N64ntsc - 640 x 240 @ 60.130001 N64ntsc +- 640 x 480 @ 60.130001 N64ntsc +- 640 x 288 @ 50.000000 N64pal - 640 x 480 @ 50.000000 N64pal -- 640 x 576 @ 50.000000 n64pal -- 640 x 288 @ 50.000000 n64pal +- 640 x 576 @ 50.000000 N64pal - 256 x 252 @ 49.759998 PSXpal -- 384 x 252 @ 49.759998 PSXpal -- 640 x 540 @ 49.759998 PSXpal - 320 x 252 @ 49.759998 PSXpal +- 384 x 252 @ 49.759998 PSXpal - 640 x 252 @ 49.759998 PSXpal +- 640 x 540 @ 49.759998 PSXpal - 384 x 240 @ 59.941002 PSXntsc - 256 x 480 @ 59.941002 PSXntsc diff --git a/audio/audio_defines.h b/audio/audio_defines.h new file mode 100644 index 0000000000..14693aa296 --- /dev/null +++ b/audio/audio_defines.h @@ -0,0 +1,88 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2017 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#ifndef __AUDIO_DEFINES__H +#define __AUDIO_DEFINES__H + +#include + +RETRO_BEGIN_DECLS + +#define AUDIO_CHUNK_SIZE_BLOCKING 512 + +/* So we don't get complete line-noise when fast-forwarding audio. */ +#define AUDIO_CHUNK_SIZE_NONBLOCKING 2048 + +#define AUDIO_MAX_RATIO 16 + +#define AUDIO_MIXER_MAX_STREAMS 16 + +#define AUDIO_MIXER_MAX_SYSTEM_STREAMS (AUDIO_MIXER_MAX_STREAMS + 4) + +/* do not define more than (MAX_SYSTEM_STREAMS - MAX_STREAMS) */ +enum audio_mixer_system_slot +{ + AUDIO_MIXER_SYSTEM_SLOT_OK = AUDIO_MIXER_MAX_STREAMS, + AUDIO_MIXER_SYSTEM_SLOT_CANCEL, + AUDIO_MIXER_SYSTEM_SLOT_NOTICE, + AUDIO_MIXER_SYSTEM_SLOT_BGM +}; + +enum audio_action +{ + AUDIO_ACTION_NONE = 0, + AUDIO_ACTION_RATE_CONTROL_DELTA, + AUDIO_ACTION_MIXER_MUTE_ENABLE, + AUDIO_ACTION_MUTE_ENABLE, + AUDIO_ACTION_VOLUME_GAIN, + AUDIO_ACTION_MIXER_VOLUME_GAIN, + AUDIO_ACTION_MIXER +}; + +enum audio_mixer_slot_selection_type +{ + AUDIO_MIXER_SLOT_SELECTION_AUTOMATIC = 0, + AUDIO_MIXER_SLOT_SELECTION_MANUAL +}; + +enum audio_mixer_stream_type +{ + AUDIO_STREAM_TYPE_NONE = 0, + AUDIO_STREAM_TYPE_USER, + AUDIO_STREAM_TYPE_SYSTEM +}; + +enum audio_mixer_state +{ + AUDIO_STREAM_STATE_NONE = 0, + AUDIO_STREAM_STATE_STOPPED, + AUDIO_STREAM_STATE_PLAYING, + AUDIO_STREAM_STATE_PLAYING_LOOPED, + AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL +}; + +typedef struct audio_statistics +{ + float average_buffer_saturation; + float std_deviation_percentage; + float close_to_underrun; + float close_to_blocking; + unsigned samples; +} audio_statistics_t; + +RETRO_END_DECLS + +#endif diff --git a/audio/audio_driver.c b/audio/audio_driver.c index d0cc9d6497..6633d8147b 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -21,10 +21,12 @@ #include #include