RetroArch/Makefile.common

2522 lines
71 KiB
Makefile
Raw Permalink Normal View History

2019-07-20 11:01:22 -07:00
ROOT_DIR := .
2016-09-19 10:44:20 -07:00
DEPS_DIR := $(ROOT_DIR)/deps
LIBRETRO_COMM_DIR := $(ROOT_DIR)/libretro-common
2017-05-16 13:33:48 -07:00
WANT_WGL = 0
2016-09-19 10:44:20 -07:00
2017-09-11 19:47:37 -07:00
ifeq ($(HAVE_STACK_USAGE), 1)
DEF_FLAGS += -fstack-usage
2017-09-11 19:47:37 -07:00
endif
2020-01-15 10:20:10 -08:00
ifeq ($(HAVE_NOUNUSED), 1)
DEF_FLAGS += $(NOUNUSED_CFLAGS)
endif
ifeq ($(HAVE_NOUNUSED_VARIABLE), 1)
DEF_FLAGS += $(NOUNUSED_VARIABLE_CFLAGS)
endif
ifeq ($(HAVE_CXX11), 1)
CXXFLAGS += $(CXX11_CFLAGS)
endif
2020-04-16 11:57:39 -07:00
ifeq ($(HAVE_SAPI), 1)
LIBS += sapi.dll
endif
ifeq ($(HAVE_GL_CONTEXT),)
HAVE_GL_CONTEXT = 0
HAVE_GL_MODERN = 0
ifeq ($(HAVE_OPENGL), 1)
HAVE_GL_CONTEXT = 1
HAVE_GL_MODERN = 1
2019-02-17 01:41:48 -08:00
endif
ifeq ($(HAVE_OPENGL1), 1)
HAVE_GL_CONTEXT = 1
endif
2016-09-16 15:38:35 -07:00
ifeq ($(HAVE_OPENGLES), 1)
HAVE_GL_CONTEXT = 1
HAVE_GL_MODERN = 1
endif
2016-09-16 15:38:35 -07:00
ifeq ($(HAVE_OPENGLES3), 1)
HAVE_GL_CONTEXT = 1
HAVE_GL_MODERN = 1
endif
endif
2015-06-02 06:57:18 -07:00
ifeq ($(HAVE_LIBRETRODB),)
HAVE_LIBRETRODB = 1
endif
2015-01-21 18:58:04 -08:00
2017-01-17 05:02:50 -08:00
ifeq ($(HAVE_SOCKET_LEGACY), 1)
2018-11-09 11:59:30 -08:00
DEFINES += -DHAVE_SOCKET_LEGACY
2017-01-17 05:02:50 -08:00
endif
2015-01-21 18:58:04 -08:00
ifeq ($(HAVE_LIBRETRODB), 1)
2016-02-09 08:36:59 -08:00
DEFINES += -DHAVE_LIBRETRODB
2015-01-21 18:58:04 -08:00
endif
2017-01-17 08:31:38 -08:00
ifeq ($(HAVE_VITA2D), 1)
2018-11-09 11:59:30 -08:00
DEFINES += -DHAVE_VITA2D
2017-01-17 08:31:38 -08:00
endif
2014-09-13 18:22:04 -07:00
ifeq ($(HAVE_DYLIB), 1)
DEFINES += -DHAVE_DYLIB
endif
2014-09-13 17:52:30 -07:00
ifeq ($(SCALER_NO_SIMD), 1)
DEFINES += -DSCALER_NO_SIMD
endif
ifeq ($(HAVE_PRESERVE_DYLIB),1)
DEFINES += -DNO_DLCLOSE
endif
ifeq ($(GL_DEBUG), 1)
DEFINES += -DGL_DEBUG
2014-09-13 17:52:30 -07:00
endif
ifeq ($(VULKAN_DEBUG), 1)
DEFINES += -DVULKAN_DEBUG
endif
2019-01-31 12:55:07 -08:00
ifeq ($(HAVE_FLOATHARD), 1)
2019-01-31 12:55:07 -08:00
DEF_FLAGS += $(FLOATHARD_CFLAGS)
ASFLAGS += $(FLOATHARD_CFLAGS)
2019-01-31 12:55:07 -08:00
endif
ifeq ($(HAVE_FLOATSOFTFP), 1)
2019-01-31 12:55:07 -08:00
DEF_FLAGS += $(FLOATSOFTFP_CFLAGS)
ASFLAGS += $(FLOATSOFTFP_CFLAGS)
2014-09-13 17:52:30 -07:00
endif
2014-09-13 19:37:57 -07:00
ifeq ($(TDM_GCC),)
LDCXXFLAGS += -static-libstdc++
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
DEFINES += -DHAVE_FILE_LOGGER
endif
2016-06-06 15:00:28 -07:00
ifeq ($(HAVE_SHADERPIPELINE), 1)
DEFINES += -DHAVE_SHADERPIPELINE
2016-06-06 15:00:28 -07:00
endif
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR)
2016-06-06 21:28:33 -07:00
2016-06-06 21:35:48 -07:00
# Switches
2018-10-12 09:29:52 -07:00
#
ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
DEFINES += -DHAVE_NETPLAYDISCOVERY
2018-10-12 09:29:52 -07:00
endif
2016-06-06 21:28:33 -07:00
2017-01-17 10:31:11 -08:00
ifeq ($(HAVE_NETLOGGER), 1)
2019-03-26 18:37:34 -07:00
DEFINES += -DHAVE_LOGGER
OBJ += network/net_logger.o
2017-01-17 10:31:11 -08:00
endif
2016-06-06 21:28:33 -07:00
# System
ifneq ($(findstring BSD,$(OS)),)
BSD_LOCAL_INC += -I/usr/local/include
2018-11-09 11:59:30 -08:00
HAVE_UNIX = 1
2016-06-06 21:28:33 -07:00
endif
ifneq ($(findstring Darwin,$(OS)),)
OSX := 1
LIBS += -framework AppKit
2021-02-16 16:11:21 -08:00
ARCHFLAGS=
MINVERFLAGS=
ifeq ($(shell uname -p),arm)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.15 -stdlib=libc++ # macOS (Metal, ARM 64bit)
else ifeq ($(HAVE_METAL),1)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.13 -stdlib=libc++ # macOS (Metal, x86 64bit)
else ifeq ($(shell uname -p),powerpc)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.5 # macOSX (PowerPC 32-bit)
else ifeq ($(shell uname -m),i386)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.6 # macOSX (OpenGL, x86 32bit)
else
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.7 -stdlib=libc++ # macOSX (OpenGL, x86 64bit)
endif
2021-02-16 16:11:21 -08:00
# Build for a specific architecture when ARCH is defined as a switch
ifeq ($(ARCH),arm64)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.15 -stdlib=libc++ # macOS (Metal, ARM 64bit)
ARCHFLAGS = -arch arm64
2021-02-16 12:38:39 -08:00
else ifeq ($(ARCH),x86_64)
ifeq ($(HAVE_METAL),1)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.13 -stdlib=libc++
else
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.7 -stdlib=libc++
endif
2021-02-16 16:11:21 -08:00
ARCHFLAGS = -arch x86_64
2021-02-16 12:38:39 -08:00
else ifeq ($(ARCH),x86)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.6
ARCHFLAGS = -arch x86
2021-02-16 12:38:39 -08:00
else ifeq ($(ARCH),ppc)
2021-02-16 16:11:21 -08:00
MINVERFLAGS = -mmacosx-version-min=10.5
ARCHFLAGS = -arch ppc
endif
ifeq ($(BUILDBOT),1)
ARCHFLAGS = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
endif
2021-02-16 16:11:21 -08:00
DEF_FLAGS += $(MINVERFLAGS) $(ARCHFLAGS)
LDFLAGS += $(MINVERFLAGS) $(ARCHFLAGS)
2016-06-06 21:28:33 -07:00
else
OSX := 0
endif
ifneq ($(findstring Haiku,$(OS)),)
LIBS += -lroot -lnetwork
2018-11-09 09:49:30 -08:00
HAVE_UNIX = 1
else
LIBS += -lm
endif
2016-06-06 21:28:33 -07:00
ifneq ($(findstring Linux,$(OS)),)
LIBS += -lrt
OBJ += input/drivers/linuxraw_input.o \
input/common/linux_common.o \
input/drivers_joypad/linuxraw_joypad.o
2018-11-09 09:49:30 -08:00
HAVE_UNIX = 1
2016-06-06 21:28:33 -07:00
endif
ifeq ($(HAVE_UNIX), 1)
2018-11-09 11:59:30 -08:00
OBJ += frontend/drivers/platform_unix.o
ifeq ($(UNIX_CWD_ENV), 1)
DEF_FLAGS += -DRARCH_UNIX_CWD_ENV
endif
endif
2016-06-06 21:35:48 -07:00
2017-12-06 20:54:54 -08:00
ifeq ($(TARGET), retroarch_3ds)
2018-11-09 11:59:30 -08:00
OBJ += frontend/drivers/platform_ctr.o
2017-12-06 20:54:54 -08:00
endif
ifeq ($(TARGET), retroarch_ps2)
OBJ += frontend/drivers/platform_ps2.o
endif
# Git Version
GIT_VERSION_CACHEDIR = $(if $(OBJDIR),$(OBJDIR),$(CURDIR))
GIT_VERSION_CACHEFILE = $(GIT_VERSION_CACHEDIR)/git-version.cache
2016-06-06 21:28:33 -07:00
ifneq (,$(wildcard .git/index)) # Building inside a Git repository?
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
endif
ifneq (,$(wildcard $(GIT_VERSION_CACHEFILE))) # Cached Git version?
GIT_VERSION_CACHE = $(shell cat "$(GIT_VERSION_CACHEFILE)" 2>/dev/null)
endif
ifeq ($(GIT_VERSION),)
ifneq ($(GIT_VERSION_CACHE),) # If no Git version, use cached if found
GIT_VERSION = $(GIT_VERSION_CACHE)
endif
endif
ifneq ($(GIT_VERSION),) # Enable version_git.o?
ifneq ($(GIT_VERSION),$(GIT_VERSION_CACHE)) # Update version_git.o?
$(shell \
mkdir -p "$(GIT_VERSION_CACHEDIR)" && \
echo "$(GIT_VERSION)" > "$(GIT_VERSION_CACHEFILE)" && \
touch version_git.c)
endif
2016-06-06 21:28:33 -07:00
DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=$(GIT_VERSION)
OBJ += version_git.o
2016-06-06 21:28:33 -07:00
endif
# General object files
2019-07-20 07:42:46 -07:00
ifeq ($(HAVE_DR_MP3), 1)
DEFINES += -DHAVE_DR_MP3
2019-07-20 07:42:46 -07:00
endif
2016-06-06 21:35:48 -07:00
2019-07-15 13:13:55 -07:00
OBJ += frontend/frontend_driver.o \
2015-10-11 00:26:54 -07:00
retroarch.o \
runloop.o \
ui/ui_companion_driver.o \
camera/camera_driver.o \
2021-11-09 17:34:04 -08:00
record/record_driver.o \
command.o \
2015-10-11 00:26:54 -07:00
msg_hash.o \
intl/msg_hash_us.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/queues/task_queue.o \
tasks/task_content.o
ifeq ($(HAVE_PATCH), 1)
2020-06-30 10:35:41 -07:00
DEFINES += -DHAVE_PATCH
XDelta patch support (Take 2) (#15915) * Add xdelta in deps * Include <assert.h> in xdelta3.h - Otherwise the static_assert calls can fail * Build xdelta3 in Makefile.common * Add xdelta support to the softpatching infrastructure - The patching itself isn't fully implemented yet * Adjust how xdelta3.h checks the sizes of some types - Now checks max values instead of relying on autotools * Add some enums that were excluded by the cherry-pick * Remove stray whitespace * Adjust SIZE macros in xdelta3.h - Move them outside the XD3_USE_LARGEFILE64 block - Add more SIZE declarations - Make SIZEOF_UNSIGNED_LONG_LONG contingent on the presence of ULLONG_MAX * Reintegrate xdelta support * Enable support for xdelta's secondary compressors - Necessary for some patches * Fix some format specifiers * Remove unnecessary files from xdelta * Include xdelta3.h with a relative path * Add xdelta3 headers to HEADERS variable * Gate Xdelta support behind HAVE_XDELTA - HAVE_XDELTA is on by default - HAVE_PATCH is still required for HAVE_XDELTA to be meaningful - Support is mostly contingent on the availability of LZMA - Anything modern should be okay - Legacy platforms (e.g. DOS) may need to have Xdelta support disabled - At least until some other solution can be found * Disable HAVE_XDELTA on platforms where the build recently failed - These come from looking at the failed builds on GitHub - These are guesses, and may turn out to be wrong * Fix a potential memory leak - Whoops, looks like I need to call two cleanup functions - xd3_close_stream exists separately from xd3_free_stream * Split the --help printout for --xdelta into its own strlcat call - GCC was complaining about #ifdefs within macro arguments being non-portable * Fix some incorrect printf format specifiers * Modify Xdelta to adhere to C89 - It's mostly using RetroArch's INLINE macro instead of the inline keyword * Slight cleanups * Remove a stray comma that was hindering C89 builds * Add XDelta support to CHANGES.md * Change how the xdelta patch's name is computed - To be in line with other recent refactoring * Fix an incorrect merge - Whoops, this part was from before I figured out how to get the size of a patched file * Explain the song-and-dance behind computing a patched file's size * Define some XDelta3-related constants to 0 on 32-bit platforms * Adjust some Xdelta-related macro definitions - Exclude the encoder, since we're not making patches - Move some #defines to after inclusion of <stdint.h>, to fix undefined behavior - Remove _WIN32_WINNT overrides, since they were for code that we're not using * Fix Xdelta support * Wrap an encoder-only function in `#if XD3_ENCODER`
2023-11-23 20:19:07 -08:00
OBJ += tasks/task_patch.o
ifeq ($(HAVE_XDELTA), 1)
DEFINES += -DHAVE_XDELTA -DSECONDARY_DJW -DSECONDARY_LZMA -DSECONDARY_FGK
INCLUDE_DIRS += -I$(DEPS_DIR)/xdelta3 -I$(LIBRETRO_COMM_DIR)
LIBS += -llzma
OBJ += $(DEPS_DIR)/xdelta3/xdelta3.o
HEADERS += xdelta3.h \
xdelta3-cfgs.h \
xdelta3-fgk.h \
xdelta3-hash.h \
xdelta3-internal.h \
xdelta3-list.h \
xdelta3-lzma.h \
xdelta3-second.h
# These headers are added to the makefile because xdelta3 does weird things
# with its #includes, which affects dependency tracking and project analysis
# (e.g. for IDEs).
endif
endif
OBJ += \
save.o \
2016-09-18 17:57:23 -07:00
tasks/task_save.o \
tasks/task_movie.o \
2015-10-11 00:26:54 -07:00
tasks/task_file_transfer.o \
2016-05-09 22:54:47 -07:00
tasks/task_image.o \
tasks/task_playlist_manager.o \
2019-11-29 09:13:35 -08:00
tasks/task_manual_content_scan.o \
tasks/task_core_backup.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_base64.o
2020-06-30 11:09:53 -07:00
ifeq ($(HAVE_TRANSLATE), 1)
OBJ += tasks/task_translation.o
2020-06-30 11:09:53 -07:00
endif
OBJ += \
2017-12-04 07:46:59 -08:00
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.o \
$(LIBRETRO_COMM_DIR)/compat/compat_strldup.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/lists/file_list.o \
$(LIBRETRO_COMM_DIR)/lists/dir_list.o \
$(LIBRETRO_COMM_DIR)/file/retro_dirent.o \
$(LIBRETRO_COMM_DIR)/streams/stdin_stream.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/streams/file_stream.o \
2017-07-27 00:09:19 -07:00
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/streams/interface_stream.o \
$(LIBRETRO_COMM_DIR)/streams/memory_stream.o \
$(LIBRETRO_COMM_DIR)/streams/network_stream.o \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o
OBJ += \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
2019-07-11 03:22:18 -07:00
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o
OBJ += \
$(LIBRETRO_COMM_DIR)/lists/linked_list.o \
2021-08-06 07:32:51 -07:00
$(LIBRETRO_COMM_DIR)/lists/nested_list.o \
$(LIBRETRO_COMM_DIR)/queues/generic_queue.o
2019-07-11 03:22:18 -07:00
ifneq ($(findstring Linux,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o
endif
ifneq ($(findstring Win32,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_windowsmmap.o
endif
ifneq ($(findstring BSD,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o
else ifneq ($(findstring Darwin,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o
endif
OBJ += \
2017-11-24 20:35:55 -08:00
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_intf.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/file/file_path.o \
$(LIBRETRO_COMM_DIR)/file/file_path_io.o \
2015-10-11 00:26:54 -07:00
file_path_special.o \
$(LIBRETRO_COMM_DIR)/hash/lrc_hash.o \
audio/audio_driver.o \
2021-07-30 08:38:39 -07:00
input/input_driver.o \
input/common/input_hid_common.o \
led/led_driver.o \
gfx/video_driver.o \
gfx/gfx_display.o \
gfx/gfx_animation.o \
gfx/gfx_thumbnail_path.o \
gfx/gfx_thumbnail.o \
2015-10-11 00:26:54 -07:00
configuration.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/dynamic/dylib.o \
2015-10-11 00:26:54 -07:00
cores/dynamic_dummy.o \
2020-07-01 12:04:05 -07:00
$(LIBRETRO_COMM_DIR)/queues/message_queue.o
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
ifeq ($(HAVE_MICROPHONE), 1)
DEFINES += -DHAVE_MICROPHONE
OBJ += audio/microphone_driver.o
endif
2020-07-01 12:04:05 -07:00
ifeq ($(HAVE_REWIND), 1)
DEFINES += -DHAVE_REWIND
OBJ += state_manager.o
2020-07-01 12:04:05 -07:00
endif
OBJ += \
2015-10-11 00:26:54 -07:00
gfx/drivers_font_renderer/bitmapfont.o \
2020-12-09 08:48:09 -08:00
gfx/drivers_font_renderer/bitmapfont_10x10.o \
gfx/drivers_font_renderer/bitmapfont_6x10.o \
tasks/task_autodetect.o \
2018-11-09 09:49:30 -08:00
input/input_autodetect_builtin.o \
2015-10-11 00:26:54 -07:00
input/input_keymaps.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.o \
$(LIBRETRO_COMM_DIR)/compat/compat_fnmatch.o \
2020-06-30 10:35:41 -07:00
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.o
ifeq ($(HAVE_CHEATS), 1)
DEFINES += -DHAVE_CHEATS
OBJ += cheat_manager.o
2020-06-30 10:35:41 -07:00
endif
ifeq ($(HAVE_CORE_INFO_CACHE), 1)
DEFINES += -DHAVE_CORE_INFO_CACHE
endif
2020-06-30 10:35:41 -07:00
OBJ += \
2015-10-11 00:26:54 -07:00
core_info.o \
core_backup.o \
2021-08-06 07:32:51 -07:00
core_option_manager.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/file/config_file.o \
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \
2019-02-28 16:22:35 -08:00
runtime_file.o \
disk_index_file.o
ifeq ($(HAVE_SCREENSHOTS), 1)
DEFINES += -DHAVE_SCREENSHOTS
OBJ += tasks/task_screenshot.o
endif
OBJ += \
2016-12-20 06:18:07 -08:00
tasks/task_powerstate.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/pixconv.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_int.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
2020-07-01 21:28:14 -07:00
gfx/font_driver.o
ifeq ($(HAVE_VIDEO_FILTER), 1)
DEFINES += -DHAVE_VIDEO_FILTER
OBJ += gfx/video_filter.o
endif
ifeq ($(HAVE_WINDOW_OFFSET), 1)
DEFINES += -DHAVE_WINDOW_OFFSET
endif
2020-07-01 21:28:14 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o
2020-07-01 17:13:04 -07:00
ifeq ($(HAVE_DSP_FILTER), 1)
DEFINES += -DHAVE_DSP_FILTER
OBJ += $(LIBRETRO_COMM_DIR)/audio/dsp_filter.o
endif
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o
2020-06-30 12:45:05 -07:00
ifeq ($(HAVE_NEAREST_RESAMPLER), 1)
DEFINES += -DHAVE_NEAREST_RESAMPLER
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o
endif
OBJ += \
2018-11-09 09:49:30 -08:00
$(LIBRETRO_COMM_DIR)/utils/md5.o \
2015-10-11 00:26:54 -07:00
playlist.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/features/features_cpu.o \
2018-03-28 15:32:37 -07:00
verbosity.o \
2019-11-29 09:13:35 -08:00
$(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o \
$(LIBRETRO_COMM_DIR)/time/rtime.o \
manual_content_scan.o \
disk_control_interface.o
2019-07-11 03:22:18 -07:00
ifeq ($(HAVE_CONFIGFILE), 1)
DEFINES += -DHAVE_CONFIGFILE
endif
ifeq ($(HAVE_BLISSBOX), 1)
DEFINES += -DHAVE_BLISSBOX
OBJ += tasks/task_autodetect_blissbox.o
endif
2019-07-11 02:51:06 -07:00
ifeq ($(HAVE_AUDIOMIXER), 1)
DEFINES += -DHAVE_AUDIOMIXER
OBJ += tasks/task_audio_mixer.o \
$(LIBRETRO_COMM_DIR)/audio/audio_mix.o \
$(LIBRETRO_COMM_DIR)/audio/audio_mixer.o
2019-07-11 02:51:06 -07:00
endif
ifeq ($(HAVE_BSV_MOVIE), 1)
DEFINES += -DHAVE_BSV_MOVIE
endif
2018-03-29 06:38:22 -07:00
ifeq ($(HAVE_RUNAHEAD), 1)
2018-11-09 11:59:30 -08:00
DEFINES += -DHAVE_RUNAHEAD
OBJ += runahead.o
2018-03-29 06:38:22 -07:00
endif
2018-03-28 15:32:37 -07:00
ifeq ($(HAVE_CC_RESAMPLER), 1)
2018-11-09 09:49:30 -08:00
DEFINES += -DHAVE_CC_RESAMPLER
OBJ += audio/drivers_resampler/cc_resampler.o
2019-07-19 10:03:48 -07:00
ifeq ($(HAVE_NEON),1)
OBJ += audio/drivers_resampler/cc_resampler_neon.o
endif
endif
2016-06-06 21:05:41 -07:00
ifeq ($(HAVE_LANGEXTRA), 1)
2018-11-09 11:59:30 -08:00
DEFINES += -DHAVE_LANGEXTRA
DEF_FLAGS += -finput-charset=UTF-8
2016-06-06 21:05:41 -07:00
endif
2016-06-06 21:35:48 -07:00
ifneq ($(HAVE_GETOPT_LONG), 1)
2018-11-09 09:49:30 -08:00
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_getopt.o
2016-06-06 21:35:48 -07:00
endif
ifneq ($(HAVE_STRCASESTR), 1)
2018-11-09 09:49:30 -08:00
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.o
2016-06-06 21:35:48 -07:00
endif
ifneq ($(HAVE_STRL), 1)
2018-11-09 09:49:30 -08:00
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_strl.o
2016-06-06 21:35:48 -07:00
endif
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/image_texture.o
2015-06-28 09:55:00 -07:00
ifeq ($(HAVE_IMAGEVIEWER), 1)
2018-11-09 09:49:30 -08:00
DEFINES += -DHAVE_IMAGEVIEWER
OBJ += cores/libretro-imageviewer/image_core.o
2015-06-28 09:55:00 -07:00
endif
2015-02-18 18:16:47 -08:00
2019-07-21 03:13:04 -07:00
ifeq ($(HAVE_D3D9), 1)
HAVE_HLSL = 1
endif
ifeq ($(HAVE_CG), 1)
HAVE_SHADERS_COMMON = 1
endif
ifeq ($(HAVE_GLSL), 1)
HAVE_SHADERS_COMMON = 1
endif
ifeq ($(HAVE_HLSL), 1)
HAVE_SHADERS_COMMON = 1
endif
ifeq ($(HAVE_SLANG), 1)
HAVE_SHADERS_COMMON = 1
endif
2018-04-30 11:33:05 -07:00
# Qt WIMP GUI
2016-11-19 17:18:44 -08:00
ifeq ($(HAVE_OPENSSL), 1)
DEF_FLAGS += $(OPENSSL_CFLAGS)
2018-11-09 09:49:30 -08:00
LIBS += $(OPENSSL_LIBS)
endif
ifeq ($(HAVE_QT), 1)
2018-11-09 09:49:30 -08:00
OBJ += ui/drivers/ui_qt.o \
ui/drivers/qt/gridview.o \
ui/drivers/qt/qt_dialogs.o \
ui/drivers/qt/qt_widgets.o \
2019-01-12 12:16:48 -08:00
ui/drivers/qt/qt_playlist.o \
ui/drivers/qt/qt_downloads.o
2019-03-26 18:37:34 -07:00
ifeq ($(HAVE_MENU), 1)
OBJ += ui/drivers/qt/qt_options.o
2019-03-26 18:37:34 -07:00
endif
2018-11-09 09:49:30 -08:00
MOC_HEADERS += ui/drivers/ui_qt.h \
ui/drivers/qt/ui_qt_load_core_window.h \
ui/drivers/qt/gridview.h \
2022-04-21 23:26:27 -07:00
ui/drivers/qt/qt_dialogs.h \
ui/drivers/qt/qt_widgets.h
2021-03-23 17:24:49 -07:00
ifeq ($(HAVE_MENU), 1)
2022-04-21 23:26:27 -07:00
MOC_HEADERS += ui/drivers/qt/qt_options.h
2019-03-26 18:37:34 -07:00
endif
2018-11-09 09:49:30 -08:00
DEFINES += -DHAVE_MAIN
DEF_FLAGS += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS)
#DEF_FLAGS += $(QT5WEBENGINE_CFLAGS)
2018-11-09 09:49:30 -08:00
LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) $(QT5CONCURRENT_LIBS) $(QT5NETWORK_LIBS)
#LIBS += $(QT5WEBENGINE_LIBS)
NEED_CXX_LINKER = 1
2018-04-30 11:33:05 -07:00
2018-11-09 09:49:30 -08:00
ifneq ($(findstring Linux,$(OS)),)
DEF_FLAGS += -fPIC
else ifneq ($(findstring BSD,$(OS)),)
DEF_FLAGS += -fPIC
2018-11-09 09:49:30 -08:00
endif
endif
2016-03-03 09:17:48 -08:00
ifeq ($(HAVE_SSA),1)
2018-11-09 09:49:30 -08:00
LIBS += $(SSA_LIBS)
2016-03-03 09:17:48 -08:00
endif
2019-01-31 12:55:07 -08:00
ifeq ($(HAVE_SSE),1)
2019-01-31 12:55:07 -08:00
DEF_FLAGS += $(SSE_LIBS)
2019-01-31 12:55:07 -08:00
endif
# LibretroDB
2015-01-21 18:58:04 -08:00
ifeq ($(HAVE_LIBRETRODB), 1)
2018-11-09 09:49:30 -08:00
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
ifeq ($(HAVE_MENU), 1)
OBJ += menu/menu_explore.o \
tasks/task_menu_explore.o
endif
2015-01-21 18:58:04 -08:00
endif
2020-09-20 07:43:05 -07:00
ifeq ($(HAVE_BUILTINBEARSSL), 1)
2020-09-18 15:31:36 -07:00
HAVE_SSL = 1
DEFINES += -DHAVE_SSL -DHAVE_BEARSSL
# these -Is are only needed for BearSSL itself
INCLUDE_DIRS += -Ideps/bearssl-0.6/src -Ideps/bearssl-0.6/inc
OBJS_BEAR = deps/bearssl-0.6/src/aead/ccm.o \
deps/bearssl-0.6/src/codec/ccopy.o \
deps/bearssl-0.6/src/codec/dec32be.o \
deps/bearssl-0.6/src/codec/dec32le.o \
deps/bearssl-0.6/src/codec/dec64be.o \
deps/bearssl-0.6/src/codec/enc32be.o \
deps/bearssl-0.6/src/codec/enc32le.o \
deps/bearssl-0.6/src/codec/enc64be.o \
deps/bearssl-0.6/src/ec/ec_all_m31.o \
deps/bearssl-0.6/src/ec/ec_c25519_m31.o \
deps/bearssl-0.6/src/ec/ecdsa_atr.o \
deps/bearssl-0.6/src/ec/ecdsa_i31_bits.o \
deps/bearssl-0.6/src/ec/ecdsa_i31_vrfy_asn1.o \
deps/bearssl-0.6/src/ec/ecdsa_i31_vrfy_raw.o \
deps/bearssl-0.6/src/ec/ec_p256_m31.o \
deps/bearssl-0.6/src/ec/ec_prime_i31.o \
deps/bearssl-0.6/src/ec/ec_secp256r1.o \
deps/bearssl-0.6/src/ec/ec_secp384r1.o \
deps/bearssl-0.6/src/ec/ec_secp521r1.o \
deps/bearssl-0.6/src/hash/ghash_ctmul64.o \
deps/bearssl-0.6/src/hash/ghash_pclmul.o \
deps/bearssl-0.6/src/hash/md5.o \
deps/bearssl-0.6/src/hash/multihash.o \
deps/bearssl-0.6/src/hash/sha1.o \
deps/bearssl-0.6/src/hash/sha2big.o \
deps/bearssl-0.6/src/hash/sha2small.o \
deps/bearssl-0.6/src/int/i31_add.o \
deps/bearssl-0.6/src/int/i31_bitlen.o \
deps/bearssl-0.6/src/int/i31_decmod.o \
deps/bearssl-0.6/src/int/i31_decode.o \
deps/bearssl-0.6/src/int/i31_decred.o \
deps/bearssl-0.6/src/int/i31_encode.o \
deps/bearssl-0.6/src/int/i31_fmont.o \
deps/bearssl-0.6/src/int/i31_iszero.o \
deps/bearssl-0.6/src/int/i31_modpow2.o \
deps/bearssl-0.6/src/int/i31_modpow.o \
deps/bearssl-0.6/src/int/i31_montmul.o \
deps/bearssl-0.6/src/int/i31_muladd.o \
deps/bearssl-0.6/src/int/i31_ninv31.o \
deps/bearssl-0.6/src/int/i31_rshift.o \
deps/bearssl-0.6/src/int/i31_sub.o \
deps/bearssl-0.6/src/int/i31_tmont.o \
deps/bearssl-0.6/src/int/i32_div32.o \
deps/bearssl-0.6/src/int/i62_modpow2.o \
deps/bearssl-0.6/src/mac/hmac_ct.o \
deps/bearssl-0.6/src/mac/hmac.o \
deps/bearssl-0.6/src/rand/hmac_drbg.o \
deps/bearssl-0.6/src/rand/sysrng.o \
deps/bearssl-0.6/src/rsa/rsa_default_pkcs1_vrfy.o \
deps/bearssl-0.6/src/rsa/rsa_default_pub.o \
deps/bearssl-0.6/src/rsa/rsa_i31_pkcs1_vrfy.o \
deps/bearssl-0.6/src/rsa/rsa_i31_pub.o \
deps/bearssl-0.6/src/rsa/rsa_i62_pkcs1_vrfy.o \
deps/bearssl-0.6/src/rsa/rsa_i62_pub.o \
deps/bearssl-0.6/src/rsa/rsa_pkcs1_sig_unpad.o \
deps/bearssl-0.6/src/ssl/prf_md5sha1.o \
deps/bearssl-0.6/src/ssl/prf.o \
deps/bearssl-0.6/src/ssl/prf_sha256.o \
deps/bearssl-0.6/src/ssl/prf_sha384.o \
deps/bearssl-0.6/src/ssl/ssl_client_default_rsapub.o \
deps/bearssl-0.6/src/ssl/ssl_client_full.o \
deps/bearssl-0.6/src/ssl/ssl_client.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_aescbc.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_aesccm.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_aesgcm.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_chapol.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_descbc.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_ecdsa.o \
deps/bearssl-0.6/src/ssl/ssl_engine_default_rsavrfy.o \
deps/bearssl-0.6/src/ssl/ssl_engine.o \
deps/bearssl-0.6/src/ssl/ssl_hs_client.o \
deps/bearssl-0.6/src/ssl/ssl_rec_cbc.o \
deps/bearssl-0.6/src/ssl/ssl_rec_ccm.o \
deps/bearssl-0.6/src/ssl/ssl_rec_chapol.o \
deps/bearssl-0.6/src/ssl/ssl_rec_gcm.o \
deps/bearssl-0.6/src/symcipher/aes_ct64_cbcdec.o \
deps/bearssl-0.6/src/symcipher/aes_ct64_cbcenc.o \
deps/bearssl-0.6/src/symcipher/aes_ct64_ctrcbc.o \
deps/bearssl-0.6/src/symcipher/aes_ct64_ctr.o \
deps/bearssl-0.6/src/symcipher/aes_ct64_dec.o \
deps/bearssl-0.6/src/symcipher/aes_ct64_enc.o \
deps/bearssl-0.6/src/symcipher/aes_ct64.o \
deps/bearssl-0.6/src/symcipher/aes_x86ni_cbcdec.o \
deps/bearssl-0.6/src/symcipher/aes_x86ni_cbcenc.o \
deps/bearssl-0.6/src/symcipher/aes_x86ni_ctrcbc.o \
deps/bearssl-0.6/src/symcipher/aes_x86ni_ctr.o \
deps/bearssl-0.6/src/symcipher/aes_x86ni.o \
deps/bearssl-0.6/src/symcipher/chacha20_ct.o \
deps/bearssl-0.6/src/symcipher/chacha20_sse2.o \
deps/bearssl-0.6/src/symcipher/des_ct_cbcdec.o \
deps/bearssl-0.6/src/symcipher/des_ct_cbcenc.o \
deps/bearssl-0.6/src/symcipher/des_ct.o \
deps/bearssl-0.6/src/symcipher/des_support.o \
deps/bearssl-0.6/src/symcipher/poly1305_ctmul.o \
deps/bearssl-0.6/src/symcipher/poly1305_ctmulq.o \
deps/bearssl-0.6/src/x509/x509_decoder.o \
deps/bearssl-0.6/src/x509/x509_minimal_full.o \
deps/bearssl-0.6/src/x509/x509_minimal.o \
OBJ += $(OBJS_BEAR)
else ifeq ($(HAVE_BUILTINMBEDTLS), 1)
HAVE_SSL = 1
DEFINES += -DHAVE_SSL
2018-11-09 09:49:30 -08:00
ifeq ($(DEBUG), 1)
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
2018-11-09 09:49:30 -08:00
endif
# 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/ctr_drbg.o \
deps/mbedtls/des.o \
deps/mbedtls/dhm.o \
deps/mbedtls/ecdh.o \
deps/mbedtls/ecdsa.o \
deps/mbedtls/ecp.o \
deps/mbedtls/ecp_curves.o \
deps/mbedtls/entropy.o \
deps/mbedtls/entropy_poll.o \
deps/mbedtls/gcm.o \
deps/mbedtls/hmac_drbg.o \
deps/mbedtls/md.o \
deps/mbedtls/md5.o \
deps/mbedtls/md_wrap.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/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/xtea.o
OBJS_TLS_X509 = deps/mbedtls/certs.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
OBJ += $(OBJS_TLS_CRYPTO) $(OBJS_TLS_X509) $(OBJS_TLS)
else ifeq ($(HAVE_SSL), 1)
DEFINES += -DHAVE_SSL
2020-09-21 01:57:05 -07:00
LIBS += $(SYSTEMMBEDTLS_LIBS)
endif
2017-07-02 22:10:23 -07:00
2014-09-13 17:52:30 -07:00
# Miscellaneous
ifeq ($(HAVE_COMMAND), 1)
DEFINES += -DHAVE_COMMAND
endif
2014-09-13 19:37:57 -07:00
ifeq ($(HAVE_STDIN_CMD), 1)
DEFINES += -DHAVE_STDIN_CMD
2014-09-13 19:37:57 -07:00
endif
2014-09-13 18:58:49 -07:00
ifeq ($(HAVE_EMSCRIPTEN), 1)
2018-11-09 11:59:30 -08:00
OBJ += frontend/drivers/platform_emscripten.o \
input/drivers/rwebinput_input.o \
input/drivers_joypad/rwebpad_joypad.o \
camera/drivers/rwebcam.o
2023-07-14 06:59:45 -07:00
ifeq ($(HAVE_RWEBAUDIO), 1)
OBJ += audio/drivers/rwebaudio.o
endif
2014-09-13 18:58:49 -07:00
endif
2020-06-17 04:56:44 -07:00
ifeq ($(HAVE_BLUETOOTH), 1)
OBJ += bluetooth/bluetooth_driver.o
2020-06-17 04:56:44 -07:00
OBJ += bluetooth/drivers/bluetoothctl.o
OBJ += tasks/task_bluetooth.o
2020-06-23 16:51:42 -07:00
ifeq ($(HAVE_DBUS), 1)
OBJ += bluetooth/drivers/bluez.o
endif
endif
2016-09-21 07:06:14 -07:00
ifeq ($(HAVE_LAKKA), 1)
OBJ += network/drivers_wifi/connmanctl.o
OBJ += misc/cpufreq/cpufreq.o
2016-09-21 07:06:14 -07:00
endif
ifeq ($(HAVE_WIFI), 1)
OBJ += network/wifi_driver.o
OBJ += tasks/task_wifi.o
OBJ += network/drivers_wifi/nmcli.o
DEFINES += -DHAVE_WIFI
endif
2014-09-13 17:52:30 -07:00
# Audio
2018-11-09 11:59:30 -08:00
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_COREAUDIO), 1)
DEFINES += -DHAVE_COREAUDIO
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/coreaudio.o
2019-03-26 18:37:34 -07:00
HAVE_COREAUDIO_LIBS = 1
endif
ifeq ($(HAVE_COREAUDIO3), 1)
DEFINES += -DHAVE_COREAUDIO3
OBJ += audio/drivers/coreaudio3.o
2019-03-26 18:37:34 -07:00
HAVE_COREAUDIO_LIBS = 1
LIBS += -framework AudioToolBox -framework AVFoundation
endif
ifeq ($(HAVE_COREAUDIO_LIBS), 1)
2019-03-26 18:37:34 -07:00
LIBS += -framework CoreServices -framework CoreAudio -framework AudioUnit
2014-09-13 17:52:30 -07:00
endif
2015-04-19 15:13:02 -07:00
ifeq ($(HAVE_CORETEXT), 1)
OBJ += gfx/drivers_font_renderer/coretext.o
endif
ifeq ($(HAVE_AUDIOIO), 1)
OBJ += audio/drivers/audioio.o
endif
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_OSS), 1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/oss.o
else ifeq ($(HAVE_OSS_BSD), 1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/oss.o
2014-09-13 17:52:30 -07:00
endif
2017-12-06 20:54:54 -08:00
ifeq ($(TARGET), retroarch_3ds)
2018-11-09 09:49:30 -08:00
OBJ += audio/drivers/ctr_csnd_audio.o \
2020-12-08 15:48:45 -08:00
audio/drivers/ctr_dsp_audio.o
ifeq ($(HAVE_THREADS), 1)
OBJ += audio/drivers/ctr_dsp_thread_audio.o
endif
2017-12-06 20:54:54 -08:00
endif
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_ALSA), 1)
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
OBJ += audio/drivers/alsa.o \
audio/common/alsa.o
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/alsa.o
endif
ifneq ($(HAVE_HAKCHI), 1)
2019-09-29 13:44:58 -07:00
ifneq ($(HAVE_SEGAM), 1)
ifneq ($(DINGUX), 1)
OBJ += midi/drivers/alsa_midi.o
endif
2019-09-29 13:44:58 -07:00
endif
endif
2016-05-11 10:02:43 -07:00
ifneq ($(MIYOO), 1)
ifeq ($(HAVE_THREADS), 1)
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
OBJ += audio/drivers/alsathread.o \
audio/common/alsathread.o
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/alsathread.o
endif
endif
2018-11-09 09:49:30 -08:00
endif
2014-09-13 17:52:30 -07:00
LIBS += $(ALSA_LIBS)
DEF_FLAGS += $(ALSA_CFLAGS)
2014-09-13 17:52:30 -07:00
endif
2017-06-23 18:44:00 -07:00
ifeq ($(HAVE_TINYALSA), 1)
2018-11-09 09:49:30 -08:00
OBJ += audio/drivers/tinyalsa.o
DEFINES += -DHAVE_TINYALSA
2017-06-23 18:44:00 -07:00
endif
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_ROAR), 1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/roar.o
2014-09-13 17:52:30 -07:00
LIBS += $(ROAR_LIBS)
DEF_FLAGS += $(ROAR_CFLAGS)
2014-09-13 17:52:30 -07:00
endif
ifeq ($(HAVE_AL), 1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/openal.o
2014-09-13 17:52:30 -07:00
ifeq ($(OSX),1)
LIBS += -framework OpenAL
else
LIBS += $(AL_LIBS)
2014-09-13 17:52:30 -07:00
endif
endif
ifneq ($(findstring Darwin,$(OS)),)
2015-10-11 00:26:54 -07:00
OBJ += frontend/drivers/platform_darwin.o
endif
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_JACK),1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/jack.o
2014-09-13 17:52:30 -07:00
LIBS += $(JACK_LIBS)
DEF_FLAGS += $(JACK_CFLAGS)
2014-09-13 17:52:30 -07:00
endif
ifeq ($(HAVE_PULSE), 1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/pulse.o
2014-09-13 17:52:30 -07:00
LIBS += $(PULSE_LIBS)
DEF_FLAGS += $(PULSE_CFLAGS)
2014-09-13 17:52:30 -07:00
endif
ifeq ($(HAVE_OSS_LIB), 1)
LIBS += -lossaudio
endif
ifeq ($(HAVE_RSOUND), 1)
2015-03-15 06:28:20 -07:00
OBJ += audio/drivers/rsound.o
DEF_FLAGS += $(RSOUND_CFLAGS)
2014-09-13 17:52:30 -07:00
LIBS += $(RSOUND_LIBS)
endif
ifeq ($(HAVE_DSOUND), 1)
2015-01-11 20:05:56 -08:00
OBJ += audio/drivers/dsound.o
2014-09-13 17:52:30 -07:00
DEFINES += -DHAVE_DSOUND
2018-11-09 09:49:30 -08:00
HAVE_DX_COMMON = 1
2018-01-03 10:58:51 -08:00
LIBS += -ldsound
2014-09-13 17:52:30 -07:00
endif
2017-04-09 14:53:55 -07:00
ifeq ($(HAVE_WASAPI), 1)
HAVE_MMDEVAPI = 1
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
OBJ += audio/drivers/wasapi.o \
audio/common/wasapi.o
2017-04-09 14:53:55 -07:00
DEFINES += -DHAVE_WASAPI
LIBS += -lole32 -lksuser
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/wasapi.o
endif
2017-04-09 14:53:55 -07:00
endif
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_XAUDIO), 1)
2015-04-02 17:29:20 -07:00
OBJ += audio/drivers/xaudio.o
2014-09-13 17:52:30 -07:00
DEFINES += -DHAVE_XAUDIO
LIBS += -lole32
endif
ifeq ($(HAVE_MMDEVAPI), 1)
OBJ += audio/common/mmdevice_common.o
endif
2018-06-03 22:48:08 -07:00
ifeq ($(HAVE_WINMM), 1)
OBJ += midi/drivers/winmm_midi.o
DEFINES += -DHAVE_WINMM
LIBS += -lwinmm
endif
2014-09-13 17:52:30 -07:00
# Audio Resamplers
ifeq ($(HAVE_NEON),1)
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_neon.o \
2017-01-17 09:01:29 -08:00
memory/neon/memcpy-neon.o
2019-01-31 12:55:07 -08:00
2019-01-31 12:55:07 -08:00
DEFINES += -DHAVE_NEON
ASFLAGS += $(NEON_ASFLAGS)
DEF_FLAGS += $(NEON_CFLAGS)
2014-09-13 17:52:30 -07:00
endif
OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o \
$(LIBRETRO_COMM_DIR)/audio/conversion/mono_to_stereo_float.o \
$(LIBRETRO_COMM_DIR)/audio/conversion/stereo_to_mono_float.o \
2020-06-30 08:36:03 -07:00
ifeq ($(HAVE_RWAV), 1)
DEFINES += -DHAVE_RWAV
2020-06-30 08:36:03 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/wav/rwav.o
endif
2016-09-19 10:44:20 -07:00
2016-06-06 21:35:48 -07:00
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
2016-06-06 21:35:48 -07:00
endif
2014-09-13 17:52:30 -07:00
HW_CONTEXT_MENU_DRIVERS=$(HAVE_MENU)
ifeq ($(HW_CONTEXT_MENU_DRIVERS),0)
2018-11-09 09:49:30 -08:00
ifeq ($(HAVE_GL_CONTEXT),1)
HW_CONTEXT_MENU_DRIVERS=1
endif
ifeq ($(HAVE_VULKAN),1)
HW_CONTEXT_MENU_DRIVERS=1
endif
endif
2015-11-17 03:04:02 -08:00
# XMB and MaterialUI are always enabled if supported and not explicitly disabled
ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
ifeq ($(HAVE_RGUI),)
HAVE_RGUI = 1
endif
ifeq ($(HAVE_MATERIALUI),)
HAVE_MATERIALUI = 1
endif
ifeq ($(HAVE_XMB),)
HAVE_XMB = 1
endif
2019-02-03 15:49:35 -08:00
ifeq ($(HAVE_OZONE),)
HAVE_OZONE = 1
endif
else
HAVE_RGUI ?= 0
HAVE_MATERIALUI ?= 0
2018-10-31 04:02:24 -07:00
HAVE_XMB ?= 0
HAVE_OZONE ?= 0
endif
ifeq ($(HAVE_MENU), 1)
DEFINES += -DHAVE_MENU
2014-09-13 15:53:00 -07:00
HAVE_MENU_COMMON = 1
ifeq ($(HAVE_GFX_WIDGETS), 1)
DEFINES += -DHAVE_GFX_WIDGETS
endif
ifeq ($(HAVE_RGUI), 1)
OBJ += menu/drivers/rgui.o
DEFINES += -DHAVE_RGUI
endif
2018-11-09 09:49:30 -08:00
ifeq ($(HAVE_MATERIALUI), 1)
OBJ += menu/drivers/materialui.o
DEFINES += -DHAVE_MATERIALUI
HAVE_ASSETS = 1
HAVE_MENU_SCREENSAVER = 1
2018-11-09 09:49:30 -08:00
endif
ifeq ($(HAVE_XMB), 1)
OBJ += menu/drivers/xmb.o
DEFINES += -DHAVE_XMB
HAVE_ASSETS = 1
HAVE_MENU_SCREENSAVER = 1
endif
2014-09-13 15:53:00 -07:00
ifeq ($(HAVE_OZONE), 1)
OBJ += menu/drivers/ozone.o
DEFINES += -DHAVE_OZONE
HAVE_ASSETS = 1
HAVE_MENU_SCREENSAVER = 1
endif
ifeq ($(HAVE_MENU_SCREENSAVER), 1)
OBJ += menu/menu_screensaver.o
endif
2018-04-07 19:55:16 -07:00
endif
2020-06-17 04:56:44 -07:00
ifeq ($(HAVE_BLUETOOTH), 1)
DEFINES += -DHAVE_BLUETOOTH
endif
ifeq ($(HAVE_LAKKA), 1)
DEFINES += -DHAVE_LAKKA
ifneq ($(HAVE_LAKKA_PROJECT),)
DEFINES += -DHAVE_LAKKA_PROJECT=\"${HAVE_LAKKA_PROJECT}\"
else
$(error You asked for Lakka, but you did not specify a target device name in HAVE_LAKKA_PROJECT)
endif
ifneq ($(HAVE_LAKKA_SERVER),)
DEFINES += -DHAVE_LAKKA_SERVER=\"${HAVE_LAKKA_SERVER}\"
else
$(error You asked for Lakka, but you did not specify update server in HAVE_LAKKA_SERVER)
endif
endif
2018-10-06 05:52:44 -07:00
ifeq ($(HAVE_LAKKA_SWITCH), 1)
DEFINES += -DHAVE_LAKKA_SWITCH
endif
2014-09-13 15:53:00 -07:00
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/menu_setting.o \
menu/menu_driver.o \
2015-10-11 00:26:54 -07:00
menu/cbs/menu_cbs_ok.o \
menu/cbs/menu_cbs_cancel.o \
menu/cbs/menu_cbs_select.o \
menu/cbs/menu_cbs_start.o \
menu/cbs/menu_cbs_info.o \
menu/cbs/menu_cbs_left.o \
menu/cbs/menu_cbs_right.o \
menu/cbs/menu_cbs_deferred_push.o \
menu/cbs/menu_cbs_scan.o \
menu/cbs/menu_cbs_get_value.o \
2016-07-08 07:24:05 -07:00
menu/cbs/menu_cbs_label.o \
2016-10-20 06:57:35 -07:00
menu/cbs/menu_cbs_sublabel.o \
2015-10-11 00:26:54 -07:00
menu/cbs/menu_cbs_title.o \
2022-02-22 10:23:48 -08:00
menu/menu_displaylist.o \
menu/menu_contentless_cores.o
endif
ifeq ($(HAVE_GFX_WIDGETS), 1)
OBJ += gfx/gfx_widgets.o
ifeq ($(HAVE_SCREENSHOTS), 1)
OBJ += gfx/widgets/gfx_widget_screenshot.o
endif
OBJ += \
gfx/widgets/gfx_widget_volume.o \
gfx/widgets/gfx_widget_generic_message.o \
gfx/widgets/gfx_widget_libretro_message.o \
gfx/widgets/gfx_widget_progress_message.o \
gfx/widgets/gfx_widget_load_content_animation.o
ifeq ($(HAVE_CHEEVOS), 1)
OBJ += gfx/widgets/gfx_widget_achievement_popup.o \
gfx/widgets/gfx_widget_leaderboard_display.o
endif
2014-09-13 15:53:00 -07:00
endif
2014-09-13 16:01:52 -07:00
ifeq ($(HAVE_OVERLAY), 1)
DEFINES += -DHAVE_OVERLAY
2018-11-09 09:49:30 -08:00
OBJ += tasks/task_overlay.o \
led/drivers/led_overlay.o
endif
2015-07-14 08:00:28 -07:00
ifeq ($(HAVE_STB_FONT), 1)
OBJ += gfx/drivers_font_renderer/stb.o
OBJ += gfx/drivers_font_renderer/stb_unicode.o
DEFINES += -DHAVE_STB_FONT
2015-07-14 08:00:28 -07:00
endif
2014-09-13 16:01:52 -07:00
ifeq ($(HAVE_FREETYPE), 1)
2015-01-12 14:34:10 -08:00
OBJ += gfx/drivers_font_renderer/freetype.o
2014-09-13 16:01:52 -07:00
LIBS += $(FREETYPE_LIBS)
DEF_FLAGS += $(FREETYPE_CFLAGS)
ifeq ($(HAVE_FREETYPE), 1)
LIBS += $(FONTCONFIG_LIBS)
DEF_FLAGS += $(FONTCONFIG_CFLAGS)
endif
2014-09-13 16:01:52 -07:00
endif
ifeq ($(HAVE_THREADS), 1)
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.o \
2016-06-06 21:35:48 -07:00
gfx/video_thread_wrapper.o \
2016-02-09 08:36:59 -08:00
audio/audio_thread_wrapper.o
2014-09-13 16:01:52 -07:00
DEFINES += -DHAVE_THREADS
ifeq ($(findstring Haiku,$(OS)),)
LIBS += $(THREADS_LIBS)
2014-09-13 16:01:52 -07:00
endif
endif
2014-09-13 16:58:57 -07:00
2016-10-17 17:21:51 -07:00
ifeq ($(HAVE_THREAD_STORAGE), 1)
DEFINES += -DHAVE_THREAD_STORAGE
endif
2017-01-17 08:31:38 -08:00
ifeq ($(HAVE_VITA2D), 1)
2018-11-09 09:49:30 -08:00
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 \
2019-12-14 05:02:40 -08:00
$(DEPS_DIR)/libvita2d/shader/texture_tint_v_gxp.o \
2018-11-09 09:49:30 -08:00
$(DEPS_DIR)/libvita2d/shader/texture_tint_f_gxp.o
OBJ += gfx/drivers/vita2d_gfx.o
2017-01-17 09:01:29 -08:00
INCLUDE_DIRS += -I$(DEPS_DIR)/libvita2d/include
2017-01-17 08:31:38 -08:00
endif
2017-12-06 20:54:54 -08:00
ifeq ($(TARGET), retroarch_3ds)
2018-11-09 09:49:30 -08:00
OBJ += gfx/drivers/ctr_gfx.o \
input/drivers/ctr_input.o \
input/drivers_joypad/ctr_joypad.o
2017-12-06 20:54:54 -08:00
endif
ifeq ($(TARGET), retroarch_ps2)
OBJ += gfx/drivers/ps2_gfx.o \
input/drivers/ps2_input.o \
input/drivers_joypad/ps2_joypad.o \
audio/drivers/ps2_audio.o
endif
2019-07-24 10:56:30 -07:00
ifeq ($(TARGET), retroarch_orbis)
OBJ += input/drivers/ps4_input.o \
input/drivers_joypad/ps4_joypad.o \
audio/drivers/psp_audio.o
endif
2019-07-24 11:04:27 -07:00
ifeq ($(TARGET), retroarch_vita)
OBJ += input/drivers/psp_input.o \
input/drivers_joypad/psp_joypad.o \
audio/drivers/psp_audio.o \
frontend/drivers/platform_psp.o
endif
ifeq ($(TARGET), retroarch_wiiu)
OBJ += gfx/drivers/gx2_gfx.o \
input/drivers/wiiu_input.o \
input/drivers_joypad/wiiu_joypad.o \
input/drivers_joypad/wiiu/wpad_driver.o \
input/drivers_joypad/wiiu/kpad_driver.o \
input/drivers_joypad/wiiu/pad_functions.o \
audio/drivers/wiiu_audio.o \
frontend/drivers/platform_wiiu.o
2019-07-24 11:04:27 -07:00
ifeq ($(WIIU_HID),1)
DEFINES += -DWIIU_HID
INCLUDE_DIRS += -Iinput/include
OBJ += input/drivers_joypad/wiiu/hidpad_driver.o
OBJ += input/drivers_hid/wiiu_hid.o
endif
endif
2017-12-23 17:26:58 -08:00
ifeq ($(TARGET), retroarch_switch)
2018-11-09 09:49:30 -08:00
ifeq ($(HAVE_LIBNX), 1)
OBJ += gfx/drivers/switch_nx_gfx.o \
audio/drivers/switch_libnx_audren_audio.o \
audio/drivers/switch_libnx_audren_thread_audio.o
2018-09-26 15:52:06 -07:00
ifeq ($(HAVE_OPENGL), 1)
2018-11-09 09:49:30 -08:00
OBJ += gfx/drivers_context/switch_ctx.o
2018-09-26 15:52:06 -07:00
endif
2018-11-09 09:49:30 -08:00
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
2017-12-23 17:26:58 -08:00
endif
2018-12-27 16:27:13 -08:00
ifeq ($(TARGET), retroarch_orbis)
OBJ += gfx/drivers_context/orbis_ctx.o \
frontend/drivers/platform_orbis.o
endif
2020-10-01 07:54:11 -07:00
ifeq ($(DINGUX), 1)
OBJ += dingux/dingux_utils.o
endif
2014-09-13 18:22:04 -07:00
ifeq ($(HAVE_WAYLAND), 1)
2018-11-17 04:01:51 -08:00
OBJ += gfx/drivers_context/wayland_ctx.o \
2020-07-14 06:56:37 -07:00
input/common/wayland_common.o \
2019-03-26 18:37:34 -07:00
input/drivers/wayland_input.o \
2022-03-19 19:59:26 -07:00
gfx/common/wayland_common.o \
gfx/common/wayland/fractional-scale-v1.o \
gfx/common/wayland/viewporter.o \
2019-03-26 18:37:34 -07:00
gfx/common/wayland/xdg-shell.o \
gfx/common/wayland/idle-inhibit-unstable-v1.o \
gfx/common/wayland/xdg-decoration-unstable-v1.o \
gfx/common/wayland/pointer-constraints-unstable-v1.o \
gfx/common/wayland/relative-pointer-unstable-v1.o
2020-07-17 04:56:59 -07:00
ifeq ($(HAVE_VULKAN), 1)
OBJ += gfx/drivers_context/wayland_vk_ctx.o
endif
DEF_FLAGS += $(WAYLAND_CFLAGS) $(WAYLAND_CURSOR_CFLAGS)
2018-11-17 04:01:51 -08:00
LIBS += $(WAYLAND_LIBS) $(WAYLAND_CURSOR_LIBS)
ifeq ($(HAVE_LIBDECOR), 1)
DEFINES += -DHAVE_LIBDECOR_H
DEF_FLAGS += $(LIBDECOR_CFLAGS)
endif
2014-09-13 18:22:04 -07:00
endif
# XML
OBJ += \
$(LIBRETRO_COMM_DIR)/formats/xml/rxml.o \
$(LIBRETRO_COMM_DIR)/formats/logiqx_dat/logiqx_dat.o \
deps/yxml/yxml.o
#Input
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_DINPUT), 1)
2018-11-09 09:49:30 -08:00
HAVE_DX_COMMON = 1
2018-01-03 10:58:51 -08:00
LIBS += -ldinput8 -lole32
2014-09-13 17:52:30 -07:00
DEFINES += -DHAVE_DINPUT
OBJ += input/drivers/dinput.o
OBJ += input/drivers_joypad/dinput_joypad.o
2014-09-13 17:52:30 -07:00
endif
2015-04-05 11:54:46 -07:00
ifeq ($(HAVE_XINPUT), 1)
DEFINES += -DHAVE_XINPUT
ifeq ($(HAVE_DINPUT), 1)
OBJ += input/drivers_joypad/xinput_hybrid_joypad.o
else
OBJ += input/drivers_joypad/xinput_joypad.o
endif
2014-09-13 16:58:57 -07:00
endif
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
2016-07-15 06:40:06 -07:00
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
endif
2014-09-13 16:58:57 -07:00
ifeq ($(HAVE_X11), 1)
OBJ += input/common/input_x11_common.o \
input/drivers/x11_input.o \
2015-10-11 00:26:54 -07:00
gfx/common/x11_common.o \
2017-12-15 20:48:05 -08:00
gfx/common/xinerama_common.o \
gfx/display_servers/dispserv_x11.o
2015-10-11 00:26:54 -07:00
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS) $(XRANDR_LIBS)
DEFINES += -DHAVE_X11
DEF_FLAGS += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
2018-11-09 09:49:30 -08:00
ifeq ($(HAVE_XCB),1)
LIBS += -lX11-xcb
2018-11-09 09:49:30 -08:00
endif
ifneq ($(HAVE_OPENGLES), 1)
OBJ += gfx/drivers_context/x_ctx.o
endif
ifeq ($(HAVE_VULKAN), 1)
OBJ += gfx/drivers_context/x_vk_ctx.o
endif
2014-09-13 16:58:57 -07:00
endif
2016-02-19 06:43:12 -08:00
ifeq ($(HAVE_XCB),1)
DEF_FLAGS += $(XCB_CFLAGS)
LIBS += $(XCB_LIBS)
2016-02-19 06:43:12 -08:00
endif
2014-09-13 16:58:57 -07:00
ifeq ($(HAVE_XKBCOMMON), 1)
DEF_FLAGS += $(XKBCOMMON_CFLAGS)
2016-02-09 08:36:59 -08:00
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
2014-09-13 16:58:57 -07:00
LIBS += $(XKBCOMMON_LIBS)
endif
WIP: Fixes #2026 Screensaver suspend on Linux via Dbus One some systems (tested with Gnome 3 on Arch Linux) the current method of using `xdg-screensaver` to suspend the screensaver does not work. Instead, using DBus to issue an `Inhibit` request is recommended. The request returns a cookie that needs to be re-used to un-inhibit the screensaver later. Additionally if the DBus connection is closed the current inhibition is discarded. Thus, the DBus connection needs to stay connected for the duration of the screenshot inhibition. The code is heavily inspired from the [SDL 2.x code](http://hg.libsdl.org/SDL/file/default/src/core/linux/SDL_dbus.c#l172). I didn't call the SDL 2 code though since this it to fix the issue with the GL driver, and I assume one would want to have screensaver inhibited even when SDL 2 is not available (but GL is). I've set "WIP" because: * I haven't done C in a long time so my code is probably not great * There's a dependency on DBus which I don't know is acceptable or not * I've put my code where I could to check it works, but `x11_common` may not be the best place * The code need and "init" and "deinit" kind of method as it needs to initialise the DBus connection, and on deinit close it properly. I've used `x11_connect` and `x11_window_destroy` but they don't sound like the best choices. * I'm a bit unclear as to what happens when "suspend screensaver" is ticked on/off in the menu. This doesn't seem to call `x11_suspend_screensaver` everytime, so I'm not sure if there's a hook somewhere (as disabling screensaver suspend in the menu should cause a DBus unhinibit request to be sent). * Should I just call the SDL 2.x code (meaning that the GL driver would depend on SDL 2.x at runtime)? So, first of all are you ok with the approach, and if yes I'd gladly get feedback about the code, how to architecture it and the best place to put it. Thanks!
2016-09-08 15:18:37 -07:00
ifeq ($(HAVE_DBUS), 1)
2018-11-09 09:49:30 -08:00
LIBS += $(DBUS_LIBS)
DEF_FLAGS += $(DBUS_CFLAGS)
2018-11-09 09:49:30 -08:00
OBJ += gfx/common/dbus_common.o
WIP: Fixes #2026 Screensaver suspend on Linux via Dbus One some systems (tested with Gnome 3 on Arch Linux) the current method of using `xdg-screensaver` to suspend the screensaver does not work. Instead, using DBus to issue an `Inhibit` request is recommended. The request returns a cookie that needs to be re-used to un-inhibit the screensaver later. Additionally if the DBus connection is closed the current inhibition is discarded. Thus, the DBus connection needs to stay connected for the duration of the screenshot inhibition. The code is heavily inspired from the [SDL 2.x code](http://hg.libsdl.org/SDL/file/default/src/core/linux/SDL_dbus.c#l172). I didn't call the SDL 2 code though since this it to fix the issue with the GL driver, and I assume one would want to have screensaver inhibited even when SDL 2 is not available (but GL is). I've set "WIP" because: * I haven't done C in a long time so my code is probably not great * There's a dependency on DBus which I don't know is acceptable or not * I've put my code where I could to check it works, but `x11_common` may not be the best place * The code need and "init" and "deinit" kind of method as it needs to initialise the DBus connection, and on deinit close it properly. I've used `x11_connect` and `x11_window_destroy` but they don't sound like the best choices. * I'm a bit unclear as to what happens when "suspend screensaver" is ticked on/off in the menu. This doesn't seem to call `x11_suspend_screensaver` everytime, so I'm not sure if there's a hook somewhere (as disabling screensaver suspend in the menu should cause a DBus unhinibit request to be sent). * Should I just call the SDL 2.x code (meaning that the GL driver would depend on SDL 2.x at runtime)? So, first of all are you ok with the approach, and if yes I'd gladly get feedback about the code, how to architecture it and the best place to put it. Thanks!
2016-09-08 15:18:37 -07:00
endif
2014-09-13 16:58:57 -07:00
ifeq ($(HAVE_UDEV), 1)
DEF_FLAGS += $(UDEV_CFLAGS)
2014-09-13 16:58:57 -07:00
LIBS += $(UDEV_LIBS)
2015-04-04 12:45:59 -07:00
OBJ += input/drivers/udev_input.o \
2015-10-11 00:26:54 -07:00
input/drivers_joypad/udev_joypad.o
2014-09-13 16:58:57 -07:00
endif
ifeq ($(HAVE_LIBUSB), 1)
2019-07-21 08:59:27 -07:00
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
DEF_FLAGS += $(LIBUSB_CFLAGS)
LIBS += $(LIBUSB_LIBS)
2016-06-06 18:01:33 -07:00
endif
ifeq ($(HAVE_IOHIDMANAGER), 1)
HAVE_HID=1
DEFINES += -DHAVE_IOHIDMANAGER
OBJ += input/drivers_hid/iohidmanager_hid.o
LIBS += -framework IOKit
2016-06-06 18:01:33 -07:00
endif
ifeq ($(HAVE_HID), 1)
2016-02-09 08:36:59 -08:00
DEFINES += -DHAVE_HID
2018-11-09 09:49:30 -08:00
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_ps4_hori_mini.o \
2018-11-09 09:49:30 -08:00
input/connect/connect_wii.o \
2019-08-11 12:28:42 -07:00
input/connect/connect_retrode.o \
2018-11-09 09:49:30 -08:00
input/connect/connect_nesusb.o \
input/connect/connect_snesusb.o \
input/connect/connect_wiiupro.o \
input/connect/connect_kade.o \
input/connect/connect_zerodelay_dragonrise.o \
2018-11-09 09:49:30 -08:00
input/connect/connect_wiiugca.o
endif
2014-10-04 14:04:38 -07:00
ifeq ($(HAVE_PARPORT), 1)
OBJ += input/drivers_joypad/parport_joypad.o
2014-10-04 14:04:38 -07:00
endif
2014-09-13 17:52:30 -07:00
2017-05-18 09:48:41 -07:00
ifneq ($(findstring Win32,$(OS)),)
2020-07-01 21:43:36 -07:00
ifeq ($(HAVE_WINRAWINPUT), 1)
DEFINES += -DHAVE_WINRAWINPUT
OBJ += input/drivers/winraw_input.o
endif
2017-05-18 09:48:41 -07:00
endif
2020-11-17 07:59:39 -08:00
ifeq ($(HAVE_LIBSHAKE), 1)
ifeq ($(OSX), 1)
DEFINES += -DHAVE_LIBSHAKE
INCLUDE_DIRS += -I$(DEPS_DIR)/libShake/include
OBJ += $(DEPS_DIR)/libShake/src/common/error.o \
$(DEPS_DIR)/libShake/src/common/helpers.o \
$(DEPS_DIR)/libShake/src/common/presets.o \
$(DEPS_DIR)/libShake/src/osx/shake.o
else ifeq ($(HAVE_UNIX), 1)
DEFINES += -DHAVE_LIBSHAKE
INCLUDE_DIRS += -I$(DEPS_DIR)/libShake/include
OBJ += $(DEPS_DIR)/libShake/src/common/error.o \
$(DEPS_DIR)/libShake/src/common/helpers.o \
$(DEPS_DIR)/libShake/src/common/presets.o \
$(DEPS_DIR)/libShake/src/linux/shake.o
endif
endif
2015-11-18 22:23:41 -08:00
# Companion UI
ifneq ($(findstring Win32,$(OS)),)
OBJ += ui/drivers/ui_win32.o
2015-11-18 22:23:41 -08:00
endif
2014-09-13 16:58:57 -07:00
# Video
2015-06-17 11:18:25 -07:00
OBJ += gfx/drivers_context/gfx_null_ctx.o
2015-10-11 00:19:11 -07:00
2016-02-22 04:01:16 -08:00
ifeq ($(HAVE_KMS), 1)
2016-07-15 06:40:06 -07:00
HAVE_AND_WILL_USE_DRM = 1
OBJ += gfx/drivers_context/drm_ctx.o \
gfx/display_servers/dispserv_kms.o
ifeq ($(HAVE_ODROIDGO2), 1)
OBJ += gfx/drivers_context/drm_go2_ctx.o
endif
DEF_FLAGS += $(GBM_CFLAGS) $(DRM_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS)
2016-02-22 04:01:16 -08:00
endif
2016-12-01 09:13:36 -08:00
ifeq ($(HAVE_CACA), 1)
DEFINES += -DHAVE_CACA
OBJ += gfx/drivers/caca_gfx.o
2019-07-27 00:56:38 -07:00
LIBS += $(CACA_LIBS)
DEF_FLAGS += $(CACA_CFLAGS)
2016-12-01 09:13:36 -08:00
endif
2018-07-12 13:55:08 -07:00
ifeq ($(HAVE_SIXEL), 1)
DEFINES += -DHAVE_SIXEL
INCLUDE_DIRS += -I/usr/include/sixel
OBJ += gfx/drivers/sixel_gfx.o
LIBS += $(SIXEL_LIBS)
2019-07-27 00:56:38 -07:00
DEF_FLAGS += $(SIXEL_CFLAGS)
2018-07-12 13:55:08 -07:00
endif
ifeq ($(HAVE_NETWORK_VIDEO), 1)
ifneq ($(NETWORK_VIDEO_HOST),)
DEFINES += -DNETWORK_VIDEO_HOST=$(NETWORK_VIDEO_HOST)
else
DEFINES += -DNETWORK_VIDEO_HOST=127.0.0.1
endif
ifneq ($(NETWORK_VIDEO_PORT),)
DEFINES += -DNETWORK_VIDEO_PORT=$(NETWORK_VIDEO_PORT)
else
DEFINES += -DNETWORK_VIDEO_PORT=4953
endif
DEFINES += -DHAVE_NETWORK_VIDEO
2020-07-14 17:37:50 -07:00
OBJ += gfx/drivers/network_gfx.o
endif
ifeq ($(HAVE_PLAIN_DRM), 1)
2016-07-15 06:40:06 -07:00
OBJ += gfx/drivers/drm_gfx.o
ifneq ($(HAVE_LAKKA), 1)
INCLUDE_DIRS += -I/usr/include/libdrm
endif
2016-08-22 05:23:17 -07:00
LIBS += -ldrm
endif
ifeq ($(HAVE_VITAGL), 1)
DEFINES += -DHAVE_OPENGL1 -DHAVE_VITAGL
OBJ += gfx/drivers/gl1.o \
gfx/drivers_context/vita_ctx.o
endif
ifeq ($(HAVE_VITAGLES), 1)
OBJ += gfx/drivers_context/vita_ctx.o
endif
2015-06-17 11:18:25 -07:00
ifeq ($(HAVE_GL_CONTEXT), 1)
2021-09-26 10:57:08 -07:00
OBJ += gfx/common/gl_common.o
2019-02-17 01:41:48 -08:00
ifeq ($(HAVE_GL_MODERN), 1)
DEFINES += -DHAVE_OPENGL
OBJ += gfx/drivers/gl2.o \
$(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o
2019-02-17 01:41:48 -08:00
endif
OBJ += $(LIBRETRO_COMM_DIR)/glsym/rglgen.o
2016-02-09 08:36:59 -08:00
ifeq ($(HAVE_OPENGL1), 1)
2019-02-17 01:41:48 -08:00
DEFINES += -DHAVE_OPENGL1
OBJ += gfx/drivers/gl1.o
2016-02-09 08:36:59 -08:00
endif
2014-09-13 18:44:54 -07:00
ifeq ($(HAVE_VIDEOCORE), 1)
2015-01-12 13:19:31 -08:00
OBJ += gfx/drivers_context/vc_egl_ctx.o
2014-09-13 18:44:54 -07:00
endif
ifeq ($(HAVE_EMSCRIPTEN), 1)
2015-01-12 13:19:31 -08:00
OBJ += gfx/drivers_context/emscriptenegl_ctx.o
2014-09-13 18:44:54 -07:00
endif
ifeq ($(HAVE_MALI_FBDEV), 1)
2015-01-12 13:19:31 -08:00
OBJ += gfx/drivers_context/mali_fbdev_ctx.o
2014-09-13 18:44:54 -07:00
endif
ifeq ($(HAVE_VIVANTE_FBDEV), 1)
2015-01-12 13:19:31 -08:00
OBJ += gfx/drivers_context/vivante_fbdev_ctx.o
2014-09-13 18:44:54 -07:00
endif
ifeq ($(HAVE_X11), 1)
ifeq ($(HAVE_EGL), 1)
2015-01-12 13:19:31 -08:00
OBJ += gfx/drivers_context/xegl_ctx.o
2014-09-13 18:44:54 -07:00
endif
endif
2018-11-09 09:49:30 -08:00
2016-07-30 07:37:22 -07:00
ifeq ($(HAVE_OSMESA), 1)
2019-02-17 01:41:48 -08:00
OBJ += gfx/drivers_context/osmesa_ctx.o
2016-07-30 07:37:22 -07:00
LIBS += -lOSMesa
endif
2018-11-09 09:49:30 -08:00
ifeq ($(HAVE_FFMPEG), 1)
ifneq ($(HAVE_OPENGLES), 1)
OBJ += cores/libretro-ffmpeg/ffmpeg_fft.o
DEFINES += -DHAVE_GL_FFT
INCLUDE_DIRS += -I$(DEPS_DIR)
2018-11-09 09:49:30 -08:00
endif
endif
2018-07-10 18:42:42 -07:00
2018-11-09 09:49:30 -08:00
ifeq ($(HAVE_MPV), 1)
OBJ += cores/libretro-mpv/mpv-libretro.o
DEFINES += -DHAVE_MPV
INCLUDE_DIRS += -I$(DEPS_DIR)
2018-11-09 09:49:30 -08:00
LIBS += -lmpv
endif
2018-06-19 19:29:31 -07:00
2016-09-16 15:38:35 -07:00
ifeq ($(HAVE_OPENGLES), 1)
DEFINES += -DHAVE_OPENGLES
LIBS += $(OPENGLES_LIBS)
DEF_FLAGS += $(OPENGLES_CFLAGS)
2016-09-16 15:38:35 -07:00
ifeq ($(HAVE_OPENGLES3), 1)
2014-09-13 18:44:54 -07:00
DEFINES += -DHAVE_OPENGLES3
2016-08-06 20:45:35 -07:00
else
DEFINES += -DHAVE_OPENGLES2
2014-09-13 18:44:54 -07:00
endif
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.o
2014-09-13 18:44:54 -07:00
else
DEFINES += -DHAVE_GL_SYNC
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.o
GL_LIBS := $(OPENGL_LIBS)
2014-09-13 18:44:54 -07:00
ifeq ($(OSX), 1)
2015-06-02 01:07:07 -07:00
GL_LIBS := -framework OpenGL
2014-09-13 18:44:54 -07:00
else ifneq ($(findstring Win32,$(OS)),)
2017-05-16 13:43:21 -07:00
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32
2019-03-26 18:37:34 -07:00
WANT_WGL=1
2014-09-13 18:44:54 -07:00
endif
2016-02-09 08:36:59 -08:00
LIBS += $(GL_LIBS)
2014-09-13 18:44:54 -07:00
endif
endif
2014-09-13 16:58:57 -07:00
ifeq ($(HAVE_METAL), 1)
DEFINES += -DHAVE_METAL
LIBS += -framework Metal -framework MetalKit
# Metal code relies on ARC (Automatic Reference Counting), enable it
DEF_FLAGS += -fobjc-arc
OBJ += \
gfx/common/metal/metal_renderer.o \
gfx/drivers/metal.o
endif
2015-11-19 04:16:43 -08:00
ifeq ($(HAVE_EGL), 1)
DEFINES += -DHAVE_EGL
DEF_FLAGS += $(EGL_CFLAGS)
2016-02-09 08:36:59 -08:00
OBJ += gfx/common/egl_common.o
2020-01-05 10:14:47 -08:00
ifeq ($(HAVE_DYNAMIC_EGL), 1)
DEFINES += -DHAVE_DYNAMIC_EGL
else
LIBS += $(EGL_LIBS)
endif
2015-11-19 04:16:43 -08:00
endif
ifeq ($(HAVE_SDL2), 1)
HAVE_SDL_COMMON = 1
2019-09-22 03:40:40 -07:00
OBJ += gfx/drivers/sdl2_gfx.o \
gfx/common/sdl2_common.o
DEF_FLAGS += $(SDL2_CFLAGS)
LIBS += $(SDL2_LIBS)
Add microphone support via a new driver (#14731) * Some slight fixes * Update libretro.h * Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE * Finish proof-of-concept for mic support - It works, but doesn't support floating-point audio yet - It may need to be resampled, too * Add macros that aren't available in SDL 2 * Comment out a variable definition for now - For C89 compliance * Add some comments for clarity * Let ALSA tolerate a null new_rate * Partial ALSA microphone support - Not yet tested - Mic is created and destroyed - Mic can also be paused or unpaused - Mic is paused or unpaused with the rest of the driver - Microphone is not yet read * Install error logging in the ALSA driver - It defers to RARCH_ERR * Free the ALSA microphone in alsa_free * Fix an indent * First draft of alsa_read_microphone * Deinitialize SDL Audio in sdl_audio_free * Save and restore the ALSA error logger - You should always practice safe global state * Add newlines to some RARCH_ERRs * Add some logging * Check for the mic being active via settings instead of via flags * Adjusted a log entry to be less misleading - A frequency of 0Hz looks weird to the uninformed - In reality, it means the driver used the requested frequency * Fix an incorrect format string * Tidy up logging in alsa.c * Rename audio_enable_microphone to audio_enable_input * Rename microphone_device to audio_input_device * Add audio_input_latency and audio_input_block_frames settings * Add all mic-related settings to the options menu * Adjust logging for alsa.c - Log the ALSA library version - Add errno details * Refer to the microphone in logs by name * Use %u instead of %d for some log items * Add input_samples_buf * Remove an inaccurate comment * Change type of input_samples_buf * Clean up audio_driver_flush_microphone_input * Comment convert_float_to_s16 - It helped me understand what it's doing - Turns out it'll work just fine on mono audio * Don't use the resampler for mic input * Fix crash in the ALSA driver when reading from a mic * Update some logging messages * ALSA support now works for mics * Reuse some common functions in alsa.c * Add alsa_thread_microphone_t * Refactor alsa.c - Introduce alsa_init_pcm to init any PCM that we're using - Vastly simplifies the implementation of alsa_init and alsa_init_microphone - Will be used for the read-based versions next * Make ALSA logging a little more consistent * Clean up the mic with alsa_free_microphone if alsa_init_microphone fails * Remove an unused function * Move some cleanup in alsa.c to a common function * First crack at mic support for alsathread - Refactor some duplicate code into functions - Use functions introduced in alsa.c - Create and destroy the mic * Slight cleanups for clarity * Implement alsa_thread_set/get_microphone_state * More work on alsathread - No more crashing, but the mic just returns silence * Slight cleanups for clarity * Add alsa_set_mic_enabled_internal - For setting the state of a microphone while considering its current state * Use alsa_set_mic_enabled_internal * Log a little more info * Log when the audio driver is started/stopped * Move base microphone driver code into a new directory - Add microphone_driver.c to Makefile.common - Rename functions as needed * Initialize and deinitialize the microphone driver * Implement sdl_microphone.c * Un-const an argument - In case the driver context needs to do any locking * Revise comments for microphone_driver.h * Remove an unimplemented function * Remove some functions from the mic driver * Remove mic functions from audio_thread_wrapper * Remove mic functions from sdl_audio * Fix microphone_null * Split the mic code for the alsa audio drivers into microphone drivers * Fix an extra struct member * Add a setting for the mic driver * Add a command to reinitialize the microphone driver * Rename mic-related settings * Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL * Rename audio_enable_input to microphone_enable * Remove some labels from qt_options * Search for microphone_driver within find_driver_nonempty * Clean up some mic driver code * Pending mics now return silence * Adjust some logging and comments * Some cleanup in the microphone driver * Invert a flag check - Oops * Fix a log message * Fix the wrong flags being checked * Slight refactor of wasapi_init_device - Add a data_flow parameter - Declare it in a header - In preparation for WASAPI mic support * Add some WASAPI macros for _IAudioCaptureClient * Move some common WASAPI functions to audio/common/wasapi.c - They'll be used by the mic and the audio drivers * Add wasapi_log_hr * Generalize mmdevice_list_new to look for capture devices, too * Fix a function declaration * Move driver-specific device_list_new functions into their respective files * Clean up some declarations * First draft of wasapi microphone driver * Add wasapi_microphone_device_list_free * Change function parameter names to be consistent with microphone_driver * Partially implement wasapi_microphone_read - Mostly copied from the audio driver so far - It doesn't compile yet - But it'll be beautiful when I'm done with it * Refactor the mic driver's functions - Rename get_mic_active to mic_alive - Split set_mic_active into start_mic and stop_mic - Refactor the SDL mic driver accordingly * Edit some WASAPI functions for logging and clarity * Implement more of the WASAPI mic driver * Rename write_event to read_event * Pass the WASAPI driver context to the various read functions * Mostly implement the read function for the WASAPI mic driver * Fix a crash in microphone_driver - Forgot to move the position of the name of null_driver * Reduce some logging in wasapi common functions - Only log the chosen audio client format, not all attempted ones * Add some macro wrappers for IAudioClient methods * Update mic driver configuration - Make the mic driver configurable in the menu - Add config items for WASAPI-related options similar to the audio driver * Fix a menu entry scrolling through audio devices instead of mic devices * Add some utility functions * Expose the new utility functions in wasapi.h * Add extra logging in the WASAPI common functions * Add sharemode_name * Use _IAudioClient_Initialize macro in some places * Pass channels to wasapi_init_client - Remember, mics are in mono * Use _IAudioClient_Initialize macro some more * Forgot to pass channels in some places * Add some utility functions * Forgot an #include * Add wasapi_select_device_format * Simplify the format selection logic in wasapi_init_client_sh * Unset the microphone in wasapi_microphone_close_mic - Ought to prevent a potential segfault * Simplify some logging * Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer * Remove some unneeded logging * Add some values to hresult_name * Polish up wasapi_select_device_format - Test for formats manually when Windows can't - Add some debug logging - Check for channels * Compute the fields of WAVEFORMATEXTENSIBLE correctly - As per the doc's stated requirements * Simplify logic for WASAPI client creation * Fix a potential hang in wasapi_microphone_read_shared_buffered * Stop the microphone if the driver is stopped * Don't name the microphone event * Ensure that wasapi_init_client reports the correct format and rate * Implement exclusive microphone read access for WASAPI * Add _IAudioCaptureClient_GetNextPacketSize macro * Organize cases in hresult_name * Clear some extra fields if wasapi_set_format is setting a Pcm format * Adjust some logs * Adjust some logs * Remove unneeded local vars * Add a log * Update wasapi.c * Update wasapi.c * Fix shared-mode mic support in WASAPI producing broken input - Turns out it had nothing to do with shared mode * Reuse a common function - Remove wasapi_microphone_read_shared_buffered - Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered * Remove some code I was using for test purposes * Clarify some language * Double the default shared-mode mic buffer length * Split getting a device's name into a separate function, then use it * Fix the ALSA mic drivers - To comply with changes I previously made to the mic driver interface * Remove unused synchronization primitives from the SDL microphone driver * Add sdl_microphone_mic_use_float * Document audio_driver_state_flags - I needed to understand these to see if similar flags were required for the mic driver * Remove an unused function in wasapi.c * Add and document flags in microphone_driver.h * Remove driver-specific mic start/stop functions - The mic driver itself doesn't do much processing - That honor goes to individual mics * Remove some unused fields in microphone_driver.h * Add CMD_EVENT_MICROPHONE_STOP/START * Remove unused functions from microphone_null * Change how the mic driver state is referenced in some places * Simplify the SDL microphone driver - The driver backend no longer keeps a reference to the mic (the frontend does that) - Remove functions that are no longer needed - Don't track paused state, just query the mic itself * Simplify the WASAPI microphone driver - Don't track the driver running state or the microphone handle, the frontend does that now - Remove support for unbuffered input (hunterk suggested that it wasn't necessary) * Make microphone_wasapi_sh_buffer_length a uint, not an int - It won't be negative anymore - 0 now represents the default value * Make the microphone frontend more robust - Improve documentation for how various functions should be implemented - Closes all microphones before freeing the driver (so backends don't have to) - Tracks the enabled state of each microphone, so backends don't have to (but they still can) * Stop the mic driver in core_unload_game * Ensure mic support is compatible with the revised menu code * Move alsa.h into audio/common * Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED - It was never really needed * Refactor the ALSA microphone driver - Move common ALSA functions to audio/common/alsa.c - Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm - Don't track the microphone handle in the ALSA driver context - Remove unneeded fields * Move some common alsathread code into audio/common/alsathread.c * Change return type of mic_driver_open_mic_internal to bool * First crack at resampling mic input * Remove an extraneous check - I think something distracted me when I was writing this line * Add stereo/mono conversion functions * Make alsa_start_pcm and alsa_stop_pcm more robust - They now return success if the stream is already running and stopped, respectively * Revise some mic-related comments in libretro.h * First crack at resampling mic input * Simplify an expression * Simplify an expression * Fix a log tag * Allow mic resampler to be configured separately from audio resampler * Add some comments * Set the source ratio to something sensible * Stop deadlock in `alsathread` mic driver * Allow mics to be initialized even when core is loaded from CLI - When loading content from CLI, the drivers are initialized a little differently - That threw off the mic initialization code * Rename the functions in retro_microphone_interface * Revise some mic-related comments in libretro.h * Update retro_microphone_interface - Add get_mic_rate - Add a parameter to open_mic - The modifications don't do anything yet * Use parameter objects in the microphone handle * Replace get_mic_rate with get_params * Add a microphone interface version * Remove part of a comment * Set the effective params in mic_driver_microphone_handle_init * Drop a stray newline * Change where the mic interface is zeroed - I was accidentally throwing out the version that the core was asking for * Reduce logspam for wasapi_set_nonblock_state - Now it only logs when the sync mode is changed * Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0 - -16 is no longer a valid value * Set the new_rate in wasapi_init * Change description of microphone sample rate in the settings * First attempt at resampling configured mic input * Forgot a section * Fix some input samples being skipped * Rename a variable for clarity * Add microphone.outgoing_samples * Update the mic driver - Processed samples are now buffered - The resampler is skipped if the ratio is (very close to) 1 * Remove part of a comment * Update some comments in audio_resampler.h * Slightly refactor the SDL microphone driver - Move SDL_AudioSpec to a field of sdl_microphone_handle_t - Allow SDL to change the requested format and sample rate - Request floating-point input - Implement sdl_microphone_mic_use_float * Fix a non-C89-compliant declaration * Add new files to griffin.c * Remove a C++-style comment * Add two more files to griffin.c * Remove some unneeded declarations in microphone_driver.h * Remove a stray comma in configuration.c - For C89 compliance * Fix compilation on some platforms * Change some function signatures * Make the ALSA drivers always set the audio rate * Fix the alsathread mic driver * Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined * Mute the microphone if the core is running in fast-forward, slow-mo, or rewind * Clarify a comment * Clarify a comment * Add a comment * Don't allocate memory for slowmo samples in the mic driver - We're not supporting slowmo for mics, so it's not needed * Fix a { * Add my name to AUTHORS.h * Add driver_lifetime_flags - For drivers that have special setup/teardown needs * Ensure that resetting the mic driver maintains active mic handles - Prevents fullscreen toggle from stopping all mic input * Update CHANGES.md * Move some default microphone settings to a new part of the config file * Ensure that RetroArch can use the audio format that Windows suggests * Remove references to mic support in the SDL audio driver * Remove unused WASAPI functions * Return failure if RetroArch couldn't select a WASAPI format * Ensure that Windows uses the WASAPI mic driver by default * Treat disabled mic support as a warning, not an error * Clarify some WASAPI-related microphone settings * Remove some unused variables * Add or revise microphone-related comments * Rearrange doc comments for microphone types in libretro.h * Remove a space * Remove some unused flags * Remove ALSA error logger - It was never used anyway * Remove unneeded microphone-related arguments * Document a parameter * Remove a logging call * Add a constant for the microphone's shared buffer length for WASAPI * Fix stylistic inconsistencies * Make mic_driver_get_sample_size a macro instead of a function * Move the microphone implementation to the audio directory * Make microphone support optional (but enabled by default) * Fix the griffin build
2023-06-06 12:55:06 -07:00
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/sdl_microphone.o
# Microphones are not supported by SDL 1.x
endif
else ifeq ($(HAVE_SDL), 1)
HAVE_SDL_COMMON = 1
OBJ += gfx/drivers/sdl_gfx.o
DEF_FLAGS += $(SDL_CFLAGS)
2014-09-13 18:22:04 -07:00
LIBS += $(SDL_LIBS)
2019-12-28 18:21:57 -08:00
else ifeq ($(HAVE_SDL_DINGUX), 1)
HAVE_SDL_COMMON = 1
2020-01-06 18:15:14 -08:00
DEF_FLAGS += -DHAVE_SDL -DHAVE_SDL_DINGUX
ifeq ($(RS90), 1)
OBJ += gfx/drivers/sdl_rs90_gfx.o
else ifeq ($(MIYOO), 1)
OBJ += gfx/drivers/sdl_rs90_gfx.o
else
OBJ += gfx/drivers/sdl_dingux_gfx.o
endif
OBJ += input/drivers/sdl_dingux_input.o \
input/drivers_joypad/sdl_dingux_joypad.o
2019-12-28 18:21:57 -08:00
DEF_FLAGS += $(SDL_DINGUX_CFLAGS)
LIBS += $(SDL_DINGUX_LIBS)
2014-09-13 18:22:04 -07:00
endif
ifeq ($(HAVE_SDL_COMMON), 1)
OBJ += input/drivers/sdl_input.o \
2015-10-11 00:26:54 -07:00
input/drivers_joypad/sdl_joypad.o \
audio/drivers/sdl_audio.o
2014-09-13 18:22:04 -07:00
2015-06-17 11:18:25 -07:00
ifeq ($(HAVE_GL_CONTEXT), 1)
OBJ += gfx/drivers_context/sdl_gl_ctx.o
2014-09-13 18:22:04 -07:00
endif
INCLUDE_DIRS += $(BSD_LOCAL_INC)
2014-09-13 18:22:04 -07:00
endif
ifeq ($(HAVE_XSHM), 1)
OBJ += gfx/drivers/xshm_gfx.o
endif
2016-02-16 11:24:00 -08:00
ifeq ($(HAVE_VULKAN), 1)
2016-07-15 06:40:06 -07:00
ifneq ($(findstring Win32,$(OS)),)
WANT_WGL = 1
2016-07-15 06:40:06 -07:00
# Trivial temporary workaround for MinGW and glslang.
CXXFLAGS += -fpermissive
endif
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-reorder -Wno-parentheses
2016-07-15 06:40:06 -07:00
OBJ += gfx/drivers/vulkan.o \
gfx/common/vulkan_common.o \
$(LIBRETRO_COMM_DIR)/vulkan/vulkan_symbol_wrapper.o
ifeq ($(HAVE_SLANG), 1)
OBJ += gfx/drivers_shader/shader_vulkan.o
endif
2016-07-15 06:40:06 -07:00
2016-08-27 16:48:13 -07:00
ifeq ($(HAVE_VULKAN_DISPLAY), 1)
2016-07-15 06:40:06 -07:00
OBJ += gfx/drivers_context/khr_display_ctx.o
endif
NEED_CXX_LINKER = 1
DEFINES += -DHAVE_VULKAN
INCLUDE_DIRS += -Igfx/include
2017-05-16 13:33:48 -07:00
endif
ifeq ($(HAVE_OPENGL_CORE), 1)
OBJ += gfx/drivers/gl3.o \
gfx/drivers_shader/shader_gl3.o
DEFINES += -DHAVE_OPENGL_CORE
NEED_CXX_LINKER = 1
endif
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_OMAP), 1)
OBJ += gfx/drivers/omap_gfx.o
2014-09-13 17:52:30 -07:00
endif
ifeq ($(HAVE_EXYNOS), 1)
2017-01-17 09:01:29 -08:00
OBJ += gfx/drivers/exynos_gfx.o
2014-09-13 17:52:30 -07:00
LIBS += $(DRM_LIBS) $(EXYNOS_LIBS)
DEF_FLAGS += $(DRM_CFLAGS) $(EXYNOS_CFLAGS)
2016-02-09 08:36:59 -08:00
HAVE_AND_WILL_USE_DRM = 1
endif
ifeq ($(HAVE_AND_WILL_USE_DRM), 1)
2016-02-09 08:36:59 -08:00
OBJ += gfx/common/drm_common.o
2014-09-13 17:52:30 -07:00
endif
ifeq ($(HAVE_DISPMANX), 1)
OBJ += gfx/drivers/dispmanx_gfx.o
2016-02-09 08:36:59 -08:00
HAVE_VIDEOCORE = 1
endif
ifeq ($(HAVE_SUNXI), 1)
2015-04-04 12:45:59 -07:00
OBJ += gfx/drivers/sunxi_gfx.o \
2015-11-16 23:35:00 -08:00
gfx/include/pixman/pixman-arm-neon-asm.o
endif
2014-09-13 16:58:57 -07:00
ifeq ($(HAVE_VG), 1)
2015-11-08 14:31:07 -08:00
OBJ += gfx/drivers/vg.o
DEF_FLAGS += $(VG_CFLAGS)
2014-09-13 16:58:57 -07:00
LIBS += $(VG_LIBS)
endif
ifeq ($(HAVE_XVIDEO), 1)
OBJ += gfx/drivers/xvideo.o
LIBS += $(XVIDEO_LIBS)
DEF_FLAGS += $(XVIDEO_CFLAGS)
2014-09-13 16:58:57 -07:00
endif
2014-09-13 17:05:17 -07:00
ifeq ($(HAVE_D3D9), 1)
2018-11-09 09:49:30 -08:00
HAVE_D3D_COMMON = 1
2018-01-04 05:59:23 -08:00
DEFINES += -DHAVE_D3D9
ifeq ($(HAVE_D3DX9), 1)
HAVE_D3DX_COMMON = 1
2018-11-09 09:49:30 -08:00
endif
ifneq ($(HAVE_DYLIB), 1)
LIBS += $(D3D9_LIBS)
ifeq ($(HAVE_D3DX9), 1)
LIBS += $(D3DX9_LIBS)
2018-11-09 09:49:30 -08:00
endif
endif
HAVE_DX_COMMON = 1
OBJ += gfx/drivers_font/d3d9x_w32_font.o
2017-09-04 15:06:07 -07:00
ifeq ($(HAVE_CG), 1)
LIBS += -lcgD3D9
OBJ += gfx/drivers/d3d9cg.o
2017-09-04 15:06:07 -07:00
endif
endif
ifeq ($(HAVE_D3D10), 1)
HAVE_D3D_COMMON = 1
2018-03-02 08:23:43 -08:00
OBJ += gfx/drivers/d3d10.o \
gfx/common/d3d10_common.o
DEFINES += -DHAVE_D3D10
endif
ifeq ($(HAVE_D3D11), 1)
HAVE_D3D_COMMON = 1
2018-03-02 08:23:43 -08:00
OBJ += gfx/drivers/d3d11.o \
gfx/common/d3d11_common.o
DEFINES += -DHAVE_D3D11
endif
ifeq ($(HAVE_D3D12), 1)
HAVE_D3D_COMMON = 1
2018-03-02 08:23:43 -08:00
OBJ += gfx/drivers/d3d12.o \
gfx/common/d3d12_common.o
DEFINES += -DHAVE_D3D12
endif
ifneq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),)
INCLUDE_DIRS += -isystemgfx/include/dxsdk
2018-03-02 08:23:43 -08:00
OBJ += gfx/common/d3dcompiler_common.o \
2018-11-09 09:49:30 -08:00
gfx/common/dxgi_common.o
DEF_FLAGS += -Wno-unknown-pragmas
endif
2017-09-04 15:06:07 -07:00
ifeq ($(HAVE_D3D8), 1)
2018-11-09 09:49:30 -08:00
HAVE_D3D_COMMON = 1
2018-01-03 10:58:51 -08:00
HAVE_DX_COMMON = 1
2017-09-04 15:06:07 -07:00
DEFINES += -DHAVE_D3D8
ifeq ($(HAVE_D3DX8), 1)
HAVE_D3DX_COMMON = 1
endif
2018-11-09 09:49:30 -08:00
ifneq ($(HAVE_DYLIB), 1)
LIBS += $(D3D8_LIBS)
ifeq ($(HAVE_D3DX8), 1)
LIBS += $(D3DX8_LIBS)
2018-11-09 09:49:30 -08:00
endif
endif
2017-09-04 15:06:07 -07:00
endif
ifeq ($(HAVE_D3DX_COMMON), 1)
DEFINES += -DHAVE_D3DX
endif
2018-01-03 10:58:51 -08:00
ifeq ($(HAVE_DX_COMMON), 1)
2018-11-09 09:49:30 -08:00
LIBS += -ldxguid
2018-01-03 10:58:51 -08:00
endif
2018-01-22 17:55:33 -08:00
ifeq ($(HAVE_D3D8), 1)
2018-11-09 09:49:30 -08:00
DEFINES += -DHAVE_D3D8
2023-06-01 11:14:19 -07:00
OBJ += gfx/drivers/d3d8.o
2018-01-22 17:55:33 -08:00
endif
ifeq ($(HAVE_D3D9), 1)
2018-11-09 09:49:30 -08:00
DEFINES += -DHAVE_D3D9
OBJ += gfx/common/d3d9_common.o
2018-01-22 17:55:33 -08:00
endif
2017-09-04 15:07:26 -07:00
ifeq ($(HAVE_D3D_COMMON), 1)
2018-11-09 09:49:30 -08:00
DEFINES += -DHAVE_D3D
OBJ += gfx/common/d3d_common.o
2014-09-13 17:05:17 -07:00
endif
2014-09-13 17:15:41 -07:00
2019-07-20 10:59:27 -07:00
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o
LIBS += $(CG_LIBS)
endif
ifeq ($(HAVE_GLSL), 1)
DEFINES += -DHAVE_GLSL
OBJ += gfx/drivers_shader/shader_glsl.o
endif
ifeq ($(HAVE_HLSL),1)
DEFINES += -DHAVE_HLSL
OBJ += gfx/drivers/d3d9hlsl.o
2019-07-20 10:59:27 -07:00
endif
ifeq ($(HAVE_SLANG),1)
DEFINES += -DHAVE_SLANG
OBJ += gfx/drivers_shader/slang_process.o
OBJ += gfx/drivers_shader/glslang_util.o
2019-08-18 09:01:21 -07:00
OBJ += gfx/drivers_shader/glslang_util_cxx.o
OBJ += gfx/drivers_shader/slang_reflection.o
endif
2019-07-20 10:59:27 -07:00
ifeq ($(HAVE_SHADERS_COMMON), 1)
OBJ += gfx/video_shader_parse.o
endif
ifeq ($(HAVE_BUILTINGLSLANG), 1)
NEED_CXX_LINKER = 1
HAVE_GLSLANG_COMMON = 1
ifneq ($(findstring Win32,$(OS)),)
GLSLANG_PLATFORM := Windows
else
GLSLANG_PLATFORM := Unix
endif
DEFINES += -DHAVE_BUILTINGLSLANG
INCLUDE_DIRS += \
-I$(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM) \
-I$(DEPS_DIR)/glslang/glslang/OGLCompilersDLL \
-I$(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent \
-I$(DEPS_DIR)/glslang/glslang/glslang/Public \
-I$(DEPS_DIR)/glslang/glslang/SPIRV
GLSLANG_SOURCES := \
gfx/drivers_shader/glslang.cpp \
$(DEPS_DIR)/glslang/glslang/SPIRV/GlslangToSpv.cpp \
$(DEPS_DIR)/glslang/glslang/SPIRV/InReadableOrder.cpp \
$(DEPS_DIR)/glslang/glslang/SPIRV/Logger.cpp \
$(DEPS_DIR)/glslang/glslang/SPIRV/SpvBuilder.cpp \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/GenericCodeGen/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/OGLCompilersDLL/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/*.cpp) \
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
$(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/ossource.cpp
else ifeq ($(HAVE_GLSLANG),1)
HAVE_GLSLANG_COMMON = 1
GLSLANG_SOURCES := gfx/drivers_shader/glslang.cpp
# The order of these libs are somewhat specific
LIBS += $(GLSLANG_LIBS) \
$(GLSLANG_MACHINEINDEPENDENT_LIBS) \
$(GLSLANG_GENERICCODEGEN_LIBS) \
$(GLSLANG_OSDEPENDENT_LIBS) \
$(GLSLANG_OGLCOMPILER_LIBS) \
$(GLSLANG_SPIRV_LIBS) \
$(GLSLANG_SPIRV_TOOLS_OPT_LIBS) \
$(GLSLANG_SPIRV_TOOLS_LIBS)
endif
2018-06-21 12:53:44 -07:00
ifeq ($(HAVE_GLSLANG_COMMON), 1)
DEFINES += -DHAVE_GLSLANG
OBJ += $(GLSLANG_SOURCES_C:.c=.o)
OBJ += $(GLSLANG_SOURCES:.cpp=.o)
endif
ifeq ($(HAVE_SPIRV_CROSS), 1)
2018-11-09 09:49:30 -08:00
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
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_glsl.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_hlsl.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_msl.o
2019-06-24 04:22:57 -07:00
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_parser.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_cross_parsed_ir.o
endif
ifeq ($(WANT_WGL), 1)
2018-11-09 09:49:30 -08:00
OBJ += gfx/drivers_context/wgl_ctx.o
ifeq ($(HAVE_VULKAN),1)
OBJ += gfx/drivers_context/w_vk_ctx.o
endif
LIBS += -lcomctl32
endif
2014-09-13 17:15:41 -07:00
# Compression/Archive
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file.o \
$(LIBRETRO_COMM_DIR)/streams/trans_stream.o \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.o
2014-09-13 17:15:41 -07:00
ifeq ($(HAVE_7ZIP),1)
INCLUDE_DIRS += -I$(DEPS_DIR)/7zip
HAVE_COMPRESSION = 1
2017-09-16 22:28:17 -07:00
DEFINES += -DHAVE_7ZIP -D_7ZIP_ST
7ZOBJ = $(DEPS_DIR)/7zip/7zArcIn.o \
$(DEPS_DIR)/7zip/7zBuf.o \
$(DEPS_DIR)/7zip/7zCrc.o \
$(DEPS_DIR)/7zip/7zCrcOpt.o \
$(DEPS_DIR)/7zip/7zDec.o \
$(DEPS_DIR)/7zip/CpuArch.o \
$(DEPS_DIR)/7zip/Delta.o \
2017-09-16 22:28:17 -07:00
$(DEPS_DIR)/7zip/LzFind.o \
2016-09-19 10:44:20 -07:00
$(DEPS_DIR)/7zip/LzmaDec.o \
$(DEPS_DIR)/7zip/Lzma2Dec.o \
2017-09-16 22:28:17 -07:00
$(DEPS_DIR)/7zip/LzmaEnc.o \
2016-09-19 10:44:20 -07:00
$(DEPS_DIR)/7zip/Bra.o \
$(DEPS_DIR)/7zip/Bra86.o \
$(DEPS_DIR)/7zip/BraIA64.o \
2016-09-19 10:44:20 -07:00
$(DEPS_DIR)/7zip/Bcj2.o \
$(DEPS_DIR)/7zip/7zFile.o \
$(DEPS_DIR)/7zip/7zStream.o
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_7z.o \
2018-11-09 09:49:30 -08:00
$(7ZOBJ)
2014-09-13 17:15:41 -07:00
endif
2014-09-13 17:52:30 -07:00
2017-12-25 22:50:32 -08:00
ifeq ($(HAVE_IBXM), 1)
DEFINES += -DHAVE_IBXM
OBJ += $(DEPS_DIR)/ibxm/ibxm.o
endif
ifeq ($(HAVE_BUILTINFLAC),1)
HAVE_FLAC = 1
DEFINES += -DHAVE_FLAC -DHAVE_DR_FLAC -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 \
-DFLAC_PACKAGE_VERSION="\"retroarch\""
INCLUDE_DIRS += -I$(DEPS_DIR) -I$(DEPS_DIR)/libFLAC/include
FLACOBJ = $(DEPS_DIR)/libFLAC/bitmath.o \
$(DEPS_DIR)/libFLAC/bitreader.o \
$(DEPS_DIR)/libFLAC/cpu.o \
$(DEPS_DIR)/libFLAC/crc.o \
$(DEPS_DIR)/libFLAC/fixed.o \
$(DEPS_DIR)/libFLAC/float.o \
$(DEPS_DIR)/libFLAC/format.o \
$(DEPS_DIR)/libFLAC/lpc.o \
$(DEPS_DIR)/libFLAC/lpc_intrin_avx2.o \
$(DEPS_DIR)/libFLAC/lpc_intrin_sse2.o \
$(DEPS_DIR)/libFLAC/lpc_intrin_sse41.o \
$(DEPS_DIR)/libFLAC/lpc_intrin_sse.o \
$(DEPS_DIR)/libFLAC/md5.o \
$(DEPS_DIR)/libFLAC/memory.o \
$(DEPS_DIR)/libFLAC/stream_decoder.o
ifneq ($(findstring Win32,$(OS)),)
DEFINES += -DHAVE_FSEEKO
# make sure not to use this on legacy Windows versions that don't have W-functions implemented
DEFINES += -DNEED_UTF8_SUPPORT
FLACOBJ += $(DEPS_DIR)/libFLAC/windows_unicode_filenames.o
endif
OBJ += $(FLACOBJ)
else ifeq ($(HAVE_FLAC),1)
DEFINES += -DHAVE_FLAC
LIBS += $(FLAC_LIBS)
endif
2015-02-21 19:56:18 -08:00
ifeq ($(HAVE_BUILTINZLIB), 1)
HAVE_ZLIB_COMMON = 1
OBJ += $(DEPS_DIR)/libz/adler32.o \
$(DEPS_DIR)/libz/libz-crc32.o \
$(DEPS_DIR)/libz/deflate.o \
$(DEPS_DIR)/libz/gzclose.o \
$(DEPS_DIR)/libz/gzlib.o \
$(DEPS_DIR)/libz/gzread.o \
$(DEPS_DIR)/libz/gzwrite.o \
$(DEPS_DIR)/libz/inffast.o \
$(DEPS_DIR)/libz/inflate.o \
$(DEPS_DIR)/libz/inftrees.o \
$(DEPS_DIR)/libz/trees.o \
$(DEPS_DIR)/libz/zutil.o
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include/compat/zlib
else ifeq ($(HAVE_ZLIB),1)
HAVE_ZLIB_COMMON = 1
LIBS += $(ZLIB_LIBS)
endif
ifeq ($(HAVE_ZLIB_COMMON), 1)
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_zlib.o \
2020-04-15 07:48:41 -07:00
$(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.o \
$(LIBRETRO_COMM_DIR)/streams/rzip_stream.o
2014-09-13 19:50:10 -07:00
DEFINES += -DHAVE_ZLIB
HAVE_COMPRESSION = 1
ifeq ($(HAVE_CHD), 1)
INCLUDE_DIRS += -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 \
$(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_huffman.o \
$(LIBRETRO_COMM_DIR)/streams/chd_stream.o \
$(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_zlib.o
ifeq ($(HAVE_FLAC),1)
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac.o \
$(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac_codec.o
endif
ifeq ($(HAVE_7ZIP), 1)
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_lzma.o
endif
2019-02-02 12:15:44 -08:00
endif
2019-02-02 12:18:44 -08:00
endif
2019-06-23 15:23:39 -07:00
ifeq ($(HAVE_CDROM), 1)
ifeq ($(CDROM_DEBUG), 1)
DEFINES += -DCDROM_DEBUG
endif
DEFINES += -DHAVE_CDROM
OBJ += $(LIBRETRO_COMM_DIR)/cdrom/cdrom.o \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.o \
$(LIBRETRO_COMM_DIR)/media/media_detect_cd.o \
tasks/task_content_disc.o
2019-06-23 15:23:39 -07:00
endif
2016-05-18 04:28:20 -07:00
ifeq ($(HAVE_RTGA), 1)
2016-07-15 06:40:06 -07:00
DEFINES += -DHAVE_RTGA
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/tga/rtga.o
2016-05-18 04:28:20 -07:00
endif
2015-04-19 07:55:03 -07:00
ifeq ($(HAVE_RPNG), 1)
2016-07-15 06:40:06 -07:00
DEFINES += -DHAVE_RPNG
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/png/rpng.o \
$(LIBRETRO_COMM_DIR)/formats/png/rpng_encode.o
2015-04-19 07:55:03 -07:00
endif
2016-05-11 12:27:17 -07:00
ifeq ($(HAVE_RJPEG), 1)
2016-07-15 06:40:06 -07:00
DEFINES += -DHAVE_RJPEG
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/jpeg/rjpeg.o
2016-05-11 12:27:17 -07:00
endif
2016-05-18 04:28:20 -07:00
ifeq ($(HAVE_RBMP), 1)
2016-07-15 06:40:06 -07:00
DEFINES += -DHAVE_RBMP
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/bmp/rbmp.o
2016-05-18 04:28:20 -07:00
endif
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/formats/bmp/rbmp_encode.o \
$(LIBRETRO_COMM_DIR)/formats/json/rjson.o \
$(LIBRETRO_COMM_DIR)/formats/image_transfer.o \
$(LIBRETRO_COMM_DIR)/formats/m3u/m3u_file.o
2016-06-06 21:35:48 -07:00
2016-10-17 17:21:51 -07:00
# Video4Linux 2
2014-09-13 17:52:30 -07:00
ifeq ($(HAVE_V4L2),1)
2016-07-28 11:01:38 -07:00
OBJ += camera/drivers/video4linux2.o
ifeq ($(HAVE_VIDEOPROCESSOR),1)
DEFINES += -DHAVE_VIDEOPROCESSOR
2018-11-09 09:49:30 -08:00
OBJ += cores/libretro-video-processor/video_processor_v4l2.o
endif
2014-09-13 17:52:30 -07:00
DEFINES += -DHAVE_V4L2
2016-07-28 10:10:18 -07:00
LIBS += $(V4L2_LIBS)
2014-09-13 17:52:30 -07:00
endif
2020-01-12 12:33:00 -08:00
# Accessibility
ifeq ($(HAVE_ACCESSIBILITY), 1)
DEFINES += -DHAVE_ACCESSIBILITY
2020-04-18 08:59:27 -07:00
ifeq ($(HAVE_SAPI), 1)
ifneq ($(findstring Win32,$(OS)),)
LIBS += -lsapi
2020-01-12 12:33:00 -08:00
endif
endif
2020-04-18 08:59:27 -07:00
endif
2020-01-12 12:33:00 -08:00
# Things that depend on network availability
2014-09-13 18:38:36 -07:00
2015-01-27 15:49:43 -08:00
ifeq ($(HAVE_NETWORKING), 1)
DEFINES += -DHAVE_NETWORKING
2016-09-19 10:44:20 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/net/net_compat.o \
$(LIBRETRO_COMM_DIR)/net/net_http.o \
2016-12-26 15:02:09 -08:00
$(LIBRETRO_COMM_DIR)/net/net_http_parse.o \
2016-09-19 10:44:20 -07:00
$(LIBRETRO_COMM_DIR)/net/net_socket.o \
core_updater_list.o \
2022-05-18 19:23:40 -07:00
network/natt.o \
2018-11-09 09:49:30 -08:00
network/net_http_special.o \
tasks/task_http.o \
tasks/task_netplay_lan_scan.o \
tasks/task_netplay_nat_traversal.o \
tasks/task_pl_thumbnail_download.o \
tasks/task_netplay_find_content.o
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += tasks/task_core_updater.o
endif
2016-06-06 21:35:48 -07:00
ifneq ($(findstring Linux,$(OS)),)
HAVE_CLOUDSYNC = 1
endif
ifeq ($(HAVE_CLOUDSYNC), 1)
DEFINES += -DHAVE_CLOUDSYNC
OBJ += tasks/task_cloudsync.o \
network/cloud_sync/webdav.o \
network/cloud_sync_driver.o
endif
2020-09-20 07:43:05 -07:00
ifeq ($(HAVE_BUILTINBEARSSL), 1)
2020-09-18 15:31:36 -07:00
OBJ += $(LIBRETRO_COMM_DIR)/net/net_socket_ssl_bear.o
else ifeq ($(HAVE_SSL), 1)
OBJ += $(LIBRETRO_COMM_DIR)/net/net_socket_ssl_mbed.o
2017-07-25 20:34:12 -07:00
endif
2022-07-31 22:51:02 -07:00
ifeq ($(HAVE_IFINFO), 1)
DEFINES += -DHAVE_IFINFO
OBJ += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
2016-07-15 06:40:06 -07:00
endif
2016-03-02 15:26:26 -08:00
ifeq ($(WANT_IFADDRS), 1)
2018-11-09 09:49:30 -08:00
DEFINES += -DWANT_IFADDRS
OBJ += $(LIBRETRO_COMM_DIR)/compat/compat_ifaddrs.o
2016-07-15 06:40:06 -07:00
endif
2014-09-13 18:38:36 -07:00
ifneq ($(findstring Win32,$(OS)),)
LIBS += -lws2_32 -liphlpapi
2014-09-13 18:38:36 -07:00
endif
# Netplay
2019-03-26 18:37:34 -07:00
DEFINES += -DHAVE_NETWORK_CMD
OBJ += \
network/netplay/netplay_frontend.o \
network/netplay/netplay_room_parse.o
2019-01-19 09:14:24 -08:00
# RetroAchievements
ifeq ($(HAVE_CHEEVOS), 1)
DEFINES += -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH
INCLUDE_DIRS += -Ideps/rcheevos/include
ifneq ($(HAVE_THREADS), 1)
DEFINES += -DRC_NO_THREADS
else ifneq (,$(filter GEKKO,$(CFLAGS)))
# Gekko (Wii) and 3DS use custom pthread wrappers (see rthreads.c)
DEFINES += -DRC_NO_THREADS
else ifneq (,$(filter _3DS,$(CFLAGS)))
DEFINES += -DRC_NO_THREADS
endif
2020-05-21 14:23:01 -07:00
OBJ += cheevos/cheevos.o \
cheevos/cheevos_client.o \
2021-06-01 07:20:00 -07:00
cheevos/cheevos_menu.o \
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
deps/rcheevos/src/rc_client.o \
deps/rcheevos/src/rc_compat.o \
deps/rcheevos/src/rc_libretro.o \
deps/rcheevos/src/rc_util.o \
deps/rcheevos/src/rcheevos/alloc.o \
2020-05-04 08:11:16 -07:00
deps/rcheevos/src/rcheevos/condition.o \
deps/rcheevos/src/rcheevos/condset.o \
deps/rcheevos/src/rcheevos/consoleinfo.o \
deps/rcheevos/src/rcheevos/format.o \
2020-05-04 08:11:16 -07:00
deps/rcheevos/src/rcheevos/lboard.o \
2019-03-30 11:44:03 -07:00
deps/rcheevos/src/rcheevos/memref.o \
2020-05-04 08:11:16 -07:00
deps/rcheevos/src/rcheevos/operand.o \
2019-03-30 11:44:03 -07:00
deps/rcheevos/src/rcheevos/richpresence.o \
2020-05-04 08:11:16 -07:00
deps/rcheevos/src/rcheevos/runtime.o \
deps/rcheevos/src/rcheevos/runtime_progress.o \
deps/rcheevos/src/rcheevos/trigger.o \
deps/rcheevos/src/rcheevos/value.o \
deps/rcheevos/src/rhash/aes.o \
deps/rcheevos/src/rhash/cdreader.o \
2020-05-04 08:11:16 -07:00
deps/rcheevos/src/rhash/hash.o \
deps/rcheevos/src/rapi/rc_api_common.o \
deps/rcheevos/src/rapi/rc_api_info.o \
deps/rcheevos/src/rapi/rc_api_runtime.o \
deps/rcheevos/src/rapi/rc_api_user.o \
ifeq ($(HAVE_LUA), 1)
DEFINES += -DHAVE_LUA \
-DLUA_32BITS
INCLUDE_DIRS += -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
2018-11-09 09:49:30 -08:00
else
DEFINES += -DRC_DISABLE_LUA
2018-11-09 09:49:30 -08:00
endif
endif
2018-05-28 21:43:30 -07:00
ifeq ($(HAVE_DISCORD), 1)
NEED_CXX_LINKER = 1
HAVE_PRESENCE = 1
2018-05-28 21:43:30 -07:00
DEFINES += -DHAVE_DISCORD
INCLUDE_DIRS += -Ideps/discord-rpc/include
ifneq ($(HAVE_THREADS), 1)
DEFINES += -DDISCORD_DISABLE_IO_THREAD
endif
2018-05-29 01:24:17 -07:00
OBJ += deps/discord-rpc/src/discord_rpc.o \
2018-11-09 09:49:30 -08:00
deps/discord-rpc/src/rpc_connection.o \
2020-06-06 11:50:25 -07:00
deps/discord-rpc/src/serialization.o
2018-11-09 09:49:30 -08:00
2021-11-05 06:00:37 -07:00
OBJ += network/discord.o
2018-11-09 09:49:30 -08:00
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
2018-05-28 21:43:30 -07:00
endif
ifeq ($(HAVE_TRANSLATE), 1)
DEFINES += -DHAVE_TRANSLATE
endif
ifeq ($(HAVE_NETWORKGAMEPAD), 1)
2019-06-17 16:03:33 -07:00
OBJ += cores/libretro-net-retropad/net_retropad_core.o
endif
2014-09-13 18:38:36 -07:00
endif
ifneq ($(findstring FPGA,$(OS)),)
2020-07-08 15:33:19 -07:00
OBJ += gfx/drivers/fpga_gfx.o
endif
ifneq ($(findstring Win32,$(OS)),)
2014-09-14 13:50:29 -07:00
OBJ += media/rarch.o \
2015-10-11 00:26:54 -07:00
gfx/common/win32_common.o \
2019-07-11 04:18:38 -07:00
frontend/drivers/platform_win32.o \
2019-01-06 08:04:28 -08:00
gfx/display_servers/dispserv_win32.o
2019-07-11 04:18:38 -07:00
ifeq ($(HAVE_GDI), 1)
OBJ += gfx/drivers/gdi_gfx.o
LIBS += -lmsimg32
2019-07-11 04:18:38 -07:00
endif
LIBS += -lhid -lsetupapi
endif
2014-09-13 19:43:18 -07:00
ifeq ($(HAVE_ANGLE), 1)
OBJ += gfx/common/angle_common.o
DEFINES += -DHAVE_ANGLE
endif
2014-09-13 19:43:18 -07:00
# Record
ifeq ($(HAVE_FFMPEG), 1)
2015-06-20 15:37:19 -07:00
OBJ += record/drivers/record_ffmpeg.o \
cores/libretro-ffmpeg/ffmpeg_core.o \
cores/libretro-ffmpeg/packet_buffer.o \
cores/libretro-ffmpeg/video_buffer.o \
$(LIBRETRO_COMM_DIR)/rthreads/tpool.o
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS)
DEFINES += -DHAVE_FFMPEG
DEF_FLAGS += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS) \
-Wno-deprecated-declarations
INCLUDE_DIRS += -Iffmpeg
2014-09-13 19:43:18 -07:00
endif
Ver 0.9.2 SR2 (Switchres API) Implimantation Fixed SR close match refresh bug. Added menu high resolution option. Fixed desktop restore bug cuusing endless resolution change requests. Fixed file conflicts Added destop restore resolution back in for manu only. Pulled Switchres fixes. Added better PI rsolution support. Ver 0.7 SR2 (Switchres API) Implimantation Removed HH experimetal check. This is better done via teh switchres.ini at present. Fixed refresh rate bug. Now new resolution and refesh is added correctly. Removed SR deinit from menu restore. Meanu now stays at last content resolution. Ver 0.6.2 SR2 (Switchres API) Implimantation Fixed super resolution bug casuing abnormal video size and aspect ratio Fixed logging issue casuing seg falts on RA exit Ver 0.6 SR2 (Switchres API) Implimantation Ver 0.2 SR2 (Switchres API) Implimantation Added forced super resolutions. Added Multi-monitor/monitor selection support. Added desktop resolution restore when switching back to menu only. Added new menu items for 31KHz standard and 120hz monitor profiles. Added new menu item INI. load monitor profile from switchrss.ini. Fixed winraw driver. Coordinates new refreshed after a resolution change. Fixed Menu aspect ratio in super resolutions. Removed static glabals. These have been added to videocrt_switch struct. Ver 0.1 SR2 (Switchres API) Implimantation Removed old CRTSwitchRes method. Added new SR2 API implimantaion. Resolution swithcing is now done by switchres libs. Both Linux and Windows working with native and super resolutions. Working multi-monitor support with monitor index selection. Working 31KHz support with standard and 120Hxz modes. The monitor index selection is still done via the RA UI. Only choose native and 15KHz form the CRT options in the RA UI as all options are now set in the switchres.ini. All other CRT optoins in the RA UI currently do nothing. Added SR wrapper to fix compile issues. Added back RPi functionality Fixed windows resize/scaling issues on resolution change Thanks @Calamity no more need for crt_switch_driver_refresh() Fix broken case after prevous commit Monitor preset options 15/31KHz now active. Added new meu option. Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your monitor preset will be selected from your switchres.ini file. Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz, Standard Fixed winraw input coordinates after switching resolution. Code cleanup Fixed menu aspect ratio issue Added menu resolution restore after closing content Fixed aspect ratio after menu resolution restore. code clean up Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution. super width bug with restoring menu resolution fix added super resolution check after setting desktop resolutoion variables when menu active only sr_deinit() used to restore desktop mode. Fixed menu sr_deinit bug. now setting sr_active false Removed static globals, added them to video_switch struct Fixex compile bug due to comment // Fixed compile issues doe to c++ comments in teh switchres_wrapper.h Temporarily removed SR2 logging to fix compile isses for c90 added logging back in. Removed support for winnt and osx Added define for C89. Disabled SR if defined C89 Removed all RA compile fixes fro C89 C90 etc. Swithing now working again. Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2 Ver 0.5 SR2 Implimentation. Ver 0.4 SR2 Implimantation. Bake SR inside RA Removed temporary log files Disable switchres when C89/C99 builds. Removed C89 and C90 checks for SR Fixed switchres_wrapper.h location Ver 0.3 SR2 Implimenation Dissable logging for C89 __STDC__ Fix For RPi fixed missing EOL fixed RPi function definition added vidrocrt_switch stuct to RPI funcion fixed xoffset for RPi Removed old RPi function call SR disabled for videocore until VC4 switching ported Reverted back to state 5c8a56c Bake SR inside RA Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Added lidstc++ to makefile.common for switchres Fixed RPi switching. Disabled Switchres for videocore unill it is ported. removed RAA.log. Should not exist Added check for when SR fails to set mode with an aspect ratio fix. added video driver re init for RPi GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI Added logas back in. Checking STDC verstion >= C11 Fixed c89 for loop declaration. Code clean up. Added new functions Fix resolution switching bug introduces with HH code clean up. Fixed menu restore bug on closw content after code clean up Moved SR logging to relevant RA logs Update makefile. Checks for X11 and xrandr fixed makefile Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Update switchres_wrapper.* header comments Update year copyright DRMKMS: build only if libdrm has the required version XRANDR: build only if xrandr is available Simplified maklefile Fixed RPI compile error with unsued functions. As before Disable Griffin. No switching support available. Never has been Removed log file 1 Added Win32 static define Added SR source Removed Videocore check on destroy SR Moved SR deinit to trigger earlier on RA exit. Fixed compile error after upstream rebase Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found Fixed refresh rate changes when no reolution change is detected. Forgot to add teh resolution cahge in with the refresh change oops Fixed endless no detection log. Removed HH check. This can been better adjusted using the switchres.ini fixed compile issue Added better PI crt switching and fixed typo Pulled Swicthres fixes. Updated desktop restore resolution. removed unused makefile Lockec menu refresh to 60hz fixed missing new line Fixed file conflicts Forced 640x480@60 for menu Added high resolution menu option Removed item logg checker Fixed typos Removed unused functions Fixed SR close match refesh bug. Fixed typo
2021-05-11 02:08:15 -07:00
# CRT mode switching
ifeq ($(HAVE_CRTSWITCHRES), 1)
Ver 0.9.2 SR2 (Switchres API) Implimantation Fixed SR close match refresh bug. Added menu high resolution option. Fixed desktop restore bug cuusing endless resolution change requests. Fixed file conflicts Added destop restore resolution back in for manu only. Pulled Switchres fixes. Added better PI rsolution support. Ver 0.7 SR2 (Switchres API) Implimantation Removed HH experimetal check. This is better done via teh switchres.ini at present. Fixed refresh rate bug. Now new resolution and refesh is added correctly. Removed SR deinit from menu restore. Meanu now stays at last content resolution. Ver 0.6.2 SR2 (Switchres API) Implimantation Fixed super resolution bug casuing abnormal video size and aspect ratio Fixed logging issue casuing seg falts on RA exit Ver 0.6 SR2 (Switchres API) Implimantation Ver 0.2 SR2 (Switchres API) Implimantation Added forced super resolutions. Added Multi-monitor/monitor selection support. Added desktop resolution restore when switching back to menu only. Added new menu items for 31KHz standard and 120hz monitor profiles. Added new menu item INI. load monitor profile from switchrss.ini. Fixed winraw driver. Coordinates new refreshed after a resolution change. Fixed Menu aspect ratio in super resolutions. Removed static glabals. These have been added to videocrt_switch struct. Ver 0.1 SR2 (Switchres API) Implimantation Removed old CRTSwitchRes method. Added new SR2 API implimantaion. Resolution swithcing is now done by switchres libs. Both Linux and Windows working with native and super resolutions. Working multi-monitor support with monitor index selection. Working 31KHz support with standard and 120Hxz modes. The monitor index selection is still done via the RA UI. Only choose native and 15KHz form the CRT options in the RA UI as all options are now set in the switchres.ini. All other CRT optoins in the RA UI currently do nothing. Added SR wrapper to fix compile issues. Added back RPi functionality Fixed windows resize/scaling issues on resolution change Thanks @Calamity no more need for crt_switch_driver_refresh() Fix broken case after prevous commit Monitor preset options 15/31KHz now active. Added new meu option. Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your monitor preset will be selected from your switchres.ini file. Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz, Standard Fixed winraw input coordinates after switching resolution. Code cleanup Fixed menu aspect ratio issue Added menu resolution restore after closing content Fixed aspect ratio after menu resolution restore. code clean up Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution. super width bug with restoring menu resolution fix added super resolution check after setting desktop resolutoion variables when menu active only sr_deinit() used to restore desktop mode. Fixed menu sr_deinit bug. now setting sr_active false Removed static globals, added them to video_switch struct Fixex compile bug due to comment // Fixed compile issues doe to c++ comments in teh switchres_wrapper.h Temporarily removed SR2 logging to fix compile isses for c90 added logging back in. Removed support for winnt and osx Added define for C89. Disabled SR if defined C89 Removed all RA compile fixes fro C89 C90 etc. Swithing now working again. Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2 Ver 0.5 SR2 Implimentation. Ver 0.4 SR2 Implimantation. Bake SR inside RA Removed temporary log files Disable switchres when C89/C99 builds. Removed C89 and C90 checks for SR Fixed switchres_wrapper.h location Ver 0.3 SR2 Implimenation Dissable logging for C89 __STDC__ Fix For RPi fixed missing EOL fixed RPi function definition added vidrocrt_switch stuct to RPI funcion fixed xoffset for RPi Removed old RPi function call SR disabled for videocore until VC4 switching ported Reverted back to state 5c8a56c Bake SR inside RA Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Added lidstc++ to makefile.common for switchres Fixed RPi switching. Disabled Switchres for videocore unill it is ported. removed RAA.log. Should not exist Added check for when SR fails to set mode with an aspect ratio fix. added video driver re init for RPi GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI Added logas back in. Checking STDC verstion >= C11 Fixed c89 for loop declaration. Code clean up. Added new functions Fix resolution switching bug introduces with HH code clean up. Fixed menu restore bug on closw content after code clean up Moved SR logging to relevant RA logs Update makefile. Checks for X11 and xrandr fixed makefile Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Update switchres_wrapper.* header comments Update year copyright DRMKMS: build only if libdrm has the required version XRANDR: build only if xrandr is available Simplified maklefile Fixed RPI compile error with unsued functions. As before Disable Griffin. No switching support available. Never has been Removed log file 1 Added Win32 static define Added SR source Removed Videocore check on destroy SR Moved SR deinit to trigger earlier on RA exit. Fixed compile error after upstream rebase Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found Fixed refresh rate changes when no reolution change is detected. Forgot to add teh resolution cahge in with the refresh change oops Fixed endless no detection log. Removed HH check. This can been better adjusted using the switchres.ini fixed compile issue Added better PI crt switching and fixed typo Pulled Swicthres fixes. Updated desktop restore resolution. removed unused makefile Lockec menu refresh to 60hz fixed missing new line Fixed file conflicts Forced 640x480@60 for menu Added high resolution menu option Removed item logg checker Fixed typos Removed unused functions Fixed SR close match refesh bug. Fixed typo
2021-05-11 02:08:15 -07:00
INCLUDE_DIRS += -I$(DEPS_DIR)/switchres
OBJ += gfx/video_crt_switch.o \
$(DEPS_DIR)/switchres/monitor.o \
$(DEPS_DIR)/switchres/modeline.o \
$(DEPS_DIR)/switchres/switchres.o \
$(DEPS_DIR)/switchres/display.o \
$(DEPS_DIR)/switchres/custom_video.o \
$(DEPS_DIR)/switchres/log.o \
$(DEPS_DIR)/switchres/switchres_wrapper.o \
$(DEPS_DIR)/switchres/edid.o
ifneq ($(findstring Win32,$(OS)),)
OBJ += $(DEPS_DIR)/switchres/display_windows.o \
$(DEPS_DIR)/switchres/custom_video_ati_family.o \
$(DEPS_DIR)/switchres/custom_video_ati.o \
$(DEPS_DIR)/switchres/custom_video_adl.o \
$(DEPS_DIR)/switchres/custom_video_pstrip.o \
$(DEPS_DIR)/switchres/resync_windows.o
endif
ifneq ($(findstring Linux,$(OS)),)
OBJ += $(DEPS_DIR)/switchres/display_linux.o
Ver 0.9.2 SR2 (Switchres API) Implimantation Fixed SR close match refresh bug. Added menu high resolution option. Fixed desktop restore bug cuusing endless resolution change requests. Fixed file conflicts Added destop restore resolution back in for manu only. Pulled Switchres fixes. Added better PI rsolution support. Ver 0.7 SR2 (Switchres API) Implimantation Removed HH experimetal check. This is better done via teh switchres.ini at present. Fixed refresh rate bug. Now new resolution and refesh is added correctly. Removed SR deinit from menu restore. Meanu now stays at last content resolution. Ver 0.6.2 SR2 (Switchres API) Implimantation Fixed super resolution bug casuing abnormal video size and aspect ratio Fixed logging issue casuing seg falts on RA exit Ver 0.6 SR2 (Switchres API) Implimantation Ver 0.2 SR2 (Switchres API) Implimantation Added forced super resolutions. Added Multi-monitor/monitor selection support. Added desktop resolution restore when switching back to menu only. Added new menu items for 31KHz standard and 120hz monitor profiles. Added new menu item INI. load monitor profile from switchrss.ini. Fixed winraw driver. Coordinates new refreshed after a resolution change. Fixed Menu aspect ratio in super resolutions. Removed static glabals. These have been added to videocrt_switch struct. Ver 0.1 SR2 (Switchres API) Implimantation Removed old CRTSwitchRes method. Added new SR2 API implimantaion. Resolution swithcing is now done by switchres libs. Both Linux and Windows working with native and super resolutions. Working multi-monitor support with monitor index selection. Working 31KHz support with standard and 120Hxz modes. The monitor index selection is still done via the RA UI. Only choose native and 15KHz form the CRT options in the RA UI as all options are now set in the switchres.ini. All other CRT optoins in the RA UI currently do nothing. Added SR wrapper to fix compile issues. Added back RPi functionality Fixed windows resize/scaling issues on resolution change Thanks @Calamity no more need for crt_switch_driver_refresh() Fix broken case after prevous commit Monitor preset options 15/31KHz now active. Added new meu option. Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your monitor preset will be selected from your switchres.ini file. Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz, Standard Fixed winraw input coordinates after switching resolution. Code cleanup Fixed menu aspect ratio issue Added menu resolution restore after closing content Fixed aspect ratio after menu resolution restore. code clean up Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution. super width bug with restoring menu resolution fix added super resolution check after setting desktop resolutoion variables when menu active only sr_deinit() used to restore desktop mode. Fixed menu sr_deinit bug. now setting sr_active false Removed static globals, added them to video_switch struct Fixex compile bug due to comment // Fixed compile issues doe to c++ comments in teh switchres_wrapper.h Temporarily removed SR2 logging to fix compile isses for c90 added logging back in. Removed support for winnt and osx Added define for C89. Disabled SR if defined C89 Removed all RA compile fixes fro C89 C90 etc. Swithing now working again. Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2 Ver 0.5 SR2 Implimentation. Ver 0.4 SR2 Implimantation. Bake SR inside RA Removed temporary log files Disable switchres when C89/C99 builds. Removed C89 and C90 checks for SR Fixed switchres_wrapper.h location Ver 0.3 SR2 Implimenation Dissable logging for C89 __STDC__ Fix For RPi fixed missing EOL fixed RPi function definition added vidrocrt_switch stuct to RPI funcion fixed xoffset for RPi Removed old RPi function call SR disabled for videocore until VC4 switching ported Reverted back to state 5c8a56c Bake SR inside RA Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Added lidstc++ to makefile.common for switchres Fixed RPi switching. Disabled Switchres for videocore unill it is ported. removed RAA.log. Should not exist Added check for when SR fails to set mode with an aspect ratio fix. added video driver re init for RPi GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI Added logas back in. Checking STDC verstion >= C11 Fixed c89 for loop declaration. Code clean up. Added new functions Fix resolution switching bug introduces with HH code clean up. Fixed menu restore bug on closw content after code clean up Moved SR logging to relevant RA logs Update makefile. Checks for X11 and xrandr fixed makefile Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Update switchres_wrapper.* header comments Update year copyright DRMKMS: build only if libdrm has the required version XRANDR: build only if xrandr is available Simplified maklefile Fixed RPI compile error with unsued functions. As before Disable Griffin. No switching support available. Never has been Removed log file 1 Added Win32 static define Added SR source Removed Videocore check on destroy SR Moved SR deinit to trigger earlier on RA exit. Fixed compile error after upstream rebase Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found Fixed refresh rate changes when no reolution change is detected. Forgot to add teh resolution cahge in with the refresh change oops Fixed endless no detection log. Removed HH check. This can been better adjusted using the switchres.ini fixed compile issue Added better PI crt switching and fixed typo Pulled Swicthres fixes. Updated desktop restore resolution. removed unused makefile Lockec menu refresh to 60hz fixed missing new line Fixed file conflicts Forced 640x480@60 for menu Added high resolution menu option Removed item logg checker Fixed typos Removed unused functions Fixed SR close match refesh bug. Fixed typo
2021-05-11 02:08:15 -07:00
ifeq ($(HAVE_X11)$(HAVE_XRANDR), 11)
OBJ += $(DEPS_DIR)/switchres/custom_video_xrandr.o
Ver 0.9.2 SR2 (Switchres API) Implimantation Fixed SR close match refresh bug. Added menu high resolution option. Fixed desktop restore bug cuusing endless resolution change requests. Fixed file conflicts Added destop restore resolution back in for manu only. Pulled Switchres fixes. Added better PI rsolution support. Ver 0.7 SR2 (Switchres API) Implimantation Removed HH experimetal check. This is better done via teh switchres.ini at present. Fixed refresh rate bug. Now new resolution and refesh is added correctly. Removed SR deinit from menu restore. Meanu now stays at last content resolution. Ver 0.6.2 SR2 (Switchres API) Implimantation Fixed super resolution bug casuing abnormal video size and aspect ratio Fixed logging issue casuing seg falts on RA exit Ver 0.6 SR2 (Switchres API) Implimantation Ver 0.2 SR2 (Switchres API) Implimantation Added forced super resolutions. Added Multi-monitor/monitor selection support. Added desktop resolution restore when switching back to menu only. Added new menu items for 31KHz standard and 120hz monitor profiles. Added new menu item INI. load monitor profile from switchrss.ini. Fixed winraw driver. Coordinates new refreshed after a resolution change. Fixed Menu aspect ratio in super resolutions. Removed static glabals. These have been added to videocrt_switch struct. Ver 0.1 SR2 (Switchres API) Implimantation Removed old CRTSwitchRes method. Added new SR2 API implimantaion. Resolution swithcing is now done by switchres libs. Both Linux and Windows working with native and super resolutions. Working multi-monitor support with monitor index selection. Working 31KHz support with standard and 120Hxz modes. The monitor index selection is still done via the RA UI. Only choose native and 15KHz form the CRT options in the RA UI as all options are now set in the switchres.ini. All other CRT optoins in the RA UI currently do nothing. Added SR wrapper to fix compile issues. Added back RPi functionality Fixed windows resize/scaling issues on resolution change Thanks @Calamity no more need for crt_switch_driver_refresh() Fix broken case after prevous commit Monitor preset options 15/31KHz now active. Added new meu option. Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your monitor preset will be selected from your switchres.ini file. Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz, Standard Fixed winraw input coordinates after switching resolution. Code cleanup Fixed menu aspect ratio issue Added menu resolution restore after closing content Fixed aspect ratio after menu resolution restore. code clean up Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution. super width bug with restoring menu resolution fix added super resolution check after setting desktop resolutoion variables when menu active only sr_deinit() used to restore desktop mode. Fixed menu sr_deinit bug. now setting sr_active false Removed static globals, added them to video_switch struct Fixex compile bug due to comment // Fixed compile issues doe to c++ comments in teh switchres_wrapper.h Temporarily removed SR2 logging to fix compile isses for c90 added logging back in. Removed support for winnt and osx Added define for C89. Disabled SR if defined C89 Removed all RA compile fixes fro C89 C90 etc. Swithing now working again. Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2 Ver 0.5 SR2 Implimentation. Ver 0.4 SR2 Implimantation. Bake SR inside RA Removed temporary log files Disable switchres when C89/C99 builds. Removed C89 and C90 checks for SR Fixed switchres_wrapper.h location Ver 0.3 SR2 Implimenation Dissable logging for C89 __STDC__ Fix For RPi fixed missing EOL fixed RPi function definition added vidrocrt_switch stuct to RPI funcion fixed xoffset for RPi Removed old RPi function call SR disabled for videocore until VC4 switching ported Reverted back to state 5c8a56c Bake SR inside RA Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Added lidstc++ to makefile.common for switchres Fixed RPi switching. Disabled Switchres for videocore unill it is ported. removed RAA.log. Should not exist Added check for when SR fails to set mode with an aspect ratio fix. added video driver re init for RPi GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI Added logas back in. Checking STDC verstion >= C11 Fixed c89 for loop declaration. Code clean up. Added new functions Fix resolution switching bug introduces with HH code clean up. Fixed menu restore bug on closw content after code clean up Moved SR logging to relevant RA logs Update makefile. Checks for X11 and xrandr fixed makefile Use native win32 api for threads. Fix static lib linking LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_ Update switchres_wrapper.* header comments Update year copyright DRMKMS: build only if libdrm has the required version XRANDR: build only if xrandr is available Simplified maklefile Fixed RPI compile error with unsued functions. As before Disable Griffin. No switching support available. Never has been Removed log file 1 Added Win32 static define Added SR source Removed Videocore check on destroy SR Moved SR deinit to trigger earlier on RA exit. Fixed compile error after upstream rebase Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found Fixed refresh rate changes when no reolution change is detected. Forgot to add teh resolution cahge in with the refresh change oops Fixed endless no detection log. Removed HH check. This can been better adjusted using the switchres.ini fixed compile issue Added better PI crt switching and fixed typo Pulled Swicthres fixes. Updated desktop restore resolution. removed unused makefile Lockec menu refresh to 60hz fixed missing new line Fixed file conflicts Forced 640x480@60 for menu Added high resolution menu option Removed item logg checker Fixed typos Removed unused functions Fixed SR close match refesh bug. Fixed typo
2021-05-11 02:08:15 -07:00
DEFINES += -DSR_WITH_XRANDR
endif
endif
ifneq ($(findstring Win32,$(OS)),)
DEFINES += -DSR_WIN32_STATIC
endif
LIBS += -lstdc++
endif
2014-09-16 10:20:33 -07:00
ifeq ($(HAVE_COMPRESSION), 1)
DEFINES += -DHAVE_COMPRESSION
2016-09-18 10:05:17 -07:00
OBJ += tasks/task_decompress.o
endif
2014-09-16 10:20:33 -07:00
ifeq ($(HAVE_COCOA), 1)
HAVE_COCOA_COMMON = 1
endif
ifeq ($(HAVE_COCOA_METAL), 1)
HAVE_COCOA_COMMON = 1
endif
ifeq ($(HAVE_COCOA_COMMON),1)
2021-01-18 11:36:51 -08:00
DEFINES += -DHAVE_MAIN -DOSX
2016-02-09 08:36:59 -08:00
OBJ += input/drivers/cocoa_input.o \
2018-11-09 09:49:30 -08:00
ui/drivers/ui_cocoa.o \
ui/drivers/cocoa/cocoa_common.o
ifeq ($(HAVE_OPENGL), 1)
DEFINES += -DGL_SILENCE_DEPRECATION
OBJ += gfx/drivers_context/cocoa_gl_ctx.o
endif
ifeq ($(HAVE_VULKAN), 1)
OBJ += gfx/drivers_context/cocoa_vk_ctx.o
endif
2015-04-19 15:38:55 -07:00
endif
2017-01-21 14:41:20 -08:00
ifneq ($(findstring DOS,$(OS)),)
2018-11-09 09:49:30 -08:00
OBJ += gfx/drivers/vga_gfx.o \
input/drivers/dos_input.o \
input/drivers_joypad/dos_joypad.o \
2019-06-22 17:22:54 -07:00
frontend/drivers/platform_dos.o
2017-01-21 14:41:20 -08:00
endif
2017-12-06 20:54:54 -08:00
ifeq ($(HAVE_STATIC_VIDEO_FILTERS), 1)
2018-11-09 09:49:30 -08:00
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 \
2019-06-14 07:14:45 -07:00
gfx/video_filters/normal2x.o \
2020-10-09 05:59:41 -07:00
gfx/video_filters/normal2x_width.o \
gfx/video_filters/normal2x_height.o \
2020-11-09 08:20:00 -08:00
gfx/video_filters/normal4x.o \
2020-09-24 08:09:21 -07:00
gfx/video_filters/scanline2x.o \
gfx/video_filters/grid2x.o \
2020-10-09 05:59:41 -07:00
gfx/video_filters/grid3x.o \
2020-09-24 08:09:21 -07:00
gfx/video_filters/gameboy3x.o \
gfx/video_filters/gameboy4x.o \
gfx/video_filters/dot_matrix_3x.o \
2020-11-20 07:22:09 -08:00
gfx/video_filters/dot_matrix_4x.o \
gfx/video_filters/upscale_1_5x.o \
gfx/video_filters/upscale_256x_320x240.o \
gfx/video_filters/picoscale_256x_320x240.o \
2022-05-17 12:42:38 -07:00
gfx/video_filters/upscale_240x160_320x240.o \
gfx/video_filters/upscale_mix_240x160_320x240.o
2017-12-06 20:54:54 -08:00
endif
2017-12-19 13:12:58 -08:00
ifeq ($(WANT_IOSUHAX), 1)
2019-05-29 01:21:56 -07:00
DEFINES += -DHAVE_IOSUHAX
INCLUDE_DIRS += -I$(DEPS_DIR)/libiosuhax/include
OBJ += $(DEPS_DIR)/libiosuhax/source/iosuhax.o \
$(DEPS_DIR)/libiosuhax/source/iosuhax_devoptab.o \
$(DEPS_DIR)/libiosuhax/source/iosuhax_disc_interface.o
2017-12-19 13:12:58 -08:00
endif
ifeq ($(WANT_LIBFAT), 1)
2019-05-29 01:21:56 -07:00
DEFINES += -DHAVE_LIBFAT
INCLUDE_DIRS += -I$(DEPS_DIR)/libfat/include
2018-11-09 09:49:30 -08:00
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
2017-12-19 13:12:58 -08:00
endif
2017-12-06 20:54:54 -08:00
ifeq ($(HAVE_STATIC_AUDIO_FILTERS), 1)
2018-11-09 09:49:30 -08:00
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
2017-12-06 20:54:54 -08:00
endif
ifeq ($(HAVE_RPILED), 1)
OBJ += led/drivers/led_rpi.o \
led/drivers/led_sys_linux.o
endif
2020-09-19 17:16:11 -07:00
ifneq ($(findstring Win32,$(OS)),)
OBJ += led/drivers/led_win32_keyboard.o
2020-09-19 17:16:11 -07:00
endif
2022-06-04 22:27:41 -07:00
ifeq ($(HAVE_X11), 1)
OBJ += led/drivers/led_x11_keyboard.o
endif
ifeq ($(HAVE_VITAGLES), 1)
DEFINES += -DHAVE_VITAGLES
INCLUDE_DIRS += -I$(DEPS_DIR)/Pigs-In-A-Blanket/include
SOURCES := $(DEPS_DIR)/Pigs-In-A-Blanket/src
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
endif
ifeq ($(HAVE_WEBOS), 1)
DEFINES += -DWEBOS
endif
ifeq ($(HAVE_TEST_DRIVERS), 1)
DEFINES += -DHAVE_TEST_DRIVERS
OBJ += input/drivers_joypad/test_joypad.o
endif
#####################################
### Android Play Feature Delivery ###
### (Play Store build core ###
### downloader) ###
2020-10-01 07:54:11 -07:00
#####################################
ifeq ($(ANDROID), 1)
OBJ += play_feature_delivery/play_feature_delivery.o
endif
### Steam integration using mist
ifeq ($(HAVE_MIST), 1)
HAVE_PRESENCE = 1
DEFINES += -DHAVE_MIST
INCLUDE_DIRS += -I$(MIST_PATH)/include
LDFLAGS += -L$(MIST_PATH) -lmist
OBJ += steam/steam.o tasks/task_steam.o
endif
### Shared rich presence code for Discord and Steam
ifeq ($(HAVE_PRESENCE), 1)
DEFINES += -DHAVE_PRESENCE
OBJ += network/presence.o
endif
##################################
### Classic Platform specifics ###
###############WIP################
2019-09-29 13:44:58 -07:00
# Help at https://modmyclassic.com
ifeq ($(HAVE_CLASSIC), 1)
DEFINES += -DHAVE_CLASSIC
endif
ifeq ($(HAVE_C_A7A7), 1)
2018-11-09 09:49:30 -08:00
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)
CC_VERSION := $(shell $(CC) -dumpversion)
ifneq (4.9,$(firstword $(sort $(CC_VERSION) 4.9))) # if version < 4.9
DEF_FLAGS += -march=armv7-a
2018-11-09 09:49:30 -08:00
else
DEF_FLAGS += -march=armv7ve
2018-11-09 09:49:30 -08:00
# If gcc is 5.0 or later
ifeq (5,$(firstword $(sort $(CC_VERSION) 5)))
2018-11-09 09:49:30 -08:00
LDFLAGS += -static-libgcc -static-libstdc++
endif
endif
endif
ifeq ($(HAVE_HAKCHI), 1)
DEFINES += -DHAVE_HAKCHI
endif
2019-09-29 13:44:58 -07:00
ifeq ($(HAVE_SEGAM), 1)
DEFINES += -DHAVE_SEGAM
endif
2020-02-24 10:44:00 -08:00
ifeq ($(HAVE_ODROIDGO2), 1)
DEFINES += -DHAVE_ODROIDGO2
LIBS += -lrga -lpng -lz
2020-02-27 01:22:35 -08:00
INCLUDE_DIRS += -I$(DEPS_DIR)/libgo2/include
OBJ += $(DEPS_DIR)/libgo2/src/display.o \
$(DEPS_DIR)/libgo2/src/queue.o \
gfx/drivers/oga_gfx.o
2020-02-24 10:44:00 -08:00
endif
2020-12-09 08:48:09 -08:00
2018-11-02 07:30:26 -07:00
##################################