mirror of
https://github.com/libretro/RetroArch
synced 2025-02-03 17:54:04 +00:00
commit
5ba7433232
22
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
22
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
## Guidelines
|
||||
|
||||
1. Rebase before opening a pull request
|
||||
2. If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
|
||||
3. If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
[Description of the pull request, detail any issues you are fixing or any features you are implementing]
|
||||
|
||||
## Related Issues
|
||||
|
||||
[Any issues this pull request may be addressing]
|
||||
|
||||
## Related Pull Requests
|
||||
|
||||
[Any other PRs from related repositories that might be needed for this pull request to work]
|
||||
|
||||
## Reviewers
|
||||
|
||||
[If possible @mention all the people that should review your pull request]
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -95,8 +95,6 @@ pkg/apple/iOS/modules/
|
||||
obj-unix/
|
||||
.vagrant/
|
||||
|
||||
.MAKEFILE_DEFINES
|
||||
.CONFIG_DEFINES
|
||||
/pkg/msvc/Release Cg/*.exe
|
||||
/pkg/msvc/Release Cg/*.iobj
|
||||
/pkg/msvc/Release Cg/*.ipdb
|
||||
|
@ -55,6 +55,7 @@ addons:
|
||||
- libsdl-image1.2-dev
|
||||
- libsdl-mixer1.2-dev
|
||||
- libsdl-ttf2.0-dev
|
||||
- libusb-1.0-0-dev
|
||||
coverity_scan:
|
||||
project:
|
||||
name: "RetroArch"
|
||||
|
28
.vscode/launch.json
vendored
Normal file
28
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "MINGW64 (MSYS2) debug",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/retroarch.exe",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": true,
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"terminal.integrated.env.windows": {
|
||||
"PATH": "/mingw64/lib/ccache/bin:/mingw64/lib/ccache/bin:/mingw64/lib/ccache/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:$PATH",
|
||||
"MSYSTEM": "MINGW64",
|
||||
},
|
||||
"terminal.integrated.cursorBlinking": true,
|
||||
|
||||
"editor.tabSize": 3,
|
||||
"editor.renderWhitespace": "all",
|
||||
"editor.insertSpaces": true,
|
||||
}
|
91
.vscode/tasks.json
vendored
Normal file
91
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"taskName": "Build",
|
||||
"type": "shell",
|
||||
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true },
|
||||
|
||||
"command": "./configure; make -j2",
|
||||
"options": {
|
||||
"shell": {
|
||||
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"args": [
|
||||
"-c"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"taskName": "Build with debugging symbols",
|
||||
"type": "shell",
|
||||
|
||||
"group": "build",
|
||||
|
||||
"command": "./configure; DEBUG=1 make -j2",
|
||||
"options": {
|
||||
"shell": {
|
||||
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"args": [
|
||||
"-c"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"taskName": "Build without reconfiguring",
|
||||
"type": "shell",
|
||||
|
||||
"group": "build",
|
||||
|
||||
"command": "make -j2",
|
||||
"options": {
|
||||
"shell": {
|
||||
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"args": [
|
||||
"-c"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"taskName": "Clean",
|
||||
"type": "shell",
|
||||
|
||||
"group": "build",
|
||||
|
||||
"command": "make clean",
|
||||
"options": {
|
||||
"shell": {
|
||||
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"args": [
|
||||
"-c"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"taskName": "Start",
|
||||
"type": "shell",
|
||||
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true },
|
||||
|
||||
"command": "./retroarch -v",
|
||||
"options": {
|
||||
"shell": {
|
||||
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
|
||||
"args": [
|
||||
"-c"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
17
CHANGES.md
17
CHANGES.md
@ -1,5 +1,14 @@
|
||||
# 1.6.8 (future)
|
||||
# 1.7.0 (future)
|
||||
- CHEEVOS: Add badges
|
||||
|
||||
# 1.6.9
|
||||
- COMMON: Small memory leak.
|
||||
- NETPLAY: Fix network command only working once.
|
||||
|
||||
# 1.6.8
|
||||
- Audio: Fix the Audio DSP picker
|
||||
- CHEEVOS: Add support for Atari Lynx cheevos.
|
||||
- CHEEVOS: Add support for RetroAchievements Leaderboards.
|
||||
- GUI: (MaterialUI) Fix crash that happened on context reset with Vulkan.
|
||||
- GUI: (MaterialUI) Skip querying and drawing items that are not visible; Cache content height and bbox calculation.
|
||||
- GUI: (MaterialUI) Fix entry box highlight calculation.
|
||||
@ -10,12 +19,15 @@
|
||||
- GUI: Add menu option for OSD text color.
|
||||
- GUI: Add menu option to remove frame count from OSD.
|
||||
- GUI: Allow wraparound of int/float settings when pressing the left key
|
||||
- INPUT/LIBRETRO: Add support for more mouse buttons (buttons 4/5)
|
||||
- INPUT/LIBRETRO: Add support for analog buttons
|
||||
- INPUT: Always show the controls menu even if descriptors are not set
|
||||
- INPUT: Fix input descriptors not being set on cores that don't implement the controllers interface
|
||||
- INPUT: Apply descriptors only for the amount of cores the core supports
|
||||
- INPUT: Implement keyboard to gamepad input remapping (limited to one gamepad device for now)
|
||||
- INPUT: Fix absolute mouse move handling on the winraw driver
|
||||
- INPUT: Ignore keyboard input if window is not active on udev driver
|
||||
- INPUT: Sanitize the filenames of autoconfig profiles before saving
|
||||
- LOBBIES: Fix crash on navigating left / right from the lobby menu
|
||||
- LOCALIZATION: Update Dutch translation
|
||||
- LOCALIZATION: Update Italian translation.
|
||||
@ -26,6 +38,8 @@
|
||||
- LINUX/PI: Broadcom VC4: Add Videocore config option
|
||||
- LINUX/UDEV: Fix - RetroArch reads keyboard input when not focused with the udev input driver.
|
||||
- NETPLAY: Fix disconnection not fully deinitializing Netplay.
|
||||
- NETPLAY: Fix lan rooms when there is more than one room
|
||||
- NETPLAY: Fix lan rooms on systems where all addresses are treated as IPv6
|
||||
- COMMON: Fix clear/free loop conditionals in playlists.
|
||||
- WINDOWS/GDI: Fix flickering of text.
|
||||
- WINDOWS/GDI: Fix graphics corruption on Windows 98
|
||||
@ -42,6 +56,7 @@
|
||||
- SCANNER: Support CHD files.
|
||||
- SCANNER: Support Gamecube ISO scanning.
|
||||
- SCANNER: Use primary data track of disc images for CRC lookups rather than cue files. This is slower but finds matches more reliably, and is necessary for CHD files to work at all. Update your databases!
|
||||
- SCANNER: Fall back on looking inside archives when matching MAME/FBA content (most recent cores only). If you had difficulty with content being detected before, you may have better luck now. Update your databases and core info!
|
||||
|
||||
# 1.6.7
|
||||
- SCANNER: Fix directory scanning.
|
||||
|
14
Makefile
14
Makefile
@ -119,10 +119,16 @@ endif
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
ifneq ($(X86),)
|
||||
CFLAGS += -m32
|
||||
CXXLAGS += -m32
|
||||
LDFLAGS += -m32
|
||||
endif
|
||||
|
||||
ifneq ($(SANITIZER),)
|
||||
CFLAGS := -fsanitize=$(SANITIZER) $(CFLAGS)
|
||||
CXXFLAGS := -fsanitize=$(SANITIZER) $(CXXFLAGS)
|
||||
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
||||
CFLAGS := -fsanitize=$(SANITIZER) $(CFLAGS)
|
||||
CXXFLAGS := -fsanitize=$(SANITIZER) $(CXXFLAGS)
|
||||
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring $(GPERFTOOLS),profiler),)
|
||||
@ -204,7 +210,7 @@ install: $(TARGET)
|
||||
rm -rf $(DESTDIR)$(ASSETS_DIR)/retroarch/assets/xmb/monochrome/src; \
|
||||
rm -rf $(DESTDIR)$(ASSETS_DIR)/retroarch/assets/xmb/retroactive/src; \
|
||||
rm -rf $(DESTDIR)$(ASSETS_DIR)/retroarch/assets/xmb/neoactive/src; \
|
||||
rm -rf $(DESTDIR)$(ASSETS_DIR)/retroarch/assets/xmb/retroactive_marked/src; \
|
||||
rm -rf $(DESTDIR)$(ASSETS_DIR)/retroarch/assets/xmb/retrosystem/src; \
|
||||
rm -rf $(DESTDIR)$(ASSETS_DIR)/retroarch/assets/xmb/dot-art/src; \
|
||||
echo "Asset copying done."; \
|
||||
fi
|
||||
|
@ -52,10 +52,6 @@ ifeq ($(HAVE_VITA2D), 1)
|
||||
DEFINES += -DHAVE_VITA2D
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FBO), 1)
|
||||
DEFINES += -DHAVE_FBO
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
DEFINES += -DHAVE_DYLIB
|
||||
endif
|
||||
@ -188,6 +184,10 @@ OBJ += frontend/frontend.o \
|
||||
setting_list.o \
|
||||
list_special.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_windowsmmap.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_intf.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_path.o \
|
||||
file_path_special.o \
|
||||
file_path_str.o \
|
||||
@ -322,7 +322,7 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SSA),1)
|
||||
LIBS += -lass
|
||||
LIBS += $(SSA_LIBS)
|
||||
endif
|
||||
|
||||
# LibretroDB
|
||||
@ -601,7 +601,7 @@ ifeq ($(HAVE_AL), 1)
|
||||
ifeq ($(OSX),1)
|
||||
LIBS += -framework OpenAL
|
||||
else
|
||||
LIBS += -lopenal
|
||||
LIBS += $(AL_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -812,7 +812,7 @@ ifeq ($(HAVE_THREADS), 1)
|
||||
audio/audio_thread_wrapper.o
|
||||
DEFINES += -DHAVE_THREADS
|
||||
ifeq ($(findstring Haiku,$(OS)),)
|
||||
LIBS += -lpthread
|
||||
LIBS += $(THREADS_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -916,7 +916,11 @@ ifeq ($(HAVE_THREADS), 1)
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_LIBUSB
|
||||
OBJ += input/drivers_hid/libusb_hid.o
|
||||
LIBS += -lusb-1.0
|
||||
ifneq ($(findstring BSD,$(OS)),)
|
||||
LIBS += -lusb
|
||||
else
|
||||
LIBS += -lusb-1.0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@ -1066,7 +1070,7 @@ endif
|
||||
else
|
||||
DEFINES += -DHAVE_GL_SYNC
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.o
|
||||
GL_LIBS := -lGL
|
||||
GL_LIBS := $(OPENGL_LIBS)
|
||||
ifeq ($(OSX), 1)
|
||||
GL_LIBS := -framework OpenGL
|
||||
OBJ += gfx/drivers_context/cgl_ctx.o
|
||||
@ -1480,6 +1484,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
OBJ += cheevos/cheevos.o \
|
||||
cheevos/var.o \
|
||||
cheevos/cond.o \
|
||||
cheevos/badges.o \
|
||||
$(LIBRETRO_COMM_DIR)/utils/md5.o
|
||||
endif
|
||||
|
||||
@ -1511,7 +1516,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
$(DEPS_DIR)/miniupnpc/minixml.o \
|
||||
$(DEPS_DIR)/miniupnpc/minisoap.o
|
||||
else
|
||||
LIBS += -lminiupnpc
|
||||
LIBS += $(MINIUPNPC_LIBS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@ -1526,7 +1531,7 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
gfx/drivers_font/gdi_font.o \
|
||||
menu/drivers_display/menu_display_gdi.o
|
||||
|
||||
LIBS += -lmsimg32
|
||||
LIBS += -lmsimg32 -lhid -lsetupapi
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_AVFOUNDATION), 1)
|
||||
|
28
Makefile.ctr
28
Makefile.ctr
@ -14,16 +14,16 @@ APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RETROARCH-3DS
|
||||
APP_UNIQUE_ID = 0xBAC00
|
||||
APP_ICON = ctr/assets/default.png
|
||||
APP_BANNER = ctr/assets/libretro_banner.png
|
||||
APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_RSF = ctr/tools/template.rsf
|
||||
APP_ICON = pkg/ctr/assets/default.png
|
||||
APP_BANNER = pkg/ctr/assets/libretro_banner.png
|
||||
APP_AUDIO = pkg/ctr/assets/silent.wav
|
||||
APP_RSF = pkg/ctr/tools/template.rsf
|
||||
APP_SYSTEM_MODE = 64MB
|
||||
APP_SYSTEM_MODE_EXT = 124MB
|
||||
APP_BIG_TEXT_SECTION = 0
|
||||
APP_USE_SVCHAX = 0
|
||||
|
||||
include ctr/Makefile.cores
|
||||
include pkg/ctr/Makefile.cores
|
||||
|
||||
OBJ :=
|
||||
OBJ += gfx/drivers/ctr_shaders/ctr_sprite.o
|
||||
@ -190,14 +190,14 @@ NM := $(PREFIX)nm
|
||||
LD := $(CXX)
|
||||
|
||||
ifneq ($(findstring Linux,$(shell uname -a)),)
|
||||
MAKEROM = ctr/tools/makerom-linux
|
||||
BANNERTOOL = ctr/tools/bannertool-linux
|
||||
MAKEROM = pkg/ctr/tools/makerom-linux
|
||||
BANNERTOOL = pkg/ctr/tools/bannertool-linux
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
MAKEROM = ctr/tools/makerom-mac
|
||||
BANNERTOOL = ctr/tools/bannertool-mac
|
||||
MAKEROM = pkg/ctr/tools/makerom-mac
|
||||
BANNERTOOL = pkg/ctr/tools/bannertool-mac
|
||||
else
|
||||
MAKEROM = ctr/tools/makerom.exe
|
||||
BANNERTOOL = ctr/tools/bannertool.exe
|
||||
MAKEROM = pkg/ctr/tools/makerom.exe
|
||||
BANNERTOOL = pkg/ctr/tools/bannertool.exe
|
||||
endif
|
||||
|
||||
%.o: %.vsh %.gsh
|
||||
@ -228,15 +228,15 @@ endif
|
||||
%.vsh:
|
||||
|
||||
$(TARGET).smdh: $(APP_ICON)
|
||||
smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
$(DEVKITPRO)/devkitARM/bin/smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
|
||||
$(TARGET).3dsx: $(TARGET).elf
|
||||
ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
cp ctr/big_text_section.xml $(TARGET).xml
|
||||
cp pkg/ctr/big_text_section.xml $(TARGET).xml
|
||||
else
|
||||
rm -f $(TARGET).xml
|
||||
endif
|
||||
-3dsxtool $< $@ $(_3DSXFLAGS)
|
||||
$(DEVKITPRO)/devkitARM/bin/3dsxtool $< $@ $(_3DSXFLAGS)
|
||||
|
||||
$(TARGET).elf: ctr/3dsx_custom_crt0.o
|
||||
$(LD) $(LDFLAGS) $(OBJ) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
@ -11,10 +11,10 @@ APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RETROARCH-3DS
|
||||
APP_UNIQUE_ID = 0xBAC00
|
||||
APP_ICON = ctr/assets/default.png
|
||||
APP_BANNER = ctr/assets/libretro_banner.png
|
||||
APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_RSF = ctr/tools/template.rsf
|
||||
APP_ICON = pkg/ctr/assets/default.png
|
||||
APP_BANNER = pkg/ctr/assets/libretro_banner.png
|
||||
APP_AUDIO = pkg/ctr/assets/silent.wav
|
||||
APP_RSF = pkg/ctr/tools/template.rsf
|
||||
APP_SYSTEM_MODE = 64MB
|
||||
APP_SYSTEM_MODE_EXT = 124MB
|
||||
|
||||
@ -44,7 +44,7 @@ ifeq ($(strip $(DEVKITPRO)),)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CTRULIB)),)
|
||||
CTRULIB = $(DEVKITPRO)/ctrulib
|
||||
CTRULIB = $(DEVKITPRO)/libctru
|
||||
endif
|
||||
|
||||
APP_TITLE := $(shell echo "$(APP_TITLE)" | cut -c1-128)
|
||||
@ -122,14 +122,14 @@ NM := $(PREFIX)nm
|
||||
LD := $(CXX)
|
||||
|
||||
ifneq ($(findstring Linux,$(shell uname -a)),)
|
||||
MAKEROM = ctr/tools/makerom-linux
|
||||
BANNERTOOL = ctr/tools/bannertool-linux
|
||||
MAKEROM = pkg/ctr/tools/makerom-linux
|
||||
BANNERTOOL = pkg/ctr/tools/bannertool-linux
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
MAKEROM = ctr/tools/makerom-mac
|
||||
BANNERTOOL = ctr/tools/bannertool-mac
|
||||
MAKEROM = pkg/ctr/tools/makerom-mac
|
||||
BANNERTOOL = pkg/ctr/tools/bannertool-mac
|
||||
else
|
||||
MAKEROM = ctr/tools/makerom.exe
|
||||
BANNERTOOL = ctr/tools/bannertool.exe
|
||||
MAKEROM = pkg/ctr/tools/makerom.exe
|
||||
BANNERTOOL = pkg/ctr/tools/bannertool.exe
|
||||
endif
|
||||
|
||||
%.o: %.vsh %.gsh
|
||||
@ -160,11 +160,11 @@ endif
|
||||
%.vsh:
|
||||
|
||||
$(TARGET).smdh: $(APP_ICON)
|
||||
smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
$(DEVKITPRO)/devkitARM/bin/smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@
|
||||
|
||||
$(TARGET).3dsx: $(TARGET).elf
|
||||
ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
cp ctr/big_text_section.xml $(TARGET).xml
|
||||
cp pkg/ctr/big_text_section.xml $(TARGET).xml
|
||||
else
|
||||
rm -f $(TARGET).xml
|
||||
endif
|
||||
|
@ -19,7 +19,6 @@ HAVE_RGUI = 1
|
||||
HAVE_SDL = 0
|
||||
HAVE_SDL2 = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_FBO = 1
|
||||
WANT_ZLIB = 1
|
||||
MEMORY = 536870912
|
||||
|
||||
|
@ -318,7 +318,6 @@ else ifeq ($(platform), windows_msvc6_x86)
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_FBO := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
@ -335,14 +334,14 @@ else ifeq ($(platform), windows_msvc6_x86)
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0351 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib
|
||||
|
||||
VCDIR ?= $(shell reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\DevStudio\6.0\Products\Microsoft Visual C++" -v "ProductDir" | grep -o '[A-Z]:\\.*')
|
||||
VCDIR ?= $(shell reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\DevStudio\6.0\Products\Microsoft Visual C++" -v "ProductDir" | grep -io '[A-Z]:\\.*')
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VCDIR)/bin"):$(PATH)
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VCDIR)/../Common/MSDev98/Bin")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VCDIR)/Include")
|
||||
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VCDIR)/Lib")
|
||||
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(INETSDK)\Lib
|
||||
else ifeq ($(platform), windows_msvc2003_x86)
|
||||
HAVE_RPNG := 1
|
||||
@ -360,7 +359,6 @@ else ifeq ($(platform), windows_msvc2003_x86)
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_FBO := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
@ -385,10 +383,10 @@ else ifeq ($(platform), windows_msvc2003_x86)
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(INETSDK)\Lib;$(DXSDK_DIR)\Lib\x86
|
||||
else
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(INETSDK)\Lib
|
||||
endif
|
||||
else ifeq ($(platform), windows_msvc2005_x86)
|
||||
@ -407,7 +405,6 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_FBO := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
@ -433,10 +430,10 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(INETSDK)\Lib;$(DXSDK_DIR)\Lib\x86
|
||||
else
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc
|
||||
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(INETSDK)\Lib
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
@ -455,7 +452,6 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_FBO := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
@ -497,17 +493,17 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS100COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS100COMNTOOLS)../../VC/include")
|
||||
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -o '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A" -v "InstallationFolder" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir := $(WindowsSdkDir:\=)
|
||||
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D9 -DHAVE_XAUDIO -DHAVE_XINPUT
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib);$(DXSDK_DIR)\Lib\$(WinArch)
|
||||
else
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
@ -526,7 +522,6 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_FBO := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
@ -573,16 +568,16 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS110COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS110COMNTOOLS)../../VC/include")
|
||||
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -v "KitsRoot81" | grep -o '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -v "KitsRoot81" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir := $(WindowsSdkDir:\=)
|
||||
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D9 -DHAVE_XAUDIO -DHAVE_XINPUT
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib);$(DXSDK_DIR)\Lib\$(WinArch)
|
||||
else
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;libretro-common\include;libretro-common\include\compat\msvc;gfx\include
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
|
||||
endif
|
||||
else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
@ -601,7 +596,6 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_FBO := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
@ -648,16 +642,16 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS120COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath -w "$(VS120COMNTOOLS)../../VC/include")
|
||||
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -v "KitsRoot81" | grep -o '[A-Z]:\\.*')
|
||||
WindowsSdkDir ?= $(shell reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" -v "KitsRoot81" | grep -io '[A-Z]:\\.*')
|
||||
WindowsSdkDir := $(WindowsSdkDir:\=)
|
||||
|
||||
ifeq ($(HAVE_DIRECTX), 1)
|
||||
PLATCFLAGS += -DHAVE_DINPUT -DHAVE_DSOUND -DHAVE_D3D -DHAVE_D3D9 -DHAVE_XAUDIO -DHAVE_XINPUT
|
||||
DXSDK_DIR := $(DXSDK_DIR:\=)
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;$(DXSDK_DIR)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib);$(DXSDK_DIR)\Lib\$(WinArch)
|
||||
else
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;libretro-common\include;libretro-common\include\compat\msvc;gfx\include
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)\Include\um;$(WindowsSdkDir)\Include\shared;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
|
||||
endif
|
||||
endif
|
||||
@ -666,11 +660,11 @@ ifneq (,$(findstring msvc,$(platform)))
|
||||
CFLAGS += -W2 $(MACHDEP) $(PLATCFLAGS)
|
||||
else
|
||||
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(PLATCFLAGS) $(INCLUDE)
|
||||
INCLUDE += -I./libretro-common/include
|
||||
INCLUDE += -I./libretro-common/include \
|
||||
-Ideps \
|
||||
-Ideps/stb
|
||||
endif
|
||||
|
||||
INCLUDE += -Ideps -Ideps/stb
|
||||
|
||||
OBJ = griffin/griffin.o $(PLATOBJS)
|
||||
|
||||
ifeq ($(HAVE_GRIFFIN_CPP), 1)
|
||||
@ -812,10 +806,6 @@ ifeq ($(HAVE_GETOPT_LONG), 1)
|
||||
CFLAGS += -DHAVE_GETOPT_LONG=1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FBO), 1)
|
||||
CFLAGS += -DHAVE_FBO
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
CFLAGS += -DHAVE_DYLIB
|
||||
endif
|
||||
@ -843,6 +833,7 @@ ifeq ($(DEBUG), 1)
|
||||
endif
|
||||
|
||||
CFLAGS += -Od -Zi -D_DEBUG -MTd -TP
|
||||
LDFLAGS += -DEBUG
|
||||
else
|
||||
CFLAGS += -O0 -g -DDEBUG
|
||||
endif
|
||||
|
@ -101,7 +101,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LANGEXTRA -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LANGEXTRA -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN
|
||||
|
||||
#DEFINES += -DHAVE_IMAGEVIEWER
|
||||
|
||||
|
@ -99,7 +99,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_STB_VORBIS
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_STB_VORBIS
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
@ -89,7 +89,7 @@ ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
SHARED_FLAGS := -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER
|
||||
SHARED_FLAGS := -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER
|
||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||
CXXFLAGS += $(SHARED_FLAGS)
|
||||
|
||||
|
@ -18,24 +18,27 @@ OBJ += wiiu/system/exception_handler.o
|
||||
OBJ += wiiu/system/missing_libc_functions.o
|
||||
OBJ += wiiu/fs/sd_fat_devoptab.o
|
||||
OBJ += wiiu/fs/fs_utils.o
|
||||
OBJ += wiiu/controller_patcher/ControllerPatcher.o
|
||||
OBJ += wiiu/controller_patcher/ControllerPatcherWrapper.o
|
||||
OBJ += wiiu/controller_patcher/ConfigReader.o
|
||||
OBJ += wiiu/controller_patcher/config/ConfigParser.o
|
||||
OBJ += wiiu/controller_patcher/config/ConfigValues.o
|
||||
OBJ += wiiu/controller_patcher/network/ControllerPatcherNet.o
|
||||
OBJ += wiiu/controller_patcher/network/TCPServer.o
|
||||
OBJ += wiiu/controller_patcher/network/UDPClient.o
|
||||
OBJ += wiiu/controller_patcher/network/UDPServer.o
|
||||
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherUtils.o
|
||||
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherHID.o
|
||||
OBJ += wiiu/controller_patcher/utils/CPRetainVars.o
|
||||
OBJ += wiiu/controller_patcher/utils/CPStringTools.o
|
||||
OBJ += wiiu/controller_patcher/utils/PadConst.o
|
||||
OBJ += wiiu/controller_patcher/utils/FSHelper.o
|
||||
OBJ += wiiu/tex_shader.o
|
||||
OBJ += wiiu/hbl.o
|
||||
|
||||
ifeq ($(ENABLE_CONTROLLER_PATCHER), 1)
|
||||
OBJ += wiiu/controller_patcher/ControllerPatcher.o
|
||||
OBJ += wiiu/controller_patcher/ControllerPatcherWrapper.o
|
||||
OBJ += wiiu/controller_patcher/ConfigReader.o
|
||||
OBJ += wiiu/controller_patcher/config/ConfigParser.o
|
||||
OBJ += wiiu/controller_patcher/config/ConfigValues.o
|
||||
OBJ += wiiu/controller_patcher/network/ControllerPatcherNet.o
|
||||
OBJ += wiiu/controller_patcher/network/TCPServer.o
|
||||
OBJ += wiiu/controller_patcher/network/UDPClient.o
|
||||
OBJ += wiiu/controller_patcher/network/UDPServer.o
|
||||
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherUtils.o
|
||||
OBJ += wiiu/controller_patcher/patcher/ControllerPatcherHID.o
|
||||
OBJ += wiiu/controller_patcher/utils/CPRetainVars.o
|
||||
OBJ += wiiu/controller_patcher/utils/CPStringTools.o
|
||||
OBJ += wiiu/controller_patcher/utils/PadConst.o
|
||||
OBJ += wiiu/controller_patcher/utils/FSHelper.o
|
||||
endif
|
||||
|
||||
DEFINES :=
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
@ -158,6 +161,9 @@ CFLAGS += -DWIIU -DMSB_FIRST
|
||||
CFLAGS += -DHAVE_MAIN
|
||||
CFLAGS += -DHAVE_UPDATE_ASSETS
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
ifeq ($(ENABLE_CONTROLLER_PATCHER), 1)
|
||||
CFLAGS += -DENABLE_CONTROLLER_PATCHER
|
||||
endif
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
||||
|
||||
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
|
||||
|
@ -5,7 +5,6 @@ HAVE_XAUDIO = 1
|
||||
HAVE_DSOUND = 1
|
||||
HAVE_WASAPI = 1
|
||||
HAVE_OPENGL = 1
|
||||
HAVE_FBO = 1
|
||||
HAVE_DYLIB = 1
|
||||
HAVE_D3D9 = 1
|
||||
HAVE_NETWORKING = 1
|
||||
|
54
cheevos/badges.c
Normal file
54
cheevos/badges.c
Normal file
@ -0,0 +1,54 @@
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <streams/file_stream.h>
|
||||
|
||||
#include "../file_path_special.h"
|
||||
#include "../configuration.h"
|
||||
#include "../verbosity.h"
|
||||
#include "../network/net_http_special.h"
|
||||
|
||||
#include "badges.h"
|
||||
|
||||
badges_ctx_t badges_ctx;
|
||||
|
||||
bool badge_exists(const char* filepath)
|
||||
{
|
||||
if(path_file_exists(filepath))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
||||
{
|
||||
const char * locked_suffix = (badges->badge_locked[i] == true) ? "_lock.png" : ".png";
|
||||
|
||||
unsigned int bufferSize = 16;
|
||||
char badge_file[bufferSize];
|
||||
|
||||
snprintf(badge_file, bufferSize, "%s", badges->badge_id_list[i]);
|
||||
strcat(badge_file, locked_suffix);
|
||||
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
fill_pathname_application_special(fullpath,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
|
||||
|
||||
menu_display_reset_textures_list(badge_file, fullpath, &badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||
}
|
||||
|
||||
void set_badge_info (badges_ctx_t *badge_struct, int id, const char *badge_id, bool active)
|
||||
{
|
||||
badge_struct->badge_id_list[id] = badge_id;
|
||||
badge_struct->badge_locked[id] = active;
|
||||
set_badge_menu_texture(badge_struct, id);
|
||||
}
|
||||
|
||||
menu_texture_item get_badge_texture (int id)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!settings->bools.cheevos_badges_enable)
|
||||
return (menu_texture_item)NULL;
|
||||
|
||||
return badges_ctx.menu_texture_list[id];
|
||||
}
|
29
cheevos/badges.h
Normal file
29
cheevos/badges.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef __RARCH_BADGE_H
|
||||
#define __RARCH_BADGE_H
|
||||
|
||||
#include "../menu/menu_driver.h"
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define CHEEVOS_BADGE_LIMIT 256
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool badge_locked[CHEEVOS_BADGE_LIMIT];
|
||||
const char * badge_id_list[CHEEVOS_BADGE_LIMIT];
|
||||
menu_texture_item menu_texture_list[CHEEVOS_BADGE_LIMIT];
|
||||
} badges_ctx_t;
|
||||
|
||||
bool badge_exists(const char* filepath);
|
||||
void set_badge_menu_texture(badges_ctx_t * badges, int i);
|
||||
extern void set_badge_info (badges_ctx_t *badge_struct, int id, const char *badge_id, bool active);
|
||||
extern menu_texture_item get_badge_texture(int id);
|
||||
|
||||
extern badges_ctx_t badges_ctx;
|
||||
static badges_ctx_t new_badges_ctx;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -60,15 +60,64 @@ typedef enum
|
||||
CHEEVOS_CONSOLE_SEGA_CD = 9,
|
||||
CHEEVOS_CONSOLE_SEGA_32X = 10,
|
||||
CHEEVOS_CONSOLE_MASTER_SYSTEM = 11,
|
||||
CHEEVOS_CONSOLE_XBOX_360 = 12,
|
||||
CHEEVOS_CONSOLE_ATARI_LYNX = 13
|
||||
CHEEVOS_CONSOLE_PLAYSTATION = 12,
|
||||
CHEEVOS_CONSOLE_ATARI_LYNX = 13,
|
||||
CHEEVOS_CONSOLE_NEOGEO = 14,
|
||||
CHEEVOS_CONSOLE_XBOX_360 = 15,
|
||||
CHEEVOS_CONSOLE_GAMECUBE = 16,
|
||||
CHEEVOS_CONSOLE_ATARI_JAGUAR = 17,
|
||||
CHEEVOS_CONSOLE_NINTENDO_DS = 18,
|
||||
CHEEVOS_CONSOLE_WII = 19,
|
||||
CHEEVOS_CONSOLE_WII_U = 20,
|
||||
CHEEVOS_CONSOLE_PLAYSTATION_2 = 21,
|
||||
CHEEVOS_CONSOLE_XBOX = 22,
|
||||
CHEEVOS_CONSOLE_SKYNET = 23,
|
||||
CHEEVOS_CONSOLE_XBOX_ONE = 24,
|
||||
CHEEVOS_CONSOLE_ATARI_2600 = 25,
|
||||
CHEEVOS_CONSOLE_MS_DOS = 26,
|
||||
CHEEVOS_CONSOLE_ARCADE = 27,
|
||||
CHEEVOS_CONSOLE_VIRTUAL_BOY = 28,
|
||||
CHEEVOS_CONSOLE_MSX = 29,
|
||||
CHEEVOS_CONSOLE_COMMODORE_64 = 30,
|
||||
CHEEVOS_CONSOLE_ZX81 = 31
|
||||
} cheevos_console_t;
|
||||
|
||||
enum
|
||||
{
|
||||
CHEEVOS_DIRTY_TITLE = 1 << 0,
|
||||
CHEEVOS_DIRTY_DESC = 1 << 1,
|
||||
CHEEVOS_DIRTY_POINTS = 1 << 2,
|
||||
CHEEVOS_DIRTY_AUTHOR = 1 << 3,
|
||||
CHEEVOS_DIRTY_ID = 1 << 4,
|
||||
CHEEVOS_DIRTY_BADGE = 1 << 5,
|
||||
CHEEVOS_DIRTY_CONDITIONS = 1 << 6,
|
||||
CHEEVOS_DIRTY_VOTES = 1 << 7,
|
||||
CHEEVOS_DIRTY_DESCRIPTION = 1 << 8,
|
||||
|
||||
CHEEVOS_DIRTY_ALL = (1 << 9) - 1
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CHEEVOS_ACTIVE_SOFTCORE = 1 << 0,
|
||||
CHEEVOS_ACTIVE_HARDCORE = 1 << 1
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CHEEVOS_FORMAT_FRAMES = 0,
|
||||
CHEEVOS_FORMAT_SECS,
|
||||
CHEEVOS_FORMAT_MILLIS,
|
||||
CHEEVOS_FORMAT_SCORE,
|
||||
CHEEVOS_FORMAT_VALUE,
|
||||
CHEEVOS_FORMAT_OTHER
|
||||
};
|
||||
|
||||
bool cheevos_load(const void *data);
|
||||
|
||||
void cheevos_reset_game(void);
|
||||
|
||||
void cheevos_populate_menu(void *data, bool hardcore);
|
||||
void cheevos_populate_menu(void *data);
|
||||
|
||||
bool cheevos_get_description(cheevos_ctx_desc_t *desc);
|
||||
|
||||
|
@ -119,12 +119,21 @@ void cheevos_var_parse(cheevos_var_t* var, const char** memaddr)
|
||||
const char *str = *memaddr;
|
||||
unsigned base = 16;
|
||||
|
||||
var->is_bcd = false;
|
||||
|
||||
if (toupper((unsigned char)*str) == 'D' && str[1] == '0' && toupper((unsigned char)str[2]) == 'X')
|
||||
{
|
||||
/* d0x + 4 hex digits */
|
||||
str += 3;
|
||||
var->type = CHEEVOS_VAR_TYPE_DELTA_MEM;
|
||||
}
|
||||
else if (toupper((unsigned char)*str) == 'B' && str[1] == '0' && toupper((unsigned char)str[2]) == 'X')
|
||||
{
|
||||
/* b0x (binary-coded decimal) */
|
||||
str += 3;
|
||||
var->is_bcd = true;
|
||||
var->type = CHEEVOS_VAR_TYPE_ADDRESS;
|
||||
}
|
||||
else if (*str == '0' && toupper((unsigned char)str[1]) == 'X')
|
||||
{
|
||||
/* 0x + 4 hex digits */
|
||||
@ -406,5 +415,8 @@ unsigned cheevos_var_get_value(cheevos_var_t* var)
|
||||
break;
|
||||
}
|
||||
|
||||
return value;
|
||||
if(var->is_bcd)
|
||||
return (((value >> 4) & 0xf) * 10) + (value & 0xf);
|
||||
else
|
||||
return value;
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ typedef struct
|
||||
cheevos_var_size_t size;
|
||||
cheevos_var_type_t type;
|
||||
int bank_id;
|
||||
bool is_bcd;
|
||||
unsigned value;
|
||||
unsigned previous;
|
||||
} cheevos_var_t;
|
||||
|
170
command.c
170
command.c
@ -641,6 +641,7 @@ static void command_stdin_poll(command_t *handle)
|
||||
|
||||
bool command_poll(command_t *handle)
|
||||
{
|
||||
memset(handle->state, 0, sizeof(handle->state));
|
||||
#if defined(HAVE_NETWORKING) && defined(HAVE_NETWORK_CMD) && defined(HAVE_COMMAND)
|
||||
command_network_poll(handle);
|
||||
#endif
|
||||
@ -1101,7 +1102,7 @@ static void command_event_load_auto_state(void)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (settings->bools.cheevos_hardcore_mode_enable)
|
||||
if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
@ -1307,14 +1308,18 @@ static void command_event_restore_default_shader_preset(void)
|
||||
if (!path_is_empty(RARCH_PATH_DEFAULT_SHADER_PRESET))
|
||||
{
|
||||
/* auto shader preset: reload the original shader */
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *shader_preset = path_get(RARCH_PATH_DEFAULT_SHADER_PRESET);
|
||||
|
||||
RARCH_LOG("%s %s\n",
|
||||
msg_hash_to_str(MSG_RESTORING_DEFAULT_SHADER_PRESET_TO),
|
||||
path_get(RARCH_PATH_DEFAULT_SHADER_PRESET));
|
||||
strlcpy(settings->paths.path_shader,
|
||||
path_get(RARCH_PATH_DEFAULT_SHADER_PRESET),
|
||||
sizeof(settings->paths.path_shader));
|
||||
if (!string_is_empty(shader_preset))
|
||||
{
|
||||
RARCH_LOG("%s %s\n",
|
||||
msg_hash_to_str(MSG_RESTORING_DEFAULT_SHADER_PRESET_TO),
|
||||
shader_preset);
|
||||
strlcpy(settings->paths.path_shader,
|
||||
shader_preset,
|
||||
sizeof(settings->paths.path_shader));
|
||||
}
|
||||
}
|
||||
|
||||
path_clear(RARCH_PATH_DEFAULT_SHADER_PRESET);
|
||||
@ -1351,7 +1356,7 @@ static bool command_event_save_auto_state(void)
|
||||
goto error;
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (settings->bools.cheevos_hardcore_mode_enable)
|
||||
if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
@ -1373,24 +1378,32 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool command_event_save_config(const char *config_path,
|
||||
static bool command_event_save_config(
|
||||
const char *config_path,
|
||||
char *s, size_t len)
|
||||
{
|
||||
if (string_is_empty(config_path) || !config_save_file(config_path))
|
||||
bool path_exists = !string_is_empty(config_path);
|
||||
const char *str = path_exists ? config_path :
|
||||
path_get(RARCH_PATH_CONFIG);
|
||||
|
||||
if (path_exists && config_save_file(config_path))
|
||||
{
|
||||
snprintf(s, len, "[Config]: %s \"%s\".",
|
||||
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||
config_path);
|
||||
RARCH_LOG("%s\n", s);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!string_is_empty(str))
|
||||
{
|
||||
snprintf(s, len, "%s \"%s\".",
|
||||
msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO),
|
||||
path_get(RARCH_PATH_CONFIG));
|
||||
str);
|
||||
RARCH_ERR("%s\n", s);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
snprintf(s, len, "[Config]: %s \"%s\".",
|
||||
msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO),
|
||||
path_get(RARCH_PATH_CONFIG));
|
||||
RARCH_LOG("%s\n", s);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1407,6 +1420,7 @@ static bool command_event_save_core_config(void)
|
||||
bool ret = false;
|
||||
bool found_path = false;
|
||||
bool overrides_active = false;
|
||||
const char *core_path = NULL;
|
||||
char *config_dir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *config_name = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *config_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
@ -1429,8 +1443,10 @@ static bool command_event_save_core_config(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
core_path = path_get(RARCH_PATH_CORE);
|
||||
|
||||
/* Infer file name based on libretro core. */
|
||||
if (!string_is_empty(path_get(RARCH_PATH_CORE)) && path_file_exists(path_get(RARCH_PATH_CORE)))
|
||||
if (!string_is_empty(core_path) && path_file_exists(core_path))
|
||||
{
|
||||
unsigned i;
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG));
|
||||
@ -1442,7 +1458,7 @@ static bool command_event_save_core_config(void)
|
||||
|
||||
fill_pathname_base_noext(
|
||||
config_name,
|
||||
path_get(RARCH_PATH_CORE),
|
||||
core_path,
|
||||
config_size);
|
||||
|
||||
fill_pathname_join(config_path, config_dir, config_name,
|
||||
@ -1489,7 +1505,8 @@ static bool command_event_save_core_config(void)
|
||||
|
||||
command_event_save_config(config_path, msg, sizeof(msg));
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
if (!string_is_empty(msg))
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
|
||||
if (overrides_active)
|
||||
rarch_ctl(RARCH_CTL_SET_OVERRIDES_ACTIVE, NULL);
|
||||
@ -1685,6 +1702,62 @@ static bool command_event_resize_windowed_scale(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
void command_playlist_push_write(
|
||||
void *data,
|
||||
const char *path,
|
||||
const char *label,
|
||||
const char *core_path,
|
||||
const char *core_name)
|
||||
{
|
||||
playlist_t *playlist = (playlist_t*)data;
|
||||
|
||||
if (!playlist)
|
||||
return;
|
||||
|
||||
if (playlist_push(
|
||||
playlist,
|
||||
path,
|
||||
label,
|
||||
core_path,
|
||||
core_name,
|
||||
NULL,
|
||||
NULL
|
||||
))
|
||||
playlist_write_file(playlist);
|
||||
}
|
||||
|
||||
void command_playlist_update_write(
|
||||
void *data,
|
||||
size_t idx,
|
||||
const char *core_display_name,
|
||||
const char *label,
|
||||
const char *path)
|
||||
{
|
||||
playlist_t *plist = (playlist_t*)data;
|
||||
playlist_t *playlist = NULL;
|
||||
|
||||
if (plist)
|
||||
playlist = plist;
|
||||
#ifdef HAVE_MENU
|
||||
else
|
||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist);
|
||||
#endif
|
||||
if (!playlist)
|
||||
return;
|
||||
|
||||
playlist_update(
|
||||
playlist,
|
||||
idx,
|
||||
label,
|
||||
NULL,
|
||||
path,
|
||||
core_display_name,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
playlist_write_file(playlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* command_event:
|
||||
* @cmd : Event command index.
|
||||
@ -1733,18 +1806,23 @@ bool command_event(enum event_command cmd, void *data)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
core_info_ctx_find_t info_find;
|
||||
rarch_system_info_t *system_info = runloop_get_system_info();
|
||||
struct retro_system_info *system = &system_info->info;
|
||||
rarch_system_info_t *system_info = NULL;
|
||||
struct retro_system_info *system = NULL;
|
||||
const char *core_path = NULL;
|
||||
system_info = runloop_get_system_info();
|
||||
system = &system_info->info;
|
||||
core_path = path_get(RARCH_PATH_CORE);
|
||||
|
||||
#if defined(HAVE_DYNAMIC)
|
||||
if (string_is_empty(path_get(RARCH_PATH_CORE)))
|
||||
if (string_is_empty(core_path))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
libretro_get_system_info(
|
||||
path_get(RARCH_PATH_CORE),
|
||||
core_path,
|
||||
system,
|
||||
&system_info->load_no_content);
|
||||
info_find.path = path_get(RARCH_PATH_CORE);
|
||||
info_find.path = core_path;
|
||||
|
||||
if (!core_info_load(&info_find))
|
||||
{
|
||||
@ -1770,7 +1848,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings->bools.cheevos_hardcore_mode_enable)
|
||||
if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
@ -1812,7 +1890,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (settings->bools.cheevos_hardcore_mode_enable)
|
||||
if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@ -1903,7 +1981,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
{
|
||||
#ifdef HAVE_CHEEVOS
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings->bools.cheevos_hardcore_mode_enable)
|
||||
if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@ -1914,7 +1992,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (settings->bools.cheevos_hardcore_mode_enable)
|
||||
if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable)
|
||||
return false;
|
||||
#endif
|
||||
if (settings->bools.rewind_enable)
|
||||
@ -2237,18 +2315,32 @@ TODO: Add a setting for these tweaks */
|
||||
ui_companion_driver_toggle();
|
||||
break;
|
||||
case CMD_EVENT_ADD_TO_FAVORITES:
|
||||
playlist_push(
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
rarch_system_info_t *sys_info = runloop_get_system_info();
|
||||
const char *core_name = NULL;
|
||||
const char *core_path = NULL;
|
||||
const char *label = NULL;
|
||||
|
||||
if (sys_info)
|
||||
{
|
||||
core_name = sys_info->info.library_name;
|
||||
core_path = path_get(RARCH_PATH_CORE);
|
||||
}
|
||||
|
||||
if (!string_is_empty(global->name.label))
|
||||
label = global->name.label;
|
||||
|
||||
command_playlist_push_write(
|
||||
g_defaults.content_favorites,
|
||||
path_get(RARCH_PATH_CONTENT),
|
||||
NULL,
|
||||
file_path_str(FILE_PATH_DETECT),
|
||||
file_path_str(FILE_PATH_DETECT),
|
||||
NULL,
|
||||
NULL
|
||||
(const char*)data,
|
||||
label,
|
||||
core_path,
|
||||
core_name
|
||||
);
|
||||
playlist_write_file(g_defaults.content_favorites);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true);
|
||||
break;
|
||||
}
|
||||
case CMD_EVENT_RESTART_RETROARCH:
|
||||
if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART))
|
||||
return false;
|
||||
|
14
command.h
14
command.h
@ -259,6 +259,20 @@ bool command_free(command_t *handle);
|
||||
**/
|
||||
bool command_event(enum event_command action, void *data);
|
||||
|
||||
void command_playlist_push_write(
|
||||
void *data,
|
||||
const char *path,
|
||||
const char *label,
|
||||
const char *core_path,
|
||||
const char *core_name);
|
||||
|
||||
void command_playlist_update_write(
|
||||
void *data,
|
||||
size_t idx,
|
||||
const char *core_display_name,
|
||||
const char *label,
|
||||
const char *path);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -293,6 +293,12 @@ static bool xmb_show_add = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBRETRODB) && !defined(RARCH_CONSOLE)
|
||||
static bool automatically_add_content_to_playlist = true;
|
||||
#else
|
||||
static bool automatically_add_content_to_playlist = false;
|
||||
#endif
|
||||
|
||||
static float menu_framebuffer_opacity = 0.900;
|
||||
|
||||
static float menu_wallpaper_opacity = 0.300;
|
||||
@ -528,7 +534,7 @@ static const bool netplay_nat_traversal = false;
|
||||
|
||||
static const unsigned netplay_delay_frames = 16;
|
||||
|
||||
static const int netplay_check_frames = 30;
|
||||
static const int netplay_check_frames = 600;
|
||||
|
||||
static const bool netplay_use_mitm_server = false;
|
||||
|
||||
|
@ -22,163 +22,202 @@
|
||||
|
||||
/* User 1 */
|
||||
static const struct retro_keybind retro_keybinds_1[] = {
|
||||
/* | RetroPad button | enum | keyboard key | js btn | js axis | */
|
||||
/* | RetroPad button | enum | keyboard key | m-btn | js btn | js axis | */
|
||||
#ifdef __QNX__
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_k, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_i, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_v, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_b, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_e, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_s, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_w, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_d, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_l, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_o, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_f, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_j, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_r, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_u, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_g, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_h, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_k, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_v, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_b, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_s, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_w, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_d, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_l, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_o, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_f, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_j, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_r, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_u, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_g, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_h, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MOVIE_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MOVIE_RECORD_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_SPACE, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MOVIE_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MOVIE_RECORD_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
#else
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_a, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_RSHIFT, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_RETURN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UP, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_DOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_LEFT, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_RIGHT, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_x, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_s, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_q, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_w, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_a, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_RSHIFT, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_RETURN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UP, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_DOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_LEFT, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_RIGHT, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_x, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_s, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_q, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_w, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_SPACE, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,RETROK_l, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_F4, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_F2, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,RETROK_f, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_ESCAPE, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_F7, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_F6, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_r, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MOVIE_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MOVIE_RECORD_TOGGLE, RETROK_o, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_p, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_k, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_h, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_m, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_n, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_y, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_t, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_u, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_F8, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_F9, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_F12, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_i, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION, RETROK_e, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_KP_PLUS, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_KP_MINUS,NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_F11, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_SCROLLOCK, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_F1, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,RETROK_l, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_F4, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_F2, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,RETROK_f, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_ESCAPE, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_F7, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_F6, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_r, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MOVIE_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MOVIE_RECORD_TOGGLE, RETROK_o, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_p, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_k, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_h, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_m, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_n, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_y, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_t, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_u, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_F8, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_F9, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_F12, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_KP_PLUS, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_KP_MINUS,NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_F11, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_SCROLLOCK, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_F1, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Users 2 to MAX_USERS */
|
||||
static const struct retro_keybind retro_keybinds_rest[] = {
|
||||
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -260,12 +260,6 @@ static const bool _sdl_image_supp = true;
|
||||
static const bool _sdl_image_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
static const bool _fbo_supp = true;
|
||||
#else
|
||||
static const bool _fbo_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
static const bool _dynamic_supp = true;
|
||||
#else
|
||||
|
123
configuration.c
123
configuration.c
@ -50,6 +50,12 @@
|
||||
|
||||
#include "tasks/tasks_internal.h"
|
||||
|
||||
static const char* invalid_filename_chars[] = {
|
||||
/* https://support.microsoft.com/en-us/help/905231/information-about-the-characters-that-you-cannot-use-in-site-names--fo */
|
||||
"~", "#", "%", "&", "*", "{", "}", "\\", ":", "[", "]", "?", "/", "|", "\'", "\"",
|
||||
NULL
|
||||
};
|
||||
|
||||
/* All config related settings go here. */
|
||||
|
||||
struct config_bool_setting
|
||||
@ -1108,6 +1114,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
unsigned count = 0;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, automatically_add_content_to_playlist, false);
|
||||
SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false);
|
||||
SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, ui_companion_enable, false);
|
||||
SETTING_BOOL("video_gpu_record", &settings->bools.video_gpu_record, true, gpu_record, false);
|
||||
@ -1248,6 +1255,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("cheevos_enable", &settings->bools.cheevos_enable, true, cheevos_enable, false);
|
||||
SETTING_BOOL("cheevos_test_unofficial", &settings->bools.cheevos_test_unofficial, true, false, false);
|
||||
SETTING_BOOL("cheevos_hardcore_mode_enable", &settings->bools.cheevos_hardcore_mode_enable, true, false, false);
|
||||
SETTING_BOOL("cheevos_leaderboards_enable", &settings->bools.cheevos_leaderboards_enable, true, false, false);
|
||||
#ifdef HAVE_XMB
|
||||
SETTING_BOOL("cheevos_badges_enable", &settings->bools.cheevos_badges_enable, true, false, false);
|
||||
#endif
|
||||
SETTING_BOOL("cheevos_verbose_enable", &settings->bools.cheevos_verbose_enable, true, false, false);
|
||||
#endif
|
||||
#ifdef HAVE_OVERLAY
|
||||
@ -1857,7 +1868,7 @@ static void config_set_defaults(void)
|
||||
temp_str[0] = '\0';
|
||||
|
||||
fill_pathname_expand_special(temp_str,
|
||||
g_defaults.path.config,
|
||||
g_defaults.path.config,
|
||||
PATH_MAX_LENGTH * sizeof(char));
|
||||
path_set(RARCH_PATH_CONFIG, temp_str);
|
||||
free(temp_str);
|
||||
@ -2133,6 +2144,24 @@ static void read_keybinds_axis(config_file_t *conf, unsigned user,
|
||||
input_config_bind_map_get_base(idx), bind);
|
||||
}
|
||||
|
||||
static void read_keybinds_mbutton(config_file_t *conf, unsigned user,
|
||||
unsigned idx, struct retro_keybind *bind)
|
||||
{
|
||||
const char *prefix = NULL;
|
||||
|
||||
if (!input_config_bind_map_get_valid(idx))
|
||||
return;
|
||||
if (!input_config_bind_map_get_base(idx))
|
||||
return;
|
||||
|
||||
prefix = input_config_get_prefix(user,
|
||||
input_config_bind_map_get_meta(idx));
|
||||
|
||||
if (prefix)
|
||||
input_config_parse_mouse_button(conf, prefix,
|
||||
input_config_bind_map_get_base(idx), bind);
|
||||
}
|
||||
|
||||
static void read_keybinds_user(config_file_t *conf, unsigned user)
|
||||
{
|
||||
unsigned i;
|
||||
@ -2147,6 +2176,7 @@ static void read_keybinds_user(config_file_t *conf, unsigned user)
|
||||
read_keybinds_keyboard(conf, user, i, bind);
|
||||
read_keybinds_button(conf, user, i, bind);
|
||||
read_keybinds_axis(conf, user, i, bind);
|
||||
read_keybinds_mbutton(conf, user, i, bind);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2255,6 +2285,8 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
#ifdef HAVE_NETWORKING
|
||||
char *override_netplay_ip_address = NULL;
|
||||
#endif
|
||||
const char *path_core = NULL;
|
||||
const char *path_config = NULL;
|
||||
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
||||
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
||||
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
|
||||
@ -2527,13 +2559,16 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
|
||||
audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume);
|
||||
|
||||
path_config = path_get(RARCH_PATH_CONFIG);
|
||||
path_core = path_get(RARCH_PATH_CORE);
|
||||
|
||||
if (string_is_empty(settings->paths.path_content_history))
|
||||
{
|
||||
if (string_is_empty(settings->paths.directory_content_history))
|
||||
{
|
||||
fill_pathname_resolve_relative(
|
||||
settings->paths.path_content_history,
|
||||
path_get(RARCH_PATH_CONFIG),
|
||||
path_config,
|
||||
file_path_str(FILE_PATH_CONTENT_HISTORY),
|
||||
sizeof(settings->paths.path_content_history));
|
||||
}
|
||||
@ -2552,7 +2587,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
{
|
||||
fill_pathname_resolve_relative(
|
||||
settings->paths.path_content_favorites,
|
||||
path_get(RARCH_PATH_CONFIG),
|
||||
path_config,
|
||||
file_path_str(FILE_PATH_CONTENT_FAVORITES),
|
||||
sizeof(settings->paths.path_content_favorites));
|
||||
}
|
||||
@ -2571,7 +2606,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
{
|
||||
fill_pathname_resolve_relative(
|
||||
settings->paths.path_content_music_history,
|
||||
path_get(RARCH_PATH_CONFIG),
|
||||
path_config,
|
||||
file_path_str(FILE_PATH_CONTENT_MUSIC_HISTORY),
|
||||
sizeof(settings->paths.path_content_music_history));
|
||||
}
|
||||
@ -2590,7 +2625,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
{
|
||||
fill_pathname_resolve_relative(
|
||||
settings->paths.path_content_video_history,
|
||||
path_get(RARCH_PATH_CONFIG),
|
||||
path_config,
|
||||
file_path_str(FILE_PATH_CONTENT_VIDEO_HISTORY),
|
||||
sizeof(settings->paths.path_content_video_history));
|
||||
}
|
||||
@ -2609,7 +2644,7 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
{
|
||||
fill_pathname_resolve_relative(
|
||||
settings->paths.path_content_image_history,
|
||||
path_get(RARCH_PATH_CONFIG),
|
||||
path_config,
|
||||
file_path_str(FILE_PATH_CONTENT_IMAGE_HISTORY),
|
||||
sizeof(settings->paths.path_content_image_history));
|
||||
}
|
||||
@ -2635,14 +2670,14 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
}
|
||||
|
||||
#ifdef RARCH_CONSOLE
|
||||
if (!string_is_empty(path_get(RARCH_PATH_CORE)))
|
||||
if (!string_is_empty(path_core))
|
||||
{
|
||||
#endif
|
||||
/* Safe-guard against older behavior. */
|
||||
if (path_is_directory(path_get(RARCH_PATH_CORE)))
|
||||
if (path_is_directory(path_core))
|
||||
{
|
||||
RARCH_WARN("\"libretro_path\" is a directory, using this for \"libretro_directory\" instead.\n");
|
||||
strlcpy(settings->paths.directory_libretro, path_get(RARCH_PATH_CORE),
|
||||
strlcpy(settings->paths.directory_libretro, path_core,
|
||||
sizeof(settings->paths.directory_libretro));
|
||||
path_clear(RARCH_PATH_CORE);
|
||||
}
|
||||
@ -2683,16 +2718,13 @@ static bool config_load_file(const char *path, bool set_defaults,
|
||||
*settings->paths.directory_system = '\0';
|
||||
|
||||
if (settings->floats.slowmotion_ratio < 1.0f)
|
||||
{
|
||||
configuration_set_float(settings, settings->floats.slowmotion_ratio, 1.0f);
|
||||
}
|
||||
|
||||
/* Sanitize fastforward_ratio value - previously range was -1
|
||||
* and up (with 0 being skipped) */
|
||||
if (settings->floats.fastforward_ratio < 0.0f)
|
||||
{
|
||||
configuration_set_float(settings, settings->floats.fastforward_ratio, 0.0f);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
settings->bools.ssh_enable = path_file_exists(LAKKA_SSH_PATH);
|
||||
@ -2922,7 +2954,7 @@ bool config_load_override(void)
|
||||
/* Restore the libretro_path we're using
|
||||
* since it will be overwritten by the override when reloading. */
|
||||
path_set(RARCH_PATH_CORE, buf);
|
||||
runloop_msg_queue_push("Configuration override loaded.", 1, 100, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_OVERRIDE_LOADED), 1, 100, true);
|
||||
|
||||
/* Reset save paths. */
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||
@ -3039,7 +3071,7 @@ bool config_load_remap(void)
|
||||
RARCH_LOG("Remaps: game-specific remap found at %s.\n", game_path);
|
||||
if (input_remapping_load_file(new_conf, game_path))
|
||||
{
|
||||
runloop_msg_queue_push("Game remap file loaded.", 1, 100, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_REMAP_FILE_LOADED), 1, 100, true);
|
||||
rarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL);
|
||||
goto success;
|
||||
}
|
||||
@ -3059,7 +3091,7 @@ bool config_load_remap(void)
|
||||
RARCH_LOG("Remaps: core-specific remap found at %s.\n", core_path);
|
||||
if (input_remapping_load_file(new_conf, core_path))
|
||||
{
|
||||
runloop_msg_queue_push("Core remap file loaded.", 1, 100, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CORE_REMAP_FILE_LOADED), 1, 100, true);
|
||||
rarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL);
|
||||
goto success;
|
||||
}
|
||||
@ -3336,6 +3368,38 @@ static void save_keybind_axis(config_file_t *conf, const char *prefix,
|
||||
}
|
||||
}
|
||||
|
||||
static void save_keybind_mbutton(config_file_t *conf, const char *prefix,
|
||||
const char *base, const struct retro_keybind *bind, bool save_empty)
|
||||
{
|
||||
char key[64];
|
||||
|
||||
key[0] = '\0';
|
||||
|
||||
fill_pathname_join_delim_concat(key, prefix,
|
||||
base, '_', "_mbtn", sizeof(key));
|
||||
|
||||
switch ( bind->mbutton )
|
||||
{
|
||||
|
||||
case RETRO_DEVICE_ID_MOUSE_LEFT: config_set_uint64(conf, key, 1); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_RIGHT: config_set_uint64(conf, key, 2); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_MIDDLE: config_set_uint64(conf, key, 3); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_BUTTON_4: config_set_uint64(conf, key, 4); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_BUTTON_5: config_set_uint64(conf, key, 5); break;
|
||||
|
||||
case RETRO_DEVICE_ID_MOUSE_WHEELUP: config_set_string(conf, key, "wu"); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_WHEELDOWN: config_set_string(conf, key, "wd"); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP: config_set_string(conf, key, "whu"); break;
|
||||
case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN: config_set_string(conf, key, "whd"); break;
|
||||
|
||||
default:
|
||||
if ( save_empty ) {
|
||||
config_set_string(conf, key, file_path_str(FILE_PATH_NUL));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* save_keybind:
|
||||
* @conf : pointer to config file object
|
||||
@ -3356,6 +3420,7 @@ static void save_keybind(config_file_t *conf, const char *prefix,
|
||||
save_keybind_key(conf, prefix, base, bind);
|
||||
save_keybind_joykey(conf, prefix, base, bind, save_empty);
|
||||
save_keybind_axis(conf, prefix, base, bind, save_empty);
|
||||
save_keybind_mbutton(conf, prefix, base, bind, save_empty);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3443,6 +3508,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
unsigned i;
|
||||
char *buf = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *autoconf_file = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *path_new = NULL;
|
||||
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
||||
int32_t pid_user = 0;
|
||||
int32_t vid_user = 0;
|
||||
@ -3454,6 +3520,26 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
|
||||
buf[0] = autoconf_file[0] = '\0';
|
||||
|
||||
if (string_is_empty(path))
|
||||
goto error;
|
||||
|
||||
path_new = strdup(path);
|
||||
|
||||
for (i = 0; invalid_filename_chars[i]; i++)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
char *tmp = strstr(path_new, invalid_filename_chars[i]);
|
||||
|
||||
if (tmp)
|
||||
*tmp = '_';
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
path = path_new;
|
||||
|
||||
fill_pathname_join(buf, autoconf_dir, joypad_ident, path_size);
|
||||
|
||||
if(path_is_directory(buf))
|
||||
@ -3479,7 +3565,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
path_size);
|
||||
}
|
||||
|
||||
conf = config_file_new(autoconf_file);
|
||||
conf = config_file_new(autoconf_file);
|
||||
|
||||
if (!conf)
|
||||
{
|
||||
@ -3515,11 +3601,14 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
|
||||
config_file_free(conf);
|
||||
free(buf);
|
||||
free(autoconf_file);
|
||||
free(path_new);
|
||||
return ret;
|
||||
|
||||
error:
|
||||
free(buf);
|
||||
free(autoconf_file);
|
||||
if (path_new)
|
||||
free(path_new);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -29,21 +29,28 @@
|
||||
#include "input/input_defines.h"
|
||||
|
||||
#define configuration_set_float(settings, var, newvar) \
|
||||
{ \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
var = newvar; \
|
||||
}
|
||||
|
||||
#define configuration_set_bool(settings, var, newvar) \
|
||||
{ \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
var = newvar; \
|
||||
}
|
||||
|
||||
#define configuration_set_uint(settings, var, newvar) \
|
||||
{ \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
var = newvar; \
|
||||
}
|
||||
|
||||
#define configuration_set_int(settings, var, newvar) \
|
||||
{ \
|
||||
settings->modified = true; \
|
||||
var = newvar
|
||||
|
||||
var = newvar; \
|
||||
}
|
||||
|
||||
enum override_type
|
||||
{
|
||||
@ -183,6 +190,8 @@ typedef struct settings
|
||||
bool cheevos_enable;
|
||||
bool cheevos_test_unofficial;
|
||||
bool cheevos_hardcore_mode_enable;
|
||||
bool cheevos_leaderboards_enable;
|
||||
bool cheevos_badges_enable;
|
||||
bool cheevos_verbose_enable;
|
||||
|
||||
/* Camera */
|
||||
@ -241,6 +250,8 @@ typedef struct settings
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
|
||||
bool automatically_add_content_to_playlist;
|
||||
} bools;
|
||||
|
||||
struct
|
||||
|
44
core_info.c
44
core_info.c
@ -389,6 +389,10 @@ static core_info_list_t *core_info_list_new(const char *path)
|
||||
&tmp_bool))
|
||||
core_info[i].supports_no_game = tmp_bool;
|
||||
|
||||
if (config_get_bool(conf, "database_match_archive_member",
|
||||
&tmp_bool))
|
||||
core_info[i].database_match_archive_member = tmp_bool;
|
||||
|
||||
core_info[i].config_data = conf;
|
||||
}
|
||||
else
|
||||
@ -823,6 +827,46 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
return num;
|
||||
}
|
||||
|
||||
bool core_info_database_match_archive_member(const char *database_path)
|
||||
{
|
||||
char *database = NULL;
|
||||
const char *new_path = path_basename(database_path);
|
||||
|
||||
if (string_is_empty(new_path))
|
||||
return false;
|
||||
|
||||
database = strdup(new_path);
|
||||
|
||||
if (string_is_empty(database))
|
||||
goto error;
|
||||
|
||||
path_remove_extension(database);
|
||||
|
||||
if (core_info_curr_list)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < core_info_curr_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_curr_list->list[i];
|
||||
|
||||
if (!info->database_match_archive_member)
|
||||
continue;
|
||||
|
||||
if (!string_list_find_elem(info->databases_list, database))
|
||||
continue;
|
||||
|
||||
free(database);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
error:
|
||||
if (database)
|
||||
free(database);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core_info_database_supports_content_path(const char *database_path, const char *path)
|
||||
{
|
||||
char *database = NULL;
|
||||
|
@ -38,6 +38,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
bool supports_no_game;
|
||||
bool database_match_archive_member;
|
||||
size_t firmware_count;
|
||||
char *path;
|
||||
void *config_data;
|
||||
@ -120,6 +121,8 @@ bool core_info_load(core_info_ctx_find_t *info);
|
||||
|
||||
bool core_info_database_supports_content_path(const char *database_path, const char *path);
|
||||
|
||||
bool core_info_database_match_archive_member(const char *database_path);
|
||||
|
||||
bool core_info_unsupported_content_path(const char *path);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
4
deps/miniupnpc/minissdpc.c
vendored
4
deps/miniupnpc/minissdpc.c
vendored
@ -67,13 +67,13 @@ struct sockaddr_un {
|
||||
#define PRINT_SOCKET_ERROR(x) perror(x)
|
||||
#endif
|
||||
|
||||
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__)
|
||||
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__) && !defined(__HAIKU__)
|
||||
#define HAS_IP_MREQN
|
||||
#endif
|
||||
|
||||
#if !defined(HAS_IP_MREQN) && !defined(_WIN32)
|
||||
#include <sys/ioctl.h>
|
||||
#if defined(__sun)
|
||||
#if defined(__sun) || defined(__HAIKU__)
|
||||
#include <sys/sockio.h>
|
||||
#endif
|
||||
#endif
|
||||
|
10
deps/miniupnpc/portlistingparse.c
vendored
10
deps/miniupnpc/portlistingparse.c
vendored
@ -31,7 +31,7 @@ static const struct {
|
||||
|
||||
/* Helper function */
|
||||
static UNSIGNED_INTEGER
|
||||
atoui(const char * p, int l)
|
||||
my_atoui(const char * p, int l)
|
||||
{
|
||||
UNSIGNED_INTEGER r = 0;
|
||||
while(l > 0 && *p)
|
||||
@ -106,7 +106,7 @@ static void portlisting_data(void * d, const char * data, int l)
|
||||
pm->remoteHost[l] = '\0';
|
||||
break;
|
||||
case NewExternalPort:
|
||||
pm->externalPort = (unsigned short)atoui(data, l);
|
||||
pm->externalPort = (unsigned short)my_atoui(data, l);
|
||||
break;
|
||||
case NewProtocol:
|
||||
if(l > 3)
|
||||
@ -115,21 +115,21 @@ static void portlisting_data(void * d, const char * data, int l)
|
||||
pm->protocol[l] = '\0';
|
||||
break;
|
||||
case NewInternalPort:
|
||||
pm->internalPort = (unsigned short)atoui(data, l);
|
||||
pm->internalPort = (unsigned short)my_atoui(data, l);
|
||||
break;
|
||||
case NewInternalClient:
|
||||
memcpy(pm->internalClient, data, l);
|
||||
pm->internalClient[l] = '\0';
|
||||
break;
|
||||
case NewEnabled:
|
||||
pm->enabled = (unsigned char)atoui(data, l);
|
||||
pm->enabled = (unsigned char)my_atoui(data, l);
|
||||
break;
|
||||
case NewDescription:
|
||||
memcpy(pm->description, data, l);
|
||||
pm->description[l] = '\0';
|
||||
break;
|
||||
case NewLeaseTime:
|
||||
pm->leaseTime = atoui(data, l);
|
||||
pm->leaseTime = my_atoui(data, l);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
20
deps/miniupnpc/upnpcommands.c
vendored
20
deps/miniupnpc/upnpcommands.c
vendored
@ -14,7 +14,7 @@
|
||||
#include "portlistingparse.h"
|
||||
|
||||
static UNSIGNED_INTEGER
|
||||
my_atoui(const char * s)
|
||||
my_custom_atoui(const char * s)
|
||||
{
|
||||
return s ? ((UNSIGNED_INTEGER)STRTOUI(s, NULL, 0)) : 0;
|
||||
}
|
||||
@ -38,7 +38,7 @@ UPNP_GetTotalBytesSent(const char * controlURL,
|
||||
/*DisplayNameValueList(buffer, bufsize);*/
|
||||
free(buffer); buffer = NULL;
|
||||
p = GetValueFromNameValueList(&pdata, "NewTotalBytesSent");
|
||||
r = (unsigned)my_atoui(p);
|
||||
r = (unsigned)my_custom_atoui(p);
|
||||
ClearNameValueList(&pdata);
|
||||
return r;
|
||||
}
|
||||
@ -62,7 +62,7 @@ UPNP_GetTotalBytesReceived(const char * controlURL,
|
||||
/*DisplayNameValueList(buffer, bufsize);*/
|
||||
free(buffer); buffer = NULL;
|
||||
p = GetValueFromNameValueList(&pdata, "NewTotalBytesReceived");
|
||||
r = (unsigned)my_atoui(p);
|
||||
r = (unsigned)my_custom_atoui(p);
|
||||
ClearNameValueList(&pdata);
|
||||
return r;
|
||||
}
|
||||
@ -86,7 +86,7 @@ UPNP_GetTotalPacketsSent(const char * controlURL,
|
||||
/*DisplayNameValueList(buffer, bufsize);*/
|
||||
free(buffer); buffer = NULL;
|
||||
p = GetValueFromNameValueList(&pdata, "NewTotalPacketsSent");
|
||||
r = (unsigned)my_atoui(p);
|
||||
r = (unsigned)my_custom_atoui(p);
|
||||
ClearNameValueList(&pdata);
|
||||
return r;
|
||||
}
|
||||
@ -110,7 +110,7 @@ UPNP_GetTotalPacketsReceived(const char * controlURL,
|
||||
/*DisplayNameValueList(buffer, bufsize);*/
|
||||
free(buffer); buffer = NULL;
|
||||
p = GetValueFromNameValueList(&pdata, "NewTotalPacketsReceived");
|
||||
r = (unsigned)my_atoui(p);
|
||||
r = (unsigned)my_custom_atoui(p);
|
||||
ClearNameValueList(&pdata);
|
||||
return r;
|
||||
}
|
||||
@ -903,11 +903,11 @@ UPNP_GetFirewallStatus(const char * controlURL,
|
||||
if(ipa && fe)
|
||||
ret = UPNPCOMMAND_SUCCESS;
|
||||
if(fe)
|
||||
*firewallEnabled = (int)my_atoui(fe);
|
||||
*firewallEnabled = (int)my_custom_atoui(fe);
|
||||
/*else
|
||||
*firewallEnabled = 0;*/
|
||||
if(ipa)
|
||||
*inboundPinholeAllowed = (int)my_atoui(ipa);
|
||||
*inboundPinholeAllowed = (int)my_custom_atoui(ipa);
|
||||
/*else
|
||||
*inboundPinholeAllowed = 0;*/
|
||||
p = GetValueFromNameValueList(&pdata, "errorCode");
|
||||
@ -971,7 +971,7 @@ UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype
|
||||
ret = UPNPCOMMAND_SUCCESS;
|
||||
p = GetValueFromNameValueList(&pdata, "OutboundPinholeTimeout");
|
||||
if(p)
|
||||
*opTimeout = (int)my_atoui(p);
|
||||
*opTimeout = (int)my_custom_atoui(p);
|
||||
}
|
||||
ClearNameValueList(&pdata);
|
||||
return ret;
|
||||
@ -1175,7 +1175,7 @@ UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
|
||||
p = GetValueFromNameValueList(&pdata, "IsWorking");
|
||||
if(p)
|
||||
{
|
||||
*isWorking = (int)my_atoui(p);
|
||||
*isWorking = (int)my_custom_atoui(p);
|
||||
ret = UPNPCOMMAND_SUCCESS;
|
||||
}
|
||||
else
|
||||
@ -1222,7 +1222,7 @@ UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
|
||||
p = GetValueFromNameValueList(&pdata, "PinholePackets");
|
||||
if(p)
|
||||
{
|
||||
*packets = (int)my_atoui(p);
|
||||
*packets = (int)my_custom_atoui(p);
|
||||
ret = UPNPCOMMAND_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -134,32 +134,7 @@ if [ $SALAMANDER = "yes" ]; then
|
||||
vita-mksfoex -s TITLE_ID=RETROVITA "RetroArch" ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/param.sfo
|
||||
cp ../pkg/${platform}/assets/ICON0.PNG ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/icon0.png
|
||||
cp -R ../pkg/${platform}/assets/livearea ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/assets
|
||||
if [ -d ../media/assets/glui ]; then
|
||||
cp -r ../media/assets/glui ../pkg/${platform}/retroarch.vpk/vpk/assets
|
||||
fi
|
||||
if [ -d ../media/assets/xmb ]; then
|
||||
cp -r ../media/assets/xmb ../pkg/${platform}/retroarch.vpk/vpk/assets
|
||||
# Strip source SVG files
|
||||
rm -rf ../pkg/${platform}/retroarch.vpk/vpk/assets/xmb/flatui/src
|
||||
rm -rf ../pkg/${platform}/retroarch.vpk/vpk/assets/xmb/monochrome/src
|
||||
rm -rf ../pkg/${platform}/retroarch.vpk/vpk/assets/xmb/retroactive/src
|
||||
rm -rf ../pkg/${platform}/retroarch.vpk/vpk/assets/xmb/retroactive_marked/src
|
||||
rm -rf ../pkg/${platform}/retroarch.vpk/vpk/assets/xmb/dot-art/src
|
||||
fi
|
||||
if [ -d ../media/libretrodb/rdb ]; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/database/rdb
|
||||
cp -r ../media/libretrodb/rdb/* ../pkg/${platform}/retroarch.vpk/vpk/database/rdb
|
||||
fi
|
||||
if [ -d ../media/libretrodb/cursors ]; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/database/cursors
|
||||
cp -r ../media/libretrodb/cursors/* ../pkg/${platform}/retroarch.vpk/vpk/database/cursors
|
||||
fi
|
||||
if [ -d ../../dist/info ]; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/info
|
||||
cp -fv ../../dist/info/*.info ../pkg/${platform}/retroarch.vpk/vpk/info/
|
||||
fi
|
||||
make -C ../ -f Makefile.${platform}.salamander clean || exit 1
|
||||
make -C ../ -f Makefile.${platform}.salamander clean || exit 1
|
||||
fi
|
||||
if [ $PLATFORM = "ctr" ] ; then
|
||||
mv -f ../retroarch_3ds_salamander.cia ../pkg/3ds/cia/retroarch_3ds.cia
|
||||
@ -259,44 +234,10 @@ for f in `ls -v *_${platform}.${EXT}`; do
|
||||
elif [ $PLATFORM = "vita" ] ; then
|
||||
COUNTER=$((COUNTER + 1))
|
||||
COUNTER_ID=`printf "%05d" ${COUNTER}`
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/livearea
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/livearea/contents
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/assets/
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/database/rdb
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/database/cursors
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/info
|
||||
cp ../retroarch_${platform}.self ../pkg/${platform}/${name}_libretro.vpk/vpk/eboot.bin
|
||||
cp ../pkg/${platform}/${name}_libretro.vpk/vpk/eboot.bin ../pkg/${platform}/retroarch.vpk/vpk/${name}_libretro.self
|
||||
vita-mksfoex -s TITLE_ID=RETR${COUNTER_ID} "RetroArch ${name}" ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/param.sfo
|
||||
cp ../pkg/${platform}/assets/ICON0.PNG ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/icon0.png
|
||||
cp ../pkg/${platform}/assets/livearea/contents/bg.png ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/livearea/contents/bg.png
|
||||
cp ../pkg/${platform}/assets/livearea/contents/startup.png ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/livearea/contents/startup.png
|
||||
cp ../pkg/${platform}/assets/livearea/contents/website.png ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/livearea/contents/website.png
|
||||
cp ../pkg/${platform}/assets/livearea/contents/template.xml ../pkg/${platform}/${name}_libretro.vpk/vpk/sce_sys/livearea/contents/template.xml
|
||||
mkdir -p ../pkg/${platform}/${name}_libretro.vpk/vpk/assets
|
||||
if [ -d ../media/assets/glui ]; then
|
||||
cp -r ../media/assets/glui ../pkg/${platform}/${name}_libretro.vpk/vpk/assets
|
||||
fi
|
||||
if [ -d ../media/assets/xmb ]; then
|
||||
cp -r ../media/assets/xmb ../pkg/${platform}/${name}_libretro.vpk/vpk/assets
|
||||
# Strip source SVG files
|
||||
rm -rf ../pkg/${platform}/${name}_libretro.vpk/vpk/assets/xmb/flatui/src
|
||||
rm -rf ../pkg/${platform}/${name}_libretro.vpk/vpk/assets/xmb/monochrome/src
|
||||
rm -rf ../pkg/${platform}/${name}_libretro.vpk/vpk/assets/xmb/retroactive/src
|
||||
rm -rf ../pkg/${platform}/${name}_libretro.vpk/vpk/assets/xmb/retroactive_marked/src
|
||||
fi
|
||||
if [ -d ../media/libretrodb/rdb ]; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/database/rdb
|
||||
cp -r ../media/libretrodb/rdb/* ../pkg/${platform}/${name}_libretro.vpk/vpk/database/rdb
|
||||
fi
|
||||
if [ -d ../media/libretrodb/cursors ]; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/database/cursors
|
||||
cp -r ../media/libretrodb/cursors/* ../pkg/${platform}/${name}_libretro.vpk/vpk/database/cursors
|
||||
fi
|
||||
cp ../retroarch_${platform}.self ../pkg/${platform}/retroarch.vpk/vpk/${name}_libretro.self
|
||||
if [ -d ../../dist/info ]; then
|
||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/info
|
||||
cp -fv ../../dist/info/"${name}_libretro.info" ../pkg/${platform}/${name}_libretro.vpk/vpk/info/"${name}_libretro.info"
|
||||
cp -fv ../../dist/info/"${name}_libretro.info" ../pkg/${platform}/retroarch.vpk/vpk/info/"${name}_libretro.info"
|
||||
fi
|
||||
elif [ $PLATFORM = "ctr" ] ; then
|
||||
mv -f ../retroarch_3ds.cia ../pkg/3ds/cia/${name}_libretro.cia
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
@ -28,6 +28,10 @@
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <kernel/image.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
#include <string.h>
|
||||
@ -119,7 +123,7 @@ void fill_pathname_abbreviate_special(char *out_path,
|
||||
* Keep application dir in front of home, moving app dir to a
|
||||
* new location inside home would break otherwise. */
|
||||
|
||||
/* ugly hack - use application_dir pointer
|
||||
/* ugly hack - use application_dir pointer
|
||||
* before filling it in. C89 reasons */
|
||||
candidates[0] = application_dir;
|
||||
candidates[1] = home;
|
||||
@ -129,23 +133,23 @@ void fill_pathname_abbreviate_special(char *out_path,
|
||||
notations [1] = "~";
|
||||
notations [2] = NULL;
|
||||
|
||||
fill_pathname_application_path(application_dir,
|
||||
fill_pathname_application_path(application_dir,
|
||||
PATH_MAX_LENGTH * sizeof(char));
|
||||
path_basedir_wrapper(application_dir);
|
||||
|
||||
|
||||
for (i = 0; candidates[i]; i++)
|
||||
{
|
||||
if (!string_is_empty(candidates[i]) &&
|
||||
if (!string_is_empty(candidates[i]) &&
|
||||
strstr(in_path, candidates[i]) == in_path)
|
||||
{
|
||||
size_t src_size = strlcpy(out_path, notations[i], size);
|
||||
|
||||
retro_assert(src_size < size);
|
||||
|
||||
|
||||
out_path += src_size;
|
||||
size -= src_size;
|
||||
in_path += strlen(candidates[i]);
|
||||
|
||||
|
||||
if (!path_char_is_slash(*in_path))
|
||||
{
|
||||
retro_assert(strlcpy(out_path,
|
||||
@ -242,7 +246,7 @@ void fill_pathname_application_path(char *s, size_t len)
|
||||
CFStringGetCString(bundle_path, s, len, kCFStringEncodingUTF8);
|
||||
CFRelease(bundle_path);
|
||||
CFRelease(bundle_url);
|
||||
|
||||
|
||||
retro_assert(strlcat(s, "nobin", len) < len);
|
||||
return;
|
||||
}
|
||||
@ -269,7 +273,7 @@ void fill_pathname_application_path(char *s, size_t len)
|
||||
char link_path[255];
|
||||
|
||||
link_path[0] = *s = '\0';
|
||||
pid = getpid();
|
||||
pid = getpid();
|
||||
|
||||
/* Linux, BSD and Solaris paths. Not standardized. */
|
||||
for (i = 0; i < ARRAY_SIZE(exts); i++)
|
||||
@ -287,7 +291,7 @@ void fill_pathname_application_path(char *s, size_t len)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RARCH_ERR("Cannot resolve application path! This should not happen.\n");
|
||||
#endif
|
||||
}
|
||||
@ -335,7 +339,7 @@ void fill_pathname_application_special(char *s,
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
s1[0] = '\0';
|
||||
|
||||
fill_pathname_application_special(s1,
|
||||
fill_pathname_application_special(s1,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH);
|
||||
fill_pathname_join(s,
|
||||
@ -349,7 +353,7 @@ void fill_pathname_application_special(char *s,
|
||||
#ifdef HAVE_ZARCH
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
fill_pathname_join(s,
|
||||
fill_pathname_join(s,
|
||||
settings->paths.directory_assets,
|
||||
"zarch",
|
||||
len);
|
||||
@ -501,6 +505,31 @@ void fill_pathname_application_special(char *s,
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES:
|
||||
{
|
||||
char *s1 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *s2 = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
s1[0] = s2[0] = '\0';
|
||||
|
||||
fill_pathname_join(s1,
|
||||
settings->paths.directory_thumbnails,
|
||||
"cheevos",
|
||||
len);
|
||||
fill_pathname_join(s2,
|
||||
s1, "badges",
|
||||
PATH_MAX_LENGTH * sizeof(char)
|
||||
);
|
||||
fill_pathname_slash(s2,
|
||||
PATH_MAX_LENGTH * sizeof(char)
|
||||
);
|
||||
strlcpy(s, s2, len);
|
||||
free(s1);
|
||||
free(s2);
|
||||
}
|
||||
break;
|
||||
|
||||
case APPLICATION_SPECIAL_NONE:
|
||||
default:
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
@ -104,7 +104,8 @@ enum application_special_type
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH,
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT,
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS,
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -48,6 +48,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <compat/apple_compat.h>
|
||||
#include <retro_assert.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <file/file_path.h>
|
||||
#include <rhash.h>
|
||||
@ -335,6 +336,15 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
|
||||
CFSearchPathForDirectoriesInDomains(CFDocumentDirectory,
|
||||
CFUserDomainMask, 1, home_dir_buf, sizeof(home_dir_buf));
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
char resolved_home_dir_buf[PATH_MAX_LENGTH] = {0};
|
||||
if (realpath(home_dir_buf, resolved_home_dir_buf)) {
|
||||
retro_assert(strlcpy(home_dir_buf,
|
||||
resolved_home_dir_buf,
|
||||
sizeof(home_dir_buf)) < sizeof(home_dir_buf));
|
||||
}
|
||||
#endif
|
||||
|
||||
strlcat(home_dir_buf, "/RetroArch", sizeof(home_dir_buf));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER],
|
||||
home_dir_buf, "shaders_glsl",
|
||||
|
@ -115,15 +115,15 @@ static void frontend_psp_get_environment_settings(int *argc, char *argv[],
|
||||
/* bundle data*/
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
|
||||
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]));
|
||||
/* user data*/
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], user_path,
|
||||
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE], user_path,
|
||||
"database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CURSOR], user_path,
|
||||
"database/cursors", sizeof(g_defaults.dirs[DEFAULT_DIR_CURSOR]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS], user_path,
|
||||
"cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG], user_path,
|
||||
|
@ -58,7 +58,9 @@
|
||||
#include <wiiu/vpad.h>
|
||||
#include <wiiu/kpad.h>
|
||||
|
||||
#include "wiiu/controller_patcher/ControllerPatcherWrapper.h"
|
||||
#if defined(ENABLE_CONTROLLER_PATCHER)
|
||||
#include "wiiu/controller_patcher/ControllerPatcherWrapper.h"
|
||||
#endif
|
||||
|
||||
#include <fat.h>
|
||||
#include <iosuhax.h>
|
||||
@ -430,7 +432,7 @@ int main(int argc, char **argv)
|
||||
KPADInit();
|
||||
#endif
|
||||
verbosity_enable();
|
||||
#ifndef IS_SALAMANDER
|
||||
#if !defined(IS_SALAMANDER) && defined(ENABLE_CONTROLLER_PATCHER)
|
||||
ControllerPatcherInit();
|
||||
#endif
|
||||
fflush(stdout);
|
||||
@ -492,7 +494,7 @@ int main(int argc, char **argv)
|
||||
|
||||
}
|
||||
while (1);
|
||||
#ifndef IS_SALAMANDER
|
||||
#if !defined(IS_SALAMANDER) && defined(ENABLE_CONTROLLER_PATCHER)
|
||||
ControllerPatcherDeInit();
|
||||
#endif
|
||||
main_exit(NULL);
|
||||
@ -523,22 +525,25 @@ void __eabi()
|
||||
__attribute__((weak))
|
||||
void __init(void)
|
||||
{
|
||||
extern void(*__CTOR_LIST__[])(void);
|
||||
void(**ctor)(void) = __CTOR_LIST__;
|
||||
extern void (*const __CTOR_LIST__)(void);
|
||||
extern void (*const __CTOR_END__)(void);
|
||||
|
||||
while (*ctor)
|
||||
void (*const *ctor)(void) = &__CTOR_LIST__;
|
||||
while (ctor < &__CTOR_END__) {
|
||||
(*ctor++)();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__attribute__((weak))
|
||||
void __fini(void)
|
||||
{
|
||||
extern void(*__DTOR_LIST__[])(void);
|
||||
void(**ctor)(void) = __DTOR_LIST__;
|
||||
extern void (*const __DTOR_LIST__)(void);
|
||||
extern void (*const __DTOR_END__)(void);
|
||||
|
||||
while (*ctor)
|
||||
(*ctor++)();
|
||||
void (*const *dtor)(void) = &__DTOR_LIST__;
|
||||
while (dtor < &__DTOR_END__) {
|
||||
(*dtor++)();
|
||||
}
|
||||
}
|
||||
|
||||
/* libiosuhax related */
|
||||
@ -633,7 +638,7 @@ int __entry_menu(int argc, char **argv)
|
||||
int ret = main(argc, argv);
|
||||
|
||||
fsdev_exit();
|
||||
// __fini();
|
||||
__fini();
|
||||
memoryRelease();
|
||||
return ret;
|
||||
}
|
||||
@ -648,7 +653,10 @@ void _start(int argc, char **argv)
|
||||
main(argc, argv);
|
||||
|
||||
fsdev_exit();
|
||||
// __fini();
|
||||
|
||||
/* TODO: fix elf2rpl so it doesn't error with "Could not find matching symbol
|
||||
for relocation" then uncomment this */
|
||||
// __fini();
|
||||
memoryRelease();
|
||||
SYSRelaunchTitle(0, 0);
|
||||
exit(0);
|
||||
|
@ -340,7 +340,7 @@ static uint64_t frontend_win32_get_mem_total(void)
|
||||
{
|
||||
/* OSes below 2000 don't have the Ex version,
|
||||
* and non-Ex cannot work with >4GB RAM */
|
||||
#if _WIN32_WINNT > 0x0400
|
||||
#if _WIN32_WINNT >= 0x0500
|
||||
MEMORYSTATUSEX mem_info;
|
||||
mem_info.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&mem_info);
|
||||
@ -357,7 +357,7 @@ static uint64_t frontend_win32_get_mem_used(void)
|
||||
{
|
||||
/* OSes below 2000 don't have the Ex version,
|
||||
* and non-Ex cannot work with >4GB RAM */
|
||||
#if _WIN32_WINNT > 0x0400
|
||||
#if _WIN32_WINNT >= 0x0500
|
||||
MEMORYSTATUSEX mem_info;
|
||||
mem_info.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&mem_info);
|
||||
|
@ -55,6 +55,7 @@ typedef struct gl
|
||||
bool fbo_feedback_enable;
|
||||
bool hw_render_fbo_init;
|
||||
bool hw_render_depth_init;
|
||||
bool has_fbo;
|
||||
bool has_srgb_fbo_gles3;
|
||||
bool has_fp_fbo;
|
||||
bool has_srgb_fbo;
|
||||
@ -140,47 +141,22 @@ typedef struct gl
|
||||
void *renderchain_data;
|
||||
} gl_t;
|
||||
|
||||
#ifdef NO_GL_FF_VERTEX
|
||||
#define gl_ff_vertex(coords) ((void)0)
|
||||
#else
|
||||
static INLINE void gl_ff_vertex(const struct video_coords *coords)
|
||||
static INLINE void gl_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter,
|
||||
GLint min_filter)
|
||||
{
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glBindTexture(GL_TEXTURE_2D, id);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NO_GL_FF_MATRIX
|
||||
#define gl_ff_matrix(mat) ((void)0)
|
||||
#else
|
||||
static INLINE void gl_ff_matrix(const math_matrix_4x4 *mat)
|
||||
{
|
||||
math_matrix_4x4 ident;
|
||||
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadMatrixf(mat->data);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
matrix_4x4_identity(ident);
|
||||
glLoadMatrixf(ident.data);
|
||||
}
|
||||
#endif
|
||||
|
||||
static INLINE unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
#ifndef HAVE_OPENGLES
|
||||
case RARCH_WRAP_BORDER:
|
||||
case RARCH_WRAP_BORDER: /* GL_CLAMP_TO_BORDER: Available since GL 1.3 */
|
||||
return GL_CLAMP_TO_BORDER;
|
||||
#else
|
||||
case RARCH_WRAP_BORDER:
|
||||
|
@ -21,6 +21,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -155,9 +158,35 @@ static void x11_set_window_class(Display *dpy, Window win)
|
||||
XSetClassHint(dpy, win, &hint);
|
||||
}
|
||||
|
||||
static void x11_set_window_pid(Display *dpy, Window win)
|
||||
{
|
||||
long scret;
|
||||
char *hostname;
|
||||
pid_t pid = getpid();
|
||||
|
||||
XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_PID", False),
|
||||
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1);
|
||||
|
||||
errno = 0;
|
||||
if((scret = sysconf(_SC_HOST_NAME_MAX)) == -1 && errno)
|
||||
return;
|
||||
if((hostname = malloc(scret + 1)) == NULL)
|
||||
return;
|
||||
|
||||
if(gethostname(hostname, scret + 1) == -1)
|
||||
RARCH_WARN("Failed to get hostname.\n");
|
||||
else
|
||||
{
|
||||
XChangeProperty(dpy, win, XA_WM_CLIENT_MACHINE, XA_STRING, 8,
|
||||
PropModeReplace, (unsigned char *)hostname, strlen(hostname));
|
||||
}
|
||||
free(hostname);
|
||||
}
|
||||
|
||||
void x11_set_window_attr(Display *dpy, Window win)
|
||||
{
|
||||
x11_set_window_class(dpy, win);
|
||||
x11_set_window_pid(dpy, win);
|
||||
}
|
||||
|
||||
static void xdg_screensaver_inhibit(Window wnd)
|
||||
|
@ -305,6 +305,8 @@ static void caca_set_osd_msg(void *data,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t caca_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@ -312,11 +314,7 @@ static const video_poke_interface_t caca_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#ifdef HAVE_FBO
|
||||
NULL,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1120,14 +1120,16 @@ static void ctr_set_osd_msg(void *data,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t ctr_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
ctr_load_texture,
|
||||
ctr_unload_texture,
|
||||
NULL,
|
||||
ctr_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL,
|
||||
ctr_set_aspect_ratio,
|
||||
ctr_apply_state_changes,
|
||||
|
@ -66,6 +66,13 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX
|
||||
#ifndef HAVE_FBO
|
||||
#define HAVE_FBO
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static LPDIRECT3D g_pD3D;
|
||||
|
||||
static bool d3d_init_imports(d3d_video_t *d3d)
|
||||
@ -1057,11 +1064,20 @@ static bool d3d_init_internal(d3d_video_t *d3d,
|
||||
* later. */
|
||||
type =
|
||||
video_shader_parse_type(settings->paths.path_shader, RARCH_SHADER_NONE);
|
||||
if (settings->bools.video_shader_enable && type == RARCH_SHADER_CG)
|
||||
|
||||
if (settings->bools.video_shader_enable)
|
||||
{
|
||||
if (!string_is_empty(d3d->shader_path))
|
||||
free(d3d->shader_path);
|
||||
d3d->shader_path = strdup(settings->paths.path_shader);
|
||||
switch (type)
|
||||
{
|
||||
case RARCH_SHADER_CG:
|
||||
if (!string_is_empty(d3d->shader_path))
|
||||
free(d3d->shader_path);
|
||||
if (!string_is_empty(settings->paths.path_shader))
|
||||
d3d->shader_path = strdup(settings->paths.path_shader);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!d3d_process_shader(d3d))
|
||||
@ -1703,7 +1719,21 @@ static void d3d_unload_texture(void *data, uintptr_t id)
|
||||
d3d_texture_free(texid);
|
||||
}
|
||||
|
||||
static void d3d_set_mvp(void *data,
|
||||
void *shader_data,
|
||||
const void *mat_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
if (d3d && d3d->renderchain_driver->set_mvp)
|
||||
d3d->renderchain_driver->set_mvp(
|
||||
d3d->renderchain_data,
|
||||
data,
|
||||
640, 480, 0);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
d3d_set_mvp,
|
||||
d3d_load_texture,
|
||||
d3d_unload_texture,
|
||||
NULL,
|
||||
|
@ -631,6 +631,8 @@ static void dispmanx_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t dispmanx_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -959,6 +959,8 @@ static void drm_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t drm_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -1478,6 +1478,8 @@ static void exynos_show_mouse(void *data, bool state)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t exynos_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -356,7 +356,8 @@ static bool gdi_gfx_alive(void *data)
|
||||
unsigned temp_height = 0;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
|
||||
bool ret = false;
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
@ -365,12 +366,13 @@ static bool gdi_gfx_alive(void *data)
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
|
||||
video_context_driver_check_window(&size_data);
|
||||
if (video_context_driver_check_window(&size_data))
|
||||
ret = !quit;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool gdi_gfx_focus(void *data)
|
||||
@ -531,6 +533,8 @@ static void gdi_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gdi_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
gdi_set_video_mode,
|
||||
@ -538,11 +542,7 @@ static const video_poke_interface_t gdi_poke_interface = {
|
||||
gdi_get_video_output_size,
|
||||
gdi_get_video_output_prev,
|
||||
gdi_get_video_output_next,
|
||||
#ifdef HAVE_FBO
|
||||
NULL,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
274
gfx/drivers/gl.c
274
gfx/drivers/gl.c
@ -220,9 +220,9 @@ static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
|
||||
coords.handle_data = NULL;
|
||||
coords.data = &gl->coords;
|
||||
|
||||
video_shader_driver_set_coords(coords);
|
||||
video_driver_set_coords(&coords);
|
||||
|
||||
video_info->cb_shader_set_mvp(gl,
|
||||
video_info->cb_set_mvp(gl,
|
||||
video_info->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
for (i = 0; i < gl->overlays; i++)
|
||||
@ -377,18 +377,10 @@ static bool gl_shader_init(gl_t *gl, const gfx_ctx_driver_t *ctx_driver,
|
||||
)
|
||||
{
|
||||
video_shader_ctx_init_t init_data;
|
||||
enum rarch_shader_type type;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *shader_path = (settings->bools.video_shader_enable
|
||||
&& *settings->paths.path_shader) ? settings->paths.path_shader : NULL;
|
||||
|
||||
if (!gl)
|
||||
{
|
||||
RARCH_ERR("[GL]: Invalid GL instance passed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
type = video_shader_parse_type(shader_path,
|
||||
enum rarch_shader_type type = video_shader_parse_type(shader_path,
|
||||
gl->core_context_in_use
|
||||
? RARCH_SHADER_GLSL : DEFAULT_SHADER_TYPE);
|
||||
|
||||
@ -449,6 +441,8 @@ GLenum min_filter_to_mag(GLenum type)
|
||||
static uintptr_t gl_get_current_framebuffer(void *data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl || !gl->has_fbo)
|
||||
return 0;
|
||||
return gl->hw_render_fbo[(gl->tex_index + 1) % gl->textures];
|
||||
}
|
||||
|
||||
@ -553,7 +547,7 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
|
||||
/* Use regular textures if we use HW render. */
|
||||
gl->egl_images = !gl->hw_render_use && gl_check_capability(GL_CAPS_EGLIMAGE) &&
|
||||
video_context_driver_init_image_buffer((void*)video);
|
||||
video_context_driver_init_image_buffer(video);
|
||||
|
||||
#ifdef HAVE_PSGL
|
||||
if (!gl->pbo)
|
||||
@ -595,11 +589,8 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
|
||||
for (i = 0; i < gl->textures; i++)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[i]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_min_filter);
|
||||
gl_bind_texture(gl->texture[i], gl->wrap_mode, gl->tex_mag_filter,
|
||||
gl->tex_min_filter);
|
||||
|
||||
if (gl->renderchain_driver->init_texture_reference)
|
||||
gl->renderchain_driver->init_texture_reference(
|
||||
@ -622,6 +613,7 @@ static INLINE void gl_set_shader_viewports(gl_t *gl)
|
||||
shader_info.set_active = true;
|
||||
|
||||
video_shader_driver_use(shader_info);
|
||||
|
||||
gl_set_viewport_wrapper(gl, width, height, false, true);
|
||||
|
||||
shader_info.data = gl;
|
||||
@ -687,11 +679,7 @@ void gl_load_texture_data(
|
||||
break;
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, id);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
gl_bind_texture(id, wrap, mag_filter, min_filter);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
|
||||
glTexImage2D(GL_TEXTURE_2D,
|
||||
@ -753,35 +741,27 @@ static void gl_render_osd_background(
|
||||
gl_t *gl, video_frame_info_t *video_info,
|
||||
const char *msg)
|
||||
{
|
||||
int msg_width;
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
video_shader_ctx_coords_t coords_data;
|
||||
video_coords_t coords;
|
||||
video_shader_ctx_info_t shader_info;
|
||||
struct uniform_info uniform_param;
|
||||
float colors[4];
|
||||
float x, x2, y, y2, width, height;
|
||||
const unsigned
|
||||
vertices_total = 6;
|
||||
float *dummy = (float*)calloc(4 * vertices_total, sizeof(float));
|
||||
float *verts = (float*)malloc(2 * vertices_total * sizeof(float));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!gl || !settings)
|
||||
goto end;
|
||||
|
||||
msg_width =
|
||||
int msg_width =
|
||||
font_driver_get_message_width(NULL, msg, strlen(msg), 1.0f);
|
||||
|
||||
/* shader driver expects vertex coords as 0..1 */
|
||||
x = video_info->font_msg_pos_x;
|
||||
y = video_info->font_msg_pos_y;
|
||||
width = msg_width / (float)video_info->width;
|
||||
height =
|
||||
float x = video_info->font_msg_pos_x;
|
||||
float y = video_info->font_msg_pos_y;
|
||||
float width = msg_width / (float)video_info->width;
|
||||
float height =
|
||||
settings->floats.video_font_size / (float)video_info->height;
|
||||
|
||||
x2 = 0.005f; /* extend background around text */
|
||||
y2 = 0.005f;
|
||||
float x2 = 0.005f; /* extend background around text */
|
||||
float y2 = 0.005f;
|
||||
|
||||
x -= x2;
|
||||
y -= y2;
|
||||
@ -822,24 +802,20 @@ static void gl_render_osd_background(
|
||||
coords_data.handle_data = NULL;
|
||||
coords_data.data = &coords;
|
||||
|
||||
shader_info.data = NULL;
|
||||
shader_info.idx = VIDEO_SHADER_STOCK_BLEND;
|
||||
shader_info.set_active = true;
|
||||
|
||||
video_driver_set_viewport(video_info->width,
|
||||
video_info->height, true, false);
|
||||
|
||||
video_shader_driver_use(shader_info);
|
||||
video_shader_driver_set_coords(coords_data);
|
||||
video_info->cb_shader_use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
video_driver_set_coords(&coords_data);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
|
||||
mvp.data = gl;
|
||||
mvp.matrix = &gl->mvp_no_rot;
|
||||
|
||||
video_shader_driver_set_mvp(mvp);
|
||||
video_info->cb_set_mvp(gl,
|
||||
video_info->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
uniform_param.type = UNIFORM_4F;
|
||||
uniform_param.enabled = true;
|
||||
@ -848,7 +824,7 @@ static void gl_render_osd_background(
|
||||
|
||||
uniform_param.lookup.type = SHADER_PROGRAM_FRAGMENT;
|
||||
uniform_param.lookup.ident = "bgcolor";
|
||||
uniform_param.lookup.idx = shader_info.idx;
|
||||
uniform_param.lookup.idx = VIDEO_SHADER_STOCK_BLEND;
|
||||
uniform_param.lookup.add_prefix = true;
|
||||
uniform_param.lookup.enable = true;
|
||||
|
||||
@ -860,7 +836,7 @@ static void gl_render_osd_background(
|
||||
video_shader_driver_set_parameter(uniform_param);
|
||||
|
||||
glDrawArrays(GL_TRIANGLES, 0, coords.vertices);
|
||||
end:
|
||||
|
||||
/* reset uniform back to zero so it is not used for anything else */
|
||||
uniform_param.result.f.v0 = 0.0f;
|
||||
uniform_param.result.f.v1 = 0.0f;
|
||||
@ -948,25 +924,23 @@ static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
color[14] = 1.0f;
|
||||
color[15] = gl->menu_texture_alpha;
|
||||
|
||||
if (!gl->menu_texture)
|
||||
return;
|
||||
|
||||
gl->coords.vertex = vertexes_flipped;
|
||||
gl->coords.tex_coord = tex_coords;
|
||||
gl->coords.color = color;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->menu_texture);
|
||||
|
||||
video_info->cb_shader_use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
coords.handle_data = NULL;
|
||||
coords.data = &gl->coords;
|
||||
coords.handle_data = NULL;
|
||||
coords.data = &gl->coords;
|
||||
|
||||
video_shader_driver_set_coords(coords);
|
||||
video_driver_set_coords(&coords);
|
||||
|
||||
video_info->cb_shader_set_mvp(gl,
|
||||
video_info->cb_set_mvp(gl,
|
||||
video_info->shader_data, &gl->mvp_no_rot);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
@ -982,9 +956,9 @@ static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
|
||||
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.vertex = gl->vertex_ptr;
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1146,9 +1120,9 @@ static bool gl_frame(void *data, const void *frame,
|
||||
coords.handle_data = NULL;
|
||||
coords.data = &gl->coords;
|
||||
|
||||
video_shader_driver_set_coords(coords);
|
||||
video_driver_set_coords(&coords);
|
||||
|
||||
video_info->cb_shader_set_mvp(gl, video_info->shader_data, &gl->mvp);
|
||||
video_info->cb_set_mvp(gl, video_info->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
@ -1165,7 +1139,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
{
|
||||
menu_driver_frame(video_info);
|
||||
|
||||
if (gl->menu_texture_enable)
|
||||
if (gl->menu_texture)
|
||||
gl_draw_texture(gl, video_info);
|
||||
}
|
||||
#endif
|
||||
@ -1318,10 +1292,6 @@ static void gl_free(void *data)
|
||||
scaler_ctx_gen_reset(&gl->pbo_readback_scaler);
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->free)
|
||||
gl->renderchain_driver->free(gl);
|
||||
gl_deinit_chain(gl);
|
||||
|
||||
if (gl->core_context_in_use)
|
||||
{
|
||||
if (gl->renderchain_driver->unbind_vao)
|
||||
@ -1330,6 +1300,10 @@ static void gl_free(void *data)
|
||||
gl->renderchain_driver->free_vao(gl);
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->free)
|
||||
gl->renderchain_driver->free(gl);
|
||||
gl_deinit_chain(gl);
|
||||
|
||||
video_context_driver_free();
|
||||
|
||||
gl_destroy_resources(gl);
|
||||
@ -1357,35 +1331,7 @@ static void gl_set_nonblock_state(void *data, bool state)
|
||||
|
||||
static bool resolve_extensions(gl_t *gl, const char *context_ident)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct retro_hw_render_callback *hwr =
|
||||
video_driver_get_hw_context();
|
||||
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
|
||||
if (!gl_check_capability(GL_CAPS_VAO))
|
||||
{
|
||||
RARCH_ERR("[GL]: Failed to initialize VAOs.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
gl_query_core_context_set(true);
|
||||
gl->core_context_in_use = true;
|
||||
|
||||
/**
|
||||
* Ensure that the rest of the frontend knows we have a core context
|
||||
*/
|
||||
flags.flags = 0;
|
||||
BIT32_SET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
|
||||
|
||||
video_context_driver_set_flags(&flags);
|
||||
|
||||
RARCH_LOG("[GL]: Using Core GL context, setting up VAO...\n");
|
||||
if (gl->renderchain_driver->new_vao)
|
||||
gl->renderchain_driver->new_vao(gl);
|
||||
}
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
/* have_es2_compat - GL_RGB565 internal format support.
|
||||
* Even though ES2 support is claimed, the format
|
||||
@ -1397,12 +1343,15 @@ static bool resolve_extensions(gl_t *gl, const char *context_ident)
|
||||
* have_sync - Use ARB_sync to reduce latency.
|
||||
*/
|
||||
gl->has_srgb_fbo = false;
|
||||
gl->has_fbo = gl_check_capability(GL_CAPS_FBO);
|
||||
gl->have_full_npot_support = gl_check_capability(GL_CAPS_FULL_NPOT_SUPPORT);
|
||||
gl->have_mipmap = gl_check_capability(GL_CAPS_MIPMAP);
|
||||
gl->have_es2_compat = gl_check_capability(GL_CAPS_ES2_COMPAT);
|
||||
gl->has_fp_fbo = gl_check_capability(GL_CAPS_FP_FBO);
|
||||
gl->support_unpack_row_length = gl_check_capability(GL_CAPS_UNPACK_ROW_LENGTH);
|
||||
gl->have_sync = gl_check_capability(GL_CAPS_SYNC);
|
||||
/* GLES3 has unpack_subimage and sRGB in core. */
|
||||
gl->has_srgb_fbo_gles3 = gl_check_capability(GL_CAPS_SRGB_FBO_ES3);
|
||||
|
||||
if (!settings->bools.video_force_srgb_disable)
|
||||
gl->has_srgb_fbo = gl_check_capability(GL_CAPS_SRGB_FBO);
|
||||
@ -1419,9 +1368,6 @@ static bool resolve_extensions(gl_t *gl, const char *context_ident)
|
||||
RARCH_WARN("[GL]: GLES implementation does not have BGRA8888 extension.\n"
|
||||
"32-bit path will require conversion.\n");
|
||||
}
|
||||
|
||||
/* GLES3 has unpack_subimage and sRGB in core. */
|
||||
gl->has_srgb_fbo_gles3 = gl_check_capability(GL_CAPS_SRGB_FBO_ES3);
|
||||
/* TODO/FIXME - No extensions for float FBO currently. */
|
||||
#endif
|
||||
|
||||
@ -1555,20 +1501,20 @@ static const gfx_ctx_driver_t *gl_get_context(gl_t *gl)
|
||||
unsigned minor = hwr->version_minor;
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
api = GFX_CTX_OPENGL_ES_API;
|
||||
api_name = "OpenGL ES 2.0";
|
||||
api = GFX_CTX_OPENGL_ES_API;
|
||||
api_name = "OpenGL ES 2.0";
|
||||
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGLES3)
|
||||
{
|
||||
major = 3;
|
||||
minor = 0;
|
||||
api_name = "OpenGL ES 3.0";
|
||||
major = 3;
|
||||
minor = 0;
|
||||
api_name = "OpenGL ES 3.0";
|
||||
}
|
||||
else if (hwr->context_type == RETRO_HW_CONTEXT_OPENGLES_VERSION)
|
||||
api_name = "OpenGL ES 3.1+";
|
||||
api_name = "OpenGL ES 3.1+";
|
||||
#else
|
||||
api = GFX_CTX_OPENGL_API;
|
||||
api_name = "OpenGL";
|
||||
api = GFX_CTX_OPENGL_API;
|
||||
api_name = "OpenGL";
|
||||
#endif
|
||||
|
||||
(void)api_name;
|
||||
@ -1796,6 +1742,45 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
rglgen_resolve_symbols(ctx_driver->get_proc_address);
|
||||
#endif
|
||||
|
||||
hwr = video_driver_get_hw_context();
|
||||
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
|
||||
gl_query_core_context_set(true);
|
||||
gl->core_context_in_use = true;
|
||||
|
||||
/**
|
||||
* Ensure that the rest of the frontend knows we have a core context
|
||||
*/
|
||||
flags.flags = 0;
|
||||
BIT32_SET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
|
||||
|
||||
video_context_driver_set_flags(&flags);
|
||||
|
||||
RARCH_LOG("[GL]: Using Core GL context, setting up VAO...\n");
|
||||
if (!gl_check_capability(GL_CAPS_VAO))
|
||||
{
|
||||
RARCH_ERR("[GL]: Failed to initialize VAOs.\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!renderchain_gl_init_first(&gl->renderchain_driver,
|
||||
&gl->renderchain_data))
|
||||
{
|
||||
RARCH_ERR("[GL]: Renderchain could not be initialized.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->restore_default_state)
|
||||
gl->renderchain_driver->restore_default_state(gl);
|
||||
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
if (gl->renderchain_driver->new_vao)
|
||||
gl->renderchain_driver->new_vao(gl);
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
|
||||
@ -1828,8 +1813,6 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
|
||||
RARCH_LOG("[GL]: Using resolution %ux%u\n", temp_width, temp_height);
|
||||
|
||||
hwr = video_driver_get_hw_context();
|
||||
|
||||
gl->vertex_ptr = hwr->bottom_left_origin
|
||||
? vertexes : vertexes_flipped;
|
||||
|
||||
@ -1839,10 +1822,9 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
*/
|
||||
gl->textures = 4;
|
||||
gl->hw_render_use = false;
|
||||
#ifdef HAVE_FBO
|
||||
if (hwr->context_type != RETRO_HW_CONTEXT_NONE)
|
||||
|
||||
if (gl->has_fbo && hwr->context_type != RETRO_HW_CONTEXT_NONE)
|
||||
gl->hw_render_use = true;
|
||||
#endif
|
||||
|
||||
if (gl->hw_render_use)
|
||||
{
|
||||
@ -1925,16 +1907,6 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
|
||||
gl_set_texture_fmts(gl, video->rgb32);
|
||||
|
||||
if (!renderchain_gl_init_first(&gl->renderchain_driver,
|
||||
&gl->renderchain_data))
|
||||
{
|
||||
RARCH_ERR("[GL]: Renderchain could not be initialized.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->restore_default_state)
|
||||
gl->renderchain_driver->restore_default_state(gl);
|
||||
|
||||
memcpy(gl->tex_info.coord, tex_coords, sizeof(gl->tex_info.coord));
|
||||
gl->coords.vertex = gl->vertex_ptr;
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
@ -1957,12 +1929,15 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||
if (gl->renderchain_driver->init)
|
||||
gl->renderchain_driver->init(gl, gl->tex_w, gl->tex_h);
|
||||
|
||||
if (gl->hw_render_use &&
|
||||
gl->renderchain_driver->init_hw_render &&
|
||||
!gl->renderchain_driver->init_hw_render(gl, gl->tex_w, gl->tex_h))
|
||||
if (gl->has_fbo)
|
||||
{
|
||||
RARCH_ERR("[GL]: Hardware rendering context initialization failed.\n");
|
||||
goto error;
|
||||
if (gl->hw_render_use &&
|
||||
gl->renderchain_driver->init_hw_render &&
|
||||
!gl->renderchain_driver->init_hw_render(gl, gl->tex_w, gl->tex_h))
|
||||
{
|
||||
RARCH_ERR("[GL]: Hardware rendering context initialization failed.\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
inp.input = input;
|
||||
@ -2089,11 +2064,8 @@ static void gl_update_tex_filter_frame(gl_t *gl)
|
||||
if (!gl->texture[i])
|
||||
continue;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[i]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gl->wrap_mode);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_min_filter);
|
||||
gl_bind_texture(gl->texture[i], gl->wrap_mode, gl->tex_mag_filter,
|
||||
gl->tex_min_filter);
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
@ -2136,11 +2108,13 @@ static bool gl_set_shader(void *data,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (gl->renderchain_driver->deinit_fbo)
|
||||
gl->renderchain_driver->deinit_fbo(gl);
|
||||
#ifdef HAVE_FBO
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
#endif
|
||||
if (gl->fbo_inited)
|
||||
{
|
||||
if (gl->renderchain_driver->deinit_fbo)
|
||||
gl->renderchain_driver->deinit_fbo(gl);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
}
|
||||
|
||||
init_data.shader_type = type;
|
||||
init_data.shader = NULL;
|
||||
@ -2167,7 +2141,7 @@ static bool gl_set_shader(void *data,
|
||||
|
||||
if (textures > gl->textures) /* Have to reinit a bit. */
|
||||
{
|
||||
if (gl->hw_render_use &&
|
||||
if (gl->hw_render_use && gl->fbo_inited &&
|
||||
gl->renderchain_driver->deinit_hw_render)
|
||||
gl->renderchain_driver->deinit_hw_render(gl);
|
||||
|
||||
@ -2545,7 +2519,27 @@ static void gl_unload_texture(void *data, uintptr_t id)
|
||||
glDeleteTextures(1, &glid);
|
||||
}
|
||||
|
||||
static void gl_set_coords(void *handle_data, void *shader_data,
|
||||
const struct video_coords *coords)
|
||||
{
|
||||
gl_t *gl = (gl_t*)handle_data;
|
||||
if (gl && gl->renderchain_driver->set_coords)
|
||||
gl->renderchain_driver->set_coords(handle_data,
|
||||
shader_data, coords);
|
||||
}
|
||||
|
||||
static void gl_set_mvp(void *data, void *shader_data,
|
||||
const void *mat_data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (gl && gl->renderchain_driver->set_mvp)
|
||||
gl->renderchain_driver->set_mvp(data,
|
||||
shader_data, mat_data);
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gl_poke_interface = {
|
||||
gl_set_coords,
|
||||
gl_set_mvp,
|
||||
gl_load_texture,
|
||||
gl_unload_texture,
|
||||
gl_set_video_mode,
|
||||
@ -2553,11 +2547,7 @@ static const video_poke_interface_t gl_poke_interface = {
|
||||
gl_get_video_output_size,
|
||||
gl_get_video_output_prev,
|
||||
gl_get_video_output_next,
|
||||
#ifdef HAVE_FBO
|
||||
gl_get_current_framebuffer,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
gl_get_proc_address,
|
||||
gl_set_aspect_ratio,
|
||||
gl_apply_state_changes,
|
||||
|
76
gfx/drivers/gl_shaders/pipeline_snowflake.glsl.frag.h
Normal file
76
gfx/drivers/gl_shaders/pipeline_snowflake.glsl.frag.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* credits to: TheTimJames
|
||||
https://www.shadertoy.com/view/Md2GRw
|
||||
*/
|
||||
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char* stock_fragment_xmb_snowflake = GLSL(
|
||||
uniform float time;
|
||||
uniform vec2 OutputSize;
|
||||
vec2 uv;
|
||||
|
||||
float atime;
|
||||
|
||||
float rand(vec2 co)
|
||||
{
|
||||
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
||||
}
|
||||
|
||||
float rand_float(float x)
|
||||
{
|
||||
return rand(vec2(x, 1.0));
|
||||
}
|
||||
|
||||
float snow(vec3 pos, vec2 uv, float o)
|
||||
{
|
||||
vec2 d = (pos.xy - uv);
|
||||
float a = atan(d.y,d.x) + sin(atime*1.0 + o) * 10.0;
|
||||
|
||||
float dist = d.x*d.x + d.y*d.y;
|
||||
|
||||
if(dist < pos.z/400.0)
|
||||
{
|
||||
float col = 0.0;
|
||||
if(sin(a * 8.0) < 0.0)
|
||||
{
|
||||
col=1.0;
|
||||
}
|
||||
if(dist < pos.z/800.0)
|
||||
{
|
||||
col+=1.0;
|
||||
}
|
||||
return col * pos.z;
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float col(vec2 c)
|
||||
{
|
||||
float color = 0.0;
|
||||
for (int i = 1; i < 15; i++)
|
||||
{
|
||||
float o = rand_float(float(i) / 3.0) * 15.0;
|
||||
float z = rand_float(float(i) + 13.0);
|
||||
float x = 1.8 - (3.6) * (rand_float(floor((time*((z + 1.0) / 2.0) +o) / 2.0)) + sin(time * o /1000.0) / 10.0);
|
||||
float y = 1.0 - mod((time * ((z + 1.0)/2.0)) + o, 2.0);
|
||||
|
||||
color += snow(vec3(x,y,z), c, o);
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
uv = gl_FragCoord.xy / OutputSize.xy;
|
||||
uv = uv * 2.0 - 1.0;
|
||||
vec2 p = uv;
|
||||
p.x *= OutputSize.x / OutputSize.y;
|
||||
|
||||
atime = (time + 1.0) / 4.0;
|
||||
|
||||
gl_FragColor = vec4(col(p));
|
||||
}
|
||||
|
||||
);
|
@ -27,7 +27,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FBO) && defined(HAVE_PSGL)
|
||||
#if defined(HAVE_PSGL)
|
||||
#define glGenFramebuffers glGenFramebuffersOES
|
||||
#define glBindFramebuffer glBindFramebufferOES
|
||||
#define glFramebufferTexture2D glFramebufferTexture2DOES
|
||||
@ -92,14 +92,10 @@
|
||||
#define glGenerateMipmap glGenerateMipmapOES
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
|
||||
#if defined(__APPLE__) || defined(HAVE_PSGL)
|
||||
#define GL_RGBA32F GL_RGBA32F_ARB
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_PSGL)
|
||||
#define RARCH_GL_INTERNAL_FORMAT32 GL_ARGB_SCE
|
||||
#define RARCH_GL_INTERNAL_FORMAT16 GL_RGB5 /* TODO: Verify if this is really 565 or just 555. */
|
||||
@ -146,18 +142,6 @@
|
||||
#define RARCH_GL_FORMAT16_565 GL_UNSIGNED_SHORT_5_6_5
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGL_MODERN) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3) || defined(HAVE_OPENGLES_3_1) || defined(HAVE_OPENGLES_3_2) || defined(HAVE_PSGL)
|
||||
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
#define NO_GL_FF_VERTEX
|
||||
#endif
|
||||
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
#define NO_GL_FF_MATRIX
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGLES2) /* TODO: Figure out exactly what. */
|
||||
#define NO_GL_CLAMP_TO_BORDER
|
||||
#endif
|
||||
|
@ -1262,6 +1262,8 @@ static void gx_get_video_output_next(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gx_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
gx_set_video_mode,
|
||||
|
@ -1130,6 +1130,8 @@ static void omap_gfx_set_texture_enable(void *data, bool state, bool full_screen
|
||||
}
|
||||
|
||||
static const video_poke_interface_t omap_gfx_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -831,6 +831,8 @@ static void psp_viewport_info(void *data, struct video_viewport *vp)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t psp_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -718,6 +718,8 @@ static void sdl2_grab_mouse_toggle(void *data)
|
||||
#endif
|
||||
|
||||
static video_poke_interface_t sdl2_video_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -517,6 +517,8 @@ static void sdl_grab_mouse_toggle(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t sdl_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -932,6 +932,8 @@ static void sunxi_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t sunxi_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -392,6 +392,8 @@ static void vga_set_osd_msg(void *data,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vga_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -779,6 +779,8 @@ static bool vita_get_current_sw_framebuffer(void *data,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vita_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
vita_load_texture,
|
||||
vita_unload_texture,
|
||||
NULL,
|
||||
|
@ -2242,6 +2242,8 @@ static void vulkan_unload_texture(void *data, uintptr_t handle)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vulkan_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
vulkan_load_texture,
|
||||
vulkan_unload_texture,
|
||||
vulkan_set_video_mode,
|
||||
|
@ -848,6 +848,8 @@ static void wiiu_gfx_set_osd_msg(void* data,
|
||||
|
||||
static const video_poke_interface_t wiiu_poke_interface =
|
||||
{
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
wiiu_gfx_load_texture,
|
||||
wiiu_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
|
@ -205,6 +205,8 @@ static void xshm_grab_mouse_toggle(void *data)
|
||||
#endif
|
||||
|
||||
static video_poke_interface_t xshm_video_poke_interface = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -28,13 +28,13 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <libdrm/drm.h>
|
||||
#include <gbm.h>
|
||||
|
||||
#include <lists/dir_list.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../../configuration.h"
|
||||
@ -80,7 +80,7 @@ typedef struct gfx_ctx_drm_data
|
||||
#ifdef HAVE_EGL
|
||||
egl_ctx_data_t egl;
|
||||
#endif
|
||||
RFILE *drm;
|
||||
int fd;
|
||||
unsigned interval;
|
||||
unsigned fb_width;
|
||||
unsigned fb_height;
|
||||
@ -294,12 +294,14 @@ static void free_drm_resources(gfx_ctx_drm_data_t *drm)
|
||||
|
||||
drm_free();
|
||||
|
||||
if (drm->drm)
|
||||
if (drm->fd >= 0)
|
||||
{
|
||||
if (g_drm_fd >= 0)
|
||||
{
|
||||
drmDropMaster(g_drm_fd);
|
||||
filestream_close(drm->drm);
|
||||
close(drm->fd);
|
||||
}
|
||||
}
|
||||
|
||||
g_gbm_surface = NULL;
|
||||
g_gbm_dev = NULL;
|
||||
@ -353,6 +355,7 @@ static void *gfx_ctx_drm_init(video_frame_info_t *video_info, void *video_driver
|
||||
|
||||
if (!drm)
|
||||
return NULL;
|
||||
drm->fd = -1;
|
||||
|
||||
gpu_descriptors = dir_list_new("/dev/dri", NULL, false, true, false, false);
|
||||
|
||||
@ -366,14 +369,14 @@ nextgpu:
|
||||
}
|
||||
gpu = gpu_descriptors->elems[gpu_index++].data;
|
||||
|
||||
drm->drm = filestream_open(gpu, RFILE_MODE_READ_WRITE, -1);
|
||||
if (!drm->drm)
|
||||
drm->fd = open(gpu, O_RDWR);
|
||||
if (drm->fd < 0)
|
||||
{
|
||||
RARCH_WARN("[KMS]: Couldn't open DRM device.\n");
|
||||
goto nextgpu;
|
||||
}
|
||||
|
||||
fd = filestream_get_fd(drm->drm);
|
||||
fd = drm->fd;
|
||||
|
||||
if (!drm_get_resources(fd))
|
||||
goto nextgpu;
|
||||
|
@ -17,13 +17,13 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/* Includes and defines for framebuffer size retrieval */
|
||||
#include <linux/fb.h>
|
||||
#include <linux/vt.h>
|
||||
|
||||
#include <streams/file_stream.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
@ -56,8 +56,7 @@ static enum gfx_ctx_api mali_api = GFX_CTX_NONE;
|
||||
|
||||
static void gfx_ctx_mali_fbdev_destroy(void *data)
|
||||
{
|
||||
int fb;
|
||||
RFILE *fd = NULL;
|
||||
int fd;
|
||||
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
|
||||
|
||||
if (mali)
|
||||
@ -71,12 +70,11 @@ static void gfx_ctx_mali_fbdev_destroy(void *data)
|
||||
}
|
||||
|
||||
/* Clear framebuffer and set cursor on again */
|
||||
fd = filestream_open("/dev/tty", RFILE_MODE_READ_WRITE, -1);
|
||||
fb = filestream_get_fd(fd);
|
||||
fd = open("/dev/tty", O_RDWR);
|
||||
ioctl(fd, VT_ACTIVATE, 5);
|
||||
ioctl(fd, VT_ACTIVATE, 1);
|
||||
close(fd);
|
||||
|
||||
ioctl(fb, VT_ACTIVATE,5);
|
||||
ioctl(fb, VT_ACTIVATE,1);
|
||||
filestream_close(fd);
|
||||
system("setterm -cursor on");
|
||||
}
|
||||
|
||||
@ -160,16 +158,16 @@ static bool gfx_ctx_mali_fbdev_set_video_mode(void *data,
|
||||
EGL_NONE
|
||||
};
|
||||
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
|
||||
RFILE *fd = filestream_open("/dev/fb0", RFILE_MODE_READ_WRITE, -1);
|
||||
int fb = filestream_get_fd(fd);
|
||||
int fd = open("/dev/fb0", O_RDWR);
|
||||
|
||||
if (ioctl(fb, FBIOGET_VSCREENINFO, &vinfo) < 0)
|
||||
if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0)
|
||||
{
|
||||
RARCH_ERR("Error obtaining framebuffer info.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
filestream_close(fd);
|
||||
close(fd);
|
||||
fd = -1;
|
||||
|
||||
width = vinfo.xres;
|
||||
height = vinfo.yres;
|
||||
@ -196,8 +194,8 @@ static bool gfx_ctx_mali_fbdev_set_video_mode(void *data,
|
||||
return true;
|
||||
|
||||
error:
|
||||
if (fd)
|
||||
filestream_close(fd);
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
RARCH_ERR("[Mali fbdev]: EGL error: %d.\n", eglGetError());
|
||||
gfx_ctx_mali_fbdev_destroy(data);
|
||||
return false;
|
||||
|
@ -113,6 +113,53 @@ static enum gfx_ctx_api x_api = GFX_CTX_NONE;
|
||||
|
||||
static gfx_ctx_x_data_t *current_context_data = NULL;
|
||||
|
||||
const unsigned long retroarch_icon_data[] = {
|
||||
16, 16,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x000000ff, 0xffffffff,
|
||||
0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0xffffffff, 0x000000ff,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0x000000ff, 0xffffffff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff,
|
||||
0x000000ff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0xffffffff, 0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xffffffff, 0x000000ff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x000000ff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0x000000ff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
};
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
static PFNGLXCREATECONTEXTATTRIBSARBPROC glx_create_context_attribs;
|
||||
|
||||
@ -574,6 +621,8 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
||||
XSetWindowAttributes swa = {0};
|
||||
int (*old_handler)(Display*, XErrorEvent*) = NULL;
|
||||
gfx_ctx_x_data_t *x = (gfx_ctx_x_data_t*)data;
|
||||
Atom net_wm_icon = XInternAtom(g_x11_dpy, "_NET_WM_ICON", False);
|
||||
Atom cardinal = XInternAtom(g_x11_dpy, "CARDINAL", False);
|
||||
|
||||
frontend_driver_install_signal_handler();
|
||||
|
||||
@ -661,6 +710,8 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
||||
(true_full ? CWOverrideRedirect : 0), &swa);
|
||||
XSetWindowBackground(g_x11_dpy, g_x11_win, 0);
|
||||
|
||||
XChangeProperty(g_x11_dpy, g_x11_win, net_wm_icon, cardinal, 32, PropModeReplace, (const unsigned char*)retroarch_icon_data, sizeof(retroarch_icon_data) / sizeof(*retroarch_icon_data));
|
||||
|
||||
switch (x_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
@ -1137,4 +1188,3 @@ const gfx_ctx_driver_t gfx_ctx_x = {
|
||||
#endif
|
||||
gfx_ctx_x_make_current
|
||||
};
|
||||
|
||||
|
@ -129,12 +129,6 @@ static void caca_render_msg(video_frame_info_t *video_info,
|
||||
caca_refresh_display(*font->caca->caca_display);
|
||||
}
|
||||
|
||||
static void caca_font_flush_block(unsigned width, unsigned height,
|
||||
void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void caca_font_bind_block(void* data, void* userdata)
|
||||
{
|
||||
(void)data;
|
||||
@ -147,6 +141,6 @@ font_renderer_t caca_font = {
|
||||
"caca font",
|
||||
caca_font_get_glyph, /* get_glyph */
|
||||
caca_font_bind_block, /* bind_block */
|
||||
caca_font_flush_block, /* flush */
|
||||
NULL, /* flush */
|
||||
caca_get_message_width /* get_message_width */
|
||||
};
|
||||
|
@ -441,11 +441,6 @@ static const struct font_glyph* ctr_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void ctr_font_flush_block(unsigned width, unsigned height, void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void ctr_font_bind_block(void* data, void* userdata)
|
||||
{
|
||||
(void)data;
|
||||
@ -460,6 +455,6 @@ font_renderer_t ctr_font =
|
||||
"ctrfont",
|
||||
ctr_font_get_glyph,
|
||||
ctr_font_bind_block,
|
||||
ctr_font_flush_block,
|
||||
NULL, /* flush_block */
|
||||
ctr_font_get_message_width,
|
||||
};
|
||||
|
@ -140,7 +140,8 @@ static void gdi_render_msg(
|
||||
SelectObject(font->gdi->memDC, font->gdi->bmp_old);
|
||||
}
|
||||
|
||||
static void gdi_font_flush_block(unsigned width, unsigned height, void* data)
|
||||
static void gdi_font_flush_block(unsigned width, unsigned height, void* data,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
@ -190,11 +190,8 @@ static void *gl_raster_font_init_font(void *data,
|
||||
video_context_driver_make_current(false);
|
||||
|
||||
glGenTextures(1, &font->tex);
|
||||
glBindTexture(GL_TEXTURE_2D, font->tex);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
||||
gl_bind_texture(font->tex, GL_CLAMP_TO_EDGE, GL_LINEAR, GL_LINEAR);
|
||||
|
||||
font->atlas = font->font_driver->get_atlas(font->font_data);
|
||||
font->tex_width = next_pow2(font->atlas->width);
|
||||
@ -247,9 +244,9 @@ static int gl_get_message_width(void *data, const char *msg,
|
||||
return delta_x * scale;
|
||||
}
|
||||
|
||||
static void gl_raster_font_draw_vertices(gl_raster_t *font, const video_coords_t *coords)
|
||||
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_mvp_t mvp;
|
||||
video_shader_ctx_coords_t coords_data;
|
||||
|
||||
if (font->atlas->dirty)
|
||||
@ -261,12 +258,10 @@ static void gl_raster_font_draw_vertices(gl_raster_t *font, const video_coords_t
|
||||
coords_data.handle_data = NULL;
|
||||
coords_data.data = coords;
|
||||
|
||||
video_shader_driver_set_coords(coords_data);
|
||||
video_driver_set_coords(&coords_data);
|
||||
|
||||
mvp.data = font->gl;
|
||||
mvp.matrix = &font->gl->mvp_no_rot;
|
||||
|
||||
video_shader_driver_set_mvp(mvp);
|
||||
video_info->cb_set_mvp(font->gl,
|
||||
video_info->shader_data, &font->gl->mvp_no_rot);
|
||||
|
||||
glDrawArrays(GL_TRIANGLES, 0, coords->vertices);
|
||||
}
|
||||
@ -274,7 +269,8 @@ static void gl_raster_font_draw_vertices(gl_raster_t *font, const video_coords_t
|
||||
static void gl_raster_font_render_line(
|
||||
gl_raster_t *font, const char *msg, unsigned msg_len,
|
||||
GLfloat scale, const GLfloat color[4], GLfloat pos_x,
|
||||
GLfloat pos_y, unsigned text_align)
|
||||
GLfloat pos_y, unsigned text_align,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
unsigned i;
|
||||
struct video_coords coords;
|
||||
@ -349,14 +345,15 @@ static void gl_raster_font_render_line(
|
||||
if (font->block)
|
||||
video_coord_array_append(&font->block->carr, &coords, coords.vertices);
|
||||
else
|
||||
gl_raster_font_draw_vertices(font, &coords);
|
||||
gl_raster_font_draw_vertices(font, &coords, video_info);
|
||||
}
|
||||
}
|
||||
|
||||
static void gl_raster_font_render_message(
|
||||
gl_raster_t *font, const char *msg, GLfloat scale,
|
||||
const GLfloat color[4], GLfloat pos_x, GLfloat pos_y,
|
||||
unsigned text_align)
|
||||
unsigned text_align,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
@ -366,7 +363,8 @@ static void gl_raster_font_render_message(
|
||||
{
|
||||
gl_raster_font_render_line(font,
|
||||
msg, (unsigned)strlen(msg), scale, color, pos_x,
|
||||
pos_y, text_align);
|
||||
pos_y, text_align,
|
||||
video_info);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -382,7 +380,8 @@ static void gl_raster_font_render_message(
|
||||
/* Draw the line */
|
||||
gl_raster_font_render_line(font,
|
||||
msg, msg_len, scale, color, pos_x,
|
||||
pos_y - (float)lines*line_height, text_align);
|
||||
pos_y - (float)lines*line_height, text_align,
|
||||
video_info);
|
||||
|
||||
if (!delim)
|
||||
break;
|
||||
@ -490,11 +489,13 @@ static void gl_raster_font_render_msg(
|
||||
if (font->gl)
|
||||
gl_raster_font_render_message(font, msg, scale, color_dark,
|
||||
x + scale * drop_x / font->gl->vp.width, y +
|
||||
scale * drop_y / font->gl->vp.height, text_align);
|
||||
scale * drop_y / font->gl->vp.height, text_align,
|
||||
video_info);
|
||||
}
|
||||
|
||||
if (font->gl)
|
||||
gl_raster_font_render_message(font, msg, scale, color, x, y, text_align);
|
||||
gl_raster_font_render_message(font, msg, scale, color,
|
||||
x, y, text_align, video_info);
|
||||
}
|
||||
|
||||
if (!font->block && font->gl)
|
||||
@ -520,7 +521,7 @@ static const struct font_glyph *gl_raster_font_get_glyph(
|
||||
}
|
||||
|
||||
static void gl_raster_font_flush_block(unsigned width, unsigned height,
|
||||
void *data)
|
||||
void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
gl_raster_t *font = (gl_raster_t*)data;
|
||||
video_font_raster_block_t *block = font ? font->block : NULL;
|
||||
@ -529,7 +530,8 @@ static void gl_raster_font_flush_block(unsigned width, unsigned height,
|
||||
return;
|
||||
|
||||
gl_raster_font_setup_viewport(width, height, font, block->fullscreen);
|
||||
gl_raster_font_draw_vertices(font, (video_coords_t*)&block->carr.coords);
|
||||
gl_raster_font_draw_vertices(font, (video_coords_t*)&block->carr.coords,
|
||||
video_info);
|
||||
|
||||
if (font->gl)
|
||||
{
|
||||
|
@ -129,12 +129,6 @@ static void vga_render_msg(video_frame_info_t *video_info,
|
||||
}
|
||||
}
|
||||
|
||||
static void vga_font_flush_block(unsigned width, unsigned height,
|
||||
void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void vga_font_bind_block(void* data, void* userdata)
|
||||
{
|
||||
(void)data;
|
||||
@ -147,6 +141,6 @@ font_renderer_t vga_font = {
|
||||
"vga font",
|
||||
vga_font_get_glyph, /* get_glyph */
|
||||
vga_font_bind_block, /* bind_block */
|
||||
vga_font_flush_block, /* flush */
|
||||
NULL, /* flush */
|
||||
vga_get_message_width /* get_message_width */
|
||||
};
|
||||
|
@ -346,12 +346,6 @@ static const struct font_glyph *vita2d_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void vita2d_font_flush_block(unsigned width, unsigned height,
|
||||
void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void vita2d_font_bind_block(void *data, void *userdata)
|
||||
{
|
||||
(void)data;
|
||||
@ -364,6 +358,6 @@ font_renderer_t vita2d_vita_font = {
|
||||
"vita2dfont",
|
||||
vita2d_font_get_glyph,
|
||||
vita2d_font_bind_block,
|
||||
vita2d_font_flush_block,
|
||||
NULL, /* flush */
|
||||
vita2d_font_get_message_width,
|
||||
};
|
||||
|
@ -436,7 +436,7 @@ static const struct font_glyph *vulkan_raster_font_get_glyph(
|
||||
}
|
||||
|
||||
static void vulkan_raster_font_flush_block(unsigned width, unsigned height,
|
||||
void *data)
|
||||
void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
@ -401,11 +401,6 @@ static const struct font_glyph* wiiu_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void wiiu_font_flush_block(unsigned width, unsigned height, void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void wiiu_font_bind_block(void* data, void* userdata)
|
||||
{
|
||||
(void)data;
|
||||
@ -420,6 +415,6 @@ font_renderer_t wiiu_font =
|
||||
"wiiufont",
|
||||
wiiu_font_get_glyph,
|
||||
wiiu_font_bind_block,
|
||||
wiiu_font_flush_block,
|
||||
NULL, /* flush */
|
||||
wiiu_font_get_message_width,
|
||||
};
|
||||
|
@ -43,13 +43,17 @@ typedef struct d3d8_renderchain
|
||||
uint64_t frame_count;
|
||||
} d3d8_renderchain_t;
|
||||
|
||||
static void renderchain_set_mvp(void *data, unsigned vp_width,
|
||||
static void d3d8_renderchain_set_mvp(
|
||||
void *chain_data,
|
||||
void *data, unsigned vp_width,
|
||||
unsigned vp_height, unsigned rotation)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||
D3DMATRIX p_out, p_rotate, mat;
|
||||
|
||||
(void)chain_data;
|
||||
|
||||
d3d_matrix_ortho_off_center_lh(&mat, 0, vp_width, vp_height, 0, 0.0f, 1.0f);
|
||||
d3d_matrix_identity(&p_out);
|
||||
d3d_matrix_rotation_z(&p_rotate, rotation * (M_PI / 2.0));
|
||||
@ -67,7 +71,7 @@ static void d3d8_renderchain_clear(void *data)
|
||||
d3d_vertex_buffer_free(chain->vertex_buf, chain->vertex_decl);
|
||||
}
|
||||
|
||||
static bool renderchain_create_first_pass(void *data,
|
||||
static bool d3d8_renderchain_create_first_pass(void *data,
|
||||
const video_info_t *info)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
@ -106,7 +110,7 @@ static bool renderchain_create_first_pass(void *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void renderchain_set_vertices(void *data, unsigned pass,
|
||||
static void d3d8_renderchain_set_vertices(void *data, unsigned pass,
|
||||
unsigned vert_width, unsigned vert_height, uint64_t frame_count)
|
||||
{
|
||||
unsigned width, height;
|
||||
@ -171,7 +175,7 @@ static void renderchain_set_vertices(void *data, unsigned pass,
|
||||
}
|
||||
}
|
||||
|
||||
static void renderchain_blit_to_texture(void *data, const void *frame,
|
||||
static void d3d8_renderchain_blit_to_texture(void *data, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
@ -254,7 +258,7 @@ static bool d3d8_renderchain_init(void *data,
|
||||
chain->tex_w = link_info->tex_w;
|
||||
chain->tex_h = link_info->tex_h;
|
||||
|
||||
if (!renderchain_create_first_pass(d3d, video_info))
|
||||
if (!d3d8_renderchain_create_first_pass(d3d, video_info))
|
||||
return false;
|
||||
|
||||
/* FIXME */
|
||||
@ -283,17 +287,17 @@ static bool d3d8_renderchain_render(void *data, const void *frame,
|
||||
{
|
||||
unsigned i;
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||
settings_t *settings = config_get_ptr();
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||
settings_t *settings = config_get_ptr();
|
||||
d3d8_renderchain_t *chain = (d3d8_renderchain_t*)d3d->renderchain_data;
|
||||
|
||||
chain->frame_count++;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
renderchain_blit_to_texture(chain, frame, frame_width, frame_height, pitch);
|
||||
renderchain_set_vertices(d3d, 1, frame_width, frame_height, chain->frame_count);
|
||||
d3d8_renderchain_blit_to_texture(chain, frame, frame_width, frame_height, pitch);
|
||||
d3d8_renderchain_set_vertices(d3d, 1, frame_width, frame_height, chain->frame_count);
|
||||
|
||||
d3d_set_texture(d3dr, 0, chain->tex);
|
||||
d3d_set_viewports(chain->dev, &d3d->final_viewport);
|
||||
@ -307,7 +311,7 @@ static bool d3d8_renderchain_render(void *data, const void *frame,
|
||||
d3d_set_stream_source(d3dr, i, chain->vertex_buf, 0, sizeof(Vertex));
|
||||
|
||||
d3d_draw_primitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
renderchain_set_mvp(d3d, width, height, d3d->dev_rotation);
|
||||
d3d8_renderchain_set_mvp(chain, d3d, width, height, d3d->dev_rotation);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -365,7 +369,8 @@ static bool d3d8_renderchain_reinit(void *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void d3d8_renderchain_viewport_info(void *data, struct video_viewport *vp)
|
||||
static void d3d8_renderchain_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
@ -385,6 +390,7 @@ static void d3d8_renderchain_viewport_info(void *data, struct video_viewport *vp
|
||||
}
|
||||
|
||||
d3d_renderchain_driver_t d3d8_d3d_renderchain = {
|
||||
d3d8_renderchain_set_mvp,
|
||||
d3d8_renderchain_free,
|
||||
d3d8_renderchain_new,
|
||||
d3d8_renderchain_reinit,
|
||||
|
@ -1191,13 +1191,14 @@ static void d3d9_cg_renderchain_end_render(cg_renderchain_t *chain)
|
||||
}
|
||||
|
||||
static void d3d9_cg_renderchain_set_mvp(
|
||||
cg_renderchain_t *chain,
|
||||
void *vertex_program,
|
||||
void *chain_data,
|
||||
void *data,
|
||||
unsigned vp_width, unsigned vp_height,
|
||||
unsigned rotation)
|
||||
{
|
||||
D3DMATRIX proj, ortho, rot, tmp;
|
||||
CGprogram vPrg = (CGprogram)vertex_program;
|
||||
CGprogram vPrg = (CGprogram)data;
|
||||
cg_renderchain_t *chain = (cg_renderchain_t*)chain_data;
|
||||
|
||||
d3d_matrix_ortho_off_center_lh(&ortho, 0, vp_width, 0, vp_height, 0, 1);
|
||||
d3d_matrix_identity(&rot);
|
||||
@ -1686,6 +1687,7 @@ static void d3d9_cg_renderchain_viewport_info(
|
||||
}
|
||||
|
||||
d3d_renderchain_driver_t cg_d3d9_renderchain = {
|
||||
d3d9_cg_renderchain_set_mvp,
|
||||
d3d9_cg_renderchain_free,
|
||||
d3d9_cg_renderchain_new,
|
||||
NULL,
|
||||
|
@ -44,19 +44,22 @@ typedef struct hlsl_d3d9_renderchain
|
||||
/* TODO/FIXME - this forward declaration should not be necesary */
|
||||
void hlsl_set_proj_matrix(void *data, XMMATRIX rotation_value);
|
||||
|
||||
static void renderchain_set_mvp(void *data, unsigned vp_width,
|
||||
static void hlsl_d3d9_renderchain_set_mvp(
|
||||
void *chain_data,
|
||||
void *data, unsigned vp_width,
|
||||
unsigned vp_height, unsigned rotation)
|
||||
{
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||
|
||||
hlsl_set_proj_matrix((void*)&d3d->shader, XMMatrixRotationZ(rotation * (M_PI / 2.0)));
|
||||
hlsl_set_proj_matrix((void*)&d3d->shader,
|
||||
XMMatrixRotationZ(rotation * (M_PI / 2.0)));
|
||||
|
||||
mvp.data = d3d;
|
||||
mvp.matrix = NULL;
|
||||
|
||||
video_shader_driver_set_mvp(mvp);
|
||||
video_driver_set_mvp(&mvp);
|
||||
}
|
||||
|
||||
static void hlsl_d3d9_renderchain_clear(void *data)
|
||||
@ -87,7 +90,7 @@ static bool hlsl_d3d9_renderchain_init_shader_fvf(void *data, void *pass_data)
|
||||
VertexElements, (void**)&chain->vertex_decl);
|
||||
}
|
||||
|
||||
static bool renderchain_create_first_pass(void *data,
|
||||
static bool hlsl_d3d9_renderchain_create_first_pass(void *data,
|
||||
const video_info_t *info)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
@ -126,7 +129,8 @@ static bool renderchain_create_first_pass(void *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void renderchain_set_vertices(void *data, unsigned pass,
|
||||
static void hlsl_d3d9_renderchain_set_vertices(
|
||||
void *data, unsigned pass,
|
||||
unsigned vert_width, unsigned vert_height, uint64_t frame_count)
|
||||
{
|
||||
video_shader_ctx_params_t params;
|
||||
@ -187,7 +191,8 @@ static void renderchain_set_vertices(void *data, unsigned pass,
|
||||
d3d_vertex_buffer_unlock(chain->vertex_buf);
|
||||
}
|
||||
|
||||
renderchain_set_mvp(d3d, width, height, d3d->dev_rotation);
|
||||
hlsl_d3d9_renderchain_set_mvp(chain,
|
||||
d3d, width, height, d3d->dev_rotation);
|
||||
|
||||
shader_info.data = d3d;
|
||||
shader_info.idx = pass;
|
||||
@ -212,8 +217,9 @@ static void renderchain_set_vertices(void *data, unsigned pass,
|
||||
video_shader_driver_set_parameters(params);
|
||||
}
|
||||
|
||||
static void renderchain_blit_to_texture(void *data, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
static void hlsl_d3d9_renderchain_blit_to_texture(
|
||||
void *data, const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
hlsl_d3d9_renderchain_t *chain = (hlsl_d3d9_renderchain_t*)data;
|
||||
@ -261,7 +267,6 @@ static void hlsl_d3d9_renderchain_free(void *data)
|
||||
hlsl_d3d9_renderchain_clear(chain->renderchain_data);
|
||||
}
|
||||
|
||||
|
||||
void *hlsl_d3d9_renderchain_new(void)
|
||||
{
|
||||
hlsl_d3d9_renderchain_t *renderchain =
|
||||
@ -327,7 +332,7 @@ static bool hlsl_d3d9_renderchain_init(void *data,
|
||||
chain->tex_w = link_info->tex_w;
|
||||
chain->tex_h = link_info->tex_h;
|
||||
|
||||
if (!renderchain_create_first_pass(d3d, video_info))
|
||||
if (!hlsl_d3d9_renderchain_create_first_pass(d3d, video_info))
|
||||
return false;
|
||||
|
||||
/* FIXME */
|
||||
@ -366,8 +371,10 @@ static bool hlsl_d3d9_renderchain_render(void *data, const void *frame,
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
renderchain_blit_to_texture(chain, frame, frame_width, frame_height, pitch);
|
||||
renderchain_set_vertices(d3d, 1, frame_width, frame_height, chain->frame_count);
|
||||
hlsl_d3d9_renderchain_blit_to_texture(chain,
|
||||
frame, frame_width, frame_height, pitch);
|
||||
hlsl_d3d9_renderchain_set_vertices(d3d,
|
||||
1, frame_width, frame_height, chain->frame_count);
|
||||
|
||||
d3d_set_texture(d3dr, 0, chain->tex);
|
||||
d3d_set_viewports(chain->dev, &d3d->final_viewport);
|
||||
@ -381,12 +388,14 @@ static bool hlsl_d3d9_renderchain_render(void *data, const void *frame,
|
||||
d3d_set_stream_source(d3dr, i, chain->vertex_buf, 0, sizeof(Vertex));
|
||||
|
||||
d3d_draw_primitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
renderchain_set_mvp(d3d, width, height, d3d->dev_rotation);
|
||||
hlsl_d3d9_renderchain_set_mvp(
|
||||
chain, d3d, width, height, d3d->dev_rotation);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool hlsl_d3d9_renderchain_add_pass(void *data, const void *info_data)
|
||||
static bool hlsl_d3d9_renderchain_add_pass(
|
||||
void *data, const void *info_data)
|
||||
{
|
||||
(void)data;
|
||||
(void)info_data;
|
||||
@ -395,7 +404,8 @@ static bool hlsl_d3d9_renderchain_add_pass(void *data, const void *info_data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void hlsl_d3d9_renderchain_add_state_tracker(void *data, void *tracker_data)
|
||||
static void hlsl_d3d9_renderchain_add_state_tracker(
|
||||
void *data, void *tracker_data)
|
||||
{
|
||||
(void)data;
|
||||
(void)tracker_data;
|
||||
@ -441,7 +451,8 @@ static bool hlsl_d3d9_renderchain_reinit(void *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void hlsl_d3d9_renderchain_viewport_info(void *data, struct video_viewport *vp)
|
||||
static void hlsl_d3d9_renderchain_viewport_info(
|
||||
void *data, struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
@ -461,6 +472,7 @@ static void hlsl_d3d9_renderchain_viewport_info(void *data, struct video_viewpor
|
||||
}
|
||||
|
||||
d3d_renderchain_driver_t hlsl_d3d9_renderchain = {
|
||||
hlsl_d3d9_renderchain_set_mvp,
|
||||
hlsl_d3d9_renderchain_free,
|
||||
hlsl_d3d9_renderchain_new,
|
||||
hlsl_d3d9_renderchain_reinit,
|
||||
|
329
gfx/drivers_renderchain/gl1_renderchain.c
Normal file
329
gfx/drivers_renderchain/gl1_renderchain.c
Normal file
@ -0,0 +1,329 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "opengl32")
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <retro_common_api.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <gfx/scaler/scaler.h>
|
||||
#include <formats/image.h>
|
||||
#include <retro_inline.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <retro_math.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include <gfx/gl_capabilities.h>
|
||||
#include <gfx/video_frame.h>
|
||||
|
||||
#include "../video_driver.h"
|
||||
#include "../video_shader_parse.h"
|
||||
#include "../common/gl_common.h"
|
||||
|
||||
#include "../../driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
typedef struct gl1_renderchain
|
||||
{
|
||||
void *empty;
|
||||
} gl1_renderchain_t;
|
||||
|
||||
GLenum min_filter_to_mag(GLenum type);
|
||||
|
||||
void gl1_renderchain_free(void *data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
(void)gl;
|
||||
}
|
||||
|
||||
static void gl1_renderchain_bind_prev_texture(
|
||||
void *data,
|
||||
const struct video_tex_info *tex_info)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
memmove(gl->prev_info + 1, gl->prev_info,
|
||||
sizeof(*tex_info) * (gl->textures - 1));
|
||||
memcpy(&gl->prev_info[0], tex_info,
|
||||
sizeof(*tex_info));
|
||||
}
|
||||
|
||||
static void gl1_renderchain_viewport_info(
|
||||
void *data, struct video_viewport *vp)
|
||||
{
|
||||
unsigned width, height;
|
||||
unsigned top_y, top_dist;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
*vp = gl->vp;
|
||||
vp->full_width = width;
|
||||
vp->full_height = height;
|
||||
|
||||
/* Adjust as GL viewport is bottom-up. */
|
||||
top_y = vp->y + vp->height;
|
||||
top_dist = height - top_y;
|
||||
vp->y = top_dist;
|
||||
}
|
||||
|
||||
static bool gl1_renderchain_read_viewport(
|
||||
void *data, uint8_t *buffer, bool is_idle)
|
||||
{
|
||||
unsigned num_pixels = 0;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
num_pixels = gl->vp.width * gl->vp.height;
|
||||
|
||||
/* Use slow synchronous readbacks. Use this with plain screenshots
|
||||
as we don't really care about performance in this case. */
|
||||
|
||||
/* GLES2 only guarantees GL_RGBA/GL_UNSIGNED_BYTE
|
||||
* readbacks so do just that.
|
||||
* GLES2 also doesn't support reading back data
|
||||
* from front buffer, so render a cached frame
|
||||
* and have gl_frame() do the readback while it's
|
||||
* in the back buffer.
|
||||
*
|
||||
* Keep codepath similar for GLES and desktop GL.
|
||||
*/
|
||||
gl->readback_buffer_screenshot = malloc(num_pixels * sizeof(uint32_t));
|
||||
|
||||
if (!gl->readback_buffer_screenshot)
|
||||
return false;
|
||||
|
||||
if (!is_idle)
|
||||
video_driver_cached_frame();
|
||||
|
||||
video_frame_convert_rgba_to_bgr(
|
||||
(const void*)gl->readback_buffer_screenshot,
|
||||
buffer,
|
||||
num_pixels);
|
||||
|
||||
free(gl->readback_buffer_screenshot);
|
||||
gl->readback_buffer_screenshot = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void gl1_renderchain_free_internal(void *data)
|
||||
{
|
||||
gl1_renderchain_t *cg_data = (gl1_renderchain_t*)data;
|
||||
|
||||
if (!cg_data)
|
||||
return;
|
||||
|
||||
free(cg_data);
|
||||
}
|
||||
|
||||
static void *gl1_renderchain_new(void)
|
||||
{
|
||||
gl1_renderchain_t *renderchain = (gl1_renderchain_t*)
|
||||
calloc(1, sizeof(*renderchain));
|
||||
if (!renderchain)
|
||||
return NULL;
|
||||
|
||||
return renderchain;
|
||||
}
|
||||
|
||||
static void gl1_renderchain_ff_vertex(const void *data)
|
||||
{
|
||||
const struct video_coords *coords = (const struct video_coords*)data;
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_ff_matrix(const void *data)
|
||||
{
|
||||
math_matrix_4x4 ident;
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)data;
|
||||
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadMatrixf(mat->data);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
matrix_4x4_identity(ident);
|
||||
glLoadMatrixf(ident.data);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_disable_client_arrays(void)
|
||||
{
|
||||
if (gl_query_core_context_in_use())
|
||||
return;
|
||||
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_restore_default_state(void *data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl)
|
||||
return;
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DITHER);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_copy_frame(
|
||||
void *data,
|
||||
video_frame_info_t *video_info,
|
||||
const void *frame,
|
||||
unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
const GLvoid *data_buf = frame;
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, video_pixel_get_alignment(pitch));
|
||||
|
||||
if (gl->base_size == 2 && !gl->have_es2_compat)
|
||||
{
|
||||
/* Convert to 32-bit textures on desktop GL.
|
||||
*
|
||||
* It is *much* faster (order of magnitude on my setup)
|
||||
* to use a custom SIMD-optimized conversion routine
|
||||
* than letting GL do it. */
|
||||
video_frame_convert_rgb16_to_rgb32(
|
||||
&gl->scaler,
|
||||
gl->conv_buffer,
|
||||
frame,
|
||||
width,
|
||||
height,
|
||||
pitch);
|
||||
data_buf = gl->conv_buffer;
|
||||
}
|
||||
else
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch / gl->base_size);
|
||||
|
||||
glTexSubImage2D(GL_TEXTURE_2D,
|
||||
0, 0, 0, width, height, gl->texture_type,
|
||||
gl->texture_fmt, data_buf);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_readback(void *data,
|
||||
unsigned alignment,
|
||||
unsigned fmt, unsigned type,
|
||||
void *src)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, alignment);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
glReadBuffer(GL_BACK);
|
||||
|
||||
glReadPixels(gl->vp.x, gl->vp.y,
|
||||
gl->vp.width, gl->vp.height,
|
||||
(GLenum)fmt, (GLenum)type, (GLvoid*)src);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_set_mvp(void *data,
|
||||
void *shader_data, const void *mat_data)
|
||||
{
|
||||
math_matrix_4x4 ident;
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)mat_data;
|
||||
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadMatrixf(mat->data);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
matrix_4x4_identity(ident);
|
||||
glLoadMatrixf(ident.data);
|
||||
}
|
||||
|
||||
static void gl1_renderchain_set_coords(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
gl_renderchain_driver_t gl2_renderchain = {
|
||||
gl1_renderchain_set_coords,
|
||||
gl1_renderchain_set_mvp,
|
||||
NULL, /* init_textures_reference */
|
||||
NULL, /* fence_iterate */
|
||||
NULL, /* fence_free */
|
||||
gl1_renderchain_readback,
|
||||
NULL, /* renderchain_init_pbo */
|
||||
NULL, /* renderchain_bind_pbo */
|
||||
NULL, /* renderchain_unbind_pbo */
|
||||
gl1_renderchain_copy_frame,
|
||||
gl1_renderchain_restore_default_state,
|
||||
NULL, /* new_vao */
|
||||
NULL, /* free_vao */
|
||||
NULL, /* bind_vao */
|
||||
NULL, /* unbind_vao */
|
||||
gl1_renderchain_disable_client_arrays, /* disable_client_arrays */
|
||||
gl1_renderchain_ff_vertex, /* ff_vertex */
|
||||
gl1_renderchain_ff_matrix,
|
||||
NULL, /* bind_backbuffer */
|
||||
NULL, /* deinit_fbo */
|
||||
gl1_renderchain_viewport_info,
|
||||
gl1_renderchain_read_viewport,
|
||||
gl1_renderchain_bind_prev_texture,
|
||||
gl1_renderchain_free_internal,
|
||||
gl1_renderchain_new,
|
||||
NULL, /* renderchain_init */
|
||||
NULL, /* init_hw_render */
|
||||
gl1_renderchain_free,
|
||||
NULL, /* deinit_hw_render */
|
||||
NULL, /* start_render */
|
||||
NULL, /* check_fbo_dimensions */
|
||||
NULL, /* recompute_pass_sizes */
|
||||
NULL, /* renderchain_render */
|
||||
"gl1",
|
||||
};
|
@ -50,10 +50,6 @@
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
#include "../common/win32_common.h"
|
||||
#endif
|
||||
|
||||
typedef struct gl2_renderchain
|
||||
{
|
||||
void *empty;
|
||||
@ -251,7 +247,6 @@ static void gl2_renderchain_render(
|
||||
const struct video_tex_info *feedback_info)
|
||||
{
|
||||
int i;
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
video_shader_ctx_coords_t coords;
|
||||
video_shader_ctx_params_t params;
|
||||
video_shader_ctx_info_t shader_info;
|
||||
@ -274,7 +269,6 @@ static void gl2_renderchain_render(
|
||||
* and render all passes from FBOs, to another FBO. */
|
||||
for (i = 1; i < gl->fbo_pass; i++)
|
||||
{
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
video_shader_ctx_coords_t coords;
|
||||
video_shader_ctx_params_t params;
|
||||
const struct video_fbo_rect *rect = &gl->fbo_rect[i];
|
||||
@ -337,12 +331,10 @@ static void gl2_renderchain_render(
|
||||
coords.handle_data = NULL;
|
||||
coords.data = &gl->coords;
|
||||
|
||||
video_shader_driver_set_coords(coords);
|
||||
video_driver_set_coords(&coords);
|
||||
|
||||
mvp.data = gl;
|
||||
mvp.matrix = &gl->mvp;
|
||||
|
||||
video_shader_driver_set_mvp(mvp);
|
||||
video_info->cb_set_mvp(gl,
|
||||
video_info->shader_data, &gl->mvp);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
@ -414,12 +406,11 @@ static void gl2_renderchain_render(
|
||||
coords.handle_data = NULL;
|
||||
coords.data = &gl->coords;
|
||||
|
||||
video_shader_driver_set_coords(coords);
|
||||
video_driver_set_coords(&coords);
|
||||
|
||||
mvp.data = gl;
|
||||
mvp.matrix = &gl->mvp;
|
||||
video_info->cb_set_mvp(gl,
|
||||
video_info->shader_data, &gl->mvp);
|
||||
|
||||
video_shader_driver_set_mvp(mvp);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
gl->coords.tex_coord = gl->tex_info.coord;
|
||||
@ -428,8 +419,6 @@ static void gl2_renderchain_render(
|
||||
static void gl2_renderchain_deinit_fbo(void *data)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if (!gl->fbo_inited)
|
||||
return;
|
||||
|
||||
glDeleteTextures(gl->fbo_pass, gl->fbo_texture);
|
||||
glDeleteFramebuffers(gl->fbo_pass, gl->fbo);
|
||||
@ -526,23 +515,19 @@ error:
|
||||
|
||||
static void gl_create_fbo_texture(gl_t *gl, unsigned i, GLuint texture)
|
||||
{
|
||||
unsigned mip_level;
|
||||
GLenum min_filter, mag_filter, wrap_enum;
|
||||
GLenum mag_filter, wrap_enum;
|
||||
video_shader_ctx_filter_t filter_type;
|
||||
video_shader_ctx_wrap_t wrap = {0};
|
||||
bool fp_fbo = false;
|
||||
bool mipmapped = false;
|
||||
bool smooth = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
GLuint base_filt = settings->bools.video_smooth ? GL_LINEAR : GL_NEAREST;
|
||||
GLuint base_mip_filt = settings->bools.video_smooth ?
|
||||
GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST;
|
||||
unsigned mip_level = i + 2;
|
||||
bool mipmapped = video_shader_driver_mipmap_input(&mip_level);
|
||||
GLenum min_filter = mipmapped ? base_mip_filt : base_filt;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
mip_level = i + 2;
|
||||
mipmapped = video_shader_driver_mipmap_input(&mip_level);
|
||||
min_filter = mipmapped ? base_mip_filt : base_filt;
|
||||
filter_type.index = i + 2;
|
||||
filter_type.smooth = &smooth;
|
||||
|
||||
@ -560,10 +545,7 @@ static void gl_create_fbo_texture(gl_t *gl, unsigned i, GLuint texture)
|
||||
|
||||
wrap_enum = gl_wrap_type_to_enum(wrap.type);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_enum);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_enum);
|
||||
gl_bind_texture(texture, wrap_enum, mag_filter, min_filter);
|
||||
|
||||
fp_fbo = gl->fbo_scale[i].fp_fbo;
|
||||
|
||||
@ -785,7 +767,7 @@ void gl2_renderchain_init(
|
||||
if (shader_info.num == 1 && !scale.valid)
|
||||
return;
|
||||
|
||||
if (!gl_check_capability(GL_CAPS_FBO))
|
||||
if (!gl->has_fbo)
|
||||
{
|
||||
RARCH_ERR("[GL]: Failed to locate FBO functions. Won't be able to use render-to-texture.\n");
|
||||
return;
|
||||
@ -884,7 +866,7 @@ static bool gl2_renderchain_init_hw_render(
|
||||
RARCH_LOG("[GL]: Max texture size: %d px, renderbuffer size: %d px.\n",
|
||||
max_fbo_size, max_renderbuffer_size);
|
||||
|
||||
if (!gl_check_capability(GL_CAPS_FBO))
|
||||
if (!gl->has_fbo)
|
||||
return false;
|
||||
|
||||
RARCH_LOG("[GL]: Supports FBO (render-to-texture).\n");
|
||||
@ -1121,54 +1103,6 @@ static void *gl2_renderchain_new(void)
|
||||
return renderchain;
|
||||
}
|
||||
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
static void gl2_renderchain_ff_vertex(const void *data)
|
||||
{
|
||||
const struct video_coords *coords = (const struct video_coords*)data;
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
static void gl2_renderchain_ff_matrix(const void *data)
|
||||
{
|
||||
math_matrix_4x4 ident;
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)data;
|
||||
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadMatrixf(mat->data);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
matrix_4x4_identity(ident);
|
||||
glLoadMatrixf(ident.data);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
static void gl2_renderchain_disable_client_arrays(void)
|
||||
{
|
||||
if (gl_query_core_context_in_use())
|
||||
return;
|
||||
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_OPENGLES
|
||||
static void gl2_renderchain_bind_vao(void *data)
|
||||
{
|
||||
@ -1355,28 +1289,24 @@ static void gl2_renderchain_copy_frame(
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(HAVE_OPENGLES2) && !defined(HAVE_PSGL)
|
||||
static void gl2_renderchain_bind_pbo(unsigned idx)
|
||||
{
|
||||
#ifndef HAVE_OPENGLES2
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, (GLuint)idx);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl2_renderchain_unbind_pbo(void)
|
||||
{
|
||||
#ifndef HAVE_OPENGLES2
|
||||
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gl2_renderchain_init_pbo(unsigned size,
|
||||
const void *data)
|
||||
{
|
||||
#ifndef HAVE_OPENGLES2
|
||||
glBufferData(GL_PIXEL_PACK_BUFFER, size,
|
||||
(const GLvoid*)data, GL_STREAM_READ);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gl2_renderchain_readback(void *data,
|
||||
unsigned alignment,
|
||||
@ -1459,6 +1389,8 @@ static void gl2_renderchain_init_textures_reference(
|
||||
}
|
||||
|
||||
gl_renderchain_driver_t gl2_renderchain = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
gl2_renderchain_init_textures_reference,
|
||||
#ifdef HAVE_OPENGLES
|
||||
NULL,
|
||||
@ -1468,9 +1400,15 @@ gl_renderchain_driver_t gl2_renderchain = {
|
||||
gl2_renderchain_fence_free,
|
||||
#endif
|
||||
gl2_renderchain_readback,
|
||||
#if !defined(HAVE_OPENGLES2) && !defined(HAVE_PSGL)
|
||||
gl2_renderchain_init_pbo,
|
||||
gl2_renderchain_bind_pbo,
|
||||
gl2_renderchain_unbind_pbo,
|
||||
#else
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#endif
|
||||
gl2_renderchain_copy_frame,
|
||||
gl2_renderchain_restore_default_state,
|
||||
#ifdef HAVE_OPENGLES
|
||||
@ -1484,18 +1422,9 @@ gl_renderchain_driver_t gl2_renderchain = {
|
||||
gl2_renderchain_bind_vao,
|
||||
gl2_renderchain_unbind_vao,
|
||||
#endif
|
||||
#ifdef NO_GL_FF_VERTEX
|
||||
NULL,
|
||||
NULL,
|
||||
#else
|
||||
gl2_renderchain_disable_client_arrays,
|
||||
gl2_renderchain_ff_vertex,
|
||||
#endif
|
||||
#ifdef NO_GL_FF_MATRIX
|
||||
NULL,
|
||||
#else
|
||||
gl2_renderchain_ff_matrix,
|
||||
#endif
|
||||
gl2_renderchain_bind_backbuffer,
|
||||
gl2_renderchain_deinit_fbo,
|
||||
gl2_renderchain_viewport_info,
|
||||
|
@ -118,7 +118,8 @@ static void null_renderchain_convert_geometry(
|
||||
(void)final_viewport_data;
|
||||
}
|
||||
|
||||
d3d_renderchain_driver_t null_renderchain = {
|
||||
d3d_renderchain_driver_t null_d3d_renderchain = {
|
||||
NULL,
|
||||
null_renderchain_free,
|
||||
null_renderchain_new,
|
||||
NULL,
|
||||
|
@ -253,17 +253,18 @@ static void gl_cg_reset_attrib(void *data)
|
||||
cg->attribs_index = 0;
|
||||
}
|
||||
|
||||
static bool gl_cg_set_mvp(void *data, void *shader_data, const math_matrix_4x4 *mat)
|
||||
static bool gl_cg_set_mvp(void *data, void *shader_data,
|
||||
const void *mat_data)
|
||||
{
|
||||
cg_shader_data_t *cg = (cg_shader_data_t*)shader_data;
|
||||
if (!cg || !cg->prg[cg->active_idx].mvp)
|
||||
if (cg && cg->prg[cg->active_idx].mvp)
|
||||
{
|
||||
gl_ff_matrix(mat);
|
||||
return false;
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)mat_data;
|
||||
cgGLSetMatrixParameterfc(cg->prg[cg->active_idx].mvp, mat->data);
|
||||
return true;
|
||||
}
|
||||
|
||||
cgGLSetMatrixParameterfc(cg->prg[cg->active_idx].mvp, mat->data);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool gl_cg_set_coords(void *handle_data, void *shader_data, const struct video_coords *coords)
|
||||
@ -292,12 +293,6 @@ static bool gl_cg_set_coords(void *handle_data, void *shader_data, const struct
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gl_cg_set_coords_fallback(void *handle_data, void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
gl_ff_vertex(coords);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gl_cg_set_texture_info(
|
||||
cg_shader_data_t *cg,
|
||||
const struct cg_fbo_params *params,
|
||||
@ -1295,7 +1290,6 @@ const shader_backend_t gl_cg_backend = {
|
||||
gl_cg_wrap_type,
|
||||
gl_cg_shader_scale,
|
||||
gl_cg_set_coords,
|
||||
gl_cg_set_coords_fallback,
|
||||
gl_cg_set_mvp,
|
||||
gl_cg_get_prev_textures,
|
||||
gl_cg_get_feedback_pass,
|
||||
|
@ -129,6 +129,7 @@ static const char *glsl_prefixes[] = {
|
||||
#include "../drivers/gl_shaders/modern_pipeline_xmb_ribbon.glsl.vert.h"
|
||||
#include "../drivers/gl_shaders/pipeline_xmb_ribbon.glsl.frag.h"
|
||||
#include "../drivers/gl_shaders/pipeline_bokeh.glsl.frag.h"
|
||||
#include "../drivers/gl_shaders/pipeline_snowflake.glsl.frag.h"
|
||||
#endif
|
||||
|
||||
typedef struct glsl_shader_data
|
||||
@ -137,7 +138,10 @@ typedef struct glsl_shader_data
|
||||
GLint attribs_elems[32 * PREV_TEXTURES + 2 + 4 + GFX_MAX_SHADERS];
|
||||
unsigned attribs_index;
|
||||
unsigned active_idx;
|
||||
unsigned current_idx;
|
||||
GLuint lut_textures[GFX_MAX_TEXTURES];
|
||||
float current_mat_data[GFX_MAX_SHADERS];
|
||||
float* current_mat_data_pointer[GFX_MAX_SHADERS];
|
||||
struct shader_uniforms uniforms[GFX_MAX_SHADERS];
|
||||
struct cache_vbo vbo[GFX_MAX_SHADERS];
|
||||
struct shader_program_glsl_data prg[GFX_MAX_SHADERS];
|
||||
@ -148,9 +152,6 @@ typedef struct glsl_shader_data
|
||||
static bool glsl_core;
|
||||
static unsigned glsl_major;
|
||||
static unsigned glsl_minor;
|
||||
static float* current_mat_data_pointer[GFX_MAX_SHADERS];
|
||||
static float current_mat_data[GFX_MAX_SHADERS];
|
||||
static unsigned current_idx;
|
||||
|
||||
static bool gl_glsl_add_lut(
|
||||
const struct video_shader *shader,
|
||||
@ -735,8 +736,10 @@ static void gl_glsl_destroy_resources(glsl_shader_data_t *glsl)
|
||||
if (!glsl)
|
||||
return;
|
||||
|
||||
current_idx = 0;
|
||||
glsl->current_idx = 0;
|
||||
|
||||
glUseProgram(0);
|
||||
|
||||
for (i = 0; i < GFX_MAX_SHADERS; i++)
|
||||
{
|
||||
if (glsl->prg[i].id == 0 || (i && glsl->prg[i].id == glsl->prg[0].id))
|
||||
@ -1093,6 +1096,21 @@ static void *gl_glsl_init(void *data, const char *path)
|
||||
&shader_prog_info);
|
||||
gl_glsl_find_uniforms(glsl, 0, glsl->prg[VIDEO_SHADER_MENU_5].id,
|
||||
&glsl->uniforms[VIDEO_SHADER_MENU_5]);
|
||||
|
||||
#if defined(HAVE_OPENGLES)
|
||||
shader_prog_info.vertex = stock_vertex_xmb_snow_modern;
|
||||
#else
|
||||
shader_prog_info.vertex = glsl_core ? stock_vertex_xmb_snow_modern : stock_vertex_xmb_snow_legacy;
|
||||
#endif
|
||||
shader_prog_info.fragment = stock_fragment_xmb_snowflake;
|
||||
|
||||
gl_glsl_compile_program(
|
||||
glsl,
|
||||
VIDEO_SHADER_MENU_6,
|
||||
&glsl->prg[VIDEO_SHADER_MENU_6],
|
||||
&shader_prog_info);
|
||||
gl_glsl_find_uniforms(glsl, 0, glsl->prg[VIDEO_SHADER_MENU_6].id,
|
||||
&glsl->uniforms[VIDEO_SHADER_MENU_6]);
|
||||
#endif
|
||||
|
||||
gl_glsl_reset_attrib(glsl);
|
||||
@ -1432,30 +1450,29 @@ static void gl_glsl_set_params(void *data, void *shader_data,
|
||||
}
|
||||
}
|
||||
|
||||
static bool gl_glsl_set_mvp(void *data, void *shader_data, const math_matrix_4x4 *mat)
|
||||
static bool gl_glsl_set_mvp(void *data, void *shader_data, const void *mat_data)
|
||||
{
|
||||
int loc;
|
||||
glsl_shader_data_t *glsl = (glsl_shader_data_t*)shader_data;
|
||||
glsl_shader_data_t *glsl = (glsl_shader_data_t*)shader_data;
|
||||
|
||||
(void)data;
|
||||
|
||||
if (!glsl || !glsl->shader->modern)
|
||||
{
|
||||
gl_ff_matrix(mat);
|
||||
return false;
|
||||
}
|
||||
|
||||
loc = glsl->uniforms[glsl->active_idx].mvp;
|
||||
if (loc >= 0)
|
||||
{
|
||||
if ( (current_idx != glsl->active_idx) ||
|
||||
(mat->data != current_mat_data_pointer[glsl->active_idx]) ||
|
||||
(*mat->data != current_mat_data[glsl->active_idx]))
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)mat_data;
|
||||
|
||||
if ( (glsl->current_idx != glsl->active_idx) ||
|
||||
(mat->data != glsl->current_mat_data_pointer[glsl->active_idx]) ||
|
||||
(*mat->data != glsl->current_mat_data[glsl->active_idx]))
|
||||
{
|
||||
glUniformMatrix4fv(loc, 1, GL_FALSE, mat->data);
|
||||
current_idx = glsl->active_idx;
|
||||
current_mat_data_pointer[glsl->active_idx] = (float*)mat->data;
|
||||
current_mat_data[glsl->active_idx] = *mat->data;
|
||||
glsl->current_idx = glsl->active_idx;
|
||||
glsl->current_mat_data_pointer[glsl->active_idx] = (float*)mat->data;
|
||||
glsl->current_mat_data[glsl->active_idx] = *mat->data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1550,13 +1567,6 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gl_glsl_set_coords_fallback(void *handle_data, void *shader_data,
|
||||
const struct video_coords *coords)
|
||||
{
|
||||
gl_ff_vertex(coords);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gl_glsl_use(void *data, void *shader_data, unsigned idx, bool set_active)
|
||||
{
|
||||
GLuint id;
|
||||
@ -1683,7 +1693,6 @@ const shader_backend_t gl_glsl_backend = {
|
||||
gl_glsl_wrap_type,
|
||||
gl_glsl_shader_scale,
|
||||
gl_glsl_set_coords,
|
||||
gl_glsl_set_coords_fallback,
|
||||
gl_glsl_set_mvp,
|
||||
gl_glsl_get_prev_textures,
|
||||
gl_glsl_get_feedback_pass,
|
||||
|
@ -497,11 +497,12 @@ static void hlsl_shader_scale(void *data, unsigned idx, struct gfx_fbo_scale *sc
|
||||
scale->valid = false;
|
||||
}
|
||||
|
||||
static bool hlsl_set_mvp(void *data, void *shader_data, const math_matrix_4x4 *mat)
|
||||
static bool hlsl_set_mvp(void *data, void *shader_data, const void *mat_data)
|
||||
{
|
||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||
hlsl_shader_data_t *hlsl_data = (hlsl_shader_data_t*)shader_data;
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)mat_data;
|
||||
|
||||
if(hlsl_data && hlsl_data->prg[hlsl_data->active_idx].mvp)
|
||||
{
|
||||
@ -542,7 +543,6 @@ const shader_backend_t hlsl_backend = {
|
||||
NULL, /* hlsl_wrap_type */
|
||||
hlsl_shader_scale,
|
||||
NULL, /* hlsl_set_coords */
|
||||
NULL, /* hlsl_set_coords_fallback */
|
||||
hlsl_set_mvp,
|
||||
NULL, /* hlsl_get_prev_textures */
|
||||
hlsl_get_feedback_pass,
|
||||
|
@ -88,7 +88,6 @@ const shader_backend_t shader_null_backend = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
shader_null_get_prev_textures,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -452,13 +452,15 @@ void font_driver_bind_block(void *font_data, void *block)
|
||||
font->renderer->bind_block(font->renderer_data, block);
|
||||
}
|
||||
|
||||
void font_driver_flush(unsigned width, unsigned height, void *font_data)
|
||||
void font_driver_flush(unsigned width, unsigned height, void *font_data,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
font_data_t *font = (font_data_t*)(font_data ? font_data : video_font_driver);
|
||||
if (font && font->renderer && font->renderer->flush)
|
||||
font->renderer->flush(width, height, font->renderer_data);
|
||||
font->renderer->flush(width, height, font->renderer_data, video_info);
|
||||
}
|
||||
|
||||
|
||||
int font_driver_get_message_width(void *font_data,
|
||||
const char *msg, unsigned len, float scale)
|
||||
{
|
||||
|
@ -113,7 +113,8 @@ typedef struct font_renderer
|
||||
|
||||
const struct font_glyph *(*get_glyph)(void *data, uint32_t code);
|
||||
void (*bind_block)(void *data, void *block);
|
||||
void (*flush)(unsigned width, unsigned height, void *data);
|
||||
void (*flush)(unsigned width, unsigned height, void *data,
|
||||
video_frame_info_t *video_info);
|
||||
|
||||
int (*get_message_width)(void *data, const char *msg, unsigned msg_len_full, float scale);
|
||||
} font_renderer_t;
|
||||
@ -154,7 +155,8 @@ void font_driver_bind_block(void *font_data, void *block);
|
||||
|
||||
int font_driver_get_message_width(void *font_data, const char *msg, unsigned len, float scale);
|
||||
|
||||
void font_driver_flush(unsigned width, unsigned height, void *font_data);
|
||||
void font_driver_flush(unsigned width, unsigned height, void *font_data,
|
||||
video_frame_info_t *video_info);
|
||||
|
||||
void font_driver_free(void *font_data);
|
||||
|
||||
|
@ -127,7 +127,7 @@ typedef struct video_pixel_scaler
|
||||
static void (*video_driver_cb_shader_use)(void *data,
|
||||
void *shader_data, unsigned index, bool set_active);
|
||||
static bool (*video_driver_cb_shader_set_mvp)(void *data,
|
||||
void *shader_data, const math_matrix_4x4 *mat);
|
||||
void *shader_data, const void *mat_data);
|
||||
bool (*video_driver_cb_has_focus)(void);
|
||||
|
||||
/* Opaque handles to currently running window.
|
||||
@ -417,12 +417,12 @@ static const d3d_renderchain_driver_t *renderchain_d3d_drivers[] = {
|
||||
#if defined(_WIN32) && defined(HAVE_D3D8)
|
||||
&d3d8_renderchain,
|
||||
#endif
|
||||
&null_renderchain,
|
||||
&null_d3d_renderchain,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const gl_renderchain_driver_t *renderchain_gl_drivers[] = {
|
||||
#if defined(HAVE_OPENGL)
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
&gl2_renderchain,
|
||||
#endif
|
||||
NULL
|
||||
@ -497,10 +497,12 @@ const char* config_get_video_driver_options(void)
|
||||
return char_list_new_special(STRING_LIST_VIDEO_DRIVERS, NULL);
|
||||
}
|
||||
|
||||
#ifdef HAVE_VULKAN
|
||||
static bool hw_render_context_is_vulkan(enum retro_hw_context_type type)
|
||||
{
|
||||
return type == RETRO_HW_CONTEXT_VULKAN;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool hw_render_context_is_gl(enum retro_hw_context_type type)
|
||||
{
|
||||
@ -1796,21 +1798,21 @@ bool video_driver_find_driver(void)
|
||||
|
||||
current_video = NULL;
|
||||
|
||||
#if defined(HAVE_VULKAN)
|
||||
if (hwr && hw_render_context_is_vulkan(hwr->context_type))
|
||||
{
|
||||
#if defined(HAVE_VULKAN)
|
||||
RARCH_LOG("[Video]: Using HW render, Vulkan driver forced.\n");
|
||||
current_video = &video_vulkan;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGL)
|
||||
if (hwr && hw_render_context_is_gl(hwr->context_type))
|
||||
{
|
||||
#if defined(HAVE_OPENGL) && defined(HAVE_FBO)
|
||||
RARCH_LOG("[Video]: Using HW render, OpenGL driver forced.\n");
|
||||
current_video = &video_gl;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (current_video)
|
||||
return true;
|
||||
@ -2310,7 +2312,7 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
|
||||
snprintf(frames_text,
|
||||
sizeof(frames_text),
|
||||
STRING_REP_UINT64,
|
||||
"%" PRIu64,
|
||||
(uint64_t)video_driver_frame_count);
|
||||
|
||||
strlcat(video_driver_window_title,
|
||||
@ -2328,7 +2330,7 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
snprintf(
|
||||
video_info.fps_text,
|
||||
sizeof(video_info.fps_text),
|
||||
"FPS: %6.1f || %s: " STRING_REP_UINT64,
|
||||
"FPS: %6.1f || %s: %" PRIu64,
|
||||
last_fps,
|
||||
msg_hash_to_str(MSG_FRAMES),
|
||||
(uint64_t)video_driver_frame_count);
|
||||
@ -2407,8 +2409,9 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
|
||||
video_driver_frame_count++;
|
||||
|
||||
/* Display the FPS, with a higher priority. */
|
||||
if (video_info.fps_show)
|
||||
runloop_msg_queue_push(video_info.fps_text, 1, 1, false);
|
||||
runloop_msg_queue_push(video_info.fps_text, 2, 1, true);
|
||||
}
|
||||
|
||||
void video_driver_display_type_set(enum rarch_display_type type)
|
||||
@ -2473,6 +2476,17 @@ static void video_shader_driver_use_null(void *data,
|
||||
(void)set_active;
|
||||
}
|
||||
|
||||
static bool video_driver_cb_set_coords(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
video_shader_ctx_coords_t ctx_coords;
|
||||
ctx_coords.handle_data = handle_data;
|
||||
ctx_coords.data = coords;
|
||||
|
||||
video_driver_set_coords(&ctx_coords);
|
||||
return true;
|
||||
}
|
||||
|
||||
void video_driver_build_info(video_frame_info_t *video_info)
|
||||
{
|
||||
bool is_perfcnt_enable = false;
|
||||
@ -2579,7 +2593,11 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->cb_set_resize = current_video_context.set_resize;
|
||||
|
||||
video_info->cb_shader_use = video_driver_cb_shader_use;
|
||||
video_info->cb_shader_set_mvp = video_driver_cb_shader_set_mvp;
|
||||
video_info->cb_set_mvp = video_driver_cb_shader_set_mvp;
|
||||
|
||||
#if 0
|
||||
video_info->cb_set_coords = video_driver_cb_set_coords;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
video_driver_threaded_unlock(is_threaded);
|
||||
@ -3195,39 +3213,16 @@ static enum gfx_wrap_type video_shader_driver_wrap_type_null(
|
||||
return RARCH_WRAP_BORDER;
|
||||
}
|
||||
|
||||
static bool video_shader_driver_set_mvp_null(void *data,
|
||||
void *shader_data, const math_matrix_4x4 *mat)
|
||||
static bool video_driver_cb_set_mvp(void *data,
|
||||
void *shader_data, const void *mat_data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
video_shader_ctx_mvp_t mvp;
|
||||
mvp.data = data;
|
||||
mvp.matrix = mat_data;
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
static bool video_shader_driver_set_mvp_null_gl(void *data,
|
||||
void *shader_data, const math_matrix_4x4 *mat)
|
||||
{
|
||||
gl_ff_matrix(mat);
|
||||
return false;
|
||||
video_driver_set_mvp(&mvp);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static bool video_shader_driver_set_coords_null(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
static bool video_shader_driver_set_coords_null_gl(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords)
|
||||
{
|
||||
gl_ff_vertex(coords);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static struct video_shader *video_shader_driver_get_current_shader_null(void *data)
|
||||
{
|
||||
@ -3286,32 +3281,12 @@ static void video_shader_driver_reset_to_defaults(void)
|
||||
video_driver_cb_shader_set_mvp = current_shader->set_mvp;
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_OPENGL
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
if (string_is_equal_fast(video_driver_get_ident(), "gl", 2))
|
||||
{
|
||||
current_shader->set_mvp = video_shader_driver_set_mvp_null_gl;
|
||||
video_driver_cb_shader_set_mvp = video_shader_driver_set_mvp_null_gl;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
current_shader->set_mvp = video_shader_driver_set_mvp_null;
|
||||
video_driver_cb_shader_set_mvp = video_shader_driver_set_mvp_null;
|
||||
}
|
||||
current_shader->set_mvp = video_driver_cb_set_mvp;
|
||||
video_driver_cb_shader_set_mvp = video_driver_cb_set_mvp;
|
||||
}
|
||||
if (!current_shader->set_coords)
|
||||
{
|
||||
#ifdef HAVE_OPENGL
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
if (string_is_equal_fast(video_driver_get_ident(), "gl", 2))
|
||||
current_shader->set_coords = video_shader_driver_set_coords_null_gl;
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
current_shader->set_coords = video_shader_driver_set_coords_null;
|
||||
}
|
||||
current_shader->set_coords = video_driver_cb_set_coords;
|
||||
|
||||
if (current_shader->use)
|
||||
video_driver_cb_shader_use = current_shader->use;
|
||||
else
|
||||
@ -3400,14 +3375,19 @@ bool video_shader_driver_info(video_shader_ctx_info_t *shader_info)
|
||||
|
||||
bool video_shader_driver_filter_type(video_shader_ctx_filter_t *filter)
|
||||
{
|
||||
return (filter) ? current_shader->filter_type(shader_data,
|
||||
filter->index, filter->smooth) : false;
|
||||
if (filter)
|
||||
return current_shader->filter_type(shader_data,
|
||||
filter->index, filter->smooth);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_shader_driver_compile_program(struct shader_program_info *program_info)
|
||||
bool video_shader_driver_compile_program(
|
||||
struct shader_program_info *program_info)
|
||||
{
|
||||
return (program_info) ? current_shader->compile_program(program_info->data,
|
||||
program_info->idx, NULL, program_info) : false;
|
||||
if (program_info)
|
||||
return current_shader->compile_program(program_info->data,
|
||||
program_info->idx, NULL, program_info);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_shader_driver_wrap_type(video_shader_ctx_wrap_t *wrap)
|
||||
@ -3416,8 +3396,34 @@ bool video_shader_driver_wrap_type(video_shader_ctx_wrap_t *wrap)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool renderchain_d3d_init_first(const d3d_renderchain_driver_t **renderchain_driver,
|
||||
void **renderchain_handle)
|
||||
void video_driver_set_coords(video_shader_ctx_coords_t *coords)
|
||||
{
|
||||
if (current_shader && current_shader->set_coords)
|
||||
current_shader->set_coords(coords->handle_data, shader_data, (const struct video_coords*)coords->data);
|
||||
else
|
||||
{
|
||||
if (video_driver_poke && video_driver_poke->set_coords)
|
||||
video_driver_poke->set_coords(coords->handle_data, shader_data, (const struct video_coords*)coords->data);
|
||||
}
|
||||
}
|
||||
|
||||
void video_driver_set_mvp(video_shader_ctx_mvp_t *mvp)
|
||||
{
|
||||
if (!mvp || !mvp->matrix)
|
||||
return;
|
||||
|
||||
if (current_shader && current_shader->set_mvp)
|
||||
current_shader->set_mvp(mvp->data, shader_data, mvp->matrix);
|
||||
else
|
||||
{
|
||||
if (video_driver_poke && video_driver_poke->set_mvp)
|
||||
video_driver_poke->set_mvp(mvp->data, shader_data, mvp->matrix);
|
||||
}
|
||||
}
|
||||
|
||||
bool renderchain_d3d_init_first(
|
||||
const d3d_renderchain_driver_t **renderchain_driver,
|
||||
void **renderchain_handle)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define VIDEO_SHADER_MENU_3 (GFX_MAX_SHADERS - 4)
|
||||
#define VIDEO_SHADER_MENU_4 (GFX_MAX_SHADERS - 5)
|
||||
#define VIDEO_SHADER_MENU_5 (GFX_MAX_SHADERS - 6)
|
||||
#define VIDEO_SHADER_MENU_6 (GFX_MAX_SHADERS - 7)
|
||||
|
||||
#endif
|
||||
|
||||
@ -233,10 +234,8 @@ typedef struct shader_backend
|
||||
unsigned index, struct gfx_fbo_scale *scale);
|
||||
bool (*set_coords)(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords);
|
||||
bool (*set_coords_fallback)(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords);
|
||||
bool (*set_mvp)(void *data, void *shader_data,
|
||||
const math_matrix_4x4 *mat);
|
||||
const void *mat_data);
|
||||
unsigned (*get_prev_textures)(void *data);
|
||||
bool (*get_feedback_pass)(void *data, unsigned *pass);
|
||||
bool (*mipmap_input)(void *data, unsigned index);
|
||||
@ -301,7 +300,7 @@ typedef struct video_shader_ctx_info
|
||||
typedef struct video_shader_ctx_mvp
|
||||
{
|
||||
void *data;
|
||||
const math_matrix_4x4 *matrix;
|
||||
const void *matrix;
|
||||
} video_shader_ctx_mvp_t;
|
||||
|
||||
typedef struct video_shader_ctx_filter
|
||||
@ -468,8 +467,12 @@ typedef struct video_frame_info
|
||||
bool (*cb_set_resize)(void*, unsigned, unsigned);
|
||||
|
||||
void (*cb_shader_use)(void *data, void *shader_data, unsigned index, bool set_active);
|
||||
bool (*cb_shader_set_mvp)(void *data, void *shader_data,
|
||||
const math_matrix_4x4 *mat);
|
||||
#if 0
|
||||
bool (*cb_set_coords)(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords);
|
||||
#endif
|
||||
bool (*cb_set_mvp)(void *data, void *shader_data,
|
||||
const void *mat_data);
|
||||
|
||||
void *context_data;
|
||||
void *shader_data;
|
||||
@ -671,6 +674,10 @@ struct aspect_ratio_elem
|
||||
|
||||
typedef struct video_poke_interface
|
||||
{
|
||||
void (*set_coords)(void *handle_data, void *shader_data,
|
||||
const struct video_coords *coords);
|
||||
void (*set_mvp)(void *data, void *shader_data,
|
||||
const void *mat_data);
|
||||
uintptr_t (*load_texture)(void *video_data, void *data,
|
||||
bool threaded, enum texture_filter_type filter_type);
|
||||
void (*unload_texture)(void *data, uintptr_t id);
|
||||
@ -797,6 +804,9 @@ typedef struct video_driver
|
||||
|
||||
typedef struct d3d_renderchain_driver
|
||||
{
|
||||
void (*set_mvp)(void *chain_data,
|
||||
void *data, unsigned vp_width,
|
||||
unsigned vp_height, unsigned rotation);
|
||||
void (*chain_free)(void *data);
|
||||
void *(*chain_new)(void);
|
||||
bool (*reinit)(void *data, const void *info_data);
|
||||
@ -827,6 +837,10 @@ typedef struct d3d_renderchain_driver
|
||||
|
||||
typedef struct gl_renderchain_driver
|
||||
{
|
||||
void (*set_coords)(void *handle_data,
|
||||
void *shader_data, const struct video_coords *coords);
|
||||
void (*set_mvp)(void *data, void *shader_data,
|
||||
const void *mat_data);
|
||||
void (*init_texture_reference)(
|
||||
void *data, unsigned i,
|
||||
unsigned internal_fmt, unsigned texture_fmt,
|
||||
@ -1273,17 +1287,13 @@ bool video_shader_driver_get_feedback_pass(unsigned *data);
|
||||
|
||||
bool video_shader_driver_mipmap_input(unsigned *index);
|
||||
|
||||
#define video_shader_driver_set_coords(coords) \
|
||||
if (!current_shader->set_coords(coords.handle_data, shader_data, (const struct video_coords*)coords.data) && current_shader->set_coords_fallback) \
|
||||
current_shader->set_coords_fallback(coords.handle_data, shader_data, (const struct video_coords*)coords.data)
|
||||
void video_driver_set_coords(video_shader_ctx_coords_t *coords);
|
||||
|
||||
bool video_shader_driver_scale(video_shader_ctx_scale_t *scaler);
|
||||
|
||||
bool video_shader_driver_info(video_shader_ctx_info_t *shader_info);
|
||||
|
||||
#define video_shader_driver_set_mvp(mvp) \
|
||||
if (mvp.matrix) \
|
||||
current_shader->set_mvp(mvp.data, shader_data, mvp.matrix) \
|
||||
void video_driver_set_mvp(video_shader_ctx_mvp_t *mvp);
|
||||
|
||||
bool video_shader_driver_filter_type(video_shader_ctx_filter_t *filter);
|
||||
|
||||
@ -1362,7 +1372,7 @@ extern const shader_backend_t shader_null_backend;
|
||||
extern d3d_renderchain_driver_t d3d8_renderchain;
|
||||
extern d3d_renderchain_driver_t cg_d3d9_renderchain;
|
||||
extern d3d_renderchain_driver_t hlsl_d3d9_renderchain;
|
||||
extern d3d_renderchain_driver_t null_renderchain;
|
||||
extern d3d_renderchain_driver_t null_d3d_renderchain;
|
||||
|
||||
extern gl_renderchain_driver_t gl2_renderchain;
|
||||
|
||||
|
@ -1257,6 +1257,8 @@ static struct video_shader *thread_get_current_shader(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t thread_poke = {
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
thread_load_texture,
|
||||
thread_unload_texture,
|
||||
thread_set_video_mode,
|
||||
|
@ -151,6 +151,7 @@ ACHIEVEMENTS
|
||||
#include "../libretro-common/formats/json/jsonsax.c"
|
||||
#include "../network/net_http_special.c"
|
||||
#include "../cheevos/cheevos.c"
|
||||
#include "../cheevos/badges.c"
|
||||
#include "../cheevos/var.c"
|
||||
#include "../cheevos/cond.c"
|
||||
#endif
|
||||
@ -821,6 +822,10 @@ FILE
|
||||
#include "../list_special.c"
|
||||
#include "../libretro-common/string/stdstring.c"
|
||||
#include "../libretro-common/file/nbio/nbio_stdio.c"
|
||||
#include "../libretro-common/file/nbio/nbio_linux.c"
|
||||
#include "../libretro-common/file/nbio/nbio_unixmmap.c"
|
||||
#include "../libretro-common/file/nbio/nbio_windowsmmap.c"
|
||||
#include "../libretro-common/file/nbio/nbio_intf.c"
|
||||
|
||||
/*============================================================
|
||||
MESSAGE
|
||||
|
@ -27,7 +27,7 @@ struct hidpad_nesusb_data
|
||||
struct pad_connection* connection;
|
||||
uint8_t data[64];
|
||||
uint32_t slot;
|
||||
uint64_t buttons;
|
||||
uint32_t buttons;
|
||||
};
|
||||
|
||||
static void* hidpad_nesusb_init(void *data, uint32_t slot, send_control_t ptr)
|
||||
@ -59,12 +59,14 @@ static void hidpad_nesusb_deinit(void *data)
|
||||
free(device);
|
||||
}
|
||||
|
||||
static uint64_t hidpad_nesusb_get_buttons(void *data)
|
||||
static void hidpad_nesusb_get_buttons(void *data, retro_bits_t* state)
|
||||
{
|
||||
struct hidpad_nesusb_data *device = (struct hidpad_nesusb_data*)data;
|
||||
if (!device)
|
||||
return 0;
|
||||
return device->buttons;
|
||||
struct hidpad_nesusb_data *device = (struct hidpad_nesusb_data*)data;
|
||||
if (device) {
|
||||
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
|
||||
} else {
|
||||
RARCH_INPUT_STATE_CLEAR_PTR(state);
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t hidpad_nesusb_get_axis(void *data, unsigned axis)
|
||||
@ -86,10 +88,10 @@ static void hidpad_nesusb_packet_handler(void *data, uint8_t *packet, uint16_t s
|
||||
uint32_t i, pressed_keys;
|
||||
static const uint32_t button_mapping[17] =
|
||||
{
|
||||
NO_BTN,
|
||||
NO_BTN,
|
||||
NO_BTN,
|
||||
NO_BTN,
|
||||
RETRO_DEVICE_ID_JOYPAD_L2,
|
||||
RETRO_DEVICE_ID_JOYPAD_R2,
|
||||
RETRO_DEVICE_ID_JOYPAD_L,
|
||||
RETRO_DEVICE_ID_JOYPAD_R,
|
||||
RETRO_DEVICE_ID_JOYPAD_SELECT,
|
||||
RETRO_DEVICE_ID_JOYPAD_START,
|
||||
NO_BTN,
|
||||
@ -100,9 +102,8 @@ static void hidpad_nesusb_packet_handler(void *data, uint8_t *packet, uint16_t s
|
||||
NO_BTN,
|
||||
RETRO_DEVICE_ID_JOYPAD_B,
|
||||
RETRO_DEVICE_ID_JOYPAD_A,
|
||||
NO_BTN,
|
||||
NO_BTN,
|
||||
16, /* HOME BUTTON when pressing SELECT+START */
|
||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
RETRO_DEVICE_ID_JOYPAD_X,
|
||||
};
|
||||
struct hidpad_nesusb_data *device = (struct hidpad_nesusb_data*)data;
|
||||
|
||||
@ -113,12 +114,11 @@ static void hidpad_nesusb_packet_handler(void *data, uint8_t *packet, uint16_t s
|
||||
|
||||
device->buttons = 0;
|
||||
|
||||
pressed_keys = device->data[7] | (device->data[6] << 8) |
|
||||
(((device->data[7] & 0x30) == 0x30) ? (1 << 16) : 0); /* SELECT+START=HOME */
|
||||
pressed_keys = device->data[7] | (device->data[6] << 8);
|
||||
|
||||
for (i = 0; i < 17; i ++)
|
||||
for (i = 0; i < 16; i ++)
|
||||
if (button_mapping[i] != NO_BTN)
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (UINT64_C(1) << button_mapping[i]) : 0;
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (1 << button_mapping[i]) : 0;
|
||||
}
|
||||
|
||||
static void hidpad_nesusb_set_rumble(void *data,
|
||||
|
@ -27,7 +27,7 @@ struct hidpad_ps2adapter_data
|
||||
struct pad_connection* connection;
|
||||
uint8_t data[64];
|
||||
uint32_t slot;
|
||||
uint64_t buttons;
|
||||
uint32_t buttons;
|
||||
};
|
||||
|
||||
static void* hidpad_ps2adapter_init(void *data, uint32_t slot, send_control_t ptr)
|
||||
@ -59,12 +59,14 @@ static void hidpad_ps2adapter_deinit(void *data)
|
||||
free(device);
|
||||
}
|
||||
|
||||
static uint64_t hidpad_ps2adapter_get_buttons(void *data)
|
||||
static void hidpad_ps2adapter_get_buttons(void *data, retro_bits_t *state)
|
||||
{
|
||||
struct hidpad_ps2adapter_data *device = (struct hidpad_ps2adapter_data*)data;
|
||||
if (!device)
|
||||
return 0;
|
||||
return device->buttons;
|
||||
struct hidpad_ps2adapter_data *device = (struct hidpad_ps2adapter_data*)data;
|
||||
if ( device ) {
|
||||
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
|
||||
} else {
|
||||
RARCH_INPUT_STATE_CLEAR_PTR(state);
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t hidpad_ps2adapter_get_axis(void *data, unsigned axis)
|
||||
@ -74,7 +76,7 @@ static int16_t hidpad_ps2adapter_get_axis(void *data, unsigned axis)
|
||||
|
||||
if (!device || axis >= 4)
|
||||
return 0;
|
||||
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case 0:
|
||||
@ -90,7 +92,7 @@ static int16_t hidpad_ps2adapter_get_axis(void *data, unsigned axis)
|
||||
val = device->data[2];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
val = (val << 8) - 0x8000;
|
||||
|
||||
return (abs(val) > 0x1000) ? val : 0;
|
||||
@ -133,7 +135,7 @@ static void hidpad_ps2adapter_packet_handler(void *data, uint8_t *packet, uint16
|
||||
/* Check if the data corresponds to the first controller, exit otherwise */
|
||||
if (packet[1] != 1)
|
||||
return;
|
||||
|
||||
|
||||
memcpy(device->data, packet, size);
|
||||
|
||||
device->buttons = 0;
|
||||
@ -143,7 +145,7 @@ static void hidpad_ps2adapter_packet_handler(void *data, uint8_t *packet, uint16
|
||||
for (i = 0; i < 16; i ++)
|
||||
if (button_mapping[i] != NO_BTN)
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (UINT64_C(1) << button_mapping[i]) : 0;
|
||||
|
||||
|
||||
/* Now process the hat values as if they were pad buttons */
|
||||
hat_value = PS2_H_GET(device->data[6]);
|
||||
device->buttons |= PS2_H_LEFT(hat_value) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include "joypad_connection.h"
|
||||
#include "../input_defines.h"
|
||||
|
||||
struct hidpad_ps3_data
|
||||
{
|
||||
@ -27,7 +28,7 @@ struct hidpad_ps3_data
|
||||
send_control_t send_control;
|
||||
uint8_t data[512];
|
||||
uint32_t slot;
|
||||
uint64_t buttons;
|
||||
uint32_t buttons;
|
||||
bool have_led;
|
||||
uint16_t motors[2];
|
||||
};
|
||||
@ -104,12 +105,23 @@ static void hidpad_ps3_deinit(void *data)
|
||||
free(device);
|
||||
}
|
||||
|
||||
static uint64_t hidpad_ps3_get_buttons(void *data)
|
||||
static void hidpad_ps3_get_buttons(void *data, retro_bits_t *state)
|
||||
{
|
||||
struct hidpad_ps3_data *device = (struct hidpad_ps3_data*)data;
|
||||
if (!device)
|
||||
return 0;
|
||||
return device->buttons;
|
||||
struct hidpad_ps3_data *device = (struct hidpad_ps3_data*)data;
|
||||
if ( device )
|
||||
{
|
||||
/*copy first 16 bits - standard RetroPad controls*/
|
||||
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
|
||||
|
||||
/*PS button?*/
|
||||
if ( device->buttons & 0x10000 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RARCH_MENU_TOGGLE );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_INPUT_STATE_CLEAR_PTR( state );
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t hidpad_ps3_get_axis(void *data, unsigned axis)
|
||||
|
@ -184,35 +184,67 @@ static bool hidpad_ps4_check_dpad(struct ps4 *rpt, unsigned id)
|
||||
return false;
|
||||
}
|
||||
|
||||
static uint64_t hidpad_ps4_get_buttons(void *data)
|
||||
static void hidpad_ps4_get_buttons(void *data, retro_bits_t* state)
|
||||
{
|
||||
uint64_t buttonstate = 0;
|
||||
struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data;
|
||||
struct ps4 *rpt = device ? (struct ps4*)&device->data : NULL;
|
||||
|
||||
if (!device || !rpt)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
buttonstate |= (rpt->btn.r3 ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R3) : 0);
|
||||
buttonstate |= (rpt->btn.l3 ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L3) : 0);
|
||||
buttonstate |= (rpt->btn.options ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : 0);
|
||||
buttonstate |= (rpt->btn.share ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : 0);
|
||||
buttonstate |= (rpt->btn.r2 ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R2) : 0);
|
||||
buttonstate |= (rpt->btn.l2 ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L2) : 0);
|
||||
buttonstate |= (rpt->btn.r1 ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R) : 0);
|
||||
buttonstate |= (rpt->btn.l1 ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L) : 0);
|
||||
RARCH_INPUT_STATE_CLEAR_PTR( state );
|
||||
|
||||
buttonstate |= (rpt->btn.triangle ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0);
|
||||
buttonstate |= (rpt->btn.circle ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0);
|
||||
buttonstate |= (rpt->btn.cross ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0);
|
||||
buttonstate |= (rpt->btn.square ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0);
|
||||
buttonstate |= ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_LEFT)) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0);
|
||||
buttonstate |= ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_DOWN)) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0);
|
||||
buttonstate |= ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_RIGHT)) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0);
|
||||
buttonstate |= ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_UP)) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0);
|
||||
buttonstate |= (rpt->btn.ps ? (UINT64_C(1) << RARCH_MENU_TOGGLE) : 0);
|
||||
|
||||
return buttonstate;
|
||||
if ( rpt->btn.r3 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R3 );
|
||||
}
|
||||
if ( rpt->btn.l3 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L3 );
|
||||
}
|
||||
if ( rpt->btn.options ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_START );
|
||||
}
|
||||
if ( rpt->btn.share ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_SELECT );
|
||||
}
|
||||
if ( rpt->btn.r2 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R2 );
|
||||
}
|
||||
if ( rpt->btn.l2 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L2 );
|
||||
}
|
||||
if ( rpt->btn.r1 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R );
|
||||
}
|
||||
if ( rpt->btn.l1 ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L );
|
||||
}
|
||||
if ( rpt->btn.triangle ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_X );
|
||||
}
|
||||
if ( rpt->btn.circle ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_A );
|
||||
}
|
||||
if ( rpt->btn.cross ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_B );
|
||||
}
|
||||
if ( rpt->btn.square ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_Y );
|
||||
}
|
||||
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_LEFT)) ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_LEFT );
|
||||
}
|
||||
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_DOWN)) ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_DOWN );
|
||||
}
|
||||
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_RIGHT)) ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_RIGHT );
|
||||
}
|
||||
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_UP)) ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_UP );
|
||||
}
|
||||
if ( rpt->btn.ps ) {
|
||||
RARCH_INPUT_STATE_BIT_SET_PTR( state, RARCH_MENU_TOGGLE );
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t hidpad_ps4_get_axis(void *data, unsigned axis)
|
||||
|
@ -25,9 +25,9 @@
|
||||
struct hidpad_psxadapter_data
|
||||
{
|
||||
struct pad_connection* connection;
|
||||
uint8_t data[8];
|
||||
uint8_t data[64];
|
||||
uint32_t slot;
|
||||
uint64_t buttons;
|
||||
uint32_t buttons;
|
||||
};
|
||||
|
||||
static void* hidpad_psxadapter_init(void *data, uint32_t slot, send_control_t ptr)
|
||||
@ -59,12 +59,14 @@ static void hidpad_psxadapter_deinit(void *data)
|
||||
free(device);
|
||||
}
|
||||
|
||||
static uint64_t hidpad_psxadapter_get_buttons(void *data)
|
||||
static void hidpad_psxadapter_get_buttons(void *data, retro_bits_t *state)
|
||||
{
|
||||
struct hidpad_psxadapter_data *device = (struct hidpad_psxadapter_data*)data;
|
||||
if (!device)
|
||||
return 0;
|
||||
return device->buttons;
|
||||
struct hidpad_psxadapter_data *device = (struct hidpad_psxadapter_data*)data;
|
||||
if ( device ) {
|
||||
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
|
||||
} else {
|
||||
RARCH_INPUT_STATE_CLEAR_PTR(state);
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t hidpad_psxadapter_get_axis(void *data, unsigned axis)
|
||||
@ -75,7 +77,7 @@ static int16_t hidpad_psxadapter_get_axis(void *data, unsigned axis)
|
||||
if (!device || axis >= 4 ||
|
||||
(device->data[2]==0x7F) ) /* digital mode detection */
|
||||
return 0;
|
||||
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case 0:
|
||||
@ -91,7 +93,7 @@ static int16_t hidpad_psxadapter_get_axis(void *data, unsigned axis)
|
||||
val = device->data[2];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
val = (val << 8) - 0x8000;
|
||||
|
||||
return (abs(val) > 0x1000) ? val : 0; /* hard coded deadzone */
|
||||
@ -107,7 +109,7 @@ static void hidpad_psxadapter_packet_handler(void *data, uint8_t *packet, uint16
|
||||
{
|
||||
uint32_t i, pressed_keys;
|
||||
int16_t hat_value;
|
||||
static const uint32_t button_mapping[17] =
|
||||
static const uint32_t button_mapping[16] =
|
||||
{
|
||||
RETRO_DEVICE_ID_JOYPAD_L2,
|
||||
RETRO_DEVICE_ID_JOYPAD_R2,
|
||||
@ -125,7 +127,6 @@ static void hidpad_psxadapter_packet_handler(void *data, uint8_t *packet, uint16
|
||||
RETRO_DEVICE_ID_JOYPAD_A,
|
||||
RETRO_DEVICE_ID_JOYPAD_B,
|
||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
16/* HOME BUTTON when pressing SELECT+START */
|
||||
};
|
||||
struct hidpad_psxadapter_data *device = (struct hidpad_psxadapter_data*)data;
|
||||
|
||||
@ -136,29 +137,28 @@ static void hidpad_psxadapter_packet_handler(void *data, uint8_t *packet, uint16
|
||||
|
||||
device->buttons = 0;
|
||||
|
||||
pressed_keys = device->data[7] | (device->data[6] << 8) |
|
||||
(((device->data[7] & 0x30) == 0x30) ? (1 << 16) : 0); /* SELECT+START = MENU TOGGLE */
|
||||
pressed_keys = device->data[7] | (device->data[6] << 8);
|
||||
|
||||
for (i = 0; i < 17; i ++)
|
||||
for (i = 0; i < 16; i ++)
|
||||
if (button_mapping[i] != NO_BTN)
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (UINT64_C(1) << button_mapping[i]) : 0;
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (1 << button_mapping[i]) : 0;
|
||||
|
||||
if (device->data[2]==0x7F) /* digital mode detection */
|
||||
{
|
||||
/* We're in digital mode, process the dpad values */
|
||||
device->buttons |= (device->data[4]==0x00) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
device->buttons |= (device->data[4]==0xFF) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
device->buttons |= (device->data[5]==0x00) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
device->buttons |= (device->data[5]==0xFF) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
device->buttons |= (device->data[4]==0x00) ? (1 << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
device->buttons |= (device->data[4]==0xFF) ? (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
device->buttons |= (device->data[5]==0x00) ? (1 << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
device->buttons |= (device->data[5]==0xFF) ? (1 << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We're in analog mode, process the hat values as if they were pad buttons */
|
||||
hat_value = PSX_H_GET(device->data[6]);
|
||||
device->buttons |= PSX_H_LEFT(hat_value) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
device->buttons |= PSX_H_RIGHT(hat_value) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
device->buttons |= PSX_H_UP(hat_value) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
device->buttons |= PSX_H_DOWN(hat_value) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
device->buttons |= PSX_H_LEFT(hat_value) ? (1 << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
device->buttons |= PSX_H_RIGHT(hat_value) ? (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
device->buttons |= PSX_H_UP(hat_value) ? (1 << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
device->buttons |= PSX_H_DOWN(hat_value) ? (1 << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ struct hidpad_snesusb_data
|
||||
struct pad_connection* connection;
|
||||
uint8_t data[64];
|
||||
uint32_t slot;
|
||||
uint64_t buttons;
|
||||
uint32_t buttons;
|
||||
};
|
||||
|
||||
static void* hidpad_snesusb_init(void *data, uint32_t slot, send_control_t ptr)
|
||||
@ -60,12 +60,14 @@ static void hidpad_snesusb_deinit(void *data)
|
||||
free(device);
|
||||
}
|
||||
|
||||
static uint64_t hidpad_snesusb_get_buttons(void *data)
|
||||
static void hidpad_snesusb_get_buttons(void *data, retro_bits_t *state)
|
||||
{
|
||||
struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;
|
||||
if (!device)
|
||||
return 0;
|
||||
return device->buttons;
|
||||
struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;
|
||||
if ( device ) {
|
||||
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
|
||||
} else {
|
||||
RARCH_INPUT_STATE_CLEAR_PTR(state);
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t hidpad_snesusb_get_axis(void *data, unsigned axis)
|
||||
@ -85,7 +87,7 @@ static int16_t hidpad_snesusb_get_axis(void *data, unsigned axis)
|
||||
static void hidpad_snesusb_packet_handler(void *data, uint8_t *packet, uint16_t size)
|
||||
{
|
||||
uint32_t i, pressed_keys;
|
||||
static const uint32_t button_mapping[17] =
|
||||
static const uint32_t button_mapping[16] =
|
||||
{
|
||||
RETRO_DEVICE_ID_JOYPAD_L,
|
||||
RETRO_DEVICE_ID_JOYPAD_R,
|
||||
@ -102,8 +104,7 @@ static void hidpad_snesusb_packet_handler(void *data, uint8_t *packet, uint16_t
|
||||
RETRO_DEVICE_ID_JOYPAD_X,
|
||||
RETRO_DEVICE_ID_JOYPAD_A,
|
||||
RETRO_DEVICE_ID_JOYPAD_B,
|
||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||
16, /* HOME BUTTON when pressing SELECT+START */
|
||||
RETRO_DEVICE_ID_JOYPAD_Y
|
||||
};
|
||||
struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;
|
||||
|
||||
@ -114,12 +115,11 @@ static void hidpad_snesusb_packet_handler(void *data, uint8_t *packet, uint16_t
|
||||
|
||||
device->buttons = 0;
|
||||
|
||||
pressed_keys = device->data[7] | (device->data[6] << 8) |
|
||||
(((device->data[7] & 0x30) == 0x30) ? (1 << 16) : 0); /* SELECT+START = MENU TOGGLE */
|
||||
pressed_keys = device->data[7] | (device->data[6] << 8);
|
||||
|
||||
for (i = 0; i < 17; i ++)
|
||||
for (i = 0; i < 16; i ++)
|
||||
if (button_mapping[i] != NO_BTN)
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (UINT64_C(1) << button_mapping[i]) : 0;
|
||||
device->buttons |= (pressed_keys & (1 << i)) ? (1 << button_mapping[i]) : 0;
|
||||
}
|
||||
|
||||
static void hidpad_snesusb_set_rumble(void *data,
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <retro_timers.h>
|
||||
|
||||
#include "joypad_connection.h"
|
||||
#include "../input_defines.h"
|
||||
|
||||
/* wiimote state flags*/
|
||||
#define WIIMOTE_STATE_DEV_FOUND 0x0001
|
||||
@ -198,7 +199,7 @@ static int wiimote_send(struct connect_wii_wiimote_t* wm,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Request the wiimote controller status.
|
||||
*
|
||||
* Controller status includes: battery level, LED status, expansions.
|
||||
@ -426,13 +427,13 @@ static int wiimote_handshake(struct connect_wii_wiimote_t* wm,
|
||||
switch (wm->handshake_state)
|
||||
{
|
||||
case 0:
|
||||
/* no ha habido nunca handshake, debemos forzar un
|
||||
/* no ha habido nunca handshake, debemos forzar un
|
||||
* mensaje de staus para ver que pasa. */
|
||||
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE);
|
||||
wiimote_set_leds(wm, WIIMOTE_LED_NONE);
|
||||
|
||||
/* Request the status of the Wiimote to
|
||||
/* Request the status of the Wiimote to
|
||||
* see if there is an expansion */
|
||||
wiimote_status(wm);
|
||||
|
||||
@ -440,16 +441,16 @@ static int wiimote_handshake(struct connect_wii_wiimote_t* wm,
|
||||
return 0;
|
||||
case 1:
|
||||
{
|
||||
/* estamos haciendo handshake o bien se necesita iniciar un
|
||||
/* estamos haciendo handshake o bien se necesita iniciar un
|
||||
* nuevo handshake ya que se inserta(quita una expansion. */
|
||||
int attachment = 0;
|
||||
|
||||
if(event != WM_RPT_CTRL_STATUS)
|
||||
return 0;
|
||||
|
||||
/* Is an attachment connected to
|
||||
/* Is an attachment connected to
|
||||
* the expansion port? */
|
||||
if ((data[2] & WM_CTRL_STATUS_BYTE1_ATTACHMENT) ==
|
||||
if ((data[2] & WM_CTRL_STATUS_BYTE1_ATTACHMENT) ==
|
||||
WM_CTRL_STATUS_BYTE1_ATTACHMENT)
|
||||
attachment = 1;
|
||||
|
||||
@ -473,19 +474,19 @@ static int wiimote_handshake(struct connect_wii_wiimote_t* wm,
|
||||
/* Rehandshake. */
|
||||
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE_COMPLETE);
|
||||
/* forzamos un handshake por si venimos
|
||||
/* forzamos un handshake por si venimos
|
||||
* de un hanshake completo. */
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE);
|
||||
}
|
||||
|
||||
/*Old way. initialize the extension was by writing the
|
||||
/*Old way. initialize the extension was by writing the
|
||||
* single encryption byte 0x00 to 0x(4)A40040. */
|
||||
#if 0
|
||||
buf = 0x00;
|
||||
wiimote_write_data(wm, WM_EXP_MEM_ENABLE, &buf, 1);
|
||||
#endif
|
||||
|
||||
/* NEW WAY 0x55 to 0x(4)A400F0, then writing
|
||||
/* NEW WAY 0x55 to 0x(4)A400F0, then writing
|
||||
* 0x00 to 0x(4)A400FB. (support clones) */
|
||||
buf = 0x55;
|
||||
wiimote_write_data(wm, 0x04A400F0, &buf, 1);
|
||||
@ -515,7 +516,7 @@ static int wiimote_handshake(struct connect_wii_wiimote_t* wm,
|
||||
printf("rehandshake\n");
|
||||
#endif
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE_COMPLETE);
|
||||
/* forzamos un handshake por si venimos
|
||||
/* forzamos un handshake por si venimos
|
||||
* de un hanshake completo. */
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE);
|
||||
}
|
||||
@ -671,12 +672,15 @@ static int16_t hidpad_wii_get_axis(void *data, unsigned axis)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint64_t hidpad_wii_get_buttons(void *data)
|
||||
static void hidpad_wii_get_buttons(void *data, retro_bits_t *state)
|
||||
{
|
||||
struct connect_wii_wiimote_t* device = (struct connect_wii_wiimote_t*)data;
|
||||
if (!device)
|
||||
return 0;
|
||||
return device->btns | (device->exp.cc.classic.btns << 16);
|
||||
struct connect_wii_wiimote_t* device = (struct connect_wii_wiimote_t*)data;
|
||||
if ( device )
|
||||
{
|
||||
uint32_t b;
|
||||
b = device->btns | (device->exp.cc.classic.btns << 16); /*broken? this doesn't match retropad!!*/
|
||||
RARCH_INPUT_STATE_COPY32_PTR(state, b);
|
||||
}
|
||||
}
|
||||
|
||||
static void hidpad_wii_packet_handler(void *data,
|
||||
|
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