mirror of
https://github.com/libretro/RetroArch
synced 2025-03-20 10:20:51 +00:00
Merge branch 'master' into more-wayland
This commit is contained in:
commit
d2f7853d49
@ -25,6 +25,7 @@ Amiga1200Gamer (amigagamer)
|
||||
Andre Leiradella (leiradel)
|
||||
Andrés (fr500)
|
||||
Anthony J. Bentley (bentley)
|
||||
Antonio Jose Ramos Marquez (psxdev)
|
||||
AridRayne
|
||||
Arto Vainiolehto (arakerlu)
|
||||
asako (asakous)
|
||||
|
@ -7,12 +7,14 @@
|
||||
- DEBUGGING: Add an integrated crash handler for debug builds (see https://docs.libretro.com/tech/debugging)
|
||||
- DISCORD: Register the application name properly.
|
||||
- DISK CONTROL: Remember the last used folder / current active folder to make disk-swapping faster.
|
||||
- INPUT: Add new menu toggle (hold start button for 2 seconds)
|
||||
- INPUT/SDL: Flush the joypad events. Decreases cpu usage over time with the SDL joypad driver.
|
||||
- LOCALIZATION: Add Greek translation.
|
||||
- LOCALIZATION: Update German translation.
|
||||
- LOCALIZATION: Update Italian translation.
|
||||
- LOCALIZATION: Update Japanese translation.
|
||||
- LOCALIZATION: Update Simplified Chinese translation.
|
||||
- LOCALIZATION: Update Spanish translation.
|
||||
- MENU: Only show CRT SwitchRes if video display server is implemented (Windows/Linux for now)
|
||||
- MENU: User Interface -> Appearance -> 'Menu Font Green/Blue Color' settings now work properly.
|
||||
- MIDI: Add a Linux ALSA driver for MIDI.
|
||||
@ -37,6 +39,7 @@
|
||||
- WINDOWS: SSL/TLS connections now work properly.
|
||||
- UWP: Initial UWP port.
|
||||
- XBONE: Initial Xbox One port.
|
||||
- XMB/OZONE: Add more icons
|
||||
|
||||
# 1.7.5
|
||||
- CAMERA: Fix Video4Linux2 driver that broke years ago.
|
||||
|
36
Makefile
36
Makefile
@ -16,28 +16,35 @@ include config.mk
|
||||
|
||||
TARGET = retroarch
|
||||
|
||||
OBJ :=
|
||||
LIBS :=
|
||||
DEF_FLAGS :=
|
||||
DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64
|
||||
DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"'
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
CFLAGS ?= -O0 -g
|
||||
CXXFLAGS ?= -O0 -g
|
||||
DEFINES += -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
CFLAGS ?= -O3
|
||||
CXXFLAGS ?= -O3
|
||||
DEF_FLAGS += -ffast-math
|
||||
endif
|
||||
|
||||
OBJ :=
|
||||
LIBS :=
|
||||
DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64
|
||||
DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"'
|
||||
|
||||
ifneq ($(findstring BSD,$(OS)),)
|
||||
CFLAGS += -DBSD
|
||||
DEF_FLAGS += -DBSD
|
||||
LDFLAGS += -L/usr/local/lib
|
||||
UDEV_CFLAGS += -I/usr/local/include/libepoll-shim
|
||||
UDEV_LIBS += -lepoll-shim
|
||||
endif
|
||||
|
||||
ifneq ($(findstring DOS,$(OS)),)
|
||||
CFLAGS += -march=i386
|
||||
DEF_FLAGS += -march=i386
|
||||
LDFLAGS += -lemu
|
||||
endif
|
||||
|
||||
@ -77,15 +84,8 @@ ifneq ($(V),1)
|
||||
Q := @
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_FLAG = -O0 -g
|
||||
DEFINES += -DDEBUG -D_DEBUG
|
||||
else
|
||||
OPTIMIZE_FLAG = -O3 -ffast-math
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DRMINGW), 1)
|
||||
CFLAGS += -DHAVE_DRMINGW
|
||||
DEF_FLAGS += -DHAVE_DRMINGW
|
||||
LDFLAGS += $(DRMINGW_LIBS)
|
||||
endif
|
||||
|
||||
@ -93,10 +93,10 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -mwindows
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb
|
||||
DEF_FLAGS += -Wall $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb
|
||||
|
||||
APPEND_CFLAGS := $(CFLAGS)
|
||||
CXXFLAGS += $(APPEND_CFLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
|
||||
|
||||
ifeq ($(HAVE_CXX), 1)
|
||||
|
177
Makefile.common
177
Makefile.common
@ -4,7 +4,7 @@ LIBRETRO_COMM_DIR := $(ROOT_DIR)/libretro-common
|
||||
WANT_WGL = 0
|
||||
|
||||
ifeq ($(HAVE_STACK_USAGE), 1)
|
||||
CFLAGS += -fstack-usage
|
||||
DEF_FLAGS += -fstack-usage
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT),)
|
||||
@ -31,11 +31,6 @@ ifeq ($(HAVE_VIDEO_PROCESSOR), 1)
|
||||
DEFINES += -DHAVE_VIDEO_PROCESSOR
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MENU), 1)
|
||||
DEFINES += -DHAVE_MENU
|
||||
HAVE_MENU_COMMON = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SOCKET_LEGACY), 1)
|
||||
DEFINES += -DHAVE_SOCKET_LEGACY
|
||||
endif
|
||||
@ -65,13 +60,11 @@ ifeq ($(HAVE_PRESERVE_DYLIB),1)
|
||||
endif
|
||||
|
||||
ifeq ($(GL_DEBUG), 1)
|
||||
CFLAGS += -DGL_DEBUG
|
||||
CXXFLAGS += -DGL_DEBUG
|
||||
DEF_FLAGS += -DGL_DEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(VULKAN_DEBUG), 1)
|
||||
CFLAGS += -DVULKAN_DEBUG
|
||||
CXXFLAGS += -DVULKAN_DEBUG
|
||||
DEF_FLAGS += -DVULKAN_DEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_HARD_FLOAT), 1)
|
||||
@ -83,23 +76,23 @@ ifeq ($(TDM_GCC),)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
DEF_FLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SHADERPIPELINE), 1)
|
||||
CFLAGS += -DHAVE_SHADERPIPELINE
|
||||
DEF_FLAGS += -DHAVE_SHADERPIPELINE
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR)
|
||||
DEF_FLAGS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR)
|
||||
|
||||
# Switches
|
||||
#
|
||||
ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
|
||||
CFLAGS += -DHAVE_NETPLAYDISCOVERY
|
||||
DEF_FLAGS += -DHAVE_NETPLAYDISCOVERY
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETLOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
DEF_FLAGS += -DHAVE_LOGGER
|
||||
DEFINES += -DHAVE_LOGGER
|
||||
OBJ += network/net_logger.o
|
||||
endif
|
||||
@ -151,7 +144,7 @@ endif
|
||||
|
||||
# General object files
|
||||
DEFINES += -DHAVE_DR_MP3
|
||||
CFLAGS += -DHAVE_DR_MP3
|
||||
DEF_FLAGS += -DHAVE_DR_MP3
|
||||
|
||||
OBJ += frontend/frontend.o \
|
||||
frontend/frontend_driver.o \
|
||||
@ -196,6 +189,7 @@ OBJ += frontend/frontend.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_windowsmmap.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_orbis.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_intf.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_path.o \
|
||||
file_path_special.o \
|
||||
@ -342,7 +336,7 @@ ifeq ($(HAVE_QT), 1)
|
||||
ui/drivers/qt/ui_qt_browser_window.o \
|
||||
ui/drivers/qt/ui_qt_load_core_window.o \
|
||||
ui/drivers/qt/ui_qt_msg_window.o \
|
||||
ui/drivers/qt/flowlayout.o \
|
||||
ui/drivers/qt/gridview.o \
|
||||
ui/drivers/qt/shaderparamsdialog.o \
|
||||
ui/drivers/qt/coreoptionsdialog.o \
|
||||
ui/drivers/qt/filedropwidget.o \
|
||||
@ -357,7 +351,7 @@ ifeq ($(HAVE_QT), 1)
|
||||
|
||||
MOC_HEADERS += ui/drivers/ui_qt.h \
|
||||
ui/drivers/qt/ui_qt_load_core_window.h \
|
||||
ui/drivers/qt/flowlayout.h \
|
||||
ui/drivers/qt/gridview.h \
|
||||
ui/drivers/qt/shaderparamsdialog.h \
|
||||
ui/drivers/qt/coreoptionsdialog.h \
|
||||
ui/drivers/qt/filedropwidget.h \
|
||||
@ -644,7 +638,7 @@ ifeq ($(HAVE_NEON),1)
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16_neon.o
|
||||
endif
|
||||
|
||||
HW_CONTEXT_MENU_DRIVERS=$(HAVE_RGUI)
|
||||
HW_CONTEXT_MENU_DRIVERS=$(HAVE_MENU)
|
||||
|
||||
ifeq ($(HW_CONTEXT_MENU_DRIVERS),0)
|
||||
ifeq ($(HAVE_GL_CONTEXT),1)
|
||||
@ -661,6 +655,10 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
|
||||
HAVE_ZARCH = 0
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RGUI),)
|
||||
HAVE_RGUI = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MATERIALUI),)
|
||||
HAVE_MATERIALUI = 1
|
||||
endif
|
||||
@ -682,6 +680,7 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
|
||||
endif
|
||||
else
|
||||
HAVE_ZARCH ?= 0
|
||||
HAVE_RGUI ?= 0
|
||||
HAVE_MATERIALUI ?= 0
|
||||
HAVE_NUKLEAR ?= 0
|
||||
HAVE_XMB ?= 0
|
||||
@ -689,53 +688,57 @@ else
|
||||
HAVE_OZONE ?= 0
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RGUI), 1)
|
||||
OBJ += menu/drivers/rgui.o
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI
|
||||
ifeq ($(HAVE_MENU), 1)
|
||||
DEFINES += -DHAVE_MENU
|
||||
HAVE_MENU_COMMON = 1
|
||||
|
||||
ifeq ($(HAVE_RGUI), 1)
|
||||
OBJ += menu/drivers/rgui.o
|
||||
DEFINES += -DHAVE_RGUI
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MATERIALUI), 1)
|
||||
OBJ += menu/drivers/materialui.o
|
||||
DEFINES += -DHAVE_MATERIALUI
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NUKLEAR), 1)
|
||||
OBJ += menu/drivers/nuklear/nk_common.o
|
||||
OBJ += menu/drivers/nuklear/nk_menu.o
|
||||
OBJ += menu/drivers/nuklear/nk_wnd_debug.o
|
||||
OBJ += menu/drivers/nuklear.o
|
||||
OBJ += menu/drivers/nuklear/nk_common.o \
|
||||
menu/drivers/nuklear/nk_menu.o \
|
||||
menu/drivers/nuklear/nk_wnd_debug.o \
|
||||
menu/drivers/nuklear.o
|
||||
DEFINES += -DHAVE_NUKLEAR
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ZARCH), 1)
|
||||
OBJ += menu/drivers/zarch.o
|
||||
DEFINES += -DHAVE_ZARCH
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XMB), 1)
|
||||
OBJ += menu/drivers/xmb.o
|
||||
DEFINES += -DHAVE_XMB
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
ifeq ($(HAVE_XMB), 1)
|
||||
OBJ += menu/drivers/xmb.o
|
||||
DEFINES += -DHAVE_XMB
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OZONE), 1)
|
||||
OBJ += menu/drivers/ozone/ozone.o
|
||||
OBJ += menu/drivers/ozone/ozone_entries.o
|
||||
OBJ += menu/drivers/ozone/ozone_display.o
|
||||
OBJ += menu/drivers/ozone/ozone_texture.o
|
||||
OBJ += menu/drivers/ozone/ozone_theme.o
|
||||
OBJ += menu/drivers/ozone/ozone_sidebar.o
|
||||
DEFINES += -DHAVE_OZONE
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
ifeq ($(HAVE_OZONE), 1)
|
||||
OBJ += menu/drivers/ozone/ozone.o \
|
||||
menu/drivers/ozone/ozone_entries.o \
|
||||
menu/drivers/ozone/ozone_display.o \
|
||||
menu/drivers/ozone/ozone_texture.o \
|
||||
menu/drivers/ozone/ozone_theme.o \
|
||||
menu/drivers/ozone/ozone_sidebar.o
|
||||
DEFINES += -DHAVE_OZONE
|
||||
HAVE_ASSETS = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STRIPES), 1)
|
||||
OBJ += menu/drivers/stripes.o
|
||||
DEFINES += -DHAVE_STRIPES
|
||||
ifeq ($(HAVE_STRIPES), 1)
|
||||
OBJ += menu/drivers/stripes.o
|
||||
DEFINES += -DHAVE_STRIPES
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LAKKA), 1)
|
||||
@ -746,6 +749,8 @@ ifeq ($(HAVE_LAKKA_SWITCH), 1)
|
||||
DEFINES += -DHAVE_LAKKA_SWITCH
|
||||
endif
|
||||
|
||||
OBJ += menu/menu_shader.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/menu_driver.o \
|
||||
menu/menu_content.o \
|
||||
@ -753,7 +758,6 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/menu_entries.o \
|
||||
menu/menu_setting.o \
|
||||
menu/menu_networking.o \
|
||||
menu/menu_shader.o \
|
||||
menu/widgets/menu_filebrowser.o \
|
||||
menu/widgets/menu_dialog.o \
|
||||
menu/widgets/menu_input_dialog.o \
|
||||
@ -780,9 +784,12 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/cbs/menu_cbs_contentlist_switch.o \
|
||||
menu/menu_displaylist.o \
|
||||
menu/menu_animation.o \
|
||||
menu/drivers_display/menu_display_null.o \
|
||||
menu/drivers/menu_generic.o \
|
||||
menu/drivers/null.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON),1)
|
||||
OBJ += menu/drivers_display/menu_display_null.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
@ -832,14 +839,14 @@ ifeq ($(HAVE_VITA2D), 1)
|
||||
$(DEPS_DIR)/libvita2d/shader/texture_f_gxp.o \
|
||||
$(DEPS_DIR)/libvita2d/shader/texture_tint_f_gxp.o
|
||||
|
||||
ifeq ($(HAVE_MENU),1)
|
||||
ifeq ($(HAVE_MENU_COMMON),1)
|
||||
OBJ += menu/drivers_display/menu_display_vita2d.o
|
||||
endif
|
||||
|
||||
OBJ += gfx/drivers/vita2d_gfx.o \
|
||||
gfx/drivers_font/vita2d_font.o
|
||||
|
||||
CFLAGS += -I$(DEPS_DIR)/libvita2d/include
|
||||
DEF_FLAGS += -I$(DEPS_DIR)/libvita2d/include
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET), retroarch_3ds)
|
||||
@ -940,7 +947,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_DBUS), 1)
|
||||
LIBS += $(DBUS_LIBS)
|
||||
CFLAGS += $(DBUS_CFLAGS)
|
||||
DEF_FLAGS += $(DBUS_CFLAGS)
|
||||
OBJ += gfx/common/dbus_common.o
|
||||
endif
|
||||
|
||||
@ -1035,7 +1042,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_SIXEL), 1)
|
||||
DEFINES += -DHAVE_SIXEL
|
||||
CFLAGS += -I/usr/include/sixel
|
||||
DEF_FLAGS += -I/usr/include/sixel
|
||||
OBJ += gfx/drivers/sixel_gfx.o gfx/drivers_font/sixel_font.o \
|
||||
gfx/drivers_context/sixel_ctx.o
|
||||
LIBS += -lsixel
|
||||
@ -1047,7 +1054,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_PLAIN_DRM), 1)
|
||||
OBJ += gfx/drivers/drm_gfx.o
|
||||
CFLAGS += -I/usr/include/libdrm
|
||||
DEF_FLAGS += -I/usr/include/libdrm
|
||||
LIBS += -ldrm
|
||||
endif
|
||||
|
||||
@ -1116,8 +1123,11 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
gfx/common/metal/MenuDisplay.o \
|
||||
gfx/common/metal_common.o \
|
||||
gfx/drivers/metal.o \
|
||||
menu/drivers_display/menu_display_metal.o \
|
||||
gfx/drivers_font/metal_raster_font.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_metal.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MPV), 1)
|
||||
@ -1299,16 +1309,20 @@ endif
|
||||
ifeq ($(HAVE_D3D10), 1)
|
||||
OBJ += gfx/drivers/d3d10.o \
|
||||
gfx/common/d3d10_common.o \
|
||||
gfx/drivers_font/d3d10_font.o \
|
||||
menu/drivers_display/menu_display_d3d10.o
|
||||
gfx/drivers_font/d3d10_font.o
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_d3d10.o
|
||||
endif
|
||||
DEFINES += -DHAVE_D3D10
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D11), 1)
|
||||
OBJ += gfx/drivers/d3d11.o \
|
||||
gfx/common/d3d11_common.o \
|
||||
gfx/drivers_font/d3d11_font.o \
|
||||
menu/drivers_display/menu_display_d3d11.o
|
||||
gfx/drivers_font/d3d11_font.o
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_d3d11.o
|
||||
endif
|
||||
DEFINES += -DHAVE_D3D11
|
||||
HAVE_SLANG = 1
|
||||
HAVE_GLSLANG = 1
|
||||
@ -1318,8 +1332,10 @@ endif
|
||||
ifeq ($(HAVE_D3D12), 1)
|
||||
OBJ += gfx/drivers/d3d12.o \
|
||||
gfx/common/d3d12_common.o \
|
||||
gfx/drivers_font/d3d12_font.o \
|
||||
menu/drivers_display/menu_display_d3d12.o
|
||||
gfx/drivers_font/d3d12_font.o
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_d3d12.o
|
||||
endif
|
||||
DEFINES += -DHAVE_D3D12
|
||||
HAVE_SLANG = 1
|
||||
HAVE_GLSLANG = 1
|
||||
@ -1330,7 +1346,7 @@ ifneq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),)
|
||||
INCLUDE_DIRS += -isystemgfx/include/dxsdk
|
||||
OBJ += gfx/common/d3dcompiler_common.o \
|
||||
gfx/common/dxgi_common.o
|
||||
CFLAGS += -Wno-unknown-pragmas
|
||||
DEF_FLAGS += -Wno-unknown-pragmas
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D8), 1)
|
||||
@ -1446,7 +1462,7 @@ OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.o
|
||||
|
||||
ifeq ($(HAVE_7ZIP),1)
|
||||
CFLAGS += -I$(DEPS_DIR)/7zip
|
||||
DEF_FLAGS += -I$(DEPS_DIR)/7zip
|
||||
HAVE_COMPRESSION = 1
|
||||
DEFINES += -DHAVE_7ZIP -D_7ZIP_ST
|
||||
7ZOBJ = $(DEPS_DIR)/7zip/7zIn.o \
|
||||
@ -1475,8 +1491,8 @@ endif
|
||||
ifeq ($(HAVE_BUILTINFLAC),1)
|
||||
HAVE_FLAC = 1
|
||||
DEFINES += -DHAVE_DR_FLAC -I$(DEPS_DIR)
|
||||
CFLAGS += -DHAVE_DR_FLAC
|
||||
CFLAGS += -DHAVE_FLAC -I$(DEPS_DIR)/libFLAC/include
|
||||
DEF_FLAGS += -DHAVE_DR_FLAC
|
||||
DEF_FLAGS += -DHAVE_FLAC -I$(DEPS_DIR)/libFLAC/include
|
||||
DEFINES += -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 \
|
||||
-DFLAC_PACKAGE_VERSION="\"retroarch\""
|
||||
FLACOBJ = $(DEPS_DIR)/libFLAC/bitmath.o \
|
||||
@ -1534,7 +1550,7 @@ ifeq ($(HAVE_ZLIB), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CHD), 1)
|
||||
CFLAGS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr
|
||||
DEF_FLAGS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr
|
||||
DEFINES += -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_bitstream.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_cdrom.o \
|
||||
@ -1586,6 +1602,12 @@ ifdef HAVE_COMPRESSION
|
||||
DEFINES += -DHAVE_COMPRESSION
|
||||
endif
|
||||
|
||||
# Easter Egg
|
||||
ifeq ($(HAVE_EASTEREGG),1)
|
||||
DEFINES += -DHAVE_EASTEREGG
|
||||
OBJ += cores/libretro-gong/gong.o
|
||||
endif
|
||||
|
||||
# Video4Linux 2
|
||||
|
||||
ifeq ($(HAVE_V4L2),1)
|
||||
@ -1753,9 +1775,11 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += gfx/drivers/gdi_gfx.o \
|
||||
gfx/drivers_context/gdi_ctx.o \
|
||||
gfx/drivers_font/gdi_font.o \
|
||||
gfx/display_servers/dispserv_win32.o \
|
||||
menu/drivers_display/menu_display_gdi.o
|
||||
gfx/display_servers/dispserv_win32.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_gdi.o
|
||||
endif
|
||||
LIBS += -lmsimg32 -lhid -lsetupapi
|
||||
endif
|
||||
|
||||
@ -1826,7 +1850,7 @@ endif
|
||||
|
||||
ifeq ($(WANT_IOSUHAX), 1)
|
||||
DEFINES += -I$(DEPS_DIR)/libiosuhax
|
||||
CFLAGS += -I$(DEPS_DIR)/libiosuhax
|
||||
DEF_FLAGS += -I$(DEPS_DIR)/libiosuhax
|
||||
OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \
|
||||
$(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \
|
||||
$(DEPS_DIR)/libiosuhax/iosuhax_disc_interface.o
|
||||
@ -1834,7 +1858,7 @@ endif
|
||||
|
||||
ifeq ($(WANT_LIBFAT), 1)
|
||||
DEFINES += -I$(DEPS_DIR)/libfat/include
|
||||
CFLAGS += -I$(DEPS_DIR)/libfat/include
|
||||
DEF_FLAGS += -I$(DEPS_DIR)/libfat/include
|
||||
OBJ += $(DEPS_DIR)/libfat/cache.o \
|
||||
$(DEPS_DIR)/libfat/directory.o \
|
||||
$(DEPS_DIR)/libfat/disc.o \
|
||||
@ -1868,7 +1892,7 @@ endif
|
||||
# Help at https://modmyclassic.com/comp
|
||||
|
||||
ifeq ($(HAVE_CLASSIC), 1)
|
||||
CFLAGS += -DHAVE_CLASSIC
|
||||
DEF_FLAGS += -DHAVE_CLASSIC
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_C_A7A7), 1)
|
||||
@ -1880,12 +1904,11 @@ ifeq ($(HAVE_C_A7A7), 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
|
||||
CFLAGS += $(C_A7A7_OPT)
|
||||
CXXFLAGS += $(C_A7A7_OPT)
|
||||
DEF_FLAGS += $(C_A7A7_OPT)
|
||||
ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1)
|
||||
CFLAGS += -march=armv7-a
|
||||
DEF_FLAGS += -march=armv7-a
|
||||
else
|
||||
CFLAGS += -march=armv7ve
|
||||
DEF_FLAGS += -march=armv7ve
|
||||
# If gcc is 5.0 or later
|
||||
ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1)
|
||||
LDFLAGS += -static-libgcc -static-libstdc++
|
||||
@ -1894,6 +1917,6 @@ ifeq ($(HAVE_C_A7A7), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_HAKCHI), 1)
|
||||
CFLAGS += -DHAVE_HAKCHI
|
||||
DEF_FLAGS += -DHAVE_HAKCHI
|
||||
endif
|
||||
##################################
|
||||
|
@ -62,6 +62,7 @@ else
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_7ZIP = 1
|
||||
@ -80,6 +81,7 @@ else
|
||||
#HAVE_BUILTINMBEDTLS = 1
|
||||
|
||||
include Makefile.common
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
BLACKLIST :=
|
||||
BLACKLIST += input/input_overlay.o
|
||||
BLACKLIST += tasks/task_overlay.o
|
||||
@ -105,7 +107,6 @@ MAKEROM_ARGS_COMMON = -rsf $(APP_RSF) -exefslogo -elf $(TARGET).elf -icon $(TARG
|
||||
INCDIRS := -I$(CTRULIB)/include
|
||||
LIBDIRS := -L. -L$(CTRULIB)/lib
|
||||
|
||||
|
||||
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft
|
||||
|
||||
CFLAGS += -mword-relocations \
|
||||
@ -149,7 +150,6 @@ LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
CFLAGS += -std=gnu99 -ffast-math
|
||||
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_ctr $(WHOLE_END) -lm
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
@ -158,7 +158,6 @@ else
|
||||
LIBS += -lctru
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(BUILD_3DSX), 1)
|
||||
TARGET_3DSX := $(TARGET).3dsx $(TARGET).smdh
|
||||
endif
|
||||
@ -268,7 +267,6 @@ $(TARGET).3ds: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF)
|
||||
$(TARGET).cia: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF)
|
||||
$(MAKEROM) -f cia -o $@ $(MAKEROM_ARGS_COMMON) -DAPP_ENCRYPTED=false
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ)
|
||||
rm -f $(TARGET).3dsx
|
||||
@ -283,4 +281,3 @@ clean:
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
|
@ -27,6 +27,7 @@ OBJ := ctr/ctr_system.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
@ -94,10 +95,8 @@ LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
CFLAGS += -std=gnu99 -ffast-math
|
||||
|
||||
|
||||
LIBS := -lctru -lm
|
||||
|
||||
|
||||
ifeq ($(BUILD_3DSX), 1)
|
||||
TARGET_3DSX := $(TARGET).3dsx $(TARGET).smdh
|
||||
endif
|
||||
@ -221,4 +220,3 @@ clean:
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@ HAVE_OPENGLES = 1
|
||||
HAVE_RJPEG = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_EMSCRIPTEN = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_SDL = 0
|
||||
HAVE_SDL2 = 0
|
||||
@ -57,7 +58,7 @@ endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
CFLAGS += -Ideps/libz -Ideps -Ideps/stb
|
||||
CFLAGS += $(DEF_FLAGS) -Ideps/libz -Ideps -Ideps/stb
|
||||
libretro = libretro_emscripten.bc
|
||||
|
||||
ifneq ($(V), 1)
|
||||
|
@ -430,8 +430,8 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
CXX = cl.exe
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -DHAVE_EASTEREGG
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib msimg32.lib
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH)
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE")
|
||||
@ -479,7 +479,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2010_,,$(platform))
|
||||
@ -550,7 +550,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2012_,,$(platform))
|
||||
@ -625,7 +625,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2013_,,$(platform))
|
||||
@ -700,7 +700,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32
|
||||
PLATCFLAGS += -D__i686__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2015_,,$(platform))
|
||||
@ -1074,7 +1074,6 @@ overlays-checkout:
|
||||
$(GIT) clone git://github.com/libretro/common-overlays.git $(OVERLAY_DIR); \
|
||||
fi
|
||||
|
||||
|
||||
clean:
|
||||
rm -f $(EXT_TARGET)
|
||||
rm -f $(EXT_INTER_TARGET)
|
||||
|
@ -41,6 +41,7 @@ HAVE_NETWORKING = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_CHD = 1
|
||||
|
||||
# RetroArch libnx useful flags
|
||||
HAVE_THREADS = 1
|
||||
|
@ -45,7 +45,6 @@ export CXX := $(PREFIX)g++
|
||||
export AR := $(PREFIX)ar
|
||||
export OBJCOPY := $(PREFIX)objcopy
|
||||
|
||||
|
||||
ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH))
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
@ -131,7 +130,6 @@ INCLUDES := $(DEFINCS) \
|
||||
|
||||
MACHDEP := -DBIGENDIAN -DGEKKO -mcpu=750 -meabi -msdata=eabi -mhard-float -ffunction-sections -fdata-sections
|
||||
|
||||
|
||||
ifeq ($(PLATFORM),wii)
|
||||
MACHDEP += -DHW_RVL
|
||||
endif
|
||||
@ -159,7 +157,6 @@ VPATH := $(LWIPDIR) \
|
||||
$(LIBWIIKEYB) \
|
||||
$(STUBSDIR)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
SOURCES_LWIP := $(LWIPDIR)/network.c \
|
||||
$(LWIPDIR)/netio.c \
|
||||
@ -264,7 +261,6 @@ SOURCES_OGC_ASM := $(OGCDIR)/cache_asm.S \
|
||||
$(OGCDIR)/system_asm.S \
|
||||
$(OGCDIR)/video_asm.S
|
||||
|
||||
|
||||
ifneq ($(BUILD_LITE), 1)
|
||||
SOURCES_OGC += $(OGCDIR)/dvd.c
|
||||
endif
|
||||
|
@ -7,7 +7,6 @@ ARCH = amd64
|
||||
BUILD_DIR = objs/msvc
|
||||
CXX_BUILD = 0
|
||||
|
||||
|
||||
WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
|
||||
WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
|
||||
VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)
|
||||
@ -30,6 +29,7 @@ HAVE_WINMM := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_ZLIB := 1
|
||||
WANT_ZLIB := 1
|
||||
HAVE_MENU := 1
|
||||
HAVE_RGUI := 1
|
||||
HAVE_XMB := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
@ -59,7 +59,7 @@ HAVE_IMAGEVIEWER := 1
|
||||
|
||||
include Makefile.common
|
||||
INCLUDE_DIRS := $(patsubst -isystem%,-I%,$(INCLUDE_DIRS))
|
||||
CFLAGS := $(filter-out -Wno-unknown-pragmas,$(CFLAGS))
|
||||
CFLAGS := $(filter-out -Wno-unknown-pragmas,$(DEF_FLAGS))
|
||||
CXXFLAGS := $(filter-out -fpermissive -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses,$(CXXFLAGS))
|
||||
LIBS := $(filter-out -lstdc++,$(LIBS))
|
||||
|
||||
@ -90,14 +90,12 @@ ifeq ($(ARCH),x86)
|
||||
CROSS =
|
||||
endif
|
||||
|
||||
|
||||
INCLUDE := $(VCINSTALLDIR)include;$(VCINSTALLDIR)atlmfc\include;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um;
|
||||
LIB := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\$(TARGET_ARCH2);$(WindowsSdkDir)lib\$(WindowsSDKVersion)um\$(TARGET_ARCH2);C:\Program Files (x86)\NVIDIA Corporation\Cg\lib.$(TARGET_ARCH2);C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Lib\$(TARGET_ARCH2);
|
||||
LIBPATH := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VCINSTALLDIR)bin\\$(CROSS)"):$(shell IFS=$$'\n'; cygpath "$(WindowsSdkDir)\bin\\$(ARCH2)"):$(PATH)
|
||||
|
||||
|
||||
export INCLUDE := $(INCLUDE)
|
||||
export LIB := $(LIB)
|
||||
export LIBPATH := $(LIBPATH)
|
||||
@ -144,7 +142,6 @@ RC = rc.exe
|
||||
LIBS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib
|
||||
LDFLAGS += -nologo -wx -nxcompat -machine:$(TARGET_ARCH2)
|
||||
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
FLAGS += -GS -Gy -Od -RTC1 -D_SECURE_SCL=1 -Zi
|
||||
FLAGS += -MDd
|
||||
@ -155,7 +152,6 @@ else
|
||||
FLAGS += -MD
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
BUILD_DIR := $(BUILD_DIR)-debug
|
||||
endif
|
||||
@ -170,7 +166,6 @@ ifneq ($(V), 1)
|
||||
Q := @
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ := griffin/griffin.o griffin/griffin_cpp.o
|
||||
DEFINES += -DHAVE_GRIFFIN -DUSE_MATH_DEFINES
|
||||
@ -188,9 +183,6 @@ OBJ := $(patsubst %rarch.o,%rarch.res,$(OBJ))
|
||||
OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ))
|
||||
OBJ := $(OBJ:.o=.obj)
|
||||
|
||||
|
||||
|
||||
|
||||
LDFLAGS += -WX -SUBSYSTEM:WINDOWS -ENTRY:mainCRTStartup
|
||||
|
||||
DEFINES := $(patsubst -f%,,$(DEFINES))
|
||||
@ -198,7 +190,6 @@ LDFLAGS := $(patsubst -l%,%.lib,$(LDFLAGS))
|
||||
LIBS := $(filter-out -lm,$(LIBS))
|
||||
LIBS := $(patsubst -l%,%.lib,$(LIBS))
|
||||
|
||||
|
||||
#$(info INCLUDE_DIRS : $(INCLUDE_DIRS))
|
||||
#$(info DEFINES : $(DEFINES))
|
||||
#$(info CFLAGS : $(CFLAGS))
|
||||
|
@ -29,7 +29,7 @@ else
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_ZLIB := 0
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_EGL := 1
|
||||
@ -55,16 +55,16 @@ else
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
BLACKLIST :=
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
|
||||
#OBJ += input/drivers/psp_input.o
|
||||
#OBJ += input/drivers_joypad/psp_joypad.o
|
||||
#OBJ += audio/drivers/psp_audio.o
|
||||
OBJ += input/drivers/ps4_input.o
|
||||
OBJ += input/drivers_joypad/ps4_joypad.o
|
||||
OBJ += audio/drivers/psp_audio.o
|
||||
#OBJ += frontend/drivers/platform_orbis.o
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(PS4SDK)),)
|
||||
$(error "Please set PS4SDK in your environment. export PS4SDK=<path to>ps4sdk")
|
||||
endif
|
||||
@ -120,10 +120,9 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
endif
|
||||
CXXFLAGS := $(CFLAGS)
|
||||
|
||||
PS4_LIBS := -lps4link -ldebugnet -lorbisFile -lelfloader -lorbisKeyboard -lorbis2d -lpng -lz -lorbisGl -lorbisPad -lorbisAudio -lmod -lorbisAudio -lmod -lorbisFileBrowser -lorbisXbmFont -lSceNet_stub -lScePigletv2VSH_stub -lSceSystemService_stub -lSceUserService_stub -lScePad_stub -lSceAudioOut_stub -lSceIme_stub -lSceSysmodule_stub \
|
||||
PS4_LIBS := -lps4link -ldebugnet -lorbisFile -lelfloader -lorbisKeyboard -lorbis2d -lpng -lz -lorbisGl -lorbisPad -lorbisAudio -lmod -lorbisFileBrowser -lorbisXbmFont -lSceNet_stub -lScePigletv2VSH_stub -lSceSystemService_stub -lSceUserService_stub -lScePad_stub -lSceAudioOut_stub -lSceIme_stub -lSceSysmodule_stub \
|
||||
-lPs4_extension_kernel_call_standard -lPs4_extension_kernel_execute_dynlib_prepare_dlclose -lPs4_common_kernel -lPs4_common_user -lPs4_common_generic -lPs4LibCInternalAdaptive_stub -lPs4LibKernelAdaptive_stub -lSceLibcInternal_stub -lkernel_stub -lps4Kernel_stub -lPs4_base_stub_resolve_minimal -lPs4_base_kernel_dlsym_standard -lPs4_base_kernel_seek_elf_address_standard -lPs4_base_assembler_register_parameter_standard -lPs4_base_assembler_system_call_standard
|
||||
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_orbis $(WHOLE_END) $(PS4_LIBS)
|
||||
|
||||
TARGETS := $(TARGET).elf
|
||||
@ -131,7 +130,6 @@ TARGETS := $(TARGET).elf
|
||||
DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend
|
||||
POSTCOMPILE = mv -f $*.Tdepend $*.depend
|
||||
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
%.o: %.cpp
|
||||
@ -144,7 +142,6 @@ all: $(TARGETS)
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
|
||||
$(POSTCOMPILE)
|
||||
|
||||
|
||||
%.o: %.S
|
||||
%.o: %.S %.depend
|
||||
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
||||
@ -167,4 +164,4 @@ clean:
|
||||
.PHONY: clean all
|
||||
.PRECIOUS: %.depend
|
||||
|
||||
-include $(OBJ:.o=.depend)
|
||||
-include $(OBJ:.o=.depend)
|
||||
|
15
Makefile.ps2
15
Makefile.ps2
@ -5,6 +5,7 @@ HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_THREADS = 0
|
||||
BIG_STACK = 0
|
||||
MUTE_WARNINGS = 0
|
||||
PS2_IP = 192.168.1.150
|
||||
|
||||
#Configuration for IRX
|
||||
@ -19,21 +20,26 @@ ifeq ($(DEBUG), 1)
|
||||
RARCH_DEFINES += -DDEBUG
|
||||
else
|
||||
OPTIMIZE_LV := -O2
|
||||
LDFLAGS := -s
|
||||
endif
|
||||
|
||||
ifeq ($(MUTE_WARNINGS), 1)
|
||||
DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses
|
||||
endif
|
||||
|
||||
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
|
||||
INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include
|
||||
INCDIR += -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper
|
||||
GPVAL = -G0
|
||||
CFLAGS = $(OPTIMIZE_LV) -ffast-math -fsingle-precision-constant
|
||||
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB
|
||||
RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L. -s
|
||||
LIBS += -lretro_ps2 -lgskit -ldmakit -laudsrv -lpad -lmc -lhdd -lsdl -lfileXio -lpatches -lpoweroff
|
||||
LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L.
|
||||
LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lpad -lmc -lhdd -lsdl -lfileXio -lpatches -lpoweroff
|
||||
|
||||
#IRX modules
|
||||
# IRX modules - modules have to be in IRX_DIR
|
||||
@ -60,12 +66,13 @@ endif
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
# Missing objecst on the PS2SDK
|
||||
EE_OBJS += ps2/compat_ctype.o
|
||||
EE_OBJS += ps2/compat_files/compat_ctype.o ps2/compat_files/time.o
|
||||
|
||||
#EE_OBJS = griffin/griffin.o bootstrap/ps2/kernel_functions.o
|
||||
EE_OBJS += griffin/griffin.o
|
||||
|
||||
EE_CFLAGS = $(CFLAGS)
|
||||
EE_CXXFLAGS = $(CFLAGS)
|
||||
EE_LDFLAGS = $(LDFLAGS)
|
||||
EE_LIBS = $(LIBS)
|
||||
EE_ASFLAGS = $(ASFLAGS)
|
||||
|
@ -55,6 +55,7 @@ PPU_SRCS = frontend/frontend_salamander.c \
|
||||
libretro-common/encodings/encoding_utf.c \
|
||||
libretro-common/compat/compat_strl.c \
|
||||
libretro-common/compat/compat_strcasestr.c \
|
||||
libretro-common/compat/fopen_utf8.c \
|
||||
libretro-common/streams/file_stream.c \
|
||||
libretro-common/vfs/vfs_implementation.c \
|
||||
libretro-common/file/config_file.c \
|
||||
|
@ -49,7 +49,6 @@ endif
|
||||
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
|
||||
EXTRA_TARGETS = EBOOT.PBP
|
||||
PSP_EBOOT_TITLE = RetroArch PSP1
|
||||
|
||||
|
@ -42,6 +42,7 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/file/config_file.o \
|
||||
|
@ -34,13 +34,13 @@ else
|
||||
HAVE_DYNAMIC = 1
|
||||
|
||||
include Makefile.common
|
||||
BLACKLIST :=
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
BLACKLIST :=
|
||||
BLACKLIST += input/input_overlay.o
|
||||
BLACKLIST += tasks/task_overlay.o
|
||||
BLACKLIST += tasks/task_overlay.o
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(LIBTRANSISTOR_HOME)),)
|
||||
$(error "Please set LIBTRANSISTOR_HOME in your environment. export LIBTRANSISTOR_HOME=<path/to/libtransistor/dist/>")
|
||||
endif
|
||||
|
@ -55,6 +55,7 @@ else
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
BLACKLIST :=
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
|
||||
@ -64,7 +65,6 @@ else
|
||||
OBJ += frontend/drivers/platform_psp.o
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(VITASDK)),)
|
||||
$(error "Please set VITASDK in your environment. export VITASDK=<path to>vitasdk")
|
||||
endif
|
||||
@ -127,7 +127,6 @@ TARGETS := $(TARGET).vpk
|
||||
DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend
|
||||
POSTCOMPILE = mv -f $*.Tdepend $*.depend
|
||||
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
%.o: %.cpp
|
||||
@ -140,7 +139,6 @@ all: $(TARGETS)
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
|
||||
$(POSTCOMPILE)
|
||||
|
||||
|
||||
%.o: %.S
|
||||
%.o: %.S %.depend
|
||||
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
||||
|
@ -44,6 +44,7 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
|
@ -67,6 +67,7 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/file/config_file.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
|
@ -64,6 +64,7 @@ ifeq ($(SALAMANDER_BUILD),1)
|
||||
OBJ += frontend/drivers/platform_null.o
|
||||
OBJ += libretro-common/encodings/encoding_utf.o
|
||||
OBJ += libretro-common/compat/compat_strcasestr.o
|
||||
OBJ += libretro-common/compat/fopen_utf8.o
|
||||
OBJ += libretro-common/file/file_path.o
|
||||
OBJ += libretro-common/string/stdstring.o
|
||||
OBJ += libretro-common/lists/string_list.o
|
||||
@ -115,6 +116,7 @@ endif
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_7ZIP = 1
|
||||
@ -241,7 +243,6 @@ ifneq ($(WANT_IOSUHAX), 1)
|
||||
LIBS += -liosuhax
|
||||
endif
|
||||
|
||||
|
||||
RPX_OBJ = $(BUILD_DIR)/wiiu/system/stubs_rpl.o
|
||||
HBL_ELF_OBJ = $(BUILD_DIR)/wiiu/system/dynamic.o $(BUILD_DIR)/wiiu/system/stubs_elf.o
|
||||
|
||||
@ -263,13 +264,11 @@ endif
|
||||
|
||||
DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)/$*.depend
|
||||
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
%: $(BUILD_DIR)/%
|
||||
cp $< $@
|
||||
|
||||
|
||||
$(BUILD_DIR)/%.o: %.cpp %.depend
|
||||
@$(if $(Q), echo CXX $<,)
|
||||
@mkdir -p $(dir $@)
|
||||
|
@ -12,6 +12,7 @@ HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_STDIN_CMD = 1
|
||||
HAVE_COMMAND = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 1
|
||||
HAVE_7ZIP = 1
|
||||
@ -102,7 +103,6 @@ else
|
||||
WINDRES = windres
|
||||
endif
|
||||
|
||||
|
||||
libretro ?= -lretro
|
||||
|
||||
ifeq ($(DYNAMIC), 1)
|
||||
@ -123,7 +123,7 @@ else
|
||||
CXXFLAGS += -O3 -ffast-math
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps
|
||||
CFLAGS += $(DEF_FLAGS) -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps
|
||||
CXXFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps -std=c++98 -D__STDC_CONSTANT_MACROS
|
||||
ifeq ($(CXX_BUILD), 1)
|
||||
CFLAGS += -std=c++98 -xc++ -D__STDC_CONSTANT_MACROS
|
||||
|
@ -119,7 +119,7 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
#ifdef EMSCRIPTEN
|
||||
&audio_rwebaudio,
|
||||
#endif
|
||||
#if defined(PSP) || defined(VITA)
|
||||
#if defined(PSP) || defined(VITA) || defined(ORBIS)
|
||||
&audio_psp,
|
||||
#endif
|
||||
#if defined(PS2)
|
||||
@ -397,7 +397,6 @@ static void audio_driver_mixer_init(unsigned out_rate)
|
||||
audio_mixer_init(out_rate);
|
||||
}
|
||||
|
||||
|
||||
static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
{
|
||||
unsigned new_rate = 0;
|
||||
@ -636,7 +635,6 @@ static void audio_driver_flush(const int16_t *data, size_t samples)
|
||||
src_data.data_in = audio_driver_input_data;
|
||||
src_data.input_frames = samples >> 1;
|
||||
|
||||
|
||||
if (audio_driver_dsp)
|
||||
{
|
||||
struct retro_dsp_data dsp_data;
|
||||
@ -1504,7 +1502,6 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool audio_driver_stop(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->stop
|
||||
@ -1594,7 +1591,6 @@ void audio_set_bool(enum audio_action action, bool val)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void audio_set_float(enum audio_action action, float val)
|
||||
{
|
||||
switch (action)
|
||||
|
@ -219,7 +219,6 @@ static int check_pcm_status(void *data, int channel_type)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
@ -328,7 +327,6 @@ static void alsa_qsa_set_nonblock_state(void *data, bool state)
|
||||
alsa->nonblock = state;
|
||||
}
|
||||
|
||||
|
||||
static bool alsa_qsa_use_float(void *data)
|
||||
{
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
|
@ -15,7 +15,6 @@
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
#else
|
||||
|
@ -56,7 +56,6 @@ static void ctr_csnd_audio_update_playpos(ctr_csnd_audio_t* ctr)
|
||||
ctr->cpu_ticks_last += samples_played * CTR_CSND_CPU_TICKS_PER_SAMPLE;
|
||||
}
|
||||
|
||||
|
||||
Result csndPlaySound_custom(int chn, u32 flags, float vol, float pan,
|
||||
void* data0, void* data1, u32 size)
|
||||
{
|
||||
@ -289,7 +288,6 @@ static size_t ctr_csnd_audio_buffer_size(void *data)
|
||||
return CTR_CSND_AUDIO_COUNT;
|
||||
}
|
||||
|
||||
|
||||
audio_driver_t audio_ctr_csnd = {
|
||||
ctr_csnd_audio_init,
|
||||
ctr_csnd_audio_write,
|
||||
|
@ -195,7 +195,6 @@ static size_t ctr_dsp_audio_buffer_size(void *data)
|
||||
return CTR_DSP_AUDIO_COUNT;
|
||||
}
|
||||
|
||||
|
||||
audio_driver_t audio_ctr_dsp = {
|
||||
ctr_dsp_audio_init,
|
||||
ctr_dsp_audio_write,
|
||||
|
@ -51,7 +51,6 @@
|
||||
#pragma comment(lib, "dxguid")
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct dsound
|
||||
{
|
||||
LPDIRECTSOUND ds;
|
||||
@ -174,7 +173,6 @@ static DWORD CALLBACK dsound_thread(PVOID data)
|
||||
/* No space to write, or we don't have data in our fifo,
|
||||
* but we can wait some time before it underruns ... */
|
||||
|
||||
|
||||
/* We could opt for using the notification interface,
|
||||
* but it is not guaranteed to work, so use high
|
||||
* priority sleeping patterns.
|
||||
|
@ -232,7 +232,6 @@ static bool sl_start(void *data, bool is_shutdown)
|
||||
return sl->is_paused ? false : true;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t sl_write(void *data, const void *buf_, size_t size)
|
||||
{
|
||||
sl_t *sl = (sl_t*)data;
|
||||
|
@ -43,7 +43,6 @@ static u8 audioThreadStack[4 * 1024] __attribute__ ((aligned(16)));
|
||||
#define AUDIO_BITS 16
|
||||
#define AUDIO_PRIORITY 0x7F /* LOWER VALUE GRATHER PRIORITY*/
|
||||
|
||||
|
||||
static void audioMainLoop(void *data)
|
||||
{
|
||||
char out_tmp[AUDIO_OUT_BUFFER];
|
||||
@ -67,7 +66,6 @@ static void audioMainLoop(void *data)
|
||||
ExitDeleteThread();
|
||||
}
|
||||
|
||||
|
||||
static void audioCreateThread(ps2_audio_t *ps2)
|
||||
{
|
||||
int ret;
|
||||
@ -81,26 +79,27 @@ static void audioCreateThread(ps2_audio_t *ps2)
|
||||
thread.attr=thread.option=0;
|
||||
|
||||
/*Backup the PS2 content to be used in the thread */
|
||||
backup_ps2 = ps2;
|
||||
backup_ps2 = ps2;
|
||||
|
||||
ps2->running = true;
|
||||
ps2->running = true;
|
||||
ps2->worker_thread = CreateThread(&thread);
|
||||
|
||||
if (ps2->worker_thread >= 0)
|
||||
{
|
||||
if (ps2->worker_thread >= 0) {
|
||||
ret = StartThread(ps2->worker_thread, NULL);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
printf("sound_init: StartThread returned %d\n", ret);
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
printf("CreateThread failed: %d\n", ps2->worker_thread);
|
||||
}
|
||||
}
|
||||
|
||||
static void audioStopNDeleteThread(ps2_audio_t *ps2)
|
||||
{
|
||||
ps2->running = false;
|
||||
if (ps2->worker_thread)
|
||||
if (ps2->worker_thread) {
|
||||
ps2->worker_thread = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
|
||||
@ -108,14 +107,13 @@ static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
|
||||
int err;
|
||||
struct audsrv_fmt_t format;
|
||||
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.channels = AUDIO_CHANNELS;
|
||||
|
||||
err = audsrv_set_format(&format);
|
||||
err = audsrv_set_format(&format);
|
||||
|
||||
if (err)
|
||||
{
|
||||
if (err){
|
||||
printf("set format returned %d\n", err);
|
||||
printf("audsrv returned error string: %s\n", audsrv_get_error_string());
|
||||
}
|
||||
@ -128,16 +126,16 @@ static void audioCreateSemas(ps2_audio_t *ps2)
|
||||
ee_sema_t lock_info;
|
||||
ee_sema_t cond_lock_info;
|
||||
|
||||
lock_info.max_count = 1;
|
||||
lock_info.init_count = 1;
|
||||
lock_info.option = 0;
|
||||
ps2->lock = CreateSema(&lock_info);
|
||||
lock_info.max_count = 1;
|
||||
lock_info.init_count = 1;
|
||||
lock_info.option = 0;
|
||||
ps2->lock = CreateSema(&lock_info);
|
||||
|
||||
cond_lock_info.init_count = 1;
|
||||
cond_lock_info.max_count = 1;
|
||||
cond_lock_info.option = 0;
|
||||
cond_lock_info.option = 0;
|
||||
|
||||
ps2->cond_lock = CreateSema(&cond_lock_info);
|
||||
ps2->cond_lock = CreateSema(&cond_lock_info);
|
||||
}
|
||||
|
||||
static void *ps2_audio_init(const char *device,
|
||||
@ -164,18 +162,15 @@ static void ps2_audio_free(void *data)
|
||||
if(!ps2)
|
||||
return;
|
||||
|
||||
if(ps2->running)
|
||||
{
|
||||
if(ps2->running){
|
||||
audioStopNDeleteThread(ps2);
|
||||
|
||||
if (ps2->lock)
|
||||
{
|
||||
if (ps2->lock){
|
||||
iDeleteSema(ps2->lock);
|
||||
ps2->lock = 0;
|
||||
}
|
||||
|
||||
if (ps2->cond_lock)
|
||||
{
|
||||
if (ps2->cond_lock){
|
||||
iDeleteSema(ps2->cond_lock);
|
||||
ps2->cond_lock = 0;
|
||||
}
|
||||
@ -192,14 +187,14 @@ static ssize_t ps2_audio_write(void *data, const void *buf, size_t size)
|
||||
if (!ps2->running)
|
||||
return -1;
|
||||
|
||||
if (ps2->nonblocking)
|
||||
{
|
||||
if (ps2->nonblocking){
|
||||
if (fifo_write_avail(ps2->buffer) < size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (fifo_write_avail(ps2->buffer) < size)
|
||||
while (fifo_write_avail(ps2->buffer) < size) {
|
||||
WaitSema(ps2->cond_lock);
|
||||
}
|
||||
|
||||
WaitSema(ps2->lock);
|
||||
fifo_write(ps2->buffer, buf, size);
|
||||
@ -213,8 +208,9 @@ static bool ps2_audio_alive(void *data)
|
||||
bool alive = false;
|
||||
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
if (ps2)
|
||||
if (ps2) {
|
||||
alive = ps2->running;
|
||||
}
|
||||
|
||||
return alive;
|
||||
}
|
||||
@ -224,8 +220,7 @@ static bool ps2_audio_stop(void *data)
|
||||
bool stop = true;
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
|
||||
if (ps2)
|
||||
{
|
||||
if (ps2) {
|
||||
audioStopNDeleteThread(ps2);
|
||||
audsrv_stop_audio();
|
||||
}
|
||||
@ -235,13 +230,13 @@ static bool ps2_audio_stop(void *data)
|
||||
|
||||
static bool ps2_audio_start(void *data, bool is_shutdown)
|
||||
{
|
||||
bool start = true;
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
bool start = true;
|
||||
|
||||
if(ps2)
|
||||
{
|
||||
if (!ps2->running && !ps2->worker_thread)
|
||||
if (ps2) {
|
||||
if (!ps2->running && !ps2->worker_thread) {
|
||||
audioCreateThread(ps2);
|
||||
}
|
||||
}
|
||||
|
||||
return start;
|
||||
@ -250,8 +245,10 @@ static bool ps2_audio_start(void *data, bool is_shutdown)
|
||||
static void ps2_audio_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
if (ps2)
|
||||
|
||||
if (ps2) {
|
||||
ps2->nonblocking = toggle;
|
||||
}
|
||||
}
|
||||
|
||||
static bool ps2_audio_use_float(void *data)
|
||||
@ -263,8 +260,7 @@ static size_t ps2_audio_write_avail(void *data)
|
||||
{
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
|
||||
if (ps2 && ps2->running)
|
||||
{
|
||||
if (ps2 && ps2->running) {
|
||||
size_t size;
|
||||
WaitSema(ps2->lock);
|
||||
size = AUDIO_BUFFER - fifo_read_avail(ps2->buffer);
|
||||
|
@ -16,21 +16,28 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#if defined(VITA) || defined(PSP)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#ifdef VITA
|
||||
#if defined(VITA)
|
||||
#include <psp2/kernel/processmgr.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
#include <psp2/kernel/sysmem.h>
|
||||
#include <psp2/audioout.h>
|
||||
#else
|
||||
#elif defined(PSP)
|
||||
#include <pspkernel.h>
|
||||
#include <pspaudio.h>
|
||||
#elif defined(ORBIS)
|
||||
#include <audioout.h>
|
||||
#define SCE_AUDIO_OUT_PORT_TYPE_MAIN 0
|
||||
#define SCE_AUDIO_OUT_MODE_STEREO 1
|
||||
#define SceUID uint32_t
|
||||
#endif
|
||||
|
||||
#include "../audio_driver.h"
|
||||
@ -64,10 +71,14 @@ static void audioMainLoop(void *data)
|
||||
{
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
|
||||
#ifdef VITA
|
||||
#if defined(VITA)
|
||||
int port = sceAudioOutOpenPort(
|
||||
SCE_AUDIO_OUT_PORT_TYPE_MAIN, AUDIO_OUT_COUNT,
|
||||
psp->rate, SCE_AUDIO_OUT_MODE_STEREO);
|
||||
#elif defined(ORBIS)
|
||||
int port = sceAudioOutOpen(0xff,
|
||||
SCE_AUDIO_OUT_PORT_TYPE_MAIN, 0, AUDIO_OUT_COUNT,
|
||||
psp->rate, SCE_AUDIO_OUT_MODE_STEREO);
|
||||
#else
|
||||
sceAudioSRCChReserve(AUDIO_OUT_COUNT, psp->rate, 2);
|
||||
#endif
|
||||
@ -95,7 +106,7 @@ static void audioMainLoop(void *data)
|
||||
scond_signal(psp->cond);
|
||||
slock_unlock(psp->cond_lock);
|
||||
|
||||
#ifdef VITA
|
||||
#if defined(VITA) || defined(ORBIS)
|
||||
sceAudioOutOutput(port,
|
||||
cond ? (psp->zeroBuffer)
|
||||
: (psp->buffer + read_pos_2));
|
||||
@ -105,8 +116,10 @@ static void audioMainLoop(void *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef VITA
|
||||
#if defined(VITA)
|
||||
sceAudioOutReleasePort(port);
|
||||
#elif defined(ORBIS)
|
||||
sceAudioOutClose(port);
|
||||
#else
|
||||
sceAudioSRCChRelease();
|
||||
#endif
|
||||
@ -127,12 +140,23 @@ static void *psp_audio_init(const char *device,
|
||||
(void)device;
|
||||
(void)latency;
|
||||
|
||||
#ifdef ORBIS
|
||||
psp->buffer = (uint32_t*)
|
||||
malloc(AUDIO_BUFFER_SIZE * sizeof(uint32_t));
|
||||
#else
|
||||
/* Cache aligned, not necessary but helpful. */
|
||||
psp->buffer = (uint32_t*)
|
||||
memalign(64, AUDIO_BUFFER_SIZE * sizeof(uint32_t));
|
||||
#endif
|
||||
memset(psp->buffer, 0, AUDIO_BUFFER_SIZE * sizeof(uint32_t));
|
||||
|
||||
#ifdef ORBIS
|
||||
psp->zeroBuffer = (uint32_t*)
|
||||
malloc(AUDIO_OUT_COUNT * sizeof(uint32_t));
|
||||
#else
|
||||
psp->zeroBuffer = (uint32_t*)
|
||||
memalign(64, AUDIO_OUT_COUNT * sizeof(uint32_t));
|
||||
#endif
|
||||
memset(psp->zeroBuffer, 0, AUDIO_OUT_COUNT * sizeof(uint32_t));
|
||||
|
||||
psp->read_pos = 0;
|
||||
@ -228,7 +252,6 @@ static bool psp_audio_alive(void *data)
|
||||
return psp->running;
|
||||
}
|
||||
|
||||
|
||||
static bool psp_audio_stop(void *data)
|
||||
{
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
@ -294,7 +317,6 @@ static size_t psp_buffer_size(void *data)
|
||||
return AUDIO_BUFFER_SIZE /** sizeof(uint32_t)*/;
|
||||
}
|
||||
|
||||
|
||||
audio_driver_t audio_psp = {
|
||||
psp_audio_init,
|
||||
psp_audio_write,
|
||||
@ -304,8 +326,10 @@ audio_driver_t audio_psp = {
|
||||
psp_audio_set_nonblock_state,
|
||||
psp_audio_free,
|
||||
psp_audio_use_float,
|
||||
#ifdef VITA
|
||||
#if defined(VITA)
|
||||
"vita",
|
||||
#elif defined(ORBIS)
|
||||
"orbis",
|
||||
#else
|
||||
"psp",
|
||||
#endif
|
||||
|
@ -80,7 +80,6 @@ static void mainLoop(void* data)
|
||||
|
||||
RARCH_LOG("[Audio]: start mainLoop cpu %u tid %u\n", svcGetCurrentProcessorNumber(), swa->thread.handle);
|
||||
|
||||
|
||||
while (swa->running)
|
||||
{
|
||||
size_t buf_avail, avail, to_write;
|
||||
|
@ -296,7 +296,6 @@
|
||||
#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
|
||||
#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000
|
||||
|
||||
|
||||
/** Audio sample format of a PCM.
|
||||
* The first letter specifiers whether the sample is signed or unsigned.
|
||||
* The letter 'S' means signed. The letter 'U' means unsigned.
|
||||
|
@ -30,16 +30,12 @@
|
||||
#include <audioclient.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* IID_IAudioClient 1CB9AD4C-DBFA-4c32-B178-C2F568A703B2 */
|
||||
static const GUID IID_IAudioClient = { 0x1CB9AD4C, 0xDBFA, 0xB178, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2 };
|
||||
/* IID_IAudioRenderClient F294ACFC-3146-4483-A7BF-ADDCA7C260E2 */
|
||||
static const GUID IID_IAudioRenderClient = { 0xF294ACFC, 0x3146, 0x4483, 0xA7BF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2 };
|
||||
/* IID_IMMDeviceEnumerator A95664D2-9614-4F35-A746-DE8DB63617E6 */
|
||||
static const GUID IID_IMMDeviceEnumerator = { 0xA95664D2, 0x9614, 0x4F35, 0xA746, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6 };
|
||||
/* CLSID_MMDeviceEnumerator BCDE0395-E52F-467C-8E3D-C4579291692E */
|
||||
static const GUID CLSID_MMDeviceEnumerator = { 0xBCDE0395, 0xE52F, 0x467C, 0x8E3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E };
|
||||
/* KSDATAFORMAT_SUBTYPE_IEEE_FLOAT 00000003-0000-0010-8000-00aa00389b71 */
|
||||
static const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010, 0x8000, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 };
|
||||
DEFINE_GUID(IID_IAudioClient, 0x1CB9AD4C, 0xDBFA, 0x4C32, 0xB1, 0x78, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2);
|
||||
DEFINE_GUID(IID_IAudioRenderClient, 0xF294ACFC, 0x3146, 0x4483, 0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2);
|
||||
DEFINE_GUID(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6);
|
||||
DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E);
|
||||
#undef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
|
||||
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
#endif
|
||||
|
||||
#include <lists/string_list.h>
|
||||
|
@ -318,7 +318,6 @@ static size_t ax_audio_buffer_size(void* data)
|
||||
return AX_AUDIO_COUNT;
|
||||
}
|
||||
|
||||
|
||||
audio_driver_t audio_ax =
|
||||
{
|
||||
ax_audio_init,
|
||||
|
@ -169,7 +169,6 @@ typedef OPAQUE IXAudio2EngineCallback IXAudio2EngineCallback;
|
||||
typedef OPAQUE IXAudio2SubmixVoice IXAudio2SubmixVoice;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct XAUDIO2_BUFFER
|
||||
{
|
||||
UINT32 Flags;
|
||||
|
@ -55,7 +55,6 @@ typedef struct rarch_CC_resampler
|
||||
void (*process)(void *re, struct resampler_data *data);
|
||||
} rarch_CC_resampler_t;
|
||||
|
||||
|
||||
#ifdef _MIPS_ARCH_ALLEGREX
|
||||
static void resampler_CC_process(void *re_, struct resampler_data *data)
|
||||
{
|
||||
@ -115,7 +114,6 @@ static void resampler_CC_process(void *re_, struct resampler_data *data)
|
||||
|
||||
"vadd.q c720, c720, c620 \n"
|
||||
|
||||
|
||||
"vadd.s s730, s730, s730[1] \n"
|
||||
"mfv %0, s730 \n"
|
||||
|
||||
@ -216,7 +214,6 @@ static void resampler_CC_downsample(void *re_, struct resampler_data *data)
|
||||
vec_ww1 = _mm_mul_ps(vec_w1, vec_w1);
|
||||
vec_ww2 = _mm_mul_ps(vec_w2, vec_w2);
|
||||
|
||||
|
||||
vec_ww1 = _mm_mul_ps(vec_ww1, _mm_sub_ps(_mm_set_ps1(3.0),vec_ww1));
|
||||
vec_ww2 = _mm_mul_ps(vec_ww2, _mm_sub_ps(_mm_set_ps1(3.0),vec_ww2));
|
||||
|
||||
@ -307,7 +304,6 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
vec_ww1 = _mm_mul_ps(vec_w1, vec_w1);
|
||||
vec_ww2 = _mm_mul_ps(vec_w2, vec_w2);
|
||||
|
||||
|
||||
vec_ww1 = _mm_mul_ps(vec_ww1,_mm_sub_ps(_mm_set_ps1(3.0),vec_ww1));
|
||||
vec_ww2 = _mm_mul_ps(vec_ww2,_mm_sub_ps(_mm_set_ps1(3.0),vec_ww2));
|
||||
|
||||
@ -349,7 +345,6 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
data->output_frames = outp - (audio_frame_float_t*)data->data_out;
|
||||
}
|
||||
|
||||
|
||||
#elif defined (__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)
|
||||
|
||||
#define CC_RESAMPLER_IDENT "NEON"
|
||||
@ -492,7 +487,6 @@ static void resampler_CC_process(void *re_, struct resampler_data *data)
|
||||
re->process(re_, data);
|
||||
}
|
||||
|
||||
|
||||
static void *resampler_CC_init(const struct resampler_config *config,
|
||||
double bandwidth_mod,
|
||||
enum resampler_quality quality,
|
||||
|
@ -46,7 +46,6 @@
|
||||
#define NETWORK_COMPAT_HEADERS 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NETWORK_COMPAT_HEADERS
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
@ -158,7 +157,6 @@ static int rsnd_poll(struct pollfd *fd, int numfd, int timeout);
|
||||
static void rsnd_cb_thread(void *thread_data);
|
||||
static void rsnd_thread(void *thread_data);
|
||||
|
||||
|
||||
/* Determine whether we're running big- or little endian */
|
||||
static INLINE int rsnd_is_little_endian(void)
|
||||
{
|
||||
@ -242,7 +240,6 @@ static int rsnd_connect_server( rsound_t *rd )
|
||||
|
||||
rd->conn_type = RSD_CONN_TCP;
|
||||
|
||||
|
||||
rd->conn.socket = net_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if ( rd->conn.socket < 0 )
|
||||
goto error;
|
||||
@ -312,7 +309,6 @@ static int rsnd_send_header_info(rsound_t *rd)
|
||||
#define FRAMESIZE 34
|
||||
#define FORMAT 42
|
||||
|
||||
|
||||
uint32_t temp_rate = rd->rate;
|
||||
uint16_t temp_channels = rd->channels;
|
||||
|
||||
@ -980,7 +976,6 @@ static int rsnd_close_ctl(rsound_t *rd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Sends delay info request to server on the ctl socket. This code section isn't critical, and will work if it works.
|
||||
// It will never block.
|
||||
static int rsnd_send_info_query(rsound_t *rd)
|
||||
@ -1296,7 +1291,6 @@ static int rsnd_reset(rsound_t *rd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int rsd_stop(rsound_t *rd)
|
||||
{
|
||||
retro_assert(rd != NULL);
|
||||
@ -1403,7 +1397,6 @@ int rsd_exec(rsound_t *rsound)
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
||||
/* ioctl()-ish param setting :D */
|
||||
int rsd_set_param(rsound_t *rd, enum rsd_settings option, void* param)
|
||||
{
|
||||
@ -1493,7 +1486,6 @@ void rsd_delay_wait(rsound_t *rd)
|
||||
/* Latency of stream in ms */
|
||||
int latency_ms = rsd_delay_ms(rd);
|
||||
|
||||
|
||||
/* Should we sleep for a while to keep the latency low? */
|
||||
if ( rd->max_latency < latency_ms )
|
||||
{
|
||||
|
@ -46,7 +46,6 @@ void _init_vita_heap(void) {
|
||||
_newlib_vm_memblock = 0;
|
||||
}
|
||||
|
||||
|
||||
// Create a mutex to use inside _sbrk_r
|
||||
if (sceKernelCreateLwMutex((struct SceKernelLwMutexWork*)_newlib_sbrk_mutex, "sbrk mutex", 0, 0, 0) < 0) {
|
||||
goto failure;
|
||||
|
@ -2622,8 +2622,6 @@ static int cheevos_iterate(coro_t *coro)
|
||||
|
||||
CORO_ENTER();
|
||||
|
||||
|
||||
|
||||
cheevos_locals.addrs_patched = false;
|
||||
|
||||
coro->settings = config_get_ptr();
|
||||
|
19
command.c
19
command.c
@ -244,8 +244,6 @@ static const struct cmd_map map[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
bool command_set_shader(const char *arg)
|
||||
{
|
||||
char msg[256];
|
||||
@ -273,7 +271,6 @@ bool command_set_shader(const char *arg)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if defined(HAVE_COMMAND) && defined(HAVE_CHEEVOS)
|
||||
#define SMY_CMD_STR "READ_CORE_RAM"
|
||||
static bool command_read_ram(const char *arg)
|
||||
@ -426,7 +423,6 @@ static bool command_network_init(command_t *handle, uint16_t port)
|
||||
msg_hash_to_str(MSG_BRINGING_UP_COMMAND_INTERFACE_ON_PORT),
|
||||
(unsigned short)port);
|
||||
|
||||
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
|
||||
@ -1150,7 +1146,6 @@ static void command_event_init_cheats(void)
|
||||
cheat_manager_alloc_if_empty() ;
|
||||
cheat_manager_load_game_specific_cheats() ;
|
||||
|
||||
|
||||
if (settings != NULL && settings->bools.apply_cheats_after_load)
|
||||
cheat_manager_apply_cheats();
|
||||
}
|
||||
@ -1347,7 +1342,6 @@ static bool command_event_init_core(enum rarch_core_type *data)
|
||||
if(settings->bools.auto_shaders_enable)
|
||||
config_load_shader_preset();
|
||||
|
||||
|
||||
/* reset video format to libretro's default */
|
||||
video_driver_set_pixel_format(RETRO_PIXEL_FORMAT_0RGB1555);
|
||||
|
||||
@ -1370,7 +1364,6 @@ static bool command_event_init_core(enum rarch_core_type *data)
|
||||
if (!core_load(settings->uints.input_poll_type_behavior))
|
||||
return false;
|
||||
|
||||
|
||||
rarch_ctl(RARCH_CTL_SET_FRAME_LIMIT, NULL);
|
||||
return true;
|
||||
}
|
||||
@ -1634,7 +1627,6 @@ static void command_event_save_current_config(enum override_type type)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!string_is_empty(msg))
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
}
|
||||
@ -1834,9 +1826,6 @@ void command_playlist_update_write(
|
||||
**/
|
||||
bool command_event(enum event_command cmd, void *data)
|
||||
{
|
||||
#ifdef HAVE_DISCORD
|
||||
static bool discord_inited = false;
|
||||
#endif
|
||||
bool boolean = false;
|
||||
|
||||
switch (cmd)
|
||||
@ -2986,26 +2975,24 @@ TODO: Add a setting for these tweaks */
|
||||
|
||||
if (!settings->bools.discord_enable)
|
||||
return false;
|
||||
if (discord_inited)
|
||||
if (discord_is_ready())
|
||||
return true;
|
||||
|
||||
discord_init();
|
||||
discord_inited = true;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case CMD_EVENT_DISCORD_DEINIT:
|
||||
#ifdef HAVE_DISCORD
|
||||
if (!discord_inited)
|
||||
if (!discord_is_ready())
|
||||
return false;
|
||||
|
||||
discord_shutdown();
|
||||
discord_inited = false;
|
||||
#endif
|
||||
break;
|
||||
case CMD_EVENT_DISCORD_UPDATE:
|
||||
#ifdef HAVE_DISCORD
|
||||
if (!data || !discord_inited)
|
||||
if (!data || !discord_is_ready())
|
||||
return false;
|
||||
|
||||
{
|
||||
|
@ -401,9 +401,11 @@ static bool default_screenshots_in_content_dir = false;
|
||||
|
||||
#if defined(__CELLOS_LV2__) || defined(_XBOX1) || defined(_XBOX360)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_L3_R3;
|
||||
#elif defined(PS2)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_HOLD_START;
|
||||
#elif defined(VITA)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_L1_R1_START_SELECT;
|
||||
#elif defined(SWITCH)
|
||||
#elif defined(SWITCH) || defined(ORBIS)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_START_SELECT;
|
||||
#else
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_NONE;
|
||||
|
@ -218,6 +218,7 @@ enum input_driver_enum
|
||||
INPUT_X,
|
||||
INPUT_WAYLAND,
|
||||
INPUT_DINPUT,
|
||||
INPUT_PS4,
|
||||
INPUT_PS3,
|
||||
INPUT_PSP,
|
||||
INPUT_PS2,
|
||||
@ -244,6 +245,7 @@ enum joypad_driver_enum
|
||||
JOYPAD_GX,
|
||||
JOYPAD_WIIU,
|
||||
JOYPAD_XDK,
|
||||
JOYPAD_PS4,
|
||||
JOYPAD_PSP,
|
||||
JOYPAD_PS2,
|
||||
JOYPAD_CTR,
|
||||
@ -371,7 +373,7 @@ static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_XENON360;
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WII;
|
||||
#elif defined(WIIU)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WIIU;
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
#elif defined(PSP) || defined(VITA) || defined(ORBIS)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PSP;
|
||||
#elif defined(PS2)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS2;
|
||||
@ -453,6 +455,8 @@ static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_RWEBINPUT;
|
||||
#elif defined(_WIN32)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_DINPUT;
|
||||
#elif defined(ORBIS)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS4;
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS3;
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
@ -499,6 +503,8 @@ static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_GX;
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_WIIU;
|
||||
#elif defined(_XBOX)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XDK;
|
||||
#elif defined(ORBIS)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS4;
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PSP;
|
||||
#elif defined(PS2)
|
||||
@ -687,8 +693,10 @@ const char *config_get_default_audio(void)
|
||||
case AUDIO_WIIU:
|
||||
return "AX";
|
||||
case AUDIO_PSP:
|
||||
#ifdef VITA
|
||||
#if defined(VITA)
|
||||
return "vita";
|
||||
#elif defined(ORBIS)
|
||||
return "orbis";
|
||||
#else
|
||||
return "psp";
|
||||
#endif
|
||||
@ -843,6 +851,8 @@ const char *config_get_default_input(void)
|
||||
{
|
||||
case INPUT_ANDROID:
|
||||
return "android";
|
||||
case INPUT_PS4:
|
||||
return "ps4";
|
||||
case INPUT_PS3:
|
||||
return "ps3";
|
||||
case INPUT_PSP:
|
||||
@ -909,6 +919,8 @@ const char *config_get_default_joypad(void)
|
||||
|
||||
switch (default_driver)
|
||||
{
|
||||
case JOYPAD_PS4:
|
||||
return "ps4";
|
||||
case JOYPAD_PS3:
|
||||
return "ps3";
|
||||
case JOYPAD_XINPUT:
|
||||
@ -962,7 +974,6 @@ const char *config_get_default_joypad(void)
|
||||
return "null";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* config_get_default_camera:
|
||||
*
|
||||
@ -1395,11 +1406,11 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
#ifdef GEKKO
|
||||
SETTING_BOOL("video_vfilter", &settings->bools.video_vfilter, true, video_vfilter, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
|
||||
#ifdef HAVE_THREADS
|
||||
SETTING_BOOL("threaded_data_runloop_enable", &settings->bools.threaded_data_runloop_enable, true, threaded_data_runloop_enable, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
|
||||
SETTING_BOOL("menu_throttle_framerate", &settings->bools.menu_throttle_framerate, true, true, false);
|
||||
SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, true, false);
|
||||
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, true, false);
|
||||
@ -2267,7 +2278,6 @@ static config_file_t *open_default_config_file(void)
|
||||
/* Try to create a new config file. */
|
||||
conf = config_file_new(NULL);
|
||||
|
||||
|
||||
if (conf)
|
||||
{
|
||||
/* Since this is a clean config file, we can
|
||||
@ -2275,7 +2285,7 @@ static config_file_t *open_default_config_file(void)
|
||||
fill_pathname_resolve_relative(conf_path, app_path,
|
||||
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
|
||||
config_set_bool(conf, "config_save_on_exit", true);
|
||||
saved = config_file_write(conf, conf_path);
|
||||
saved = config_file_write(conf, conf_path, true);
|
||||
}
|
||||
|
||||
if (!saved)
|
||||
@ -2311,7 +2321,7 @@ static config_file_t *open_default_config_file(void)
|
||||
if (conf)
|
||||
{
|
||||
config_set_bool(conf, "config_save_on_exit", true);
|
||||
saved = config_file_write(conf, conf_path);
|
||||
saved = config_file_write(conf, conf_path, true);
|
||||
}
|
||||
|
||||
if (!saved)
|
||||
@ -2386,7 +2396,7 @@ static config_file_t *open_default_config_file(void)
|
||||
{
|
||||
/* Since this is a clean config file, we can safely use config_save_on_exit. */
|
||||
config_set_bool(conf, "config_save_on_exit", true);
|
||||
saved = config_file_write(conf, conf_path);
|
||||
saved = config_file_write(conf, conf_path, true);
|
||||
}
|
||||
|
||||
if (!saved)
|
||||
@ -2633,7 +2643,6 @@ static void config_get_hex_base(config_file_t *conf,
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* config_load:
|
||||
* @path : path to be read from.
|
||||
@ -2840,7 +2849,6 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
CONFIG_GET_INT_BASE(conf, settings, uints.led_map[i], buf);
|
||||
}
|
||||
|
||||
|
||||
/* Hexadecimal settings */
|
||||
|
||||
if (config_get_hex(conf, "video_message_color", &msg_color))
|
||||
@ -3024,7 +3032,6 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!string_is_empty(settings->paths.directory_screenshot))
|
||||
{
|
||||
if (string_is_equal(settings->paths.directory_screenshot, "default"))
|
||||
@ -3091,7 +3098,6 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
if (settings->floats.fastforward_ratio < 0.0f)
|
||||
configuration_set_float(settings, settings->floats.fastforward_ratio, 0.0f);
|
||||
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH);
|
||||
settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH);
|
||||
@ -3187,7 +3193,6 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
|
||||
ret = true;
|
||||
|
||||
|
||||
end:
|
||||
if (conf)
|
||||
config_file_free(conf);
|
||||
@ -3498,7 +3503,6 @@ bool config_load_remap(void)
|
||||
malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
remap_directory[0] = core_path[0] = game_path[0] = '\0';
|
||||
|
||||
|
||||
strlcpy(remap_directory,
|
||||
settings->paths.directory_input_remapping,
|
||||
path_size);
|
||||
@ -3565,7 +3569,6 @@ bool config_load_remap(void)
|
||||
input_remapping_set_defaults(false);
|
||||
}
|
||||
|
||||
|
||||
/* Create a new config file from core_path */
|
||||
new_conf = config_file_new(core_path);
|
||||
|
||||
@ -3791,8 +3794,6 @@ static void parse_config_file(void)
|
||||
path_get(RARCH_PATH_CONFIG));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void save_keybind_key(config_file_t *conf, const char *prefix,
|
||||
const char *base, const struct retro_keybind *bind)
|
||||
{
|
||||
@ -4046,13 +4047,12 @@ static bool config_save_keybinds_file(const char *path)
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
save_keybinds_user(conf, i);
|
||||
|
||||
ret = config_file_write(conf, path);
|
||||
ret = config_file_write(conf, path, true);
|
||||
config_file_free(conf);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* config_save_autoconf_profile:
|
||||
* @path : Path that shall be written to.
|
||||
@ -4155,7 +4155,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
&input_config_binds[user][i], false, false);
|
||||
}
|
||||
|
||||
ret = config_file_write(conf, autoconf_file);
|
||||
ret = config_file_write(conf, autoconf_file, false);
|
||||
|
||||
config_file_free(conf);
|
||||
free(buf);
|
||||
@ -4170,7 +4170,6 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* config_save_file:
|
||||
* @path : Path that shall be written to.
|
||||
@ -4378,7 +4377,6 @@ bool config_save_file(const char *path)
|
||||
settings->uints.menu_border_light_color);
|
||||
#endif
|
||||
|
||||
|
||||
video_driver_save_settings(conf);
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
@ -4405,7 +4403,7 @@ bool config_save_file(const char *path)
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
save_keybinds_user(conf, i);
|
||||
|
||||
ret = config_file_write(conf, path);
|
||||
ret = config_file_write(conf, path, true);
|
||||
config_file_free(conf);
|
||||
|
||||
return ret;
|
||||
@ -4651,7 +4649,6 @@ bool config_save_overrides(int override_type)
|
||||
config_set_int(conf, cfg, overrides->uints.input_joypad_map[i]);
|
||||
}
|
||||
|
||||
|
||||
/* blacklist these since they are handled by remaps */
|
||||
/* to-do: add setting to control blacklisting
|
||||
if (settings->uints.input_libretro_device[i]
|
||||
@ -4677,17 +4674,17 @@ bool config_save_overrides(int override_type)
|
||||
case OVERRIDE_CORE:
|
||||
/* Create a new config file from core_path */
|
||||
RARCH_LOG ("[overrides] path %s\n", core_path);
|
||||
ret = config_file_write(conf, core_path);
|
||||
ret = config_file_write(conf, core_path, true);
|
||||
break;
|
||||
case OVERRIDE_GAME:
|
||||
/* Create a new config file from core_path */
|
||||
RARCH_LOG ("[overrides] path %s\n", game_path);
|
||||
ret = config_file_write(conf, game_path);
|
||||
ret = config_file_write(conf, game_path, true);
|
||||
break;
|
||||
case OVERRIDE_CONTENT_DIR:
|
||||
/* Create a new config file from content_path */
|
||||
RARCH_LOG ("[overrides] path %s\n", content_path);
|
||||
ret = config_file_write(conf, content_path);
|
||||
ret = config_file_write(conf, content_path, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -134,7 +134,6 @@ bool core_set_default_callbacks(struct retro_callbacks *cbs)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool core_deinit(void *data)
|
||||
{
|
||||
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||
@ -402,7 +401,6 @@ bool core_unload(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool core_unload_game(void)
|
||||
{
|
||||
video_driver_free_hw_context();
|
||||
|
@ -24,7 +24,8 @@ enum rarch_core_type
|
||||
CORE_TYPE_MPV,
|
||||
CORE_TYPE_IMAGEVIEWER,
|
||||
CORE_TYPE_NETRETROPAD,
|
||||
CORE_TYPE_VIDEO_PROCESSOR
|
||||
CORE_TYPE_VIDEO_PROCESSOR,
|
||||
CORE_TYPE_GONG
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -224,4 +224,3 @@ void libretro_dummy_retro_cheat_set(unsigned idx,
|
||||
(void)code;
|
||||
}
|
||||
|
||||
|
||||
|
@ -360,6 +360,62 @@ size_t libretro_videoprocessor_retro_get_memory_size(unsigned id);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EASTEREGG
|
||||
/* Internal gong core. */
|
||||
|
||||
void libretro_gong_retro_init(void);
|
||||
|
||||
void libretro_gong_retro_deinit(void);
|
||||
|
||||
unsigned libretro_gong_retro_api_version(void);
|
||||
|
||||
void libretro_gong_retro_get_system_info(struct retro_system_info *info);
|
||||
|
||||
void libretro_gong_retro_get_system_av_info(struct retro_system_av_info *info);
|
||||
|
||||
void libretro_gong_retro_set_environment(retro_environment_t cb);
|
||||
|
||||
void libretro_gong_retro_set_video_refresh(retro_video_refresh_t cb);
|
||||
|
||||
void libretro_gong_retro_set_audio_sample(retro_audio_sample_t cb);
|
||||
|
||||
void libretro_gong_retro_set_audio_sample_batch(retro_audio_sample_batch_t cb);
|
||||
|
||||
void libretro_gong_retro_set_input_poll(retro_input_poll_t cb);
|
||||
|
||||
void libretro_gong_retro_set_input_state(retro_input_state_t cb);
|
||||
|
||||
void libretro_gong_retro_set_controller_port_device(unsigned port, unsigned device);
|
||||
|
||||
void libretro_gong_retro_reset(void);
|
||||
|
||||
void libretro_gong_retro_run(void);
|
||||
|
||||
size_t libretro_gong_retro_serialize_size(void);
|
||||
|
||||
bool libretro_gong_retro_serialize(void *data, size_t size);
|
||||
|
||||
bool libretro_gong_retro_unserialize(const void *data, size_t size);
|
||||
|
||||
void libretro_gong_retro_cheat_reset(void);
|
||||
|
||||
void libretro_gong_retro_cheat_set(unsigned index, bool enabled, const char *code);
|
||||
|
||||
bool libretro_gong_retro_load_game(const struct retro_game_info *game);
|
||||
|
||||
bool libretro_gong_retro_load_game_special(unsigned game_type,
|
||||
const struct retro_game_info *info, size_t num_info);
|
||||
|
||||
void libretro_gong_retro_unload_game(void);
|
||||
|
||||
unsigned libretro_gong_retro_get_region(void);
|
||||
|
||||
void *libretro_gong_retro_get_memory_data(unsigned id);
|
||||
|
||||
size_t libretro_gong_retro_get_memory_size(unsigned id);
|
||||
|
||||
#endif
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -195,7 +195,7 @@ CFLAGS += -D__LIBRETRO__
|
||||
|
||||
include Makefile.common
|
||||
|
||||
CFLAGS += $(DEFINES) $(INCFLAGS) $(GLFLAGS)
|
||||
CFLAGS += $(DEFINES) $(INCFLAGS) $(GLFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += -Wall $(fpic)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
|
@ -16,7 +16,6 @@ AVUTIL_DIR := $(BASE_DIR)/libavutil
|
||||
SWSCALE_DIR := $(BASE_DIR)/libswscale
|
||||
SWRESAMPLE_DIR := $(BASE_DIR)/libswresample
|
||||
|
||||
|
||||
INCFLAGS += -I$(BASE_DIR) -I$(CORE_DIR) -I$(LIBRETRO_COMM_DIR)/include -I$(LIBRETRO_COMM_DIR)/include/compat
|
||||
|
||||
LIBRETRO_SOURCE += $(CORE_DIR)/ffmpeg_core.c \
|
||||
|
@ -134,7 +134,6 @@ endif
|
||||
|
||||
LIBS += -lm
|
||||
|
||||
|
||||
ifeq ($(HAVE_NEON),1)
|
||||
DEFINES += -DHAVE_NEON=1
|
||||
else
|
||||
@ -163,7 +162,6 @@ CPUOPTS += -DARCH_BFIN=0
|
||||
#We can reasonably assume MMX will be there on all x86 CPUs from 1997 and up at least
|
||||
#SSE2 can be assumed from Pentium 4 and up - can be switched on or off with the switch HAVE_SSE2
|
||||
|
||||
|
||||
ifeq ($(ARCH_X86),1)
|
||||
CPUOPTS += -DHAVE_AMD3DNOW_INLINE=0
|
||||
CPUOPTS += -DHAVE_AMD3DNOWEXT_EXTERNAL=0
|
||||
@ -756,7 +754,6 @@ else
|
||||
DEFINES += -DCONFIG_LIBSPEEX_ENCODER=0
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(HAVE_LIBOPUS),1)
|
||||
DEFINES += -DCONFIG_LIBOPUS_ENCODER=1 \
|
||||
-DCONFIG_OPUS_PARSER=1 \
|
||||
@ -1265,7 +1262,6 @@ DEFINES += -DCONFIG_LIBOPUS_DECODER=0
|
||||
DEFINES += -DCONFIG_OPUS_MUXER=0
|
||||
endif
|
||||
|
||||
|
||||
#libavutil
|
||||
ifeq ($(INTERNAL_LIBAVUTIL),1)
|
||||
DEFINES += -DHAVE_AV_CONFIG_H
|
||||
@ -1336,7 +1332,6 @@ ifeq ($(ARCH_ARM),1)
|
||||
LIBAVUTIL_SOURCE += $(filter-out $(AVUTIL_BLACKLIST),$(wildcard $(AVUTIL_DIR)/arm/*.c))
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(ARCH_PPC),1)
|
||||
LIBAVUTIL_SOURCE += $(AVUTIL_DIR)/ppc/cpu.c \
|
||||
$(AVUTIL_DIR)/ppc/float_dsp_init.c
|
||||
@ -1468,7 +1463,6 @@ else
|
||||
DEFINES += -DCONFIG_XVMC=0
|
||||
endif
|
||||
|
||||
|
||||
AVCODEC_BLACKLIST := \
|
||||
$(AVCODEC_DIR)/arm/neontest.c \
|
||||
$(AVCODEC_DIR)/vda.c \
|
||||
|
@ -693,7 +693,6 @@ void CORE_PREFIX(retro_run)(void)
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, frames[0].tex);
|
||||
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||
glVertexAttribPointer(vertex_loc, 2, GL_FLOAT, GL_FALSE,
|
||||
4 * sizeof(GLfloat), (const GLvoid*)(0 * sizeof(GLfloat)));
|
||||
@ -1664,7 +1663,6 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
unsigned CORE_PREFIX(retro_get_region)(void)
|
||||
{
|
||||
return RETRO_REGION_NTSC;
|
||||
|
696
cores/libretro-gong/gong.c
Normal file
696
cores/libretro-gong/gong.c
Normal file
@ -0,0 +1,696 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Libretro port by Brad Parker,
|
||||
Original source code by Dan Zaidan: https://danzaidan.itch.io/
|
||||
Original license:
|
||||
"You can do whatever you want with the code, but I am providing it as is without any warranty whatsoever."
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libretro.h>
|
||||
#include <retro_math.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "internal_cores.h"
|
||||
#define GONG_CORE_PREFIX(s) libretro_gong_##s
|
||||
#else
|
||||
#define GONG_CORE_PREFIX(s) s
|
||||
#endif
|
||||
|
||||
#define WIDTH 356
|
||||
#define HEIGHT 200
|
||||
#define FPS (60000.0f / 1000.0f)
|
||||
|
||||
static retro_log_printf_t GONG_CORE_PREFIX(log_cb);
|
||||
static retro_video_refresh_t GONG_CORE_PREFIX(video_cb);
|
||||
static retro_input_poll_t GONG_CORE_PREFIX(input_poll_cb);
|
||||
static retro_input_state_t GONG_CORE_PREFIX(input_state_cb);
|
||||
static retro_audio_sample_t GONG_CORE_PREFIX(audio_cb);
|
||||
static retro_audio_sample_batch_t GONG_CORE_PREFIX(audio_batch_cb);
|
||||
static retro_environment_t GONG_CORE_PREFIX(environ_cb);
|
||||
|
||||
static const char *GONG_CORE_PREFIX(valid_extensions) = "gong";
|
||||
|
||||
static float player1_py = 0.0f;
|
||||
static float player1_dpy = 0.0f;
|
||||
static float player2_py = 0.0f;
|
||||
static float player2_dpy = 0.0f;
|
||||
static float player2_speed = 0.0f;
|
||||
static float ball_px = 0.0f;
|
||||
static float ball_py = 0.0f;
|
||||
static float ball_dpx = 0.0f;
|
||||
static float ball_dpy = 0.0f;
|
||||
static float ball_speed = 0.0f;
|
||||
static bool is_initialized = 0;
|
||||
static unsigned player1_score = 0;
|
||||
static unsigned player2_score = 0;
|
||||
static float current_play_points = 0.0f;
|
||||
|
||||
static unsigned char *video_buf = NULL;
|
||||
|
||||
enum
|
||||
{
|
||||
B_MOVE_UP,
|
||||
B_MOVE_DOWN,
|
||||
B_SPEED_UP,
|
||||
B_COUNT /* This should always be in the bottom */
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int half_transition_count;
|
||||
bool ended_down;
|
||||
} Game_Button_State;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Game_Button_State buttons[B_COUNT];
|
||||
float last_dt;
|
||||
} Game_Input;
|
||||
|
||||
static Game_Input g_input = {0};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Pixels are always 32-bit wide, memory order XX BB GG RR */
|
||||
int width;
|
||||
int height;
|
||||
int pitch;
|
||||
void *memory;
|
||||
} Game_Offscreen_Buffer;
|
||||
|
||||
static Game_Offscreen_Buffer game_buffer = {0};
|
||||
|
||||
static void game_update_and_render(Game_Input *input, Game_Offscreen_Buffer *draw_buffer);
|
||||
|
||||
static const struct retro_controller_description pads[] = {
|
||||
{ "Joypad", RETRO_DEVICE_JOYPAD },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
|
||||
static const struct retro_controller_info ports[] = {
|
||||
{ pads, 1 },
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
struct retro_input_descriptor desc[] = {
|
||||
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP, "D-Pad Up" },
|
||||
{ 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN, "D-Pad Down" },
|
||||
{ 0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y, "Left Analog Y" },
|
||||
{ 0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y, "Right Analog Y" },
|
||||
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
static INLINE bool pressed(Game_Button_State state)
|
||||
{
|
||||
return state.half_transition_count > 1 ||
|
||||
(state.half_transition_count == 1 && state.ended_down);
|
||||
}
|
||||
|
||||
static INLINE bool is_down(Game_Button_State state)
|
||||
{
|
||||
return state.ended_down;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info)
|
||||
{
|
||||
info->library_name = "gong";
|
||||
info->library_version = "v1.0";
|
||||
info->need_fullpath = false;
|
||||
info->block_extract = false;
|
||||
info->valid_extensions = GONG_CORE_PREFIX(valid_extensions);
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info)
|
||||
{
|
||||
info->geometry.base_width = WIDTH;
|
||||
info->geometry.base_height = HEIGHT;
|
||||
info->geometry.max_width = WIDTH;
|
||||
info->geometry.max_height = HEIGHT;
|
||||
info->geometry.aspect_ratio = 16.0f / 9.0f;
|
||||
info->timing.fps = FPS;
|
||||
info->timing.sample_rate = 44100.0;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_init)(void)
|
||||
{
|
||||
struct retro_log_callback log;
|
||||
|
||||
if (GONG_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log))
|
||||
GONG_CORE_PREFIX(log_cb) = log.log;
|
||||
else
|
||||
GONG_CORE_PREFIX(log_cb) = NULL;
|
||||
|
||||
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned));
|
||||
|
||||
game_buffer.width = WIDTH;
|
||||
game_buffer.height = HEIGHT;
|
||||
game_buffer.pitch = WIDTH * sizeof(unsigned);
|
||||
game_buffer.memory = video_buf;
|
||||
|
||||
g_input.last_dt = 1.0f / FPS;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_deinit)(void)
|
||||
{
|
||||
if (video_buf)
|
||||
free(video_buf);
|
||||
|
||||
video_buf = NULL;
|
||||
game_buffer.memory = NULL;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
|
||||
{
|
||||
bool no_content = true;
|
||||
|
||||
static const struct retro_variable vars[] = {
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
GONG_CORE_PREFIX(environ_cb) = cb;
|
||||
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_video_refresh)(retro_video_refresh_t cb)
|
||||
{
|
||||
GONG_CORE_PREFIX(video_cb) = cb;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_audio_sample)(retro_audio_sample_t cb)
|
||||
{
|
||||
GONG_CORE_PREFIX(audio_cb) = cb;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_audio_sample_batch)(retro_audio_sample_batch_t cb)
|
||||
{
|
||||
GONG_CORE_PREFIX(audio_batch_cb) = cb;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_input_poll)(retro_input_poll_t cb)
|
||||
{
|
||||
GONG_CORE_PREFIX(input_poll_cb) = cb;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_input_state)(retro_input_state_t cb)
|
||||
{
|
||||
GONG_CORE_PREFIX(input_state_cb) = cb;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_set_controller_port_device)(unsigned a, unsigned b)
|
||||
{
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_reset)(void)
|
||||
{
|
||||
player1_py = 0.0f;
|
||||
player1_dpy = 0.0f;
|
||||
player2_py = 0.0f;
|
||||
player2_dpy = 0.0f;
|
||||
player2_speed = 0.0f;
|
||||
player1_score = 0;
|
||||
player2_score = 0;
|
||||
is_initialized = 0;
|
||||
}
|
||||
|
||||
size_t GONG_CORE_PREFIX(retro_serialize_size)(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool GONG_CORE_PREFIX(retro_serialize)(void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GONG_CORE_PREFIX(retro_unserialize)(const void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_cheat_reset)(void)
|
||||
{
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_cheat_set)(unsigned a, bool b, const char * c)
|
||||
{
|
||||
}
|
||||
|
||||
bool GONG_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
{
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
|
||||
if (!GONG_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
if (GONG_CORE_PREFIX(log_cb))
|
||||
GONG_CORE_PREFIX(log_cb)(RETRO_LOG_INFO, "XRGB8888 is not supported.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GONG_CORE_PREFIX(retro_load_game_special)(unsigned a, const struct retro_game_info *b, size_t c)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_unload_game)(void)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned GONG_CORE_PREFIX(retro_get_region)(void)
|
||||
{
|
||||
return RETRO_REGION_NTSC;
|
||||
}
|
||||
|
||||
void* GONG_CORE_PREFIX(retro_get_memory_data)(unsigned id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t GONG_CORE_PREFIX(retro_get_memory_size)(unsigned id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void process_joypad(Game_Button_State *new_state, bool is_down)
|
||||
{
|
||||
if (new_state->ended_down != is_down)
|
||||
{
|
||||
new_state->ended_down = is_down;
|
||||
new_state->half_transition_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
static bool is_key_up_or_down(int16_t input, int16_t not_input, int key)
|
||||
{
|
||||
if (input & (1 << key) || not_input & (1 << key))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void GONG_CORE_PREFIX(retro_run)(void)
|
||||
{
|
||||
uint16_t input = 0;
|
||||
uint16_t not_input = 0;
|
||||
static uint16_t previnput = 0;
|
||||
uint16_t realinput = 0;
|
||||
int i = 0;
|
||||
int16_t analogYLeft1 = 0;
|
||||
int16_t analogYRight1 = 0;
|
||||
|
||||
GONG_CORE_PREFIX(input_poll_cb)();
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
if (GONG_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, i))
|
||||
{
|
||||
realinput |= 1 << i;
|
||||
}
|
||||
}
|
||||
|
||||
analogYLeft1 = GONG_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 5000.0f;
|
||||
analogYRight1 = GONG_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 5000.0f;
|
||||
|
||||
if (analogYLeft1 > 0)
|
||||
realinput |= (1 << RETRO_DEVICE_ID_JOYPAD_DOWN);
|
||||
else if (analogYRight1 > 0)
|
||||
realinput |= (1 << RETRO_DEVICE_ID_JOYPAD_DOWN);
|
||||
|
||||
if (analogYLeft1 < 0)
|
||||
realinput |= (1 << RETRO_DEVICE_ID_JOYPAD_UP);
|
||||
else if (analogYRight1 < 0)
|
||||
realinput |= (1 << RETRO_DEVICE_ID_JOYPAD_UP);
|
||||
|
||||
input = realinput & ~previnput;
|
||||
not_input = previnput & ~realinput;
|
||||
|
||||
if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
process_joypad(&g_input.buttons[B_MOVE_UP], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_UP));
|
||||
else if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
process_joypad(&g_input.buttons[B_MOVE_DOWN], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_DOWN));
|
||||
else if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
process_joypad(&g_input.buttons[B_MOVE_DOWN], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_DOWN));
|
||||
|
||||
if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_A))
|
||||
process_joypad(&g_input.buttons[B_SPEED_UP], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_A));
|
||||
else if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_B))
|
||||
process_joypad(&g_input.buttons[B_SPEED_UP], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_B));
|
||||
else if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_X))
|
||||
process_joypad(&g_input.buttons[B_SPEED_UP], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_X));
|
||||
else if (is_key_up_or_down(input, not_input, RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
process_joypad(&g_input.buttons[B_SPEED_UP], realinput & (1 << RETRO_DEVICE_ID_JOYPAD_Y));
|
||||
|
||||
previnput = realinput;
|
||||
|
||||
game_update_and_render(&g_input, &game_buffer);
|
||||
|
||||
GONG_CORE_PREFIX(video_cb)(video_buf, WIDTH, HEIGHT, WIDTH * sizeof(uint32_t));
|
||||
}
|
||||
|
||||
unsigned GONG_CORE_PREFIX(retro_api_version)(void)
|
||||
{
|
||||
return RETRO_API_VERSION;
|
||||
}
|
||||
|
||||
static void draw_rect_in_pixels(Game_Offscreen_Buffer *buffer, unsigned color, int min_x, int min_y, int max_x, int max_y)
|
||||
{
|
||||
int y;
|
||||
|
||||
min_x = MAX(min_x, 0);
|
||||
min_y = MAX(min_y, 0);
|
||||
max_x = MIN(max_x, buffer->width);
|
||||
max_y = MIN(max_y, buffer->height);
|
||||
|
||||
for (y = min_y; y < max_y; y++)
|
||||
{
|
||||
int x;
|
||||
|
||||
for (x = min_x; x < max_x; x++)
|
||||
{
|
||||
unsigned *pixel = (unsigned*)((unsigned char*)buffer->memory + ((buffer->width * (buffer->height - y - 1) + x) * sizeof(unsigned)));
|
||||
|
||||
*pixel++ = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void clear(Game_Offscreen_Buffer *buffer, unsigned color)
|
||||
{
|
||||
draw_rect_in_pixels(buffer, color, 0, 0, buffer->width, buffer->height);
|
||||
}
|
||||
|
||||
static void draw_rect(Game_Offscreen_Buffer *buffer, unsigned color, float x, float y, float half_size_x, float half_size_y)
|
||||
{
|
||||
/* @Hardcoded to always keep the playing field area on screen, no matter the aspect ratio */
|
||||
float scale = .01f;
|
||||
float relative_axis = (float)buffer->height;
|
||||
int min_x, min_y, max_x, max_y;
|
||||
|
||||
if ((float)buffer->width / (float)buffer->height < 1.77f)
|
||||
{
|
||||
relative_axis = (float)buffer->width;
|
||||
scale = .0056f;
|
||||
}
|
||||
|
||||
half_size_x *= relative_axis * scale;
|
||||
half_size_y *= relative_axis * scale;
|
||||
x *= relative_axis * scale;
|
||||
y *= relative_axis * scale;
|
||||
|
||||
x = x + buffer->width / 2;
|
||||
y = y + buffer->height / 2;
|
||||
|
||||
min_x = (unsigned)(x - half_size_x);
|
||||
min_y = (unsigned)(y - half_size_y);
|
||||
max_x = (unsigned)(x + half_size_x);
|
||||
max_y = (unsigned)(y + half_size_y);
|
||||
|
||||
draw_rect_in_pixels(buffer, color, min_x, min_y, max_x, max_y);
|
||||
}
|
||||
|
||||
static void draw_number(Game_Offscreen_Buffer *buffer, unsigned number, unsigned color, float x, float y)
|
||||
{
|
||||
float at_x = x;
|
||||
|
||||
do {
|
||||
unsigned alg = number % 10;
|
||||
|
||||
number /= 10;
|
||||
|
||||
switch (alg)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
draw_rect(buffer, color, at_x - 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.5f);
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
draw_rect(buffer, color, at_x - 2.f, y - 2.f, .5f, 2.f);
|
||||
draw_rect(buffer, color, at_x + 2.f, y + 2.f, .5f, 2.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
break;
|
||||
};
|
||||
|
||||
case 4:
|
||||
{
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.5f);
|
||||
draw_rect(buffer, color, at_x - 2.f, y+2.5f, .5f, 2.f);
|
||||
break;
|
||||
};
|
||||
|
||||
case 5:
|
||||
{
|
||||
draw_rect(buffer, color, at_x + 2.f, y-2.f, .5f, 2.f);
|
||||
draw_rect(buffer, color, at_x - 2.f, y+2.f, .5f, 2.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
break;
|
||||
};
|
||||
|
||||
case 6:
|
||||
{
|
||||
draw_rect(buffer, color, at_x + 2.f, y-2.f, .5f, 2.f);
|
||||
draw_rect(buffer, color, at_x - 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
break;
|
||||
};
|
||||
|
||||
case 7:
|
||||
{
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.5f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
break;
|
||||
};
|
||||
|
||||
case 8:
|
||||
{
|
||||
draw_rect(buffer, color, at_x - 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
break;
|
||||
};
|
||||
|
||||
case 9:
|
||||
{
|
||||
draw_rect(buffer, color, at_x - 2.f, y + 2.f, .5f, 2.f);
|
||||
draw_rect(buffer, color, at_x + 2.f, y, .5f, 4.f);
|
||||
draw_rect(buffer, color, at_x, y + 4.f, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y, 2.5f, .5f);
|
||||
draw_rect(buffer, color, at_x, y - 4.f, 2.5f, .5f);
|
||||
break;
|
||||
};
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
at_x -= 7.f;
|
||||
} while(number > 0);
|
||||
}
|
||||
|
||||
static void game_update_and_render(Game_Input *input, Game_Offscreen_Buffer *draw_buffer)
|
||||
{
|
||||
const float initial_ball_speed = 80.f;
|
||||
float playing_field_x = 85.f;
|
||||
float playing_field_y = 48.f;
|
||||
float player_size_x = 2.5f;
|
||||
float player_size_y = 10.f;
|
||||
|
||||
if (!is_initialized)
|
||||
{
|
||||
is_initialized = 1;
|
||||
ball_px = 0;
|
||||
ball_py = 0;
|
||||
ball_dpx = initial_ball_speed;
|
||||
ball_dpy = 0;
|
||||
current_play_points = 10.f;
|
||||
player2_speed = 80.f;
|
||||
}
|
||||
|
||||
{
|
||||
float speed = 80.f;
|
||||
player1_dpy = 0.f;
|
||||
|
||||
if (is_down(input->buttons[B_SPEED_UP]))
|
||||
speed = 150.f;
|
||||
|
||||
if (is_down(input->buttons[B_MOVE_UP]))
|
||||
{
|
||||
if (player1_py < playing_field_y - player_size_y)
|
||||
{
|
||||
player1_dpy = speed;
|
||||
}
|
||||
|
||||
if (player1_py < -playing_field_y + player_size_y)
|
||||
{
|
||||
player1_py = -playing_field_y + player_size_y;
|
||||
player1_dpy = 0.f;
|
||||
}
|
||||
}
|
||||
if (is_down(input->buttons[B_MOVE_DOWN]))
|
||||
{
|
||||
if (player1_py > -playing_field_y + player_size_y)
|
||||
{
|
||||
player1_dpy = -speed;
|
||||
}
|
||||
|
||||
if (player1_py < -playing_field_y + player_size_y)
|
||||
{
|
||||
player1_py = -playing_field_y + player_size_y;
|
||||
player1_dpy = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
player1_py += player1_dpy * input->last_dt;
|
||||
}
|
||||
|
||||
{
|
||||
player2_dpy = (ball_py - player2_py) * 100.f;
|
||||
player2_dpy = MIN(player2_dpy, player2_speed);
|
||||
player2_dpy = MAX(player2_dpy, -player2_speed);
|
||||
player2_py += player2_dpy * input->last_dt;
|
||||
|
||||
if (player2_py < -playing_field_y + player_size_y)
|
||||
{
|
||||
player2_py = -playing_field_y + player_size_y;
|
||||
player2_dpy = 0.f;
|
||||
}
|
||||
|
||||
if (player2_py > playing_field_y - player_size_y)
|
||||
{
|
||||
player2_py = playing_field_y - player_size_y;
|
||||
player2_dpy = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
ball_px += ball_dpx * input->last_dt;
|
||||
|
||||
if (ball_dpx > 0)
|
||||
{
|
||||
ball_dpx += 10.f * input->last_dt;
|
||||
}
|
||||
else
|
||||
{
|
||||
ball_dpx -= 10.f * input->last_dt;
|
||||
}
|
||||
|
||||
ball_py += ball_dpy * input->last_dt;
|
||||
|
||||
if (ball_py > playing_field_y - 1.f)
|
||||
{
|
||||
ball_py = playing_field_y - 1.f;
|
||||
ball_dpy *= -1.f;
|
||||
}
|
||||
else if (ball_py < -playing_field_y + 1)
|
||||
{
|
||||
ball_py = -playing_field_y + 1.f;
|
||||
ball_dpy *= -1;
|
||||
}
|
||||
|
||||
if (ball_px > 80.f - 2.5f - 1.f) /* @Hardcoded */
|
||||
{
|
||||
if ((ball_py >= (player2_py - 10.f)) && (ball_py <= (player2_py + 10.f)))
|
||||
{
|
||||
ball_dpx *= -1.f;
|
||||
ball_px = 80.f - 2.5f - 1.f; /* @Hardcoded */
|
||||
ball_dpy = (ball_py - player2_py) + player2_dpy;
|
||||
++current_play_points;
|
||||
}
|
||||
else if (ball_px >= playing_field_x - 1)
|
||||
{
|
||||
ball_px = 0;
|
||||
ball_py = 0;
|
||||
ball_dpy = 0;
|
||||
ball_dpx = -initial_ball_speed;
|
||||
player2_score += (unsigned)current_play_points;
|
||||
current_play_points = 10.f;
|
||||
}
|
||||
}
|
||||
else if (ball_px < -80 + 2.5f + 1.f) /* @Hardcoded */
|
||||
{
|
||||
if ((ball_py >= (player1_py - 10.f)) && (ball_py <= (player1_py + 10.f)))
|
||||
{
|
||||
ball_dpx *= -1.f;
|
||||
ball_px = -80 + 2.5f + 1.f; /* @Hardcoded */
|
||||
ball_dpy = (ball_py - player1_py) + player1_dpy;
|
||||
++current_play_points;
|
||||
}
|
||||
else if (ball_px <= -playing_field_x + 1)
|
||||
{
|
||||
ball_px = 0;
|
||||
ball_py = 0;
|
||||
ball_dpy = 0;
|
||||
ball_dpx = initial_ball_speed;
|
||||
player1_score += (unsigned)current_play_points;
|
||||
current_play_points = 10.f;
|
||||
player2_speed += current_play_points * 0.01f;
|
||||
}
|
||||
}
|
||||
|
||||
clear(draw_buffer, 0x021077);
|
||||
draw_rect(draw_buffer, 0x000530, 0.f, 0.f, playing_field_x, playing_field_y);
|
||||
|
||||
draw_rect(draw_buffer, 0x00ffff, -80.f, player1_py, player_size_x, player_size_y);
|
||||
draw_rect(draw_buffer, 0x00ffff, 80.f, player2_py, player_size_x, player_size_y);
|
||||
|
||||
draw_rect(draw_buffer, 0xffff00, ball_px, ball_py, 1.f, 1.f);
|
||||
|
||||
draw_number(draw_buffer, (unsigned)current_play_points, 0xaaaaaa, 0.f, 38.f);
|
||||
draw_number(draw_buffer, player1_score, 0xff6611, 20.f, 38.f);
|
||||
draw_number(draw_buffer, player2_score, 0xff6611, -20.f, 38.f);
|
||||
}
|
1
cores/libretro-gong/internal_cores.h
Normal file
1
cores/libretro-gong/internal_cores.h
Normal file
@ -0,0 +1 @@
|
||||
#include "../internal_cores.h"
|
5
cores/libretro-gong/link.T
Normal file
5
cores/libretro-gong/link.T
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
global: retro_*;
|
||||
local: *;
|
||||
};
|
||||
|
@ -275,7 +275,6 @@ static bool imageviewer_load(const char *path, int image_index)
|
||||
|
||||
process_new_image = true;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -293,7 +292,6 @@ bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
dir_list_sort(file_list, false);
|
||||
free(dir);
|
||||
|
||||
|
||||
if (!IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
if (IMAGE_CORE_PREFIX(log_cb))
|
||||
@ -312,7 +310,6 @@ bool IMAGE_CORE_PREFIX(retro_load_game_special)(unsigned a, const struct retro_g
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_unload_game)(void)
|
||||
{
|
||||
imageviewer_free_image();
|
||||
@ -335,7 +332,6 @@ size_t IMAGE_CORE_PREFIX(retro_get_memory_size)(unsigned id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_run)(void)
|
||||
{
|
||||
bool first_image = false;
|
||||
|
@ -103,7 +103,6 @@ else
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
endif
|
||||
|
||||
|
||||
LDFLAGS += $(LIBM)
|
||||
|
||||
ifeq ($(platform), win)
|
||||
|
@ -276,7 +276,6 @@ void NETRETROPAD_CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb) = cb;
|
||||
bool no_content = true;
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
|
||||
@ -379,7 +378,6 @@ void NETRETROPAD_CORE_PREFIX(retro_run)(void)
|
||||
pixel += 65;
|
||||
}
|
||||
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(video_cb)(frame_buf, 320, 240, 640);
|
||||
|
||||
retro_sleep(4);
|
||||
|
@ -102,7 +102,6 @@ static uint32_t *frame_prev2;
|
||||
static uint32_t *frame_prev3;
|
||||
static uint32_t *frame_curr;
|
||||
|
||||
|
||||
// Frametime debug messages
|
||||
struct timeval ft_prevtime = { 0 }, ft_prevtime2 = { 0 };
|
||||
char *ft_info = NULL, *ft_info2 = NULL;
|
||||
@ -660,7 +659,6 @@ void source_v4l2_normal(int width, int height) {
|
||||
v4l2_frame_times(bufcp);
|
||||
}
|
||||
|
||||
|
||||
void source_v4l2_alternate_hack(int width, int height) {
|
||||
struct v4l2_buffer bufcp;
|
||||
struct v4l2_format fmt;
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* from https://github.com/smealum/ctrulib
|
||||
* modified to allow reducing __linear_heap_size at runtime */
|
||||
|
||||
|
||||
#include <3ds.h>
|
||||
#include <stdlib.h>
|
||||
#include <3ds/util/rbtree.h>
|
||||
@ -245,7 +244,6 @@ extern "C" u32 ctr_get_linear_unused(void)
|
||||
return __linear_heap + __linear_heap_size - sLinearPool_maxaddr;
|
||||
}
|
||||
|
||||
|
||||
extern "C" void ctr_linear_free_pages(u32 pages)
|
||||
{
|
||||
if(sLinearPool.last->base + sLinearPool.last->size != (u8*)__linear_heap + __linear_heap_size)
|
||||
|
@ -379,7 +379,6 @@ static void do_memchunkhax2(void)
|
||||
APT_SetAppCpuTimeLimit(mch2.old_cpu_time_limit);
|
||||
}
|
||||
|
||||
|
||||
static void gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
|
||||
{
|
||||
extern Handle gspEvents[GSPGPU_EVENT_MAX];
|
||||
|
@ -93,7 +93,6 @@ void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
||||
__system_allocateHeaps();
|
||||
}
|
||||
|
||||
|
||||
Result __sync_fini(void) __attribute__((weak));
|
||||
|
||||
extern char** __system_argv;
|
||||
@ -299,7 +298,6 @@ void wait_for_input(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
long sysconf(int name)
|
||||
{
|
||||
switch (name)
|
||||
|
@ -5,14 +5,12 @@
|
||||
|
||||
#include "mini-hb-menu/common.h"
|
||||
|
||||
|
||||
extern const loaderFuncs_s loader_Ninjhax1;
|
||||
extern const loaderFuncs_s loader_Ninjhax2;
|
||||
extern const loaderFuncs_s loader_Rosalina;
|
||||
|
||||
static void (*launch_3dsx)(const char* path, argData_s* args, executableMetadata_s* em);
|
||||
|
||||
|
||||
static int exec_3dsx_actual(const char* path, const char** args, bool appendPath){
|
||||
struct stat sBuff;
|
||||
argData_s newProgramArgs;
|
||||
|
@ -4,16 +4,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include <3ds.h>
|
||||
|
||||
|
||||
#define FILE_CHUNK_SIZE 4096
|
||||
|
||||
|
||||
typedef struct{
|
||||
u32 argc;
|
||||
char args[0x300 - 0x4];
|
||||
}ciaParam;
|
||||
|
||||
|
||||
char argvHmac[0x20] = {0x1d, 0x78, 0xff, 0xb9, 0xc5, 0xbc, 0x78, 0xb7, 0xac, 0x29, 0x1d, 0x3e, 0x16, 0xd0, 0xcf, 0x53, 0xef, 0x12, 0x58, 0x83, 0xb6, 0x9e, 0x2f, 0x79, 0x47, 0xf9, 0x35, 0x61, 0xeb, 0x50, 0xd7, 0x67};
|
||||
|
||||
|
||||
|
@ -35,7 +35,6 @@ void GPU_SetFloatUniform(GPU_SHADER_TYPE type, u32 startreg, u32* data, u32 numr
|
||||
GPUCMD_AddWrites(GPUREG_VSH_FLOATUNIFORM_DATA+regOffset, data, numreg*4);
|
||||
}
|
||||
|
||||
|
||||
//takes PAs as arguments
|
||||
void GPU_SetViewport(u32* depthBuffer, u32* colorBuffer, u32 x, u32 y, u32 w, u32 h)
|
||||
{
|
||||
@ -307,7 +306,6 @@ void GPU_FinishDrawing()
|
||||
GPUCMD_AddWrite(GPUREG_EARLYDEPTH_CLEAR, 0x00000001);
|
||||
}
|
||||
|
||||
|
||||
void GPU_Finalize(void)
|
||||
{
|
||||
GPUCMD_AddMaskedWrite(GPUREG_PRIMITIVE_CONFIG, 0x8, 0x00000000);
|
||||
|
@ -148,7 +148,6 @@ char *bin_to_hex_alloc(const uint8_t *data, size_t len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
database_info_t *db_info)
|
||||
{
|
||||
|
@ -129,20 +129,20 @@ public class DiscordRpc
|
||||
FreeMem();
|
||||
}
|
||||
|
||||
_presence.state = StrToPtr(state, 128);
|
||||
_presence.details = StrToPtr(details, 128);
|
||||
_presence.state = StrToPtr(state);
|
||||
_presence.details = StrToPtr(details);
|
||||
_presence.startTimestamp = startTimestamp;
|
||||
_presence.endTimestamp = endTimestamp;
|
||||
_presence.largeImageKey = StrToPtr(largeImageKey, 32);
|
||||
_presence.largeImageText = StrToPtr(largeImageText, 128);
|
||||
_presence.smallImageKey = StrToPtr(smallImageKey, 32);
|
||||
_presence.smallImageText = StrToPtr(smallImageText, 128);
|
||||
_presence.partyId = StrToPtr(partyId, 128);
|
||||
_presence.largeImageKey = StrToPtr(largeImageKey);
|
||||
_presence.largeImageText = StrToPtr(largeImageText);
|
||||
_presence.smallImageKey = StrToPtr(smallImageKey);
|
||||
_presence.smallImageText = StrToPtr(smallImageText);
|
||||
_presence.partyId = StrToPtr(partyId);
|
||||
_presence.partySize = partySize;
|
||||
_presence.partyMax = partyMax;
|
||||
_presence.matchSecret = StrToPtr(matchSecret, 128);
|
||||
_presence.joinSecret = StrToPtr(joinSecret, 128);
|
||||
_presence.spectateSecret = StrToPtr(spectateSecret, 128);
|
||||
_presence.matchSecret = StrToPtr(matchSecret);
|
||||
_presence.joinSecret = StrToPtr(joinSecret);
|
||||
_presence.spectateSecret = StrToPtr(spectateSecret);
|
||||
_presence.instance = instance;
|
||||
|
||||
return _presence;
|
||||
@ -152,16 +152,18 @@ public class DiscordRpc
|
||||
/// Returns a pointer to a representation of the given string with a size of maxbytes
|
||||
/// </summary>
|
||||
/// <param name="input">String to convert</param>
|
||||
/// <param name="maxbytes">Max number of bytes to use</param>
|
||||
/// <returns>Pointer to the UTF-8 representation of <see cref="input"/></returns>
|
||||
private IntPtr StrToPtr(string input, int maxbytes)
|
||||
private IntPtr StrToPtr(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input)) return IntPtr.Zero;
|
||||
var convstr = StrClampBytes(input, maxbytes);
|
||||
var convbytecnt = Encoding.UTF8.GetByteCount(convstr);
|
||||
var buffer = Marshal.AllocHGlobal(convbytecnt);
|
||||
var convbytecnt = Encoding.UTF8.GetByteCount(input);
|
||||
var buffer = Marshal.AllocHGlobal(convbytecnt + 1);
|
||||
for (int i = 0; i < convbytecnt + 1; i++)
|
||||
{
|
||||
Marshal.WriteByte(buffer, i , 0);
|
||||
}
|
||||
_buffers.Add(buffer);
|
||||
Marshal.Copy(Encoding.UTF8.GetBytes(convstr), 0, buffer, convbytecnt);
|
||||
Marshal.Copy(Encoding.UTF8.GetBytes(input), 0, buffer, convbytecnt);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@ -181,30 +183,6 @@ public class DiscordRpc
|
||||
return Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(str));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clamp the string to the given byte length preserving null termination
|
||||
/// </summary>
|
||||
/// <param name="toclamp">string to clamp</param>
|
||||
/// <param name="maxbytes">max bytes the resulting string should have (including null termination)</param>
|
||||
/// <returns>null terminated string with a byte length less or equal to <see cref="maxbytes"/></returns>
|
||||
private static string StrClampBytes(string toclamp, int maxbytes)
|
||||
{
|
||||
var str = StrToUtf8NullTerm(toclamp);
|
||||
var strbytes = Encoding.UTF8.GetBytes(str);
|
||||
|
||||
if (strbytes.Length <= maxbytes)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
var newstrbytes = new byte[] { };
|
||||
Array.Copy(strbytes, 0, newstrbytes, 0, maxbytes - 1);
|
||||
newstrbytes[newstrbytes.Length - 1] = 0;
|
||||
newstrbytes[newstrbytes.Length - 2] = 0;
|
||||
|
||||
return Encoding.UTF8.GetString(newstrbytes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Free the allocated memory for conversion to <see cref="RichPresenceStruct"/>
|
||||
/// </summary>
|
||||
|
@ -24,6 +24,16 @@ struct FDiscordUserData {
|
||||
FString avatar;
|
||||
};
|
||||
|
||||
/**
|
||||
* Valid response codes for Respond function
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class EDiscordJoinResponseCodes : uint8
|
||||
{
|
||||
DISCORD_REPLY_NO UMETA(DisplayName="No"),
|
||||
DISCORD_REPLY_YES UMETA(DisplayName="Yes"),
|
||||
DISCORD_REPLY_IGNORE UMETA(DisplayName="Ignore")
|
||||
};
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(Discord, Log, All);
|
||||
|
||||
|
@ -33,9 +33,11 @@ extern "C" DISCORD_EXPORT void Discord_Register(const char* applicationId, const
|
||||
|
||||
char exePath[1024];
|
||||
if (!command || !command[0]) {
|
||||
if (readlink("/proc/self/exe", exePath, sizeof(exePath)) <= 0) {
|
||||
ssize_t size = readlink("/proc/self/exe", exePath, sizeof(exePath));
|
||||
if (size <= 0 || size >= (ssize_t)sizeof(exePath)) {
|
||||
return;
|
||||
}
|
||||
exePath[size] = '\0';
|
||||
command = exePath;
|
||||
}
|
||||
|
||||
|
3
deps/discord-rpc/src/discord_rpc.cpp
vendored
3
deps/discord-rpc/src/discord_rpc.cpp
vendored
@ -89,10 +89,11 @@ public:
|
||||
keepRunning.store(true);
|
||||
ioThread = std::thread([&]() {
|
||||
const std::chrono::duration<int64_t, std::milli> maxWait{500LL};
|
||||
Discord_UpdateConnection();
|
||||
while (keepRunning.load()) {
|
||||
Discord_UpdateConnection();
|
||||
std::unique_lock<std::mutex> lock(waitForIOMutex);
|
||||
waitForIOActivity.wait_for(lock, maxWait);
|
||||
Discord_UpdateConnection();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
5
dirs.c
5
dirs.c
@ -25,7 +25,6 @@
|
||||
#include "dirs.h"
|
||||
#include "command.h"
|
||||
#include "configuration.h"
|
||||
#include "command.h"
|
||||
#include "defaults.h"
|
||||
#include "list_special.h"
|
||||
#include "file_path_special.h"
|
||||
@ -309,7 +308,11 @@ void dir_check_defaults(void)
|
||||
/* early return for people with a custom folder setup
|
||||
so it doesn't create unnecessary directories
|
||||
*/
|
||||
#ifdef ORBIS
|
||||
if (filestream_exists("host0:app/custom.ini"))
|
||||
#else
|
||||
if (filestream_exists("custom.ini"))
|
||||
#endif
|
||||
return;
|
||||
|
||||
for (i = 0; i < DEFAULT_DIR_LAST; i++)
|
||||
|
@ -37,25 +37,112 @@
|
||||
#include "../cheevos/cheevos.h"
|
||||
#endif
|
||||
|
||||
static int FrustrationLevel = 0;
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/widgets/menu_input_dialog.h"
|
||||
#include "../../menu/menu_cbs.h"
|
||||
#endif
|
||||
|
||||
#include <net/net_http.h>
|
||||
#include "../network/net_http_special.h"
|
||||
#include "../tasks/tasks_internal.h"
|
||||
#include <streams/file_stream.h>
|
||||
#include <file/file_path.h>
|
||||
#include "../file_path_special.h"
|
||||
|
||||
static int64_t start_time = 0;
|
||||
static int64_t pause_time = 0;
|
||||
static int64_t ellapsed_time = 0;
|
||||
|
||||
static bool discord_ready = false;
|
||||
static bool discord_avatar_ready = false;
|
||||
static unsigned discord_status = 0;
|
||||
|
||||
struct netplay_room *room;
|
||||
|
||||
static char user_id[128];
|
||||
static char user_name[128];
|
||||
static char party_name[128];
|
||||
static char user_avatar[PATH_MAX_LENGTH];
|
||||
|
||||
static char cdn_url[] = "https://cdn.discordapp.com/avatars";
|
||||
|
||||
DiscordRichPresence discord_presence;
|
||||
|
||||
char* discord_get_own_username(void)
|
||||
{
|
||||
return user_name;
|
||||
}
|
||||
|
||||
char* discord_get_own_avatar(void)
|
||||
{
|
||||
return user_avatar;
|
||||
}
|
||||
|
||||
bool discord_avatar_is_ready(void)
|
||||
{
|
||||
return discord_avatar_ready;
|
||||
}
|
||||
|
||||
void discord_avatar_set_ready(bool ready)
|
||||
{
|
||||
discord_avatar_ready = ready;
|
||||
}
|
||||
|
||||
bool discord_is_ready(void)
|
||||
{
|
||||
return discord_ready;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static bool discord_download_avatar(
|
||||
const char* user_id, const char* avatar_id)
|
||||
{
|
||||
static char url[PATH_MAX_LENGTH];
|
||||
static char url_encoded[PATH_MAX_LENGTH];
|
||||
static char full_path[PATH_MAX_LENGTH];
|
||||
|
||||
static char buf[PATH_MAX_LENGTH];
|
||||
|
||||
file_transfer_t *transf = NULL;
|
||||
|
||||
fill_pathname_application_special(buf,
|
||||
sizeof(buf),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS);
|
||||
fill_pathname_join(full_path, buf, avatar_id, sizeof(full_path));
|
||||
strlcpy(user_avatar, avatar_id, sizeof(user_avatar));
|
||||
|
||||
if(filestream_exists(full_path))
|
||||
return true;
|
||||
|
||||
snprintf(url, sizeof(url), "%s/%s/%s.png", cdn_url, user_id, avatar_id);
|
||||
net_http_urlencode_full(url_encoded, url, sizeof(url_encoded));
|
||||
snprintf(buf, sizeof(buf), "%s.png", avatar_id);
|
||||
|
||||
transf = (file_transfer_t*)calloc(1, sizeof(*transf));
|
||||
transf->enum_idx = MENU_ENUM_LABEL_CB_DISCORD_AVATAR;
|
||||
strlcpy(transf->path, buf, sizeof(transf->path));
|
||||
|
||||
RARCH_LOG("[Discord] downloading avatar from: %s\n", url_encoded);
|
||||
task_push_http_transfer(url_encoded, true, NULL, cb_generic_download, transf);
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void handle_discord_ready(const DiscordUser* connectedUser)
|
||||
{
|
||||
strlcpy(user_name, connectedUser->username, sizeof(user_name));
|
||||
strlcpy(party_name, connectedUser->username, sizeof(user_name));
|
||||
strlcat(party_name, "|", sizeof(party_name));
|
||||
strlcat(party_name, connectedUser->discriminator, sizeof(party_name));
|
||||
|
||||
RARCH_LOG("[Discord] connected to user: %s#%s - avatar id: %s\n",
|
||||
connectedUser->username,
|
||||
connectedUser->discriminator,
|
||||
connectedUser->userId);
|
||||
#ifdef HAVE_MENU
|
||||
discord_download_avatar(connectedUser->userId, connectedUser->avatar);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void handle_discord_disconnected(int errcode, const char* message)
|
||||
@ -68,24 +155,72 @@ static void handle_discord_error(int errcode, const char* message)
|
||||
RARCH_LOG("[Discord] error (%d: %s)\n", errcode, message);
|
||||
}
|
||||
|
||||
static void handle_discord_join_cb(void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
struct netplay_room *room;
|
||||
char tmp_hostname[32];
|
||||
|
||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||
|
||||
if (!data || err)
|
||||
goto finish;
|
||||
|
||||
data->data = (char*)realloc(data->data, data->len + 1);
|
||||
data->data[data->len] = '\0';
|
||||
|
||||
netplay_rooms_parse(data->data);
|
||||
room = netplay_room_get(0);
|
||||
|
||||
if (room)
|
||||
{
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||
deinit_netplay();
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
|
||||
snprintf(tmp_hostname, sizeof(tmp_hostname), "%s|%d",
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_address : room->address,
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port);
|
||||
|
||||
RARCH_LOG("[Discord] joining lobby at: %s\n", tmp_hostname);
|
||||
task_push_netplay_crc_scan(room->gamecrc,
|
||||
room->gamename, tmp_hostname, room->corename);
|
||||
|
||||
}
|
||||
|
||||
finish:
|
||||
|
||||
if (err)
|
||||
RARCH_ERR("%s: %s\n", msg_hash_to_str(MSG_DOWNLOAD_FAILED), err);
|
||||
|
||||
if (data)
|
||||
{
|
||||
if (data->data)
|
||||
free(data->data);
|
||||
free(data);
|
||||
}
|
||||
|
||||
if (user_data)
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void handle_discord_join(const char* secret)
|
||||
{
|
||||
RARCH_LOG("[Discord] join (%s)\n", secret);
|
||||
char url [2048] = "http://lobby.libretro.com/";
|
||||
char tmp_hostname[32];
|
||||
static struct string_list *list = NULL;
|
||||
|
||||
RARCH_LOG("[Discord] join secret: (%s)\n", secret);
|
||||
list = string_split(secret, "|");
|
||||
|
||||
char tmp_hostname[32];
|
||||
strlcat(url, list->elems[0].data, sizeof(url));
|
||||
strlcat(url, "/", sizeof(url));
|
||||
RARCH_LOG("[Discord] querying lobby id: %s at %s\n", list->elems[0].data, url);
|
||||
|
||||
snprintf(tmp_hostname,
|
||||
sizeof(tmp_hostname),
|
||||
"%s|%s", list->elems[0].data, list->elems[1].data);
|
||||
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||
deinit_netplay();
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
|
||||
task_push_netplay_crc_scan(atoi(list->elems[3].data),
|
||||
list->elems[2].data,
|
||||
tmp_hostname, list->elems[4].data);
|
||||
task_push_http_transfer(url, true, NULL, handle_discord_join_cb, NULL);
|
||||
}
|
||||
|
||||
static void handle_discord_spectate(const char* secret)
|
||||
@ -93,14 +228,54 @@ static void handle_discord_spectate(const char* secret)
|
||||
RARCH_LOG("[Discord] spectate (%s)\n", secret);
|
||||
}
|
||||
|
||||
static void handle_discord_join_response(void *ignore, const char *line)
|
||||
{
|
||||
/* To-Do: needs in-game widgets
|
||||
if (strstr(line, "yes"))
|
||||
Discord_Respond(user_id, DISCORD_REPLY_YES);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_input_dialog_end();
|
||||
rarch_menu_running_finished();
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
static void handle_discord_join_request(const DiscordUser* request)
|
||||
{
|
||||
int response = -1;
|
||||
char yn[4];
|
||||
RARCH_LOG("[Discord] join request from %s#%s - %s\n",
|
||||
static char url[PATH_MAX_LENGTH];
|
||||
static char url_encoded[PATH_MAX_LENGTH];
|
||||
static char filename[PATH_MAX_LENGTH];
|
||||
char buf[PATH_MAX_LENGTH];
|
||||
#ifdef HAVE_MENU
|
||||
menu_input_ctx_line_t line;
|
||||
#endif
|
||||
|
||||
RARCH_LOG("[Discord] join request from %s#%s - %s %s\n",
|
||||
request->username,
|
||||
request->discriminator,
|
||||
request->userId);
|
||||
request->userId,
|
||||
request->avatar);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
discord_download_avatar(request->userId, request->avatar);
|
||||
/* To-Do: needs in-game widgets
|
||||
rarch_menu_running();
|
||||
*/
|
||||
|
||||
memset(&line, 0, sizeof(line));
|
||||
snprintf(buf, sizeof(buf), "%s %s?", msg_hash_to_str(MSG_DISCORD_CONNECTION_REQUEST), request->username);
|
||||
line.label = buf;
|
||||
line.label_setting = "no_setting";
|
||||
line.cb = handle_discord_join_response;
|
||||
|
||||
/* To-Do: needs in-game widgets
|
||||
To-Do: bespoke dialog, should show while in-game and have a hotkey to accept
|
||||
To-Do: show avatar of the user connecting
|
||||
if (!menu_input_dialog_start(&line))
|
||||
return;
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
void discord_update(enum discord_presence presence)
|
||||
@ -121,8 +296,8 @@ void discord_update(enum discord_presence presence)
|
||||
switch (presence)
|
||||
{
|
||||
case DISCORD_PRESENCE_MENU:
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU);
|
||||
discord_presence.largeImageKey = "base";
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU);
|
||||
discord_presence.largeImageKey = "base";
|
||||
discord_presence.largeImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
|
||||
discord_presence.instance = 0;
|
||||
break;
|
||||
@ -137,9 +312,9 @@ void discord_update(enum discord_presence presence)
|
||||
case DISCORD_PRESENCE_GAME:
|
||||
if (core_info)
|
||||
{
|
||||
const char *system_id = core_info->system_id ? core_info->system_id : "core";
|
||||
|
||||
char *label = NULL;
|
||||
const char *system_id = core_info->system_id
|
||||
? core_info->system_id : "core";
|
||||
char *label = NULL;
|
||||
playlist_t *current_playlist = playlist_get_cached();
|
||||
|
||||
if (current_playlist)
|
||||
@ -164,13 +339,13 @@ void discord_update(enum discord_presence presence)
|
||||
pause_time = 0;
|
||||
ellapsed_time = 0;
|
||||
|
||||
discord_presence.smallImageKey = "playing";
|
||||
discord_presence.smallImageKey = "playing";
|
||||
discord_presence.smallImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING);
|
||||
discord_presence.startTimestamp = start_time;
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME);
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME);
|
||||
|
||||
discord_presence.state = label;
|
||||
discord_presence.instance = 0;
|
||||
discord_presence.state = label;
|
||||
discord_presence.instance = 0;
|
||||
}
|
||||
break;
|
||||
case DISCORD_PRESENCE_NETPLAY_HOSTING:
|
||||
@ -183,19 +358,18 @@ void discord_update(enum discord_presence presence)
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_address : room->address,
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port);
|
||||
|
||||
char party_id[128];
|
||||
snprintf(party_id, sizeof(party_id), "%d|%s", room->id, room->nickname);
|
||||
char join_secret[128];
|
||||
snprintf(join_secret, sizeof(join_secret), "%s|%d|%s|%u|%s",
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_address : room->address,
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port,
|
||||
room->gamename, room->gamecrc, room->corename);
|
||||
RARCH_LOG("%s\n", join_secret);
|
||||
discord_presence.joinSecret = strdup(join_secret);
|
||||
discord_presence.spectateSecret = "SPECSPECSPEC";
|
||||
discord_presence.partyId = party_id;
|
||||
discord_presence.partyMax = 0;
|
||||
discord_presence.partySize = 0;
|
||||
{
|
||||
char join_secret[128];
|
||||
snprintf(join_secret, sizeof(join_secret), "%d|%s", room->id, room->nickname);
|
||||
discord_presence.joinSecret = strdup(join_secret);
|
||||
/* discord_presence.spectateSecret = "SPECSPECSPEC"; */
|
||||
discord_presence.partyId = strdup(party_name);
|
||||
discord_presence.partyMax = 0;
|
||||
discord_presence.partySize = 0;
|
||||
|
||||
RARCH_LOG("[Discord] join secret: %s\n", join_secret);
|
||||
RARCH_LOG("[Discord] party id: %s\n", party_name);
|
||||
}
|
||||
break;
|
||||
case DISCORD_PRESENCE_NETPLAY_HOSTING_STOPPED:
|
||||
case DISCORD_PRESENCE_NETPLAY_CLIENT:
|
||||
@ -212,7 +386,9 @@ void discord_update(enum discord_presence presence)
|
||||
|
||||
void discord_init(void)
|
||||
{
|
||||
char command[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
DiscordEventHandlers handlers;
|
||||
|
||||
RARCH_LOG("[Discord] initializing ..\n");
|
||||
@ -226,13 +402,13 @@ void discord_init(void)
|
||||
handlers.spectateGame = handle_discord_spectate;
|
||||
handlers.joinRequest = handle_discord_join_request;
|
||||
|
||||
/* To-Do: Add the arguments RetroArch was started with to the register URI*/
|
||||
const char command[256] = "retroarch";
|
||||
|
||||
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
|
||||
Discord_Register(settings->arrays.discord_app_id, NULL);
|
||||
|
||||
discord_ready = true;
|
||||
strlcpy(command, get_retroarch_launch_arguments(), sizeof(command));
|
||||
|
||||
RARCH_LOG("[Discord] registering startup command: %s\n", command);
|
||||
Discord_Register(settings->arrays.discord_app_id, command);
|
||||
discord_ready = true;
|
||||
}
|
||||
|
||||
void discord_shutdown(void)
|
||||
@ -243,7 +419,7 @@ void discord_shutdown(void)
|
||||
discord_ready = false;
|
||||
}
|
||||
|
||||
void discord_run_callbacks()
|
||||
void discord_run_callbacks(void)
|
||||
{
|
||||
Discord_RunCallbacks();
|
||||
}
|
||||
}
|
||||
|
@ -55,4 +55,14 @@ void discord_update(enum discord_presence presence);
|
||||
|
||||
void discord_run_callbacks();
|
||||
|
||||
bool discord_is_ready();
|
||||
|
||||
void discord_avatar_set_ready(bool ready);
|
||||
|
||||
bool discord_avatar_is_ready();
|
||||
|
||||
char* discord_get_own_username(void);
|
||||
|
||||
char* discord_get_own_avatar(void);
|
||||
|
||||
#endif /* __RARCH_DISCORD_H */
|
||||
|
6
driver.c
6
driver.c
@ -35,6 +35,7 @@
|
||||
#include "wifi/wifi_driver.h"
|
||||
#include "led/led_driver.h"
|
||||
#include "midi/midi_driver.h"
|
||||
#include "command.h"
|
||||
#include "configuration.h"
|
||||
#include "core_info.h"
|
||||
#include "driver.h"
|
||||
@ -385,6 +386,10 @@ void drivers_init(int flags)
|
||||
if (flags & DRIVER_MENU_MASK)
|
||||
menu_driver_init(video_is_threaded);
|
||||
}
|
||||
#else
|
||||
/* Qt uses core info, even if the menu is disabled */
|
||||
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
|
||||
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
#endif
|
||||
|
||||
if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK))
|
||||
@ -403,7 +408,6 @@ void drivers_init(int flags)
|
||||
midi_driver_init();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uninit_drivers:
|
||||
* @flags : Bitmask of drivers to deinitialize.
|
||||
|
43
dynamic.c
43
dynamic.c
@ -108,6 +108,10 @@ static dylib_t lib_handle;
|
||||
#define SYMBOL_VIDEOPROCESSOR(x) current_core->x = libretro_videoprocessor_##x
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EASTEREGG
|
||||
#define SYMBOL_GONG(x) current_core->x = libretro_gong_##x
|
||||
#endif
|
||||
|
||||
static bool ignore_environment_cb = false;
|
||||
static bool core_set_shared_context = false;
|
||||
static bool *load_no_content_hook = NULL;
|
||||
@ -173,7 +177,6 @@ void libretro_free_system_info(struct retro_system_info *info)
|
||||
memset(info, 0, sizeof(*info));
|
||||
}
|
||||
|
||||
|
||||
static bool environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
{
|
||||
rarch_system_info_t *system = runloop_get_system_info();
|
||||
@ -236,7 +239,6 @@ static bool environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
subsystem_data[i].roms = subsystem_data_roms[i];
|
||||
}
|
||||
|
||||
|
||||
subsystem_current_count = size <= SUBSYSTEM_MAX_SUBSYSTEMS ? size : SUBSYSTEM_MAX_SUBSYSTEMS;
|
||||
#if 0
|
||||
RARCH_LOG("Subsystems: %d\n", subsystem_current_count);
|
||||
@ -777,6 +779,43 @@ bool init_libretro_sym_custom(enum rarch_core_type type, struct retro_core_t *cu
|
||||
SYMBOL_VIDEOPROCESSOR(retro_get_region);
|
||||
SYMBOL_VIDEOPROCESSOR(retro_get_memory_data);
|
||||
SYMBOL_VIDEOPROCESSOR(retro_get_memory_size);
|
||||
#endif
|
||||
break;
|
||||
case CORE_TYPE_GONG:
|
||||
#ifdef HAVE_EASTEREGG
|
||||
SYMBOL_GONG(retro_init);
|
||||
SYMBOL_GONG(retro_deinit);
|
||||
|
||||
SYMBOL_GONG(retro_api_version);
|
||||
SYMBOL_GONG(retro_get_system_info);
|
||||
SYMBOL_GONG(retro_get_system_av_info);
|
||||
|
||||
SYMBOL_GONG(retro_set_environment);
|
||||
SYMBOL_GONG(retro_set_video_refresh);
|
||||
SYMBOL_GONG(retro_set_audio_sample);
|
||||
SYMBOL_GONG(retro_set_audio_sample_batch);
|
||||
SYMBOL_GONG(retro_set_input_poll);
|
||||
SYMBOL_GONG(retro_set_input_state);
|
||||
|
||||
SYMBOL_GONG(retro_set_controller_port_device);
|
||||
|
||||
SYMBOL_GONG(retro_reset);
|
||||
SYMBOL_GONG(retro_run);
|
||||
|
||||
SYMBOL_GONG(retro_serialize_size);
|
||||
SYMBOL_GONG(retro_serialize);
|
||||
SYMBOL_GONG(retro_unserialize);
|
||||
|
||||
SYMBOL_GONG(retro_cheat_reset);
|
||||
SYMBOL_GONG(retro_cheat_set);
|
||||
|
||||
SYMBOL_GONG(retro_load_game);
|
||||
SYMBOL_GONG(retro_load_game_special);
|
||||
|
||||
SYMBOL_GONG(retro_unload_game);
|
||||
SYMBOL_GONG(retro_get_region);
|
||||
SYMBOL_GONG(retro_get_memory_data);
|
||||
SYMBOL_GONG(retro_get_memory_size);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
@ -338,6 +338,31 @@ void fill_pathname_application_special(char *s,
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS:
|
||||
{
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
s1[0] = s2[0] = '\0';
|
||||
|
||||
fill_pathname_join(s1,
|
||||
settings->paths.directory_thumbnails,
|
||||
"discord",
|
||||
len);
|
||||
fill_pathname_join(s2,
|
||||
s1, "avatars",
|
||||
PATH_MAX_LENGTH * sizeof(char)
|
||||
);
|
||||
fill_pathname_slash(s2,
|
||||
PATH_MAX_LENGTH * sizeof(char)
|
||||
);
|
||||
strlcpy(s, s2, len);
|
||||
free(s1);
|
||||
free(s2);
|
||||
}
|
||||
break;
|
||||
|
||||
case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES:
|
||||
{
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
|
@ -111,7 +111,8 @@ enum application_special_type
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH,
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT,
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS,
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES,
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <ps4link.h>
|
||||
#include <orbisKeyboard.h>
|
||||
#include <debugnet.h>
|
||||
#include <orbisFile.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
@ -81,7 +82,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
sceSystemServiceHideSplashScreen();
|
||||
|
||||
|
||||
uintptr_t intptr=0;
|
||||
sscanf(argv[1],"%p",&intptr);
|
||||
myConf=(OrbisGlobalConf *)intptr;
|
||||
@ -107,13 +107,32 @@ static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
|
||||
#if defined(HAVE_LOGGER)
|
||||
logger_init();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
retro_main_log_file_init("host0:/temp/retroarch-log.txt");
|
||||
retro_main_log_file_init("host0:app/temp/retroarch-log.txt");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
strlcpy(eboot_path, "host0:/", sizeof(eboot_path));
|
||||
int ret;
|
||||
|
||||
sceSystemServiceHideSplashScreen();
|
||||
|
||||
|
||||
uintptr_t intptr=0;
|
||||
sscanf(argv[1],"%p",&intptr);
|
||||
argv[1] = NULL;
|
||||
myConf=(OrbisGlobalConf *)intptr;
|
||||
ret=ps4LinkInitWithConf(myConf->confLink);
|
||||
if(!ret)
|
||||
{
|
||||
ps4LinkFinish();
|
||||
return;
|
||||
}
|
||||
orbisFileInit();
|
||||
orbisPadInitWithConf(myConf->confPad);
|
||||
scePadClose(myConf->confPad->padHandle);
|
||||
|
||||
strlcpy(eboot_path, "host0:app", sizeof(eboot_path));
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_PORT], eboot_path, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
|
||||
strlcpy(user_path, "host0:/data/retroarch/", sizeof(user_path));
|
||||
strlcpy(user_path, "host0:app/data/retroarch/", sizeof(user_path));
|
||||
|
||||
RARCH_LOG("port dir: [%s]\n", g_defaults.dirs[DEFAULT_DIR_PORT]);
|
||||
|
||||
@ -160,7 +179,7 @@ static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
|
||||
params = (struct rarch_main_wrap*)params_data;
|
||||
params->verbose = true;
|
||||
|
||||
if (!string_is_empty(argv[1]))
|
||||
if (!string_is_empty(argv[2]))
|
||||
{
|
||||
static char path[PATH_MAX_LENGTH] = {0};
|
||||
struct rarch_main_wrap *args =
|
||||
@ -168,7 +187,7 @@ static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
|
||||
|
||||
if (args)
|
||||
{
|
||||
strlcpy(path, argv[1], sizeof(path));
|
||||
strlcpy(path, argv[2], sizeof(path));
|
||||
|
||||
args->touched = true;
|
||||
args->no_content = false;
|
||||
@ -183,7 +202,7 @@ static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
|
||||
RARCH_LOG("argv[1]: %s\n", argv[1]);
|
||||
RARCH_LOG("argv[2]: %s\n", argv[2]);
|
||||
|
||||
RARCH_LOG("Auto-start game %s.\n", argv[1]);
|
||||
RARCH_LOG("Auto-start game %s.\n", argv[2]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -215,7 +234,6 @@ static void frontend_orbis_shutdown(bool unused)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void frontend_orbis_init(void *data)
|
||||
{
|
||||
|
||||
@ -309,7 +327,7 @@ static int frontend_orbis_parse_drive_list(void *data, bool load_content)
|
||||
MSG_UNKNOWN;
|
||||
|
||||
menu_entries_append_enum(list,
|
||||
"app0",
|
||||
"host0:app",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
|
@ -23,9 +23,8 @@
|
||||
#include <sifrpc.h>
|
||||
#include <iopcontrol.h>
|
||||
#include <libpwroff.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <audsrv.h>
|
||||
|
||||
#include <libpad.h>
|
||||
|
||||
enum BootDeviceIDs{
|
||||
BOOT_DEVICE_UNKNOWN = -1,
|
||||
@ -361,14 +360,16 @@ static void frontend_ps2_init(void *data)
|
||||
SifExecModuleBuffer(freesd_irx_start, freesd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(audsrv_irx_start, audsrv_irx_size, 0, NULL, NULL);
|
||||
|
||||
SDL_Init(SDL_INIT_TIMER);
|
||||
|
||||
/* Initializes audsrv library */
|
||||
if (audsrv_init())
|
||||
{
|
||||
if (audsrv_init()) {
|
||||
RARCH_ERR("audsrv library not initalizated\n");
|
||||
}
|
||||
|
||||
/* Initializes pad library
|
||||
Must be init with 0 as parameter*/
|
||||
if (padInit(0) != 1) {
|
||||
RARCH_ERR("padInit library not initalizated\n");
|
||||
}
|
||||
|
||||
#if defined(HAVE_FILE_LOGGER)
|
||||
retro_main_log_file_init("retroarch.log");
|
||||
@ -386,6 +387,10 @@ static void frontend_ps2_deinit(void *data)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
padEnd();
|
||||
audsrv_quit();
|
||||
|
||||
fileXioUmount("pfs0:");
|
||||
fileXioExit();
|
||||
|
||||
|
@ -656,7 +656,6 @@ static void frontend_switch_shutdown(bool unused)
|
||||
/* runloop_get_system_info isnt initialized that early.. */
|
||||
extern void retro_get_system_info(struct retro_system_info *info);
|
||||
|
||||
|
||||
static void frontend_switch_init(void *data)
|
||||
{
|
||||
|
||||
|
@ -1824,7 +1824,6 @@ static void frontend_unix_get_env(int *argc,
|
||||
else if (strstr(device_model, "JSS15J"))
|
||||
g_defaults.settings.video_refresh_rate = 59.65;
|
||||
|
||||
|
||||
/* For gamepad-like/console devices:
|
||||
*
|
||||
* - Explicitly disable input overlay by default
|
||||
|
@ -104,7 +104,6 @@ struct android_app
|
||||
* receive user input events. */
|
||||
AInputQueue* inputQueue;
|
||||
|
||||
|
||||
/* When non-NULL, this is the window surface that the app can draw in. */
|
||||
ANativeWindow* window;
|
||||
|
||||
@ -165,7 +164,6 @@ struct android_app
|
||||
jmethodID setSustainedPerformanceMode;
|
||||
};
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
LOOPER_ID_MAIN = 1,
|
||||
|
@ -86,7 +86,6 @@ static void frontend_uwp_get_os(char *s, size_t len, int *major, int *minor)
|
||||
GetVersionEx(&vi);
|
||||
#endif
|
||||
|
||||
|
||||
if (major)
|
||||
*major = vi.dwMajorVersion;
|
||||
|
||||
|
@ -133,7 +133,6 @@ static void frontend_wiiu_init(void *data)
|
||||
DEBUG_LINE();
|
||||
}
|
||||
|
||||
|
||||
static int frontend_wiiu_get_rating(void)
|
||||
{
|
||||
return 10;
|
||||
@ -168,7 +167,6 @@ static int frontend_wiiu_parse_drive_list(void *data, bool load_content)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void frontend_wiiu_exec(const char *path, bool should_load_game)
|
||||
{
|
||||
|
||||
@ -269,7 +267,6 @@ static void frontend_wiiu_exitspawn(char *s, size_t len)
|
||||
frontend_wiiu_exec(s, should_load_game);
|
||||
}
|
||||
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_wiiu =
|
||||
{
|
||||
frontend_wiiu_get_environment_settings,
|
||||
|
@ -191,7 +191,6 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
|
||||
GetVersionEx(&vi);
|
||||
#endif
|
||||
|
||||
|
||||
if (major)
|
||||
*major = vi.dwMajorVersion;
|
||||
|
||||
|
@ -161,7 +161,6 @@ int rarch_main(int argc, char *argv[], void *data)
|
||||
}
|
||||
|
||||
#ifndef HAVE_MAIN
|
||||
#ifndef ORBIS
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
@ -170,4 +169,3 @@ int main(int argc, char *argv[])
|
||||
return rarch_main(argc, argv, NULL);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -85,6 +85,9 @@ static frontend_ctx_driver_t *frontend_ctx_drivers[] = {
|
||||
#endif
|
||||
#ifdef SWITCH
|
||||
&frontend_ctx_switch,
|
||||
#endif
|
||||
#if defined(ORBIS)
|
||||
&frontend_ctx_orbis,
|
||||
#endif
|
||||
&frontend_ctx_null,
|
||||
NULL
|
||||
|
@ -129,6 +129,7 @@ extern frontend_ctx_driver_t frontend_ctx_xenon;
|
||||
extern frontend_ctx_driver_t frontend_ctx_emscripten;
|
||||
extern frontend_ctx_driver_t frontend_ctx_dos;
|
||||
extern frontend_ctx_driver_t frontend_ctx_switch;
|
||||
extern frontend_ctx_driver_t frontend_ctx_orbis;
|
||||
extern frontend_ctx_driver_t frontend_ctx_null;
|
||||
|
||||
/**
|
||||
|
@ -162,7 +162,7 @@ static void salamander_init(char *s, size_t len)
|
||||
if (conf)
|
||||
{
|
||||
config_set_string(conf, "libretro_path", s);
|
||||
config_file_write(conf, g_defaults.path.config);
|
||||
config_file_write(conf, g_defaults.path.config, true);
|
||||
config_file_free(conf);
|
||||
}
|
||||
}
|
||||
|
@ -138,5 +138,4 @@ static INLINE void ctr_set_scale_vector(ctr_scale_vector_t* vec,
|
||||
vec->v = -1.0 / texture_height;
|
||||
}
|
||||
|
||||
|
||||
#endif // CTR_COMMON_H__
|
||||
|
@ -54,7 +54,6 @@ typedef ID3D10Debug* D3D10Debug;
|
||||
typedef ID3D10SwitchToRef* D3D10SwitchToRef;
|
||||
typedef ID3D10InfoQueue* D3D10InfoQueue;
|
||||
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
static INLINE void D3D10SetResourceEvictionPriority(D3D10Resource resource, UINT eviction_priority)
|
||||
{
|
||||
|
@ -75,7 +75,6 @@ typedef HRESULT (__stdcall
|
||||
LPD3DXFONT* ppFont);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_D3DX
|
||||
static D3DXCreateFontIndirect_t D3DCreateFontIndirect;
|
||||
static D3DCreateTextureFromFile_t D3DCreateTextureFromFile;
|
||||
|
@ -99,7 +99,6 @@ typedef HRESULT (__stdcall
|
||||
LPD3DXFONT* ppFont);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_D3DX
|
||||
static D3D9XCreateFontIndirect_t D3D9CreateFontIndirect;
|
||||
static D3D9CreateTextureFromFile_t D3D9CreateTextureFromFile;
|
||||
|
@ -36,7 +36,6 @@ void *d3d_matrix_transpose(void *_pout, const void *_pm)
|
||||
return pout;
|
||||
}
|
||||
|
||||
|
||||
void *d3d_matrix_identity(void *_pout)
|
||||
{
|
||||
struct d3d_matrix *pout = (struct d3d_matrix*)_pout;
|
||||
|
@ -54,7 +54,6 @@ struct d3d_matrix
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
typedef struct d3d_texture
|
||||
{
|
||||
void *data;
|
||||
|
@ -419,7 +419,12 @@ bool egl_create_context(egl_ctx_data_t *egl, const EGLint *egl_attribs)
|
||||
|
||||
bool egl_create_surface(egl_ctx_data_t *egl, void *native_window)
|
||||
{
|
||||
egl->surf = eglCreateWindowSurface(egl->dpy, egl->config, (NativeWindowType)native_window, NULL);
|
||||
EGLint window_attribs[] = {
|
||||
EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
egl->surf = eglCreateWindowSurface(egl->dpy, egl->config, (NativeWindowType)native_window, window_attribs);
|
||||
|
||||
if (egl->surf == EGL_NO_SURFACE)
|
||||
return false;
|
||||
|
@ -44,7 +44,6 @@ extern MTLPixelFormat SelectOptimalPixelFormat(MTLPixelFormat fmt);
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface MetalMenu : NSObject
|
||||
|
||||
@property (nonatomic, readonly) bool hasFrame;
|
||||
@ -59,7 +58,6 @@ extern MTLPixelFormat SelectOptimalPixelFormat(MTLPixelFormat fmt);
|
||||
filter:(RTextureFilter)filter;
|
||||
@end
|
||||
|
||||
|
||||
@interface Overlay : NSObject
|
||||
@property (nonatomic, readwrite) bool enabled;
|
||||
@property (nonatomic, readwrite) bool fullscreen;
|
||||
|
@ -264,7 +264,6 @@ void vulkan_buffer_chain_free(
|
||||
VkDevice device,
|
||||
struct vk_buffer_chain *chain);
|
||||
|
||||
|
||||
struct vk_descriptor_pool
|
||||
{
|
||||
VkDescriptorPool pool;
|
||||
@ -444,7 +443,6 @@ uint32_t vulkan_find_memory_type_fallback(
|
||||
uint32_t device_reqs, uint32_t host_reqs_first,
|
||||
uint32_t host_reqs_second);
|
||||
|
||||
|
||||
struct vk_texture vulkan_create_texture(vk_t *vk,
|
||||
struct vk_texture *old,
|
||||
unsigned width, unsigned height,
|
||||
|
@ -37,7 +37,6 @@ typedef struct
|
||||
int16_t y;
|
||||
} wayland_touch_data_t;
|
||||
|
||||
|
||||
typedef struct input_ctx_wayland_data
|
||||
{
|
||||
/* Wayland uses Linux keysyms. */
|
||||
|
@ -180,8 +180,6 @@ typedef struct DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM {
|
||||
UINT32 statusFlags;
|
||||
} DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM;
|
||||
|
||||
|
||||
|
||||
typedef struct DISPLAYCONFIG_PATH_INFO_CUSTOM {
|
||||
DISPLAYCONFIG_PATH_SOURCE_INFO_CUSTOM sourceInfo;
|
||||
DISPLAYCONFIG_PATH_TARGET_INFO_CUSTOM targetInfo;
|
||||
@ -345,7 +343,6 @@ INT_PTR_COMPAT CALLBACK PickCoreProc(HWND hDlg, UINT message,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static BOOL CALLBACK win32_monitor_enum_proc(HMONITOR hMonitor,
|
||||
HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
||||
{
|
||||
@ -353,7 +350,6 @@ static BOOL CALLBACK win32_monitor_enum_proc(HMONITOR hMonitor,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void win32_monitor_from_window(void)
|
||||
{
|
||||
#ifndef _XBOX
|
||||
@ -593,11 +589,13 @@ static LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message,
|
||||
keysym = (unsigned)wparam;
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_DINPUT
|
||||
{
|
||||
/* extended keys will map to dinput if the high bit is set */
|
||||
if (input_get_ptr() == &input_dinput && (lparam >> 24 & 0x1))
|
||||
keysym |= 0x80;
|
||||
}
|
||||
#endif
|
||||
/* Key released? */
|
||||
if (message == WM_KEYUP || message == WM_SYSKEYUP)
|
||||
keydown = false;
|
||||
@ -1335,7 +1333,6 @@ bool win32_set_video_mode(void *data,
|
||||
&mon_rect, width, height, fullscreen))
|
||||
return false;
|
||||
|
||||
|
||||
win32_set_window(&width, &height,
|
||||
fullscreen, windowed_full, &rect);
|
||||
|
||||
|
@ -55,7 +55,6 @@
|
||||
#define MOVERESIZE_X_SHIFT 8
|
||||
#define MOVERESIZE_Y_SHIFT 9
|
||||
|
||||
|
||||
static XF86VidModeModeInfo desktop_mode;
|
||||
static bool xdg_screensaver_available = true;
|
||||
bool g_x11_entered = false;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user