mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Merge branch 'master' into runtime_rcheevos_switch
This commit is contained in:
commit
c2364096f3
9
.gitignore
vendored
9
.gitignore
vendored
@ -62,7 +62,6 @@ apple/RetroArch_iOS.xcodeproj/project.xcworkspace/*
|
||||
/freetype2/
|
||||
/ft2build.h
|
||||
/iconv.h
|
||||
/libxml2/
|
||||
/phoenix/
|
||||
/python/
|
||||
/rsound.h
|
||||
@ -77,6 +76,10 @@ convert_rumble.awk
|
||||
*~
|
||||
assets
|
||||
info
|
||||
content_image_history.lpl
|
||||
saves
|
||||
screenshots
|
||||
|
||||
|
||||
# Wii U
|
||||
*.depend
|
||||
@ -165,6 +168,10 @@ retroarch_switch.nacp
|
||||
retroarch_switch.nro
|
||||
retroarch_switch.nso
|
||||
|
||||
# PS2
|
||||
ps2/irx/*.c
|
||||
ps2/libcdvd/lib/
|
||||
|
||||
# Wayland
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.c
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.h
|
||||
|
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -66,7 +66,9 @@
|
||||
"xutility": "c",
|
||||
"menu_input_dialog.h": "c",
|
||||
"menu_filebrowser.h": "c",
|
||||
"ozone_sidebar.h": "c"
|
||||
"ozone_sidebar.h": "c",
|
||||
"menu_thumbnail_path.h": "c",
|
||||
"badges.h": "c"
|
||||
},
|
||||
"C_Cpp.dimInactiveRegions": false,
|
||||
}
|
39
CHANGES.md
39
CHANGES.md
@ -1,11 +1,14 @@
|
||||
# 1.7.7 (future)
|
||||
- 3DS: Add unique IDs to prevent cores overwriting each other.
|
||||
- 3DS: Fix screen tearing when running 50Hz content.
|
||||
- ANDROID: We now target API level 26 (minimum is still API level 9).
|
||||
- ANDROID: Add option to vibrate on touch (works in menu or overlay).
|
||||
- ANDROID: Add device vibration option for cores that support rumble.
|
||||
- ANDROID: Add gamepad vibration support for cores that support rumble.
|
||||
- ANDROID: Allow stylus/pen to move mouse without pressing down.
|
||||
- AUDIO: Avoid deadlocks in certain audio drivers when toggling menu sounds on.
|
||||
- BLISS-BOX: Support PSX Jogcon (requires firmware 3.0).
|
||||
- CHEEVOS: Fix crash when reading memory that is out of range.
|
||||
- CRT: Dynamic super resolution support.
|
||||
- DISCORD: Fix potential crash when username is empty and discord is disabled.
|
||||
- DISCORD: Ask to join support for Linux.
|
||||
@ -21,13 +24,30 @@
|
||||
- COMMON: Show CPU model name in log.
|
||||
- COMMON: Add "Help -> Send Debug Info" option (and F10 hotkey) to send diagnostic info to the RetroArch team for help with problems.
|
||||
- COMMON: Show GPU device name/version in log.
|
||||
- COMMON: Add menu option to write log info to a file.
|
||||
- COMMON: Add subsystem support for playlists. Subsystem info is automatically saved to the history playlist for easy relaunching.
|
||||
- GL: Add new "gl1" OpenGL 1.1 compliant video driver for legacy GPUs and software renderers
|
||||
- GL: Draw OSD on top of overlay.
|
||||
- GL: Add a new "glcore" driver with slang support (requires GL 3.2+ or GLES3).
|
||||
- GONG: Add savestate support.
|
||||
- GONG: Add video refresh rate core options.
|
||||
- GONG: Two player support via core option.
|
||||
- GUI: Fix text alignment when using stb_unicode.
|
||||
- GUI: Fix text display issues when using Japanese (and other unicode-dependent language) text with stb_unicode.
|
||||
- GUI: Set language on first startup to the user's preferred OS language (Windows, *nix and Android).
|
||||
- INPUT: Add (scaled radial) analog deadzone and sensitivity options.
|
||||
- LIBRETRO: Add Turkish language support.
|
||||
- LIBRETRO: Allow non-accelerated video to rotate the display.
|
||||
- LOCALIZATION: Update Chinese (Simplified) translation.
|
||||
- LOCALIZATION: Update Chinese (Traditional) translation.
|
||||
- LOCALIZATION: Update Dutch translation.
|
||||
- LOCALIZATION: Update French translation.
|
||||
- LOCALIZATION: Update German translation.
|
||||
- LOCALIZATION: Update Japanese translation.
|
||||
- LOCALIZATION: Update Polish translation.
|
||||
- LOCALIZATION: Update Russian translation.
|
||||
- LOCALIZATION: Update Spanish translation.
|
||||
- LOCALIZATION: Add new Turkish translation.
|
||||
- MIDI: Fix startup crash in midi driver.
|
||||
- MENU: Add memory statistics support to more context drivers.
|
||||
- MENU: Enable ozone driver for UWP builds.
|
||||
@ -40,12 +60,15 @@
|
||||
- MENU: Enable "Add to Favorites" without loading a core.
|
||||
- MENU: Allow core name to be hidden on history/favorites playlists.
|
||||
- MENU: Populate crc32 and db_name fields when adding history/favourites playlist entries.
|
||||
- MENU: Fix TTF files not showing in OSD/menu font selection screen.
|
||||
- MENU: Fix audio/video filters not showing in file browser.
|
||||
- MENU/GLUI: Add subsystem support.
|
||||
- MENU/OZONE: Add mouse support on entries (no sidebar yet).
|
||||
- MENU/OZONE: Allow collapsing the sidebar.
|
||||
- MENU/OZONE: Add thumbnail support.
|
||||
- MENU/QT: Add git version and build date to Help->About window.
|
||||
- MENU/QT: Fix content loading via the file browser.
|
||||
- MENU/QT/WIMP: Add git version and build date to Help->About window.
|
||||
- MENU/QT/WIMP: Fix content loading via the file browser.
|
||||
- MENU/QT/WIMP: Add new settings window to control all RetroArch settings.
|
||||
- MENU/RGUI: Improve playlist titles.
|
||||
- MENU/RGUI: Add option to hide associated cores in playlists.
|
||||
- MENU/RGUI: Add internal upscaling option.
|
||||
@ -57,6 +80,14 @@
|
||||
- MENU/RGUI: Add "full width" layout option.
|
||||
- MENU/RGUI: Ensure menu color theme is applied immediately.
|
||||
- MENU/RGUI: Fix "Lock Menu Aspect Ratio" option when using custom viewports.
|
||||
- MENU/RGUI: Add widescreen support.
|
||||
- MENU/RGUI: Allow text to be centred when selecting widescreen layouts.
|
||||
- MENU/RGUI: Add inline playlist thumbnail support.
|
||||
- MENU/RGUI: Add optional shadow effects.
|
||||
- MENU/RGUI: Performance optimizations.
|
||||
- MENU/RGUI: Add optional extended ASCII support.
|
||||
- MENU/RGUI: Add optional delay when loading thumbnails.
|
||||
- MENU/RGUI: Add on-screen keyboard.
|
||||
- MENU/XMB: Prevent crashes when resizing to a tiny window.
|
||||
- NETPLAY: Fix stall-out causing total disconnection with >2 players.
|
||||
- NETPLAY: Different (more intuitive?) default netplay share policy.
|
||||
@ -65,12 +96,16 @@
|
||||
- OSX: Prevent crash on exit.
|
||||
- OSX: Metal is now the default video driver.
|
||||
- OSX: Enable CoreAudio v3 driver for Metal.
|
||||
- PS2: CDFS support.
|
||||
- PS2: Implemented analog support for ps2 controllers.
|
||||
- PS2: Fix audio freeze after restarting core.
|
||||
- PS2: Fix issues with load state and the font driver.
|
||||
- PS2: File I/O now works for USB and network host.
|
||||
- PS2: Support cores with extra padding in their frame buffers.
|
||||
- SHADERS: Don't alphabetize shader presets.
|
||||
- SWITCH: Add rumble support.
|
||||
- SWITCH: Add USB keyboard support.
|
||||
- VITA: Add bluetooth mouse and keyboard support.
|
||||
- VULKAN: Fix color issues with RGBA8888 swapchains in readback (screenshots).
|
||||
- WII: Don't init overlay when RAM is beyond 72MB.
|
||||
- WII: Skip CRC calculation on content load, can improve load times of larger games by several seconds.
|
||||
|
@ -102,9 +102,9 @@ ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETLOGGER), 1)
|
||||
DEF_FLAGS += -DHAVE_LOGGER
|
||||
DEFINES += -DHAVE_LOGGER
|
||||
OBJ += network/net_logger.o
|
||||
DEF_FLAGS += -DHAVE_LOGGER
|
||||
DEFINES += -DHAVE_LOGGER
|
||||
OBJ += network/net_logger.o
|
||||
endif
|
||||
|
||||
# System
|
||||
@ -309,7 +309,8 @@ ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
intl/msg_hash_chs.o \
|
||||
intl/msg_hash_cht.o \
|
||||
intl/msg_hash_ar.o \
|
||||
intl/msg_hash_el.o
|
||||
intl/msg_hash_el.o \
|
||||
intl/msg_hash_tr.o
|
||||
endif
|
||||
|
||||
ifneq ($(HAVE_GETOPT_LONG), 1)
|
||||
@ -357,6 +358,27 @@ ifeq ($(HAVE_QT), 1)
|
||||
ui/drivers/qt/thumbnaildownload.o \
|
||||
ui/drivers/qt/thumbnailpackdownload.o \
|
||||
ui/drivers/qt/playlistthumbnaildownload.o
|
||||
ifeq ($(HAVE_MENU), 1)
|
||||
OBJ += ui/drivers/qt/settingswidgets.o \
|
||||
ui/drivers/qt/options/achievements.o \
|
||||
ui/drivers/qt/options/audio.o \
|
||||
ui/drivers/qt/options/configuration.o \
|
||||
ui/drivers/qt/options/core.o \
|
||||
ui/drivers/qt/options/directory.o \
|
||||
ui/drivers/qt/options/drivers.o \
|
||||
ui/drivers/qt/options/input.o \
|
||||
ui/drivers/qt/options/latency.o \
|
||||
ui/drivers/qt/options/logging.o \
|
||||
ui/drivers/qt/options/network.o \
|
||||
ui/drivers/qt/options/osd.o \
|
||||
ui/drivers/qt/options/playlists.o \
|
||||
ui/drivers/qt/options/recording.o \
|
||||
ui/drivers/qt/options/saving.o \
|
||||
ui/drivers/qt/options/throttle.o \
|
||||
ui/drivers/qt/options/ui.o \
|
||||
ui/drivers/qt/options/user.o \
|
||||
ui/drivers/qt/options/video.o
|
||||
endif
|
||||
|
||||
MOC_HEADERS += ui/drivers/ui_qt.h \
|
||||
ui/drivers/qt/ui_qt_load_core_window.h \
|
||||
@ -367,6 +389,10 @@ ifeq ($(HAVE_QT), 1)
|
||||
ui/drivers/qt/coreinfodialog.h \
|
||||
ui/drivers/qt/playlistentrydialog.h \
|
||||
ui/drivers/qt/viewoptionsdialog.h
|
||||
ifeq ($(HAVE_MENU), 1)
|
||||
MOC_HEADERS += ui/drivers/qt/settingswidgets.h \
|
||||
ui/drivers/qt/options/options.h
|
||||
endif
|
||||
|
||||
DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS) -DHAVE_MAIN
|
||||
#DEFINES += $(QT5WEBENGINE_CFLAGS)
|
||||
@ -519,16 +545,16 @@ endif
|
||||
|
||||
ifeq ($(HAVE_COREAUDIO), 1)
|
||||
OBJ += audio/drivers/coreaudio.o
|
||||
HAVE_COREAUDIO_LIBS = 1
|
||||
HAVE_COREAUDIO_LIBS = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COREAUDIO3), 1)
|
||||
OBJ += audio/drivers/coreaudio3.o
|
||||
HAVE_COREAUDIO_LIBS = 1
|
||||
HAVE_COREAUDIO_LIBS = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COREAUDIO_LIBS), 1)
|
||||
LIBS += -framework CoreServices -framework CoreAudio -framework AudioUnit
|
||||
LIBS += -framework CoreServices -framework CoreAudio -framework AudioUnit
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CORETEXT), 1)
|
||||
@ -792,11 +818,12 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/menu_displaylist.o \
|
||||
menu/menu_animation.o \
|
||||
menu/drivers/menu_generic.o \
|
||||
menu/drivers/null.o
|
||||
menu/drivers/null.o \
|
||||
menu/menu_thumbnail_path.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON),1)
|
||||
OBJ += menu/drivers_display/menu_display_null.o
|
||||
endif
|
||||
OBJ += menu/drivers_display/menu_display_null.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MENU_WIDGETS), 1)
|
||||
OBJ += menu/widgets/menu_widgets.o
|
||||
@ -806,8 +833,8 @@ endif
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
DEFINES += -DHAVE_OVERLAY
|
||||
OBJ += tasks/task_overlay.o \
|
||||
input/input_overlay.o \
|
||||
led/drivers/led_overlay.o
|
||||
input/input_overlay.o \
|
||||
led/drivers/led_overlay.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
@ -824,6 +851,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/rsemaphore.o \
|
||||
gfx/video_thread_wrapper.o \
|
||||
audio/audio_thread_wrapper.o
|
||||
DEFINES += -DHAVE_THREADS
|
||||
@ -894,11 +922,11 @@ endif
|
||||
|
||||
ifeq ($(HAVE_WAYLAND), 1)
|
||||
OBJ += gfx/drivers_context/wayland_ctx.o \
|
||||
input/drivers/wayland_input.o \
|
||||
gfx/common/wayland/xdg-shell.o \
|
||||
gfx/common/wayland/xdg-shell-unstable-v6.o \
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.o \
|
||||
gfx/common/wayland/xdg-decoration-unstable-v1.o
|
||||
input/drivers/wayland_input.o \
|
||||
gfx/common/wayland/xdg-shell.o \
|
||||
gfx/common/wayland/xdg-shell-unstable-v6.o \
|
||||
gfx/common/wayland/idle-inhibit-unstable-v1.o \
|
||||
gfx/common/wayland/xdg-decoration-unstable-v1.o
|
||||
ifeq ($(HAVE_EGL), 1)
|
||||
LIBS += $(EGL_LIBS)
|
||||
endif
|
||||
@ -1173,7 +1201,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
OBJ += gfx/drivers_context/cgl_ctx.o
|
||||
else ifneq ($(findstring Win32,$(OS)),)
|
||||
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32
|
||||
WANT_WGL=1
|
||||
WANT_WGL=1
|
||||
endif
|
||||
LIBS += $(GL_LIBS)
|
||||
endif
|
||||
@ -1346,8 +1374,8 @@ ifeq ($(HAVE_D3D11), 1)
|
||||
gfx/common/d3d11_common.o \
|
||||
gfx/drivers_font/d3d11_font.o
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_d3d11.o
|
||||
endif
|
||||
OBJ += menu/drivers_display/menu_display_d3d11.o
|
||||
endif
|
||||
DEFINES += -DHAVE_D3D11
|
||||
HAVE_SLANG = 1
|
||||
HAVE_GLSLANG = 1
|
||||
@ -1473,13 +1501,6 @@ ifeq ($(WANT_WGL), 1)
|
||||
LIBS += -lcomctl32
|
||||
endif
|
||||
|
||||
#ifeq ($(HAVE_LIBXML2), 1)
|
||||
#LIBS += $(LIBXML2_LIBS)
|
||||
#DEFINES += $(LIBXML2_CFLAGS)
|
||||
#else
|
||||
#OBJ += $(LIBRETRO_COMM_DIR)/formats/xml/rxml.o
|
||||
#endif
|
||||
|
||||
# Compression/Archive
|
||||
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file.o \
|
||||
@ -1616,6 +1637,7 @@ endif
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/bmp/rbmp_encode.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax_full.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/xml/rxml.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/image_transfer.o
|
||||
|
||||
ifdef HAVE_COMPRESSION
|
||||
@ -1674,8 +1696,8 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
endif
|
||||
|
||||
# Netplay
|
||||
DEFINES += -DHAVE_NETWORK_CMD
|
||||
OBJ += network/netplay/netplay_delta.o \
|
||||
DEFINES += -DHAVE_NETWORK_CMD
|
||||
OBJ += network/netplay/netplay_delta.o \
|
||||
network/netplay/netplay_frontend.o \
|
||||
network/netplay/netplay_handshake.o \
|
||||
network/netplay/netplay_init.o \
|
||||
@ -1823,8 +1845,8 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
gfx/display_servers/dispserv_win32.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_gdi.o
|
||||
endif
|
||||
OBJ += menu/drivers_display/menu_display_gdi.o
|
||||
endif
|
||||
LIBS += -lmsimg32 -lhid -lsetupapi
|
||||
endif
|
||||
|
||||
|
@ -271,7 +271,7 @@ else ifeq ($(platform), vita)
|
||||
PLATCFLAGS := -mfloat-abi=hard -fsingle-precision-constant \
|
||||
-mword-relocations -fno-unwind-tables -fno-asynchronous-unwind-tables -ftree-vectorize -fno-optimize-sibling-calls
|
||||
LIBS += -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceTouch_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceTouch_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lSceMotion_stub -lSceAppMgr_stub -lpng -lm -lc
|
||||
|
||||
|
46
Makefile.ps2
46
Makefile.ps2
@ -5,16 +5,19 @@ HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_THREADS = 0
|
||||
BIG_STACK = 0
|
||||
MUTE_WARNINGS = 0
|
||||
MUTE_WARNINGS = 1
|
||||
PS2_IP = 192.168.1.150
|
||||
|
||||
#Configuration for IRX
|
||||
EE_BIN2O = bin2o
|
||||
IRX_DIR = $(PS2SDK)/iop/irx
|
||||
|
||||
TARGET = retroarchps2.elf
|
||||
TARGET_RELEASE = retroarchps2-release.elf
|
||||
|
||||
# Lib CDVD
|
||||
CDVD_DIR = ps2/libcdvd
|
||||
|
||||
# Compile the IRXs first
|
||||
IRX_DIR = ps2/irx
|
||||
IRX_FILES = $(wildcard ps2/irx/*.c)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_LV := -O0 -g
|
||||
RARCH_DEFINES += -DDEBUG
|
||||
@ -27,7 +30,7 @@ ifeq ($(MUTE_WARNINGS), 1)
|
||||
DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses
|
||||
endif
|
||||
|
||||
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
|
||||
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include -I$(CDVD_DIR)/ee
|
||||
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
|
||||
@ -38,14 +41,10 @@ RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHA
|
||||
RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L.
|
||||
LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lmf -lpad -lmc -lhdd -lsdl -lfileXio -lpatches -lpoweroff
|
||||
LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L$(CDVD_DIR)/lib -L.
|
||||
LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lmf -lpadx -lmtap -lmc -lhdd -lsdl -lfileXio
|
||||
LIBS += -lcdvdfs -lpatches -lpoweroff
|
||||
|
||||
#IRX modules
|
||||
# IRX modules - modules have to be in IRX_DIR
|
||||
IRX = iomanX.irx fileXio.irx mcman.irx mcserv.irx usbd.irx usbhdfsd.irx freesd.irx audsrv.irx poweroff.irx ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx
|
||||
IRX_OBJ = $(IRX:.irx=.o)
|
||||
EE_OBJS += $(IRX_OBJ)
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
@ -65,8 +64,15 @@ endif
|
||||
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
# All the IRX objects
|
||||
EE_OBJS += $(IRX_DIR)/freemtap_irx.o $(IRX_DIR)/freepad_irx.o $(IRX_DIR)/freesio2_irx.o $(IRX_DIR)/iomanX_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/fileXio_irx.o $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o $(IRX_DIR)/usbd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/usbhdfsd_irx.o $(IRX_DIR)/freesd_irx.o $(IRX_DIR)/audsrv_irx.o $(IRX_DIR)/poweroff_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/cdvd_irx.o
|
||||
|
||||
# Missing objecst on the PS2SDK
|
||||
EE_OBJS += ps2/compat_files/compat_ctype.o ps2/compat_files/time.o ps2/compat_files/ps2_devices.o
|
||||
EE_OBJS += ps2/compat_files/compat_ctype.o ps2/compat_files/time.o ps2/compat_files/ps2_devices.o
|
||||
EE_OBJS += ps2/compat_files/fileXio_cdvd.o ps2/compat_files/ps2_descriptor.o
|
||||
|
||||
#EE_OBJS = griffin/griffin.o bootstrap/ps2/kernel_functions.o
|
||||
EE_OBJS += griffin/griffin.o
|
||||
@ -77,14 +83,18 @@ EE_LDFLAGS = $(LDFLAGS)
|
||||
EE_LIBS = $(LIBS)
|
||||
EE_ASFLAGS = $(ASFLAGS)
|
||||
EE_INCS = $(INCDIR)
|
||||
EE_IRX_OBJ = $(IRX_OBJ)
|
||||
EE_BIN = $(TARGET)
|
||||
EE_GPVAL = $(GPVAL)
|
||||
|
||||
all: $(EE_IRX_OBJ) $(EE_BIN)
|
||||
|
||||
all: irxdir $(EE_BIN)
|
||||
|
||||
irxdir:
|
||||
$(MAKE) -C $(IRX_DIR)
|
||||
|
||||
clean:
|
||||
rm -f $(EE_BIN) $(EE_OBJS)
|
||||
$(MAKE) -C $(IRX_DIR) clean
|
||||
|
||||
prepare:
|
||||
ps2client -h $(PS2_IP) reset
|
||||
@ -100,10 +110,6 @@ package:
|
||||
|
||||
release: clean all package
|
||||
|
||||
#Specific file name and output per IRX Module
|
||||
$(EE_IRX_OBJ):
|
||||
$(EE_BIN2O) $(EE_GPVAL) $(IRX_DIR)/$(@:.o=.irx) $@ $(@:.o=_irx)
|
||||
|
||||
#Include preferences
|
||||
include $(PS2SDK)/samples/Makefile.pref
|
||||
include $(PS2SDK)/samples/Makefile.eeglobal
|
||||
|
@ -116,7 +116,7 @@ endif
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
|
||||
VITA_LIBS := -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub \
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceTouch_stub -lSceAudio_stub \
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceTouch_stub -lSceAudio_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lpthread -lpng -lz
|
||||
|
||||
|
@ -22,7 +22,7 @@ RARCH_DEFINES = -DVITA -DIS_SALAMANDER -DRARCH_CONSOLE
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lSceMotion_stub -lSceAppMgr_stub -lfreetype -lpng -lm -lc
|
||||
|
||||
|
@ -32,7 +32,6 @@ HAVE_FREETYPE := 1
|
||||
HAVE_FFMPEG := 0
|
||||
|
||||
HAVE_CG := 1
|
||||
HAVE_LIBXML2 := 0
|
||||
HAVE_ZLIB := 1
|
||||
WANT_ZLIB := 1
|
||||
HAVE_CC_RESAMPLER := 1
|
||||
@ -46,11 +45,6 @@ FREETYPE_CFLAGS := -DHAVE_FREETYPE -Ifreetype2
|
||||
FREETYPE_LIBS := -lfreetype
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBXML2), 1)
|
||||
LIBXML2_CFLAGS := -Ilibxml2 -DHAVE_LIBXML2 -DHAVE_GLSL
|
||||
LIBXML2_LIBS := -lxml2 -liconv
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SDL), 1)
|
||||
SDL_LIBS := -lSDL
|
||||
SDL_CFLAGS := -ISDL -DHAVE_SDL
|
||||
|
@ -80,7 +80,7 @@ To enable mali_fbdev you must configure RetroArch with --enable-gles and --enabl
|
||||
|
||||
This is an example of what you would use on a CubieBoard2 for a lightweight RetroArch:
|
||||
|
||||
./configure --enable-gles --enable-mali_fbdev --disable-x11 --disable-sdl2 --enable-floathard --disable-ffmpeg --disable-netplay --enable-udev --disable-sdl --disable-pulse --disable-oss --disable-freetype --disable-7zip --disable-libxml2
|
||||
./configure --enable-gles --enable-mali_fbdev --disable-x11 --disable-sdl2 --enable-floathard --disable-ffmpeg --disable-netplay --enable-udev --disable-sdl --disable-pulse --disable-oss --disable-freetype --disable-7zip
|
||||
|
||||
NOTE: A TTY hack is used to auto-clean the console on exit, and the fbdev ioctls are used to retrieve
|
||||
current video mode. Both things work good, but they are not exactly ideal solutions.
|
||||
|
@ -105,7 +105,6 @@ OSX port of RetroArch requires latest versions of XCode to build.
|
||||
RetroArch can utilize these libraries if enabled:
|
||||
|
||||
- nvidia-cg-toolkit
|
||||
- libxml2 (GLSL XML shaders)
|
||||
- libfreetype2 (TTF font rendering on screen)
|
||||
|
||||
RetroArch needs at least one of these audio driver libraries:
|
||||
|
@ -89,7 +89,7 @@ static void rb_init(ringbuffer_h r, size_t cap)
|
||||
static void rb_free(ringbuffer_h r)
|
||||
{
|
||||
free(r->buffer);
|
||||
bzero(r, sizeof(*r));
|
||||
memset(r, 0, sizeof(*r));
|
||||
}
|
||||
|
||||
#define UNLIKELY(x) __builtin_expect((x), 0)
|
||||
@ -115,9 +115,10 @@ static void rb_write_data(ringbuffer_h r, const float *data, size_t len)
|
||||
rb_len_add(r, (int)n);
|
||||
}
|
||||
|
||||
static void rb_read_data(ringbuffer_h r, float *d0, float *d1, size_t len)
|
||||
static void rb_read_data(ringbuffer_h r,
|
||||
float *d0, float *d1, size_t len)
|
||||
{
|
||||
size_t need = len*2;
|
||||
size_t need = len * 2;
|
||||
|
||||
do {
|
||||
size_t have = rb_len(r);
|
||||
@ -136,13 +137,15 @@ static void rb_read_data(ringbuffer_h r, float *d0, float *d1, size_t len)
|
||||
|
||||
if (UNLIKELY(need > 0))
|
||||
{
|
||||
const float quiet = 0.0f;
|
||||
size_t fill;
|
||||
|
||||
/* we got more data */
|
||||
if (rb_len(r) > 0)
|
||||
continue;
|
||||
|
||||
// underflow
|
||||
const float quiet = 0.0f;
|
||||
size_t fill = (need/2)*sizeof(float);
|
||||
/* underflow */
|
||||
fill = (need/2)*sizeof(float);
|
||||
memset_pattern4(&d0[i], &quiet, fill);
|
||||
memset_pattern4(&d1[i], &quiet, fill);
|
||||
}
|
||||
@ -180,35 +183,38 @@ static bool g_interrupted;
|
||||
latency:(NSUInteger)latency {
|
||||
if (self = [super init])
|
||||
{
|
||||
_sema = dispatch_semaphore_create(0);
|
||||
NSError *err;
|
||||
AUAudioUnit *au;
|
||||
AudioComponentDescription desc;
|
||||
AVAudioFormat *format, *renderFormat;
|
||||
|
||||
_bufferSize = (latency * rate) / 1000;
|
||||
_bufferSize *= 2; // stereo
|
||||
_sema = dispatch_semaphore_create(0);
|
||||
|
||||
_bufferSize = (latency * rate) / 1000;
|
||||
_bufferSize *= 2; /* stereo */
|
||||
rb_init(&_rb, _bufferSize);
|
||||
|
||||
AudioComponentDescription desc = {
|
||||
.componentType = kAudioUnitType_Output,
|
||||
.componentSubType = kAudioUnitSubType_DefaultOutput,
|
||||
.componentManufacturer = kAudioUnitManufacturer_Apple,
|
||||
};
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_DefaultOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
|
||||
NSError *err;
|
||||
AUAudioUnit *au = [[AUAudioUnit alloc] initWithComponentDescription:desc error:&err];
|
||||
au = [[AUAudioUnit alloc] initWithComponentDescription:desc error:&err];
|
||||
if (err != nil)
|
||||
return nil;
|
||||
|
||||
AVAudioFormat *format = au.outputBusses[0].format;
|
||||
format = au.outputBusses[0].format;
|
||||
if (format.channelCount != 2)
|
||||
return nil;
|
||||
|
||||
AVAudioFormat *renderFormat = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:rate channels:2];
|
||||
renderFormat = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:rate channels:2];
|
||||
[au.inputBusses[0] setFormat:renderFormat error:&err];
|
||||
if (err != nil)
|
||||
return nil;
|
||||
|
||||
ringbuffer_h rb = &_rb;
|
||||
__block dispatch_semaphore_t sema = _sema;
|
||||
au.outputProvider = ^AUAudioUnitStatus(AudioUnitRenderActionFlags * actionFlags, const AudioTimeStamp * timestamp, AUAudioFrameCount frameCount, NSInteger inputBusNumber, AudioBufferList * inputData) {
|
||||
au.outputProvider = ^AUAudioUnitStatus(AudioUnitRenderActionFlags * actionFlags, const AudioTimeStamp * timestamp, AUAudioFrameCount frameCount, NSInteger inputBusNumber, AudioBufferList * inputData)
|
||||
{
|
||||
rb_read_data(rb, inputData->mBuffers[0].mData, inputData->mBuffers[1].mData, frameCount);
|
||||
dispatch_semaphore_signal(sema);
|
||||
return 0;
|
||||
@ -288,9 +294,9 @@ static void coreaudio3_free(void *data)
|
||||
}
|
||||
|
||||
static void *coreaudio3_init(const char *device,
|
||||
unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
CoreAudio3 *dev = [[CoreAudio3 alloc] initWithRate:rate
|
||||
latency:latency];
|
||||
@ -300,10 +306,12 @@ static void *coreaudio3_init(const char *device,
|
||||
return (__bridge_retained void *)dev;
|
||||
}
|
||||
|
||||
static ssize_t coreaudio3_write(void *data, const void *buf_, size_t size)
|
||||
static ssize_t coreaudio3_write(void *data,
|
||||
const void *buf_, size_t size)
|
||||
{
|
||||
CoreAudio3 *dev = (__bridge CoreAudio3 *)data;
|
||||
return [dev writeFloat:(const float *)buf_ samples:size/sizeof(float)] * sizeof(float);
|
||||
return [dev writeFloat:(const float *)
|
||||
buf_ samples:size/sizeof(float)] * sizeof(float);
|
||||
}
|
||||
|
||||
static void coreaudio3_set_nonblock_state(void *data, bool state)
|
||||
@ -377,6 +385,8 @@ audio_driver_t audio_coreaudio3 = {
|
||||
coreaudio3_free,
|
||||
coreaudio3_use_float,
|
||||
"coreaudio3",
|
||||
NULL, /* device_list_new */
|
||||
NULL, /* device_list_free */
|
||||
coreaudio3_write_avail,
|
||||
coreaudio3_buffer_size,
|
||||
};
|
||||
|
@ -219,7 +219,7 @@ static xaudio2_t *xaudio2_new(unsigned samplerate, unsigned channels,
|
||||
goto error;
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
|
||||
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, device, NULL, AudioCategory_GameEffects)))
|
||||
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, (LPCWSTR)(uintptr_t)device, NULL, AudioCategory_GameEffects)))
|
||||
goto error;
|
||||
#else
|
||||
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, device, NULL)))
|
||||
|
@ -35,6 +35,9 @@
|
||||
#ifdef HAVE_MENU
|
||||
#include "../menu/menu_driver.h"
|
||||
#include "../menu/menu_entries.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
@ -492,9 +495,14 @@ static void rcheevos_award(rcheevos_cheevo_t* cheevo, int mode)
|
||||
cheevo->active &= ~RCHEEVOS_ACTIVE_SOFTCORE;
|
||||
|
||||
/* Show the OSD message. */
|
||||
snprintf(buffer, sizeof(buffer), "Achievement Unlocked: %s", cheevo->info->title);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(cheevo->info->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_push_achievement(cheevo->info->title, cheevo->info->badge))
|
||||
#endif
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Achievement Unlocked: %s", cheevo->info->title);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(cheevo->info->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
/* Start the award task. */
|
||||
if ((mode & RCHEEVOS_ACTIVE_HARDCORE) != 0)
|
||||
@ -527,11 +535,14 @@ static unsigned rcheevos_peek(unsigned address, unsigned num_bytes, void* ud)
|
||||
address, rcheevos_locals.patchdata.console_id);
|
||||
unsigned value = 0;
|
||||
|
||||
switch (num_bytes)
|
||||
if (data)
|
||||
{
|
||||
case 4: value |= data[2] << 16 | data[3] << 24;
|
||||
case 2: value |= data[1] << 8;
|
||||
case 1: value |= data[0];
|
||||
switch (num_bytes)
|
||||
{
|
||||
case 4: value |= data[2] << 16 | data[3] << 24;
|
||||
case 2: value |= data[1] << 8;
|
||||
case 1: value |= data[0];
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
@ -1678,6 +1689,9 @@ found:
|
||||
|
||||
badges_ctx = new_badges_ctx;
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (false) /* we always want badges if menu widgets are enabled */
|
||||
#endif
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!(
|
||||
|
@ -47,7 +47,7 @@ void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#if defined(HAVE_MENU) || defined(HAVE_MENU_WIDGETS)
|
||||
menu_display_reset_textures_list(badge_file, fullpath,
|
||||
&badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
#endif
|
||||
|
@ -36,6 +36,9 @@
|
||||
#ifdef HAVE_MENU
|
||||
#include "../menu/menu_driver.h"
|
||||
#include "../menu/menu_entries.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
@ -1643,9 +1646,8 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set)
|
||||
}
|
||||
else if (valid)
|
||||
{
|
||||
char msg[256];
|
||||
char url[256];
|
||||
msg[0] = url[0] = '\0';
|
||||
url[0] = '\0';
|
||||
|
||||
cheevo->active &= ~mode;
|
||||
|
||||
@ -1655,11 +1657,18 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set)
|
||||
CHEEVOS_LOG("[CHEEVOS]: awarding cheevo %u: %s (%s).\n",
|
||||
cheevo->id, cheevo->title, cheevo->description);
|
||||
|
||||
snprintf(msg, sizeof(msg), "Achievement Unlocked: %s",
|
||||
cheevo->title);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(cheevo->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_push_achievement(cheevo->title, cheevo->badge))
|
||||
#endif
|
||||
{
|
||||
char msg[256];
|
||||
msg[0] = '\0';
|
||||
snprintf(msg, sizeof(msg), "Achievement Unlocked: %s",
|
||||
cheevo->title);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(cheevo->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
cheevos_make_unlock_url(cheevo, url, sizeof(url));
|
||||
task_push_http_transfer(url, true, NULL,
|
||||
@ -3193,6 +3202,9 @@ found:
|
||||
|
||||
badges_ctx = new_badges_ctx;
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (false) /* we always want badges if menu widgets are enabled */
|
||||
#endif
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!(
|
||||
|
@ -290,45 +290,51 @@ Testing
|
||||
uint8_t* cheevos_var_get_memory(const cheevos_var_t* var)
|
||||
{
|
||||
uint8_t* memory = NULL;
|
||||
size_t length = 0;
|
||||
|
||||
if (var->bank_id >= 0)
|
||||
if (var->bank_id < 0)
|
||||
return NULL;
|
||||
|
||||
rarch_system_info_t* system = runloop_get_system_info();
|
||||
|
||||
if (system->mmaps.num_descriptors != 0)
|
||||
{
|
||||
rarch_system_info_t* system = runloop_get_system_info();
|
||||
memory = (uint8_t*)system->mmaps.descriptors[var->bank_id].core.ptr;
|
||||
length = system->mmaps.descriptors[var->bank_id].core.len;
|
||||
}
|
||||
else
|
||||
{
|
||||
retro_ctx_memory_info_t meminfo = {NULL, 0, 0};
|
||||
|
||||
if (system->mmaps.num_descriptors != 0)
|
||||
memory = (uint8_t*)system->mmaps.descriptors[var->bank_id].core.ptr;
|
||||
else
|
||||
switch (var->bank_id)
|
||||
{
|
||||
retro_ctx_memory_info_t meminfo = {NULL, 0, 0};
|
||||
|
||||
switch (var->bank_id)
|
||||
{
|
||||
case 0:
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
break;
|
||||
case 1:
|
||||
meminfo.id = RETRO_MEMORY_SAVE_RAM;
|
||||
break;
|
||||
case 2:
|
||||
meminfo.id = RETRO_MEMORY_VIDEO_RAM;
|
||||
break;
|
||||
case 3:
|
||||
meminfo.id = RETRO_MEMORY_RTC;
|
||||
break;
|
||||
default:
|
||||
CHEEVOS_ERR(CHEEVOS_TAG "invalid bank id: %d\n", var->bank_id);
|
||||
break;
|
||||
}
|
||||
|
||||
core_get_memory(&meminfo);
|
||||
memory = (uint8_t*)meminfo.data;
|
||||
case 0:
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
break;
|
||||
case 1:
|
||||
meminfo.id = RETRO_MEMORY_SAVE_RAM;
|
||||
break;
|
||||
case 2:
|
||||
meminfo.id = RETRO_MEMORY_VIDEO_RAM;
|
||||
break;
|
||||
case 3:
|
||||
meminfo.id = RETRO_MEMORY_RTC;
|
||||
break;
|
||||
default:
|
||||
CHEEVOS_ERR(CHEEVOS_TAG "invalid bank id: %d\n", var->bank_id);
|
||||
break;
|
||||
}
|
||||
|
||||
if (memory)
|
||||
memory += var->value;
|
||||
core_get_memory(&meminfo);
|
||||
|
||||
memory = (uint8_t*)meminfo.data;
|
||||
length = meminfo.size;
|
||||
}
|
||||
|
||||
return memory;
|
||||
if (memory == NULL || var->value >= length)
|
||||
return NULL;
|
||||
|
||||
return memory + var->value;
|
||||
}
|
||||
|
||||
unsigned cheevos_var_get_value(cheevos_var_t* var)
|
||||
|
51
command.c
51
command.c
@ -57,6 +57,9 @@
|
||||
#include "menu/menu_content.h"
|
||||
#include "menu/menu_shader.h"
|
||||
#include "menu/widgets/menu_dialog.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
@ -286,7 +289,7 @@ static bool command_read_ram(const char *arg)
|
||||
unsigned int alloc_size = 0;
|
||||
unsigned int addr = -1;
|
||||
|
||||
if (sscanf(arg, "%x %d", &addr, &nbytes) != 2)
|
||||
if (sscanf(arg, "%x %u", &addr, &nbytes) != 2)
|
||||
return true;
|
||||
alloc_size = 40 + nbytes * 3; /* We alloc more than needed, saving 20 bytes is not really relevant */
|
||||
reply = (char*) malloc(alloc_size);
|
||||
@ -984,7 +987,10 @@ static void command_event_set_volume(float gain)
|
||||
msg_hash_to_str(MSG_AUDIO_VOLUME),
|
||||
new_volume);
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
|
||||
#endif
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
|
||||
@ -2134,9 +2140,11 @@ TODO: Add a setting for these tweaks */
|
||||
return false;
|
||||
}
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
|
||||
#endif
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_SEND_DEBUG_INFO:
|
||||
@ -2429,15 +2437,19 @@ TODO: Add a setting for these tweaks */
|
||||
{
|
||||
if (str_list->size >= 6)
|
||||
{
|
||||
struct playlist_entry entry = {0};
|
||||
|
||||
entry.path = str_list->elems[0].data; /* content_path */
|
||||
entry.label = str_list->elems[1].data; /* content_label */
|
||||
entry.core_path = str_list->elems[2].data; /* core_path */
|
||||
entry.core_name = str_list->elems[3].data; /* core_name */
|
||||
entry.crc32 = str_list->elems[4].data; /* crc32 */
|
||||
entry.db_name = str_list->elems[5].data; /* db_name */
|
||||
|
||||
/* Write playlist entry */
|
||||
command_playlist_push_write(
|
||||
g_defaults.content_favorites,
|
||||
str_list->elems[0].data, /* content_path */
|
||||
str_list->elems[1].data, /* content_label */
|
||||
str_list->elems[2].data, /* core_path */
|
||||
str_list->elems[3].data, /* core_name */
|
||||
str_list->elems[4].data, /* crc32 */
|
||||
str_list->elems[5].data /* db_name */
|
||||
&entry
|
||||
);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
@ -2450,16 +2462,16 @@ TODO: Add a setting for these tweaks */
|
||||
const char *core_name = "DETECT";
|
||||
const char *core_path = "DETECT";
|
||||
size_t *playlist_index = (size_t*)data;
|
||||
struct playlist_entry entry = {0};
|
||||
|
||||
/* the update function reads our entry as const, so these casts are safe */
|
||||
entry.core_path = (char*)core_path;
|
||||
entry.core_name = (char*)core_name;
|
||||
|
||||
command_playlist_update_write(
|
||||
NULL,
|
||||
*playlist_index,
|
||||
NULL,
|
||||
NULL,
|
||||
core_path,
|
||||
core_name,
|
||||
NULL,
|
||||
NULL);
|
||||
&entry);
|
||||
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET_CORE_ASSOCIATION), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
break;
|
||||
@ -2518,6 +2530,9 @@ TODO: Add a setting for these tweaks */
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED));
|
||||
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_set_paused(is_paused))
|
||||
#endif
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
|
||||
1, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
@ -2532,6 +2547,10 @@ TODO: Add a setting for these tweaks */
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (video_driver_has_widgets())
|
||||
menu_widgets_set_paused(is_paused);
|
||||
#endif
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED));
|
||||
command_event(CMD_EVENT_AUDIO_START, NULL);
|
||||
}
|
||||
|
32
config.def.h
32
config.def.h
@ -32,6 +32,11 @@
|
||||
#include "network/netplay/netplay.h"
|
||||
#endif
|
||||
|
||||
/* Required for 3DS display mode setting */
|
||||
#if defined(_3DS)
|
||||
#include "gfx/common/ctr_common.h"
|
||||
#endif
|
||||
|
||||
#if defined(HW_RVL)
|
||||
#define MAX_GAMMA_SETTING 30
|
||||
#elif defined(GEKKO)
|
||||
@ -384,10 +389,16 @@ static unsigned menu_shader_pipeline = 2;
|
||||
static bool show_advanced_settings = false;
|
||||
|
||||
static unsigned rgui_color_theme = RGUI_THEME_CLASSIC_GREEN;
|
||||
static bool rgui_inline_thumbnails = false;
|
||||
static bool rgui_swap_thumbnails = false;
|
||||
static unsigned rgui_thumbnail_downscaler = RGUI_THUMB_SCALE_POINT;
|
||||
static bool rgui_lock_aspect = false;
|
||||
static unsigned rgui_thumbnail_delay = 0;
|
||||
static unsigned rgui_internal_upscale_level = RGUI_UPSCALE_NONE;
|
||||
static bool rgui_full_width_layout = true;
|
||||
static unsigned rgui_aspect = RGUI_ASPECT_RATIO_4_3;
|
||||
static unsigned rgui_aspect_lock = RGUI_ASPECT_RATIO_LOCK_NONE;
|
||||
static bool rgui_shadows = false;
|
||||
static bool rgui_extended_ascii = false;
|
||||
|
||||
#else
|
||||
static bool default_block_config_read = false;
|
||||
@ -438,6 +449,9 @@ static bool menu_swap_ok_cancel_buttons = false;
|
||||
|
||||
static bool quit_press_twice = false;
|
||||
|
||||
static bool default_log_to_file = false;
|
||||
static bool log_to_file_timestamp = false;
|
||||
|
||||
/* Crop overscanned frames. */
|
||||
static const bool crop_overscan = true;
|
||||
|
||||
@ -509,9 +523,11 @@ static const float crt_refresh_rate = 60/1.001;
|
||||
* Used for setups where one manually rotates the monitor. */
|
||||
static const bool allow_rotate = true;
|
||||
|
||||
#ifdef _3DS
|
||||
#if defined(_3DS)
|
||||
/* Enable bottom LCD screen */
|
||||
static const bool video_3ds_lcd_bottom = true;
|
||||
/* Sets video display mode (3D, 2D, etc.) */
|
||||
static const unsigned video_3ds_display_mode = CTR_VIDEO_MODE_3D;
|
||||
#endif
|
||||
|
||||
/* AUDIO */
|
||||
@ -716,13 +732,15 @@ static const bool playlist_sort_alphabetical = true;
|
||||
/* File format to use when writing playlists to disk */
|
||||
static const bool playlist_use_old_format = false;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* Specify when to display 'core name' inline on playlist entries */
|
||||
static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV;
|
||||
|
||||
static const bool playlist_show_sublabels = false;
|
||||
|
||||
/* Specifies which runtime record to use on playlist sublabels */
|
||||
static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE;
|
||||
#endif
|
||||
|
||||
static const bool playlist_show_sublabels = false;
|
||||
|
||||
/* Show Menu start-up screen on boot. */
|
||||
static const bool default_menu_show_start_screen = true;
|
||||
@ -752,7 +770,11 @@ static const unsigned libretro_log_level = 1;
|
||||
|
||||
/* Axis threshold (between 0.0 and 1.0)
|
||||
* How far an axis must be tilted to result in a button press. */
|
||||
static const float axis_threshold = 0.5;
|
||||
static const float axis_threshold = 0.5f;
|
||||
|
||||
static const float analog_deadzone = 0.0f;
|
||||
|
||||
static const float analog_sensitivity = 1.0f;
|
||||
|
||||
/* Describes speed of which turbo-enabled buttons toggle. */
|
||||
static const unsigned turbo_period = 6;
|
||||
|
@ -260,12 +260,6 @@ static const bool _hlsl_supp = true;
|
||||
static const bool _hlsl_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBXML2
|
||||
static const bool _libxml2_supp = true;
|
||||
#else
|
||||
static const bool _libxml2_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SDL_IMAGE
|
||||
static const bool _sdl_image_supp = true;
|
||||
#else
|
||||
|
@ -1310,6 +1310,8 @@ static struct config_path_setting *populate_settings_path(settings_t *settings,
|
||||
global->record.config_dir, false, NULL, true);
|
||||
}
|
||||
|
||||
SETTING_ARRAY("log_dir", settings->paths.log_dir, true, NULL, true);
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
@ -1506,8 +1508,11 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false);
|
||||
SETTING_BOOL("rgui_border_filler_thickness_enable", &settings->bools.menu_rgui_border_filler_thickness_enable, true, true, false);
|
||||
SETTING_BOOL("rgui_border_filler_enable", &settings->bools.menu_rgui_border_filler_enable, true, true, false);
|
||||
SETTING_BOOL("menu_rgui_lock_aspect", &settings->bools.menu_rgui_lock_aspect, true, rgui_lock_aspect, false);
|
||||
SETTING_BOOL("menu_rgui_shadows", &settings->bools.menu_rgui_shadows, true, rgui_shadows, false);
|
||||
SETTING_BOOL("menu_rgui_full_width_layout", &settings->bools.menu_rgui_full_width_layout, true, rgui_full_width_layout, false);
|
||||
SETTING_BOOL("rgui_inline_thumbnails", &settings->bools.menu_rgui_inline_thumbnails, true, rgui_inline_thumbnails, false);
|
||||
SETTING_BOOL("rgui_swap_thumbnails", &settings->bools.menu_rgui_swap_thumbnails, true, rgui_swap_thumbnails, false);
|
||||
SETTING_BOOL("rgui_extended_ascii", &settings->bools.menu_rgui_extended_ascii, true, rgui_extended_ascii, false);
|
||||
#endif
|
||||
#ifdef HAVE_XMB
|
||||
SETTING_BOOL("xmb_shadows_enable", &settings->bools.menu_xmb_shadows_enable, true, xmb_shadows_enable, false);
|
||||
@ -1595,6 +1600,9 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, ozone_collapse_sidebar, false);
|
||||
#endif
|
||||
|
||||
SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, default_log_to_file, false);
|
||||
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, log_to_file_timestamp, false);
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
@ -1633,6 +1641,8 @@ static struct config_float_setting *populate_settings_float(settings_t *settings
|
||||
SETTING_FLOAT("fastforward_ratio", &settings->floats.fastforward_ratio, true, fastforward_ratio, false);
|
||||
SETTING_FLOAT("slowmotion_ratio", &settings->floats.slowmotion_ratio, true, slowmotion_ratio, false);
|
||||
SETTING_FLOAT("input_axis_threshold", input_driver_get_float(INPUT_ACTION_AXIS_THRESHOLD), true, axis_threshold, false);
|
||||
SETTING_FLOAT("input_analog_deadzone", &settings->floats.input_analog_deadzone, true, analog_deadzone, false);
|
||||
SETTING_FLOAT("input_analog_sensitivity", &settings->floats.input_analog_sensitivity, true, analog_sensitivity, false);
|
||||
SETTING_FLOAT("video_msg_bgcolor_opacity", &settings->floats.video_msg_bgcolor_opacity, true, message_bgcolor_opacity, false);
|
||||
|
||||
*size = count;
|
||||
@ -1691,7 +1701,10 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
#ifdef HAVE_RGUI
|
||||
SETTING_UINT("rgui_menu_color_theme", &settings->uints.menu_rgui_color_theme, true, rgui_color_theme, false);
|
||||
SETTING_UINT("rgui_thumbnail_downscaler", &settings->uints.menu_rgui_thumbnail_downscaler, true, rgui_thumbnail_downscaler, false);
|
||||
SETTING_UINT("rgui_thumbnail_delay", &settings->uints.menu_rgui_thumbnail_delay, true, rgui_thumbnail_delay, false);
|
||||
SETTING_UINT("rgui_internal_upscale_level", &settings->uints.menu_rgui_internal_upscale_level, true, rgui_internal_upscale_level, false);
|
||||
SETTING_UINT("rgui_aspect_ratio", &settings->uints.menu_rgui_aspect_ratio, true, rgui_aspect, false);
|
||||
SETTING_UINT("rgui_aspect_ratio_lock", &settings->uints.menu_rgui_aspect_ratio_lock, true, rgui_aspect_lock, false);
|
||||
#endif
|
||||
#ifdef HAVE_LIBNX
|
||||
SETTING_UINT("split_joycon_p1", &settings->uints.input_split_joycon[0], true, 0, false);
|
||||
@ -1743,7 +1756,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("netplay_share_analog", &settings->uints.netplay_share_analog, true, netplay_share_analog, false);
|
||||
#endif
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
SETTING_UINT("user_language", msg_hash_get_uint(MSG_HASH_USER_LANGUAGE), true, RETRO_LANGUAGE_ENGLISH, false);
|
||||
SETTING_UINT("user_language", msg_hash_get_uint(MSG_HASH_USER_LANGUAGE), true, def_user_language, false);
|
||||
#endif
|
||||
SETTING_UINT("bundle_assets_extract_version_current", &settings->uints.bundle_assets_extract_version_current, true, 0, false);
|
||||
SETTING_UINT("bundle_assets_extract_last_version", &settings->uints.bundle_assets_extract_last_version, true, 0, false);
|
||||
@ -1772,8 +1785,14 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("libnx_overclock", &settings->uints.libnx_overclock, true, SWITCH_DEFAULT_CPU_PROFILE, false);
|
||||
#endif
|
||||
|
||||
#ifdef _3DS
|
||||
SETTING_UINT("video_3ds_display_mode", &settings->uints.video_3ds_display_mode, true, video_3ds_display_mode, false);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, playlist_show_inline_core_name, false);
|
||||
SETTING_UINT("playlist_sublabel_runtime_type", &settings->uints.playlist_sublabel_runtime_type, true, playlist_sublabel_runtime_type, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
||||
@ -2119,6 +2138,8 @@ void config_set_defaults(void)
|
||||
*settings->paths.directory_content_history = '\0';
|
||||
*settings->paths.path_audio_dsp_plugin = '\0';
|
||||
|
||||
*settings->paths.log_dir = '\0';
|
||||
|
||||
video_driver_default_settings();
|
||||
|
||||
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS]))
|
||||
@ -2255,6 +2276,11 @@ void config_set_defaults(void)
|
||||
g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY],
|
||||
sizeof(settings->paths.directory_content_history));
|
||||
|
||||
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_LOGS]))
|
||||
strlcpy(settings->paths.log_dir,
|
||||
g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
sizeof(settings->paths.log_dir));
|
||||
|
||||
if (!string_is_empty(g_defaults.path.config))
|
||||
{
|
||||
char *temp_str = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
@ -2834,7 +2860,9 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
if (config_get_bool(conf, "log_verbosity", &tmp_bool))
|
||||
{
|
||||
if (tmp_bool)
|
||||
{
|
||||
verbosity_enable();
|
||||
}
|
||||
else
|
||||
verbosity_disable();
|
||||
}
|
||||
@ -3144,6 +3172,20 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
if (string_is_equal(settings->paths.directory_system, "default"))
|
||||
*settings->paths.directory_system = '\0';
|
||||
|
||||
/* Log directory is a special case, since it must contain
|
||||
* a valid path as soon as possible - if config file
|
||||
* value is 'default' must copy g_defaults.dirs[DEFAULT_DIR_LOGS]
|
||||
* directly... */
|
||||
if (string_is_equal(settings->paths.log_dir, "default"))
|
||||
{
|
||||
if (!string_is_empty(g_defaults.dirs[DEFAULT_DIR_LOGS]))
|
||||
strlcpy(settings->paths.log_dir,
|
||||
g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
sizeof(settings->paths.log_dir));
|
||||
else
|
||||
*settings->paths.log_dir = '\0';
|
||||
}
|
||||
|
||||
if (settings->floats.slowmotion_ratio < 1.0f)
|
||||
configuration_set_float(settings, settings->floats.slowmotion_ratio, 1.0f);
|
||||
|
||||
@ -3245,8 +3287,10 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode);
|
||||
recording_driver_update_streaming_url();
|
||||
|
||||
ret = true;
|
||||
if (!config_entry_exists(conf, "user_language"))
|
||||
msg_hash_set_uint(MSG_HASH_USER_LANGUAGE, frontend_driver_get_user_language());
|
||||
|
||||
ret = true;
|
||||
end:
|
||||
if (conf)
|
||||
config_file_free(conf);
|
||||
|
@ -171,8 +171,11 @@ typedef struct settings
|
||||
bool menu_rgui_background_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_enable;
|
||||
bool menu_rgui_lock_aspect;
|
||||
bool menu_rgui_full_width_layout;
|
||||
bool menu_rgui_shadows;
|
||||
bool menu_rgui_inline_thumbnails;
|
||||
bool menu_rgui_swap_thumbnails;
|
||||
bool menu_rgui_extended_ascii;
|
||||
bool menu_xmb_shadows_enable;
|
||||
bool menu_xmb_vertical_thumbnails;
|
||||
bool menu_content_show_settings;
|
||||
@ -321,6 +324,9 @@ typedef struct settings
|
||||
#ifdef HAVE_OZONE
|
||||
bool ozone_collapse_sidebar;
|
||||
#endif
|
||||
|
||||
bool log_to_file;
|
||||
bool log_to_file_timestamp;
|
||||
} bools;
|
||||
|
||||
struct
|
||||
@ -353,6 +359,8 @@ typedef struct settings
|
||||
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
float input_analog_deadzone;
|
||||
float input_analog_sensitivity;
|
||||
} floats;
|
||||
|
||||
struct
|
||||
@ -423,11 +431,13 @@ typedef struct settings
|
||||
unsigned video_stream_quality;
|
||||
unsigned video_record_scale_factor;
|
||||
unsigned video_stream_scale_factor;
|
||||
unsigned video_3ds_display_mode;
|
||||
|
||||
unsigned menu_timedate_style;
|
||||
unsigned menu_thumbnails;
|
||||
unsigned menu_left_thumbnails;
|
||||
unsigned menu_rgui_thumbnail_downscaler;
|
||||
unsigned menu_rgui_thumbnail_delay;
|
||||
unsigned menu_dpi_override_value;
|
||||
unsigned menu_rgui_color_theme;
|
||||
unsigned menu_xmb_layout;
|
||||
@ -442,6 +452,8 @@ typedef struct settings
|
||||
unsigned menu_font_color_green;
|
||||
unsigned menu_font_color_blue;
|
||||
unsigned menu_rgui_internal_upscale_level;
|
||||
unsigned menu_rgui_aspect_ratio;
|
||||
unsigned menu_rgui_aspect_ratio_lock;
|
||||
unsigned menu_ticker_type;
|
||||
|
||||
unsigned playlist_show_inline_core_name;
|
||||
@ -590,6 +602,8 @@ typedef struct settings
|
||||
char directory_menu_config[PATH_MAX_LENGTH];
|
||||
char directory_menu_content[PATH_MAX_LENGTH];
|
||||
char streaming_title[PATH_MAX_LENGTH];
|
||||
|
||||
char log_dir[PATH_MAX_LENGTH];
|
||||
} paths;
|
||||
|
||||
bool modified;
|
||||
|
@ -112,6 +112,9 @@ char* content_get_subsystem_rom(unsigned index);
|
||||
/* Sets the subsystem by name */
|
||||
bool content_set_subsystem_by_name(const char* subsystem_name);
|
||||
|
||||
/* Get the current subsystem "friendly name" */
|
||||
void content_get_subsystem_friendly_name(const char* subsystem_name, char* subsystem_friendly_name, size_t len);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -21,10 +21,19 @@
|
||||
|
||||
#include <libretro.h>
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_RGUI)
|
||||
#include <string/stdstring.h>
|
||||
#include "../configuration.h"
|
||||
#include "../menu/menu_defines.h"
|
||||
#endif
|
||||
|
||||
#include "internal_cores.h"
|
||||
|
||||
static uint16_t *dummy_frame_buf;
|
||||
|
||||
static uint16_t frame_buf_width;
|
||||
static uint16_t frame_buf_height;
|
||||
|
||||
#if defined(HAVE_LIBNX) && defined(HAVE_STATIC_DUMMY)
|
||||
void retro_init(void) { libretro_dummy_retro_init(); }
|
||||
void retro_deinit(void) { libretro_dummy_retro_deinit(); }
|
||||
@ -55,10 +64,38 @@ void retro_cheat_set(unsigned idx, bool enabled, const char *code) { libretro_du
|
||||
|
||||
void libretro_dummy_retro_init(void)
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_RGUI)
|
||||
settings_t *settings = config_get_ptr();
|
||||
#endif
|
||||
unsigned i;
|
||||
|
||||
dummy_frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
||||
for (i = 0; i < 320 * 240; i++)
|
||||
/* Sensible defaults */
|
||||
frame_buf_width = 320;
|
||||
frame_buf_height = 240;
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_RGUI)
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
{
|
||||
switch (settings->uints.menu_rgui_aspect_ratio)
|
||||
{
|
||||
case RGUI_ASPECT_RATIO_16_9:
|
||||
case RGUI_ASPECT_RATIO_16_9_CENTRE:
|
||||
frame_buf_width = 426;
|
||||
break;
|
||||
case RGUI_ASPECT_RATIO_16_10:
|
||||
case RGUI_ASPECT_RATIO_16_10_CENTRE:
|
||||
frame_buf_width = 384;
|
||||
break;
|
||||
default:
|
||||
/* 4:3 */
|
||||
frame_buf_width = 320;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
dummy_frame_buf = (uint16_t*)calloc(frame_buf_width * frame_buf_height, sizeof(uint16_t));
|
||||
for (i = 0; i < (unsigned)(frame_buf_width * frame_buf_height); i++)
|
||||
dummy_frame_buf[i] = 4 << 5;
|
||||
}
|
||||
|
||||
@ -109,11 +146,11 @@ void libretro_dummy_retro_get_system_av_info(
|
||||
info->timing.fps = refresh_rate;
|
||||
info->timing.sample_rate = 30000.0;
|
||||
|
||||
info->geometry.base_width = 320;
|
||||
info->geometry.base_height = 240;
|
||||
info->geometry.max_width = 320;
|
||||
info->geometry.max_height = 240;
|
||||
info->geometry.aspect_ratio = 4.0 / 3.0;
|
||||
info->geometry.base_width = frame_buf_width;
|
||||
info->geometry.base_height = frame_buf_height;
|
||||
info->geometry.max_width = frame_buf_width;
|
||||
info->geometry.max_height = frame_buf_height;
|
||||
info->geometry.aspect_ratio = (float)frame_buf_width / (float)frame_buf_height;
|
||||
}
|
||||
|
||||
void libretro_dummy_retro_set_environment(retro_environment_t cb)
|
||||
@ -158,7 +195,7 @@ void libretro_dummy_retro_reset(void)
|
||||
void libretro_dummy_retro_run(void)
|
||||
{
|
||||
dummy_input_poll_cb();
|
||||
dummy_video_cb(dummy_frame_buf, 320, 240, 640);
|
||||
dummy_video_cb(dummy_frame_buf, frame_buf_width, frame_buf_height, 2 * frame_buf_width);
|
||||
}
|
||||
|
||||
/* This should never be called, it's only used as a placeholder. */
|
||||
|
@ -351,12 +351,6 @@ static void load_state(const void *data, size_t size)
|
||||
check_variables();
|
||||
}
|
||||
|
||||
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;
|
||||
@ -393,11 +387,11 @@ void GONG_CORE_PREFIX(retro_init)(void)
|
||||
else
|
||||
GONG_CORE_PREFIX(log_cb) = NULL;
|
||||
|
||||
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned));
|
||||
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned char));
|
||||
|
||||
game_buffer.width = WIDTH;
|
||||
game_buffer.width = WIDTH;
|
||||
game_buffer.height = HEIGHT;
|
||||
game_buffer.pitch = WIDTH * sizeof(unsigned);
|
||||
game_buffer.pitch = WIDTH * sizeof(unsigned);
|
||||
game_buffer.memory = video_buf;
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ enum default_dirs
|
||||
DEFAULT_DIR_CHEATS,
|
||||
DEFAULT_DIR_RECORD_CONFIG,
|
||||
DEFAULT_DIR_RECORD_OUTPUT,
|
||||
DEFAULT_DIR_LOGS,
|
||||
DEFAULT_DIR_LAST
|
||||
};
|
||||
|
||||
|
4
deps/stb/stb_truetype.h
vendored
4
deps/stb/stb_truetype.h
vendored
@ -1876,6 +1876,7 @@ static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edg
|
||||
y1 = e->ey;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (x0 == x)
|
||||
assert(x1 <= x+1);
|
||||
else if (x0 == x+1)
|
||||
@ -1886,13 +1887,16 @@ static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edg
|
||||
assert(x1 >= x+1);
|
||||
else
|
||||
assert(x1 >= x && x1 <= x+1);
|
||||
#endif
|
||||
|
||||
if (x0 <= x && x1 <= x)
|
||||
scanline[x] += e->direction * (y1-y0);
|
||||
else if (x0 >= x+1 && x1 >= x+1)
|
||||
;
|
||||
else {
|
||||
#if 0
|
||||
assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1);
|
||||
#endif
|
||||
scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); /* coverage = 1 - average x position */
|
||||
}
|
||||
}
|
||||
|
2
dirs.c
2
dirs.c
@ -314,6 +314,8 @@ void dir_check_defaults(void)
|
||||
*/
|
||||
#ifdef ORBIS
|
||||
if (filestream_exists("host0:app/custom.ini"))
|
||||
#elif defined(ANDROID)
|
||||
if (filestream_exists("host0:app/custom.ini"))
|
||||
#else
|
||||
if (filestream_exists("custom.ini"))
|
||||
#endif
|
||||
|
@ -345,15 +345,19 @@ void discord_update(enum discord_presence presence)
|
||||
{
|
||||
const char *system_id = core_info->system_id
|
||||
? core_info->system_id : "core";
|
||||
char *label = NULL;
|
||||
const char *label = NULL;
|
||||
const struct playlist_entry *entry = NULL;
|
||||
playlist_t *current_playlist = playlist_get_cached();
|
||||
|
||||
if (current_playlist)
|
||||
{
|
||||
playlist_get_index_by_path(
|
||||
current_playlist, path_get(RARCH_PATH_CONTENT), NULL, &label, NULL, NULL, NULL, NULL);
|
||||
current_playlist, path_get(RARCH_PATH_CONTENT), &entry);
|
||||
label = entry->label;
|
||||
}
|
||||
|
||||
if (!label)
|
||||
label = (char *)path_basename(path_get(RARCH_PATH_BASENAME));
|
||||
label = path_basename(path_get(RARCH_PATH_BASENAME));
|
||||
#if 0
|
||||
RARCH_LOG("[discord] current core: %s\n", system_id);
|
||||
RARCH_LOG("[discord] current content: %s\n", label);
|
||||
|
@ -231,6 +231,9 @@ for f in `ls -v *_${platform}.${EXT}`; do
|
||||
make -C ../ -f Makefile.${platform} $OPTS LIBRETRO=$name $whole_archive $big_stack -j3 || exit 1
|
||||
elif [ $PLATFORM = "libnx" ]; then
|
||||
make -C ../ -f Makefile.${platform} $OPTS APP_TITLE="$name" LIBRETRO=$name $whole_archive $big_stack -j3 || exit 1
|
||||
elif [ $PLATFORM = "ps2" ]; then
|
||||
# TODO PS2 should be able to compile in parallel
|
||||
make -C ../ -f Makefile.${platform} $OPTS $whole_archive $big_stack || exit 1
|
||||
else
|
||||
make -C ../ -f Makefile.${platform} $OPTS $whole_archive $big_stack -j3 || exit 1
|
||||
fi
|
||||
|
@ -1395,7 +1395,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
unsigned retro_id;
|
||||
const struct retro_input_descriptor *desc = NULL;
|
||||
memset(&system->input_desc_btn, 0,
|
||||
memset((void*)&system->input_desc_btn, 0,
|
||||
sizeof(system->input_desc_btn));
|
||||
|
||||
desc = (const struct retro_input_descriptor*)data;
|
||||
|
@ -94,7 +94,9 @@ enum file_path_enum
|
||||
FILE_PATH_XM_EXTENSION,
|
||||
FILE_PATH_CONFIG_EXTENSION,
|
||||
FILE_PATH_CORE_INFO_EXTENSION,
|
||||
FILE_PATH_RUNTIME_EXTENSION
|
||||
FILE_PATH_RUNTIME_EXTENSION,
|
||||
FILE_PATH_DEFAULT_EVENT_LOG,
|
||||
FILE_PATH_EVENT_LOG_EXTENSION
|
||||
};
|
||||
|
||||
enum application_special_type
|
||||
|
@ -227,6 +227,12 @@ const char *file_path_str(enum file_path_enum enum_idx)
|
||||
case FILE_PATH_RUNTIME_EXTENSION:
|
||||
str = ".lrtl";
|
||||
break;
|
||||
case FILE_PATH_DEFAULT_EVENT_LOG:
|
||||
str = "retroarch.log";
|
||||
break;
|
||||
case FILE_PATH_EVENT_LOG_EXTENSION:
|
||||
str = ".log";
|
||||
break;
|
||||
case FILE_PATH_UNKNOWN:
|
||||
default:
|
||||
break;
|
||||
|
@ -93,14 +93,6 @@ static void frontend_ctr_get_environment_settings(int* argc, char* argv[],
|
||||
{
|
||||
(void)args;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
#if defined(HAVE_LOGGER)
|
||||
logger_init();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
retro_main_log_file_init("sdmc:/retroarch/retroarch-log.txt");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
fill_pathname_basedir(g_defaults.dirs[DEFAULT_DIR_PORT], elf_path_cst, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
|
||||
RARCH_LOG("port dir: [%s]\n", g_defaults.dirs[DEFAULT_DIR_PORT]);
|
||||
|
||||
@ -125,11 +117,13 @@ static void frontend_ctr_get_environment_settings(int* argc, char* argv[],
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_REMAP], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"config/remaps", sizeof(g_defaults.dirs[DEFAULT_DIR_REMAP]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"filters", sizeof(g_defaults.dirs[DEFAULT_DIR_REMAP]));
|
||||
"filters", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CURSOR], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"database/cursors", sizeof(g_defaults.dirs[DEFAULT_DIR_CURSOR]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config));
|
||||
}
|
||||
@ -139,17 +133,25 @@ static void frontend_ctr_deinit(void* data)
|
||||
Handle lcd_handle;
|
||||
u32 parallax_layer_reg_state;
|
||||
u8 not_2DS;
|
||||
u8 device_model = 0xFF;
|
||||
|
||||
extern PrintConsole* currentConsole;
|
||||
|
||||
(void)data;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
/* Note: frontend_ctr_deinit() is normally called when
|
||||
* forking to load new content. When this happens, the
|
||||
* log messages generated in frontend_ctr_exec() *must*
|
||||
* be printed to screen (provided bottom screen is not
|
||||
* turned off...), since the 'first core launch' warning
|
||||
* can prevent sdcard corruption. We therefore close any
|
||||
* existing log file, enable verbose logging and revert
|
||||
* to console output. (Normal logging will be resumed
|
||||
* once retroarch.cfg has been re-read) */
|
||||
retro_main_log_file_deinit();
|
||||
verbosity_enable();
|
||||
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL);
|
||||
#endif
|
||||
retro_main_log_file_init(NULL, false);
|
||||
|
||||
if ((gfxBottomFramebuffers[0] == (u8*)currentConsole->frameBuffer)
|
||||
&& (ctr_fork_mode == FRONTEND_FORK_NONE))
|
||||
@ -166,8 +168,16 @@ static void frontend_ctr_deinit(void* data)
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
|
||||
parallax_layer_reg_state = (*(float*)0x1FF81080 == 0.0) ? 0x0 : 0x00010001;
|
||||
GSPGPU_WriteHWRegs(0x202000, ¶llax_layer_reg_state, 4);
|
||||
/* Only O3DS and O3DSXL support running in 'dual-framebuffer'
|
||||
* mode with the parallax barrier disabled
|
||||
* (i.e. these are the only platforms that can use
|
||||
* CTR_VIDEO_MODE_2D_400x240 and CTR_VIDEO_MODE_2D_800x240) */
|
||||
CFGU_GetSystemModel(&device_model); /* (0 = O3DS, 1 = O3DSXL, 2 = N3DS, 3 = 2DS, 4 = N3DSXL, 5 = N2DSXL) */
|
||||
if ((device_model == 0) || (device_model == 1))
|
||||
{
|
||||
parallax_layer_reg_state = (*(float*)0x1FF81080 == 0.0) ? 0x0 : 0x00010001;
|
||||
GSPGPU_WriteHWRegs(0x202000, ¶llax_layer_reg_state, 4);
|
||||
}
|
||||
|
||||
mcuHwcExit();
|
||||
ptmuExit();
|
||||
@ -203,9 +213,9 @@ static void frontend_ctr_exec(const char* path, bool should_load_game)
|
||||
if (should_load_game && !path_is_empty(RARCH_PATH_CONTENT))
|
||||
{
|
||||
strcpy(game_path, path_get(RARCH_PATH_CONTENT));
|
||||
arg_data[args] = game_path;
|
||||
arg_data[args + 1] = NULL;
|
||||
args++;
|
||||
arg_data[args] = game_path;
|
||||
arg_data[args + 1] = NULL;
|
||||
args++;
|
||||
RARCH_LOG("content path: [%s].\n", path_get(RARCH_PATH_CONTENT));
|
||||
}
|
||||
#endif
|
||||
@ -603,5 +613,6 @@ frontend_ctx_driver_t frontend_ctx_ctr =
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"ctr",
|
||||
};
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include <file/file_path.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <rhash.h>
|
||||
#include <features/features_cpu.h>
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
@ -400,6 +401,7 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE], home_dir_buf, "states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG], home_dir_buf, "records_config", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT], home_dir_buf, "records", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], home_dir_buf, "logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
#if defined(IOS)
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST], home_dir_buf, "playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
||||
#endif
|
||||
@ -771,10 +773,11 @@ frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
NULL, /* watch_path_for_changes */
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
|
||||
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
|
||||
frontend_darwin_get_cpu_model_name,
|
||||
#else
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
#endif
|
||||
NULL, /* get_user_language */
|
||||
"darwin",
|
||||
};
|
||||
|
@ -72,5 +72,6 @@ frontend_ctx_driver_t frontend_ctx_dos = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"dos",
|
||||
};
|
||||
|
@ -198,6 +198,8 @@ static void frontend_emscripten_get_env(int *argc, char *argv[],
|
||||
"system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], user_path,
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
/* cache dir */
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE], "/tmp/",
|
||||
@ -265,5 +267,6 @@ frontend_ctx_driver_t frontend_ctx_emscripten = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"emscripten"
|
||||
};
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/iosupport.h>
|
||||
|
||||
#include <gccore.h>
|
||||
#include <ogcsys.h>
|
||||
@ -65,17 +66,6 @@ extern void system_exec_wii(const char *path, bool should_load_game);
|
||||
static enum frontend_fork gx_fork_mode = FRONTEND_FORK_NONE;
|
||||
#endif
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
#include "../../paths.h"
|
||||
|
||||
enum
|
||||
{
|
||||
GX_DEVICE_SD = 0,
|
||||
GX_DEVICE_USB,
|
||||
GX_DEVICE_END
|
||||
};
|
||||
|
||||
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
static devoptab_t dotab_stdout = {
|
||||
"stdout", /* device name */
|
||||
0, /* size of file structure */
|
||||
@ -101,7 +91,16 @@ static devoptab_t dotab_stdout = {
|
||||
NULL, /* device fsync_r */
|
||||
NULL, /* deviceData; */
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
#include "../../paths.h"
|
||||
|
||||
enum
|
||||
{
|
||||
GX_DEVICE_SD = 0,
|
||||
GX_DEVICE_USB,
|
||||
GX_DEVICE_END
|
||||
};
|
||||
|
||||
#ifdef HW_RVL
|
||||
static struct
|
||||
@ -151,22 +150,6 @@ static void gx_devthread(void *a)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
static int gx_logger_net(struct _reent *r, int fd, const char *ptr, size_t len)
|
||||
{
|
||||
#ifdef HAVE_LOGGER
|
||||
static char temp[4000];
|
||||
size_t l = (len >= 4000) ? 3999 : len - 1;
|
||||
memcpy(temp, ptr, l);
|
||||
temp[l] = 0;
|
||||
logger_send("%s", temp);
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
fwrite(ptr, 1, len, retro_main_log_file());
|
||||
#endif
|
||||
return len;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef IS_SALAMANDER
|
||||
@ -180,11 +163,6 @@ static void frontend_gx_get_environment_settings(
|
||||
char *last_slash = NULL;
|
||||
char *device_end = NULL;
|
||||
#ifndef IS_SALAMANDER
|
||||
#if defined(HAVE_LOGGER)
|
||||
logger_init();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
retro_main_log_file_init("/retroarch-log.txt");
|
||||
#endif
|
||||
|
||||
/* This situation can happen on some loaders so we really need some
|
||||
fake args or else retroarch will just crash on parsing NULL pointers */
|
||||
@ -253,6 +231,8 @@ static void frontend_gx_get_environment_settings(
|
||||
"savefiles", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
#ifdef IS_SALAMANDER
|
||||
if (*argc > 2 && argv[1] != NULL && argv[2] != NULL)
|
||||
@ -326,15 +306,8 @@ static void frontend_gx_init(void *data)
|
||||
|
||||
fatInitDefault();
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
devoptab_list[STD_OUT] = &dotab_stdout;
|
||||
devoptab_list[STD_ERR] = &dotab_stdout;
|
||||
dotab_stdout.write_r = gx_logger_net;
|
||||
#elif defined(HAVE_FILE_LOGGER) && !defined(IS_SALAMANDER)
|
||||
devoptab_list[STD_OUT] = &dotab_stdout;
|
||||
devoptab_list[STD_ERR] = &dotab_stdout;
|
||||
dotab_stdout.write_r = gx_logger_file;
|
||||
#endif
|
||||
|
||||
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
|
||||
gx_devices[GX_DEVICE_SD].interface = &__io_wiisd;
|
||||
@ -575,5 +548,6 @@ frontend_ctx_driver_t frontend_ctx_gx = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"gx",
|
||||
};
|
||||
|
@ -48,5 +48,6 @@ frontend_ctx_driver_t frontend_ctx_null = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"null",
|
||||
};
|
||||
|
@ -169,6 +169,8 @@ static void frontend_orbis_get_environment_settings(int *argc, char *argv[],
|
||||
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], user_path,
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY],
|
||||
user_path, sizeof(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]));
|
||||
fill_pathname_join(g_defaults.path.config, user_path,
|
||||
@ -367,5 +369,6 @@ frontend_ctx_driver_t frontend_ctx_orbis = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"orbis",
|
||||
};
|
||||
|
@ -23,49 +23,16 @@
|
||||
#include <sifrpc.h>
|
||||
#include <iopcontrol.h>
|
||||
#include <libpwroff.h>
|
||||
#include <libmc.h>
|
||||
#include <libmtap.h>
|
||||
#include <audsrv.h>
|
||||
#include <libpad.h>
|
||||
#include <libcdvd-common.h>
|
||||
#include <cdvd_rpc.h>
|
||||
#include <fileXio_cdvd.h>
|
||||
#include <ps2_devices.h>
|
||||
|
||||
|
||||
extern unsigned char poweroff_irx_start[];
|
||||
extern unsigned int poweroff_irx_size;
|
||||
|
||||
extern unsigned char ps2dev9_irx_start[];
|
||||
extern unsigned int ps2dev9_irx_size;
|
||||
|
||||
extern unsigned char ps2atad_irx_start[];
|
||||
extern unsigned int ps2atad_irx_size;
|
||||
|
||||
extern unsigned char ps2hdd_irx_start[];
|
||||
extern unsigned int ps2hdd_irx_size;
|
||||
|
||||
extern unsigned char ps2fs_irx_start[];
|
||||
extern unsigned int ps2fs_irx_size;
|
||||
|
||||
extern unsigned char iomanX_irx_start[];
|
||||
extern unsigned int iomanX_irx_size;
|
||||
|
||||
extern unsigned char fileXio_irx_start[];
|
||||
extern unsigned int fileXio_irx_size;
|
||||
|
||||
extern unsigned char freesd_irx_start[];
|
||||
extern unsigned int freesd_irx_size;
|
||||
|
||||
extern unsigned char audsrv_irx_start[];
|
||||
extern unsigned int audsrv_irx_size;
|
||||
|
||||
extern unsigned char usbd_irx_start[];
|
||||
extern unsigned int usbd_irx_size;
|
||||
|
||||
extern unsigned char usbhdfsd_irx_start[];
|
||||
extern unsigned int usbhdfsd_irx_size;
|
||||
|
||||
extern unsigned char mcman_irx_start[];
|
||||
extern unsigned int mcman_irx_size;
|
||||
|
||||
extern unsigned char mcserv_irx_start[];
|
||||
extern unsigned int mcserv_irx_size;
|
||||
#include <ps2_irx_variables.h>
|
||||
#include <ps2_descriptor.h>
|
||||
|
||||
char eboot_path[512];
|
||||
char user_path[512];
|
||||
@ -110,6 +77,8 @@ static void create_path_names(void)
|
||||
"SCREENSHOTS", sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM], user_path,
|
||||
"SYSTEM", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
"LOGS", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
/* cache dir */
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE], user_path,
|
||||
@ -196,36 +165,59 @@ static void frontend_ps2_init(void *data)
|
||||
SifInitRpc(0);
|
||||
sbv_patch_enable_lmb();
|
||||
|
||||
/* Controllers */
|
||||
SifLoadModule("rom0:SIO2MAN", 0, NULL);
|
||||
SifLoadModule("rom0:PADMAN", 0, NULL);
|
||||
|
||||
/* I/O Files */
|
||||
SifExecModuleBuffer(iomanX_irx_start, iomanX_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(fileXio_irx_start, fileXio_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&iomanX_irx, size_iomanX_irx, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&fileXio_irx, size_fileXio_irx, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&freesio2_irx, size_freesio2_irx, 0, NULL, NULL);
|
||||
|
||||
/* Memory Card */
|
||||
SifExecModuleBuffer(mcman_irx_start, mcman_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(mcserv_irx_start, mcserv_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&mcman_irx, size_mcman_irx, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&mcserv_irx, size_mcserv_irx, 0, NULL, NULL);
|
||||
|
||||
/* Controllers */
|
||||
SifExecModuleBuffer(&freemtap_irx, size_freemtap_irx, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&freepad_irx, size_freepad_irx, 0, NULL, NULL);
|
||||
|
||||
/* USB */
|
||||
SifExecModuleBuffer(usbd_irx_start, usbd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(usbhdfsd_irx_start, usbhdfsd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&usbd_irx, size_usbd_irx, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&usbhdfsd_irx, size_usbhdfsd_irx, 0, NULL, NULL);
|
||||
|
||||
/* Audio */
|
||||
SifExecModuleBuffer(freesd_irx_start, freesd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(audsrv_irx_start, audsrv_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&freesd_irx, size_freesd_irx, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(&audsrv_irx, size_audsrv_irx, 0, NULL, NULL);
|
||||
|
||||
/* CDVD */
|
||||
SifExecModuleBuffer(&cdvd_irx, size_cdvd_irx, 0, NULL, NULL);
|
||||
|
||||
if (mcInit(MC_TYPE_XMC)) {
|
||||
RARCH_ERR("mcInit library not initalizated\n");
|
||||
}
|
||||
|
||||
/* Initializes audsrv library */
|
||||
if (audsrv_init()) {
|
||||
RARCH_ERR("audsrv library not initalizated\n");
|
||||
}
|
||||
|
||||
/* Initializes pad library
|
||||
/* Initializes pad libraries
|
||||
Must be init with 0 as parameter*/
|
||||
if (mtapInit() != 1) {
|
||||
RARCH_ERR("mtapInit library not initalizated\n");
|
||||
}
|
||||
if (padInit(0) != 1) {
|
||||
RARCH_ERR("padInit library not initalizated\n");
|
||||
}
|
||||
if (mtapPortOpen(0) != 1) {
|
||||
RARCH_ERR("mtapPortOpen library not initalizated\n");
|
||||
}
|
||||
|
||||
/* Initializes CDVD library */
|
||||
/* SCECdINoD init without check for a disc. Reduces risk of a lockup if the drive is in a erroneous state. */
|
||||
sceCdInit(SCECdINoD);
|
||||
if (CDVD_Init() != 1) {
|
||||
RARCH_ERR("CDVD_Init library not initalizated\n");
|
||||
}
|
||||
|
||||
_init_ps2_io();
|
||||
|
||||
/* Prepare device */
|
||||
getcwd(cwd, sizeof(cwd));
|
||||
@ -245,6 +237,8 @@ static void frontend_ps2_deinit(void *data)
|
||||
verbosity_disable();
|
||||
command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL);
|
||||
#endif
|
||||
_free_ps2_io();
|
||||
CDVD_Stop();
|
||||
padEnd();
|
||||
audsrv_quit();
|
||||
fileXioExit();
|
||||
@ -359,6 +353,11 @@ static int frontend_ps2_parse_drive_list(void *data, bool load_content)
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
menu_entries_append_enum(list,
|
||||
rootDevicePath(BOOT_DEVICE_CDFS),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
menu_entries_append_enum(list,
|
||||
rootDevicePath(BOOT_DEVICE_MASS),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
@ -416,5 +415,6 @@ frontend_ctx_driver_t frontend_ctx_ps2 = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"null",
|
||||
};
|
||||
|
@ -263,6 +263,9 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
}
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
@ -636,5 +639,6 @@ frontend_ctx_driver_t frontend_ctx_ps3 = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"ps3",
|
||||
};
|
||||
|
@ -147,6 +147,8 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
|
||||
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], user_path,
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY],
|
||||
user_path, sizeof(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]));
|
||||
fill_pathname_join(g_defaults.path.config, user_path,
|
||||
@ -177,6 +179,8 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
|
||||
"SCREENSHOTS", sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM], user_path,
|
||||
"SYSTEM", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
"LOGS", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
/* cache dir */
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE], user_path,
|
||||
@ -530,6 +534,7 @@ frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
#ifdef VITA
|
||||
"vita",
|
||||
#else
|
||||
|
@ -130,6 +130,8 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[],
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAIL]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS], user_path,
|
||||
"wallpapers", sizeof(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
/* tmp */
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CACHE],
|
||||
@ -206,5 +208,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"qnx",
|
||||
};
|
||||
|
@ -223,6 +223,9 @@ static void frontend_switch_get_environment_settings(int *argc, char *argv[], vo
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
int i = 0;
|
||||
for (i; i < DEFAULT_DIR_LAST; i++)
|
||||
{
|
||||
@ -942,5 +945,6 @@ frontend_ctx_driver_t frontend_ctx_switch =
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"switch",
|
||||
};
|
||||
|
@ -1660,6 +1660,10 @@ static void frontend_unix_get_env(int *argc,
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
}
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
internal_storage_app_path, "logs",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
break;
|
||||
|
||||
/* only the internal app dir is writable, this should never happen*/
|
||||
@ -1722,6 +1726,10 @@ static void frontend_unix_get_env(int *argc,
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
}
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
app_dir, "logs",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
break;
|
||||
/* sdcard is writable, this should be the case most of the time*/
|
||||
case INTERNAL_STORAGE_WRITABLE:
|
||||
@ -1742,6 +1750,10 @@ static void frontend_unix_get_env(int *argc,
|
||||
internal_storage_path, "RetroArch/downloads",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
internal_storage_path, "RetroArch/logs",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG],
|
||||
internal_storage_path, "RetroArch/config",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG]));
|
||||
@ -1908,6 +1920,8 @@ static void frontend_unix_get_env(int *argc,
|
||||
"screenshots", sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS], base_path,
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAILS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], base_path,
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
#endif
|
||||
|
||||
for (i = 0; i < DEFAULT_DIR_LAST; i++)
|
||||
@ -2038,6 +2052,8 @@ static void frontend_unix_init(void *data)
|
||||
"setScreenOrientation", "(I)V");
|
||||
GET_METHOD_ID(env, android_app->doVibrate, class,
|
||||
"doVibrate", "(IIII)V");
|
||||
GET_METHOD_ID(env, android_app->getUserLanguageString, class,
|
||||
"getUserLanguageString", "()Ljava/lang/String;");
|
||||
CALL_OBJ_METHOD(env, obj, android_app->activity->clazz,
|
||||
android_app->getIntent);
|
||||
|
||||
@ -2480,6 +2496,37 @@ static const char* frontend_unix_get_cpu_model_name(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
enum retro_language frontend_unix_get_user_language(void)
|
||||
{
|
||||
enum retro_language lang = RETRO_LANGUAGE_ENGLISH;
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
#ifdef ANDROID
|
||||
jstring jstr = NULL;
|
||||
JNIEnv *env = jni_thread_getenv();
|
||||
|
||||
if (!env || !g_android)
|
||||
return lang;
|
||||
|
||||
if (g_android->getUserLanguageString)
|
||||
{
|
||||
CALL_OBJ_METHOD(env, jstr, g_android->activity->clazz, g_android->getUserLanguageString);
|
||||
|
||||
if (jstr)
|
||||
{
|
||||
const char *langStr = (*env)->GetStringUTFChars(env, jstr, 0);
|
||||
|
||||
lang = rarch_get_language_from_iso(langStr);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, jstr, langStr);
|
||||
}
|
||||
}
|
||||
#else
|
||||
lang = rarch_get_language_from_iso(getenv("LANG"));
|
||||
#endif
|
||||
#endif
|
||||
return lang;
|
||||
}
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_unix = {
|
||||
frontend_unix_get_env, /* environment_get */
|
||||
frontend_unix_init, /* init */
|
||||
@ -2525,6 +2572,7 @@ frontend_ctx_driver_t frontend_ctx_unix = {
|
||||
frontend_unix_check_for_path_changes,
|
||||
frontend_unix_set_sustained_performance_mode,
|
||||
frontend_unix_get_cpu_model_name,
|
||||
frontend_unix_get_user_language,
|
||||
#ifdef ANDROID
|
||||
"android"
|
||||
#else
|
||||
|
@ -163,6 +163,7 @@ struct android_app
|
||||
jmethodID getBatteryLevel;
|
||||
jmethodID setSustainedPerformanceMode;
|
||||
jmethodID setScreenOrientation;
|
||||
jmethodID getUserLanguageString;
|
||||
jmethodID doVibrate;
|
||||
};
|
||||
|
||||
|
@ -374,6 +374,8 @@ static void frontend_uwp_environment_get(int *argc, char *argv[],
|
||||
"~\\states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
||||
"~\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
"~\\logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
@ -445,5 +447,6 @@ frontend_ctx_driver_t frontend_ctx_uwp = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"uwp"
|
||||
};
|
||||
|
@ -104,6 +104,8 @@ static void frontend_wiiu_get_environment_settings(int *argc, char *argv[],
|
||||
"database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CURSOR], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"database/cursors", sizeof(g_defaults.dirs[DEFAULT_DIR_CURSOR]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config));
|
||||
|
||||
@ -300,6 +302,7 @@ frontend_ctx_driver_t frontend_ctx_wiiu =
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"wiiu",
|
||||
NULL, /* get_video_driver */
|
||||
};
|
||||
|
@ -465,7 +465,8 @@ static void frontend_win32_environment_get(int *argc, char *argv[],
|
||||
":\\states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
||||
":\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
|
||||
fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
":\\logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
#ifdef HAVE_MENU
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
snprintf(g_defaults.settings.menu,
|
||||
@ -574,6 +575,61 @@ static const char* frontend_win32_get_cpu_model_name(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
enum retro_language frontend_win32_get_user_language(void)
|
||||
{
|
||||
enum retro_language lang = RETRO_LANGUAGE_ENGLISH;
|
||||
#if defined(HAVE_LANGEXTRA) && !defined(_XBOX)
|
||||
#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500) || !defined(_MSC_VER)
|
||||
LANGID langid = GetUserDefaultUILanguage();
|
||||
unsigned i;
|
||||
|
||||
struct lang_pair
|
||||
{
|
||||
unsigned short lang_ident;
|
||||
enum retro_language lang;
|
||||
};
|
||||
|
||||
/* https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings */
|
||||
const struct lang_pair pairs[] =
|
||||
{
|
||||
{0x9, RETRO_LANGUAGE_ENGLISH},
|
||||
{0x11, RETRO_LANGUAGE_JAPANESE},
|
||||
{0xc, RETRO_LANGUAGE_FRENCH},
|
||||
{0xa, RETRO_LANGUAGE_SPANISH},
|
||||
{0x7, RETRO_LANGUAGE_GERMAN},
|
||||
{0x10, RETRO_LANGUAGE_ITALIAN},
|
||||
{0x13, RETRO_LANGUAGE_DUTCH},
|
||||
{0x416, RETRO_LANGUAGE_PORTUGUESE_BRAZIL},
|
||||
{0x816, RETRO_LANGUAGE_PORTUGUESE_PORTUGAL},
|
||||
{0x16, RETRO_LANGUAGE_PORTUGUESE_PORTUGAL},
|
||||
{0x19, RETRO_LANGUAGE_RUSSIAN},
|
||||
{0x12, RETRO_LANGUAGE_KOREAN},
|
||||
{0xC04, RETRO_LANGUAGE_CHINESE_TRADITIONAL}, /* HK/PRC */
|
||||
{0x1404, RETRO_LANGUAGE_CHINESE_TRADITIONAL}, /* MO */
|
||||
{0x1004, RETRO_LANGUAGE_CHINESE_SIMPLIFIED}, /* SG */
|
||||
{0x7c04, RETRO_LANGUAGE_CHINESE_TRADITIONAL}, /* neutral */
|
||||
{0x4, RETRO_LANGUAGE_CHINESE_SIMPLIFIED}, /* neutral */
|
||||
/* MS does not support Esperanto */
|
||||
/*{0x0, RETRO_LANGUAGE_ESPERANTO},*/
|
||||
{0x15, RETRO_LANGUAGE_POLISH},
|
||||
{0x2a, RETRO_LANGUAGE_VIETNAMESE},
|
||||
{0x1, RETRO_LANGUAGE_ARABIC},
|
||||
{0x8, RETRO_LANGUAGE_GREEK},
|
||||
};
|
||||
|
||||
for (i = 0; i < sizeof(pairs) / sizeof(pairs[0]); i++)
|
||||
{
|
||||
if ((langid & pairs[i].lang_ident) == pairs[i].lang_ident)
|
||||
{
|
||||
lang = pairs[i].lang;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return lang;
|
||||
}
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||
frontend_win32_environment_get,
|
||||
frontend_win32_init,
|
||||
@ -602,5 +658,6 @@ frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
frontend_win32_get_cpu_model_name,
|
||||
frontend_win32_get_user_language,
|
||||
"win32"
|
||||
};
|
||||
|
@ -132,6 +132,9 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
#elif defined(_XBOX360)
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"game:",
|
||||
@ -152,6 +155,9 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
||||
"game:\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
"game:\\logs",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
#endif
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
@ -428,5 +434,6 @@ frontend_ctx_driver_t frontend_ctx_xdk = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"xdk",
|
||||
};
|
||||
|
@ -95,5 +95,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
"xenon",
|
||||
};
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#if defined(_3DS)
|
||||
#include <3ds.h>
|
||||
@ -464,4 +465,12 @@ const char* frontend_driver_get_cpu_model_name(void)
|
||||
return NULL;
|
||||
return frontend->get_cpu_model_name();
|
||||
}
|
||||
|
||||
enum retro_language frontend_driver_get_user_language(void)
|
||||
{
|
||||
frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||
if (!frontend || !frontend->get_user_language)
|
||||
return RETRO_LANGUAGE_ENGLISH;
|
||||
return frontend->get_user_language();
|
||||
}
|
||||
#endif
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <retro_common_api.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#include <libretro.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum frontend_powerstate
|
||||
@ -107,6 +109,7 @@ typedef struct frontend_ctx_driver
|
||||
bool (*check_for_path_changes)(path_change_data_t *change_data);
|
||||
void (*set_sustained_performance_mode)(bool on);
|
||||
const char* (*get_cpu_model_name)(void);
|
||||
enum retro_language (*get_user_language)(void);
|
||||
|
||||
const char *ident;
|
||||
|
||||
@ -214,6 +217,8 @@ void frontend_driver_set_sustained_performance_mode(bool on);
|
||||
|
||||
const char* frontend_driver_get_cpu_model_name(void);
|
||||
|
||||
enum retro_language frontend_driver_get_user_language(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -42,11 +42,12 @@ typedef struct
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CTR_VIDEO_MODE_NORMAL,
|
||||
CTR_VIDEO_MODE_800x240,
|
||||
CTR_VIDEO_MODE_400x240,
|
||||
CTR_VIDEO_MODE_3D
|
||||
}ctr_video_mode_enum;
|
||||
CTR_VIDEO_MODE_3D = 0,
|
||||
CTR_VIDEO_MODE_2D,
|
||||
CTR_VIDEO_MODE_2D_400x240,
|
||||
CTR_VIDEO_MODE_2D_800x240,
|
||||
CTR_VIDEO_MODE_LAST
|
||||
} ctr_video_mode_enum;
|
||||
|
||||
typedef struct ctr_video
|
||||
{
|
||||
@ -95,8 +96,9 @@ typedef struct ctr_video
|
||||
unsigned rotation;
|
||||
bool keep_aspect;
|
||||
bool should_resize;
|
||||
bool lcd_buttom_on;
|
||||
bool msg_rendering_enabled;
|
||||
bool supports_parallax_disable;
|
||||
bool enable_3d;
|
||||
|
||||
void* empty_framebuffer;
|
||||
|
||||
|
@ -515,6 +515,8 @@ static INLINE INT32 d3d8_get_xrgb8888_format(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void d3d8_set_mvp(void *data, const void *userdata);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -812,6 +812,8 @@ static INLINE void d3d9_convert_geometry(
|
||||
}
|
||||
}
|
||||
|
||||
void d3d9_set_mvp(void *data, const void *userdata);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -75,6 +75,14 @@ typedef struct gl1
|
||||
bool smooth;
|
||||
bool menu_smooth;
|
||||
void *readback_buffer_screenshot;
|
||||
bool overlay_enable;
|
||||
bool overlay_full_screen;
|
||||
GLuint *overlay_tex;
|
||||
unsigned overlays;
|
||||
float *overlay_vertex_coord;
|
||||
float *overlay_tex_coord;
|
||||
float *overlay_color_coord;
|
||||
bool fullscreen;
|
||||
} gl1_t;
|
||||
|
||||
static INLINE void gl1_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter,
|
||||
|
@ -744,12 +744,14 @@ static const NSUInteger kConstantAlignment = 4;
|
||||
|
||||
- (bool)allocRange:(BufferRange *)range length:(NSUInteger)length
|
||||
{
|
||||
bzero(range, sizeof(*range));
|
||||
MTLResourceOptions opts;
|
||||
|
||||
memset(range, 0, sizeof(*range));
|
||||
|
||||
#if TARGET_OS_OSX
|
||||
MTLResourceOptions opts = MTLResourceStorageModeManaged;
|
||||
opts = MTLResourceStorageModeManaged;
|
||||
#else
|
||||
MTLResourceOptions opts = MTLResourceStorageModeShared;
|
||||
opts = MTLResourceStorageModeShared;
|
||||
#endif
|
||||
|
||||
if (!_head)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2016-2017 - Hans-Kristian Arntzen
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
@ -618,7 +618,7 @@ struct vk_texture vulkan_create_texture(vk_t *vk,
|
||||
RARCH_LOG("[Vulkan]: GPU supports linear images as textures, but not DEVICE_LOCAL. Falling back to copy path.\n");
|
||||
type = VULKAN_TEXTURE_STAGING;
|
||||
vkDestroyImage(device, tex.image, NULL);
|
||||
tex.image = NULL;
|
||||
tex.image = (VkImage)NULL;
|
||||
info.initialLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
||||
buffer_info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
|
||||
@ -1580,7 +1580,7 @@ static bool vulkan_find_device_extensions(VkPhysicalDevice gpu,
|
||||
goto end;
|
||||
}
|
||||
|
||||
memcpy(enabled, exts, num_exts * sizeof(*exts));
|
||||
memcpy((void*)enabled, exts, num_exts * sizeof(*exts));
|
||||
*enabled_count = num_exts;
|
||||
|
||||
for (i = 0; i < num_optional_exts; i++)
|
||||
|
@ -572,17 +572,17 @@ bool x11_alive(void *data)
|
||||
|
||||
case KeyRelease:
|
||||
/* When you receive a key release and the next event is a key press
|
||||
of the same key combination, then it's auto-repeat and the
|
||||
of the same key combination, then it's auto-repeat and the
|
||||
key wasn't actually released. */
|
||||
if(XEventsQueued(g_x11_dpy, QueuedAfterReading))
|
||||
{
|
||||
XEvent next_event;
|
||||
XPeekEvent(g_x11_dpy, &next_event);
|
||||
if (next_event.type == KeyPress &&
|
||||
if (next_event.type == KeyPress &&
|
||||
next_event.xkey.time == event.xkey.time &&
|
||||
next_event.xkey.keycode == event.xkey.keycode)
|
||||
{
|
||||
break; // Key wasn't actually released
|
||||
break; /* Key wasn't actually released */
|
||||
}
|
||||
}
|
||||
case KeyPress:
|
||||
|
@ -57,6 +57,7 @@ typedef struct
|
||||
bool decorations;
|
||||
} dispserv_x11_t;
|
||||
|
||||
#ifdef HAVE_XRANDR
|
||||
static Display* x11_display_server_open_display(void)
|
||||
{
|
||||
Display *dpy = g_x11_dpy;
|
||||
@ -72,7 +73,9 @@ static Display* x11_display_server_open_display(void)
|
||||
|
||||
return dpy;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XRANDR
|
||||
static void x11_display_server_close_display(Display *dpy)
|
||||
{
|
||||
if (!dpy || x11_display_server_using_global_dpy || dpy == g_x11_dpy)
|
||||
@ -80,6 +83,7 @@ static void x11_display_server_close_display(Display *dpy)
|
||||
|
||||
XCloseDisplay(dpy);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void* x11_display_server_init(void)
|
||||
{
|
||||
|
@ -306,8 +306,6 @@ static void caca_set_osd_msg(void *data,
|
||||
|
||||
static const video_poke_interface_t caca_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -53,46 +53,59 @@
|
||||
* when reinitialising... */
|
||||
static bool ctr_bottom_screen_enabled = true;
|
||||
|
||||
static INLINE void ctr_check_3D_slider(ctr_video_t* ctr)
|
||||
static INLINE void ctr_check_3D_slider(ctr_video_t* ctr, ctr_video_mode_enum video_mode)
|
||||
{
|
||||
float slider_val = *(float*)0x1FF81080;
|
||||
ctr_video_mode_enum old_mode = ctr->video_mode;
|
||||
|
||||
if (slider_val == 0.0)
|
||||
ctr->video_mode = CTR_VIDEO_MODE_NORMAL;
|
||||
else if (slider_val < 0.2)
|
||||
ctr->video_mode = CTR_VIDEO_MODE_800x240;
|
||||
else if (slider_val < 0.5)
|
||||
ctr->video_mode = CTR_VIDEO_MODE_400x240;
|
||||
else
|
||||
ctr->video_mode = CTR_VIDEO_MODE_3D;
|
||||
|
||||
if (ctr->video_mode)
|
||||
if (slider_val == 0.0f)
|
||||
{
|
||||
switch (ctr->video_mode)
|
||||
{
|
||||
case CTR_VIDEO_MODE_800x240:
|
||||
case CTR_VIDEO_MODE_400x240:
|
||||
ctr_set_parallax_layer(false);
|
||||
break;
|
||||
case CTR_VIDEO_MODE_3D:
|
||||
{
|
||||
s16 offset = (slider_val - 0.6) * 10.0;
|
||||
ctr->frame_coords[1] = ctr->frame_coords[0];
|
||||
ctr->frame_coords[2] = ctr->frame_coords[0];
|
||||
ctr->video_mode = CTR_VIDEO_MODE_2D;
|
||||
ctr->enable_3d = false;
|
||||
return;
|
||||
}
|
||||
|
||||
ctr->frame_coords[1].x0 -= offset;
|
||||
ctr->frame_coords[1].x1 -= offset;
|
||||
ctr->frame_coords[2].x0 += offset;
|
||||
ctr->frame_coords[2].x1 += offset;
|
||||
switch (video_mode)
|
||||
{
|
||||
case CTR_VIDEO_MODE_3D:
|
||||
{
|
||||
s16 offset = slider_val * 10.0f;
|
||||
|
||||
GSPGPU_FlushDataCache(ctr->frame_coords, 3 * sizeof(ctr_vertex_t));
|
||||
ctr->video_mode = CTR_VIDEO_MODE_3D;
|
||||
|
||||
ctr->frame_coords[1] = ctr->frame_coords[0];
|
||||
ctr->frame_coords[2] = ctr->frame_coords[0];
|
||||
|
||||
ctr->frame_coords[1].x0 -= offset;
|
||||
ctr->frame_coords[1].x1 -= offset;
|
||||
ctr->frame_coords[2].x0 += offset;
|
||||
ctr->frame_coords[2].x1 += offset;
|
||||
|
||||
GSPGPU_FlushDataCache(ctr->frame_coords, 3 * sizeof(ctr_vertex_t));
|
||||
|
||||
if (ctr->supports_parallax_disable)
|
||||
ctr_set_parallax_layer(true);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ctr->enable_3d = true;
|
||||
}
|
||||
break;
|
||||
case CTR_VIDEO_MODE_2D_400x240:
|
||||
case CTR_VIDEO_MODE_2D_800x240:
|
||||
if (ctr->supports_parallax_disable)
|
||||
{
|
||||
ctr->video_mode = video_mode;
|
||||
ctr_set_parallax_layer(false);
|
||||
ctr->enable_3d = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctr->video_mode = CTR_VIDEO_MODE_2D;
|
||||
ctr->enable_3d = false;
|
||||
}
|
||||
break;
|
||||
case CTR_VIDEO_MODE_2D:
|
||||
default:
|
||||
ctr->video_mode = CTR_VIDEO_MODE_2D;
|
||||
ctr->enable_3d = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,13 +141,12 @@ static INLINE void ctr_set_screen_coords(ctr_video_t * ctr)
|
||||
}
|
||||
}
|
||||
|
||||
static void ctr_update_viewport(ctr_video_t* ctr, video_frame_info_t *video_info)
|
||||
static void ctr_update_viewport(ctr_video_t* ctr, settings_t *settings, video_frame_info_t *video_info)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
float width = ctr->vp.full_width;
|
||||
float height = ctr->vp.full_height;
|
||||
settings_t *settings = config_get_ptr();
|
||||
float desired_aspect = video_driver_get_aspect_ratio();
|
||||
|
||||
if(ctr->rotation & 0x1)
|
||||
@ -248,7 +260,7 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param)
|
||||
ctr->p3d_event_pending = false;
|
||||
}
|
||||
|
||||
if((hook == APTHOOK_ONSUSPEND) && (ctr->video_mode == CTR_VIDEO_MODE_400x240))
|
||||
if((hook == APTHOOK_ONSUSPEND) && (ctr->video_mode == CTR_VIDEO_MODE_2D_400x240))
|
||||
{
|
||||
memcpy(gfxTopRightFramebuffers[ctr->current_buffer_top],
|
||||
gfxTopLeftFramebuffers[ctr->current_buffer_top],
|
||||
@ -256,7 +268,7 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param)
|
||||
GSPGPU_FlushDataCache(gfxTopRightFramebuffers[ctr->current_buffer_top], 400 * 240 * 3);
|
||||
}
|
||||
|
||||
if ((hook == APTHOOK_ONSUSPEND))
|
||||
if ((hook == APTHOOK_ONSUSPEND) && ctr->supports_parallax_disable)
|
||||
ctr_set_parallax_layer(*(float*)0x1FF81080 != 0.0);
|
||||
|
||||
if((hook == APTHOOK_ONSUSPEND) || (hook == APTHOOK_ONRESTORE))
|
||||
@ -317,9 +329,10 @@ static void* ctr_init(const video_info_t* video,
|
||||
const input_driver_t** input, void** input_data)
|
||||
{
|
||||
float refresh_rate;
|
||||
void* ctrinput = NULL;
|
||||
u8 device_model = 0xFF;
|
||||
void* ctrinput = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
ctr_video_t* ctr = (ctr_video_t*)linearAlloc(sizeof(ctr_video_t));
|
||||
ctr_video_t* ctr = (ctr_video_t*)linearAlloc(sizeof(ctr_video_t));
|
||||
|
||||
if (!ctr)
|
||||
return NULL;
|
||||
@ -455,9 +468,15 @@ static void* ctr_init(const video_info_t* video,
|
||||
ctr->should_resize = true;
|
||||
ctr->smooth = video->smooth;
|
||||
ctr->vsync = video->vsync;
|
||||
ctr->lcd_buttom_on = true; /* Unused */
|
||||
ctr->current_buffer_top = 0;
|
||||
|
||||
/* Only O3DS and O3DSXL support running in 'dual-framebuffer'
|
||||
* mode with the parallax barrier disabled
|
||||
* (i.e. these are the only platforms that can use
|
||||
* CTR_VIDEO_MODE_2D_400x240 and CTR_VIDEO_MODE_2D_800x240) */
|
||||
CFGU_GetSystemModel(&device_model); /* (0 = O3DS, 1 = O3DSXL, 2 = N3DS, 3 = 2DS, 4 = N3DSXL, 5 = N2DSXL) */
|
||||
ctr->supports_parallax_disable = (device_model == 0) || (device_model == 1);
|
||||
|
||||
ctr->empty_framebuffer = linearAlloc(320 * 240 * 2);
|
||||
memset(ctr->empty_framebuffer, 0, 320 * 240 * 2);
|
||||
|
||||
@ -500,6 +519,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
extern u8* gfxSharedMemory;
|
||||
extern u8 gfxThreadID;
|
||||
uint32_t state_tmp = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
ctr_video_t *ctr = (ctr_video_t*)data;
|
||||
static float fps = 0.0;
|
||||
static int total_frames = 0;
|
||||
@ -507,7 +527,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
|
||||
extern bool select_pressed;
|
||||
|
||||
if (!width || !height)
|
||||
if (!width || !height || !settings)
|
||||
{
|
||||
gspWaitForEvent(GSPGPU_EVENT_VBlank0, true);
|
||||
return true;
|
||||
@ -542,7 +562,6 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
gspWaitForEvent(GSPGPU_EVENT_PPF, false);
|
||||
ctr->ppf_event_pending = false;
|
||||
}
|
||||
frames++;
|
||||
#ifndef HAVE_THREADS
|
||||
if(task_queue_find(&ctr_tasks_finder_data))
|
||||
{
|
||||
@ -560,72 +579,120 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
}
|
||||
#endif
|
||||
if (ctr->vsync)
|
||||
gspWaitForEvent(GSPGPU_EVENT_VBlank0, false);
|
||||
{
|
||||
/* If we are running at the display refresh rate,
|
||||
* then all is well - just wait on the *current* VBlank0
|
||||
* event and carry on.
|
||||
*
|
||||
* If we are running at below the display refresh rate,
|
||||
* then we have problems: frame updates will happen
|
||||
* entirely out of sync with VBlank0 events. To elaborate,
|
||||
* we'll wait for a VBlank0 here, but it will already have
|
||||
* happened partway through the previous frame. So it's:
|
||||
* 'oh good - let's render the current frame', but the next
|
||||
* VBlank0 will occur in less time than it takes to draw the
|
||||
* current frame, resulting in 'overlap' and screen tearing.
|
||||
*
|
||||
* This seems to be a consequence of using the GPU directly.
|
||||
* Other 3DS homebrew typically uses the ctrulib function
|
||||
* gfxSwapBuffers(), which ensures an immediate buffer
|
||||
* swap every time, and no tearing. We can't do this:
|
||||
* instead, we use a variant of the ctrulib function
|
||||
* gfxSwapBuffersGpu(), which seems to send a notification,
|
||||
* and the swap happens when it happens...
|
||||
*
|
||||
* I don't know how to fix this 'properly' (probably needs
|
||||
* some low level rewriting, maybe switching to an implementation
|
||||
* based on citro3d), but I can at least implement a hack/workaround
|
||||
* that allows 50Hz content to be run without tearing. This involves
|
||||
* the following:
|
||||
*
|
||||
* If content frame rate is more than 10% lower than the 3DS
|
||||
* display refresh rate, don't wait on the *current* VBlank0
|
||||
* event (because it is 'tainted'), but instead wait on the
|
||||
* *next* VBlank0 event (which will ensure we have enough time
|
||||
* to write/flush the display buffers).
|
||||
*
|
||||
* This fixes screen tearing, but it has a significant impact on
|
||||
* performance...
|
||||
* */
|
||||
bool next_event = false;
|
||||
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
|
||||
if (av_info)
|
||||
next_event = av_info->timing.fps < video_info->refresh_rate * 0.9f;
|
||||
gspWaitForEvent(GSPGPU_EVENT_VBlank0, next_event);
|
||||
}
|
||||
|
||||
ctr->vsync_event_pending = true;
|
||||
|
||||
currentTick = svcGetSystemTick();
|
||||
diff = currentTick - lastTick;
|
||||
if(diff > CTR_CPU_TICKS_PER_SECOND)
|
||||
/* Internal counters/statistics
|
||||
* > This is only required if the bottom screen is enabled */
|
||||
if (ctr_bottom_screen_enabled)
|
||||
{
|
||||
fps = (float)frames * ((float) CTR_CPU_TICKS_PER_SECOND / (float) diff);
|
||||
lastTick = currentTick;
|
||||
frames = 0;
|
||||
}
|
||||
frames++;
|
||||
currentTick = svcGetSystemTick();
|
||||
diff = currentTick - lastTick;
|
||||
if(diff > CTR_CPU_TICKS_PER_SECOND)
|
||||
{
|
||||
fps = (float)frames * ((float) CTR_CPU_TICKS_PER_SECOND / (float) diff);
|
||||
lastTick = currentTick;
|
||||
frames = 0;
|
||||
}
|
||||
|
||||
#ifdef CTR_INSPECT_MEMORY_USAGE
|
||||
uint32_t ctr_get_stack_usage(void);
|
||||
void ctr_linear_get_stats(void);
|
||||
extern u32 __linear_heap_size;
|
||||
extern u32 __heap_size;
|
||||
uint32_t ctr_get_stack_usage(void);
|
||||
void ctr_linear_get_stats(void);
|
||||
extern u32 __linear_heap_size;
|
||||
extern u32 __heap_size;
|
||||
|
||||
MemInfo mem_info;
|
||||
PageInfo page_info;
|
||||
u32 query_addr = 0x08000000;
|
||||
printf(PRINTFPOS(0,0));
|
||||
while (query_addr < 0x40000000)
|
||||
{
|
||||
svcQueryMemory(&mem_info, &page_info, query_addr);
|
||||
printf("0x%08X --> 0x%08X (0x%08X) \n", mem_info.base_addr, mem_info.base_addr + mem_info.size, mem_info.size);
|
||||
query_addr = mem_info.base_addr + mem_info.size;
|
||||
if(query_addr == 0x1F000000)
|
||||
query_addr = 0x30000000;
|
||||
}
|
||||
MemInfo mem_info;
|
||||
PageInfo page_info;
|
||||
u32 query_addr = 0x08000000;
|
||||
printf(PRINTFPOS(0,0));
|
||||
while (query_addr < 0x40000000)
|
||||
{
|
||||
svcQueryMemory(&mem_info, &page_info, query_addr);
|
||||
printf("0x%08X --> 0x%08X (0x%08X) \n", mem_info.base_addr, mem_info.base_addr + mem_info.size, mem_info.size);
|
||||
query_addr = mem_info.base_addr + mem_info.size;
|
||||
if(query_addr == 0x1F000000)
|
||||
query_addr = 0x30000000;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static u32* dummy_pointer;
|
||||
if(total_frames == 500)
|
||||
dummy_pointer = malloc(0x2000000);
|
||||
if(total_frames == 1000)
|
||||
free(dummy_pointer);
|
||||
static u32* dummy_pointer;
|
||||
if(total_frames == 500)
|
||||
dummy_pointer = malloc(0x2000000);
|
||||
if(total_frames == 1000)
|
||||
free(dummy_pointer);
|
||||
#endif
|
||||
|
||||
printf("========================================");
|
||||
printf("0x%08X 0x%08X 0x%08X\n", __heap_size, gpuCmdBufOffset, (__linear_heap_size - linearSpaceFree()));
|
||||
printf("fps: %8.4f frames: %i (%X)\n", fps, total_frames++, (__linear_heap_size - linearSpaceFree()));
|
||||
printf("========================================");
|
||||
u32 app_memory = *((u32*)0x1FF80040);
|
||||
u64 mem_used;
|
||||
svcGetSystemInfo(&mem_used, 0, 1);
|
||||
printf("total mem : 0x%08X \n", app_memory);
|
||||
printf("used: 0x%08X free: 0x%08X \n", (u32)mem_used, app_memory - (u32)mem_used);
|
||||
static u32 stack_usage = 0;
|
||||
extern u32 __stack_bottom;
|
||||
if(!(total_frames & 0x3F))
|
||||
stack_usage = ctr_get_stack_usage();
|
||||
printf("stack total:0x%08X used: 0x%08X\n", 0x10000000 - __stack_bottom, stack_usage);
|
||||
printf("========================================");
|
||||
printf("0x%08X 0x%08X 0x%08X\n", __heap_size, gpuCmdBufOffset, (__linear_heap_size - linearSpaceFree()));
|
||||
printf("fps: %8.4f frames: %i (%X)\n", fps, total_frames++, (__linear_heap_size - linearSpaceFree()));
|
||||
printf("========================================");
|
||||
u32 app_memory = *((u32*)0x1FF80040);
|
||||
u64 mem_used;
|
||||
svcGetSystemInfo(&mem_used, 0, 1);
|
||||
printf("total mem : 0x%08X \n", app_memory);
|
||||
printf("used: 0x%08X free: 0x%08X \n", (u32)mem_used, app_memory - (u32)mem_used);
|
||||
static u32 stack_usage = 0;
|
||||
extern u32 __stack_bottom;
|
||||
if(!(total_frames & 0x3F))
|
||||
stack_usage = ctr_get_stack_usage();
|
||||
printf("stack total:0x%08X used: 0x%08X\n", 0x10000000 - __stack_bottom, stack_usage);
|
||||
|
||||
printf("========================================");
|
||||
ctr_linear_get_stats();
|
||||
printf("========================================");
|
||||
printf("========================================");
|
||||
ctr_linear_get_stats();
|
||||
printf("========================================");
|
||||
|
||||
#else
|
||||
printf(PRINTFPOS(29,0)"fps: %8.4f frames: %i\r", fps, total_frames++);
|
||||
printf(PRINTFPOS(29,0)"fps: %8.4f frames: %i\r", fps, total_frames++);
|
||||
#endif
|
||||
fflush(stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
if (ctr->should_resize)
|
||||
ctr_update_viewport(ctr, video_info);
|
||||
ctr_update_viewport(ctr, settings, video_info);
|
||||
|
||||
ctrGuSetMemoryFill(true, (u32*)ctr->drawbuffers.top.left, 0x00000000,
|
||||
(u32*)ctr->drawbuffers.top.left + 2 * CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT,
|
||||
@ -658,7 +725,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
else
|
||||
{
|
||||
int i;
|
||||
uint8_t *dst = (uint8_t*)ctr->texture_linear;
|
||||
uint8_t *dst = (uint8_t*)ctr->texture_linear;
|
||||
const uint8_t *src = frame;
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
@ -689,7 +756,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE),
|
||||
ctr->rgb32 ? GPU_RGBA8: GPU_RGB565);
|
||||
|
||||
ctr_check_3D_slider(ctr);
|
||||
ctr_check_3D_slider(ctr, (ctr_video_mode_enum)settings->uints.video_3ds_display_mode);
|
||||
|
||||
/* ARGB --> RGBA */
|
||||
if (ctr->rgb32)
|
||||
@ -720,7 +787,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
GPU_SetViewport(NULL,
|
||||
VIRT_TO_PHYS(ctr->drawbuffers.top.left),
|
||||
0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT,
|
||||
ctr->video_mode == CTR_VIDEO_MODE_800x240 ? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
||||
ctr->video_mode == CTR_VIDEO_MODE_2D_800x240 ? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
||||
|
||||
if (ctr->video_mode == CTR_VIDEO_MODE_3D)
|
||||
{
|
||||
@ -769,7 +836,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
GPU_SetViewport(NULL,
|
||||
VIRT_TO_PHYS(ctr->drawbuffers.top.left),
|
||||
0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT,
|
||||
ctr->video_mode == CTR_VIDEO_MODE_800x240 ? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
||||
ctr->video_mode == CTR_VIDEO_MODE_2D_800x240 ? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
||||
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, 1);
|
||||
|
||||
if (ctr->video_mode == CTR_VIDEO_MODE_3D)
|
||||
@ -813,16 +880,16 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
|
||||
ctrGuDisplayTransfer(true, ctr->drawbuffers.top.left,
|
||||
240,
|
||||
ctr->video_mode == CTR_VIDEO_MODE_800x240 ? 800 : 400,
|
||||
ctr->video_mode == CTR_VIDEO_MODE_2D_800x240 ? 800 : 400,
|
||||
CTRGU_RGBA8,
|
||||
gfxTopLeftFramebuffers[ctr->current_buffer_top], 240,CTRGU_RGB8, CTRGU_MULTISAMPLE_NONE);
|
||||
gfxTopLeftFramebuffers[ctr->current_buffer_top], 240, CTRGU_RGB8, CTRGU_MULTISAMPLE_NONE);
|
||||
|
||||
if ((ctr->video_mode == CTR_VIDEO_MODE_400x240) || (ctr->video_mode == CTR_VIDEO_MODE_3D))
|
||||
if ((ctr->video_mode == CTR_VIDEO_MODE_2D_400x240) || (ctr->video_mode == CTR_VIDEO_MODE_3D))
|
||||
ctrGuDisplayTransfer(true, ctr->drawbuffers.top.right,
|
||||
240,
|
||||
400,
|
||||
CTRGU_RGBA8,
|
||||
gfxTopRightFramebuffers[ctr->current_buffer_top], 240,CTRGU_RGB8, CTRGU_MULTISAMPLE_NONE);
|
||||
gfxTopRightFramebuffers[ctr->current_buffer_top], 240, CTRGU_RGB8, CTRGU_MULTISAMPLE_NONE);
|
||||
|
||||
/* Swap buffers : */
|
||||
|
||||
@ -831,7 +898,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
topFramebufferInfo.
|
||||
framebuf0_vaddr = (u32*)gfxTopLeftFramebuffers[ctr->current_buffer_top];
|
||||
|
||||
if(ctr->video_mode == CTR_VIDEO_MODE_800x240)
|
||||
if(ctr->video_mode == CTR_VIDEO_MODE_2D_800x240)
|
||||
{
|
||||
topFramebufferInfo.
|
||||
framebuf1_vaddr = (u32*)(gfxTopLeftFramebuffers[ctr->current_buffer_top] + 240 * 3);
|
||||
@ -840,13 +907,19 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
}
|
||||
else
|
||||
{
|
||||
topFramebufferInfo.
|
||||
framebuf1_vaddr = (u32*)gfxTopRightFramebuffers[ctr->current_buffer_top];
|
||||
if (ctr->enable_3d)
|
||||
topFramebufferInfo.
|
||||
framebuf1_vaddr = (u32*)gfxTopRightFramebuffers[ctr->current_buffer_top];
|
||||
else
|
||||
topFramebufferInfo.
|
||||
framebuf1_vaddr = topFramebufferInfo.framebuf0_vaddr;
|
||||
|
||||
topFramebufferInfo.
|
||||
framebuf_widthbytesize = 240 * 3;
|
||||
}
|
||||
|
||||
topFramebufferInfo.format = (1<<8)|(1<<5)|GSP_BGR8_OES;
|
||||
u8 bit5 = (ctr->enable_3d != 0);
|
||||
topFramebufferInfo.format = (1<<8)|((1^bit5)<<6)|((bit5)<<5)|GSP_BGR8_OES;
|
||||
topFramebufferInfo.
|
||||
framebuf_dispselect = ctr->current_buffer_top;
|
||||
topFramebufferInfo.unk = 0x00000000;
|
||||
@ -1144,8 +1217,6 @@ static void ctr_set_osd_msg(void *data,
|
||||
|
||||
static const video_poke_interface_t ctr_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
ctr_load_texture,
|
||||
ctr_unload_texture,
|
||||
NULL,
|
||||
|
@ -76,11 +76,11 @@ d3d10_overlay_vertex_geom(void* data, unsigned index, float x, float y, float w,
|
||||
|
||||
static void d3d10_clear_scissor(d3d10_video_t *d3d10, video_frame_info_t *video_info)
|
||||
{
|
||||
D3D10_RECT scissor_rect = {0};
|
||||
D3D10_RECT scissor_rect;
|
||||
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.bottom = video_info->height;
|
||||
|
||||
D3D10SetScissorRects(d3d10->device, 1, &scissor_rect);
|
||||
@ -997,7 +997,8 @@ d3d10_gfx_init(const video_info_t* video,
|
||||
|
||||
IDXGIAdapter_GetDesc(d3d10->adapter, &desc);
|
||||
|
||||
utf16_to_char_string(desc.Description, str, sizeof(str));
|
||||
utf16_to_char_string((const uint16_t*)
|
||||
desc.Description, str, sizeof(str));
|
||||
|
||||
RARCH_LOG("[D3D10]: Using GPU: %s\n", str);
|
||||
|
||||
@ -1402,12 +1403,18 @@ static bool d3d10_gfx_frame(
|
||||
d3d10->sprites.enabled = true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifndef HAVE_MENU_WIDGETS
|
||||
if (d3d10->menu.enabled)
|
||||
#endif
|
||||
{
|
||||
D3D10SetViewports(context, 1, &d3d10->viewport);
|
||||
D3D10SetVertexBuffer(context, 0, d3d10->sprites.vbo, sizeof(d3d10_sprite_t), 0);
|
||||
menu_driver_frame(video_info);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (d3d10->menu.enabled)
|
||||
menu_driver_frame(video_info);
|
||||
else
|
||||
#endif
|
||||
if (video_info->statistics_show)
|
||||
@ -1683,8 +1690,6 @@ static uint32_t d3d10_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t d3d10_poke_interface = {
|
||||
d3d10_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
d3d10_gfx_load_texture,
|
||||
d3d10_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -93,11 +93,11 @@ d3d11_overlay_vertex_geom(void* data, unsigned index, float x, float y, float w,
|
||||
|
||||
static void d3d11_clear_scissor(d3d11_video_t *d3d11, video_frame_info_t *video_info)
|
||||
{
|
||||
D3D11_RECT scissor_rect = {0};
|
||||
D3D11_RECT scissor_rect;
|
||||
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.left = 0;
|
||||
scissor_rect.top = 0;
|
||||
scissor_rect.right = video_info->width;
|
||||
scissor_rect.bottom = video_info->height;
|
||||
|
||||
D3D11SetScissorRects(d3d11->context, 1, &scissor_rect);
|
||||
@ -1069,7 +1069,8 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
|
||||
|
||||
IDXGIAdapter_GetDesc(d3d11->adapter, &desc);
|
||||
|
||||
utf16_to_char_string(desc.Description, str, sizeof(str));
|
||||
utf16_to_char_string((const uint16_t*)
|
||||
desc.Description, str, sizeof(str));
|
||||
|
||||
RARCH_LOG("[D3D11]: Using GPU: %s\n", str);
|
||||
|
||||
@ -1467,12 +1468,19 @@ static bool d3d11_gfx_frame(
|
||||
d3d11->sprites.enabled = true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifndef HAVE_MENU_WIDGETS
|
||||
if (d3d11->menu.enabled)
|
||||
#endif
|
||||
{
|
||||
D3D11SetViewports(context, 1, &d3d11->viewport);
|
||||
D3D11SetVertexBuffer(context, 0, d3d11->sprites.vbo, sizeof(d3d11_sprite_t), 0);
|
||||
menu_driver_frame(video_info);
|
||||
D3D11SetVertexBuffer(context, 0,
|
||||
d3d11->sprites.vbo, sizeof(d3d11_sprite_t), 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (d3d11->menu.enabled)
|
||||
menu_driver_frame(video_info);
|
||||
else
|
||||
#endif
|
||||
if (video_info->statistics_show)
|
||||
@ -1527,8 +1535,6 @@ static bool d3d11_gfx_frame(
|
||||
}
|
||||
d3d11->sprites.enabled = false;
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
PERF_STOP();
|
||||
#endif
|
||||
@ -1750,8 +1756,6 @@ static uint32_t d3d11_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t d3d11_poke_interface = {
|
||||
d3d11_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
d3d11_gfx_load_texture,
|
||||
d3d11_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -1477,13 +1477,19 @@ static bool d3d12_gfx_frame(
|
||||
d3d12->sprites.enabled = true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifndef HAVE_MENU_WIDGETS
|
||||
if (d3d12->menu.enabled)
|
||||
#endif
|
||||
{
|
||||
D3D12RSSetViewports(d3d12->queue.cmd, 1, &d3d12->chain.viewport);
|
||||
D3D12RSSetScissorRects(d3d12->queue.cmd, 1, &d3d12->chain.scissorRect);
|
||||
D3D12IASetVertexBuffers(d3d12->queue.cmd, 0, 1, &d3d12->sprites.vbo_view);
|
||||
menu_driver_frame(video_info);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (d3d12->menu.enabled)
|
||||
menu_driver_frame(video_info);
|
||||
else
|
||||
#endif
|
||||
if (video_info->statistics_show)
|
||||
@ -1797,8 +1803,6 @@ static uint32_t d3d12_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t d3d12_poke_interface = {
|
||||
d3d12_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
d3d12_gfx_load_texture,
|
||||
d3d12_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -86,23 +86,20 @@ typedef struct d3d8_renderchain
|
||||
uint64_t frame_count;
|
||||
} d3d8_renderchain_t;
|
||||
|
||||
static void d3d8_renderchain_set_mvp(
|
||||
d3d8_video_t *d3d,
|
||||
void *chain_data,
|
||||
void *shader_data,
|
||||
const void *mat_data)
|
||||
void d3d8_set_mvp(void *data, const void *mat_data)
|
||||
{
|
||||
struct d3d_matrix matrix;
|
||||
LPDIRECT3DDEVICE8 d3dr = (LPDIRECT3DDEVICE8)data;
|
||||
|
||||
d3d_matrix_identity(&matrix);
|
||||
|
||||
d3d8_set_transform(d3d->dev, D3DTS_PROJECTION, (D3DMATRIX*)&matrix);
|
||||
d3d8_set_transform(d3d->dev, D3DTS_VIEW, (D3DMATRIX*)&matrix);
|
||||
d3d8_set_transform(d3dr, D3DTS_PROJECTION, (D3DMATRIX*)&matrix);
|
||||
d3d8_set_transform(d3dr, D3DTS_VIEW, (D3DMATRIX*)&matrix);
|
||||
|
||||
if (mat_data)
|
||||
d3d_matrix_transpose(&matrix, mat_data);
|
||||
|
||||
d3d8_set_transform(d3d->dev, D3DTS_WORLD, (D3DMATRIX*)&matrix);
|
||||
d3d8_set_transform(d3dr, D3DTS_WORLD, (D3DMATRIX*)&matrix);
|
||||
}
|
||||
|
||||
static bool d3d8_renderchain_create_first_pass(
|
||||
@ -288,7 +285,7 @@ static void d3d8_renderchain_render_pass(
|
||||
D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_DIFFUSE,
|
||||
NULL);
|
||||
d3d8_set_stream_source(d3dr, 0, chain->vertex_buf, 0, sizeof(Vertex));
|
||||
d3d8_renderchain_set_mvp(d3d, chain, NULL, &d3d->mvp_rotate);
|
||||
d3d8_set_mvp(d3d->dev, &d3d->mvp_rotate);
|
||||
d3d8_draw_primitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
}
|
||||
|
||||
@ -427,15 +424,6 @@ static void d3d8_viewport_info(void *data, struct video_viewport *vp)
|
||||
d3d8_renderchain_viewport_info(d3d, vp);
|
||||
}
|
||||
|
||||
static void d3d8_set_mvp(void *data,
|
||||
void *shader_data,
|
||||
const void *mat_data)
|
||||
{
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
if (d3d)
|
||||
d3d8_renderchain_set_mvp(d3d, d3d->renderchain_data, shader_data, mat_data);
|
||||
}
|
||||
|
||||
static void d3d8_overlay_render(d3d8_video_t *d3d,
|
||||
video_frame_info_t *video_info,
|
||||
overlay_t *overlay, bool force_linear)
|
||||
@ -1598,7 +1586,7 @@ static bool d3d8_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_MENU
|
||||
if (d3d->menu && d3d->menu->enabled)
|
||||
{
|
||||
d3d8_set_mvp(d3d, NULL, &d3d->mvp);
|
||||
d3d8_set_mvp(d3d->dev, &d3d->mvp);
|
||||
d3d8_overlay_render(d3d, video_info, d3d->menu, false);
|
||||
|
||||
d3d->menu_display.offset = 0;
|
||||
@ -1623,7 +1611,7 @@ static bool d3d8_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (d3d->overlays_enabled)
|
||||
{
|
||||
d3d8_set_mvp(d3d, NULL, &d3d->mvp);
|
||||
d3d8_set_mvp(d3d->dev, &d3d->mvp);
|
||||
for (i = 0; i < d3d->overlays_size; i++)
|
||||
d3d8_overlay_render(d3d, video_info, &d3d->overlays[i], true);
|
||||
}
|
||||
@ -1854,8 +1842,6 @@ static uint32_t d3d8_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t d3d_poke_interface = {
|
||||
d3d8_get_flags,
|
||||
NULL, /* set_coords */
|
||||
d3d8_set_mvp,
|
||||
d3d8_load_texture,
|
||||
d3d8_unload_texture,
|
||||
d3d8_set_video_mode,
|
||||
|
@ -456,12 +456,10 @@ static void d3d9_viewport_info(void *data, struct video_viewport *vp)
|
||||
vp->full_height = height;
|
||||
}
|
||||
|
||||
static void d3d9_set_mvp(void *data,
|
||||
void *shader_data,
|
||||
const void *mat_data)
|
||||
void d3d9_set_mvp(void *data, const void *mat_data)
|
||||
{
|
||||
d3d9_video_t *d3d = (d3d9_video_t*)data;
|
||||
d3d9_set_vertex_shader_constantf(d3d->dev, 0, (const float*)mat_data, 4);
|
||||
LPDIRECT3DDEVICE9 dev = (LPDIRECT3DDEVICE9)data;
|
||||
d3d9_set_vertex_shader_constantf(dev, 0, (const float*)mat_data, 4);
|
||||
}
|
||||
|
||||
static void d3d9_overlay_render(d3d9_video_t *d3d,
|
||||
@ -1696,7 +1694,7 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_MENU
|
||||
if (d3d->menu && d3d->menu->enabled)
|
||||
{
|
||||
d3d9_set_mvp(d3d, NULL, &d3d->mvp);
|
||||
d3d9_set_mvp(d3d->dev, &d3d->mvp);
|
||||
d3d9_overlay_render(d3d, video_info, d3d->menu, false);
|
||||
|
||||
d3d->menu_display.offset = 0;
|
||||
@ -1725,7 +1723,7 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (d3d->overlays_enabled)
|
||||
{
|
||||
d3d9_set_mvp(d3d, NULL, &d3d->mvp);
|
||||
d3d9_set_mvp(d3d->dev, &d3d->mvp);
|
||||
for (i = 0; i < d3d->overlays_size; i++)
|
||||
d3d9_overlay_render(d3d, video_info, &d3d->overlays[i], true);
|
||||
}
|
||||
@ -2053,8 +2051,6 @@ static uint32_t d3d9_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t d3d9_poke_interface = {
|
||||
d3d9_get_flags,
|
||||
NULL, /* set_coords */
|
||||
d3d9_set_mvp,
|
||||
d3d9_load_texture,
|
||||
d3d9_unload_texture,
|
||||
d3d9_set_video_mode,
|
||||
|
@ -632,8 +632,6 @@ static void dispmanx_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
|
||||
static const video_poke_interface_t dispmanx_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -966,8 +966,6 @@ static void drm_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
|
||||
static const video_poke_interface_t drm_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -1489,8 +1489,6 @@ static void exynos_show_mouse(void *data, bool state)
|
||||
|
||||
static const video_poke_interface_t exynos_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -631,8 +631,6 @@ static void gdi_unload_texture(void *data, uintptr_t handle)
|
||||
|
||||
static const video_poke_interface_t gdi_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
gdi_load_texture,
|
||||
gdi_unload_texture,
|
||||
gdi_set_video_mode,
|
||||
|
217
gfx/drivers/gl.c
217
gfx/drivers/gl.c
@ -15,6 +15,12 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Middle of the road OpenGL driver.
|
||||
*
|
||||
* Minimum version (desktop): OpenGL 2.0+
|
||||
* Minimum version (mobile) : OpenGLES 2.0+
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "opengl32")
|
||||
#endif
|
||||
@ -267,13 +273,6 @@ static bool gl2_shader_scale(gl_t *gl,
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char *gl2_shader_get_ident(gl_t *gl)
|
||||
{
|
||||
if (!gl || !gl->shader)
|
||||
return "N/A";
|
||||
return gl->shader->ident;
|
||||
}
|
||||
|
||||
static void gl2_renderchain_convert_geometry(
|
||||
struct video_fbo_rect *fbo_rect,
|
||||
struct gfx_fbo_scale *fbo_scale,
|
||||
@ -352,18 +351,20 @@ static void gl2_load_texture_image(GLenum target,
|
||||
{
|
||||
#if !defined(HAVE_PSGL) && !defined(ORBIS)
|
||||
#ifdef HAVE_OPENGLES2
|
||||
if (gl_check_capability(GL_CAPS_TEX_STORAGE_EXT) && internalFormat != GL_BGRA_EXT)
|
||||
{
|
||||
gl2_size_format(&internalFormat);
|
||||
glTexStorage2DEXT(target, 1, internalFormat, width, height);
|
||||
}
|
||||
unsigned cap = GL_CAPS_TEX_STORAGE_EXT;
|
||||
#else
|
||||
if (gl_check_capability(GL_CAPS_TEX_STORAGE) && internalFormat != GL_BGRA_EXT)
|
||||
unsigned cap = GL_CAPS_TEX_STORAGE;
|
||||
#endif
|
||||
|
||||
if (gl_check_capability(cap) && internalFormat != GL_BGRA_EXT)
|
||||
{
|
||||
gl2_size_format(&internalFormat);
|
||||
glTexStorage2D(target, 1, internalFormat, width, height);
|
||||
}
|
||||
#ifdef HAVE_OPENGLES2
|
||||
glTexStorage2DEXT(target, 1, internalFormat, width, height);
|
||||
#else
|
||||
glTexStorage2D (target, 1, internalFormat, width, height);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
@ -658,11 +659,8 @@ static void gl2_renderchain_render(
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
gl->shader->set_coords(gl,
|
||||
gl->shader_data, &gl->coords);
|
||||
|
||||
gl->shader->set_mvp(gl, gl->shader_data,
|
||||
&gl->mvp);
|
||||
gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
@ -729,11 +727,8 @@ static void gl2_renderchain_render(
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
gl->shader->set_coords(gl,
|
||||
gl->shader_data, &gl->coords);
|
||||
|
||||
gl->shader->set_mvp(gl, gl->shader_data,
|
||||
&gl->mvp);
|
||||
gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
@ -1616,28 +1611,15 @@ static void gl2_renderchain_copy_frame(
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl2_renderchain_bind_pbo(unsigned idx)
|
||||
{
|
||||
#if !defined(HAVE_OPENGLES2) && !defined(HAVE_PSGL)
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, (GLuint)idx);
|
||||
#define gl2_renderchain_bind_pbo(idx) glBindBuffer(GL_PIXEL_PACK_BUFFER, (GLuint)idx)
|
||||
#define gl2_renderchain_unbind_pbo() glBindBuffer(GL_PIXEL_PACK_BUFFER, 0)
|
||||
#define gl2_renderchain_init_pbo(size, data) glBufferData(GL_PIXEL_PACK_BUFFER, size, (const GLvoid*)data, GL_STREAM_READ)
|
||||
#else
|
||||
#define gl2_renderchain_bind_pbo(idx)
|
||||
#define gl2_renderchain_unbind_pbo()
|
||||
#define gl2_renderchain_init_pbo(size, data)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl2_renderchain_unbind_pbo(void)
|
||||
{
|
||||
#if !defined(HAVE_OPENGLES2) && !defined(HAVE_PSGL)
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl2_renderchain_init_pbo(unsigned size,
|
||||
const void *data)
|
||||
{
|
||||
#if !defined(HAVE_OPENGLES2) && !defined(HAVE_PSGL)
|
||||
glBufferData(GL_PIXEL_PACK_BUFFER, size,
|
||||
(const GLvoid*)data, GL_STREAM_READ);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl2_renderchain_readback(
|
||||
gl_t *gl,
|
||||
@ -1977,20 +1959,16 @@ static void gl2_render_overlay(gl_t *gl, video_frame_info_t *video_info)
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
/* Ensure that we reset the attrib array. */
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
gl->shader->use(gl, gl->shader_data,
|
||||
VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertex = gl->overlay_vertex_coord;
|
||||
gl->coords.tex_coord = gl->overlay_tex_coord;
|
||||
gl->coords.color = gl->overlay_color_coord;
|
||||
gl->coords.vertices = 4 * gl->overlays;
|
||||
|
||||
gl->shader->set_coords(gl,
|
||||
gl->shader_data, &gl->coords);
|
||||
|
||||
gl->shader->set_mvp(gl, gl->shader_data,
|
||||
&gl->mvp_no_rot);
|
||||
gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
for (i = 0; i < gl->overlays; i++)
|
||||
{
|
||||
@ -2021,6 +1999,76 @@ static void gl2_set_viewport_wrapper(void *data, unsigned viewport_width,
|
||||
}
|
||||
|
||||
/* Shaders */
|
||||
static const shader_backend_t *gl_shader_driver_set_backend(
|
||||
enum rarch_shader_type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RARCH_SHADER_CG:
|
||||
{
|
||||
#ifdef HAVE_CG
|
||||
gfx_ctx_flags_t flags;
|
||||
flags.flags = 0;
|
||||
video_context_driver_get_flags(&flags);
|
||||
|
||||
if (BIT32_GET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT))
|
||||
{
|
||||
RARCH_ERR("[Shader driver]: Cg cannot be used with core"
|
||||
" GL context. Trying to fall back to GLSL...\n");
|
||||
return gl_shader_driver_set_backend(RARCH_SHADER_GLSL);
|
||||
}
|
||||
|
||||
RARCH_LOG("[Shader driver]: Using Cg shader backend.\n");
|
||||
return &gl_cg_backend;
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
case RARCH_SHADER_GLSL:
|
||||
#ifdef HAVE_GLSL
|
||||
RARCH_LOG("[Shader driver]: Using GLSL shader backend.\n");
|
||||
return &gl_glsl_backend;
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
case RARCH_SHADER_HLSL:
|
||||
case RARCH_SHADER_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool gl_shader_driver_init(video_shader_ctx_init_t *init)
|
||||
{
|
||||
void *tmp = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!init->shader || !init->shader->init)
|
||||
{
|
||||
init->shader = gl_shader_driver_set_backend(init->shader_type);
|
||||
|
||||
if (!init->shader)
|
||||
return false;
|
||||
}
|
||||
|
||||
tmp = init->shader->init(init->data, init->path);
|
||||
|
||||
if (!tmp)
|
||||
return false;
|
||||
|
||||
if (string_is_equal(settings->arrays.menu_driver, "xmb")
|
||||
&& init->shader->init_menu_shaders)
|
||||
{
|
||||
RARCH_LOG("Setting up menu pipeline shaders for XMB ... \n");
|
||||
init->shader->init_menu_shaders(tmp);
|
||||
}
|
||||
|
||||
init->shader_data = tmp;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gl2_shader_init(gl_t *gl, const gfx_ctx_driver_t *ctx_driver,
|
||||
struct retro_hw_render_callback *hwr
|
||||
@ -2066,7 +2114,7 @@ static bool gl2_shader_init(gl_t *gl, const gfx_ctx_driver_t *ctx_driver,
|
||||
init_data.data = gl;
|
||||
init_data.path = shader_path;
|
||||
|
||||
if (video_shader_driver_init(&init_data))
|
||||
if (gl_shader_driver_init(&init_data))
|
||||
{
|
||||
gl->shader = init_data.shader;
|
||||
gl->shader_data = init_data.shader_data;
|
||||
@ -2078,7 +2126,7 @@ static bool gl2_shader_init(gl_t *gl, const gfx_ctx_driver_t *ctx_driver,
|
||||
init_data.shader = NULL;
|
||||
init_data.path = NULL;
|
||||
|
||||
ret = video_shader_driver_init(&init_data);
|
||||
ret = gl_shader_driver_init(&init_data);
|
||||
|
||||
gl->shader = init_data.shader;
|
||||
gl->shader_data = init_data.shader_data;
|
||||
@ -2246,10 +2294,7 @@ static INLINE void gl2_set_shader_viewports(gl_t *gl)
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (video_info.shader_driver && video_info.shader_driver->use)
|
||||
video_info.shader_driver->use(gl,
|
||||
video_info.shader_data, i, true);
|
||||
|
||||
gl->shader->use(gl, gl->shader_data, i, true);
|
||||
gl2_set_viewport(gl, &video_info,
|
||||
width, height, false, true);
|
||||
}
|
||||
@ -2360,19 +2405,16 @@ static void gl2_render_osd_background(
|
||||
video_driver_set_viewport(video_info->width,
|
||||
video_info->height, true, false);
|
||||
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
gl->shader->use(gl, gl->shader_data,
|
||||
VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->shader->set_coords(gl, gl->shader_data,
|
||||
&coords);
|
||||
gl->shader->set_coords(gl->shader_data, &coords);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
|
||||
gl->shader->set_mvp(gl, gl->shader_data,
|
||||
&gl->mvp_no_rot);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
uniform_param.type = UNIFORM_4F;
|
||||
uniform_param.enabled = true;
|
||||
@ -2464,17 +2506,13 @@ static INLINE void gl2_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->menu_texture);
|
||||
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
gl->shader->use(gl,
|
||||
gl->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
gl->shader->set_coords(gl,
|
||||
gl->shader_data, &gl->coords);
|
||||
|
||||
gl->shader->set_mvp(gl, gl->shader_data,
|
||||
&gl->mvp_no_rot);
|
||||
gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
@ -2539,9 +2577,7 @@ static bool gl2_frame(void *data, const void *frame,
|
||||
if (gl->core_context_in_use)
|
||||
gl2_renderchain_bind_vao(chain);
|
||||
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, 1, true);
|
||||
gl->shader->use(gl, gl->shader_data, 1, true);
|
||||
|
||||
#ifdef IOS
|
||||
/* Apparently the viewport is lost each frame, thanks Apple. */
|
||||
@ -2669,11 +2705,8 @@ static bool gl2_frame(void *data, const void *frame,
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
gl->shader->set_coords(gl,
|
||||
gl->shader_data, &gl->coords);
|
||||
|
||||
gl->shader->set_mvp(gl, gl->shader_data,
|
||||
&gl->mvp);
|
||||
gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
@ -2737,10 +2770,7 @@ static bool gl2_frame(void *data, const void *frame,
|
||||
/* Reset state which could easily mess up libretro core. */
|
||||
if (gl->hw_render_fbo_init)
|
||||
{
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, 0, true);
|
||||
|
||||
gl->shader->use(gl, gl->shader_data, 0, true);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
@ -2838,7 +2868,6 @@ static void gl2_free(void *data)
|
||||
font_driver_free_osd();
|
||||
|
||||
gl->shader->deinit(gl->shader_data);
|
||||
video_shader_driver_deinit();
|
||||
|
||||
glDeleteTextures(gl->textures, gl->texture);
|
||||
|
||||
@ -3447,15 +3476,13 @@ static void *gl2_init(const video_info_t *video,
|
||||
|
||||
gl->shader = (shader_backend_t*)gl2_shader_ctx_drivers[0];
|
||||
|
||||
if (!video_shader_driver_init_first(gl->shader))
|
||||
if (!gl->shader)
|
||||
{
|
||||
RARCH_ERR("[GL:]: Shader driver initialization failed.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
gl2_shader_get_ident(gl);
|
||||
|
||||
RARCH_LOG("[GL]: Default shader backend found: %s.\n", gl2_shader_get_ident(gl));
|
||||
RARCH_LOG("[GL]: Default shader backend found: %s.\n", gl->shader->ident);
|
||||
|
||||
if (!gl2_shader_init(gl, ctx_driver, hwr))
|
||||
{
|
||||
@ -3682,8 +3709,6 @@ static bool gl2_set_shader(void *data,
|
||||
gl->shader->deinit(gl->shader_data);
|
||||
gl->shader_data = NULL;
|
||||
|
||||
video_shader_driver_deinit();
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#ifdef HAVE_GLSL
|
||||
@ -3714,11 +3739,11 @@ static bool gl2_set_shader(void *data,
|
||||
init_data.data = gl;
|
||||
init_data.path = path;
|
||||
|
||||
if (!video_shader_driver_init(&init_data))
|
||||
if (!gl_shader_driver_init(&init_data))
|
||||
{
|
||||
init_data.path = NULL;
|
||||
|
||||
video_shader_driver_init(&init_data);
|
||||
gl_shader_driver_init(&init_data);
|
||||
|
||||
gl->shader = init_data.shader;
|
||||
gl->shader_data = init_data.shader_data;
|
||||
@ -4142,8 +4167,6 @@ static uint32_t gl2_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t gl2_poke_interface = {
|
||||
gl2_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
gl2_load_texture,
|
||||
gl2_unload_texture,
|
||||
gl2_set_video_mode,
|
||||
|
@ -15,7 +15,9 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* We are targeting a minimum of OpenGL 1.1 and the Microsoft "GDI Generic" software GL implementation.
|
||||
/* OpenGL driver.
|
||||
*
|
||||
* We are targeting a minimum of OpenGL 1.1 and the Microsoft "GDI Generic" software GL implementation.
|
||||
* Any additional features added for later 1.x versions should only be enabled if they are detected at runtime. */
|
||||
|
||||
#include <stddef.h>
|
||||
@ -32,6 +34,9 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
@ -103,6 +108,17 @@ static const GLfloat gl1_white_color[] = {
|
||||
if (gl1_shared_context_use) \
|
||||
gl1->ctx_driver->bind_hw_render(gl1->ctx_data, enable)
|
||||
|
||||
static void gl1_render_overlay(gl1_t *gl, video_frame_info_t *video_info);
|
||||
static void gl1_free_overlay(gl1_t *gl);
|
||||
static void gl1_overlay_vertex_geom(void *data,
|
||||
unsigned image,
|
||||
float x, float y,
|
||||
float w, float h);
|
||||
static void gl1_overlay_tex_geom(void *data,
|
||||
unsigned image,
|
||||
GLfloat x, GLfloat y,
|
||||
GLfloat w, GLfloat h);
|
||||
|
||||
static bool is_pot(unsigned x)
|
||||
{
|
||||
return (x & (x - 1)) == 0;
|
||||
@ -113,10 +129,6 @@ static unsigned get_pot(unsigned x)
|
||||
return (is_pot(x) ? x : next_pow2(x));
|
||||
}
|
||||
|
||||
static void gl1_gfx_create(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void *gl1_gfx_init(const video_info_t *video,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
@ -153,8 +165,6 @@ static void *gl1_gfx_init(const video_info_t *video,
|
||||
else
|
||||
gl1_video_pitch = video->width * 2;
|
||||
|
||||
gl1_gfx_create();
|
||||
|
||||
ctx_driver = video_context_driver_init_first(gl1,
|
||||
settings->arrays.video_context_driver,
|
||||
GFX_CTX_OPENGL_API, 1, 1, false, &ctx_data);
|
||||
@ -206,6 +216,8 @@ static void *gl1_gfx_init(const video_info_t *video,
|
||||
if (!video_context_driver_set_video_mode(&mode))
|
||||
goto error;
|
||||
|
||||
gl1->fullscreen = video->fullscreen;
|
||||
|
||||
mode.width = 0;
|
||||
mode.height = 0;
|
||||
|
||||
@ -468,7 +480,6 @@ static void draw_tex(gl1_t *gl1, int pot_width, int pot_height, int width, int h
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
/*glLoadMatrixf(gl1->mvp.data);*/
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
@ -708,6 +719,32 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
#ifdef HAVE_MENU
|
||||
if (gl1->menu_texture_enable)
|
||||
menu_driver_frame(video_info);
|
||||
else if (video_info->statistics_show)
|
||||
{
|
||||
struct font_params *osd_params = (struct font_params*)
|
||||
&video_info->osd_stat_params;
|
||||
|
||||
if (osd_params)
|
||||
{
|
||||
font_driver_render_msg(video_info, NULL, video_info->stat_text,
|
||||
(const struct font_params*)&video_info->osd_stat_params);
|
||||
#if 0
|
||||
osd_params->y = 0.350f;
|
||||
osd_params->scale = 0.75f;
|
||||
font_driver_render_msg(video_info, NULL, video_info->chat_text,
|
||||
(const struct font_params*)&video_info->osd_stat_params);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
menu_widgets_frame(video_info);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (gl1->overlay_enable)
|
||||
gl1_render_overlay(gl1, video_info);
|
||||
#endif
|
||||
|
||||
if (msg)
|
||||
@ -740,13 +777,12 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
video_info->cb_swap_buffers(video_info->context_data, video_info);
|
||||
|
||||
/* check if we are fast forwarding or in menu, if we are ignore hard sync */
|
||||
if (gl1->have_sync
|
||||
&& video_info->hard_sync
|
||||
if (video_info->hard_sync
|
||||
&& !video_info->input_driver_nonblock_state
|
||||
&& !gl1->menu_texture_enable)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
/* hard sync would go here if possible */
|
||||
glFinish();
|
||||
}
|
||||
|
||||
gl1_context_bind_hw_render(gl1, true);
|
||||
@ -859,6 +895,10 @@ static void gl1_gfx_free(void *data)
|
||||
gl1->menu_tex = 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
gl1_free_overlay(gl1);
|
||||
#endif
|
||||
|
||||
if (gl1->extensions)
|
||||
{
|
||||
string_list_free(gl1->extensions);
|
||||
@ -1067,33 +1107,15 @@ static void gl1_load_texture_data(
|
||||
bool rgb32 = (base_size == (sizeof(uint32_t)));
|
||||
GLenum wrap = gl1_wrap_type_to_enum(wrap_type);
|
||||
|
||||
/* Assume no mipmapping support. */
|
||||
/* GL1.x does not have mipmapping support. */
|
||||
switch (filter_type)
|
||||
{
|
||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||
filter_type = TEXTURE_FILTER_LINEAR;
|
||||
break;
|
||||
case TEXTURE_FILTER_MIPMAP_NEAREST:
|
||||
filter_type = TEXTURE_FILTER_NEAREST;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (filter_type)
|
||||
{
|
||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||
min_filter = GL_LINEAR_MIPMAP_NEAREST;
|
||||
mag_filter = GL_LINEAR;
|
||||
break;
|
||||
case TEXTURE_FILTER_MIPMAP_NEAREST:
|
||||
min_filter = GL_NEAREST_MIPMAP_NEAREST;
|
||||
mag_filter = GL_NEAREST;
|
||||
break;
|
||||
case TEXTURE_FILTER_NEAREST:
|
||||
min_filter = GL_NEAREST;
|
||||
mag_filter = GL_NEAREST;
|
||||
break;
|
||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||
case TEXTURE_FILTER_LINEAR:
|
||||
default:
|
||||
min_filter = GL_LINEAR;
|
||||
@ -1128,17 +1150,6 @@ static void video_texture_load_gl1(
|
||||
}
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
static int video_texture_load_wrap_gl1_mipmap(void *data)
|
||||
{
|
||||
uintptr_t id = 0;
|
||||
|
||||
if (!data)
|
||||
return 0;
|
||||
video_texture_load_gl1((struct texture_image*)data,
|
||||
TEXTURE_FILTER_MIPMAP_LINEAR, &id);
|
||||
return (int)id;
|
||||
}
|
||||
|
||||
static int video_texture_load_wrap_gl1(void *data)
|
||||
{
|
||||
uintptr_t id = 0;
|
||||
@ -1146,7 +1157,7 @@ static int video_texture_load_wrap_gl1(void *data)
|
||||
if (!data)
|
||||
return 0;
|
||||
video_texture_load_gl1((struct texture_image*)data,
|
||||
TEXTURE_FILTER_LINEAR, &id);
|
||||
TEXTURE_FILTER_NEAREST, &id);
|
||||
return (int)id;
|
||||
}
|
||||
#endif
|
||||
@ -1160,16 +1171,6 @@ static uintptr_t gl1_load_texture(void *video_data, void *data,
|
||||
if (threaded)
|
||||
{
|
||||
custom_command_method_t func = video_texture_load_wrap_gl1;
|
||||
|
||||
switch (filter_type)
|
||||
{
|
||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||
case TEXTURE_FILTER_MIPMAP_NEAREST:
|
||||
func = video_texture_load_wrap_gl1_mipmap;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return video_thread_texture_load(data, func);
|
||||
}
|
||||
#endif
|
||||
@ -1243,43 +1244,15 @@ static uint32_t gl1_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_HARD_SYNC);
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_BLACK_FRAME_INSERTION);
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_MENU_FRAME_FILTERING);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static void gl1_set_mvp(void *data, void *shader_data, const void *mat_data)
|
||||
{
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)mat_data;
|
||||
|
||||
(void)data;
|
||||
(void)shader_data;
|
||||
|
||||
if (!mat)
|
||||
return;
|
||||
|
||||
glLoadMatrixf(mat->data);
|
||||
}
|
||||
|
||||
static void gl1_set_coords(void *handle_data, void *shader_data,
|
||||
const struct video_coords *coords)
|
||||
{
|
||||
gl1_t *gl1 = (gl1_t*)handle_data;
|
||||
|
||||
if (!gl1)
|
||||
return;
|
||||
|
||||
gl1->coords.vertex = coords->vertex;
|
||||
gl1->coords.color = coords->color;
|
||||
gl1->coords.tex_coord = coords->tex_coord;
|
||||
gl1->coords.lut_tex_coord = coords->lut_tex_coord;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gl1_poke_interface = {
|
||||
gl1_get_flags,
|
||||
gl1_set_coords,
|
||||
gl1_set_mvp,
|
||||
gl1_load_texture,
|
||||
gl1_unload_texture,
|
||||
gl1_set_video_mode,
|
||||
@ -1309,6 +1282,14 @@ static void gl1_gfx_get_poke_interface(void *data,
|
||||
*iface = &gl1_poke_interface;
|
||||
}
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
static bool gl1_menu_widgets_enabled(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gl1_gfx_set_viewport_wrapper(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
@ -1326,6 +1307,230 @@ bool gl1_has_menu_frame(void)
|
||||
return (gl1_menu_frame != NULL);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static bool gl1_overlay_load(void *data,
|
||||
const void *image_data, unsigned num_images)
|
||||
{
|
||||
unsigned i, j;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
const struct texture_image *images =
|
||||
(const struct texture_image*)image_data;
|
||||
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
gl1_context_bind_hw_render(gl, false);
|
||||
|
||||
gl1_free_overlay(gl);
|
||||
gl->overlay_tex = (GLuint*)
|
||||
calloc(num_images, sizeof(*gl->overlay_tex));
|
||||
|
||||
if (!gl->overlay_tex)
|
||||
{
|
||||
gl1_context_bind_hw_render(gl, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
gl->overlay_vertex_coord = (GLfloat*)
|
||||
calloc(2 * 4 * num_images, sizeof(GLfloat));
|
||||
gl->overlay_tex_coord = (GLfloat*)
|
||||
calloc(2 * 4 * num_images, sizeof(GLfloat));
|
||||
gl->overlay_color_coord = (GLfloat*)
|
||||
calloc(4 * 4 * num_images, sizeof(GLfloat));
|
||||
|
||||
if ( !gl->overlay_vertex_coord
|
||||
|| !gl->overlay_tex_coord
|
||||
|| !gl->overlay_color_coord)
|
||||
return false;
|
||||
|
||||
gl->overlays = num_images;
|
||||
glGenTextures(num_images, gl->overlay_tex);
|
||||
|
||||
for (i = 0; i < num_images; i++)
|
||||
{
|
||||
unsigned alignment = video_pixel_get_alignment(images[i].width
|
||||
* sizeof(uint32_t));
|
||||
|
||||
gl1_load_texture_data(gl->overlay_tex[i],
|
||||
RARCH_WRAP_EDGE, TEXTURE_FILTER_LINEAR,
|
||||
alignment,
|
||||
images[i].width, images[i].height, images[i].pixels,
|
||||
sizeof(uint32_t));
|
||||
|
||||
/* Default. Stretch to whole screen. */
|
||||
gl1_overlay_tex_geom(gl, i, 0, 0, 1, 1);
|
||||
gl1_overlay_vertex_geom(gl, i, 0, 0, 1, 1);
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
gl->overlay_color_coord[16 * i + j] = 1.0f;
|
||||
}
|
||||
|
||||
gl1_context_bind_hw_render(gl, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gl1_overlay_enable(void *data, bool state)
|
||||
{
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
gl->overlay_enable = state;
|
||||
|
||||
if (gl->fullscreen)
|
||||
video_context_driver_show_mouse(&state);
|
||||
}
|
||||
|
||||
static void gl1_overlay_full_screen(void *data, bool enable)
|
||||
{
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (gl)
|
||||
gl->overlay_full_screen = enable;
|
||||
}
|
||||
|
||||
static void gl1_overlay_set_alpha(void *data, unsigned image, float mod)
|
||||
{
|
||||
GLfloat *color = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
color = (GLfloat*)&gl->overlay_color_coord[image * 16];
|
||||
|
||||
color[ 0 + 3] = mod;
|
||||
color[ 4 + 3] = mod;
|
||||
color[ 8 + 3] = mod;
|
||||
color[12 + 3] = mod;
|
||||
}
|
||||
|
||||
static const video_overlay_interface_t gl1_overlay_interface = {
|
||||
gl1_overlay_enable,
|
||||
gl1_overlay_load,
|
||||
gl1_overlay_tex_geom,
|
||||
gl1_overlay_vertex_geom,
|
||||
gl1_overlay_full_screen,
|
||||
gl1_overlay_set_alpha,
|
||||
};
|
||||
|
||||
static void gl1_get_overlay_interface(void *data,
|
||||
const video_overlay_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &gl1_overlay_interface;
|
||||
}
|
||||
|
||||
static void gl1_free_overlay(gl1_t *gl)
|
||||
{
|
||||
glDeleteTextures(gl->overlays, gl->overlay_tex);
|
||||
|
||||
free(gl->overlay_tex);
|
||||
free(gl->overlay_vertex_coord);
|
||||
free(gl->overlay_tex_coord);
|
||||
free(gl->overlay_color_coord);
|
||||
gl->overlay_tex = NULL;
|
||||
gl->overlay_vertex_coord = NULL;
|
||||
gl->overlay_tex_coord = NULL;
|
||||
gl->overlay_color_coord = NULL;
|
||||
gl->overlays = 0;
|
||||
}
|
||||
|
||||
static void gl1_overlay_vertex_geom(void *data,
|
||||
unsigned image,
|
||||
float x, float y,
|
||||
float w, float h)
|
||||
{
|
||||
GLfloat *vertex = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
if (image > gl->overlays)
|
||||
{
|
||||
RARCH_ERR("[GL]: Invalid overlay id: %u\n", image);
|
||||
return;
|
||||
}
|
||||
|
||||
vertex = (GLfloat*)&gl->overlay_vertex_coord[image * 8];
|
||||
|
||||
/* Flipped, so we preserve top-down semantics. */
|
||||
y = 1.0f - y;
|
||||
h = -h;
|
||||
|
||||
vertex[0] = x;
|
||||
vertex[1] = y;
|
||||
vertex[2] = x + w;
|
||||
vertex[3] = y;
|
||||
vertex[4] = x;
|
||||
vertex[5] = y + h;
|
||||
vertex[6] = x + w;
|
||||
vertex[7] = y + h;
|
||||
}
|
||||
|
||||
static void gl1_overlay_tex_geom(void *data,
|
||||
unsigned image,
|
||||
GLfloat x, GLfloat y,
|
||||
GLfloat w, GLfloat h)
|
||||
{
|
||||
GLfloat *tex = NULL;
|
||||
gl1_t *gl = (gl1_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
tex = (GLfloat*)&gl->overlay_tex_coord[image * 8];
|
||||
|
||||
tex[0] = x;
|
||||
tex[1] = y;
|
||||
tex[2] = x + w;
|
||||
tex[3] = y;
|
||||
tex[4] = x;
|
||||
tex[5] = y + h;
|
||||
tex[6] = x + w;
|
||||
tex[7] = y + h;
|
||||
}
|
||||
|
||||
static void gl1_render_overlay(gl1_t *gl, video_frame_info_t *video_info)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
if (gl->overlay_full_screen)
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
gl->coords.vertex = gl->overlay_vertex_coord;
|
||||
gl->coords.tex_coord = gl->overlay_tex_coord;
|
||||
gl->coords.color = gl->overlay_color_coord;
|
||||
gl->coords.vertices = 4 * gl->overlays;
|
||||
|
||||
/*gl->shader->set_coords(gl->shader_data, &gl->coords);
|
||||
gl->shader->set_mvp(gl->shader_data, &gl->mvp_no_rot);*/
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
for (i = 0; i < gl->overlays; i++)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->overlay_tex[i]);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 4 * i, 4);
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
gl->coords.vertex = gl->vertex_ptr;
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
gl->coords.vertices = 4;
|
||||
if (gl->overlay_full_screen)
|
||||
glViewport(gl->vp.x, gl->vp.y, gl->vp.width, gl->vp.height);
|
||||
}
|
||||
#endif
|
||||
|
||||
video_driver_t video_gl1 = {
|
||||
gl1_gfx_init,
|
||||
gl1_gfx_frame,
|
||||
@ -1344,11 +1549,11 @@ video_driver_t video_gl1 = {
|
||||
NULL, /* read_frame_raw */
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL, /* overlay_interface */
|
||||
gl1_get_overlay_interface,
|
||||
#endif
|
||||
gl1_gfx_get_poke_interface,
|
||||
gl1_wrap_type_to_enum,
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
NULL
|
||||
gl1_menu_widgets_enabled
|
||||
#endif
|
||||
};
|
||||
|
@ -13,6 +13,12 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Modern OpenGL driver.
|
||||
*
|
||||
* Minimum version (desktop): OpenGL 3.2+
|
||||
* Minimum version (mobile) : OpenGLES 3.0+
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@ -394,13 +400,13 @@ static bool gl_core_init_hw_render(gl_core_t *gl, unsigned width, unsigned heigh
|
||||
RARCH_LOG("[GLCore]: Max texture size: %d px, renderbuffer size: %d px.\n",
|
||||
max_fbo_size, max_rb_size);
|
||||
|
||||
if (width > max_fbo_size)
|
||||
if (width > (unsigned)max_fbo_size)
|
||||
width = max_fbo_size;
|
||||
if (width > max_rb_size)
|
||||
if (width > (unsigned)max_rb_size)
|
||||
width = max_rb_size;
|
||||
if (height > max_fbo_size)
|
||||
if (height > (unsigned)max_fbo_size)
|
||||
height = max_fbo_size;
|
||||
if (height > max_rb_size)
|
||||
if (height > (unsigned)max_rb_size)
|
||||
height = max_rb_size;
|
||||
|
||||
glGenFramebuffers(1, &gl->hw_render_fbo);
|
||||
@ -497,7 +503,8 @@ static const gfx_ctx_driver_t *gl_core_get_context(gl_core_t *gl)
|
||||
#endif
|
||||
|
||||
/* Force shared context. */
|
||||
gl->use_shared_context = hwr->context_type != RETRO_HW_CONTEXT_NONE;
|
||||
if (hwr)
|
||||
gl->use_shared_context = hwr->context_type != RETRO_HW_CONTEXT_NONE;
|
||||
|
||||
gfx_ctx = video_context_driver_init_first(gl,
|
||||
settings->arrays.video_context_driver,
|
||||
@ -1624,6 +1631,7 @@ static bool gl_core_frame(void *data, const void *frame,
|
||||
texture.padded_width = streamed->width;
|
||||
texture.padded_height = streamed->height;
|
||||
}
|
||||
gl_core_filter_chain_set_frame_count(gl->filter_chain, frame_count);
|
||||
gl_core_filter_chain_set_input_texture(gl->filter_chain, &texture);
|
||||
gl_core_filter_chain_build_offscreen_passes(gl->filter_chain, &gl->filter_chain_vp);
|
||||
|
||||
@ -1959,8 +1967,6 @@ static retro_proc_address_t gl_core_get_proc_address(void *data, const char *sym
|
||||
|
||||
static const video_poke_interface_t gl_core_poke_interface = {
|
||||
gl_core_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
gl_core_load_texture,
|
||||
gl_core_unload_texture,
|
||||
gl_core_set_video_mode,
|
||||
@ -1998,6 +2004,31 @@ static bool gl_core_menu_widgets_enabled(void *data)
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned gl_core_wrap_type_to_enum(enum gfx_wrap_type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RARCH_WRAP_BORDER:
|
||||
#ifdef HAVE_OPENGLES3
|
||||
/* GLES does not support CLAMP_TO_BORDER until GLES 3.2.
|
||||
* It is a deprecated feature in general. */
|
||||
return GL_CLAMP_TO_EDGE;
|
||||
#else
|
||||
return GL_CLAMP_TO_BORDER;
|
||||
#endif
|
||||
case RARCH_WRAP_EDGE:
|
||||
return GL_CLAMP_TO_EDGE;
|
||||
case RARCH_WRAP_REPEAT:
|
||||
return GL_REPEAT;
|
||||
case RARCH_WRAP_MIRRORED_REPEAT:
|
||||
return GL_MIRRORED_REPEAT;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
video_driver_t video_gl_core = {
|
||||
gl_core_init,
|
||||
gl_core_frame,
|
||||
@ -2028,7 +2059,7 @@ video_driver_t video_gl_core = {
|
||||
gl_core_get_overlay_interface,
|
||||
#endif
|
||||
gl_core_get_poke_interface,
|
||||
/*gl_core_wrap_type_to_enum,*/NULL,
|
||||
gl_core_wrap_type_to_enum,
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
gl_core_menu_widgets_enabled
|
||||
#endif
|
||||
|
@ -1717,8 +1717,6 @@ static uint32_t wiiu_gfx_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t wiiu_poke_interface = {
|
||||
wiiu_gfx_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
wiiu_gfx_load_texture,
|
||||
wiiu_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -1265,8 +1265,6 @@ static void gx_get_video_output_next(void *data)
|
||||
|
||||
static const video_poke_interface_t gx_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
gx_set_video_mode,
|
||||
|
@ -1138,8 +1138,6 @@ static float omap_get_refresh_rate(void *data)
|
||||
|
||||
static const video_poke_interface_t omap_gfx_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -172,7 +172,7 @@ static void prim_texture(GSGLOBAL *gsGlobal, GSTEXTURE *texture, int zPosition,
|
||||
GS_TEXT);
|
||||
}
|
||||
|
||||
static void clearVRAMIfNeeded(ps2_video_t *ps2, void *frame, int width, int height)
|
||||
static void clearVRAMIfNeeded(ps2_video_t *ps2, const void *frame, int width, int height)
|
||||
{
|
||||
if (!ps2->clearVRAM) {
|
||||
if(frame && frame != RETRO_HW_FRAME_BUFFER_VALID) {
|
||||
@ -470,8 +470,6 @@ static bool ps2_get_hw_render_interface(void* data,
|
||||
|
||||
static const video_poke_interface_t ps2_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -832,8 +832,6 @@ static void psp_viewport_info(void *data, struct video_viewport *vp)
|
||||
|
||||
static const video_poke_interface_t psp_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -726,8 +726,6 @@ static void sdl2_grab_mouse_toggle(void *data)
|
||||
|
||||
static video_poke_interface_t sdl2_video_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -518,8 +518,6 @@ static void sdl_grab_mouse_toggle(void *data)
|
||||
|
||||
static const video_poke_interface_t sdl_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -599,8 +599,6 @@ static void sixel_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t sixel_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -944,8 +944,6 @@ static float sunxi_get_refresh_rate (void *data)
|
||||
|
||||
static const video_poke_interface_t sunxi_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -406,8 +406,6 @@ static void switch_set_texture_enable(void *data, bool enable, bool full_screen)
|
||||
|
||||
static const video_poke_interface_t switch_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -755,8 +755,6 @@ void switch_overlay_interface(void *data, const video_overlay_interface_t **ifac
|
||||
|
||||
static const video_poke_interface_t switch_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -391,8 +391,6 @@ static void vga_set_osd_msg(void *data,
|
||||
|
||||
static const video_poke_interface_t vga_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -790,8 +790,6 @@ static bool vita_get_current_sw_framebuffer(void *data,
|
||||
|
||||
static const video_poke_interface_t vita_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
vita_load_texture,
|
||||
vita_unload_texture,
|
||||
NULL,
|
||||
|
@ -2366,7 +2366,7 @@ static void vulkan_unload_texture(void *data, uintptr_t handle)
|
||||
{
|
||||
vk_t *vk = (vk_t*)data;
|
||||
struct vk_texture *texture = (struct vk_texture*)handle;
|
||||
if (!texture)
|
||||
if (!texture || !vk)
|
||||
return;
|
||||
|
||||
/* TODO: We really want to defer this deletion instead,
|
||||
@ -2407,8 +2407,6 @@ static uint32_t vulkan_get_flags(void *data)
|
||||
|
||||
static const video_poke_interface_t vulkan_poke_interface = {
|
||||
vulkan_get_flags,
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
vulkan_load_texture,
|
||||
vulkan_unload_texture,
|
||||
vulkan_set_video_mode,
|
||||
|
@ -205,8 +205,6 @@ static void xshm_grab_mouse_toggle(void *data)
|
||||
|
||||
static video_poke_interface_t xshm_video_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -939,8 +939,6 @@ static video_poke_interface_t xv_video_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
x11_get_refresh_rate,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -215,8 +215,8 @@ static void ctr_font_render_line(
|
||||
width = glyph->width;
|
||||
height = glyph->height;
|
||||
|
||||
v->x0 = x + off_x + delta_x * scale;
|
||||
v->y0 = y + off_y + delta_y * scale;
|
||||
v->x0 = x + (off_x + delta_x) * scale;
|
||||
v->y0 = y + (off_y + delta_y) * scale;
|
||||
v->u0 = tex_x;
|
||||
v->v0 = tex_y;
|
||||
v->x1 = v->x0 + width * scale;
|
||||
@ -265,7 +265,7 @@ static void ctr_font_render_line(
|
||||
GPU_SetViewport(NULL,
|
||||
VIRT_TO_PHYS(ctr->drawbuffers.top.left),
|
||||
0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT,
|
||||
ctr->video_mode == CTR_VIDEO_MODE_800x240
|
||||
ctr->video_mode == CTR_VIDEO_MODE_2D_800x240
|
||||
? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
||||
|
||||
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, v - ctr->vertex_cache.current);
|
||||
|
@ -178,8 +178,8 @@ static void d3d10_font_render_line(
|
||||
if (!glyph)
|
||||
continue;
|
||||
|
||||
v->pos.x = (x + glyph->draw_offset_x) * scale / (float)d3d10->viewport.Width;
|
||||
v->pos.y = (y + glyph->draw_offset_y) * scale / (float)d3d10->viewport.Height;
|
||||
v->pos.x = (x + (glyph->draw_offset_x * scale)) / (float)d3d10->viewport.Width;
|
||||
v->pos.y = (y + (glyph->draw_offset_y * scale)) / (float)d3d10->viewport.Height;
|
||||
v->pos.w = glyph->width * scale / (float)d3d10->viewport.Width;
|
||||
v->pos.h = glyph->height * scale / (float)d3d10->viewport.Height;
|
||||
|
||||
|
@ -176,8 +176,8 @@ static void d3d11_font_render_line(
|
||||
if (!glyph)
|
||||
continue;
|
||||
|
||||
v->pos.x = (x + glyph->draw_offset_x) * scale / (float)d3d11->viewport.Width;
|
||||
v->pos.y = (y + glyph->draw_offset_y) * scale / (float)d3d11->viewport.Height;
|
||||
v->pos.x = (x + (glyph->draw_offset_x * scale)) / (float)d3d11->viewport.Width;
|
||||
v->pos.y = (y + (glyph->draw_offset_y * scale)) / (float)d3d11->viewport.Height;
|
||||
v->pos.w = glyph->width * scale / (float)d3d11->viewport.Width;
|
||||
v->pos.h = glyph->height * scale / (float)d3d11->viewport.Height;
|
||||
|
||||
|
@ -184,8 +184,8 @@ static void d3d12_font_render_line(
|
||||
if (!glyph)
|
||||
continue;
|
||||
|
||||
v->pos.x = (x + glyph->draw_offset_x) * scale / (float)d3d12->chain.viewport.Width;
|
||||
v->pos.y = (y + glyph->draw_offset_y) * scale / (float)d3d12->chain.viewport.Height;
|
||||
v->pos.x = (x + (glyph->draw_offset_x * scale)) / (float)d3d12->chain.viewport.Width;
|
||||
v->pos.y = (y + (glyph->draw_offset_y * scale)) / (float)d3d12->chain.viewport.Height;
|
||||
v->pos.w = glyph->width * scale / (float)d3d12->chain.viewport.Width;
|
||||
v->pos.h = glyph->height * scale / (float)d3d12->chain.viewport.Height;
|
||||
|
||||
|
@ -237,22 +237,12 @@ static void gl1_raster_font_draw_vertices(gl1_raster_t *font,
|
||||
const video_coords_t *coords,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
video_shader_ctx_coords_t coords_data;
|
||||
|
||||
if (font->atlas->dirty)
|
||||
{
|
||||
gl1_raster_font_upload_atlas(font);
|
||||
font->atlas->dirty = false;
|
||||
}
|
||||
|
||||
coords_data.handle_data = NULL;
|
||||
coords_data.data = coords;
|
||||
|
||||
video_driver_set_coords(&coords_data);
|
||||
|
||||
/*video_info->cb_set_mvp(font->gl,
|
||||
video_info->shader_data, &font->gl->mvp_no_rot);*/
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadMatrixf(font->gl->mvp.data);
|
||||
@ -560,7 +550,6 @@ static void gl1_raster_font_bind_block(void *data, void *userdata)
|
||||
font->block = block;
|
||||
}
|
||||
|
||||
|
||||
static int gl1_get_line_height(void *data)
|
||||
{
|
||||
gl1_raster_t *font = (gl1_raster_t*)data;
|
||||
|
@ -249,21 +249,15 @@ static void gl_raster_font_draw_vertices(gl_raster_t *font,
|
||||
const video_coords_t *coords,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
video_shader_ctx_coords_t coords_data;
|
||||
|
||||
if (font->atlas->dirty)
|
||||
{
|
||||
gl_raster_font_upload_atlas(font);
|
||||
font->atlas->dirty = false;
|
||||
}
|
||||
|
||||
coords_data.handle_data = NULL;
|
||||
coords_data.data = coords;
|
||||
|
||||
video_driver_set_coords(&coords_data);
|
||||
|
||||
video_info->cb_set_mvp(font->gl,
|
||||
video_info->shader_data, &font->gl->mvp_no_rot);
|
||||
font->gl->shader->set_coords(font->gl->shader_data, coords);
|
||||
font->gl->shader->set_mvp(font->gl->shader_data,
|
||||
&font->gl->mvp_no_rot);
|
||||
|
||||
glDrawArrays(GL_TRIANGLES, 0, coords->vertices);
|
||||
}
|
||||
|
@ -298,8 +298,8 @@ static INLINE void write_quad6(SpriteVertex *pv,
|
||||
height = glyph->height;
|
||||
|
||||
write_quad6(v,
|
||||
(x + off_x + delta_x * scale) * inv_win_width,
|
||||
(y + off_y + delta_y * scale) * inv_win_height,
|
||||
(x + (off_x + delta_x) * scale) * inv_win_width,
|
||||
(y + (off_y + delta_y) * scale) * inv_win_height,
|
||||
width * scale * inv_win_width,
|
||||
height * scale * inv_win_height,
|
||||
tex_x * inv_tex_size_x,
|
||||
|
@ -209,8 +209,8 @@ static void vita2d_font_render_line(
|
||||
}
|
||||
|
||||
vita2d_draw_texture_tint_part_scale(font->texture,
|
||||
x + off_x + delta_x * scale,
|
||||
y + off_y + delta_y * scale,
|
||||
x + (off_x + delta_x) * scale,
|
||||
y + (off_y + delta_y) * scale,
|
||||
tex_x, tex_y, width, height,
|
||||
scale,
|
||||
scale,
|
||||
|
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