mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Update to latest official
Update to latest official
This commit is contained in:
commit
d0df92f542
@ -38,7 +38,7 @@ matrix:
|
||||
- clang-3.8
|
||||
env: COMPILER_NAME=clang-3.8 CXX=clang++-3.8 CC=clang-3.8
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode8
|
||||
script:
|
||||
- xcodebuild -target RetroArch -configuration Release -project pkg/apple/RetroArch.xcodeproj
|
||||
- os: osx
|
||||
|
7
.vscode/c_cpp_properties.json
vendored
7
.vscode/c_cpp_properties.json
vendored
@ -29,7 +29,9 @@
|
||||
"includePath": [
|
||||
"/usr/include",
|
||||
"/usr/local/include",
|
||||
"${workspaceRoot}"
|
||||
"${workspaceRoot}",
|
||||
"${workspaceFolder}/libretro-common/include",
|
||||
"${workspaceRoot}/libretro-common/include"
|
||||
],
|
||||
"defines": [],
|
||||
"intelliSenseMode": "clang-x64",
|
||||
@ -50,7 +52,8 @@
|
||||
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/ucrt",
|
||||
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/shared",
|
||||
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/winrt",
|
||||
"${workspaceRoot}"
|
||||
"${workspaceRoot}",
|
||||
"${workspaceFolder}/libretro-common/include"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
|
20
.vscode/settings.json
vendored
20
.vscode/settings.json
vendored
@ -7,6 +7,7 @@
|
||||
"terminal.integrated.cursorBlinking": true,
|
||||
|
||||
"editor.tabSize": 3,
|
||||
"editor.detectIndentation": false,
|
||||
"editor.renderWhitespace": "all",
|
||||
"editor.insertSpaces": true,
|
||||
"files.associations": {
|
||||
@ -22,7 +23,24 @@
|
||||
"ios": "c",
|
||||
"list": "c",
|
||||
"input_driver.h": "c",
|
||||
"video_driver.h": "c"
|
||||
"video_driver.h": "c",
|
||||
"menu_driver.h": "c",
|
||||
"file_path.h": "c",
|
||||
"unordered_map": "c",
|
||||
"unordered_set": "c",
|
||||
"sstream": "cpp",
|
||||
"hash_map": "c",
|
||||
"hash_set": "c",
|
||||
"initializer_list": "c",
|
||||
"string_view": "c",
|
||||
"utility": "c",
|
||||
"menu_input.h": "c",
|
||||
"tasks_internal.h": "c",
|
||||
"ozone.h": "c",
|
||||
"ozone_theme.h": "c",
|
||||
"ozone_texture.h": "c",
|
||||
"string_list.h": "c",
|
||||
"core_info.h": "c"
|
||||
},
|
||||
"C_Cpp.dimInactiveRegions": false,
|
||||
}
|
57
.vscode/tasks.json
vendored
57
.vscode/tasks.json
vendored
@ -4,12 +4,49 @@
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"taskName": "msys2-mingw64 build",
|
||||
"label": "linux clean build",
|
||||
"type": "shell",
|
||||
"group": "build",
|
||||
"command": "make clean && ./configure && make -j12"
|
||||
},
|
||||
{
|
||||
"label": "linux clean",
|
||||
"type": "shell",
|
||||
"group": "build",
|
||||
"command": "make clean"
|
||||
},
|
||||
{
|
||||
"label": "linux build with debug symbols",
|
||||
"type": "shell",
|
||||
"group": "build",
|
||||
"command": "DEBUG=1 make -j12"
|
||||
},
|
||||
{
|
||||
"label": "linux build",
|
||||
"type": "shell",
|
||||
"group": "build",
|
||||
"command": "make -j12"
|
||||
},
|
||||
{
|
||||
"label": "linux build and run",
|
||||
"type": "shell",
|
||||
"group": "build",
|
||||
"command": "make -j12 && ./retroarch -v"
|
||||
},
|
||||
{
|
||||
"label": "linux build and run with debug symbols",
|
||||
"type": "shell",
|
||||
"group": "build",
|
||||
"command": "DEBUG=1 make -j12 && ./retroarch -v"
|
||||
},
|
||||
{
|
||||
"label": "msys2-mingw64 build",
|
||||
"type": "shell",
|
||||
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true },
|
||||
"isDefault": true
|
||||
},
|
||||
|
||||
"command": "./configure; make -j2",
|
||||
"options": {
|
||||
@ -20,9 +57,9 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskName": "msys2-mingw64 build with debug symbols",
|
||||
"label": "msys2-mingw64 build with debug symbols",
|
||||
"type": "shell",
|
||||
|
||||
"group": "build",
|
||||
@ -36,9 +73,9 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskName": "msys2-mingw64 rebuild",
|
||||
"label": "msys2-mingw64 rebuild",
|
||||
"type": "shell",
|
||||
|
||||
"group": "build",
|
||||
@ -52,9 +89,9 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskName": "msys2-mingw64 clean",
|
||||
"label": "msys2-mingw64 clean",
|
||||
"type": "shell",
|
||||
|
||||
"group": "build",
|
||||
@ -68,9 +105,9 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskName": "msys2-mingw64 run",
|
||||
"label": "msys2-mingw64 run",
|
||||
"type": "shell",
|
||||
|
||||
"group": {
|
||||
|
@ -1,13 +1,21 @@
|
||||
# 1.7.6 (future)
|
||||
- CPU FILTERS: Add Normal2x filter.
|
||||
- DATE: Add Date / Time style options.
|
||||
- MIDI: Add a Linux ALSA driver for MIDI.
|
||||
- LOCALIZATION: Add Greek translation.
|
||||
- LOCALIZATION: Update German translation.
|
||||
- LOCALIZATION: Update Italian translation.
|
||||
- LOCALIZATION: Update Simplified Chinese translation.
|
||||
- LOCALIZATION: Update Japanese translation.
|
||||
- MENU: Only show CRT SwitchRes if video display server is implemented (Windows/Linux for now)
|
||||
- MENU: User Interface -> Appearance -> 'Menu Font Green/Blue Color' settings now work properly.
|
||||
- SCANNER: Fix GDI disc scanning.
|
||||
- SWITCH/LIBNX: Improve touch scaling calculation.
|
||||
- SWITCH: Proper button labels.
|
||||
- VULKAN: Fix RGUI crashing at startup.
|
||||
- VULKAN: Fix secondary screens in overlays not working.
|
||||
- WINDOWS/WSA: Network Information info is blank until first network operation.
|
||||
- WIIU: Initial netplay peer-to-peer support. Network information working.
|
||||
|
||||
# 1.7.5
|
||||
- CAMERA: Fix Video4Linux2 driver that broke years ago.
|
||||
|
110
Makefile.classic_armv7_a7
Normal file
110
Makefile.classic_armv7_a7
Normal file
@ -0,0 +1,110 @@
|
||||
# This build was put together and is maintained by ModMyClassic.com for Libretro.
|
||||
# The purpose is to give Libretro a proper "official" build platform for classic consoles.
|
||||
# If you need any help in building for the classics or have any questions then please visit
|
||||
# https://modmyclassic.com/comp and we will help in any way possible!
|
||||
|
||||
# Building Prerequisites ##############
|
||||
# arm-linux-gnueabihf-gcc-8
|
||||
# arm-linux-gnueabihf-g++-8
|
||||
# arm-linux-gnueabihf-as
|
||||
# arm-linux-gnueabihf-strip
|
||||
# patchelf
|
||||
# bc
|
||||
|
||||
# Classic Readme Variables ############
|
||||
CLASSIC_MODS_VER := Official_Retroarch_v1_7_5c_COptimised
|
||||
CLASSIC_MODS_NAME := RetroArch v1.7.5c (Official Classic Optimised)
|
||||
CLASSIC_VERSION := 1.7.5c \(Classic+\)
|
||||
MOD_CREATOR := Libretro + ModMyClassic
|
||||
MOD_CATEGORY := RetroArch
|
||||
GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`")
|
||||
|
||||
# Platform dependant Variables ########
|
||||
HAKCHI_DIR := RA_Platform-Hakchi
|
||||
HAKCHI_GIT := https://github.com/Classicmods/RA_Platform-Hakchi
|
||||
|
||||
# General Shared Variables ############
|
||||
TARGET := retroarch
|
||||
CC_V = arm-linux-gnueabihf-gcc-8
|
||||
CXX_V = arm-linux-gnueabihf-g++-8
|
||||
AS_V = arm-linux-gnueabihf-as
|
||||
CC_AS_V = arm-linux-gnueabihf-gcc-8
|
||||
|
||||
# Libretro Defines ####################
|
||||
#HAVE_CLASSIC = Classic Hook, disable some features
|
||||
#HAVE_C_A7A7 = Classic Armv7 Cortex A7 optimisation override
|
||||
#HAVE_HAKCHI = Hakchi Hook, change default configurations etc (TODO)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
retroarch:
|
||||
#Backup vanilla version files + ammend version
|
||||
cp version.all version_BACKUP.all && cp version.dtd version_BACKUP.dtd
|
||||
sed -i -e 's/RARCH_VERSION="[^"]*"/RARCH_VERSION="$(CLASSIC_VERSION)"/g' version.all
|
||||
sed -i -e 's/PACKAGE_VERSION "[^"]*"/PACKAGE_VERSION "$(CLASSIC_VERSION)"/g' version.all
|
||||
sed -i -e 's/ENTITY version "[^"]*"/ENTITY version "$(CLASSIC_VERSION)"/g' version.dtd
|
||||
#Build the RetroArch Binary for cross platform classics (ARMv7 Cortex A7)
|
||||
patchelf --version #Check if you have patchelf installed... (sudo apt-get install patchelf)
|
||||
./configure --host=arm-linux-gnueabihf --enable-mali_fbdev --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard --disable-discord
|
||||
make CC=$(CC_V) CXX=$(CXX_V) AS=$(AS_V) CC_AS=$(CC_AS_V) LDFLAGS_SDL=-lSDL2 HAVE_CLASSIC=1 HAVE_C_A7A7=1 HAVE_HAKCHI=1 -j #Cook it
|
||||
arm-linux-gnueabihf-strip -v retroarch
|
||||
patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary...
|
||||
|
||||
#HAKCHI BUILD (NESC, SNESC)
|
||||
#FYI this build was originally known as RetroArch 'Neo' for Hakchi.
|
||||
@echo "** BUILDING CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
||||
rm -fr /tmp/$(HAKCHI_DIR)
|
||||
cd /tmp/; git clone $(HAKCHI_GIT)
|
||||
cp retroarch /tmp/$(HAKCHI_DIR)/bin/retroarch
|
||||
echo $$(echo "Built by: " $$USER @ $$(date) \\\\\\ Git Commit: $(GIT_COMMIT)) > /tmp/$(HAKCHI_DIR)/etc/libretro/retroarch_version
|
||||
cp /tmp/$(HAKCHI_DIR)/readme.md /tmp/$(HAKCHI_DIR)/readme_COPY.md
|
||||
printf "%s\n" \
|
||||
"---" \
|
||||
"Name: $(CLASSIC_MODS_NAME)" \
|
||||
"Creator: $(MOD_CREATOR)" \
|
||||
"Category: $(MOD_CATEGORY)" \
|
||||
"Version: $(CLASSIC_MODS_VER)" \
|
||||
"Built on: $(shell date)" \
|
||||
"Git commit: $(GIT_COMMIT)" \
|
||||
"---" > /tmp/$(HAKCHI_DIR)/readme.md
|
||||
cat /tmp/$(HAKCHI_DIR)/readme_COPY.md >> /tmp/$(HAKCHI_DIR)/readme.md
|
||||
rm /tmp/$(HAKCHI_DIR)/readme_COPY.md
|
||||
@echo "** COMPRESSING $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
||||
cd /tmp/$(HAKCHI_DIR)/; tar -czvf "$(CLASSIC_MODS_VER).hmod" *
|
||||
mv /tmp/$(HAKCHI_DIR)/$(CLASSIC_MODS_VER).hmod .
|
||||
@echo "** BUILT CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
||||
rm -fr /tmp/$(HAKCHI_DIR) #clean up tmp
|
||||
|
||||
#COMMODORE 64 MINI BUILD (WIP)
|
||||
|
||||
#Clean down dirty files
|
||||
rm -f version.all version.dtd
|
||||
mv version_BACKUP.all version.all && mv version_BACKUP.dtd version.dtd
|
||||
@echo "*********************************************************************"
|
||||
@echo "*** Classic ARM7 Cortex A7 build and packages built successfully! ***"
|
||||
@echo "****************** Winner, Winner, Chicken Dinner! ******************"
|
||||
@echo "*********************************************************************"
|
||||
clean:
|
||||
rm -rf obj-unix
|
||||
rm -f *.d
|
||||
rm -f *.o
|
||||
rm -f audio/*.o
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/drivers_font/*.o
|
||||
rm -f gfx/drivers_font_renderer/*.o
|
||||
rm -f gfx/drivers_context/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f record/*.o
|
||||
rm -f input/*.o
|
||||
rm -f tools/*.o
|
||||
rm -f $(BINDIR)/retroarch
|
||||
rm -f $(BINDIR)/retroarch-joyconfig
|
||||
rm -f $(PNDDIR)/readme.html
|
||||
rm -f retroarch
|
||||
rm -f $(CLASSIC_MODS_VER).hmod
|
||||
rm -f version.all version.dtd
|
||||
mv -f version_BACKUP.all version.all || echo "Backup Doesn't Exist - Ignoring..."
|
||||
mv -f version_BACKUP.dtd version.dtd || echo "Backup Doesn't Exist - Ignoring..."
|
||||
rm -f *_BACKUP*
|
1160
Makefile.common
1160
Makefile.common
File diff suppressed because it is too large
Load Diff
@ -320,6 +320,7 @@ else ifeq ($(platform), windows_msvc6_x86)
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 0
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -361,6 +362,7 @@ else ifeq ($(platform), windows_msvc2003_x86)
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -407,6 +409,7 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -454,6 +457,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -524,6 +528,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -598,6 +603,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -672,6 +678,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
@ -857,6 +864,10 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
CFLAGS += -DHAVE_NETWORKING
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
|
||||
CFLAGS += -DHAVE_NETPLAYDISCOVERY
|
||||
endif
|
||||
|
||||
ifeq ($(RARCH_CONSOLE), 1)
|
||||
CFLAGS += -DRARCH_CONSOLE
|
||||
endif
|
||||
|
@ -36,6 +36,7 @@ HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_NETWORKING = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
|
||||
@ -55,9 +56,8 @@ ifeq ($(HAVE_OPENGL), 1)
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 1
|
||||
|
||||
HAVE_ZARCH = 0
|
||||
HAVE_XMB = 1
|
||||
HAVE_STRIPES = 0
|
||||
HAVE_OZONE = 1
|
||||
|
||||
HAVE_OVERLAY = 1
|
||||
else
|
||||
@ -66,11 +66,12 @@ else
|
||||
HAVE_ZARCH = 0
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_OZONE = 0
|
||||
HAVE_STRIPES = 0
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
BLACKLIST := $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
|
||||
BLACKLIST :=
|
||||
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
|
||||
@ -221,7 +222,8 @@ ifneq ($(ROMFS),)
|
||||
export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS)
|
||||
endif
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
DEPENDS_TMP := $(OFILES:.o=.d)
|
||||
DEPENDS := $(filter-out libretro_libnx.a,$(DEPENDS_TMP))
|
||||
|
||||
.PHONY: clean all
|
||||
|
||||
@ -243,7 +245,7 @@ endif
|
||||
$(OUTPUT).elf : $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(OUTPUT).pfs0 $(OUTPUT).nro $(OUTPUT).elf
|
||||
rm -f $(DEPENDS) $(OBJ) $(OUTPUT).pfs0 $(OUTPUT).nro $(OUTPUT).elf
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# you need a rule like this for each extension you use as binary data
|
||||
|
@ -1,62 +0,0 @@
|
||||
# Hakchi version added to ease confusion amongst Hakchi community due to messy past...
|
||||
#
|
||||
# Make sure you have readelf installed (sudo apt-get install readelf) to patch the binary
|
||||
# Might not be needed for your build but it's a useful tool and for safety it should be
|
||||
# run anyway to ensure the SDL2 link isn't broken...
|
||||
|
||||
HAKCHI_VER := Hakchi_Retroarch_Neo_v1_7_3b
|
||||
HAKCHI_NAME := "Hakchi RetroArch 'Neo' v1.7.3b
|
||||
MOD_CREATOR := TheOtherGuys
|
||||
MOD_CATEGORY := RetroArch
|
||||
|
||||
HAKCHI_DIR := hakchi
|
||||
TARGET := retroarch
|
||||
GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`")
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
retroarch:
|
||||
readelf -v #Check if you have readelf installed... (sudo apt-get install readelf)
|
||||
./configure --host=arm-linux-gnueabihf --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard
|
||||
make -f Makefile -j HAVE_HAKCHI=1
|
||||
patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary...
|
||||
#/usr/bin/arm-linux-gnueabihf-strip retroarch
|
||||
rm -f $(HAKCHI_DIR)/bin/retroarch
|
||||
cp retroarch $(HAKCHI_DIR)/bin/retroarch
|
||||
echo $$(echo "Built by: " $$USER @ $$(date) \\\\\\ Git Commit: $(GIT_COMMIT)) > $(HAKCHI_DIR)/etc/libretro/retroarch_version
|
||||
cp $(HAKCHI_DIR)/readme.md $(HAKCHI_DIR)/readme_COPY.md
|
||||
printf "%s\n" \
|
||||
"---" \
|
||||
"Name: $(HAKCHI_VER)" \
|
||||
"Creator: $(MOD_CREATOR)" \
|
||||
"Category: $(MOD_CATEGORY)" \
|
||||
"Version: $(HAKCHI_VER)" \
|
||||
"Built on: $(shell date)" \
|
||||
"Git commit: $(GIT_COMMIT)" \
|
||||
"---" > $(HAKCHI_DIR)/readme.md
|
||||
cat $(HAKCHI_DIR)/readme_COPY.md >> $(HAKCHI_DIR)/readme.md
|
||||
rm $(HAKCHI_DIR)/readme_COPY.md
|
||||
@echo "** BUILDING HAKCHI $(HAKCHI_VER) HMOD PACKAGE **"
|
||||
cd $(HAKCHI_DIR)/; tar -czvf "$(HAKCHI_VER).hmod" *
|
||||
mv $(HAKCHI_DIR)/$(HAKCHI_VER).hmod .
|
||||
@echo "** BUILT HAKCHI $(HAKCHI_VER) HMOD PACKAGE **"
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f audio/*.o
|
||||
rm -f conf/*.o
|
||||
rm -f gfx/*.o
|
||||
rm -f gfx/drivers_font/*.o
|
||||
rm -f gfx/drivers_font_renderer/*.o
|
||||
rm -f gfx/drivers_context/*.o
|
||||
rm -f gfx/py_state/*.o
|
||||
rm -f compat/*.o
|
||||
rm -f record/*.o
|
||||
rm -f input/*.o
|
||||
rm -f tools/*.o
|
||||
rm -f $(BINDIR)/retroarch
|
||||
rm -f $(BINDIR)/retroarch-joyconfig
|
||||
rm -f $(PNDDIR)/readme.html
|
||||
rm -f retroarch
|
||||
rm -f $(HAKCHI_DIR)/bin/retroarch
|
||||
rm -f $(HAKCHI_VER).hmod
|
||||
rm -f $(HAKCHI_DIR)/etc/libretro/retroarch_version
|
105
Makefile.ps2
Normal file
105
Makefile.ps2
Normal file
@ -0,0 +1,105 @@
|
||||
BUILD_PRX = 0
|
||||
DEBUG = 1
|
||||
HAVE_KERNEL_PRX = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_THREADS = 0
|
||||
BIG_STACK = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
PS2_IP = 192.168.1.150
|
||||
|
||||
#Configuration for IRX
|
||||
EE_BIN2O = bin2o
|
||||
IRX_DIR = $(PS2SDK)/iop/irx
|
||||
|
||||
TARGET = retroarchps2.elf
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_LV := -O0 -g
|
||||
RARCH_DEFINES += -DDEBUG
|
||||
else
|
||||
OPTIMIZE_LV := -O2
|
||||
endif
|
||||
|
||||
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_START := -Wl,--whole-archive
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
INCDIR = -I$(PS2SDK)/ports/include -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/iop/include -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include
|
||||
INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include
|
||||
INCDIR += -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper
|
||||
GPVAL = -G0
|
||||
CFLAGS = $(OPTIMIZE_LV) -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB
|
||||
RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L.
|
||||
#LIBS = $(WHOLE_START) -lretro_ps2 $(WHOLE_END) -lstdc++ -lm -lz -lgskit -ldmakit -lpng -laudsrv -lpad -lcdvd -lmad -lfileXio -lpatches
|
||||
LIBS += $(WHOLE_START) -lretro_ps2 $(WHOLE_END)
|
||||
LIBS += -lm -lg -lz -ldebug -lfileXio -laudsrv -lpatches -lpoweroff -ldma -lgskit -ldmakit -lpad -lsdl
|
||||
|
||||
#IRX modules
|
||||
# IRX modules - modules have to be in IRX_DIR
|
||||
IRX = iomanX.irx fileXio.irx usbd.irx usbhdfsd.irx freesd.irx audsrv.irx poweroff.irx ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx
|
||||
IRX_OBJ = $(IRX:.irx=.o)
|
||||
EE_OBJS += $(IRX_OBJ)
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_STACK), 1)
|
||||
CFLAGS += -DBIG_STACK
|
||||
endif
|
||||
|
||||
CFLAGS += $(RARCH_DEFINES)
|
||||
|
||||
# Missing objecst on the PS2SDK
|
||||
EE_OBJS += ps2/compat_ctype.o
|
||||
|
||||
#EE_OBJS = griffin/griffin.o bootstrap/ps2/kernel_functions.o
|
||||
EE_OBJS += griffin/griffin.o
|
||||
|
||||
EE_CFLAGS = $(CFLAGS)
|
||||
EE_LDFLAGS = $(LDFLAGS)
|
||||
EE_LIBS = $(LIBS)
|
||||
EE_ASFLAGS = $(ASFLAGS)
|
||||
EE_INCS = $(INCDIR)
|
||||
EE_IRX_OBJ = $(IRX_OBJ)
|
||||
EE_BIN = $(TARGET)
|
||||
EE_GPVAL = $(GPVAL)
|
||||
|
||||
all: $(EE_IRX_OBJ) $(EE_BIN)
|
||||
|
||||
clean:
|
||||
rm -f $(EE_BIN) $(EE_OBJS)
|
||||
|
||||
prepare:
|
||||
ps2client -h $(PS2_IP) reset
|
||||
ps2client -h $(PS2_IP) netdump
|
||||
|
||||
run:
|
||||
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
|
||||
|
||||
debug: clean prepare all run
|
||||
|
||||
#Specific file name and output per IRX Module
|
||||
$(EE_IRX_OBJ):
|
||||
$(EE_BIN2O) $(EE_GPVAL) $(IRX_DIR)/$(@:.o=.irx) $@ $(@:.o=_irx)
|
||||
|
||||
#Include preferences
|
||||
include $(PS2SDK)/samples/Makefile.pref
|
||||
include $(PS2SDK)/samples/Makefile.eeglobal
|
||||
|
@ -105,7 +105,7 @@ endif
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_LIBRETRODB
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER
|
||||
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING
|
||||
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING -DHAVE_NETPLAYDISCOVERY
|
||||
# DEFINES += -DWANT_IFADDRS
|
||||
# DEFINES += -DHAVE_FREETYPE
|
||||
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
|
||||
@ -128,6 +128,7 @@ endif
|
||||
HAVE_LANGEXTRA = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_NETWORKING = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
# WANT_IFADDRS = 1
|
||||
HAVE_OVERLAY = 1
|
||||
@ -137,8 +138,6 @@ endif
|
||||
WANT_IOSUHAX = 1
|
||||
|
||||
include Makefile.common
|
||||
BLACKLIST := $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
|
||||
OBJ += gfx/drivers/gx2_gfx.o
|
||||
OBJ += gfx/drivers_font/wiiu_font.o
|
||||
|
@ -8,6 +8,7 @@ HAVE_OPENGL = 1
|
||||
HAVE_DYLIB = 1
|
||||
HAVE_D3D9 = 1
|
||||
HAVE_NETWORKING = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_STDIN_CMD = 1
|
||||
HAVE_COMMAND = 1
|
||||
HAVE_THREADS = 1
|
||||
|
34
README.md
34
README.md
@ -189,46 +189,46 @@ The default super resolution is 2560. It is displayed just under the CRT switch
|
||||
|
||||
If native resolutions are activated you will need a whole new set of modelines:
|
||||
|
||||
- 512 x 240 @ 50.006977 SNESpal
|
||||
- 256 x 240 @ 50.006977 SNESpal
|
||||
- 256 x 448 @ 50.006977 SNESpal
|
||||
- 512 x 224 @ 50.006977 SNESpal
|
||||
- 512 x 240 @ 50.006977 SNESpal
|
||||
- 512 x 448 @ 50.006977 SNESpal
|
||||
- 256 x 240 @ 60.098812 SNESntsc
|
||||
- 256 x 448 @ 60.098812 SNESntsc
|
||||
- 512 x 240 @ 60.098812 SNESntsc
|
||||
- 512 x 224 @ 60.098812 SNESntsc
|
||||
- 512 x 448 @ 60.098812 SNESntsc
|
||||
- 256 x 240 @ 50.006977 SNESpal
|
||||
- 256 x 448 @ 50.006977 SNESpal
|
||||
- 256 x 240 @ 60.098812 SNESntsc
|
||||
- 256 x 448 @ 60.098812 SNESntsc
|
||||
- 320 x 240 @ 59.922745 MDntsc
|
||||
- 320 x 448 @ 59.922745 MDntp
|
||||
- 320 x 480 @ 59.922745 MDntsc
|
||||
- 256 x 192 @ 59.922745 MDntsc
|
||||
- 320 x 224 @ 59.922745 MDntsc
|
||||
- 256 x 224 @ 59.922745 MDntsc
|
||||
- 320 x 288 @ 49.701458 MDpal
|
||||
- 320 x 576 @ 49.701458 MDpal
|
||||
- 320 x 224 @ 59.922745 MDntsc
|
||||
- 320 x 240 @ 59.922745 MDntsc
|
||||
- 320 x 448 @ 59.922745 MDntsc
|
||||
- 320 x 480 @ 59.922745 MDntsc
|
||||
- 256 x 192 @ 49.701458 MDpal
|
||||
- 256 x 224 @ 49.701458 MDpal
|
||||
- 320 x 224 @ 49.701458 MDpal
|
||||
- 320 x 240 @ 49.701458 MDpal
|
||||
- 320 x 288 @ 49.701458 MDpal
|
||||
- 320 x 448 @ 49.701458 MDpal
|
||||
- 320 x 480 @ 49.701458 MDpal
|
||||
- 256 x 224 @ 49.701458 MDpal
|
||||
- 320 x 576 @ 49.701458 MDpal
|
||||
- 256 x 288 @ 49.701458 MSYSpal
|
||||
- 256 x 240 @ 60.098812 NESntsc
|
||||
- 256 x 240 @ 50.006977 NESpal
|
||||
|
||||
- 640 x 480 @ 60.130001 N64ntsc
|
||||
- 640 x 237 @ 60.130001 N64ntsc
|
||||
- 640 x 240 @ 60.130001 N64ntsc
|
||||
- 640 x 480 @ 60.130001 N64ntsc
|
||||
- 640 x 288 @ 50.000000 N64pal
|
||||
- 640 x 480 @ 50.000000 N64pal
|
||||
- 640 x 576 @ 50.000000 n64pal
|
||||
- 640 x 288 @ 50.000000 n64pal
|
||||
- 640 x 576 @ 50.000000 N64pal
|
||||
|
||||
- 256 x 252 @ 49.759998 PSXpal
|
||||
- 384 x 252 @ 49.759998 PSXpal
|
||||
- 640 x 540 @ 49.759998 PSXpal
|
||||
- 320 x 252 @ 49.759998 PSXpal
|
||||
- 384 x 252 @ 49.759998 PSXpal
|
||||
- 640 x 252 @ 49.759998 PSXpal
|
||||
- 640 x 540 @ 49.759998 PSXpal
|
||||
|
||||
- 384 x 240 @ 59.941002 PSXntsc
|
||||
- 256 x 480 @ 59.941002 PSXntsc
|
||||
|
@ -796,6 +796,9 @@ size_t audio_driver_sample_batch(const int16_t *data, size_t frames)
|
||||
**/
|
||||
void audio_driver_sample_rewind(int16_t left, int16_t right)
|
||||
{
|
||||
if (audio_driver_rewind_ptr == 0)
|
||||
return;
|
||||
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] = right;
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] = left;
|
||||
}
|
||||
@ -819,7 +822,10 @@ size_t audio_driver_sample_batch_rewind(const int16_t *data, size_t frames)
|
||||
size_t samples = frames << 1;
|
||||
|
||||
for (i = 0; i < samples; i++)
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] = data[i];
|
||||
{
|
||||
if (audio_driver_rewind_ptr > 0)
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] = data[i];
|
||||
}
|
||||
|
||||
return frames;
|
||||
}
|
||||
@ -905,11 +911,13 @@ void audio_driver_setup_rewind(void)
|
||||
|
||||
for (i = 0; i < audio_driver_data_ptr; i += 2)
|
||||
{
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] =
|
||||
audio_driver_output_samples_conv_buf[i + 1];
|
||||
if (audio_driver_rewind_ptr > 0)
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] =
|
||||
audio_driver_output_samples_conv_buf[i + 1];
|
||||
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] =
|
||||
audio_driver_output_samples_conv_buf[i + 0];
|
||||
if (audio_driver_rewind_ptr > 0)
|
||||
audio_driver_rewind_buf[--audio_driver_rewind_ptr] =
|
||||
audio_driver_output_samples_conv_buf[i + 0];
|
||||
}
|
||||
|
||||
audio_driver_data_ptr = 0;
|
||||
|
@ -335,6 +335,7 @@ extern audio_driver_t audio_ps3;
|
||||
extern audio_driver_t audio_gx;
|
||||
extern audio_driver_t audio_ax;
|
||||
extern audio_driver_t audio_psp;
|
||||
extern audio_driver_t audio_ps2;
|
||||
extern audio_driver_t audio_ctr_csnd;
|
||||
extern audio_driver_t audio_ctr_dsp;
|
||||
extern audio_driver_t audio_switch;
|
||||
|
@ -29,6 +29,19 @@
|
||||
#include <mmreg.h>
|
||||
#include <audioclient.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* IID_IAudioClient 1CB9AD4C-DBFA-4c32-B178-C2F568A703B2 */
|
||||
static const GUID IID_IAudioClient = { 0x1CB9AD4C, 0xDBFA, 0xB178, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2 };
|
||||
/* IID_IAudioRenderClient F294ACFC-3146-4483-A7BF-ADDCA7C260E2 */
|
||||
static const GUID IID_IAudioRenderClient = { 0xF294ACFC, 0x3146, 0x4483, 0xA7BF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2 };
|
||||
/* IID_IMMDeviceEnumerator A95664D2-9614-4F35-A746-DE8DB63617E6 */
|
||||
static const GUID IID_IMMDeviceEnumerator = { 0xA95664D2, 0x9614, 0x4F35, 0xA746, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6 };
|
||||
/* CLSID_MMDeviceEnumerator BCDE0395-E52F-467C-8E3D-C4579291692E */
|
||||
static const GUID CLSID_MMDeviceEnumerator = { 0xBCDE0395, 0xE52F, 0x467C, 0x8E3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E };
|
||||
/* KSDATAFORMAT_SUBTYPE_IEEE_FLOAT 00000003-0000-0010-8000-00aa00389b71 */
|
||||
static const GUID KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010, 0x8000, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 };
|
||||
#endif
|
||||
|
||||
#include <lists/string_list.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
|
@ -1743,7 +1743,10 @@ found:
|
||||
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!string_is_equal(settings->arrays.menu_driver, "xmb") ||
|
||||
if (!(
|
||||
string_is_equal(settings->arrays.menu_driver, "xmb") ||
|
||||
string_is_equal(settings->arrays.menu_driver, "ozone")
|
||||
) ||
|
||||
!settings->bools.cheevos_badges_enable)
|
||||
CORO_RET();
|
||||
}
|
||||
|
7473
cheevos/cheevos.c
7473
cheevos/cheevos.c
File diff suppressed because it is too large
Load Diff
@ -98,7 +98,8 @@ typedef enum
|
||||
CHEEVOS_CONSOLE_VIRTUAL_BOY = 28,
|
||||
CHEEVOS_CONSOLE_MSX = 29,
|
||||
CHEEVOS_CONSOLE_COMMODORE_64 = 30,
|
||||
CHEEVOS_CONSOLE_ZX81 = 31
|
||||
CHEEVOS_CONSOLE_ZX81 = 31,
|
||||
CHEEVOS_CONSOLE_ATARI_7800 = 51
|
||||
} cheevos_console_t;
|
||||
|
||||
enum
|
||||
|
29
command.c
29
command.c
@ -1278,6 +1278,7 @@ static bool event_init_content(void)
|
||||
{
|
||||
bool contentless = false;
|
||||
bool is_inited = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
content_get_status(&contentless, &is_inited);
|
||||
|
||||
@ -1304,7 +1305,18 @@ static bool event_init_content(void)
|
||||
RARCH_LOG("%s.\n",
|
||||
msg_hash_to_str(MSG_SKIPPING_SRAM_LOAD));
|
||||
|
||||
/*
|
||||
Since the operations are asynchronouse we can't guarantee users will not use auto_load_state to cheat on
|
||||
achievements so we forbid auto_load_state from happening if cheevos_enable and cheevos_hardcode_mode_enable
|
||||
are true
|
||||
*/
|
||||
#ifdef HAVE_CHEEVOS
|
||||
if (!settings->bools.cheevos_enable || !settings->bools.cheevos_hardcore_mode_enable)
|
||||
command_event_load_auto_state();
|
||||
#else
|
||||
command_event_load_auto_state();
|
||||
#endif
|
||||
|
||||
command_event(CMD_EVENT_BSV_MOVIE_INIT, NULL);
|
||||
command_event(CMD_EVENT_NETPLAY_INIT, NULL);
|
||||
|
||||
@ -2433,17 +2445,12 @@ TODO: Add a setting for these tweaks */
|
||||
break;
|
||||
case CMD_EVENT_ADD_TO_FAVORITES:
|
||||
{
|
||||
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);
|
||||
}
|
||||
/* TODO/FIXME - does path_get(RARCH_PATH_CORE) depend on the system info struct? Investigate */
|
||||
global_t *global = global_get_ptr();
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
const char *label = NULL;
|
||||
const char *core_path = system ? path_get(RARCH_PATH_CORE) : NULL;
|
||||
const char *core_name = system ? system->library_name : NULL;
|
||||
|
||||
if (!string_is_empty(global->name.label))
|
||||
label = global->name.label;
|
||||
|
17
config.def.h
17
config.def.h
@ -188,7 +188,7 @@ static const bool video_threaded = false;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_THREADS)
|
||||
#if defined(GEKKO) || defined(PSP)
|
||||
#if defined(GEKKO) || defined(PSP) || defined(PS2)
|
||||
/* For single-core consoles right now it's better to have this be disabled. */
|
||||
static const bool threaded_data_runloop_enable = false;
|
||||
#else
|
||||
@ -266,6 +266,12 @@ static const float default_input_overlay_opacity = 0.7f;
|
||||
|
||||
static bool default_block_config_read = true;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
static bool menu_use_preferred_system_color_theme = true;
|
||||
#else
|
||||
static bool menu_use_preferred_system_color_theme = false;
|
||||
#endif
|
||||
|
||||
static bool quick_menu_show_take_screenshot = true;
|
||||
static bool quick_menu_show_save_load_state = true;
|
||||
static bool quick_menu_show_undo_save_load_state = true;
|
||||
@ -472,6 +478,11 @@ static const float crt_refresh_rate = 60/1.001;
|
||||
* Used for setups where one manually rotates the monitor. */
|
||||
static const bool allow_rotate = true;
|
||||
|
||||
#ifdef _3DS
|
||||
/* Enable bottom LCD screen */
|
||||
static const bool video_3ds_lcd_bottom = true;
|
||||
#endif
|
||||
|
||||
/* AUDIO */
|
||||
|
||||
/* Will enable audio or not. */
|
||||
@ -725,7 +736,7 @@ static const bool desktop_menu_enable = true;
|
||||
|
||||
#if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || defined(__CELLOS_LV2__) || (defined(__MACH__) && defined(IOS)) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON__)
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_LOWER;
|
||||
#elif defined(PSP) || defined(_3DS) || defined(VITA)
|
||||
#elif defined(PSP) || defined(_3DS) || defined(VITA) || defined(PS2)
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_LOWEST;
|
||||
#else
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_NORMAL;
|
||||
@ -811,4 +822,6 @@ static char buildbot_server_url[] = "";
|
||||
|
||||
static char buildbot_assets_server_url[] = "http://buildbot.libretro.com/assets/";
|
||||
|
||||
static char default_discord_app_id[] = "475456035851599874";
|
||||
|
||||
#endif
|
||||
|
@ -308,7 +308,7 @@ static const bool _python_supp = true;
|
||||
static const bool _python_supp = false;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH)
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL)
|
||||
static const bool _cocoa_supp = true;
|
||||
#else
|
||||
static const bool _cocoa_supp = false;
|
||||
|
@ -148,6 +148,7 @@ enum video_driver_enum
|
||||
VIDEO_XENON360,
|
||||
VIDEO_PSP1,
|
||||
VIDEO_VITA2D,
|
||||
VIDEO_PS2,
|
||||
VIDEO_CTR,
|
||||
VIDEO_SWITCH,
|
||||
VIDEO_D3D8,
|
||||
@ -191,6 +192,7 @@ enum audio_driver_enum
|
||||
AUDIO_WIIU,
|
||||
AUDIO_RWEBAUDIO,
|
||||
AUDIO_PSP,
|
||||
AUDIO_PS2,
|
||||
AUDIO_CTR,
|
||||
AUDIO_SWITCH,
|
||||
AUDIO_NULL
|
||||
@ -214,6 +216,7 @@ enum input_driver_enum
|
||||
INPUT_DINPUT,
|
||||
INPUT_PS3,
|
||||
INPUT_PSP,
|
||||
INPUT_PS2,
|
||||
INPUT_CTR,
|
||||
INPUT_SWITCH,
|
||||
INPUT_XENON360,
|
||||
@ -237,6 +240,7 @@ enum joypad_driver_enum
|
||||
JOYPAD_WIIU,
|
||||
JOYPAD_XDK,
|
||||
JOYPAD_PSP,
|
||||
JOYPAD_PS2,
|
||||
JOYPAD_CTR,
|
||||
JOYPAD_SWITCH,
|
||||
JOYPAD_DINPUT,
|
||||
@ -288,6 +292,7 @@ enum menu_driver_enum
|
||||
MENU_XMB,
|
||||
MENU_STRIPES,
|
||||
MENU_NUKLEAR,
|
||||
MENU_OZONE,
|
||||
MENU_NULL
|
||||
};
|
||||
|
||||
@ -324,6 +329,8 @@ static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VG;
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VITA2D;
|
||||
#elif defined(PSP)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_PSP1;
|
||||
#elif defined(PS2)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_PS2;
|
||||
#elif defined(_3DS)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_CTR;
|
||||
#elif defined(SWITCH)
|
||||
@ -354,6 +361,8 @@ static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WII;
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WIIU;
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PSP;
|
||||
#elif defined(PS2)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS2;
|
||||
#elif defined(_3DS)
|
||||
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_CTR;
|
||||
#elif defined(SWITCH)
|
||||
@ -434,6 +443,8 @@ static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_DINPUT;
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS3;
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PSP;
|
||||
#elif defined(PS2)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_PS2;
|
||||
#elif defined(_3DS)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_CTR;
|
||||
#elif defined(SWITCH)
|
||||
@ -450,7 +461,7 @@ static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_UDEV;
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_LINUXRAW;
|
||||
#elif defined(HAVE_WAYLAND)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_WAYLAND;
|
||||
#elif defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH)
|
||||
#elif defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_COCOA;
|
||||
#elif defined(__QNX__)
|
||||
static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_QNX;
|
||||
@ -476,6 +487,8 @@ static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_WIIU;
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XDK;
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PSP;
|
||||
#elif defined(PS2)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS2;
|
||||
#elif defined(_3DS)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_CTR;
|
||||
#elif defined(SWITCH)
|
||||
@ -510,7 +523,7 @@ static enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_V4L2;
|
||||
static enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_RWEBCAM;
|
||||
#elif defined(ANDROID)
|
||||
static enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_ANDROID;
|
||||
#elif defined(HAVE_AVFOUNDATION) && (defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH))
|
||||
#elif defined(HAVE_AVFOUNDATION) && (defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL))
|
||||
static enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_AVFOUNDATION;
|
||||
#else
|
||||
static enum camera_driver_enum CAMERA_DEFAULT_DRIVER = CAMERA_NULL;
|
||||
@ -524,7 +537,7 @@ static enum wifi_driver_enum WIFI_DEFAULT_DRIVER = WIFI_NULL;
|
||||
|
||||
#if defined(ANDROID)
|
||||
static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_ANDROID;
|
||||
#elif defined(HAVE_CORELOCATION) && (defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH))
|
||||
#elif defined(HAVE_CORELOCATION) && (defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL))
|
||||
static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_CORELOCATION;
|
||||
#else
|
||||
static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
|
||||
@ -534,6 +547,8 @@ static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XUI;
|
||||
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_MATERIALUI;
|
||||
#elif defined(HAVE_OZONE) && defined(HAVE_LIBNX)
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_OZONE;
|
||||
#elif defined(HAVE_XMB) && !defined(_XBOX)
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XMB;
|
||||
#elif defined(HAVE_RGUI)
|
||||
@ -660,6 +675,8 @@ const char *config_get_default_audio(void)
|
||||
#else
|
||||
return "psp";
|
||||
#endif
|
||||
case AUDIO_PS2:
|
||||
return "ps2";
|
||||
case AUDIO_CTR:
|
||||
return "csnd";
|
||||
case AUDIO_SWITCH:
|
||||
@ -755,6 +772,8 @@ const char *config_get_default_video(void)
|
||||
return "d3d12";
|
||||
case VIDEO_PSP1:
|
||||
return "psp1";
|
||||
case VIDEO_PS2:
|
||||
return "ps2";
|
||||
case VIDEO_VITA2D:
|
||||
return "vita2d";
|
||||
case VIDEO_CTR:
|
||||
@ -815,6 +834,8 @@ const char *config_get_default_input(void)
|
||||
#else
|
||||
return "psp";
|
||||
#endif
|
||||
case INPUT_PS2:
|
||||
return "ps2";
|
||||
case INPUT_CTR:
|
||||
return "ctr";
|
||||
case INPUT_SWITCH:
|
||||
@ -885,6 +906,8 @@ const char *config_get_default_joypad(void)
|
||||
#else
|
||||
return "psp";
|
||||
#endif
|
||||
case JOYPAD_PS2:
|
||||
return "ps2";
|
||||
case JOYPAD_CTR:
|
||||
return "ctr";
|
||||
case JOYPAD_SWITCH:
|
||||
@ -1028,6 +1051,8 @@ const char *config_get_default_menu(void)
|
||||
return "rgui";
|
||||
case MENU_XUI:
|
||||
return "xui";
|
||||
case MENU_OZONE:
|
||||
return "ozone";
|
||||
case MENU_MATERIALUI:
|
||||
return "glui";
|
||||
case MENU_XMB:
|
||||
@ -1111,7 +1136,7 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
|
||||
SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, midi_input, true);
|
||||
SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, midi_output, true);
|
||||
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
|
||||
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
|
||||
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, default_discord_app_id, true);
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
@ -1382,6 +1407,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("quick_menu_show_save_content_dir_overrides", &settings->bools.quick_menu_show_save_content_dir_overrides, true, quick_menu_show_save_content_dir_overrides, false);
|
||||
SETTING_BOOL("quick_menu_show_information", &settings->bools.quick_menu_show_information, true, quick_menu_show_information, false);
|
||||
SETTING_BOOL("kiosk_mode_enable", &settings->bools.kiosk_mode_enable, true, kiosk_mode_enable, false);
|
||||
SETTING_BOOL("menu_use_preferred_system_color_theme", &settings->bools.menu_use_preferred_system_color_theme, true, menu_use_preferred_system_color_theme, false);
|
||||
SETTING_BOOL("content_show_settings", &settings->bools.menu_content_show_settings, true, content_show_settings, false);
|
||||
SETTING_BOOL("content_show_favorites", &settings->bools.menu_content_show_favorites, true, content_show_favorites, false);
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
@ -1491,6 +1517,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
|
||||
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);
|
||||
|
||||
#ifdef _3DS
|
||||
SETTING_BOOL("video_3ds_lcd_bottom", &settings->bools.video_3ds_lcd_bottom, true, video_3ds_lcd_bottom, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
@ -1575,6 +1605,16 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("dpi_override_value", &settings->uints.menu_dpi_override_value, true, menu_dpi_override_value, false);
|
||||
SETTING_UINT("menu_thumbnails", &settings->uints.menu_thumbnails, true, menu_thumbnails_default, false);
|
||||
SETTING_UINT("menu_timedate_style", &settings->uints.menu_timedate_style, true, menu_timedate_style, false);
|
||||
#ifdef HAVE_LIBNX
|
||||
SETTING_UINT("split_joycon_p1", &settings->uints.input_split_joycon[0], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p2", &settings->uints.input_split_joycon[1], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p3", &settings->uints.input_split_joycon[2], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p4", &settings->uints.input_split_joycon[3], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p5", &settings->uints.input_split_joycon[4], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p6", &settings->uints.input_split_joycon[5], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p7", &settings->uints.input_split_joycon[6], true, 0, false);
|
||||
SETTING_UINT("split_joycon_p8", &settings->uints.input_split_joycon[7], true, 0, false);
|
||||
#endif
|
||||
#ifdef HAVE_XMB
|
||||
SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false);
|
||||
SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, xmb_alpha_factor, false);
|
||||
@ -1588,6 +1628,9 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
#endif
|
||||
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, MATERIALUI_THEME_BLUE, false);
|
||||
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, menu_shader_pipeline, false);
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, 0, false);
|
||||
#endif
|
||||
#endif
|
||||
SETTING_UINT("audio_out_rate", &settings->uints.audio_out_rate, true, out_rate, false);
|
||||
SETTING_UINT("custom_viewport_width", &settings->video_viewport_custom.width, false, 0 /* TODO */, false);
|
||||
@ -1804,6 +1847,9 @@ void config_set_defaults(void)
|
||||
*settings->paths.path_menu_xmb_font = '\0';
|
||||
#endif
|
||||
|
||||
strlcpy(settings->arrays.discord_app_id,
|
||||
default_discord_app_id, sizeof(settings->arrays.discord_app_id));
|
||||
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (g_defaults.menu.materialui.menu_color_theme_enable)
|
||||
settings->uints.menu_materialui_color_theme = g_defaults.menu.materialui.menu_color_theme;
|
||||
@ -2349,7 +2395,8 @@ static bool check_menu_driver_compatibility(void)
|
||||
char *menu_driver = settings->arrays.menu_driver;
|
||||
|
||||
if (string_is_equal (menu_driver, "rgui") ||
|
||||
string_is_equal(menu_driver, "null"))
|
||||
string_is_equal(menu_driver, "null") ||
|
||||
string_is_equal(video_driver, "null"))
|
||||
return true;
|
||||
|
||||
/* TODO/FIXME - maintenance hazard */
|
||||
@ -2357,11 +2404,13 @@ static bool check_menu_driver_compatibility(void)
|
||||
string_is_equal(video_driver, "d3d10") ||
|
||||
string_is_equal(video_driver, "d3d11") ||
|
||||
string_is_equal(video_driver, "d3d12") ||
|
||||
string_is_equal(video_driver, "gdi") ||
|
||||
string_is_equal(video_driver, "gl") ||
|
||||
string_is_equal(video_driver, "gx2") ||
|
||||
string_is_equal(video_driver, "vulkan") ||
|
||||
string_is_equal(video_driver, "metal") ||
|
||||
string_is_equal(video_driver, "vita"))
|
||||
string_is_equal(video_driver, "ctr") ||
|
||||
string_is_equal(video_driver, "vita2d"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -104,6 +104,7 @@ typedef struct settings
|
||||
bool video_statistics_show;
|
||||
bool video_framecount_show;
|
||||
bool video_msg_bgcolor_enable;
|
||||
bool video_3ds_lcd_bottom;
|
||||
|
||||
/* Audio */
|
||||
bool audio_enable;
|
||||
@ -175,6 +176,8 @@ typedef struct settings
|
||||
bool menu_content_show_history;
|
||||
bool menu_content_show_add;
|
||||
bool menu_content_show_playlists;
|
||||
bool menu_use_preferred_system_color_theme;
|
||||
bool menu_preferred_system_color_theme_set;
|
||||
bool menu_unified_controls;
|
||||
bool quick_menu_show_take_screenshot;
|
||||
bool quick_menu_show_save_load_state;
|
||||
@ -407,6 +410,7 @@ typedef struct settings
|
||||
unsigned menu_xmb_theme;
|
||||
unsigned menu_xmb_color_theme;
|
||||
unsigned menu_materialui_color_theme;
|
||||
unsigned menu_ozone_color_theme;
|
||||
unsigned menu_font_color_red;
|
||||
unsigned menu_font_color_green;
|
||||
unsigned menu_font_color_blue;
|
||||
@ -482,6 +486,8 @@ typedef struct settings
|
||||
|
||||
char youtube_stream_key[PATH_MAX_LENGTH];
|
||||
char twitch_stream_key[PATH_MAX_LENGTH];
|
||||
|
||||
char discord_app_id[PATH_MAX_LENGTH];
|
||||
} arrays;
|
||||
|
||||
struct
|
||||
|
12
core_impl.c
12
core_impl.c
@ -396,7 +396,9 @@ bool core_unload(void)
|
||||
{
|
||||
video_driver_set_cached_frame_ptr(NULL);
|
||||
|
||||
current_core.retro_deinit();
|
||||
if (current_core.inited)
|
||||
current_core.retro_deinit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -407,9 +409,11 @@ bool core_unload_game(void)
|
||||
|
||||
video_driver_set_cached_frame_ptr(NULL);
|
||||
|
||||
current_core.retro_unload_game();
|
||||
|
||||
current_core.game_loaded = false;
|
||||
if (current_core.game_loaded)
|
||||
{
|
||||
current_core.retro_unload_game();
|
||||
current_core.game_loaded = false;
|
||||
}
|
||||
|
||||
audio_driver_stop();
|
||||
|
||||
|
@ -205,7 +205,7 @@ static bool core_info_list_iterate(
|
||||
current_path,
|
||||
info_path_base_size);
|
||||
|
||||
#if defined(RARCH_MOBILE) || (defined(RARCH_CONSOLE) && !defined(PSP) && !defined(_3DS) && !defined(VITA) && !defined(HW_WUP))
|
||||
#if defined(RARCH_MOBILE) || (defined(RARCH_CONSOLE) && !defined(PSP) && !defined(_3DS) && !defined(VITA) && !defined(PS2) && !defined(HW_WUP))
|
||||
substr = strrchr(info_path_base, '_');
|
||||
if (substr)
|
||||
*substr = '\0';
|
||||
|
@ -109,7 +109,7 @@ else
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
endif
|
||||
|
||||
LDFLAGS += $(LIBV4L2) $(LIBASOUND) $(LIBUDEV)
|
||||
LDFLAGS += $(LIBV4L2) $(LIBASOUND) $(LIBUDEV) -lm
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
|
File diff suppressed because it is too large
Load Diff
10
deps/discord-rpc/src/discord_register_win.cpp
vendored
10
deps/discord-rpc/src/discord_register_win.cpp
vendored
@ -77,22 +77,22 @@ static void Discord_RegisterW(const wchar_t* applicationId, const wchar_t* comma
|
||||
wchar_t openCommand[1024];
|
||||
|
||||
if (command && command[0]) {
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%s", command);
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%S", command);
|
||||
}
|
||||
else {
|
||||
// StringCbCopyW(openCommand, sizeof(openCommand), exeFilePath);
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%s", exeFilePath);
|
||||
StringCbPrintfW(openCommand, sizeof(openCommand), L"%S", exeFilePath);
|
||||
}
|
||||
|
||||
wchar_t protocolName[64];
|
||||
StringCbPrintfW(protocolName, sizeof(protocolName), L"discord-%s", applicationId);
|
||||
StringCbPrintfW(protocolName, sizeof(protocolName), L"discord-%S", applicationId);
|
||||
wchar_t protocolDescription[128];
|
||||
StringCbPrintfW(
|
||||
protocolDescription, sizeof(protocolDescription), L"URL:Run game %s protocol", applicationId);
|
||||
protocolDescription, sizeof(protocolDescription), L"URL:Run game %S protocol", applicationId);
|
||||
wchar_t urlProtocol = 0;
|
||||
|
||||
wchar_t keyName[256];
|
||||
StringCbPrintfW(keyName, sizeof(keyName), L"Software\\Classes\\%s", protocolName);
|
||||
StringCbPrintfW(keyName, sizeof(keyName), L"Software\\Classes\\%S", protocolName);
|
||||
HKEY key;
|
||||
auto status =
|
||||
RegCreateKeyExW(HKEY_CURRENT_USER, keyName, 0, nullptr, 0, KEY_WRITE, nullptr, &key, nullptr);
|
||||
|
6
deps/mbedtls/asn1write.c
vendored
6
deps/mbedtls/asn1write.c
vendored
@ -345,7 +345,7 @@ mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data
|
||||
return( NULL );
|
||||
|
||||
cur->oid.len = oid_len;
|
||||
cur->oid.p = mbedtls_calloc( 1, oid_len );
|
||||
cur->oid.p = (unsigned char*)(unsigned char*)(unsigned char*)(unsigned char*)(unsigned char*)(unsigned char*)(unsigned char*)(unsigned char*)(unsigned char*)mbedtls_calloc( 1, oid_len );
|
||||
if( cur->oid.p == NULL )
|
||||
{
|
||||
mbedtls_free( cur );
|
||||
@ -355,7 +355,7 @@ mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data
|
||||
memcpy( cur->oid.p, oid, oid_len );
|
||||
|
||||
cur->val.len = val_len;
|
||||
cur->val.p = mbedtls_calloc( 1, val_len );
|
||||
cur->val.p = (unsigned char*)mbedtls_calloc( 1, val_len );
|
||||
if( cur->val.p == NULL )
|
||||
{
|
||||
mbedtls_free( cur->oid.p );
|
||||
@ -378,7 +378,7 @@ mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data
|
||||
return( NULL );
|
||||
|
||||
mbedtls_free( cur->val.p );
|
||||
cur->val.p = p;
|
||||
cur->val.p = (unsigned char*)p;
|
||||
cur->val.len = val_len;
|
||||
}
|
||||
|
||||
|
517
deps/mbedtls/blowfish.c
vendored
517
deps/mbedtls/blowfish.c
vendored
@ -73,7 +73,264 @@ static const uint32_t P[MBEDTLS_BLOWFISH_ROUNDS + 2] = {
|
||||
};
|
||||
|
||||
/* declarations of data at the end of this file */
|
||||
static const uint32_t S[4][256];
|
||||
static const uint32_t S[4][256] = {
|
||||
{ 0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L,
|
||||
0xB8E1AFEDL, 0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L,
|
||||
0x24A19947L, 0xB3916CF7L, 0x0801F2E2L, 0x858EFC16L,
|
||||
0x636920D8L, 0x71574E69L, 0xA458FEA3L, 0xF4933D7EL,
|
||||
0x0D95748FL, 0x728EB658L, 0x718BCD58L, 0x82154AEEL,
|
||||
0x7B54A41DL, 0xC25A59B5L, 0x9C30D539L, 0x2AF26013L,
|
||||
0xC5D1B023L, 0x286085F0L, 0xCA417918L, 0xB8DB38EFL,
|
||||
0x8E79DCB0L, 0x603A180EL, 0x6C9E0E8BL, 0xB01E8A3EL,
|
||||
0xD71577C1L, 0xBD314B27L, 0x78AF2FDAL, 0x55605C60L,
|
||||
0xE65525F3L, 0xAA55AB94L, 0x57489862L, 0x63E81440L,
|
||||
0x55CA396AL, 0x2AAB10B6L, 0xB4CC5C34L, 0x1141E8CEL,
|
||||
0xA15486AFL, 0x7C72E993L, 0xB3EE1411L, 0x636FBC2AL,
|
||||
0x2BA9C55DL, 0x741831F6L, 0xCE5C3E16L, 0x9B87931EL,
|
||||
0xAFD6BA33L, 0x6C24CF5CL, 0x7A325381L, 0x28958677L,
|
||||
0x3B8F4898L, 0x6B4BB9AFL, 0xC4BFE81BL, 0x66282193L,
|
||||
0x61D809CCL, 0xFB21A991L, 0x487CAC60L, 0x5DEC8032L,
|
||||
0xEF845D5DL, 0xE98575B1L, 0xDC262302L, 0xEB651B88L,
|
||||
0x23893E81L, 0xD396ACC5L, 0x0F6D6FF3L, 0x83F44239L,
|
||||
0x2E0B4482L, 0xA4842004L, 0x69C8F04AL, 0x9E1F9B5EL,
|
||||
0x21C66842L, 0xF6E96C9AL, 0x670C9C61L, 0xABD388F0L,
|
||||
0x6A51A0D2L, 0xD8542F68L, 0x960FA728L, 0xAB5133A3L,
|
||||
0x6EEF0B6CL, 0x137A3BE4L, 0xBA3BF050L, 0x7EFB2A98L,
|
||||
0xA1F1651DL, 0x39AF0176L, 0x66CA593EL, 0x82430E88L,
|
||||
0x8CEE8619L, 0x456F9FB4L, 0x7D84A5C3L, 0x3B8B5EBEL,
|
||||
0xE06F75D8L, 0x85C12073L, 0x401A449FL, 0x56C16AA6L,
|
||||
0x4ED3AA62L, 0x363F7706L, 0x1BFEDF72L, 0x429B023DL,
|
||||
0x37D0D724L, 0xD00A1248L, 0xDB0FEAD3L, 0x49F1C09BL,
|
||||
0x075372C9L, 0x80991B7BL, 0x25D479D8L, 0xF6E8DEF7L,
|
||||
0xE3FE501AL, 0xB6794C3BL, 0x976CE0BDL, 0x04C006BAL,
|
||||
0xC1A94FB6L, 0x409F60C4L, 0x5E5C9EC2L, 0x196A2463L,
|
||||
0x68FB6FAFL, 0x3E6C53B5L, 0x1339B2EBL, 0x3B52EC6FL,
|
||||
0x6DFC511FL, 0x9B30952CL, 0xCC814544L, 0xAF5EBD09L,
|
||||
0xBEE3D004L, 0xDE334AFDL, 0x660F2807L, 0x192E4BB3L,
|
||||
0xC0CBA857L, 0x45C8740FL, 0xD20B5F39L, 0xB9D3FBDBL,
|
||||
0x5579C0BDL, 0x1A60320AL, 0xD6A100C6L, 0x402C7279L,
|
||||
0x679F25FEL, 0xFB1FA3CCL, 0x8EA5E9F8L, 0xDB3222F8L,
|
||||
0x3C7516DFL, 0xFD616B15L, 0x2F501EC8L, 0xAD0552ABL,
|
||||
0x323DB5FAL, 0xFD238760L, 0x53317B48L, 0x3E00DF82L,
|
||||
0x9E5C57BBL, 0xCA6F8CA0L, 0x1A87562EL, 0xDF1769DBL,
|
||||
0xD542A8F6L, 0x287EFFC3L, 0xAC6732C6L, 0x8C4F5573L,
|
||||
0x695B27B0L, 0xBBCA58C8L, 0xE1FFA35DL, 0xB8F011A0L,
|
||||
0x10FA3D98L, 0xFD2183B8L, 0x4AFCB56CL, 0x2DD1D35BL,
|
||||
0x9A53E479L, 0xB6F84565L, 0xD28E49BCL, 0x4BFB9790L,
|
||||
0xE1DDF2DAL, 0xA4CB7E33L, 0x62FB1341L, 0xCEE4C6E8L,
|
||||
0xEF20CADAL, 0x36774C01L, 0xD07E9EFEL, 0x2BF11FB4L,
|
||||
0x95DBDA4DL, 0xAE909198L, 0xEAAD8E71L, 0x6B93D5A0L,
|
||||
0xD08ED1D0L, 0xAFC725E0L, 0x8E3C5B2FL, 0x8E7594B7L,
|
||||
0x8FF6E2FBL, 0xF2122B64L, 0x8888B812L, 0x900DF01CL,
|
||||
0x4FAD5EA0L, 0x688FC31CL, 0xD1CFF191L, 0xB3A8C1ADL,
|
||||
0x2F2F2218L, 0xBE0E1777L, 0xEA752DFEL, 0x8B021FA1L,
|
||||
0xE5A0CC0FL, 0xB56F74E8L, 0x18ACF3D6L, 0xCE89E299L,
|
||||
0xB4A84FE0L, 0xFD13E0B7L, 0x7CC43B81L, 0xD2ADA8D9L,
|
||||
0x165FA266L, 0x80957705L, 0x93CC7314L, 0x211A1477L,
|
||||
0xE6AD2065L, 0x77B5FA86L, 0xC75442F5L, 0xFB9D35CFL,
|
||||
0xEBCDAF0CL, 0x7B3E89A0L, 0xD6411BD3L, 0xAE1E7E49L,
|
||||
0x00250E2DL, 0x2071B35EL, 0x226800BBL, 0x57B8E0AFL,
|
||||
0x2464369BL, 0xF009B91EL, 0x5563911DL, 0x59DFA6AAL,
|
||||
0x78C14389L, 0xD95A537FL, 0x207D5BA2L, 0x02E5B9C5L,
|
||||
0x83260376L, 0x6295CFA9L, 0x11C81968L, 0x4E734A41L,
|
||||
0xB3472DCAL, 0x7B14A94AL, 0x1B510052L, 0x9A532915L,
|
||||
0xD60F573FL, 0xBC9BC6E4L, 0x2B60A476L, 0x81E67400L,
|
||||
0x08BA6FB5L, 0x571BE91FL, 0xF296EC6BL, 0x2A0DD915L,
|
||||
0xB6636521L, 0xE7B9F9B6L, 0xFF34052EL, 0xC5855664L,
|
||||
0x53B02D5DL, 0xA99F8FA1L, 0x08BA4799L, 0x6E85076AL },
|
||||
{ 0x4B7A70E9L, 0xB5B32944L, 0xDB75092EL, 0xC4192623L,
|
||||
0xAD6EA6B0L, 0x49A7DF7DL, 0x9CEE60B8L, 0x8FEDB266L,
|
||||
0xECAA8C71L, 0x699A17FFL, 0x5664526CL, 0xC2B19EE1L,
|
||||
0x193602A5L, 0x75094C29L, 0xA0591340L, 0xE4183A3EL,
|
||||
0x3F54989AL, 0x5B429D65L, 0x6B8FE4D6L, 0x99F73FD6L,
|
||||
0xA1D29C07L, 0xEFE830F5L, 0x4D2D38E6L, 0xF0255DC1L,
|
||||
0x4CDD2086L, 0x8470EB26L, 0x6382E9C6L, 0x021ECC5EL,
|
||||
0x09686B3FL, 0x3EBAEFC9L, 0x3C971814L, 0x6B6A70A1L,
|
||||
0x687F3584L, 0x52A0E286L, 0xB79C5305L, 0xAA500737L,
|
||||
0x3E07841CL, 0x7FDEAE5CL, 0x8E7D44ECL, 0x5716F2B8L,
|
||||
0xB03ADA37L, 0xF0500C0DL, 0xF01C1F04L, 0x0200B3FFL,
|
||||
0xAE0CF51AL, 0x3CB574B2L, 0x25837A58L, 0xDC0921BDL,
|
||||
0xD19113F9L, 0x7CA92FF6L, 0x94324773L, 0x22F54701L,
|
||||
0x3AE5E581L, 0x37C2DADCL, 0xC8B57634L, 0x9AF3DDA7L,
|
||||
0xA9446146L, 0x0FD0030EL, 0xECC8C73EL, 0xA4751E41L,
|
||||
0xE238CD99L, 0x3BEA0E2FL, 0x3280BBA1L, 0x183EB331L,
|
||||
0x4E548B38L, 0x4F6DB908L, 0x6F420D03L, 0xF60A04BFL,
|
||||
0x2CB81290L, 0x24977C79L, 0x5679B072L, 0xBCAF89AFL,
|
||||
0xDE9A771FL, 0xD9930810L, 0xB38BAE12L, 0xDCCF3F2EL,
|
||||
0x5512721FL, 0x2E6B7124L, 0x501ADDE6L, 0x9F84CD87L,
|
||||
0x7A584718L, 0x7408DA17L, 0xBC9F9ABCL, 0xE94B7D8CL,
|
||||
0xEC7AEC3AL, 0xDB851DFAL, 0x63094366L, 0xC464C3D2L,
|
||||
0xEF1C1847L, 0x3215D908L, 0xDD433B37L, 0x24C2BA16L,
|
||||
0x12A14D43L, 0x2A65C451L, 0x50940002L, 0x133AE4DDL,
|
||||
0x71DFF89EL, 0x10314E55L, 0x81AC77D6L, 0x5F11199BL,
|
||||
0x043556F1L, 0xD7A3C76BL, 0x3C11183BL, 0x5924A509L,
|
||||
0xF28FE6EDL, 0x97F1FBFAL, 0x9EBABF2CL, 0x1E153C6EL,
|
||||
0x86E34570L, 0xEAE96FB1L, 0x860E5E0AL, 0x5A3E2AB3L,
|
||||
0x771FE71CL, 0x4E3D06FAL, 0x2965DCB9L, 0x99E71D0FL,
|
||||
0x803E89D6L, 0x5266C825L, 0x2E4CC978L, 0x9C10B36AL,
|
||||
0xC6150EBAL, 0x94E2EA78L, 0xA5FC3C53L, 0x1E0A2DF4L,
|
||||
0xF2F74EA7L, 0x361D2B3DL, 0x1939260FL, 0x19C27960L,
|
||||
0x5223A708L, 0xF71312B6L, 0xEBADFE6EL, 0xEAC31F66L,
|
||||
0xE3BC4595L, 0xA67BC883L, 0xB17F37D1L, 0x018CFF28L,
|
||||
0xC332DDEFL, 0xBE6C5AA5L, 0x65582185L, 0x68AB9802L,
|
||||
0xEECEA50FL, 0xDB2F953BL, 0x2AEF7DADL, 0x5B6E2F84L,
|
||||
0x1521B628L, 0x29076170L, 0xECDD4775L, 0x619F1510L,
|
||||
0x13CCA830L, 0xEB61BD96L, 0x0334FE1EL, 0xAA0363CFL,
|
||||
0xB5735C90L, 0x4C70A239L, 0xD59E9E0BL, 0xCBAADE14L,
|
||||
0xEECC86BCL, 0x60622CA7L, 0x9CAB5CABL, 0xB2F3846EL,
|
||||
0x648B1EAFL, 0x19BDF0CAL, 0xA02369B9L, 0x655ABB50L,
|
||||
0x40685A32L, 0x3C2AB4B3L, 0x319EE9D5L, 0xC021B8F7L,
|
||||
0x9B540B19L, 0x875FA099L, 0x95F7997EL, 0x623D7DA8L,
|
||||
0xF837889AL, 0x97E32D77L, 0x11ED935FL, 0x16681281L,
|
||||
0x0E358829L, 0xC7E61FD6L, 0x96DEDFA1L, 0x7858BA99L,
|
||||
0x57F584A5L, 0x1B227263L, 0x9B83C3FFL, 0x1AC24696L,
|
||||
0xCDB30AEBL, 0x532E3054L, 0x8FD948E4L, 0x6DBC3128L,
|
||||
0x58EBF2EFL, 0x34C6FFEAL, 0xFE28ED61L, 0xEE7C3C73L,
|
||||
0x5D4A14D9L, 0xE864B7E3L, 0x42105D14L, 0x203E13E0L,
|
||||
0x45EEE2B6L, 0xA3AAABEAL, 0xDB6C4F15L, 0xFACB4FD0L,
|
||||
0xC742F442L, 0xEF6ABBB5L, 0x654F3B1DL, 0x41CD2105L,
|
||||
0xD81E799EL, 0x86854DC7L, 0xE44B476AL, 0x3D816250L,
|
||||
0xCF62A1F2L, 0x5B8D2646L, 0xFC8883A0L, 0xC1C7B6A3L,
|
||||
0x7F1524C3L, 0x69CB7492L, 0x47848A0BL, 0x5692B285L,
|
||||
0x095BBF00L, 0xAD19489DL, 0x1462B174L, 0x23820E00L,
|
||||
0x58428D2AL, 0x0C55F5EAL, 0x1DADF43EL, 0x233F7061L,
|
||||
0x3372F092L, 0x8D937E41L, 0xD65FECF1L, 0x6C223BDBL,
|
||||
0x7CDE3759L, 0xCBEE7460L, 0x4085F2A7L, 0xCE77326EL,
|
||||
0xA6078084L, 0x19F8509EL, 0xE8EFD855L, 0x61D99735L,
|
||||
0xA969A7AAL, 0xC50C06C2L, 0x5A04ABFCL, 0x800BCADCL,
|
||||
0x9E447A2EL, 0xC3453484L, 0xFDD56705L, 0x0E1E9EC9L,
|
||||
0xDB73DBD3L, 0x105588CDL, 0x675FDA79L, 0xE3674340L,
|
||||
0xC5C43465L, 0x713E38D8L, 0x3D28F89EL, 0xF16DFF20L,
|
||||
0x153E21E7L, 0x8FB03D4AL, 0xE6E39F2BL, 0xDB83ADF7L },
|
||||
{ 0xE93D5A68L, 0x948140F7L, 0xF64C261CL, 0x94692934L,
|
||||
0x411520F7L, 0x7602D4F7L, 0xBCF46B2EL, 0xD4A20068L,
|
||||
0xD4082471L, 0x3320F46AL, 0x43B7D4B7L, 0x500061AFL,
|
||||
0x1E39F62EL, 0x97244546L, 0x14214F74L, 0xBF8B8840L,
|
||||
0x4D95FC1DL, 0x96B591AFL, 0x70F4DDD3L, 0x66A02F45L,
|
||||
0xBFBC09ECL, 0x03BD9785L, 0x7FAC6DD0L, 0x31CB8504L,
|
||||
0x96EB27B3L, 0x55FD3941L, 0xDA2547E6L, 0xABCA0A9AL,
|
||||
0x28507825L, 0x530429F4L, 0x0A2C86DAL, 0xE9B66DFBL,
|
||||
0x68DC1462L, 0xD7486900L, 0x680EC0A4L, 0x27A18DEEL,
|
||||
0x4F3FFEA2L, 0xE887AD8CL, 0xB58CE006L, 0x7AF4D6B6L,
|
||||
0xAACE1E7CL, 0xD3375FECL, 0xCE78A399L, 0x406B2A42L,
|
||||
0x20FE9E35L, 0xD9F385B9L, 0xEE39D7ABL, 0x3B124E8BL,
|
||||
0x1DC9FAF7L, 0x4B6D1856L, 0x26A36631L, 0xEAE397B2L,
|
||||
0x3A6EFA74L, 0xDD5B4332L, 0x6841E7F7L, 0xCA7820FBL,
|
||||
0xFB0AF54EL, 0xD8FEB397L, 0x454056ACL, 0xBA489527L,
|
||||
0x55533A3AL, 0x20838D87L, 0xFE6BA9B7L, 0xD096954BL,
|
||||
0x55A867BCL, 0xA1159A58L, 0xCCA92963L, 0x99E1DB33L,
|
||||
0xA62A4A56L, 0x3F3125F9L, 0x5EF47E1CL, 0x9029317CL,
|
||||
0xFDF8E802L, 0x04272F70L, 0x80BB155CL, 0x05282CE3L,
|
||||
0x95C11548L, 0xE4C66D22L, 0x48C1133FL, 0xC70F86DCL,
|
||||
0x07F9C9EEL, 0x41041F0FL, 0x404779A4L, 0x5D886E17L,
|
||||
0x325F51EBL, 0xD59BC0D1L, 0xF2BCC18FL, 0x41113564L,
|
||||
0x257B7834L, 0x602A9C60L, 0xDFF8E8A3L, 0x1F636C1BL,
|
||||
0x0E12B4C2L, 0x02E1329EL, 0xAF664FD1L, 0xCAD18115L,
|
||||
0x6B2395E0L, 0x333E92E1L, 0x3B240B62L, 0xEEBEB922L,
|
||||
0x85B2A20EL, 0xE6BA0D99L, 0xDE720C8CL, 0x2DA2F728L,
|
||||
0xD0127845L, 0x95B794FDL, 0x647D0862L, 0xE7CCF5F0L,
|
||||
0x5449A36FL, 0x877D48FAL, 0xC39DFD27L, 0xF33E8D1EL,
|
||||
0x0A476341L, 0x992EFF74L, 0x3A6F6EABL, 0xF4F8FD37L,
|
||||
0xA812DC60L, 0xA1EBDDF8L, 0x991BE14CL, 0xDB6E6B0DL,
|
||||
0xC67B5510L, 0x6D672C37L, 0x2765D43BL, 0xDCD0E804L,
|
||||
0xF1290DC7L, 0xCC00FFA3L, 0xB5390F92L, 0x690FED0BL,
|
||||
0x667B9FFBL, 0xCEDB7D9CL, 0xA091CF0BL, 0xD9155EA3L,
|
||||
0xBB132F88L, 0x515BAD24L, 0x7B9479BFL, 0x763BD6EBL,
|
||||
0x37392EB3L, 0xCC115979L, 0x8026E297L, 0xF42E312DL,
|
||||
0x6842ADA7L, 0xC66A2B3BL, 0x12754CCCL, 0x782EF11CL,
|
||||
0x6A124237L, 0xB79251E7L, 0x06A1BBE6L, 0x4BFB6350L,
|
||||
0x1A6B1018L, 0x11CAEDFAL, 0x3D25BDD8L, 0xE2E1C3C9L,
|
||||
0x44421659L, 0x0A121386L, 0xD90CEC6EL, 0xD5ABEA2AL,
|
||||
0x64AF674EL, 0xDA86A85FL, 0xBEBFE988L, 0x64E4C3FEL,
|
||||
0x9DBC8057L, 0xF0F7C086L, 0x60787BF8L, 0x6003604DL,
|
||||
0xD1FD8346L, 0xF6381FB0L, 0x7745AE04L, 0xD736FCCCL,
|
||||
0x83426B33L, 0xF01EAB71L, 0xB0804187L, 0x3C005E5FL,
|
||||
0x77A057BEL, 0xBDE8AE24L, 0x55464299L, 0xBF582E61L,
|
||||
0x4E58F48FL, 0xF2DDFDA2L, 0xF474EF38L, 0x8789BDC2L,
|
||||
0x5366F9C3L, 0xC8B38E74L, 0xB475F255L, 0x46FCD9B9L,
|
||||
0x7AEB2661L, 0x8B1DDF84L, 0x846A0E79L, 0x915F95E2L,
|
||||
0x466E598EL, 0x20B45770L, 0x8CD55591L, 0xC902DE4CL,
|
||||
0xB90BACE1L, 0xBB8205D0L, 0x11A86248L, 0x7574A99EL,
|
||||
0xB77F19B6L, 0xE0A9DC09L, 0x662D09A1L, 0xC4324633L,
|
||||
0xE85A1F02L, 0x09F0BE8CL, 0x4A99A025L, 0x1D6EFE10L,
|
||||
0x1AB93D1DL, 0x0BA5A4DFL, 0xA186F20FL, 0x2868F169L,
|
||||
0xDCB7DA83L, 0x573906FEL, 0xA1E2CE9BL, 0x4FCD7F52L,
|
||||
0x50115E01L, 0xA70683FAL, 0xA002B5C4L, 0x0DE6D027L,
|
||||
0x9AF88C27L, 0x773F8641L, 0xC3604C06L, 0x61A806B5L,
|
||||
0xF0177A28L, 0xC0F586E0L, 0x006058AAL, 0x30DC7D62L,
|
||||
0x11E69ED7L, 0x2338EA63L, 0x53C2DD94L, 0xC2C21634L,
|
||||
0xBBCBEE56L, 0x90BCB6DEL, 0xEBFC7DA1L, 0xCE591D76L,
|
||||
0x6F05E409L, 0x4B7C0188L, 0x39720A3DL, 0x7C927C24L,
|
||||
0x86E3725FL, 0x724D9DB9L, 0x1AC15BB4L, 0xD39EB8FCL,
|
||||
0xED545578L, 0x08FCA5B5L, 0xD83D7CD3L, 0x4DAD0FC4L,
|
||||
0x1E50EF5EL, 0xB161E6F8L, 0xA28514D9L, 0x6C51133CL,
|
||||
0x6FD5C7E7L, 0x56E14EC4L, 0x362ABFCEL, 0xDDC6C837L,
|
||||
0xD79A3234L, 0x92638212L, 0x670EFA8EL, 0x406000E0L },
|
||||
{ 0x3A39CE37L, 0xD3FAF5CFL, 0xABC27737L, 0x5AC52D1BL,
|
||||
0x5CB0679EL, 0x4FA33742L, 0xD3822740L, 0x99BC9BBEL,
|
||||
0xD5118E9DL, 0xBF0F7315L, 0xD62D1C7EL, 0xC700C47BL,
|
||||
0xB78C1B6BL, 0x21A19045L, 0xB26EB1BEL, 0x6A366EB4L,
|
||||
0x5748AB2FL, 0xBC946E79L, 0xC6A376D2L, 0x6549C2C8L,
|
||||
0x530FF8EEL, 0x468DDE7DL, 0xD5730A1DL, 0x4CD04DC6L,
|
||||
0x2939BBDBL, 0xA9BA4650L, 0xAC9526E8L, 0xBE5EE304L,
|
||||
0xA1FAD5F0L, 0x6A2D519AL, 0x63EF8CE2L, 0x9A86EE22L,
|
||||
0xC089C2B8L, 0x43242EF6L, 0xA51E03AAL, 0x9CF2D0A4L,
|
||||
0x83C061BAL, 0x9BE96A4DL, 0x8FE51550L, 0xBA645BD6L,
|
||||
0x2826A2F9L, 0xA73A3AE1L, 0x4BA99586L, 0xEF5562E9L,
|
||||
0xC72FEFD3L, 0xF752F7DAL, 0x3F046F69L, 0x77FA0A59L,
|
||||
0x80E4A915L, 0x87B08601L, 0x9B09E6ADL, 0x3B3EE593L,
|
||||
0xE990FD5AL, 0x9E34D797L, 0x2CF0B7D9L, 0x022B8B51L,
|
||||
0x96D5AC3AL, 0x017DA67DL, 0xD1CF3ED6L, 0x7C7D2D28L,
|
||||
0x1F9F25CFL, 0xADF2B89BL, 0x5AD6B472L, 0x5A88F54CL,
|
||||
0xE029AC71L, 0xE019A5E6L, 0x47B0ACFDL, 0xED93FA9BL,
|
||||
0xE8D3C48DL, 0x283B57CCL, 0xF8D56629L, 0x79132E28L,
|
||||
0x785F0191L, 0xED756055L, 0xF7960E44L, 0xE3D35E8CL,
|
||||
0x15056DD4L, 0x88F46DBAL, 0x03A16125L, 0x0564F0BDL,
|
||||
0xC3EB9E15L, 0x3C9057A2L, 0x97271AECL, 0xA93A072AL,
|
||||
0x1B3F6D9BL, 0x1E6321F5L, 0xF59C66FBL, 0x26DCF319L,
|
||||
0x7533D928L, 0xB155FDF5L, 0x03563482L, 0x8ABA3CBBL,
|
||||
0x28517711L, 0xC20AD9F8L, 0xABCC5167L, 0xCCAD925FL,
|
||||
0x4DE81751L, 0x3830DC8EL, 0x379D5862L, 0x9320F991L,
|
||||
0xEA7A90C2L, 0xFB3E7BCEL, 0x5121CE64L, 0x774FBE32L,
|
||||
0xA8B6E37EL, 0xC3293D46L, 0x48DE5369L, 0x6413E680L,
|
||||
0xA2AE0810L, 0xDD6DB224L, 0x69852DFDL, 0x09072166L,
|
||||
0xB39A460AL, 0x6445C0DDL, 0x586CDECFL, 0x1C20C8AEL,
|
||||
0x5BBEF7DDL, 0x1B588D40L, 0xCCD2017FL, 0x6BB4E3BBL,
|
||||
0xDDA26A7EL, 0x3A59FF45L, 0x3E350A44L, 0xBCB4CDD5L,
|
||||
0x72EACEA8L, 0xFA6484BBL, 0x8D6612AEL, 0xBF3C6F47L,
|
||||
0xD29BE463L, 0x542F5D9EL, 0xAEC2771BL, 0xF64E6370L,
|
||||
0x740E0D8DL, 0xE75B1357L, 0xF8721671L, 0xAF537D5DL,
|
||||
0x4040CB08L, 0x4EB4E2CCL, 0x34D2466AL, 0x0115AF84L,
|
||||
0xE1B00428L, 0x95983A1DL, 0x06B89FB4L, 0xCE6EA048L,
|
||||
0x6F3F3B82L, 0x3520AB82L, 0x011A1D4BL, 0x277227F8L,
|
||||
0x611560B1L, 0xE7933FDCL, 0xBB3A792BL, 0x344525BDL,
|
||||
0xA08839E1L, 0x51CE794BL, 0x2F32C9B7L, 0xA01FBAC9L,
|
||||
0xE01CC87EL, 0xBCC7D1F6L, 0xCF0111C3L, 0xA1E8AAC7L,
|
||||
0x1A908749L, 0xD44FBD9AL, 0xD0DADECBL, 0xD50ADA38L,
|
||||
0x0339C32AL, 0xC6913667L, 0x8DF9317CL, 0xE0B12B4FL,
|
||||
0xF79E59B7L, 0x43F5BB3AL, 0xF2D519FFL, 0x27D9459CL,
|
||||
0xBF97222CL, 0x15E6FC2AL, 0x0F91FC71L, 0x9B941525L,
|
||||
0xFAE59361L, 0xCEB69CEBL, 0xC2A86459L, 0x12BAA8D1L,
|
||||
0xB6C1075EL, 0xE3056A0CL, 0x10D25065L, 0xCB03A442L,
|
||||
0xE0EC6E0EL, 0x1698DB3BL, 0x4C98A0BEL, 0x3278E964L,
|
||||
0x9F1F9532L, 0xE0D392DFL, 0xD3A0342BL, 0x8971F21EL,
|
||||
0x1B0A7441L, 0x4BA3348CL, 0xC5BE7120L, 0xC37632D8L,
|
||||
0xDF359F8DL, 0x9B992F2EL, 0xE60B6F47L, 0x0FE3F11DL,
|
||||
0xE54CDA54L, 0x1EDAD891L, 0xCE6279CFL, 0xCD3E7E6FL,
|
||||
0x1618B166L, 0xFD2C1D05L, 0x848FD2C5L, 0xF6FB2299L,
|
||||
0xF523F357L, 0xA6327623L, 0x93A83531L, 0x56CCCD02L,
|
||||
0xACF08162L, 0x5A75EBB5L, 0x6E163697L, 0x88D273CCL,
|
||||
0xDE966292L, 0x81B949D0L, 0x4C50901BL, 0x71C65614L,
|
||||
0xE6C6C7BDL, 0x327A140AL, 0x45E1D006L, 0xC3F27B9AL,
|
||||
0xC9AA53FDL, 0x62A80F00L, 0xBB25BFE2L, 0x35BDD2F6L,
|
||||
0x71126905L, 0xB2040222L, 0xB6CBCF7CL, 0xCD769C2BL,
|
||||
0x53113EC0L, 0x1640E3D3L, 0x38ABBD60L, 0x2547ADF0L,
|
||||
0xBA38209CL, 0xF746CE76L, 0x77AFA1C5L, 0x20756060L,
|
||||
0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL,
|
||||
0x1948C25CL, 0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L,
|
||||
0x90D4F869L, 0xA65CDEA0L, 0x3F09252DL, 0xC208E69FL,
|
||||
0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L, 0x3AC372E6L }
|
||||
};
|
||||
|
||||
static uint32_t F( mbedtls_blowfish_context *ctx, uint32_t x )
|
||||
{
|
||||
@ -390,264 +647,6 @@ int mbedtls_blowfish_crypt_ctr( mbedtls_blowfish_context *ctx,
|
||||
}
|
||||
#endif /* MBEDTLS_CIPHER_MODE_CTR */
|
||||
|
||||
static const uint32_t S[4][256] = {
|
||||
{ 0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L,
|
||||
0xB8E1AFEDL, 0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L,
|
||||
0x24A19947L, 0xB3916CF7L, 0x0801F2E2L, 0x858EFC16L,
|
||||
0x636920D8L, 0x71574E69L, 0xA458FEA3L, 0xF4933D7EL,
|
||||
0x0D95748FL, 0x728EB658L, 0x718BCD58L, 0x82154AEEL,
|
||||
0x7B54A41DL, 0xC25A59B5L, 0x9C30D539L, 0x2AF26013L,
|
||||
0xC5D1B023L, 0x286085F0L, 0xCA417918L, 0xB8DB38EFL,
|
||||
0x8E79DCB0L, 0x603A180EL, 0x6C9E0E8BL, 0xB01E8A3EL,
|
||||
0xD71577C1L, 0xBD314B27L, 0x78AF2FDAL, 0x55605C60L,
|
||||
0xE65525F3L, 0xAA55AB94L, 0x57489862L, 0x63E81440L,
|
||||
0x55CA396AL, 0x2AAB10B6L, 0xB4CC5C34L, 0x1141E8CEL,
|
||||
0xA15486AFL, 0x7C72E993L, 0xB3EE1411L, 0x636FBC2AL,
|
||||
0x2BA9C55DL, 0x741831F6L, 0xCE5C3E16L, 0x9B87931EL,
|
||||
0xAFD6BA33L, 0x6C24CF5CL, 0x7A325381L, 0x28958677L,
|
||||
0x3B8F4898L, 0x6B4BB9AFL, 0xC4BFE81BL, 0x66282193L,
|
||||
0x61D809CCL, 0xFB21A991L, 0x487CAC60L, 0x5DEC8032L,
|
||||
0xEF845D5DL, 0xE98575B1L, 0xDC262302L, 0xEB651B88L,
|
||||
0x23893E81L, 0xD396ACC5L, 0x0F6D6FF3L, 0x83F44239L,
|
||||
0x2E0B4482L, 0xA4842004L, 0x69C8F04AL, 0x9E1F9B5EL,
|
||||
0x21C66842L, 0xF6E96C9AL, 0x670C9C61L, 0xABD388F0L,
|
||||
0x6A51A0D2L, 0xD8542F68L, 0x960FA728L, 0xAB5133A3L,
|
||||
0x6EEF0B6CL, 0x137A3BE4L, 0xBA3BF050L, 0x7EFB2A98L,
|
||||
0xA1F1651DL, 0x39AF0176L, 0x66CA593EL, 0x82430E88L,
|
||||
0x8CEE8619L, 0x456F9FB4L, 0x7D84A5C3L, 0x3B8B5EBEL,
|
||||
0xE06F75D8L, 0x85C12073L, 0x401A449FL, 0x56C16AA6L,
|
||||
0x4ED3AA62L, 0x363F7706L, 0x1BFEDF72L, 0x429B023DL,
|
||||
0x37D0D724L, 0xD00A1248L, 0xDB0FEAD3L, 0x49F1C09BL,
|
||||
0x075372C9L, 0x80991B7BL, 0x25D479D8L, 0xF6E8DEF7L,
|
||||
0xE3FE501AL, 0xB6794C3BL, 0x976CE0BDL, 0x04C006BAL,
|
||||
0xC1A94FB6L, 0x409F60C4L, 0x5E5C9EC2L, 0x196A2463L,
|
||||
0x68FB6FAFL, 0x3E6C53B5L, 0x1339B2EBL, 0x3B52EC6FL,
|
||||
0x6DFC511FL, 0x9B30952CL, 0xCC814544L, 0xAF5EBD09L,
|
||||
0xBEE3D004L, 0xDE334AFDL, 0x660F2807L, 0x192E4BB3L,
|
||||
0xC0CBA857L, 0x45C8740FL, 0xD20B5F39L, 0xB9D3FBDBL,
|
||||
0x5579C0BDL, 0x1A60320AL, 0xD6A100C6L, 0x402C7279L,
|
||||
0x679F25FEL, 0xFB1FA3CCL, 0x8EA5E9F8L, 0xDB3222F8L,
|
||||
0x3C7516DFL, 0xFD616B15L, 0x2F501EC8L, 0xAD0552ABL,
|
||||
0x323DB5FAL, 0xFD238760L, 0x53317B48L, 0x3E00DF82L,
|
||||
0x9E5C57BBL, 0xCA6F8CA0L, 0x1A87562EL, 0xDF1769DBL,
|
||||
0xD542A8F6L, 0x287EFFC3L, 0xAC6732C6L, 0x8C4F5573L,
|
||||
0x695B27B0L, 0xBBCA58C8L, 0xE1FFA35DL, 0xB8F011A0L,
|
||||
0x10FA3D98L, 0xFD2183B8L, 0x4AFCB56CL, 0x2DD1D35BL,
|
||||
0x9A53E479L, 0xB6F84565L, 0xD28E49BCL, 0x4BFB9790L,
|
||||
0xE1DDF2DAL, 0xA4CB7E33L, 0x62FB1341L, 0xCEE4C6E8L,
|
||||
0xEF20CADAL, 0x36774C01L, 0xD07E9EFEL, 0x2BF11FB4L,
|
||||
0x95DBDA4DL, 0xAE909198L, 0xEAAD8E71L, 0x6B93D5A0L,
|
||||
0xD08ED1D0L, 0xAFC725E0L, 0x8E3C5B2FL, 0x8E7594B7L,
|
||||
0x8FF6E2FBL, 0xF2122B64L, 0x8888B812L, 0x900DF01CL,
|
||||
0x4FAD5EA0L, 0x688FC31CL, 0xD1CFF191L, 0xB3A8C1ADL,
|
||||
0x2F2F2218L, 0xBE0E1777L, 0xEA752DFEL, 0x8B021FA1L,
|
||||
0xE5A0CC0FL, 0xB56F74E8L, 0x18ACF3D6L, 0xCE89E299L,
|
||||
0xB4A84FE0L, 0xFD13E0B7L, 0x7CC43B81L, 0xD2ADA8D9L,
|
||||
0x165FA266L, 0x80957705L, 0x93CC7314L, 0x211A1477L,
|
||||
0xE6AD2065L, 0x77B5FA86L, 0xC75442F5L, 0xFB9D35CFL,
|
||||
0xEBCDAF0CL, 0x7B3E89A0L, 0xD6411BD3L, 0xAE1E7E49L,
|
||||
0x00250E2DL, 0x2071B35EL, 0x226800BBL, 0x57B8E0AFL,
|
||||
0x2464369BL, 0xF009B91EL, 0x5563911DL, 0x59DFA6AAL,
|
||||
0x78C14389L, 0xD95A537FL, 0x207D5BA2L, 0x02E5B9C5L,
|
||||
0x83260376L, 0x6295CFA9L, 0x11C81968L, 0x4E734A41L,
|
||||
0xB3472DCAL, 0x7B14A94AL, 0x1B510052L, 0x9A532915L,
|
||||
0xD60F573FL, 0xBC9BC6E4L, 0x2B60A476L, 0x81E67400L,
|
||||
0x08BA6FB5L, 0x571BE91FL, 0xF296EC6BL, 0x2A0DD915L,
|
||||
0xB6636521L, 0xE7B9F9B6L, 0xFF34052EL, 0xC5855664L,
|
||||
0x53B02D5DL, 0xA99F8FA1L, 0x08BA4799L, 0x6E85076AL },
|
||||
{ 0x4B7A70E9L, 0xB5B32944L, 0xDB75092EL, 0xC4192623L,
|
||||
0xAD6EA6B0L, 0x49A7DF7DL, 0x9CEE60B8L, 0x8FEDB266L,
|
||||
0xECAA8C71L, 0x699A17FFL, 0x5664526CL, 0xC2B19EE1L,
|
||||
0x193602A5L, 0x75094C29L, 0xA0591340L, 0xE4183A3EL,
|
||||
0x3F54989AL, 0x5B429D65L, 0x6B8FE4D6L, 0x99F73FD6L,
|
||||
0xA1D29C07L, 0xEFE830F5L, 0x4D2D38E6L, 0xF0255DC1L,
|
||||
0x4CDD2086L, 0x8470EB26L, 0x6382E9C6L, 0x021ECC5EL,
|
||||
0x09686B3FL, 0x3EBAEFC9L, 0x3C971814L, 0x6B6A70A1L,
|
||||
0x687F3584L, 0x52A0E286L, 0xB79C5305L, 0xAA500737L,
|
||||
0x3E07841CL, 0x7FDEAE5CL, 0x8E7D44ECL, 0x5716F2B8L,
|
||||
0xB03ADA37L, 0xF0500C0DL, 0xF01C1F04L, 0x0200B3FFL,
|
||||
0xAE0CF51AL, 0x3CB574B2L, 0x25837A58L, 0xDC0921BDL,
|
||||
0xD19113F9L, 0x7CA92FF6L, 0x94324773L, 0x22F54701L,
|
||||
0x3AE5E581L, 0x37C2DADCL, 0xC8B57634L, 0x9AF3DDA7L,
|
||||
0xA9446146L, 0x0FD0030EL, 0xECC8C73EL, 0xA4751E41L,
|
||||
0xE238CD99L, 0x3BEA0E2FL, 0x3280BBA1L, 0x183EB331L,
|
||||
0x4E548B38L, 0x4F6DB908L, 0x6F420D03L, 0xF60A04BFL,
|
||||
0x2CB81290L, 0x24977C79L, 0x5679B072L, 0xBCAF89AFL,
|
||||
0xDE9A771FL, 0xD9930810L, 0xB38BAE12L, 0xDCCF3F2EL,
|
||||
0x5512721FL, 0x2E6B7124L, 0x501ADDE6L, 0x9F84CD87L,
|
||||
0x7A584718L, 0x7408DA17L, 0xBC9F9ABCL, 0xE94B7D8CL,
|
||||
0xEC7AEC3AL, 0xDB851DFAL, 0x63094366L, 0xC464C3D2L,
|
||||
0xEF1C1847L, 0x3215D908L, 0xDD433B37L, 0x24C2BA16L,
|
||||
0x12A14D43L, 0x2A65C451L, 0x50940002L, 0x133AE4DDL,
|
||||
0x71DFF89EL, 0x10314E55L, 0x81AC77D6L, 0x5F11199BL,
|
||||
0x043556F1L, 0xD7A3C76BL, 0x3C11183BL, 0x5924A509L,
|
||||
0xF28FE6EDL, 0x97F1FBFAL, 0x9EBABF2CL, 0x1E153C6EL,
|
||||
0x86E34570L, 0xEAE96FB1L, 0x860E5E0AL, 0x5A3E2AB3L,
|
||||
0x771FE71CL, 0x4E3D06FAL, 0x2965DCB9L, 0x99E71D0FL,
|
||||
0x803E89D6L, 0x5266C825L, 0x2E4CC978L, 0x9C10B36AL,
|
||||
0xC6150EBAL, 0x94E2EA78L, 0xA5FC3C53L, 0x1E0A2DF4L,
|
||||
0xF2F74EA7L, 0x361D2B3DL, 0x1939260FL, 0x19C27960L,
|
||||
0x5223A708L, 0xF71312B6L, 0xEBADFE6EL, 0xEAC31F66L,
|
||||
0xE3BC4595L, 0xA67BC883L, 0xB17F37D1L, 0x018CFF28L,
|
||||
0xC332DDEFL, 0xBE6C5AA5L, 0x65582185L, 0x68AB9802L,
|
||||
0xEECEA50FL, 0xDB2F953BL, 0x2AEF7DADL, 0x5B6E2F84L,
|
||||
0x1521B628L, 0x29076170L, 0xECDD4775L, 0x619F1510L,
|
||||
0x13CCA830L, 0xEB61BD96L, 0x0334FE1EL, 0xAA0363CFL,
|
||||
0xB5735C90L, 0x4C70A239L, 0xD59E9E0BL, 0xCBAADE14L,
|
||||
0xEECC86BCL, 0x60622CA7L, 0x9CAB5CABL, 0xB2F3846EL,
|
||||
0x648B1EAFL, 0x19BDF0CAL, 0xA02369B9L, 0x655ABB50L,
|
||||
0x40685A32L, 0x3C2AB4B3L, 0x319EE9D5L, 0xC021B8F7L,
|
||||
0x9B540B19L, 0x875FA099L, 0x95F7997EL, 0x623D7DA8L,
|
||||
0xF837889AL, 0x97E32D77L, 0x11ED935FL, 0x16681281L,
|
||||
0x0E358829L, 0xC7E61FD6L, 0x96DEDFA1L, 0x7858BA99L,
|
||||
0x57F584A5L, 0x1B227263L, 0x9B83C3FFL, 0x1AC24696L,
|
||||
0xCDB30AEBL, 0x532E3054L, 0x8FD948E4L, 0x6DBC3128L,
|
||||
0x58EBF2EFL, 0x34C6FFEAL, 0xFE28ED61L, 0xEE7C3C73L,
|
||||
0x5D4A14D9L, 0xE864B7E3L, 0x42105D14L, 0x203E13E0L,
|
||||
0x45EEE2B6L, 0xA3AAABEAL, 0xDB6C4F15L, 0xFACB4FD0L,
|
||||
0xC742F442L, 0xEF6ABBB5L, 0x654F3B1DL, 0x41CD2105L,
|
||||
0xD81E799EL, 0x86854DC7L, 0xE44B476AL, 0x3D816250L,
|
||||
0xCF62A1F2L, 0x5B8D2646L, 0xFC8883A0L, 0xC1C7B6A3L,
|
||||
0x7F1524C3L, 0x69CB7492L, 0x47848A0BL, 0x5692B285L,
|
||||
0x095BBF00L, 0xAD19489DL, 0x1462B174L, 0x23820E00L,
|
||||
0x58428D2AL, 0x0C55F5EAL, 0x1DADF43EL, 0x233F7061L,
|
||||
0x3372F092L, 0x8D937E41L, 0xD65FECF1L, 0x6C223BDBL,
|
||||
0x7CDE3759L, 0xCBEE7460L, 0x4085F2A7L, 0xCE77326EL,
|
||||
0xA6078084L, 0x19F8509EL, 0xE8EFD855L, 0x61D99735L,
|
||||
0xA969A7AAL, 0xC50C06C2L, 0x5A04ABFCL, 0x800BCADCL,
|
||||
0x9E447A2EL, 0xC3453484L, 0xFDD56705L, 0x0E1E9EC9L,
|
||||
0xDB73DBD3L, 0x105588CDL, 0x675FDA79L, 0xE3674340L,
|
||||
0xC5C43465L, 0x713E38D8L, 0x3D28F89EL, 0xF16DFF20L,
|
||||
0x153E21E7L, 0x8FB03D4AL, 0xE6E39F2BL, 0xDB83ADF7L },
|
||||
{ 0xE93D5A68L, 0x948140F7L, 0xF64C261CL, 0x94692934L,
|
||||
0x411520F7L, 0x7602D4F7L, 0xBCF46B2EL, 0xD4A20068L,
|
||||
0xD4082471L, 0x3320F46AL, 0x43B7D4B7L, 0x500061AFL,
|
||||
0x1E39F62EL, 0x97244546L, 0x14214F74L, 0xBF8B8840L,
|
||||
0x4D95FC1DL, 0x96B591AFL, 0x70F4DDD3L, 0x66A02F45L,
|
||||
0xBFBC09ECL, 0x03BD9785L, 0x7FAC6DD0L, 0x31CB8504L,
|
||||
0x96EB27B3L, 0x55FD3941L, 0xDA2547E6L, 0xABCA0A9AL,
|
||||
0x28507825L, 0x530429F4L, 0x0A2C86DAL, 0xE9B66DFBL,
|
||||
0x68DC1462L, 0xD7486900L, 0x680EC0A4L, 0x27A18DEEL,
|
||||
0x4F3FFEA2L, 0xE887AD8CL, 0xB58CE006L, 0x7AF4D6B6L,
|
||||
0xAACE1E7CL, 0xD3375FECL, 0xCE78A399L, 0x406B2A42L,
|
||||
0x20FE9E35L, 0xD9F385B9L, 0xEE39D7ABL, 0x3B124E8BL,
|
||||
0x1DC9FAF7L, 0x4B6D1856L, 0x26A36631L, 0xEAE397B2L,
|
||||
0x3A6EFA74L, 0xDD5B4332L, 0x6841E7F7L, 0xCA7820FBL,
|
||||
0xFB0AF54EL, 0xD8FEB397L, 0x454056ACL, 0xBA489527L,
|
||||
0x55533A3AL, 0x20838D87L, 0xFE6BA9B7L, 0xD096954BL,
|
||||
0x55A867BCL, 0xA1159A58L, 0xCCA92963L, 0x99E1DB33L,
|
||||
0xA62A4A56L, 0x3F3125F9L, 0x5EF47E1CL, 0x9029317CL,
|
||||
0xFDF8E802L, 0x04272F70L, 0x80BB155CL, 0x05282CE3L,
|
||||
0x95C11548L, 0xE4C66D22L, 0x48C1133FL, 0xC70F86DCL,
|
||||
0x07F9C9EEL, 0x41041F0FL, 0x404779A4L, 0x5D886E17L,
|
||||
0x325F51EBL, 0xD59BC0D1L, 0xF2BCC18FL, 0x41113564L,
|
||||
0x257B7834L, 0x602A9C60L, 0xDFF8E8A3L, 0x1F636C1BL,
|
||||
0x0E12B4C2L, 0x02E1329EL, 0xAF664FD1L, 0xCAD18115L,
|
||||
0x6B2395E0L, 0x333E92E1L, 0x3B240B62L, 0xEEBEB922L,
|
||||
0x85B2A20EL, 0xE6BA0D99L, 0xDE720C8CL, 0x2DA2F728L,
|
||||
0xD0127845L, 0x95B794FDL, 0x647D0862L, 0xE7CCF5F0L,
|
||||
0x5449A36FL, 0x877D48FAL, 0xC39DFD27L, 0xF33E8D1EL,
|
||||
0x0A476341L, 0x992EFF74L, 0x3A6F6EABL, 0xF4F8FD37L,
|
||||
0xA812DC60L, 0xA1EBDDF8L, 0x991BE14CL, 0xDB6E6B0DL,
|
||||
0xC67B5510L, 0x6D672C37L, 0x2765D43BL, 0xDCD0E804L,
|
||||
0xF1290DC7L, 0xCC00FFA3L, 0xB5390F92L, 0x690FED0BL,
|
||||
0x667B9FFBL, 0xCEDB7D9CL, 0xA091CF0BL, 0xD9155EA3L,
|
||||
0xBB132F88L, 0x515BAD24L, 0x7B9479BFL, 0x763BD6EBL,
|
||||
0x37392EB3L, 0xCC115979L, 0x8026E297L, 0xF42E312DL,
|
||||
0x6842ADA7L, 0xC66A2B3BL, 0x12754CCCL, 0x782EF11CL,
|
||||
0x6A124237L, 0xB79251E7L, 0x06A1BBE6L, 0x4BFB6350L,
|
||||
0x1A6B1018L, 0x11CAEDFAL, 0x3D25BDD8L, 0xE2E1C3C9L,
|
||||
0x44421659L, 0x0A121386L, 0xD90CEC6EL, 0xD5ABEA2AL,
|
||||
0x64AF674EL, 0xDA86A85FL, 0xBEBFE988L, 0x64E4C3FEL,
|
||||
0x9DBC8057L, 0xF0F7C086L, 0x60787BF8L, 0x6003604DL,
|
||||
0xD1FD8346L, 0xF6381FB0L, 0x7745AE04L, 0xD736FCCCL,
|
||||
0x83426B33L, 0xF01EAB71L, 0xB0804187L, 0x3C005E5FL,
|
||||
0x77A057BEL, 0xBDE8AE24L, 0x55464299L, 0xBF582E61L,
|
||||
0x4E58F48FL, 0xF2DDFDA2L, 0xF474EF38L, 0x8789BDC2L,
|
||||
0x5366F9C3L, 0xC8B38E74L, 0xB475F255L, 0x46FCD9B9L,
|
||||
0x7AEB2661L, 0x8B1DDF84L, 0x846A0E79L, 0x915F95E2L,
|
||||
0x466E598EL, 0x20B45770L, 0x8CD55591L, 0xC902DE4CL,
|
||||
0xB90BACE1L, 0xBB8205D0L, 0x11A86248L, 0x7574A99EL,
|
||||
0xB77F19B6L, 0xE0A9DC09L, 0x662D09A1L, 0xC4324633L,
|
||||
0xE85A1F02L, 0x09F0BE8CL, 0x4A99A025L, 0x1D6EFE10L,
|
||||
0x1AB93D1DL, 0x0BA5A4DFL, 0xA186F20FL, 0x2868F169L,
|
||||
0xDCB7DA83L, 0x573906FEL, 0xA1E2CE9BL, 0x4FCD7F52L,
|
||||
0x50115E01L, 0xA70683FAL, 0xA002B5C4L, 0x0DE6D027L,
|
||||
0x9AF88C27L, 0x773F8641L, 0xC3604C06L, 0x61A806B5L,
|
||||
0xF0177A28L, 0xC0F586E0L, 0x006058AAL, 0x30DC7D62L,
|
||||
0x11E69ED7L, 0x2338EA63L, 0x53C2DD94L, 0xC2C21634L,
|
||||
0xBBCBEE56L, 0x90BCB6DEL, 0xEBFC7DA1L, 0xCE591D76L,
|
||||
0x6F05E409L, 0x4B7C0188L, 0x39720A3DL, 0x7C927C24L,
|
||||
0x86E3725FL, 0x724D9DB9L, 0x1AC15BB4L, 0xD39EB8FCL,
|
||||
0xED545578L, 0x08FCA5B5L, 0xD83D7CD3L, 0x4DAD0FC4L,
|
||||
0x1E50EF5EL, 0xB161E6F8L, 0xA28514D9L, 0x6C51133CL,
|
||||
0x6FD5C7E7L, 0x56E14EC4L, 0x362ABFCEL, 0xDDC6C837L,
|
||||
0xD79A3234L, 0x92638212L, 0x670EFA8EL, 0x406000E0L },
|
||||
{ 0x3A39CE37L, 0xD3FAF5CFL, 0xABC27737L, 0x5AC52D1BL,
|
||||
0x5CB0679EL, 0x4FA33742L, 0xD3822740L, 0x99BC9BBEL,
|
||||
0xD5118E9DL, 0xBF0F7315L, 0xD62D1C7EL, 0xC700C47BL,
|
||||
0xB78C1B6BL, 0x21A19045L, 0xB26EB1BEL, 0x6A366EB4L,
|
||||
0x5748AB2FL, 0xBC946E79L, 0xC6A376D2L, 0x6549C2C8L,
|
||||
0x530FF8EEL, 0x468DDE7DL, 0xD5730A1DL, 0x4CD04DC6L,
|
||||
0x2939BBDBL, 0xA9BA4650L, 0xAC9526E8L, 0xBE5EE304L,
|
||||
0xA1FAD5F0L, 0x6A2D519AL, 0x63EF8CE2L, 0x9A86EE22L,
|
||||
0xC089C2B8L, 0x43242EF6L, 0xA51E03AAL, 0x9CF2D0A4L,
|
||||
0x83C061BAL, 0x9BE96A4DL, 0x8FE51550L, 0xBA645BD6L,
|
||||
0x2826A2F9L, 0xA73A3AE1L, 0x4BA99586L, 0xEF5562E9L,
|
||||
0xC72FEFD3L, 0xF752F7DAL, 0x3F046F69L, 0x77FA0A59L,
|
||||
0x80E4A915L, 0x87B08601L, 0x9B09E6ADL, 0x3B3EE593L,
|
||||
0xE990FD5AL, 0x9E34D797L, 0x2CF0B7D9L, 0x022B8B51L,
|
||||
0x96D5AC3AL, 0x017DA67DL, 0xD1CF3ED6L, 0x7C7D2D28L,
|
||||
0x1F9F25CFL, 0xADF2B89BL, 0x5AD6B472L, 0x5A88F54CL,
|
||||
0xE029AC71L, 0xE019A5E6L, 0x47B0ACFDL, 0xED93FA9BL,
|
||||
0xE8D3C48DL, 0x283B57CCL, 0xF8D56629L, 0x79132E28L,
|
||||
0x785F0191L, 0xED756055L, 0xF7960E44L, 0xE3D35E8CL,
|
||||
0x15056DD4L, 0x88F46DBAL, 0x03A16125L, 0x0564F0BDL,
|
||||
0xC3EB9E15L, 0x3C9057A2L, 0x97271AECL, 0xA93A072AL,
|
||||
0x1B3F6D9BL, 0x1E6321F5L, 0xF59C66FBL, 0x26DCF319L,
|
||||
0x7533D928L, 0xB155FDF5L, 0x03563482L, 0x8ABA3CBBL,
|
||||
0x28517711L, 0xC20AD9F8L, 0xABCC5167L, 0xCCAD925FL,
|
||||
0x4DE81751L, 0x3830DC8EL, 0x379D5862L, 0x9320F991L,
|
||||
0xEA7A90C2L, 0xFB3E7BCEL, 0x5121CE64L, 0x774FBE32L,
|
||||
0xA8B6E37EL, 0xC3293D46L, 0x48DE5369L, 0x6413E680L,
|
||||
0xA2AE0810L, 0xDD6DB224L, 0x69852DFDL, 0x09072166L,
|
||||
0xB39A460AL, 0x6445C0DDL, 0x586CDECFL, 0x1C20C8AEL,
|
||||
0x5BBEF7DDL, 0x1B588D40L, 0xCCD2017FL, 0x6BB4E3BBL,
|
||||
0xDDA26A7EL, 0x3A59FF45L, 0x3E350A44L, 0xBCB4CDD5L,
|
||||
0x72EACEA8L, 0xFA6484BBL, 0x8D6612AEL, 0xBF3C6F47L,
|
||||
0xD29BE463L, 0x542F5D9EL, 0xAEC2771BL, 0xF64E6370L,
|
||||
0x740E0D8DL, 0xE75B1357L, 0xF8721671L, 0xAF537D5DL,
|
||||
0x4040CB08L, 0x4EB4E2CCL, 0x34D2466AL, 0x0115AF84L,
|
||||
0xE1B00428L, 0x95983A1DL, 0x06B89FB4L, 0xCE6EA048L,
|
||||
0x6F3F3B82L, 0x3520AB82L, 0x011A1D4BL, 0x277227F8L,
|
||||
0x611560B1L, 0xE7933FDCL, 0xBB3A792BL, 0x344525BDL,
|
||||
0xA08839E1L, 0x51CE794BL, 0x2F32C9B7L, 0xA01FBAC9L,
|
||||
0xE01CC87EL, 0xBCC7D1F6L, 0xCF0111C3L, 0xA1E8AAC7L,
|
||||
0x1A908749L, 0xD44FBD9AL, 0xD0DADECBL, 0xD50ADA38L,
|
||||
0x0339C32AL, 0xC6913667L, 0x8DF9317CL, 0xE0B12B4FL,
|
||||
0xF79E59B7L, 0x43F5BB3AL, 0xF2D519FFL, 0x27D9459CL,
|
||||
0xBF97222CL, 0x15E6FC2AL, 0x0F91FC71L, 0x9B941525L,
|
||||
0xFAE59361L, 0xCEB69CEBL, 0xC2A86459L, 0x12BAA8D1L,
|
||||
0xB6C1075EL, 0xE3056A0CL, 0x10D25065L, 0xCB03A442L,
|
||||
0xE0EC6E0EL, 0x1698DB3BL, 0x4C98A0BEL, 0x3278E964L,
|
||||
0x9F1F9532L, 0xE0D392DFL, 0xD3A0342BL, 0x8971F21EL,
|
||||
0x1B0A7441L, 0x4BA3348CL, 0xC5BE7120L, 0xC37632D8L,
|
||||
0xDF359F8DL, 0x9B992F2EL, 0xE60B6F47L, 0x0FE3F11DL,
|
||||
0xE54CDA54L, 0x1EDAD891L, 0xCE6279CFL, 0xCD3E7E6FL,
|
||||
0x1618B166L, 0xFD2C1D05L, 0x848FD2C5L, 0xF6FB2299L,
|
||||
0xF523F357L, 0xA6327623L, 0x93A83531L, 0x56CCCD02L,
|
||||
0xACF08162L, 0x5A75EBB5L, 0x6E163697L, 0x88D273CCL,
|
||||
0xDE966292L, 0x81B949D0L, 0x4C50901BL, 0x71C65614L,
|
||||
0xE6C6C7BDL, 0x327A140AL, 0x45E1D006L, 0xC3F27B9AL,
|
||||
0xC9AA53FDL, 0x62A80F00L, 0xBB25BFE2L, 0x35BDD2F6L,
|
||||
0x71126905L, 0xB2040222L, 0xB6CBCF7CL, 0xCD769C2BL,
|
||||
0x53113EC0L, 0x1640E3D3L, 0x38ABBD60L, 0x2547ADF0L,
|
||||
0xBA38209CL, 0xF746CE76L, 0x77AFA1C5L, 0x20756060L,
|
||||
0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL,
|
||||
0x1948C25CL, 0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L,
|
||||
0x90D4F869L, 0xA65CDEA0L, 0x3F09252DL, 0xC208E69FL,
|
||||
0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L, 0x3AC372E6L }
|
||||
};
|
||||
|
||||
#endif /* !MBEDTLS_BLOWFISH_ALT */
|
||||
#endif /* MBEDTLS_BLOWFISH_C */
|
||||
|
24
deps/mbedtls/cipher_wrap.c
vendored
24
deps/mbedtls/cipher_wrap.c
vendored
@ -87,8 +87,8 @@ static void *gcm_ctx_alloc( void )
|
||||
|
||||
static void gcm_ctx_free( void *ctx )
|
||||
{
|
||||
mbedtls_gcm_free( ctx );
|
||||
mbedtls_free( ctx );
|
||||
mbedtls_gcm_free((mbedtls_gcm_context*)ctx);
|
||||
mbedtls_free(ctx);
|
||||
}
|
||||
#endif /* MBEDTLS_GCM_C */
|
||||
|
||||
@ -106,7 +106,7 @@ static void *ccm_ctx_alloc( void )
|
||||
|
||||
static void ccm_ctx_free( void *ctx )
|
||||
{
|
||||
mbedtls_ccm_free( ctx );
|
||||
mbedtls_ccm_free((mbedtls_ccm_context*)ctx);
|
||||
mbedtls_free( ctx );
|
||||
}
|
||||
#endif /* MBEDTLS_CCM_C */
|
||||
@ -162,7 +162,7 @@ static int aes_setkey_enc_wrap( void *ctx, const unsigned char *key,
|
||||
|
||||
static void * aes_ctx_alloc( void )
|
||||
{
|
||||
mbedtls_aes_context *aes = mbedtls_calloc( 1, sizeof( mbedtls_aes_context ) );
|
||||
mbedtls_aes_context *aes = (mbedtls_aes_context*)mbedtls_calloc( 1, sizeof( mbedtls_aes_context ) );
|
||||
|
||||
if( aes == NULL )
|
||||
return( NULL );
|
||||
@ -518,8 +518,8 @@ static int camellia_setkey_enc_wrap( void *ctx, const unsigned char *key,
|
||||
|
||||
static void * camellia_ctx_alloc( void )
|
||||
{
|
||||
mbedtls_camellia_context *ctx;
|
||||
ctx = mbedtls_calloc( 1, sizeof( mbedtls_camellia_context ) );
|
||||
mbedtls_camellia_context *ctx = (mbedtls_camellia_context*)
|
||||
mbedtls_calloc( 1, sizeof( mbedtls_camellia_context ) );
|
||||
|
||||
if( ctx == NULL )
|
||||
return( NULL );
|
||||
@ -906,7 +906,8 @@ static int des3_set3key_enc_wrap( void *ctx, const unsigned char *key,
|
||||
|
||||
static void * des_ctx_alloc( void )
|
||||
{
|
||||
mbedtls_des_context *des = mbedtls_calloc( 1, sizeof( mbedtls_des_context ) );
|
||||
mbedtls_des_context *des = (mbedtls_des_context*)
|
||||
mbedtls_calloc( 1, sizeof( mbedtls_des_context ) );
|
||||
|
||||
if( des == NULL )
|
||||
return( NULL );
|
||||
@ -924,8 +925,7 @@ static void des_ctx_free( void *ctx )
|
||||
|
||||
static void * des3_ctx_alloc( void )
|
||||
{
|
||||
mbedtls_des3_context *des3;
|
||||
des3 = mbedtls_calloc( 1, sizeof( mbedtls_des3_context ) );
|
||||
mbedtls_des3_context *des3 = (mbedtls_des3_context*)mbedtls_calloc( 1, sizeof( mbedtls_des3_context ) );
|
||||
|
||||
if( des3 == NULL )
|
||||
return( NULL );
|
||||
@ -1123,8 +1123,7 @@ static int blowfish_setkey_wrap( void *ctx, const unsigned char *key,
|
||||
|
||||
static void * blowfish_ctx_alloc( void )
|
||||
{
|
||||
mbedtls_blowfish_context *ctx;
|
||||
ctx = mbedtls_calloc( 1, sizeof( mbedtls_blowfish_context ) );
|
||||
mbedtls_blowfish_context *ctx = (mbedtls_blowfish_context*)mbedtls_calloc( 1, sizeof( mbedtls_blowfish_context ) );
|
||||
|
||||
if( ctx == NULL )
|
||||
return( NULL );
|
||||
@ -1233,8 +1232,7 @@ static int arc4_setkey_wrap( void *ctx, const unsigned char *key,
|
||||
|
||||
static void * arc4_ctx_alloc( void )
|
||||
{
|
||||
mbedtls_arc4_context *ctx;
|
||||
ctx = mbedtls_calloc( 1, sizeof( mbedtls_arc4_context ) );
|
||||
mbedtls_arc4_context *ctx = (mbedtls_arc4_context*)mbedtls_calloc( 1, sizeof( mbedtls_arc4_context ) );
|
||||
|
||||
if( ctx == NULL )
|
||||
return( NULL );
|
||||
|
2
deps/mbedtls/hmac_drbg.c
vendored
2
deps/mbedtls/hmac_drbg.c
vendored
@ -447,7 +447,7 @@ static size_t test_offset;
|
||||
static int hmac_drbg_self_test_entropy( void *data,
|
||||
unsigned char *buf, size_t len )
|
||||
{
|
||||
const unsigned char *p = data;
|
||||
const unsigned char *p = (const unsigned char*)data;
|
||||
memcpy( buf, p + test_offset, len );
|
||||
test_offset += len;
|
||||
return( 0 );
|
||||
|
4
deps/mbedtls/pem.c
vendored
4
deps/mbedtls/pem.c
vendored
@ -323,7 +323,7 @@ int mbedtls_pem_read_buffer( mbedtls_pem_context *ctx, const char *header, const
|
||||
if( ret == MBEDTLS_ERR_BASE64_INVALID_CHARACTER )
|
||||
return( MBEDTLS_ERR_PEM_INVALID_DATA + ret );
|
||||
|
||||
if( ( buf = mbedtls_calloc( 1, len ) ) == NULL )
|
||||
if( ( buf = (unsigned char*)mbedtls_calloc( 1, len ) ) == NULL )
|
||||
return( MBEDTLS_ERR_PEM_ALLOC_FAILED );
|
||||
|
||||
if( ( ret = mbedtls_base64_decode( buf, len, &len, s1, s2 - s1 ) ) != 0 )
|
||||
@ -409,7 +409,7 @@ int mbedtls_pem_write_buffer( const char *header, const char *footer,
|
||||
return( MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL );
|
||||
}
|
||||
|
||||
if( ( encode_buf = mbedtls_calloc( 1, use_len ) ) == NULL )
|
||||
if( ( encode_buf = (unsigned char*)mbedtls_calloc( 1, use_len ) ) == NULL )
|
||||
return( MBEDTLS_ERR_PEM_ALLOC_FAILED );
|
||||
|
||||
if( ( ret = mbedtls_base64_encode( encode_buf, use_len, &use_len, der_data,
|
||||
|
49
deps/mbedtls/ssl_tls.c
vendored
49
deps/mbedtls/ssl_tls.c
vendored
@ -163,7 +163,7 @@ static int ssl_session_copy( mbedtls_ssl_session *dst, const mbedtls_ssl_session
|
||||
{
|
||||
int ret;
|
||||
|
||||
dst->peer_cert = mbedtls_calloc( 1, sizeof(mbedtls_x509_crt) );
|
||||
dst->peer_cert = (mbedtls_x509_crt*)mbedtls_calloc( 1, sizeof(mbedtls_x509_crt) );
|
||||
if( dst->peer_cert == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
||||
@ -182,7 +182,7 @@ static int ssl_session_copy( mbedtls_ssl_session *dst, const mbedtls_ssl_session
|
||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C)
|
||||
if( src->ticket != NULL )
|
||||
{
|
||||
dst->ticket = mbedtls_calloc( 1, src->ticket_len );
|
||||
dst->ticket = (unsigned char*)mbedtls_calloc( 1, src->ticket_len );
|
||||
if( dst->ticket == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
||||
@ -2471,14 +2471,15 @@ static int ssl_flight_append( mbedtls_ssl_context *ssl )
|
||||
mbedtls_ssl_flight_item *msg;
|
||||
|
||||
/* Allocate space for current message */
|
||||
if( ( msg = mbedtls_calloc( 1, sizeof( mbedtls_ssl_flight_item ) ) ) == NULL )
|
||||
if( ( msg = (mbedtls_ssl_flight_item*)
|
||||
mbedtls_calloc( 1, sizeof( mbedtls_ssl_flight_item ) ) ) == NULL )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc %d bytes failed",
|
||||
sizeof( mbedtls_ssl_flight_item ) ) );
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
}
|
||||
|
||||
if( ( msg->p = mbedtls_calloc( 1, ssl->out_msglen ) ) == NULL )
|
||||
if( ( msg->p = (unsigned char*)mbedtls_calloc( 1, ssl->out_msglen ) ) == NULL )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc %d bytes failed", ssl->out_msglen ) );
|
||||
mbedtls_free( msg );
|
||||
@ -2950,7 +2951,7 @@ static int ssl_reassemble_dtls_handshake( mbedtls_ssl_context *ssl )
|
||||
/* The bitmask needs one bit per byte of message excluding header */
|
||||
alloc_len = 12 + msg_len + msg_len / 8 + ( msg_len % 8 != 0 );
|
||||
|
||||
ssl->handshake->hs_msg = mbedtls_calloc( 1, alloc_len );
|
||||
ssl->handshake->hs_msg = (unsigned char*)mbedtls_calloc( 1, alloc_len );
|
||||
if( ssl->handshake->hs_msg == NULL )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc failed (%d bytes)", alloc_len ) );
|
||||
@ -4453,7 +4454,7 @@ int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl )
|
||||
mbedtls_free( ssl->session_negotiate->peer_cert );
|
||||
}
|
||||
|
||||
if( ( ssl->session_negotiate->peer_cert = mbedtls_calloc( 1,
|
||||
if( ( ssl->session_negotiate->peer_cert = (mbedtls_x509_crt*)mbedtls_calloc( 1,
|
||||
sizeof( mbedtls_x509_crt ) ) ) == NULL )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed",
|
||||
@ -5506,17 +5507,17 @@ static int ssl_handshake_init( mbedtls_ssl_context *ssl )
|
||||
*/
|
||||
if( ssl->transform_negotiate == NULL )
|
||||
{
|
||||
ssl->transform_negotiate = mbedtls_calloc( 1, sizeof(mbedtls_ssl_transform) );
|
||||
ssl->transform_negotiate = (mbedtls_ssl_transform*)mbedtls_calloc( 1, sizeof(mbedtls_ssl_transform) );
|
||||
}
|
||||
|
||||
if( ssl->session_negotiate == NULL )
|
||||
{
|
||||
ssl->session_negotiate = mbedtls_calloc( 1, sizeof(mbedtls_ssl_session) );
|
||||
ssl->session_negotiate = (mbedtls_ssl_session*)mbedtls_calloc( 1, sizeof(mbedtls_ssl_session) );
|
||||
}
|
||||
|
||||
if( ssl->handshake == NULL )
|
||||
{
|
||||
ssl->handshake = mbedtls_calloc( 1, sizeof(mbedtls_ssl_handshake_params) );
|
||||
ssl->handshake = (mbedtls_ssl_handshake_params*)mbedtls_calloc( 1, sizeof(mbedtls_ssl_handshake_params) );
|
||||
}
|
||||
|
||||
/* All pointers should exist and can be directly freed without issue */
|
||||
@ -5610,8 +5611,8 @@ int mbedtls_ssl_setup( mbedtls_ssl_context *ssl,
|
||||
/*
|
||||
* Prepare base structures
|
||||
*/
|
||||
if( ( ssl-> in_buf = mbedtls_calloc( 1, len ) ) == NULL ||
|
||||
( ssl->out_buf = mbedtls_calloc( 1, len ) ) == NULL )
|
||||
if( ( ssl-> in_buf = (unsigned char*)mbedtls_calloc( 1, len ) ) == NULL ||
|
||||
( ssl->out_buf = (unsigned char*)mbedtls_calloc( 1, len ) ) == NULL )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed", len ) );
|
||||
mbedtls_free( ssl->in_buf );
|
||||
@ -5936,27 +5937,26 @@ static int ssl_append_key_cert( mbedtls_ssl_key_cert **head,
|
||||
mbedtls_x509_crt *cert,
|
||||
mbedtls_pk_context *key )
|
||||
{
|
||||
mbedtls_ssl_key_cert *new;
|
||||
|
||||
new = mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );
|
||||
if( new == NULL )
|
||||
mbedtls_ssl_key_cert *keycert = (mbedtls_ssl_key_cert*)
|
||||
mbedtls_calloc( 1, sizeof( mbedtls_ssl_key_cert ) );
|
||||
if( keycert == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
||||
new->cert = cert;
|
||||
new->key = key;
|
||||
new->next = NULL;
|
||||
keycert->cert = cert;
|
||||
keycert->key = key;
|
||||
keycert->next = NULL;
|
||||
|
||||
/* Update head is the list was null, else add to the end */
|
||||
if( *head == NULL )
|
||||
{
|
||||
*head = new;
|
||||
*head = keycert;
|
||||
}
|
||||
else
|
||||
{
|
||||
mbedtls_ssl_key_cert *cur = *head;
|
||||
while( cur->next != NULL )
|
||||
cur = cur->next;
|
||||
cur->next = new;
|
||||
cur->next = keycert;
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
@ -6054,8 +6054,8 @@ int mbedtls_ssl_conf_psk( mbedtls_ssl_config *conf,
|
||||
conf->psk_identity = NULL;
|
||||
}
|
||||
|
||||
if( ( conf->psk = mbedtls_calloc( 1, psk_len ) ) == NULL ||
|
||||
( conf->psk_identity = mbedtls_calloc( 1, psk_identity_len ) ) == NULL )
|
||||
if( ( conf->psk = (unsigned char*)mbedtls_calloc( 1, psk_len ) ) == NULL ||
|
||||
( conf->psk_identity = (unsigned char*)mbedtls_calloc( 1, psk_identity_len ) ) == NULL )
|
||||
{
|
||||
mbedtls_free( conf->psk );
|
||||
mbedtls_free( conf->psk_identity );
|
||||
@ -6085,7 +6085,8 @@ int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl,
|
||||
if( ssl->handshake->psk != NULL )
|
||||
mbedtls_free( ssl->handshake->psk );
|
||||
|
||||
if( ( ssl->handshake->psk = mbedtls_calloc( 1, psk_len ) ) == NULL )
|
||||
if( ( ssl->handshake->psk = (unsigned char*)
|
||||
mbedtls_calloc( 1, psk_len ) ) == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
||||
ssl->handshake->psk_len = psk_len;
|
||||
@ -6185,7 +6186,7 @@ int mbedtls_ssl_set_hostname( mbedtls_ssl_context *ssl, const char *hostname )
|
||||
if( hostname_len > MBEDTLS_SSL_MAX_HOST_NAME_LEN )
|
||||
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
|
||||
|
||||
ssl->hostname = mbedtls_calloc( 1, hostname_len + 1 );
|
||||
ssl->hostname = (char*)mbedtls_calloc( 1, hostname_len + 1 );
|
||||
|
||||
if( ssl->hostname == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
@ -16,8 +16,10 @@
|
||||
#include <file/file_path.h>
|
||||
|
||||
#include "discord.h"
|
||||
#include "discord_register.h"
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../configuration.h"
|
||||
#include "../core.h"
|
||||
#include "../core_info.h"
|
||||
#include "../paths.h"
|
||||
@ -35,7 +37,6 @@
|
||||
#include "../cheevos/cheevos.h"
|
||||
#endif
|
||||
|
||||
static const char* APPLICATION_ID = "475456035851599874";
|
||||
static int FrustrationLevel = 0;
|
||||
|
||||
static int64_t start_time = 0;
|
||||
@ -211,6 +212,7 @@ void discord_update(enum discord_presence presence)
|
||||
|
||||
void discord_init(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
DiscordEventHandlers handlers;
|
||||
|
||||
RARCH_LOG("[Discord] initializing ..\n");
|
||||
@ -224,7 +226,11 @@ void discord_init(void)
|
||||
handlers.spectateGame = handle_discord_spectate;
|
||||
handlers.joinRequest = handle_discord_join_request;
|
||||
|
||||
Discord_Initialize(APPLICATION_ID, &handlers, 1, NULL);
|
||||
/* To-Do: Add the arguments RetroArch was started with to the register URI*/
|
||||
const char command[256] = "retroarch";
|
||||
|
||||
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
|
||||
Discord_Register(settings->arrays.discord_app_id, NULL);
|
||||
|
||||
discord_ready = true;
|
||||
}
|
||||
|
5
driver.c
5
driver.c
@ -18,8 +18,6 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include <audio/audio_resampler.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@ -28,9 +26,7 @@
|
||||
#include "menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
#include "command.h"
|
||||
#include "dynamic.h"
|
||||
#include "msg_hash.h"
|
||||
|
||||
#include "audio/audio_driver.h"
|
||||
#include "camera/camera_driver.h"
|
||||
@ -40,7 +36,6 @@
|
||||
#include "led/led_driver.h"
|
||||
#include "midi/midi_driver.h"
|
||||
#include "configuration.h"
|
||||
#include "core.h"
|
||||
#include "core_info.h"
|
||||
#include "driver.h"
|
||||
#include "retroarch.h"
|
||||
|
58
dynamic.c
58
dynamic.c
@ -39,6 +39,10 @@
|
||||
#include "cheevos/cheevos.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
#include "gfx/common/gl_common.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
#include "network/netplay/netplay.h"
|
||||
#endif
|
||||
@ -50,7 +54,6 @@
|
||||
#include "camera/camera_driver.h"
|
||||
#include "location/location_driver.h"
|
||||
#include "record/record_driver.h"
|
||||
#include "core.h"
|
||||
#include "driver.h"
|
||||
#include "performance_counters.h"
|
||||
#include "gfx/video_driver.h"
|
||||
@ -58,13 +61,11 @@
|
||||
#include "midi/midi_driver.h"
|
||||
|
||||
#include "cores/internal_cores.h"
|
||||
#include "frontend/frontend_driver.h"
|
||||
#include "content.h"
|
||||
#include "dirs.h"
|
||||
#include "paths.h"
|
||||
#include "retroarch.h"
|
||||
#include "configuration.h"
|
||||
#include "msg_hash.h"
|
||||
#include "verbosity.h"
|
||||
#include "tasks/tasks_internal.h"
|
||||
|
||||
@ -314,6 +315,10 @@ static dylib_t libretro_get_system_info_lib(const char *path,
|
||||
}
|
||||
#endif
|
||||
|
||||
static char current_library_name[1024];
|
||||
static char current_library_version[1024];
|
||||
static char current_valid_extensions[1024];
|
||||
|
||||
/**
|
||||
* libretro_get_system_info:
|
||||
* @path : Path to libretro library.
|
||||
@ -370,13 +375,23 @@ bool libretro_get_system_info(const char *path,
|
||||
|
||||
memcpy(info, &dummy_info, sizeof(*info));
|
||||
|
||||
if (!string_is_empty(dummy_info.library_name))
|
||||
info->library_name = strdup(dummy_info.library_name);
|
||||
if (!string_is_empty(dummy_info.library_version))
|
||||
info->library_version = strdup(dummy_info.library_version);
|
||||
current_library_name[0] = '\0';
|
||||
current_library_version[0] = '\0';
|
||||
current_valid_extensions[0] = '\0';
|
||||
|
||||
if (!string_is_empty(dummy_info.library_name))
|
||||
strlcpy(current_library_name,
|
||||
dummy_info.library_name, sizeof(current_library_name));
|
||||
if (!string_is_empty(dummy_info.library_version))
|
||||
strlcpy(current_library_version,
|
||||
dummy_info.library_version, sizeof(current_library_version));
|
||||
if (dummy_info.valid_extensions)
|
||||
info->valid_extensions = strdup(dummy_info.valid_extensions);
|
||||
strlcpy(current_valid_extensions,
|
||||
dummy_info.valid_extensions, sizeof(current_valid_extensions));
|
||||
|
||||
info->library_name = current_library_name;
|
||||
info->library_version = current_library_version;
|
||||
info->valid_extensions = current_valid_extensions;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
dylib_close(lib);
|
||||
@ -705,10 +720,6 @@ static bool load_symbols(enum rarch_core_type type, struct retro_core_t *current
|
||||
**/
|
||||
bool init_libretro_sym(enum rarch_core_type type, struct retro_core_t *current_core)
|
||||
{
|
||||
/* Guarantee that we can do "dirty" casting.
|
||||
* Every OS that this program supports should pass this. */
|
||||
retro_assert(sizeof(void*) == sizeof(void (*)(void)));
|
||||
|
||||
if (!load_symbols(type, current_core))
|
||||
return false;
|
||||
|
||||
@ -1368,22 +1379,22 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
if (!dynamic_verify_hw_context(cb->context_type, cb->version_minor, cb->version_major))
|
||||
return false;
|
||||
|
||||
if (cb->context_type == RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
flags.flags = 0;
|
||||
BIT32_SET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
|
||||
|
||||
video_context_driver_set_flags(&flags);
|
||||
}
|
||||
#if defined(HAVE_OPENGL)
|
||||
if (!gl_set_core_context(cb->context_type)) { }
|
||||
#endif
|
||||
|
||||
cb->get_current_framebuffer = video_driver_get_current_framebuffer;
|
||||
cb->get_proc_address = video_driver_get_proc_address;
|
||||
|
||||
/* Old ABI. Don't copy garbage. */
|
||||
if (cmd & RETRO_ENVIRONMENT_EXPERIMENTAL)
|
||||
{
|
||||
memcpy(hwr,
|
||||
cb, offsetof(struct retro_hw_render_callback, stencil));
|
||||
memset(hwr + offsetof(struct retro_hw_render_callback, stencil),
|
||||
0, sizeof(*cb) - offsetof(struct retro_hw_render_callback, stencil));
|
||||
|
||||
}
|
||||
else
|
||||
memcpy(hwr, cb, sizeof(*cb));
|
||||
break;
|
||||
@ -1582,9 +1593,10 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
struct retro_subsystem_info *info_ptr = NULL;
|
||||
free(system->subsystem.data);
|
||||
system->subsystem.data = NULL;
|
||||
system->subsystem.size = 0;
|
||||
|
||||
info_ptr = (struct retro_subsystem_info*)
|
||||
calloc(i, sizeof(*info_ptr));
|
||||
malloc(i * sizeof(*info_ptr));
|
||||
|
||||
if (!info_ptr)
|
||||
return false;
|
||||
@ -1620,6 +1632,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
free(system->ports.data);
|
||||
system->ports.data = NULL;
|
||||
system->ports.size = 0;
|
||||
|
||||
info_ptr = (struct retro_controller_info*)calloc(i, sizeof(*info_ptr));
|
||||
if (!info_ptr)
|
||||
@ -1644,6 +1657,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
RARCH_LOG("Environ SET_MEMORY_MAPS.\n");
|
||||
free((void*)system->mmaps.descriptors);
|
||||
system->mmaps.descriptors = 0;
|
||||
system->mmaps.num_descriptors = 0;
|
||||
descriptors = (rarch_memory_descriptor_t*)
|
||||
calloc(mmaps->num_descriptors,
|
||||
@ -1840,6 +1854,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_REPLAYING, NULL))
|
||||
result &= ~(1|2);
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
|
||||
result |= 4;
|
||||
#endif
|
||||
if (data != NULL)
|
||||
{
|
||||
|
@ -292,6 +292,12 @@ static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
|
||||
get_ios_version(major, minor);
|
||||
strlcpy(s, "iOS", len);
|
||||
#elif defined(OSX)
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 // MAC_OS_X_VERSION_10_13
|
||||
NSOperatingSystemVersion version = NSProcessInfo.processInfo.operatingSystemVersion;
|
||||
*major = (int)version.majorVersion;
|
||||
*minor = (int)version.minorVersion;
|
||||
#else
|
||||
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)])
|
||||
{
|
||||
typedef struct
|
||||
@ -309,6 +315,7 @@ static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
|
||||
Gestalt(gestaltSystemVersionMinor, (SInt32*)minor);
|
||||
Gestalt(gestaltSystemVersionMajor, (SInt32*)major);
|
||||
}
|
||||
#endif
|
||||
strlcpy(s, "OSX", len);
|
||||
#endif
|
||||
}
|
||||
|
514
frontend/drivers/platform_ps2.c
Normal file
514
frontend/drivers/platform_ps2.c
Normal file
@ -0,0 +1,514 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
* * You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../frontend_driver.h"
|
||||
|
||||
#include <io_common.h>
|
||||
#include <loadfile.h>
|
||||
#include <unistd.h>
|
||||
#include <sbv_patches.h>
|
||||
#include <fileXio_rpc.h>
|
||||
#include <audsrv.h>
|
||||
#include <sifrpc.h>
|
||||
#include <iopcontrol.h>
|
||||
#include <libpwroff.h>
|
||||
#include <SDL/SDL.h>
|
||||
|
||||
|
||||
enum BootDeviceIDs{
|
||||
BOOT_DEVICE_UNKNOWN = -1,
|
||||
BOOT_DEVICE_MC0 = 0,
|
||||
BOOT_DEVICE_MC1,
|
||||
BOOT_DEVICE_CDROM,
|
||||
BOOT_DEVICE_MASS,
|
||||
BOOT_DEVICE_HDD,
|
||||
BOOT_DEVICE_HOST,
|
||||
|
||||
BOOT_DEVICE_COUNT,
|
||||
};
|
||||
|
||||
extern unsigned char poweroff_irx_start[];
|
||||
extern unsigned int poweroff_irx_size;
|
||||
|
||||
extern unsigned char ps2dev9_irx_start[];
|
||||
extern unsigned int ps2dev9_irx_size;
|
||||
|
||||
extern unsigned char ps2atad_irx_start[];
|
||||
extern unsigned int ps2atad_irx_size;
|
||||
|
||||
extern unsigned char ps2hdd_irx_start[];
|
||||
extern unsigned int ps2hdd_irx_size;
|
||||
|
||||
extern unsigned char ps2fs_irx_start[];
|
||||
extern unsigned int ps2fs_irx_size;
|
||||
|
||||
extern unsigned char iomanX_irx_start[];
|
||||
extern unsigned int iomanX_irx_size;
|
||||
|
||||
extern unsigned char fileXio_irx_start[];
|
||||
extern unsigned int fileXio_irx_size;
|
||||
|
||||
extern unsigned char freesd_irx_start[];
|
||||
extern unsigned int freesd_irx_size;
|
||||
|
||||
extern unsigned char audsrv_irx_start[];
|
||||
extern unsigned int audsrv_irx_size;
|
||||
|
||||
extern unsigned char usbd_irx_start[];
|
||||
extern unsigned int usbd_irx_size;
|
||||
|
||||
extern unsigned char usbhdfsd_irx_start[];
|
||||
extern unsigned int usbhdfsd_irx_size;
|
||||
|
||||
static unsigned char HDDModulesLoaded=0;
|
||||
|
||||
char eboot_path[512];
|
||||
char user_path[512];
|
||||
|
||||
static enum frontend_fork ps2_fork_mode = FRONTEND_FORK_NONE;
|
||||
|
||||
//Only paths residing on "basic" devices (devices that don't require mounting)
|
||||
//can be specified here, since this system doesn't perform mounting based on the path.
|
||||
#define DEFAULT_PATH "mass:"
|
||||
|
||||
static int getBootDeviceID(char *path) {
|
||||
int result = BOOT_DEVICE_HOST;
|
||||
|
||||
if(!strncmp(path, "mc0:", 4)) result=BOOT_DEVICE_MC0;
|
||||
else if(!strncmp(path, "mc1:", 4)) result=BOOT_DEVICE_MC1;
|
||||
else if(!strncmp(path, "cdrom0:", 7)) result=BOOT_DEVICE_CDROM;
|
||||
else if(!strncmp(path, "mass:", 5) || !strncmp(path, "mass0:", 6)) result=BOOT_DEVICE_MASS;
|
||||
else if(!strncmp(path, "hdd:", 4) || !strncmp(path, "hdd0:", 5)) result=BOOT_DEVICE_HDD;
|
||||
else if(!strncmp(path, "host", 4) && ((path[4]>='0' && path[4]<='9') || path[4]==':')) result=BOOT_DEVICE_HOST;
|
||||
else result=BOOT_DEVICE_UNKNOWN;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//HACK! If booting from a USB device, keep trying to open this program again until it succeeds. This will ensure that the emulator will be able to load its files.
|
||||
static void waitUntilDeviceIsReady(const char *path) {
|
||||
FILE *file;
|
||||
|
||||
while((file=fopen(path, "rb"))==NULL){
|
||||
//Wait for a while first, or the IOP will get swamped by requests from the EE.
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
nopdelay();
|
||||
};
|
||||
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
void setPWDOnPFS(const char *FullCWD_path) {
|
||||
int i;
|
||||
char *path;
|
||||
|
||||
path=NULL;
|
||||
for(i=strlen(FullCWD_path); i>=0; i--){ /* Try to seperate the CWD from the path to this ELF. */
|
||||
if(FullCWD_path[i]==':'){
|
||||
if((path=malloc(i+6+2))!=NULL){
|
||||
strcpy(path, "pfs0:/");
|
||||
strncat(path, FullCWD_path, i+1);
|
||||
path[i+1+6]='\0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if((FullCWD_path[i]=='\\')||(FullCWD_path[i]=='/')){
|
||||
if((path=malloc(i+6+1))!=NULL){
|
||||
strcpy(path, "pfs0:/");
|
||||
strncat(path, FullCWD_path, i);
|
||||
path[i+6]='\0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(path!=NULL){
|
||||
chdir(path);
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
|
||||
static const char *getMountParams(const char *command, char *BlockDevice) {
|
||||
const char *MountPath;
|
||||
int BlockDeviceNameLen;
|
||||
|
||||
MountPath=NULL;
|
||||
if(strlen(command)>6 && (MountPath=strchr(&command[5], ':'))!=NULL){
|
||||
BlockDeviceNameLen=(unsigned int)MountPath-(unsigned int)command;
|
||||
strncpy(BlockDevice, command, BlockDeviceNameLen);
|
||||
BlockDevice[BlockDeviceNameLen]='\0';
|
||||
|
||||
MountPath++; //This is the location of the mount path;
|
||||
}
|
||||
|
||||
return MountPath;
|
||||
}
|
||||
|
||||
static void create_path_names(void)
|
||||
{
|
||||
#ifndef IS_SALAMANDER
|
||||
#if defined(HAVE_LOGGER)
|
||||
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
retro_main_log_file_init("ux0:/temp/retroarch-log.txt"); // It really depend from where we are executing this
|
||||
#endif
|
||||
#endif
|
||||
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
"CORES", sizeof(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]));
|
||||
|
||||
/* user data */
|
||||
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,
|
||||
"CONFIG", sizeof(g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], user_path,
|
||||
"DOWNLOADS", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST], user_path,
|
||||
"PLAYLISTS", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_REMAP], g_defaults.dirs[DEFAULT_DIR_MENU_CONFIG],
|
||||
"REMAPS", sizeof(g_defaults.dirs[DEFAULT_DIR_REMAP]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SRAM], user_path,
|
||||
"SAVEFILES", sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE], user_path,
|
||||
"SAVESTATES", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT], user_path,
|
||||
"SCREENSHOTS", sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM], user_path,
|
||||
"SYSTEM", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
|
||||
/* cache dir */
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CACHE], user_path,
|
||||
"TEMP", sizeof(g_defaults.dirs[DEFAULT_DIR_CACHE]));
|
||||
|
||||
/* history and main config */
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY],
|
||||
user_path, sizeof(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]));
|
||||
fill_pathname_join(g_defaults.path.config, user_path,
|
||||
file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config));
|
||||
}
|
||||
|
||||
static void poweroffCallback(void *arg)
|
||||
{
|
||||
//Close all files and unmount all partitions.
|
||||
//close(fd);
|
||||
|
||||
//If you use PFS, close all files and unmount all partitions.
|
||||
//fileXioDevctl("pfs:", PDIOC_CLOSEALL, NULL, 0, NULL, 0)
|
||||
|
||||
//Shut down DEV9, if you used it.
|
||||
//while(fileXioDevctl("dev9x:", DDIOC_OFF, NULL, 0, NULL, 0) < 0){};
|
||||
|
||||
printf("Shutdown!");
|
||||
poweroffShutdown();
|
||||
}
|
||||
|
||||
static void frontend_ps2_get_environment_settings(int *argc, char *argv[],
|
||||
void *args, void *params_data)
|
||||
{
|
||||
char cwd[FILENAME_MAX], blockDevice[16];
|
||||
const char *mountPoint;
|
||||
int bootDeviceID;
|
||||
|
||||
//TODO: I DONT KNOW YET, WHY IT CRASHES IF UNCOMENT THIS PART
|
||||
getcwd(cwd, sizeof(cwd));
|
||||
bootDeviceID=getBootDeviceID(cwd);
|
||||
//Mount the HDD partition, if required.
|
||||
if(bootDeviceID==BOOT_DEVICE_HDD){
|
||||
/* Try not to adjust this unless you know what you are doing. The tricky part i keeping the NULL character in the middle of that argument list separated from the number 4. */
|
||||
static const char PS2HDD_args[]="-o\0""2";
|
||||
static const char PS2FS_args[]="-o\0""8";
|
||||
|
||||
if(!HDDModulesLoaded){
|
||||
SifExecModuleBuffer(poweroff_irx_start, poweroff_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(ps2dev9_irx_start, ps2dev9_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(ps2atad_irx_start, ps2atad_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(ps2hdd_irx_start, ps2hdd_irx_size, sizeof(PS2HDD_args), PS2HDD_args, NULL);
|
||||
SifExecModuleBuffer(ps2fs_irx_start, ps2fs_irx_size, sizeof(PS2FS_args), PS2FS_args, NULL);
|
||||
HDDModulesLoaded=1;
|
||||
}
|
||||
|
||||
//Attempt to mount the partition.
|
||||
if((mountPoint=getMountParams(cwd, blockDevice))!=NULL && !strncmp(mountPoint, "pfs:", 4)){
|
||||
fileXioMount("pfs0:", blockDevice, FIO_MT_RDWR);
|
||||
|
||||
setPWDOnPFS(&mountPoint[4]);
|
||||
}
|
||||
} else if(bootDeviceID==BOOT_DEVICE_CDROM){
|
||||
chdir(DEFAULT_PATH);
|
||||
} else if(bootDeviceID==BOOT_DEVICE_MASS){
|
||||
waitUntilDeviceIsReady(argv[0]);
|
||||
} else if (bootDeviceID==BOOT_DEVICE_UNKNOWN) {
|
||||
|
||||
}
|
||||
|
||||
create_path_names();
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
if (!string_is_empty(argv[1]))
|
||||
{
|
||||
static char path[PATH_MAX_LENGTH] = {0};
|
||||
struct rarch_main_wrap *args =
|
||||
(struct rarch_main_wrap*)params_data;
|
||||
|
||||
if (args)
|
||||
{
|
||||
strlcpy(path, argv[1], sizeof(path));
|
||||
|
||||
args->touched = true;
|
||||
args->no_content = false;
|
||||
args->verbose = false;
|
||||
args->config_path = NULL;
|
||||
args->sram_path = NULL;
|
||||
args->state_path = NULL;
|
||||
args->content_path = path;
|
||||
args->libretro_path = NULL;
|
||||
|
||||
RARCH_LOG("argv[0]: %s\n", argv[0]);
|
||||
RARCH_LOG("argv[1]: %s\n", argv[1]);
|
||||
RARCH_LOG("argv[2]: %s\n", argv[2]);
|
||||
|
||||
RARCH_LOG("Auto-start game %s.\n", argv[1]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
int i;
|
||||
for (i = 0; i < DEFAULT_DIR_LAST; i++)
|
||||
{
|
||||
const char *dir_path = g_defaults.dirs[i];
|
||||
if (!string_is_empty(dir_path))
|
||||
path_mkdir(dir_path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void frontend_ps2_init(void *data)
|
||||
{
|
||||
SifInitRpc(0);
|
||||
#if !defined(DEBUG)
|
||||
while(!SifIopReset(NULL, 0)){}; // Comment this line if you don't wanna debug the output
|
||||
#endif
|
||||
|
||||
while(!SifIopSync()){};
|
||||
SifInitRpc(0);
|
||||
sbv_patch_enable_lmb();
|
||||
|
||||
SifExecModuleBuffer(iomanX_irx_start, iomanX_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(fileXio_irx_start, fileXio_irx_size, 0, NULL, NULL);
|
||||
|
||||
SifLoadModule("rom0:SIO2MAN", 0, NULL);
|
||||
SifLoadModule("rom0:MCMAN", 0, NULL);
|
||||
SifLoadModule("rom0:MCSERV", 0, NULL);
|
||||
SifLoadModule("rom0:PADMAN", 0, NULL);
|
||||
|
||||
SifExecModuleBuffer(usbd_irx_start, usbd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(usbhdfsd_irx_start, usbhdfsd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(freesd_irx_start, freesd_irx_size, 0, NULL, NULL);
|
||||
SifExecModuleBuffer(audsrv_irx_start, audsrv_irx_size, 0, NULL, NULL);
|
||||
|
||||
fileXioInit();
|
||||
audsrv_init();
|
||||
|
||||
SDL_Init(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
static void frontend_ps2_deinit(void *data)
|
||||
{
|
||||
(void)data;
|
||||
#ifndef IS_SALAMANDER
|
||||
verbosity_disable();
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
fileXioUmount("pfs0:");
|
||||
fileXioExit();
|
||||
|
||||
SifExitRpc();
|
||||
}
|
||||
|
||||
static void frontend_ps2_exec(const char *path, bool should_load_game)
|
||||
{
|
||||
#if defined(IS_SALAMANDER)
|
||||
char argp[512] = {0};
|
||||
SceSize args = 0;
|
||||
|
||||
strlcpy(argp, eboot_path, sizeof(argp));
|
||||
args = strlen(argp) + 1;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
if (should_load_game && !path_is_empty(RARCH_PATH_CONTENT))
|
||||
{
|
||||
argp[args] = '\0';
|
||||
strlcat(argp + args, path_get(RARCH_PATH_CONTENT), sizeof(argp) - args);
|
||||
args += strlen(argp + args) + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
RARCH_LOG("Attempt to load executable: [%s].\n", path);
|
||||
// exitspawn_kernel(path, args, argp); // I don't know what this is doing
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
static bool frontend_ps2_set_fork(enum frontend_fork fork_mode)
|
||||
{
|
||||
switch (fork_mode)
|
||||
{
|
||||
case FRONTEND_FORK_CORE:
|
||||
RARCH_LOG("FRONTEND_FORK_CORE\n");
|
||||
ps2_fork_mode = fork_mode;
|
||||
break;
|
||||
case FRONTEND_FORK_CORE_WITH_ARGS:
|
||||
RARCH_LOG("FRONTEND_FORK_CORE_WITH_ARGS\n");
|
||||
ps2_fork_mode = fork_mode;
|
||||
break;
|
||||
case FRONTEND_FORK_RESTART:
|
||||
RARCH_LOG("FRONTEND_FORK_RESTART\n");
|
||||
/* NOTE: We don't implement Salamander, so just turn
|
||||
* this into FRONTEND_FORK_CORE. */
|
||||
ps2_fork_mode = FRONTEND_FORK_CORE;
|
||||
break;
|
||||
case FRONTEND_FORK_NONE:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void frontend_ps2_exitspawn(char *core_path, size_t core_path_size)
|
||||
{
|
||||
bool should_load_game = false;
|
||||
#ifndef IS_SALAMANDER
|
||||
if (ps2_fork_mode == FRONTEND_FORK_NONE)
|
||||
return;
|
||||
|
||||
switch (ps2_fork_mode)
|
||||
{
|
||||
case FRONTEND_FORK_CORE_WITH_ARGS:
|
||||
should_load_game = true;
|
||||
break;
|
||||
case FRONTEND_FORK_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
frontend_ps2_exec(core_path, should_load_game);
|
||||
}
|
||||
|
||||
static void frontend_ps2_shutdown(bool unused)
|
||||
{
|
||||
poweroffInit();
|
||||
//Set callback function
|
||||
poweroffSetCallback(&poweroffCallback, NULL);
|
||||
}
|
||||
|
||||
static int frontend_ps2_get_rating(void)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
enum frontend_architecture frontend_ps2_get_architecture(void)
|
||||
{
|
||||
return FRONTEND_ARCH_MIPS;
|
||||
}
|
||||
|
||||
static int frontend_ps2_parse_drive_list(void *data, bool load_content)
|
||||
{
|
||||
#ifndef IS_SALAMANDER
|
||||
file_list_t *list = (file_list_t*)data;
|
||||
enum msg_hash_enums enum_idx = load_content ?
|
||||
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR :
|
||||
MSG_UNKNOWN;
|
||||
|
||||
menu_entries_append_enum(list,
|
||||
"mc0:/",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
menu_entries_append_enum(list,
|
||||
"mc1:/",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
menu_entries_append_enum(list,
|
||||
"mass:/",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
menu_entries_append_enum(list,
|
||||
"hdd0:/",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
menu_entries_append_enum(list,
|
||||
"host:/",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
||||
enum_idx,
|
||||
FILE_TYPE_DIRECTORY, 0, 0);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_ps2 = {
|
||||
frontend_ps2_get_environment_settings, /* environment_get */
|
||||
frontend_ps2_init, /* init */
|
||||
frontend_ps2_deinit, /* deinit */
|
||||
frontend_ps2_exitspawn, /* exitspawn */
|
||||
NULL, /* process_args */
|
||||
frontend_ps2_exec, /* exec */
|
||||
#ifdef IS_SALAMANDER
|
||||
NULL, /* set_fork */
|
||||
#else
|
||||
frontend_ps2_set_fork, /* set_fork */
|
||||
#endif
|
||||
frontend_ps2_shutdown, /* shutdown */
|
||||
NULL, /* get_name */
|
||||
NULL, /* get_os */
|
||||
frontend_ps2_get_rating, /* get_rating */
|
||||
NULL, /* load_content */
|
||||
frontend_ps2_get_architecture, /* get_architecture */
|
||||
NULL, /* get_powerstate */
|
||||
frontend_ps2_parse_drive_list, /* parse_drive_list */
|
||||
NULL, /* get_mem_total */
|
||||
NULL, /* get_mem_free */
|
||||
NULL, /* install_signal_handler */
|
||||
NULL, /* get_sighandler_state */
|
||||
NULL, /* set_sighandler_state */
|
||||
NULL, /* destroy_sighandler_state */
|
||||
NULL, /* attach_console */
|
||||
NULL, /* detach_console */
|
||||
#ifdef HAVE_LAKKA
|
||||
NULL, /* get_lakka_version */
|
||||
#endif
|
||||
NULL, /* watch_path_for_changes */
|
||||
NULL, /* check_for_path_changes */
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
"null",
|
||||
};
|
@ -62,10 +62,19 @@ static uint32_t *splashData = NULL;
|
||||
|
||||
static bool psmInitialized = false;
|
||||
|
||||
static AppletHookCookie applet_hook_cookie;
|
||||
|
||||
#ifdef NXLINK
|
||||
extern bool nxlink_connected;
|
||||
#endif
|
||||
|
||||
static void on_applet_hook(AppletHookType hook, void* param) {
|
||||
if(hook == AppletHookType_OnExitRequest) {
|
||||
RARCH_LOG("Got AppletHook OnExitRequest, exiting.\n");
|
||||
retroarch_main_quit();
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_LIBNX */
|
||||
|
||||
static void get_first_valid_core(char *path_return)
|
||||
@ -191,6 +200,7 @@ static void frontend_switch_deinit(void *data)
|
||||
(void)data;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
nifmExit();
|
||||
#if defined(SWITCH) && defined(NXLINK)
|
||||
socketExit();
|
||||
#endif
|
||||
@ -208,6 +218,7 @@ static void frontend_switch_deinit(void *data)
|
||||
#ifndef HAVE_OPENGL
|
||||
gfxExit();
|
||||
#endif
|
||||
appletUnlockExit();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -607,6 +618,9 @@ static void frontend_switch_init(void *data)
|
||||
(void)data;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
nifmInitialize();
|
||||
appletLockExit();
|
||||
appletHook(&applet_hook_cookie, on_applet_hook, NULL);
|
||||
#ifndef HAVE_OPENGL
|
||||
/* Init Resolution before initDefault */
|
||||
gfxInitResolution(1280, 720);
|
||||
@ -616,6 +630,9 @@ static void frontend_switch_init(void *data)
|
||||
|
||||
gfxConfigureTransform(0);
|
||||
#endif /* HAVE_OPENGL */
|
||||
|
||||
appletInitializeGamePlayRecording();
|
||||
|
||||
#ifdef NXLINK
|
||||
socketInitializeDefault();
|
||||
nxlink_connected = nxlinkStdio() != -1;
|
||||
|
@ -565,6 +565,9 @@ static bool device_is_xperia_play(const char *name)
|
||||
strstr(name, "R800at") ||
|
||||
strstr(name, "R800i") ||
|
||||
strstr(name, "R800a") ||
|
||||
strstr(name, "R800") ||
|
||||
strstr(name, "Xperia Play") ||
|
||||
strstr(name, "Play") ||
|
||||
strstr(name, "SO-01D")
|
||||
)
|
||||
return true;
|
||||
|
@ -530,6 +530,9 @@ static void wiiu_log_init(int port)
|
||||
{
|
||||
wiiu_log_lock = 0;
|
||||
|
||||
if(wiiu_log_socket >= 0)
|
||||
return;
|
||||
|
||||
if(broadcast_init(port) < 0)
|
||||
return;
|
||||
|
||||
|
@ -56,6 +56,9 @@ static frontend_ctx_driver_t *frontend_ctx_drivers[] = {
|
||||
#if defined(PSP) || defined(VITA)
|
||||
&frontend_ctx_psp,
|
||||
#endif
|
||||
#if defined(PS2)
|
||||
&frontend_ctx_ps2,
|
||||
#endif
|
||||
#if defined(_3DS)
|
||||
&frontend_ctx_ctr,
|
||||
#endif
|
||||
@ -141,6 +144,9 @@ bool frontend_driver_get_core_extension(char *s, size_t len)
|
||||
#elif defined(VITA)
|
||||
strlcpy(s, "self|bin", len);
|
||||
return true;
|
||||
#elif defined(PS2)
|
||||
strlcpy(s, "elf", len);
|
||||
return true;
|
||||
#elif defined(_XBOX1)
|
||||
strlcpy(s, "xbe", len);
|
||||
return true;
|
||||
@ -187,6 +193,9 @@ bool frontend_driver_get_salamander_basename(char *s, size_t len)
|
||||
#elif defined(VITA)
|
||||
strlcpy(s, "eboot.bin", len);
|
||||
return true;
|
||||
#elif defined(PS2)
|
||||
strlcpy(s, "eboot.elf", len);
|
||||
return true;
|
||||
#elif defined(_XBOX1)
|
||||
strlcpy(s, "default.xbe", len);
|
||||
return true;
|
||||
|
@ -120,6 +120,7 @@ extern frontend_ctx_driver_t frontend_ctx_qnx;
|
||||
extern frontend_ctx_driver_t frontend_ctx_darwin;
|
||||
extern frontend_ctx_driver_t frontend_ctx_unix;
|
||||
extern frontend_ctx_driver_t frontend_ctx_psp;
|
||||
extern frontend_ctx_driver_t frontend_ctx_ps2;
|
||||
extern frontend_ctx_driver_t frontend_ctx_ctr;
|
||||
extern frontend_ctx_driver_t frontend_ctx_switch;
|
||||
extern frontend_ctx_driver_t frontend_ctx_win32;
|
||||
|
@ -34,6 +34,8 @@ typedef struct gdi
|
||||
unsigned video_height;
|
||||
unsigned screen_width;
|
||||
unsigned screen_height;
|
||||
void *ctx_data;
|
||||
const gfx_ctx_driver_t *ctx_driver;
|
||||
} gdi_t;
|
||||
|
||||
typedef struct gdi_texture
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <string.h>
|
||||
#include <libretro.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -316,6 +317,8 @@ struct gl
|
||||
|
||||
const gl_renderchain_driver_t *renderchain_driver;
|
||||
void *renderchain_data;
|
||||
void *ctx_data;
|
||||
const gfx_ctx_driver_t *ctx_driver;
|
||||
};
|
||||
|
||||
static INLINE void gl_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter,
|
||||
@ -386,6 +389,23 @@ static INLINE GLenum gl_min_filter_to_mag(GLenum type)
|
||||
return type;
|
||||
}
|
||||
|
||||
static INLINE bool gl_set_core_context(enum retro_hw_context_type ctx_type)
|
||||
{
|
||||
gfx_ctx_flags_t flags;
|
||||
if (ctx_type != RETRO_HW_CONTEXT_OPENGL_CORE)
|
||||
return false;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -61,6 +61,9 @@ typedef struct
|
||||
/*! @brief resets the viewport for the main render encoder to the drawable size */
|
||||
- (void)resetRenderViewport;
|
||||
|
||||
/*! @brief resets the scissor rect for the main render encoder to the drawable size */
|
||||
- (void)resetScissorRect;
|
||||
|
||||
/*! @brief draws a quad at the specified position (normalized coordinates) using the main render encoder */
|
||||
- (void)drawQuadX:(float)x y:(float)y w:(float)w h:(float)h
|
||||
r:(float)r g:(float)g b:(float)b a:(float)a;
|
||||
|
@ -565,6 +565,17 @@
|
||||
[self.rce setViewport:vp];
|
||||
}
|
||||
|
||||
- (void)resetScissorRect
|
||||
{
|
||||
MTLScissorRect sr = {
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = _viewport.full_width,
|
||||
.height = _viewport.full_height,
|
||||
};
|
||||
[self.rce setScissorRect:sr];
|
||||
}
|
||||
|
||||
- (void)drawQuadX:(float)x y:(float)y w:(float)w h:(float)h
|
||||
r:(float)r g:(float)g b:(float)b a:(float)a
|
||||
{
|
||||
|
@ -14,6 +14,8 @@
|
||||
- (instancetype)initWithContext:(Context *)context;
|
||||
- (void)drawPipeline:(menu_display_ctx_draw_t *)draw video:(video_frame_info_t *)video;
|
||||
- (void)draw:(menu_display_ctx_draw_t *)draw video:(video_frame_info_t *)video;
|
||||
- (void)setScissorRect:(MTLScissorRect)rect;
|
||||
- (void)clearScissorRect;
|
||||
|
||||
#pragma mark - static methods
|
||||
|
||||
|
@ -14,8 +14,10 @@
|
||||
{
|
||||
Context *_context;
|
||||
MTLClearColor _clearColor;
|
||||
bool _clearNextRender;
|
||||
MTLScissorRect _scissorRect;
|
||||
BOOL _useScissorRect;
|
||||
Uniforms _uniforms;
|
||||
bool _clearNextRender;
|
||||
}
|
||||
|
||||
- (instancetype)initWithContext:(Context *)context
|
||||
@ -25,6 +27,7 @@
|
||||
_context = context;
|
||||
_clearColor = MTLClearColorMake(0.0, 0.0, 0.0, 1.0);
|
||||
_uniforms.projectionMatrix = matrix_proj_ortho(0, 1, 0, 1);
|
||||
_useScissorRect = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@ -73,6 +76,19 @@
|
||||
return _clearColor;
|
||||
}
|
||||
|
||||
- (void)setScissorRect:(MTLScissorRect)rect
|
||||
{
|
||||
_scissorRect = rect;
|
||||
_useScissorRect = YES;
|
||||
}
|
||||
|
||||
- (void)clearScissorRect
|
||||
{
|
||||
_useScissorRect = NO;
|
||||
[_context resetScissorRect];
|
||||
}
|
||||
|
||||
|
||||
- (MTLPrimitiveType)_toPrimitiveType:(enum menu_display_prim_type)prim
|
||||
{
|
||||
switch (prim)
|
||||
@ -181,6 +197,10 @@
|
||||
};
|
||||
[rce setViewport:vp];
|
||||
|
||||
if (_useScissorRect) {
|
||||
[rce setScissorRect:_scissorRect];
|
||||
}
|
||||
|
||||
switch (draw->pipeline.id)
|
||||
{
|
||||
#if HAVE_SHADERPIPELINE
|
||||
|
@ -86,20 +86,16 @@
|
||||
|
||||
_frame = frame;
|
||||
|
||||
// update vertices
|
||||
CGPoint o = frame.origin;
|
||||
CGSize s = frame.size;
|
||||
|
||||
float l = o.x;
|
||||
float t = o.y;
|
||||
float r = o.x + s.width;
|
||||
float b = o.y + s.height;
|
||||
float l = (float)CGRectGetMinX(frame);
|
||||
float t = (float)CGRectGetMinY(frame);
|
||||
float r = (float)CGRectGetMaxX(frame);
|
||||
float b = (float)CGRectGetMaxY(frame);
|
||||
|
||||
Vertex v[4] = {
|
||||
{{l, b, 0}, {0, 1}},
|
||||
{{r, b, 0}, {1, 1}},
|
||||
{{l, t, 0}, {0, 0}},
|
||||
{{r, t, 0}, {1, 0}},
|
||||
{simd_make_float3(l, b, 0), simd_make_float2(0, 1)},
|
||||
{simd_make_float3(r, b, 0), simd_make_float2(1, 1)},
|
||||
{simd_make_float3(l, t, 0), simd_make_float2(0, 0)},
|
||||
{simd_make_float3(r, t, 0), simd_make_float2(1, 0)},
|
||||
};
|
||||
memcpy(_v, v, sizeof(_v));
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "metal_common.h"
|
||||
#import "../../ui/drivers/cocoa/cocoa_common.h"
|
||||
#import "../../ui/drivers/cocoa/cocoa_common_metal.h"
|
||||
#import <memory.h>
|
||||
#import <gfx/video_frame.h>
|
||||
#import <Metal/Metal.h>
|
||||
|
@ -29,6 +29,8 @@ typedef struct sixel
|
||||
unsigned video_height;
|
||||
unsigned screen_width;
|
||||
unsigned screen_height;
|
||||
void *ctx_data;
|
||||
const gfx_ctx_driver_t *ctx_driver;
|
||||
} sixel_t;
|
||||
|
||||
#endif
|
||||
|
@ -979,10 +979,18 @@ static void vulkan_check_dynamic_state(
|
||||
{
|
||||
VkRect2D sci;
|
||||
|
||||
sci.offset.x = vk->vp.x;
|
||||
sci.offset.y = vk->vp.y;
|
||||
sci.extent.width = vk->vp.width;
|
||||
sci.extent.height = vk->vp.height;
|
||||
if (vk->tracker.use_scissor)
|
||||
{
|
||||
sci = vk->tracker.scissor;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No scissor -> viewport */
|
||||
sci.offset.x = vk->vp.x;
|
||||
sci.offset.y = vk->vp.y;
|
||||
sci.extent.width = vk->vp.width;
|
||||
sci.extent.height = vk->vp.height;
|
||||
}
|
||||
|
||||
vkCmdSetViewport(vk->cmd, 0, 1, &vk->vk_vp);
|
||||
vkCmdSetScissor (vk->cmd, 0, 1, &sci);
|
||||
|
@ -332,6 +332,8 @@ typedef struct vk
|
||||
|
||||
vulkan_context_t *context;
|
||||
video_info_t video;
|
||||
void *ctx_data;
|
||||
const gfx_ctx_driver_t *ctx_driver;
|
||||
|
||||
VkFormat tex_fmt;
|
||||
math_matrix_4x4 mvp, mvp_no_rot;
|
||||
@ -421,6 +423,8 @@ typedef struct vk
|
||||
struct
|
||||
{
|
||||
uint64_t dirty;
|
||||
VkRect2D scissor;
|
||||
bool use_scissor;
|
||||
VkPipeline pipeline;
|
||||
VkImageView view;
|
||||
VkSampler sampler;
|
||||
@ -499,6 +503,7 @@ static INLINE unsigned vulkan_format_to_bpp(VkFormat format)
|
||||
return 4;
|
||||
|
||||
case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
|
||||
case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
|
||||
case VK_FORMAT_R5G6B5_UNORM_PACK16:
|
||||
return 2;
|
||||
|
||||
|
@ -47,6 +47,12 @@
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#endif
|
||||
|
||||
/* An annoyance...
|
||||
* Have to keep track of bottom screen enable state
|
||||
* externally, otherwise cannot detect current state
|
||||
* when reinitialising... */
|
||||
static bool ctr_bottom_screen_enabled = true;
|
||||
|
||||
static INLINE void ctr_check_3D_slider(ctr_video_t* ctr)
|
||||
{
|
||||
float slider_val = *(float*)0x1FF81080;
|
||||
@ -263,7 +269,7 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param)
|
||||
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = ((hook == APTHOOK_ONSUSPEND) || ctr->lcd_buttom_on)? 0x00110040: 0x00120040;
|
||||
cmdbuf[0] = ((hook == APTHOOK_ONSUSPEND) || ctr_bottom_screen_enabled)? 0x00110040: 0x00120040;
|
||||
cmdbuf[1] = 2;
|
||||
svcSendSyncRequest(lcd_handle);
|
||||
svcCloseHandle(lcd_handle);
|
||||
@ -283,11 +289,38 @@ static bool ctr_tasks_finder(retro_task_t *task,void *userdata)
|
||||
task_finder_data_t ctr_tasks_finder_data = {ctr_tasks_finder, NULL};
|
||||
#endif
|
||||
|
||||
static void ctr_set_bottom_screen_enable(void* data, bool enabled)
|
||||
{
|
||||
Handle lcd_handle;
|
||||
u8 not_2DS;
|
||||
extern PrintConsole* currentConsole;
|
||||
ctr_video_t *ctr = (ctr_video_t*)data;
|
||||
|
||||
if (!ctr)
|
||||
return;
|
||||
|
||||
gfxBottomFramebuffers[0] = enabled ? (u8*)currentConsole->frameBuffer:
|
||||
(u8*)ctr->empty_framebuffer;
|
||||
|
||||
CFGU_GetModelNintendo2DS(¬_2DS);
|
||||
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = enabled? 0x00110040: 0x00120040;
|
||||
cmdbuf[1] = 2;
|
||||
svcSendSyncRequest(lcd_handle);
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
|
||||
ctr_bottom_screen_enabled = enabled;
|
||||
}
|
||||
|
||||
static void* ctr_init(const video_info_t* video,
|
||||
const input_driver_t** input, void** input_data)
|
||||
{
|
||||
float refresh_rate;
|
||||
void* ctrinput = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
ctr_video_t* ctr = (ctr_video_t*)linearAlloc(sizeof(ctr_video_t));
|
||||
|
||||
if (!ctr)
|
||||
@ -415,7 +448,6 @@ static void* ctr_init(const video_info_t* video,
|
||||
|
||||
if (input && input_data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
ctrinput = input_ctr.init(settings->arrays.input_joypad_driver);
|
||||
*input = ctrinput ? &input_ctr : NULL;
|
||||
*input_data = ctrinput;
|
||||
@ -425,7 +457,7 @@ static void* ctr_init(const video_info_t* video,
|
||||
ctr->should_resize = true;
|
||||
ctr->smooth = video->smooth;
|
||||
ctr->vsync = video->vsync;
|
||||
ctr->lcd_buttom_on = true;
|
||||
ctr->lcd_buttom_on = true; /* Unused */
|
||||
ctr->current_buffer_top = 0;
|
||||
|
||||
ctr->empty_framebuffer = linearAlloc(320 * 240 * 2);
|
||||
@ -444,6 +476,11 @@ static void* ctr_init(const video_info_t* video,
|
||||
ctr->menu_texture_frame_enable = false;
|
||||
ctr->menu_texture_enable = false;
|
||||
|
||||
/* Set bottom screen enable state, if required */
|
||||
if (settings->bools.video_3ds_lcd_bottom != ctr_bottom_screen_enabled) {
|
||||
ctr_set_bottom_screen_enable(ctr, settings->bools.video_3ds_lcd_bottom);
|
||||
}
|
||||
|
||||
gspSetEventCallback(GSPGPU_EVENT_VBlank0, (ThreadFunc)ctr_vsync_hook, ctr, false);
|
||||
|
||||
return ctr;
|
||||
@ -494,24 +531,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
hidTouchRead(&state_tmp_touch);
|
||||
if((state_tmp & KEY_TOUCH) && (state_tmp_touch.py < 120))
|
||||
{
|
||||
Handle lcd_handle;
|
||||
u8 not_2DS;
|
||||
extern PrintConsole* currentConsole;
|
||||
|
||||
gfxBottomFramebuffers[0] = ctr->lcd_buttom_on ? (u8*)ctr->empty_framebuffer:
|
||||
(u8*)currentConsole->frameBuffer;
|
||||
|
||||
CFGU_GetModelNintendo2DS(¬_2DS);
|
||||
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = ctr->lcd_buttom_on? 0x00120040: 0x00110040;
|
||||
cmdbuf[1] = 2;
|
||||
svcSendSyncRequest(lcd_handle);
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
|
||||
ctr->lcd_buttom_on = !ctr->lcd_buttom_on;
|
||||
ctr_set_bottom_screen_enable(ctr, !ctr_bottom_screen_enabled);
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "../../driver.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#include "../video_driver.h"
|
||||
#include "../font_driver.h"
|
||||
#include "../common/win32_common.h"
|
||||
@ -909,10 +911,10 @@ d3d10_gfx_init(const video_info_t* video,
|
||||
|
||||
if (settings->bools.video_shader_enable)
|
||||
{
|
||||
const char* ext = path_get_extension(settings->paths.path_shader);
|
||||
const char* ext = path_get_extension(retroarch_get_shader_preset());
|
||||
|
||||
if (ext && !strncmp(ext, "slang", 5))
|
||||
d3d10_gfx_set_shader(d3d10, RARCH_SHADER_SLANG, settings->paths.path_shader);
|
||||
d3d10_gfx_set_shader(d3d10, RARCH_SHADER_SLANG, retroarch_get_shader_preset());
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "../../driver.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../video_driver.h"
|
||||
#include "../font_driver.h"
|
||||
#include "../common/win32_common.h"
|
||||
@ -954,10 +955,10 @@ d3d11_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
|
||||
|
||||
if (settings->bools.video_shader_enable)
|
||||
{
|
||||
const char* ext = path_get_extension(settings->paths.path_shader);
|
||||
const char* ext = path_get_extension(retroarch_get_shader_preset());
|
||||
|
||||
if (ext && !strncmp(ext, "slang", 5))
|
||||
d3d11_gfx_set_shader(d3d11, RARCH_SHADER_SLANG, settings->paths.path_shader);
|
||||
d3d11_gfx_set_shader(d3d11, RARCH_SHADER_SLANG, retroarch_get_shader_preset());
|
||||
}
|
||||
|
||||
if (video_driver_get_hw_context()->context_type == RETRO_HW_CONTEXT_DIRECT3D &&
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "../../driver.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#include "wiiu/wiiu_dbg.h"
|
||||
|
||||
@ -971,10 +972,10 @@ d3d12_gfx_init(const video_info_t* video, const input_driver_t** input, void** i
|
||||
|
||||
if (settings->bools.video_shader_enable)
|
||||
{
|
||||
const char* ext = path_get_extension(settings->paths.path_shader);
|
||||
const char* ext = path_get_extension(retroarch_get_shader_preset());
|
||||
|
||||
if (ext && string_is_equal(ext, "slangp"))
|
||||
d3d12_gfx_set_shader(d3d12, RARCH_SHADER_SLANG, settings->paths.path_shader);
|
||||
d3d12_gfx_set_shader(d3d12, RARCH_SHADER_SLANG, retroarch_get_shader_preset());
|
||||
}
|
||||
|
||||
return d3d12;
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include "../../driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
#include "../common/gdi_common.h"
|
||||
@ -82,6 +83,7 @@ static void *gdi_gfx_init(const video_info_t *video,
|
||||
unsigned full_x, full_y;
|
||||
gfx_ctx_input_t inp;
|
||||
gfx_ctx_mode_t mode;
|
||||
void *ctx_data = NULL;
|
||||
const gfx_ctx_driver_t *ctx_driver = NULL;
|
||||
unsigned win_width = 0, win_height = 0;
|
||||
unsigned temp_width = 0, temp_height = 0;
|
||||
@ -106,10 +108,14 @@ static void *gdi_gfx_init(const video_info_t *video,
|
||||
|
||||
ctx_driver = video_context_driver_init_first(gdi,
|
||||
settings->arrays.video_context_driver,
|
||||
GFX_CTX_GDI_API, 1, 0, false);
|
||||
GFX_CTX_GDI_API, 1, 0, false, &ctx_data);
|
||||
if (!ctx_driver)
|
||||
goto error;
|
||||
|
||||
if (ctx_data)
|
||||
gdi->ctx_data = ctx_data;
|
||||
|
||||
gdi->ctx_driver = ctx_driver;
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
RARCH_LOG("[GDI]: Found GDI context: %s\n", ctx_driver->ident);
|
||||
@ -193,8 +199,9 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
||||
HWND hwnd = win32_get_window();
|
||||
BITMAPINFO *info;
|
||||
|
||||
/* FIXME */
|
||||
/* FIXME: Force these settings off as they interfere with the rendering */
|
||||
video_info->xmb_shadows_enable = false;
|
||||
video_info->menu_shader_pipeline = 0;
|
||||
|
||||
if (!frame || !frame_width || !frame_height)
|
||||
return true;
|
||||
@ -355,23 +362,21 @@ static void gdi_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
|
||||
static bool gdi_gfx_alive(void *data)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
bool ret = false;
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
gdi_t *gdi = (gdi_t*)data;
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
size_data.quit = &quit;
|
||||
size_data.resize = &resize;
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
gdi->ctx_driver->check_window(gdi->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||
|
||||
if (video_context_driver_check_window(&size_data))
|
||||
ret = !quit;
|
||||
ret = !quit;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
@ -401,7 +406,7 @@ static bool gdi_gfx_has_windowed(void *data)
|
||||
static void gdi_gfx_free(void *data)
|
||||
{
|
||||
gdi_t *gdi = (gdi_t*)data;
|
||||
HWND hwnd = win32_get_window();
|
||||
HWND hwnd = win32_get_window();
|
||||
|
||||
if (gdi_menu_frame)
|
||||
{
|
||||
|
153
gfx/drivers/gl.c
153
gfx/drivers/gl.c
@ -118,10 +118,14 @@ static const GLfloat white_color[] = {
|
||||
|
||||
static bool gl_shared_context_use = false;
|
||||
|
||||
void context_bind_hw_render(bool enable)
|
||||
#define gl_context_bind_hw_render(gl, enable) \
|
||||
if (gl_shared_context_use) \
|
||||
gl->ctx_driver->bind_hw_render(gl->ctx_data, enable)
|
||||
|
||||
void context_bind_hw_render(void *data, bool enable)
|
||||
{
|
||||
if (gl_shared_context_use)
|
||||
video_context_driver_bind_hw_render(&enable);
|
||||
gl_t *gl = (gl_t*)data;
|
||||
gl_context_bind_hw_render(gl, enable);
|
||||
}
|
||||
|
||||
|
||||
@ -210,8 +214,9 @@ static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
/* Ensure that we reset the attrib array. */
|
||||
video_info->cb_shader_use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertex = gl->overlay_vertex_coord;
|
||||
gl->coords.tex_coord = gl->overlay_tex_coord;
|
||||
@ -580,19 +585,17 @@ static void gl_init_textures(gl_t *gl, const video_info_t *video)
|
||||
static INLINE void gl_set_shader_viewports(gl_t *gl)
|
||||
{
|
||||
unsigned i, width, height;
|
||||
video_shader_ctx_info_t shader_info;
|
||||
video_frame_info_t video_info;
|
||||
|
||||
video_driver_build_info(&video_info);
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
shader_info.data = gl;
|
||||
shader_info.set_active = true;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
shader_info.idx = i;
|
||||
video_shader_driver_use(&shader_info);
|
||||
if (video_info.shader_driver && video_info.shader_driver->use)
|
||||
video_info.shader_driver->use(gl,
|
||||
video_info.shader_data, i, true);
|
||||
|
||||
gl_set_viewport(gl, &video_info,
|
||||
width, height, false, true);
|
||||
}
|
||||
@ -678,7 +681,7 @@ static void gl_set_texture_frame(void *data,
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
menu_filter = settings->bools.menu_linear_filter ? TEXTURE_FILTER_LINEAR : TEXTURE_FILTER_NEAREST;
|
||||
|
||||
@ -695,7 +698,7 @@ static void gl_set_texture_frame(void *data,
|
||||
gl->menu_texture_alpha = alpha;
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
}
|
||||
|
||||
static void gl_set_texture_enable(void *data, bool state, bool full_screen)
|
||||
@ -777,8 +780,9 @@ static void gl_render_osd_background(
|
||||
video_driver_set_viewport(video_info->width,
|
||||
video_info->height, true, false);
|
||||
|
||||
video_info->cb_shader_use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
video_driver_set_coords(&coords_data);
|
||||
|
||||
@ -877,8 +881,9 @@ static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->menu_texture);
|
||||
|
||||
video_info->cb_shader_use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, VIDEO_SHADER_STOCK_BLEND, true);
|
||||
|
||||
gl->coords.vertices = 4;
|
||||
|
||||
@ -953,17 +958,19 @@ static bool gl_frame(void *data, const void *frame,
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
/* Should be called once per frame */
|
||||
// Should be called once per frame
|
||||
if(!appletMainLoop())
|
||||
return false;
|
||||
#endif
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
if (gl->core_context_in_use && gl->renderchain_driver->bind_vao)
|
||||
gl->renderchain_driver->bind_vao(gl, gl->renderchain_data);
|
||||
|
||||
video_info->cb_shader_use(gl, video_info->shader_data, 1, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, 1, true);
|
||||
|
||||
#ifdef IOS
|
||||
/* Apparently the viewport is lost each frame, thanks Apple. */
|
||||
@ -1164,7 +1171,9 @@ static bool gl_frame(void *data, const void *frame,
|
||||
/* Reset state which could easily mess up libretro core. */
|
||||
if (gl->hw_render_fbo_init)
|
||||
{
|
||||
video_info->cb_shader_use(gl, video_info->shader_data, 0, true);
|
||||
if (video_info->shader_driver && video_info->shader_driver->use)
|
||||
video_info->shader_driver->use(gl,
|
||||
video_info->shader_data, 0, true);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
if (gl->renderchain_driver->disable_client_arrays)
|
||||
@ -1226,7 +1235,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||
gl->renderchain_driver->unbind_vao(gl,
|
||||
gl->renderchain_data);
|
||||
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1266,7 +1275,7 @@ static void gl_free(void *data)
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
if (gl->have_sync)
|
||||
{
|
||||
@ -1332,13 +1341,13 @@ static void gl_set_nonblock_state(void *data, bool state)
|
||||
|
||||
RARCH_LOG("[GL]: VSync => %s\n", state ? "off" : "on");
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
if (!state)
|
||||
interval = settings->uints.video_swap_interval;
|
||||
|
||||
video_context_driver_swap_interval(&interval);
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
}
|
||||
|
||||
static bool resolve_extensions(gl_t *gl, const char *context_ident, const video_info_t *video)
|
||||
@ -1501,48 +1510,48 @@ static bool gl_init_pbo_readback(gl_t *gl)
|
||||
static const gfx_ctx_driver_t *gl_get_context(gl_t *gl)
|
||||
{
|
||||
enum gfx_ctx_api api;
|
||||
const gfx_ctx_driver_t *gfx_ctx = NULL;
|
||||
void *ctx_data = NULL;
|
||||
const char *api_name = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct retro_hw_render_callback *hwr = video_driver_get_hw_context();
|
||||
unsigned major = hwr->version_major;
|
||||
unsigned minor = hwr->version_minor;
|
||||
enum retro_hw_context_type ctx_type = hwr->context_type;
|
||||
bool hw_context_in_use = ctx_type != RETRO_HW_CONTEXT_NONE;
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
api = GFX_CTX_OPENGL_ES_API;
|
||||
api_name = "OpenGL ES 2.0";
|
||||
|
||||
switch (ctx_type)
|
||||
if (hwr->context_type == RETRO_HW_CONTEXT_OPENGLES3)
|
||||
{
|
||||
case RETRO_HW_CONTEXT_OPENGLES3:
|
||||
major = 3;
|
||||
minor = 0;
|
||||
api_name = "OpenGL ES 3.0";
|
||||
break;
|
||||
case RETRO_HW_CONTEXT_OPENGLES_VERSION:
|
||||
api_name = "OpenGL ES 3.1+";
|
||||
break;
|
||||
case RETRO_HW_CONTEXT_NONE:
|
||||
default:
|
||||
break;
|
||||
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+";
|
||||
#else
|
||||
api = GFX_CTX_OPENGL_API;
|
||||
api_name = "OpenGL";
|
||||
api = GFX_CTX_OPENGL_API;
|
||||
api_name = "OpenGL";
|
||||
#endif
|
||||
|
||||
(void)api_name;
|
||||
|
||||
gl_shared_context_use = settings->bools.video_shared_context
|
||||
&& hw_context_in_use;
|
||||
&& hwr->context_type != RETRO_HW_CONTEXT_NONE;
|
||||
|
||||
if (libretro_get_shared_context() && hw_context_in_use)
|
||||
if ( (libretro_get_shared_context())
|
||||
&& (hwr->context_type != RETRO_HW_CONTEXT_NONE))
|
||||
gl_shared_context_use = true;
|
||||
|
||||
return video_context_driver_init_first(gl,
|
||||
gfx_ctx = video_context_driver_init_first(gl,
|
||||
settings->arrays.video_context_driver,
|
||||
api, major, minor, gl_shared_context_use);
|
||||
api, major, minor, gl_shared_context_use, &ctx_data);
|
||||
|
||||
if (ctx_data)
|
||||
gl->ctx_data = ctx_data;
|
||||
|
||||
return gfx_ctx;
|
||||
}
|
||||
|
||||
#ifdef GL_DEBUG
|
||||
@ -1733,6 +1742,7 @@ static void *gl_init(const video_info_t *video,
|
||||
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
gl->ctx_driver = ctx_driver;
|
||||
gl->video_info = *video;
|
||||
|
||||
RARCH_LOG("[GL]: Found GL context: %s\n", ctx_driver->ident);
|
||||
@ -1789,18 +1799,10 @@ static void *gl_init(const video_info_t *video,
|
||||
|
||||
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);
|
||||
gl_set_core_context(hwr->context_type);
|
||||
|
||||
RARCH_LOG("[GL]: Using Core GL context, setting up VAO...\n");
|
||||
if (!gl_check_capability(GL_CAPS_VAO))
|
||||
@ -1877,9 +1879,9 @@ static void *gl_init(const video_info_t *video,
|
||||
* create textures. */
|
||||
gl->textures = 1;
|
||||
#ifdef GL_DEBUG
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
gl_begin_debug(gl);
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -2015,7 +2017,7 @@ static void *gl_init(const video_info_t *video,
|
||||
goto error;
|
||||
}
|
||||
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
return gl;
|
||||
|
||||
error:
|
||||
@ -2026,31 +2028,26 @@ error:
|
||||
|
||||
static bool gl_alive(void *data)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool ret = false;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
size_data.quit = &quit;
|
||||
size_data.resize = &resize;
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
gl->ctx_driver->check_window(gl->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||
|
||||
if (video_context_driver_check_window(&size_data))
|
||||
{
|
||||
if (quit)
|
||||
gl->quitting = true;
|
||||
else if (resize)
|
||||
gl->should_resize = true;
|
||||
if (quit)
|
||||
gl->quitting = true;
|
||||
else if (resize)
|
||||
gl->should_resize = true;
|
||||
|
||||
ret = !gl->quitting;
|
||||
}
|
||||
ret = !gl->quitting;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
@ -2077,7 +2074,7 @@ static void gl_update_tex_filter_frame(gl_t *gl)
|
||||
wrap_info.idx = 0;
|
||||
wrap_info.type = RARCH_WRAP_BORDER;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
shader_filter.index = 1;
|
||||
shader_filter.smooth = &smooth;
|
||||
@ -2114,7 +2111,7 @@ static void gl_update_tex_filter_frame(gl_t *gl)
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
}
|
||||
|
||||
static bool gl_set_shader(void *data,
|
||||
@ -2129,7 +2126,7 @@ static bool gl_set_shader(void *data,
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
if (type == RARCH_SHADER_NONE)
|
||||
return false;
|
||||
@ -2212,13 +2209,13 @@ static bool gl_set_shader(void *data,
|
||||
|
||||
/* Apparently need to set viewport for passes when we aren't using FBOs. */
|
||||
gl_set_shader_viewports(gl);
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2316,7 +2313,7 @@ static bool gl_overlay_load(void *data,
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
gl_context_bind_hw_render(gl, false);
|
||||
|
||||
gl_free_overlay(gl);
|
||||
gl->overlay_tex = (GLuint*)
|
||||
@ -2324,7 +2321,7 @@ static bool gl_overlay_load(void *data,
|
||||
|
||||
if (!gl->overlay_tex)
|
||||
{
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2362,7 +2359,7 @@ static bool gl_overlay_load(void *data,
|
||||
gl->overlay_color_coord[16 * i + j] = 1.0f;
|
||||
}
|
||||
|
||||
context_bind_hw_render(true);
|
||||
gl_context_bind_hw_render(gl, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,17 @@
|
||||
//
|
||||
// metal.m
|
||||
// RetroArch_Metal
|
||||
//
|
||||
// Created by Stuart Carnie on 5/14/18.
|
||||
//
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2018 - Stuart Carnie
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#import <Metal/Metal.h>
|
||||
#import <MetalKit/MetalKit.h>
|
||||
@ -28,9 +36,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
#import "../../menu/menu_driver.h"
|
||||
|
||||
#endif
|
||||
|
||||
#import "../font_driver.h"
|
||||
@ -145,10 +151,12 @@ static void metal_free(void *data)
|
||||
static void metal_set_viewport(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
// RARCH_LOG("[Metal]: set_viewport size: %dx%d full: %s rotate: %s\n",
|
||||
// viewport_width, viewport_height,
|
||||
// force_full ? "YES" : "NO",
|
||||
// allow_rotate ? "YES" : "NO");
|
||||
#if 0
|
||||
RARCH_LOG("[Metal]: set_viewport size: %dx%d full: %s rotate: %s\n",
|
||||
viewport_width, viewport_height,
|
||||
force_full ? "YES" : "NO",
|
||||
allow_rotate ? "YES" : "NO");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void metal_set_rotation(void *data, unsigned rotation)
|
||||
@ -270,7 +278,9 @@ static void metal_set_texture_enable(void *data, bool state, bool full_screen)
|
||||
return;
|
||||
|
||||
md.menu.enabled = state;
|
||||
//md.menu.fullScreen = full_screen;
|
||||
#if 0
|
||||
md.menu.fullScreen = full_screen;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void metal_set_osd_msg(void *data,
|
||||
@ -398,7 +408,7 @@ static const video_overlay_interface_t metal_overlay_interface = {
|
||||
};
|
||||
|
||||
static void metal_get_overlay_interface(void *data,
|
||||
const video_overlay_interface_t **iface)
|
||||
const video_overlay_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &metal_overlay_interface;
|
||||
|
424
gfx/drivers/ps2_gfx.c
Normal file
424
gfx/drivers/ps2_gfx.c
Normal file
@ -0,0 +1,424 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2018 - Francisco Javier Trujillo Mata
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include "../video_driver.h"
|
||||
|
||||
#include "../../driver.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#include <loadcore.h>
|
||||
#include <kernel.h>
|
||||
#include <gsKit.h>
|
||||
#include <gsInline.h>
|
||||
|
||||
#define GS_TEXT GS_SETREG_RGBAQ(0x80,0x80,0x80,0x80,0x00) // turn white GS Screen
|
||||
#define GS_BLACK GS_SETREG_RGBAQ(0x00,0x00,0x00,0x00,0x00) // turn white GS Screen
|
||||
|
||||
typedef struct ps2_video
|
||||
{
|
||||
GSGLOBAL *gsGlobal;
|
||||
GSTEXTURE *menuTexture;
|
||||
GSTEXTURE *coreTexture;
|
||||
|
||||
bool menuVisible;
|
||||
bool fullscreen;
|
||||
|
||||
bool rgb32;
|
||||
bool force_aspect;
|
||||
int menu_filter;
|
||||
int core_filter;
|
||||
} ps2_video_t;
|
||||
|
||||
// PRIVATE METHODS
|
||||
static GSGLOBAL *init_GSGlobal(void) {
|
||||
GSGLOBAL *gsGlobal = gsKit_init_global();
|
||||
|
||||
gsGlobal->PSM = GS_PSM_CT16;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16S;
|
||||
gsGlobal->DoubleBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->ZBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->PrimAlphaEnable = GS_SETTING_OFF;
|
||||
|
||||
dmaKit_init(D_CTRL_RELE_OFF,D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC,
|
||||
D_CTRL_STD_OFF, D_CTRL_RCYC_8, 1 << DMA_CHANNEL_GIF);
|
||||
|
||||
// Initialize the DMAC
|
||||
dmaKit_chan_init(DMA_CHANNEL_GIF);
|
||||
|
||||
gsKit_init_screen(gsGlobal);
|
||||
gsKit_mode_switch(gsGlobal, GS_ONESHOT);
|
||||
|
||||
gsKit_clear(gsGlobal, GS_BLACK);
|
||||
|
||||
return gsGlobal;
|
||||
}
|
||||
|
||||
static GSTEXTURE * prepare_new_texture(void) {
|
||||
GSTEXTURE *texture = malloc(sizeof *texture);
|
||||
texture->Width = 0;
|
||||
texture->Height = 0;
|
||||
texture->Mem = NULL;
|
||||
return texture;
|
||||
}
|
||||
|
||||
static void init_ps2_video(ps2_video_t *ps2) {
|
||||
ps2->gsGlobal = init_GSGlobal();
|
||||
ps2->menuTexture = prepare_new_texture();
|
||||
ps2->coreTexture = prepare_new_texture();
|
||||
}
|
||||
|
||||
static void deinitTexture(GSTEXTURE *texture) {
|
||||
free(texture->Mem);
|
||||
free(texture->Clut);
|
||||
texture->Mem = NULL;
|
||||
texture->Clut = NULL;
|
||||
}
|
||||
|
||||
static void color_correction32(uint32_t *buffer, uint32_t dimensions)
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t x32;
|
||||
for (i = 0; i < dimensions; i++) {
|
||||
x32 = buffer[i];
|
||||
buffer[i] = ((x32 >> 16) & 0xFF) | ((x32 << 16) & 0xFF0000) | (x32 & 0xFF00FF00);
|
||||
}
|
||||
}
|
||||
|
||||
static void color_correction16(uint16_t *buffer, uint32_t dimensions)
|
||||
{
|
||||
uint32_t i;
|
||||
uint16_t x16;
|
||||
for (i = 0; i < dimensions; i++) {
|
||||
x16 = buffer[i];
|
||||
buffer[i] = (x16 & 0x8000) | ((x16 << 10) & 0x7C00) | (x16 & 0x3E0) | ((x16 >> 10) & 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
static void transfer_texture(GSTEXTURE *texture, const void *frame,
|
||||
int width, int height, bool rgb32, int filter, bool color_correction) {
|
||||
|
||||
int PSM = rgb32 ? GS_PSM_CT32 : GS_PSM_CT16;
|
||||
size_t size = gsKit_texture_size_ee(width, height, PSM);
|
||||
if ( !texture->Mem ||
|
||||
texture->Width != width ||
|
||||
texture->Height != height ||
|
||||
texture->PSM != PSM ) {
|
||||
texture->Width = width;
|
||||
texture->Height = height;
|
||||
texture->PSM = PSM;
|
||||
texture->Filter = filter;
|
||||
free(texture->Mem);
|
||||
texture->Mem = memalign(128, size);
|
||||
}
|
||||
|
||||
if (color_correction) {
|
||||
int pixels = width * height;
|
||||
if (rgb32) {
|
||||
uint32_t *buffer = (uint32_t *)frame;
|
||||
color_correction32(buffer, pixels);
|
||||
} else {
|
||||
uint16_t *buffer = (uint16_t *)frame;
|
||||
color_correction16(buffer, pixels);
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(texture->Mem, frame, size);
|
||||
}
|
||||
|
||||
static void vram_alloc(GSGLOBAL *gsGlobal, GSTEXTURE *texture) {
|
||||
uint32_t size = gsKit_texture_size(texture->Width, texture->Height, texture->PSM);
|
||||
texture->Vram=gsKit_vram_alloc(gsGlobal, size, GSKIT_ALLOC_USERBUFFER);
|
||||
if(texture->Vram == GSKIT_ALLOC_ERROR) {
|
||||
printf("VRAM Allocation Failed. Will not upload texture.\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void prim_texture(GSGLOBAL *gsGlobal, GSTEXTURE *texture, int zPosition, bool force_aspect) {
|
||||
float x1, y1, x2, y2;
|
||||
if (force_aspect) {
|
||||
float delta = 1.0f;
|
||||
float texture_aspect_ratio = texture->Width / texture->Height;
|
||||
float gsGlobal_aspect_ratio = gsGlobal->Width / gsGlobal->Height;
|
||||
if (texture_aspect_ratio < gsGlobal_aspect_ratio) {
|
||||
//height
|
||||
delta = gsGlobal->Height / texture->Height;
|
||||
} else {
|
||||
//width
|
||||
delta = gsGlobal->Width / texture->Width;
|
||||
}
|
||||
float newWidth = texture->Width * delta;
|
||||
float newHeight = texture->Height * delta;
|
||||
|
||||
x1 = (gsGlobal->Width - newWidth) / 2.0f;
|
||||
y1 = (gsGlobal->Height - newHeight) / 2.0f;
|
||||
x2 = newWidth + x1;
|
||||
y2 = newHeight + y1;
|
||||
|
||||
} else {
|
||||
x1 = 0.0f;
|
||||
y1 = 0.0f;
|
||||
x2 = gsGlobal->Width;
|
||||
y2 = gsGlobal->Height;
|
||||
}
|
||||
|
||||
gsKit_prim_sprite_texture( gsGlobal, texture,
|
||||
x1, //X1
|
||||
y1, // Y1
|
||||
0.0f, // U1
|
||||
0.0f, // V1
|
||||
x2, // X2
|
||||
y2, // Y2
|
||||
texture->Width, // U2
|
||||
texture->Height, // V2
|
||||
zPosition,
|
||||
GS_TEXT);
|
||||
}
|
||||
|
||||
|
||||
static void *ps2_gfx_init(const video_info_t *video,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
void *ps2input = NULL;
|
||||
*input_data = NULL;
|
||||
(void)video;
|
||||
|
||||
ps2_video_t *ps2 = (ps2_video_t*)calloc(1, sizeof(ps2_video_t));
|
||||
|
||||
if (!ps2)
|
||||
return NULL;
|
||||
|
||||
init_ps2_video(ps2);
|
||||
ps2->rgb32 = video->rgb32;
|
||||
ps2->fullscreen = video->fullscreen;
|
||||
ps2->core_filter = video->smooth ? GS_FILTER_LINEAR : GS_FILTER_NEAREST;
|
||||
ps2->force_aspect = video->force_aspect;
|
||||
|
||||
if (input && input_data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
ps2input = input_ps2.init(settings->arrays.input_joypad_driver);
|
||||
*input = ps2input ? &input_ps2 : NULL;
|
||||
*input_data = ps2input;
|
||||
}
|
||||
|
||||
return ps2;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
unsigned width, unsigned height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||
{
|
||||
#ifdef DISPLAY_FPS
|
||||
uint32_t diff;
|
||||
static uint64_t currentTick,lastTick;
|
||||
static int frames;
|
||||
static float fps = 0.0;
|
||||
#endif
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
if (!width || !height)
|
||||
return false;
|
||||
|
||||
if (frame_count%120==0) {
|
||||
printf("ps2_gfx_frame %i\n", frame_count);
|
||||
}
|
||||
gsKit_vram_clear(ps2->gsGlobal);
|
||||
|
||||
if (frame) {
|
||||
transfer_texture(ps2->coreTexture, frame, width, height, ps2->rgb32, ps2->core_filter, 1);
|
||||
vram_alloc(ps2->gsGlobal, ps2->coreTexture);
|
||||
gsKit_texture_upload(ps2->gsGlobal, ps2->coreTexture);
|
||||
prim_texture(ps2->gsGlobal, ps2->coreTexture, 1, ps2->force_aspect);
|
||||
}
|
||||
|
||||
bool texture_empty = !ps2->menuTexture->Width || !ps2->menuTexture->Height;
|
||||
if (ps2->menuVisible && !texture_empty) {
|
||||
vram_alloc(ps2->gsGlobal, ps2->menuTexture);
|
||||
gsKit_texture_upload(ps2->gsGlobal, ps2->menuTexture);
|
||||
prim_texture(ps2->gsGlobal, ps2->menuTexture, 2, ps2->fullscreen);
|
||||
}
|
||||
|
||||
gsKit_sync_flip(ps2->gsGlobal);
|
||||
gsKit_queue_exec(ps2->gsGlobal);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ps2_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
(void)data;
|
||||
(void)toggle;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_alive(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ps2_gfx_free(void *data)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
gsKit_clear(ps2->gsGlobal, GS_BLACK);
|
||||
gsKit_vram_clear(ps2->gsGlobal);
|
||||
|
||||
deinitTexture(ps2->menuTexture);
|
||||
deinitTexture(ps2->coreTexture);
|
||||
|
||||
gsKit_deinit_global(ps2->gsGlobal);
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
static bool ps2_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ps2_gfx_set_rotation(void *data,
|
||||
unsigned rotation)
|
||||
{
|
||||
(void)data;
|
||||
(void)rotation;
|
||||
}
|
||||
|
||||
static void ps2_gfx_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
(void)data;
|
||||
(void)vp;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
{
|
||||
(void)data;
|
||||
(void)buffer;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ps2_set_filtering(void *data, unsigned index, bool smooth)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
ps2->menu_filter = smooth ? GS_FILTER_LINEAR : GS_FILTER_NEAREST;
|
||||
}
|
||||
|
||||
static void ps2_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
}
|
||||
|
||||
static void ps2_apply_state_changes(void *data)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
}
|
||||
|
||||
static void ps2_set_texture_frame(void *data, const void *frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
transfer_texture(ps2->menuTexture, frame, width, height, rgb32, ps2->menu_filter, 0);
|
||||
}
|
||||
|
||||
static void ps2_set_texture_enable(void *data, bool enable, bool fullscreen)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
ps2->menuVisible = enable;
|
||||
ps2->fullscreen = fullscreen;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t ps2_poke_interface = {
|
||||
NULL, /* get_flags */
|
||||
NULL, /* set_coords */
|
||||
NULL, /* set_mvp */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* get_refresh_rate */
|
||||
ps2_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL, /* get_proc_address */
|
||||
ps2_set_aspect_ratio,
|
||||
ps2_apply_state_changes,
|
||||
ps2_set_texture_frame,
|
||||
ps2_set_texture_enable,
|
||||
NULL, /* set_osd_msg */
|
||||
NULL, /* show_mouse */
|
||||
NULL, /* grab_mouse_toggle */
|
||||
NULL, /* get_current_shader */
|
||||
NULL, /* get_current_software_framebuffer */
|
||||
NULL /* get_hw_render_interface */
|
||||
};
|
||||
|
||||
|
||||
static void ps2_gfx_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &ps2_poke_interface;
|
||||
}
|
||||
|
||||
video_driver_t video_ps2 = {
|
||||
ps2_gfx_init,
|
||||
ps2_gfx_frame,
|
||||
ps2_gfx_set_nonblock_state,
|
||||
ps2_gfx_alive,
|
||||
ps2_gfx_focus,
|
||||
ps2_gfx_suppress_screensaver,
|
||||
ps2_gfx_has_windowed,
|
||||
ps2_gfx_set_shader,
|
||||
ps2_gfx_free,
|
||||
"ps2",
|
||||
NULL, /* set_viewport */
|
||||
ps2_gfx_set_rotation,
|
||||
ps2_gfx_viewport_info,
|
||||
ps2_gfx_read_viewport,
|
||||
NULL, /* read_frame_raw */
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL, /* overlay_interface */
|
||||
#endif
|
||||
ps2_gfx_get_poke_interface,
|
||||
};
|
@ -188,9 +188,10 @@ static void scroll_on_demand(int pixelheight)
|
||||
static void *sixel_gfx_init(const video_info_t *video,
|
||||
const input_driver_t **input, void **input_data)
|
||||
{
|
||||
gfx_ctx_input_t inp;
|
||||
void *ctx_data = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
sixel_t *sixel = (sixel_t*)calloc(1, sizeof(*sixel));
|
||||
gfx_ctx_input_t inp;
|
||||
const gfx_ctx_driver_t *ctx_driver = NULL;
|
||||
const char *scale_str = NULL;
|
||||
|
||||
@ -218,11 +219,15 @@ static void *sixel_gfx_init(const video_info_t *video,
|
||||
|
||||
ctx_driver = video_context_driver_init_first(sixel,
|
||||
settings->arrays.video_context_driver,
|
||||
GFX_CTX_SIXEL_API, 1, 0, false);
|
||||
GFX_CTX_SIXEL_API, 1, 0, false, &ctx_data);
|
||||
|
||||
if (!ctx_driver)
|
||||
goto error;
|
||||
|
||||
if (ctx_data)
|
||||
sixel->ctx_data = ctx_data;
|
||||
|
||||
sixel->ctx_driver = ctx_driver;
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
RARCH_LOG("[SIXEL]: Found SIXEL context: %s\n", ctx_driver->ident);
|
||||
@ -434,16 +439,14 @@ static bool sixel_gfx_alive(void *data)
|
||||
unsigned temp_height = 0;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
sixel_t *sixel = (sixel_t*)data;
|
||||
|
||||
/* Needed because some context drivers don't track their sizes */
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
size_data.quit = &quit;
|
||||
size_data.resize = &resize;
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
|
||||
video_context_driver_check_window(&size_data);
|
||||
sixel->ctx_driver->check_window(sixel->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
|
@ -71,6 +71,8 @@ typedef struct
|
||||
VGuint mGlyphIndices[1024];
|
||||
VGPaint mPaintFg;
|
||||
VGPaint mPaintBg;
|
||||
void *ctx_data;
|
||||
const gfx_ctx_driver_t *ctx_driver;
|
||||
} vg_t;
|
||||
|
||||
static PFNVGCREATEEGLIMAGETARGETKHRPROC pvgCreateEGLImageTargetKHR;
|
||||
@ -102,15 +104,20 @@ static void *vg_init(const video_info_t *video,
|
||||
int interval = 0;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
void *ctx_data = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
vg_t *vg = (vg_t*)calloc(1, sizeof(vg_t));
|
||||
const gfx_ctx_driver_t *ctx = video_context_driver_init_first(
|
||||
vg, settings->arrays.video_context_driver,
|
||||
GFX_CTX_OPENVG_API, 0, 0, false);
|
||||
GFX_CTX_OPENVG_API, 0, 0, false, &ctx_data);
|
||||
|
||||
if (!vg || !ctx)
|
||||
goto error;
|
||||
|
||||
if (ctx_data)
|
||||
vg->ctx_data = ctx_data;
|
||||
|
||||
vg->ctx_driver = ctx;
|
||||
video_context_driver_set((void*)ctx);
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
@ -434,18 +441,15 @@ static bool vg_frame(void *data, const void *frame,
|
||||
|
||||
static bool vg_alive(void *data)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
vg_t *vg = (vg_t*)data;
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
|
||||
size_data.quit = &quit;
|
||||
size_data.resize = &vg->should_resize;
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
|
||||
video_context_driver_check_window(&size_data);
|
||||
vg->ctx_driver->check_window(vg->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
|
@ -61,14 +61,19 @@ static void vulkan_viewport_info(void *data, struct video_viewport *vp);
|
||||
|
||||
static const gfx_ctx_driver_t *vulkan_get_context(vk_t *vk)
|
||||
{
|
||||
unsigned major = 1;
|
||||
unsigned minor = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
enum gfx_ctx_api api = GFX_CTX_VULKAN_API;
|
||||
|
||||
return video_context_driver_init_first(
|
||||
void *ctx_data = NULL;
|
||||
unsigned major = 1;
|
||||
unsigned minor = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
enum gfx_ctx_api api = GFX_CTX_VULKAN_API;
|
||||
const gfx_ctx_driver_t *gfx_ctx = video_context_driver_init_first(
|
||||
vk, settings->arrays.video_context_driver,
|
||||
api, major, minor, false);
|
||||
api, major, minor, false, &ctx_data);
|
||||
|
||||
if (ctx_data)
|
||||
vk->ctx_data = ctx_data;
|
||||
|
||||
return gfx_ctx;
|
||||
}
|
||||
|
||||
static void vulkan_init_render_pass(
|
||||
@ -1131,23 +1136,23 @@ static void *vulkan_init(const video_info_t *video,
|
||||
vk_t *vk = (vk_t*)calloc(1, sizeof(*vk));
|
||||
if (!vk)
|
||||
return NULL;
|
||||
|
||||
vk->video = *video;
|
||||
|
||||
ctx_driver = vulkan_get_context(vk);
|
||||
ctx_driver = vulkan_get_context(vk);
|
||||
if (!ctx_driver)
|
||||
{
|
||||
RARCH_ERR("[Vulkan]: Failed to get Vulkan context.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
vk->video = *video;
|
||||
vk->ctx_driver = ctx_driver;
|
||||
|
||||
video_context_driver_set((const gfx_ctx_driver_t*)ctx_driver);
|
||||
|
||||
video_context_driver_get_video_size(&mode);
|
||||
full_x = mode.width;
|
||||
full_y = mode.height;
|
||||
mode.width = 0;
|
||||
mode.height = 0;
|
||||
full_x = mode.width;
|
||||
full_y = mode.height;
|
||||
mode.width = 0;
|
||||
mode.height = 0;
|
||||
|
||||
RARCH_LOG("[Vulkan]: Detecting screen resolution %ux%u.\n", full_x, full_y);
|
||||
interval = video->vsync ? video->swap_interval : 0;
|
||||
@ -1182,7 +1187,7 @@ static void *vulkan_init(const video_info_t *video,
|
||||
|
||||
RARCH_LOG("[Vulkan]: Using resolution %ux%u\n", temp_width, temp_height);
|
||||
|
||||
video_context_driver_get_context_data(&vk->context);
|
||||
*(void**)&vk->context = vk->ctx_driver->get_context_data(vk->ctx_data);
|
||||
|
||||
vk->vsync = video->vsync;
|
||||
vk->fullscreen = video->fullscreen;
|
||||
@ -1280,30 +1285,25 @@ static void vulkan_set_nonblock_state(void *data, bool state)
|
||||
|
||||
static bool vulkan_alive(void *data)
|
||||
{
|
||||
gfx_ctx_size_t size_data;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
bool ret = false;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
vk_t *vk = (vk_t*)data;
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
|
||||
video_driver_get_size(&temp_width, &temp_height);
|
||||
|
||||
size_data.quit = &quit;
|
||||
size_data.resize = &resize;
|
||||
size_data.width = &temp_width;
|
||||
size_data.height = &temp_height;
|
||||
vk->ctx_driver->check_window(vk->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height, is_shutdown);
|
||||
|
||||
if (video_context_driver_check_window(&size_data))
|
||||
{
|
||||
if (quit)
|
||||
vk->quitting = true;
|
||||
else if (resize)
|
||||
vk->should_resize = true;
|
||||
if (quit)
|
||||
vk->quitting = true;
|
||||
else if (resize)
|
||||
vk->should_resize = true;
|
||||
|
||||
ret = !vk->quitting;
|
||||
}
|
||||
ret = !vk->quitting;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_size(&temp_width, &temp_height);
|
||||
@ -1779,6 +1779,30 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
vulkan_filter_chain_build_offscreen_passes(
|
||||
(vulkan_filter_chain_t*)vk->filter_chain,
|
||||
vk->cmd, &vk->vk_vp);
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
/* Upload menu texture. */
|
||||
if (vk->menu.enable)
|
||||
{
|
||||
if (vk->menu.textures[vk->menu.last_index].image != VK_NULL_HANDLE ||
|
||||
vk->menu.textures[vk->menu.last_index].buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
struct vk_texture *optimal = &vk->menu.textures_optimal[vk->menu.last_index];
|
||||
struct vk_texture *texture = &vk->menu.textures[vk->menu.last_index];
|
||||
|
||||
if (optimal->memory != VK_NULL_HANDLE)
|
||||
{
|
||||
if (vk->menu.dirty[vk->menu.last_index])
|
||||
{
|
||||
vulkan_copy_staging_to_dynamic(vk, vk->cmd,
|
||||
optimal, texture);
|
||||
vk->menu.dirty[vk->menu.last_index] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Render to backbuffer. */
|
||||
if (chain->backbuffer.image != VK_NULL_HANDLE && vk->context->has_acquired_swapchain)
|
||||
{
|
||||
@ -1813,7 +1837,8 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
{
|
||||
menu_driver_frame(video_info);
|
||||
|
||||
if (vk->menu.textures[vk->menu.last_index].image != VK_NULL_HANDLE)
|
||||
if (vk->menu.textures[vk->menu.last_index].image != VK_NULL_HANDLE ||
|
||||
vk->menu.textures[vk->menu.last_index].buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
struct vk_draw_quad quad;
|
||||
struct vk_texture *optimal = &vk->menu.textures_optimal[vk->menu.last_index];
|
||||
@ -1823,16 +1848,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
quad.texture = &vk->menu.textures[vk->menu.last_index];
|
||||
|
||||
if (optimal->memory != VK_NULL_HANDLE)
|
||||
{
|
||||
if (vk->menu.dirty[vk->menu.last_index])
|
||||
{
|
||||
vulkan_copy_staging_to_dynamic(vk, vk->cmd,
|
||||
optimal,
|
||||
quad.texture);
|
||||
vk->menu.dirty[vk->menu.last_index] = false;
|
||||
}
|
||||
quad.texture = optimal;
|
||||
}
|
||||
|
||||
quad.sampler = optimal->mipmap ?
|
||||
vk->samplers.mipmap_linear : vk->samplers.linear;
|
||||
@ -2197,9 +2213,6 @@ static void vulkan_set_texture_frame(void *data,
|
||||
for (y = 0; y < height; y++, dst += texture->stride, src += stride)
|
||||
memcpy(dst, src, stride);
|
||||
|
||||
vulkan_sync_texture_to_gpu(vk, texture);
|
||||
vkUnmapMemory(vk->context->device, texture->memory);
|
||||
|
||||
vk->menu.alpha = alpha;
|
||||
vk->menu.last_index = index;
|
||||
|
||||
@ -2212,7 +2225,10 @@ static void vulkan_set_texture_frame(void *data,
|
||||
NULL, rgb32 ? NULL : &br_swizzle,
|
||||
VULKAN_TEXTURE_DYNAMIC);
|
||||
}
|
||||
else
|
||||
vulkan_sync_texture_to_gpu(vk, texture);
|
||||
|
||||
vkUnmapMemory(vk->context->device, texture->memory);
|
||||
vk->menu.dirty[index] = true;
|
||||
}
|
||||
|
||||
@ -2603,6 +2619,7 @@ static bool vulkan_overlay_load(void *data,
|
||||
const void *image_data, unsigned num_images)
|
||||
{
|
||||
unsigned i, j;
|
||||
bool old_enabled;
|
||||
const struct texture_image *images =
|
||||
(const struct texture_image*)image_data;
|
||||
vk_t *vk = (vk_t*)data;
|
||||
@ -2620,6 +2637,7 @@ static bool vulkan_overlay_load(void *data,
|
||||
#ifdef HAVE_THREADS
|
||||
slock_unlock(vk->context->queue_lock);
|
||||
#endif
|
||||
old_enabled = vk->overlay.enable;
|
||||
vulkan_overlay_free(vk);
|
||||
|
||||
vk->overlay.images = (struct vk_texture*)
|
||||
@ -2647,6 +2665,7 @@ static bool vulkan_overlay_load(void *data,
|
||||
vk->overlay.vertex[4 * i + j].color = white;
|
||||
}
|
||||
|
||||
vk->overlay.enable = old_enabled;
|
||||
return true;
|
||||
|
||||
error:
|
||||
|
@ -22,7 +22,7 @@
|
||||
#else
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#endif
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
#include <OpenGL/CGLTypes.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <AppKit/NSScreen.h>
|
||||
@ -37,7 +37,7 @@
|
||||
#include <retro_assert.h>
|
||||
#include <compat/apple_compat.h>
|
||||
|
||||
#import "../../ui/drivers/cocoa/cocoa_common.h"
|
||||
#import "../../ui/drivers/cocoa/cocoa_common_metal.h"
|
||||
#include "../video_driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
@ -107,8 +107,8 @@ static int g_fast_forward_skips;
|
||||
static bool g_is_syncing = true;
|
||||
static bool g_use_hw_ctx = false;
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#include "../../ui/drivers/ui_cocoa.h"
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
#include "../../ui/drivers/ui_cocoa_metal.h"
|
||||
static NSOpenGLPixelFormat* g_format;
|
||||
|
||||
void *glcontext_get_ptr(void)
|
||||
@ -203,7 +203,7 @@ float get_backing_scale_factor(void)
|
||||
return backing_scale_def;
|
||||
|
||||
backing_scale_def = 1.0f;
|
||||
#ifdef HAVE_COCOA
|
||||
#ifdef HAVE_COCOA_METAL
|
||||
screen = (BRIDGE RAScreen*)get_chosen_screen();
|
||||
|
||||
if (screen)
|
||||
@ -228,7 +228,7 @@ void cocoagl_gfx_ctx_update(void)
|
||||
switch (cocoagl_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
#if MAC_OS_X_VERSION_10_7
|
||||
CGLUpdateContext(g_hw_ctx.CGLContextObj);
|
||||
CGLUpdateContext(g_context.CGLContextObj);
|
||||
@ -256,7 +256,7 @@ static void cocoagl_gfx_ctx_destroy(void *data)
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
[GLContextClass clearCurrentContext];
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
[g_context clearDrawable];
|
||||
RELEASE(g_context);
|
||||
RELEASE(g_format);
|
||||
@ -302,7 +302,7 @@ static void *cocoagl_gfx_ctx_init(video_frame_info_t *video_info, void *video_dr
|
||||
// setViewType is not (yet?) defined for iOS
|
||||
// [apple_platform setViewType:APPLE_VIEW_TYPE_OPENGL_ES];
|
||||
break;
|
||||
#elif defined(HAVE_COCOA)
|
||||
#elif defined(HAVE_COCOA_METAL)
|
||||
case GFX_CTX_OPENGL_API:
|
||||
[apple_platform setViewType:APPLE_VIEW_TYPE_OPENGL];
|
||||
break;
|
||||
@ -341,7 +341,7 @@ static bool cocoagl_gfx_ctx_bind_api(void *data, enum gfx_ctx_api api, unsigned
|
||||
#if defined(HAVE_COCOATOUCH)
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
break;
|
||||
#elif defined(HAVE_COCOA)
|
||||
#elif defined(HAVE_COCOA_METAL)
|
||||
case GFX_CTX_OPENGL_API:
|
||||
break;
|
||||
#ifdef HAVE_VULKAN
|
||||
@ -376,7 +376,7 @@ static void cocoagl_gfx_ctx_swap_interval(void *data, int interval)
|
||||
// Just skip presents so fast forward still works.
|
||||
g_is_syncing = interval ? true : false;
|
||||
g_fast_forward_skips = interval ? 0 : 3;
|
||||
#elif defined(HAVE_COCOA)
|
||||
#elif defined(HAVE_COCOA_METAL)
|
||||
GLint value = interval ? 1 : 0;
|
||||
[g_context setValues:&value forParameter:NSOpenGLCPSwapInterval];
|
||||
#endif
|
||||
@ -405,7 +405,7 @@ static void cocoagl_gfx_ctx_show_mouse(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
#ifdef HAVE_COCOA
|
||||
#ifdef HAVE_COCOA_METAL
|
||||
if (state)
|
||||
[NSCursor unhide];
|
||||
else
|
||||
@ -421,7 +421,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
|
||||
cocoa_ctx->width = width;
|
||||
cocoa_ctx->height = height;
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
//CocoaView *g_view = (BRIDGE CocoaView *)nsview_get_ptr();
|
||||
NSView *g_view = apple_platform.renderView;
|
||||
#endif
|
||||
@ -431,7 +431,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
{
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
if ([g_view respondsToSelector: @selector(setWantsBestResolutionOpenGLSurface:)])
|
||||
[g_view setWantsBestResolutionOpenGLSurface:YES];
|
||||
|
||||
@ -507,7 +507,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
static bool has_went_fullscreen = false;
|
||||
/* TODO: Screen mode support. */
|
||||
|
||||
@ -563,7 +563,7 @@ float cocoagl_gfx_ctx_get_native_scale(void)
|
||||
static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned* height)
|
||||
{
|
||||
float screenscale = cocoagl_gfx_ctx_get_native_scale();
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
CGRect size;
|
||||
GLsizei backingPixelWidth, backingPixelHeight;
|
||||
NSView *g_view = apple_platform.renderView;
|
||||
@ -584,7 +584,7 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
|
||||
*height = CGRectGetHeight(size) * screenscale;
|
||||
}
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
static void cocoagl_gfx_ctx_update_title(void *data, void *data2)
|
||||
{
|
||||
ui_window_cocoa_t view;
|
||||
@ -611,7 +611,7 @@ static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types ty
|
||||
float *value)
|
||||
{
|
||||
RAScreen *screen = (BRIDGE RAScreen*)get_chosen_screen();
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
NSDictionary *description = [screen deviceDescription];
|
||||
NSSize display_pixel_size = [[description objectForKey:NSDeviceSize] sizeValue];
|
||||
CGSize display_physical_size = CGDisplayScreenSize(
|
||||
@ -719,7 +719,7 @@ static void cocoagl_gfx_ctx_swap_buffers(void *data, void *data2)
|
||||
if (!(--g_fast_forward_skips < 0))
|
||||
return;
|
||||
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
[g_context flushBuffer];
|
||||
[g_hw_ctx flushBuffer];
|
||||
#elif defined(HAVE_COCOATOUCH)
|
||||
@ -892,7 +892,7 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = {
|
||||
.set_video_mode = cocoagl_gfx_ctx_set_video_mode,
|
||||
.get_video_size = cocoagl_gfx_ctx_get_video_size,
|
||||
.get_metrics = cocoagl_gfx_ctx_get_metrics,
|
||||
#if defined(HAVE_COCOA)
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
.update_window_title = cocoagl_gfx_ctx_update_title,
|
||||
#endif
|
||||
.check_window = cocoagl_gfx_ctx_check_window,
|
@ -86,7 +86,7 @@ static void gdi_render_msg(
|
||||
void *data, const char *msg,
|
||||
const struct font_params *params)
|
||||
{
|
||||
float x, y, scale, drop_mod, alpha, drop_alpha;
|
||||
float x, y, scale, drop_mod, drop_alpha;
|
||||
int drop_x, drop_y, msg_strlen;
|
||||
unsigned i;
|
||||
unsigned newX, newY, newDropX, newDropY;
|
||||
@ -116,7 +116,6 @@ static void gdi_render_msg(
|
||||
red = FONT_COLOR_GET_RED(params->color);
|
||||
green = FONT_COLOR_GET_GREEN(params->color);
|
||||
blue = FONT_COLOR_GET_BLUE(params->color);
|
||||
alpha = FONT_COLOR_GET_ALPHA(params->color);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -131,7 +130,6 @@ static void gdi_render_msg(
|
||||
red = video_info->font_msg_color_r * 255.0f;
|
||||
green = video_info->font_msg_color_g * 255.0f;
|
||||
blue = video_info->font_msg_color_b * 255.0f;
|
||||
alpha = 255;
|
||||
}
|
||||
|
||||
msg_strlen = strlen(msg);
|
||||
|
@ -164,7 +164,7 @@ static void gl2_renderchain_bind_backbuffer(void *data,
|
||||
#endif
|
||||
}
|
||||
|
||||
void context_bind_hw_render(bool enable);
|
||||
void context_bind_hw_render(void *data, bool enable);
|
||||
|
||||
void gl_load_texture_data(
|
||||
uint32_t id_data,
|
||||
@ -532,7 +532,7 @@ static void gl2_renderchain_deinit_hw_render(
|
||||
if (!gl)
|
||||
return;
|
||||
|
||||
context_bind_hw_render(true);
|
||||
context_bind_hw_render(gl, true);
|
||||
|
||||
if (gl->hw_render_fbo_init)
|
||||
gl2_delete_fb(gl->textures, gl->hw_render_fbo);
|
||||
@ -540,7 +540,7 @@ static void gl2_renderchain_deinit_hw_render(
|
||||
gl2_delete_rb(gl->textures, chain->hw_render_depth);
|
||||
gl->hw_render_fbo_init = false;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
context_bind_hw_render(gl, false);
|
||||
}
|
||||
|
||||
static void gl2_renderchain_free(gl_t *gl, void *chain_data)
|
||||
@ -956,7 +956,7 @@ static bool gl2_renderchain_init_hw_render(
|
||||
|
||||
/* We can only share texture objects through contexts.
|
||||
* FBOs are "abstract" objects and are not shared. */
|
||||
context_bind_hw_render(true);
|
||||
context_bind_hw_render(gl, true);
|
||||
|
||||
RARCH_LOG("[GL]: Initializing HW render (%u x %u).\n", width, height);
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_fbo_size);
|
||||
@ -1037,7 +1037,7 @@ static bool gl2_renderchain_init_hw_render(
|
||||
gl2_renderchain_bind_backbuffer(gl, chain_data);
|
||||
gl->hw_render_fbo_init = true;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
context_bind_hw_render(gl, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1076,7 +1076,7 @@ static bool gl2_renderchain_read_viewport(
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
context_bind_hw_render(false);
|
||||
context_bind_hw_render(gl, false);
|
||||
|
||||
num_pixels = gl->vp.width * gl->vp.height;
|
||||
|
||||
@ -1160,11 +1160,11 @@ static bool gl2_renderchain_read_viewport(
|
||||
gl->readback_buffer_screenshot = NULL;
|
||||
}
|
||||
|
||||
context_bind_hw_render(true);
|
||||
context_bind_hw_render(gl, true);
|
||||
return true;
|
||||
|
||||
error:
|
||||
context_bind_hw_render(true);
|
||||
context_bind_hw_render(gl, true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -55,6 +55,15 @@ bool glslang_read_shader_file(const char *path, vector<string> *output, bool roo
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Remove Windows \r chars if we encounter them.
|
||||
* filestream_read_file() allocates one extra for 0 terminator. */
|
||||
auto itr = remove_if(buf, buf + len + 1, [](char c) {
|
||||
return c == '\r';
|
||||
});
|
||||
|
||||
if (itr < buf + len)
|
||||
*itr = '\0';
|
||||
|
||||
/* Cannot use string_split since it removes blank lines (strtok). */
|
||||
ptr = buf;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "glslang_util.h"
|
||||
#include "slang_preprocess.h"
|
||||
|
@ -21,7 +21,14 @@
|
||||
#include "../verbosity.h"
|
||||
|
||||
static const video_display_server_t *current_display_server = NULL;
|
||||
static void *current_display_server_data = NULL;
|
||||
static void *current_display_server_data = NULL;
|
||||
|
||||
const char *video_display_server_get_ident(void)
|
||||
{
|
||||
if (!current_display_server)
|
||||
return "null";
|
||||
return current_display_server->ident;
|
||||
}
|
||||
|
||||
void* video_display_server_init(void)
|
||||
{
|
||||
|
@ -52,6 +52,8 @@ bool video_display_server_switch_resolution(
|
||||
|
||||
const char *video_display_server_get_output_options(void);
|
||||
|
||||
const char *video_display_server_get_ident(void);
|
||||
|
||||
extern const video_display_server_t dispserv_win32;
|
||||
extern const video_display_server_t dispserv_x11;
|
||||
extern const video_display_server_t dispserv_null;
|
||||
|
@ -295,6 +295,9 @@ static const video_driver_t *video_drivers[] = {
|
||||
#ifdef PSP
|
||||
&video_psp1,
|
||||
#endif
|
||||
#ifdef PS2
|
||||
&video_ps2,
|
||||
#endif
|
||||
#ifdef _3DS
|
||||
&video_ctr,
|
||||
#endif
|
||||
@ -395,7 +398,7 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = {
|
||||
#if defined(__QNX__)
|
||||
&gfx_ctx_qnx,
|
||||
#endif
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH)
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL)
|
||||
&gfx_ctx_cocoagl,
|
||||
#endif
|
||||
#if defined(__APPLE__) && !defined(TARGET_IPHONE_SIMULATOR) && !defined(TARGET_OS_IPHONE)
|
||||
@ -460,12 +463,6 @@ static bool set_resize_null(void *a, unsigned b, unsigned c)
|
||||
return false;
|
||||
}
|
||||
|
||||
void video_driver_set_resize(unsigned width, unsigned height)
|
||||
{
|
||||
if (current_video_context.set_resize)
|
||||
current_video_context.set_resize(video_context_data, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
* video_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
@ -677,11 +674,9 @@ retro_proc_address_t video_driver_get_proc_address(const char *sym)
|
||||
bool video_driver_set_shader(enum rarch_shader_type type,
|
||||
const char *path)
|
||||
{
|
||||
bool ret = false;
|
||||
if (current_video->set_shader)
|
||||
ret = current_video->set_shader(video_driver_data, type, path);
|
||||
|
||||
return ret;
|
||||
return current_video->set_shader(video_driver_data, type, path);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void video_driver_filter_free(void)
|
||||
@ -2756,6 +2751,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->scale_integer = settings->bools.video_scale_integer;
|
||||
video_info->aspect_ratio_idx = settings->uints.video_aspect_ratio_idx;
|
||||
video_info->post_filter_record = settings->bools.video_post_filter_record;
|
||||
video_info->input_menu_swap_ok_cancel_buttons = settings->bools.input_menu_swap_ok_cancel_buttons;
|
||||
video_info->max_swapchain_images = settings->uints.video_max_swapchain_images;
|
||||
video_info->windowed_fullscreen = settings->bools.video_windowed_fullscreen;
|
||||
video_info->fullscreen = settings->bools.video_fullscreen || retroarch_is_forced_fullscreen();
|
||||
@ -2793,6 +2789,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->menu_footer_opacity = settings->floats.menu_footer_opacity;
|
||||
video_info->menu_header_opacity = settings->floats.menu_header_opacity;
|
||||
video_info->materialui_color_theme = settings->uints.menu_materialui_color_theme;
|
||||
video_info->ozone_color_theme = settings->uints.menu_ozone_color_theme;
|
||||
video_info->menu_shader_pipeline = settings->uints.menu_xmb_shader_pipeline;
|
||||
video_info->xmb_theme = settings->uints.menu_xmb_theme;
|
||||
video_info->xmb_color_theme = settings->uints.menu_xmb_color_theme;
|
||||
@ -2830,6 +2827,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->input_driver_nonblock_state = input_driver_is_nonblock_state();
|
||||
|
||||
video_info->context_data = video_context_data;
|
||||
video_info->shader_driver = current_shader;
|
||||
video_info->shader_data = current_shader_data;
|
||||
|
||||
video_info->cb_update_window_title = current_video_context.update_window_title;
|
||||
@ -2837,7 +2835,6 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->cb_get_metrics = current_video_context.get_metrics;
|
||||
video_info->cb_set_resize = current_video_context.set_resize;
|
||||
|
||||
video_info->cb_shader_use = video_driver_cb_shader_use;
|
||||
video_info->cb_set_mvp = video_driver_cb_shader_set_mvp;
|
||||
|
||||
video_info->userdata = video_driver_get_ptr(false);
|
||||
@ -3015,74 +3012,30 @@ static const gfx_ctx_driver_t *video_context_driver_init(
|
||||
const gfx_ctx_driver_t *ctx,
|
||||
const char *ident,
|
||||
enum gfx_ctx_api api, unsigned major,
|
||||
unsigned minor, bool hw_render_ctx)
|
||||
unsigned minor, bool hw_render_ctx,
|
||||
void **ctx_data)
|
||||
{
|
||||
if (ctx->bind_api(data, api, major, minor))
|
||||
video_frame_info_t video_info;
|
||||
|
||||
if (!ctx->bind_api(data, api, major, minor))
|
||||
{
|
||||
video_frame_info_t video_info;
|
||||
void *ctx_data = NULL;
|
||||
RARCH_WARN("Failed to bind API (#%u, version %u.%u)"
|
||||
" on context driver \"%s\".\n",
|
||||
(unsigned)api, major, minor, ctx->ident);
|
||||
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
ctx_data = ctx->init(&video_info, data);
|
||||
|
||||
if (!ctx_data)
|
||||
return NULL;
|
||||
|
||||
if (ctx->bind_hw_render)
|
||||
ctx->bind_hw_render(ctx_data,
|
||||
video_info.shared_context && hw_render_ctx);
|
||||
|
||||
video_context_data = ctx_data;
|
||||
|
||||
return ctx;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
RARCH_WARN("Failed to bind API (#%u, version %u.%u)"
|
||||
" on context driver \"%s\".\n",
|
||||
(unsigned)api, major, minor, ctx->ident);
|
||||
#endif
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
if (!(*ctx_data = ctx->init(&video_info, data)))
|
||||
return NULL;
|
||||
|
||||
/**
|
||||
* video_context_driver_find_driver:
|
||||
* @data : Input data.
|
||||
* @ident : Identifier of graphics context driver to find.
|
||||
* @api : API of higher-level graphics API.
|
||||
* @major : Major version number of higher-level graphics API.
|
||||
* @minor : Minor version number of higher-level graphics API.
|
||||
* @hw_render_ctx : Request a graphics context driver capable of
|
||||
* hardware rendering?
|
||||
*
|
||||
* Finds graphics context driver and initializes.
|
||||
*
|
||||
* Returns: graphics context driver if found, otherwise NULL.
|
||||
**/
|
||||
static const gfx_ctx_driver_t *video_context_driver_find_driver(void *data,
|
||||
const char *ident,
|
||||
enum gfx_ctx_api api, unsigned major,
|
||||
unsigned minor, bool hw_render_ctx)
|
||||
{
|
||||
int i = find_video_context_driver_index(ident);
|
||||
if (ctx->bind_hw_render)
|
||||
ctx->bind_hw_render(*ctx_data,
|
||||
video_info.shared_context && hw_render_ctx);
|
||||
|
||||
if (i >= 0)
|
||||
return video_context_driver_init(data, gfx_ctx_drivers[i], ident,
|
||||
api, major, minor, hw_render_ctx);
|
||||
|
||||
for (i = 0; gfx_ctx_drivers[i]; i++)
|
||||
{
|
||||
const gfx_ctx_driver_t *ctx =
|
||||
video_context_driver_init(data, gfx_ctx_drivers[i], ident,
|
||||
api, major, minor, hw_render_ctx);
|
||||
|
||||
if (ctx)
|
||||
return ctx;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3101,28 +3054,35 @@ static const gfx_ctx_driver_t *video_context_driver_find_driver(void *data,
|
||||
**/
|
||||
const gfx_ctx_driver_t *video_context_driver_init_first(void *data,
|
||||
const char *ident, enum gfx_ctx_api api, unsigned major,
|
||||
unsigned minor, bool hw_render_ctx)
|
||||
unsigned minor, bool hw_render_ctx, void **ctx_data)
|
||||
{
|
||||
return video_context_driver_find_driver(data, ident, api,
|
||||
major, minor, hw_render_ctx);
|
||||
}
|
||||
int i = find_video_context_driver_index(ident);
|
||||
|
||||
bool video_context_driver_check_window(gfx_ctx_size_t *size_data)
|
||||
{
|
||||
if ( video_context_data
|
||||
&& current_video_context.check_window)
|
||||
if (i >= 0)
|
||||
{
|
||||
bool is_shutdown = rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL);
|
||||
current_video_context.check_window(video_context_data,
|
||||
size_data->quit,
|
||||
size_data->resize,
|
||||
size_data->width,
|
||||
size_data->height,
|
||||
is_shutdown);
|
||||
return true;
|
||||
const gfx_ctx_driver_t *ctx = video_context_driver_init(data, gfx_ctx_drivers[i], ident,
|
||||
api, major, minor, hw_render_ctx, ctx_data);
|
||||
if (ctx)
|
||||
{
|
||||
video_context_data = *ctx_data;
|
||||
return ctx;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
for (i = 0; gfx_ctx_drivers[i]; i++)
|
||||
{
|
||||
const gfx_ctx_driver_t *ctx =
|
||||
video_context_driver_init(data, gfx_ctx_drivers[i], ident,
|
||||
api, major, minor, hw_render_ctx, ctx_data);
|
||||
|
||||
if (ctx)
|
||||
{
|
||||
video_context_data = *ctx_data;
|
||||
return ctx;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool video_context_driver_init_image_buffer(const video_info_t *data)
|
||||
@ -3162,14 +3122,6 @@ bool video_context_driver_get_video_output_next(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_context_driver_bind_hw_render(bool *enable)
|
||||
{
|
||||
if (!current_video_context.bind_hw_render)
|
||||
return false;
|
||||
current_video_context.bind_hw_render(video_context_data, *enable);
|
||||
return true;
|
||||
}
|
||||
|
||||
void video_context_driver_make_current(bool release)
|
||||
{
|
||||
if (current_video_context.make_current)
|
||||
@ -3324,15 +3276,6 @@ bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_context_driver_get_context_data(void *data)
|
||||
{
|
||||
if (!current_video_context.get_context_data)
|
||||
return false;
|
||||
*(void**)data = current_video_context.get_context_data(
|
||||
video_context_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_context_driver_show_mouse(bool *bool_data)
|
||||
{
|
||||
if (!current_video_context.show_mouse)
|
||||
@ -3435,15 +3378,13 @@ enum gfx_ctx_api video_context_driver_get_api(void)
|
||||
|
||||
bool video_driver_has_windowed(void)
|
||||
{
|
||||
#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE)
|
||||
return false;
|
||||
#else
|
||||
#if !(defined(RARCH_CONSOLE) || defined(RARCH_MOBILE))
|
||||
if (video_driver_data && current_video->has_windowed)
|
||||
return current_video->has_windowed(video_driver_data);
|
||||
else if (video_context_data && current_video_context.has_windowed)
|
||||
return current_video_context.has_windowed(video_context_data);
|
||||
return false;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_driver_cached_frame_has_valid_framebuffer(void)
|
||||
|
@ -404,6 +404,7 @@ typedef struct video_info
|
||||
|
||||
typedef struct video_frame_info
|
||||
{
|
||||
bool input_menu_swap_ok_cancel_buttons;
|
||||
bool input_driver_nonblock_state;
|
||||
bool shared_context;
|
||||
bool black_frame_insertion;
|
||||
@ -444,6 +445,7 @@ typedef struct video_frame_info
|
||||
unsigned xmb_color_theme;
|
||||
unsigned menu_shader_pipeline;
|
||||
unsigned materialui_color_theme;
|
||||
unsigned ozone_color_theme;
|
||||
unsigned custom_vp_width;
|
||||
unsigned custom_vp_height;
|
||||
unsigned custom_vp_full_width;
|
||||
@ -493,13 +495,13 @@ typedef struct video_frame_info
|
||||
float *value);
|
||||
bool (*cb_set_resize)(void*, unsigned, unsigned);
|
||||
|
||||
void (*cb_shader_use)(void *data, void *shader_data, unsigned index, bool set_active);
|
||||
bool (*cb_set_mvp)(void *data, void *shader_data,
|
||||
const void *mat_data);
|
||||
|
||||
void *context_data;
|
||||
void *shader_data;
|
||||
void *userdata;
|
||||
const shader_backend_t *shader_driver;
|
||||
} video_frame_info_t;
|
||||
|
||||
typedef void (*update_window_title_cb)(void*, void*);
|
||||
@ -1126,8 +1128,6 @@ void video_driver_set_threaded(bool val);
|
||||
void video_driver_get_status(uint64_t *frame_count, bool * is_alive,
|
||||
bool *is_focused);
|
||||
|
||||
void video_driver_set_resize(unsigned width, unsigned height);
|
||||
|
||||
/**
|
||||
* video_context_driver_init_first:
|
||||
* @data : Input data.
|
||||
@ -1142,10 +1142,10 @@ void video_driver_set_resize(unsigned width, unsigned height);
|
||||
*
|
||||
* Returns: graphics context driver if found, otherwise NULL.
|
||||
**/
|
||||
const gfx_ctx_driver_t *video_context_driver_init_first(void *data, const char *ident,
|
||||
enum gfx_ctx_api api, unsigned major, unsigned minor, bool hw_render_ctx);
|
||||
|
||||
bool video_context_driver_check_window(gfx_ctx_size_t *size_data);
|
||||
const gfx_ctx_driver_t *video_context_driver_init_first(
|
||||
void *data, const char *ident,
|
||||
enum gfx_ctx_api api, unsigned major, unsigned minor,
|
||||
bool hw_render_ctx, void **ctx_data);
|
||||
|
||||
bool video_context_driver_find_prev_driver(void);
|
||||
|
||||
@ -1183,8 +1183,6 @@ bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info);
|
||||
|
||||
bool video_context_driver_get_refresh_rate(float *refresh_rate);
|
||||
|
||||
bool video_context_driver_get_context_data(void *data);
|
||||
|
||||
bool video_context_driver_show_mouse(bool *bool_data);
|
||||
|
||||
bool video_context_driver_set_flags(gfx_ctx_flags_t *flags);
|
||||
@ -1253,6 +1251,7 @@ extern video_driver_t video_vulkan;
|
||||
extern video_driver_t video_metal;
|
||||
extern video_driver_t video_psp1;
|
||||
extern video_driver_t video_vita2d;
|
||||
extern video_driver_t video_ps2;
|
||||
extern video_driver_t video_ctr;
|
||||
extern video_driver_t video_switch;
|
||||
extern video_driver_t video_d3d8;
|
||||
|
@ -333,6 +333,7 @@ extern const struct softfilter_implementation *supertwoxsai_get_implementation(s
|
||||
extern const struct softfilter_implementation *twoxbr_get_implementation(softfilter_simd_mask_t simd);
|
||||
extern const struct softfilter_implementation *darken_get_implementation(softfilter_simd_mask_t simd);
|
||||
extern const struct softfilter_implementation *scale2x_get_implementation(softfilter_simd_mask_t simd);
|
||||
extern const struct softfilter_implementation *normal2x_get_implementation(softfilter_simd_mask_t simd);
|
||||
|
||||
static const softfilter_get_implementation_t soft_plugs_builtin[] = {
|
||||
blargg_ntsc_snes_get_implementation,
|
||||
@ -345,6 +346,7 @@ static const softfilter_get_implementation_t soft_plugs_builtin[] = {
|
||||
supereagle_get_implementation,
|
||||
epx_get_implementation,
|
||||
scale2x_get_implementation,
|
||||
normal2x_get_implementation,
|
||||
};
|
||||
|
||||
static bool append_softfilter_plugs(rarch_softfilter_t *filt,
|
||||
|
@ -70,7 +70,7 @@ ASMFLAGS := -INEON/asm
|
||||
asflags += -mfpu=neon
|
||||
endif
|
||||
|
||||
objects += blargg_ntsc_snes.$(DYLIB) phosphor2x.$(DYLIB) epx.$(DYLIB) lq2x.$(DYLIB) 2xsai.$(DYLIB) super2xsai.$(DYLIB) supereagle.$(DYLIB) 2xbr.$(DYLIB) darken.$(DYLIB) scale2x.$(DYLIB)
|
||||
objects += blargg_ntsc_snes.$(DYLIB) phosphor2x.$(DYLIB) epx.$(DYLIB) lq2x.$(DYLIB) 2xsai.$(DYLIB) super2xsai.$(DYLIB) supereagle.$(DYLIB) 2xbr.$(DYLIB) darken.$(DYLIB) scale2x.$(DYLIB) normal2x.$(DYLIB)
|
||||
|
||||
all: build;
|
||||
|
||||
|
1
gfx/video_filters/Normal2x.filt
Normal file
1
gfx/video_filters/Normal2x.filt
Normal file
@ -0,0 +1 @@
|
||||
filter = normal2x
|
218
gfx/video_filters/normal2x.c
Normal file
218
gfx/video_filters/normal2x.c
Normal file
@ -0,0 +1,218 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2018 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Compile: gcc -o normal2x.so -shared normal2x.c -std=c99 -O3 -Wall -pedantic -fPIC */
|
||||
|
||||
#include "softfilter.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#define softfilter_get_implementation normal2x_get_implementation
|
||||
#define softfilter_thread_data normal2x_softfilter_thread_data
|
||||
#define filter_data normal2x_filter_data
|
||||
#endif
|
||||
|
||||
struct softfilter_thread_data
|
||||
{
|
||||
void *out_data;
|
||||
const void *in_data;
|
||||
size_t out_pitch;
|
||||
size_t in_pitch;
|
||||
unsigned colfmt;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
int first;
|
||||
int last;
|
||||
};
|
||||
|
||||
struct filter_data
|
||||
{
|
||||
unsigned threads;
|
||||
struct softfilter_thread_data *workers;
|
||||
unsigned in_fmt;
|
||||
};
|
||||
|
||||
static unsigned normal2x_generic_input_fmts(void)
|
||||
{
|
||||
return SOFTFILTER_FMT_XRGB8888 | SOFTFILTER_FMT_RGB565;
|
||||
}
|
||||
|
||||
static unsigned normal2x_generic_output_fmts(unsigned input_fmts)
|
||||
{
|
||||
return input_fmts;
|
||||
}
|
||||
|
||||
static unsigned normal2x_generic_threads(void *data)
|
||||
{
|
||||
struct filter_data *filt = (struct filter_data*)data;
|
||||
return filt->threads;
|
||||
}
|
||||
|
||||
static void *normal2x_generic_create(const struct softfilter_config *config,
|
||||
unsigned in_fmt, unsigned out_fmt,
|
||||
unsigned max_width, unsigned max_height,
|
||||
unsigned threads, softfilter_simd_mask_t simd, void *userdata)
|
||||
{
|
||||
struct filter_data *filt = (struct filter_data*)calloc(1, sizeof(*filt));
|
||||
(void)simd;
|
||||
(void)config;
|
||||
(void)userdata;
|
||||
|
||||
if (!filt) {
|
||||
return NULL;
|
||||
}
|
||||
/* Apparently the code is not thread-safe,
|
||||
* so force single threaded operation... */
|
||||
filt->workers = (struct softfilter_thread_data*)calloc(1, sizeof(struct softfilter_thread_data));
|
||||
filt->threads = 1;
|
||||
filt->in_fmt = in_fmt;
|
||||
if (!filt->workers) {
|
||||
free(filt);
|
||||
return NULL;
|
||||
}
|
||||
return filt;
|
||||
}
|
||||
|
||||
static void normal2x_generic_output(void *data,
|
||||
unsigned *out_width, unsigned *out_height,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
*out_width = width << 1;
|
||||
*out_height = height << 1;
|
||||
}
|
||||
|
||||
static void normal2x_generic_destroy(void *data)
|
||||
{
|
||||
struct filter_data *filt = (struct filter_data*)data;
|
||||
if (!filt) {
|
||||
return;
|
||||
}
|
||||
free(filt->workers);
|
||||
free(filt);
|
||||
}
|
||||
|
||||
static void normal2x_work_cb_xrgb8888(void *data, void *thread_data)
|
||||
{
|
||||
struct softfilter_thread_data *thr = (struct softfilter_thread_data*)thread_data;
|
||||
const uint32_t *input = (const uint32_t*)thr->in_data;
|
||||
uint32_t *output = (uint32_t*)thr->out_data;
|
||||
unsigned in_stride = (unsigned)(thr->in_pitch >> 2);
|
||||
unsigned out_stride = (unsigned)(thr->out_pitch >> 2);
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < thr->height; ++y)
|
||||
{
|
||||
uint32_t *out_ptr = output;
|
||||
for (x = 0; x < thr->width; ++x)
|
||||
{
|
||||
uint64_t colour = (uint64_t)*(input + x);
|
||||
colour |= colour << 32;
|
||||
|
||||
*(uint64_t *)(out_ptr) = colour;
|
||||
*(uint64_t *)(out_ptr + out_stride) = colour;
|
||||
|
||||
out_ptr += 2;
|
||||
}
|
||||
|
||||
input += in_stride;
|
||||
output += out_stride << 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void normal2x_work_cb_rgb565(void *data, void *thread_data)
|
||||
{
|
||||
struct softfilter_thread_data *thr = (struct softfilter_thread_data*)thread_data;
|
||||
const uint16_t *input = (const uint16_t*)thr->in_data;
|
||||
uint16_t *output = (uint16_t*)thr->out_data;
|
||||
unsigned in_stride = (unsigned)(thr->in_pitch >> 1);
|
||||
unsigned out_stride = (unsigned)(thr->out_pitch >> 1);
|
||||
unsigned x, y;
|
||||
|
||||
for (y = 0; y < thr->height; ++y)
|
||||
{
|
||||
uint16_t * out_ptr = output;
|
||||
for (x = 0; x < thr->width; ++x)
|
||||
{
|
||||
uint32_t colour = (uint32_t)*(input + x);
|
||||
colour |= colour << 16;
|
||||
|
||||
*(uint32_t *)(out_ptr) = colour;
|
||||
*(uint32_t *)(out_ptr + out_stride) = colour;
|
||||
|
||||
out_ptr += 2;
|
||||
}
|
||||
|
||||
input += in_stride;
|
||||
output += out_stride << 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void normal2x_generic_packets(void *data,
|
||||
struct softfilter_work_packet *packets,
|
||||
void *output, size_t output_stride,
|
||||
const void *input, unsigned width, unsigned height, size_t input_stride)
|
||||
{
|
||||
/* We are guaranteed single threaded operation
|
||||
* (filt->threads = 1) so we don't need to loop
|
||||
* over threads and can cull some code. This only
|
||||
* makes the tiniest performance difference, but
|
||||
* every little helps when running on an o3DS... */
|
||||
struct filter_data *filt = (struct filter_data*)data;
|
||||
struct softfilter_thread_data *thr = (struct softfilter_thread_data*)&filt->workers[0];
|
||||
|
||||
thr->out_data = (uint8_t*)output;
|
||||
thr->in_data = (const uint8_t*)input;
|
||||
thr->out_pitch = output_stride;
|
||||
thr->in_pitch = input_stride;
|
||||
thr->width = width;
|
||||
thr->height = height;
|
||||
|
||||
if (filt->in_fmt == SOFTFILTER_FMT_XRGB8888) {
|
||||
packets[0].work = normal2x_work_cb_xrgb8888;
|
||||
} else if (filt->in_fmt == SOFTFILTER_FMT_RGB565) {
|
||||
packets[0].work = normal2x_work_cb_rgb565;
|
||||
}
|
||||
packets[0].thread_data = thr;
|
||||
}
|
||||
|
||||
static const struct softfilter_implementation normal2x_generic = {
|
||||
normal2x_generic_input_fmts,
|
||||
normal2x_generic_output_fmts,
|
||||
|
||||
normal2x_generic_create,
|
||||
normal2x_generic_destroy,
|
||||
|
||||
normal2x_generic_threads,
|
||||
normal2x_generic_output,
|
||||
normal2x_generic_packets,
|
||||
|
||||
SOFTFILTER_API_VERSION,
|
||||
"Normal2x",
|
||||
"normal2x",
|
||||
};
|
||||
|
||||
const struct softfilter_implementation *softfilter_get_implementation(
|
||||
softfilter_simd_mask_t simd)
|
||||
{
|
||||
(void)simd;
|
||||
return &normal2x_generic;
|
||||
}
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#undef softfilter_get_implementation
|
||||
#undef softfilter_thread_data
|
||||
#undef filter_data
|
||||
#endif
|
@ -438,6 +438,8 @@ VIDEO DRIVER
|
||||
#include "../gfx/drivers/gx_gfx.c"
|
||||
#elif defined(PSP)
|
||||
#include "../gfx/drivers/psp1_gfx.c"
|
||||
#elif defined(PS2)
|
||||
#include "../gfx/drivers/ps2_gfx.c"
|
||||
#elif defined(HAVE_VITA2D)
|
||||
#include "../deps/libvita2d/source/vita2d.c"
|
||||
#include "../deps/libvita2d/source/vita2d_texture.c"
|
||||
@ -567,7 +569,10 @@ INPUT
|
||||
#elif defined(SN_TARGET_PSP2) || defined(PSP) || defined(VITA)
|
||||
#include "../input/drivers/psp_input.c"
|
||||
#include "../input/drivers_joypad/psp_joypad.c"
|
||||
#elif defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH)
|
||||
#elif defined(PS2)
|
||||
#include "../input/drivers/ps2_input.c"
|
||||
#include "../input/drivers_joypad/ps2_joypad.c"
|
||||
#elif defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL)
|
||||
#include "../input/drivers/cocoa_input.c"
|
||||
#elif defined(_3DS)
|
||||
#include "../input/drivers/ctr_input.c"
|
||||
@ -764,6 +769,8 @@ AUDIO
|
||||
#include "../audio/drivers/rwebaudio.c"
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
#include "../audio/drivers/psp_audio.c"
|
||||
#elif defined(PS2)
|
||||
// #include "../audio/drivers/ps2_audio.c"
|
||||
#elif defined(_3DS)
|
||||
#include "../audio/drivers/ctr_csnd_audio.c"
|
||||
#include "../audio/drivers/ctr_dsp_audio.c"
|
||||
@ -860,6 +867,7 @@ FILTERS
|
||||
#include "../gfx/video_filters/blargg_ntsc_snes.c"
|
||||
#include "../gfx/video_filters/lq2x.c"
|
||||
#include "../gfx/video_filters/phosphor2x.c"
|
||||
#include "../gfx/video_filters/normal2x.c"
|
||||
|
||||
#include "../libretro-common/audio/dsp_filters/echo.c"
|
||||
#include "../libretro-common/audio/dsp_filters/eq.c"
|
||||
@ -958,6 +966,8 @@ FRONTEND
|
||||
#include "../frontend/drivers/platform_wiiu.c"
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
#include "../frontend/drivers/platform_psp.c"
|
||||
#elif defined(PS2)
|
||||
#include "../frontend/drivers/platform_ps2.c"
|
||||
#elif defined(_3DS)
|
||||
#include "../frontend/drivers/platform_ctr.c"
|
||||
#elif defined(SWITCH) && defined(HAVE_LIBNX)
|
||||
@ -1035,6 +1045,7 @@ RETROARCH
|
||||
#include "../intl/msg_hash_chs.c"
|
||||
#include "../intl/msg_hash_cht.c"
|
||||
#include "../intl/msg_hash_ar.c"
|
||||
#include "../intl/msg_hash_el.c"
|
||||
#endif
|
||||
|
||||
#include "../intl/msg_hash_us.c"
|
||||
@ -1263,6 +1274,14 @@ MENU
|
||||
#ifdef HAVE_XMB
|
||||
#include "../menu/drivers/xmb.c"
|
||||
#endif
|
||||
#ifdef HAVE_OZONE
|
||||
#include "../menu/drivers/ozone/ozone.c"
|
||||
#include "../menu/drivers/ozone/ozone_display.c"
|
||||
#include "../menu/drivers/ozone/ozone_entries.c"
|
||||
#include "../menu/drivers/ozone/ozone_sidebar.c"
|
||||
#include "../menu/drivers/ozone/ozone_texture.c"
|
||||
#include "../menu/drivers/ozone/ozone_theme.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRIPES
|
||||
#include "../menu/drivers/stripes.c"
|
||||
|
@ -27,9 +27,14 @@
|
||||
#include "../frontend/drivers/platform_darwin.m"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||
#if defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA)
|
||||
#include "../gfx/drivers_context/macos_ctx.m"
|
||||
#include "../gfx/drivers_context/cocoa_gl_ctx.m"
|
||||
#include "../ui/drivers/cocoa/cocoa_common.m"
|
||||
#else
|
||||
#include "../gfx/drivers_context/cocoa_gl_ctx_metal.m"
|
||||
#include "../ui/drivers/cocoa/cocoa_common_metal.m"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOATOUCH)
|
||||
|
||||
@ -45,6 +50,12 @@
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_window.m"
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_msg_window.m"
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_application.m"
|
||||
#elif defined(HAVE_COCOA_METAL)
|
||||
#include "../ui/drivers/ui_cocoa_metal.m"
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_browser_window_metal.m"
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_window_metal.m"
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_msg_window_metal.m"
|
||||
#include "../ui/drivers/cocoa/ui_cocoa_application_metal.m"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
source /etc/preinit
|
||||
script_init
|
||||
|
||||
uistop
|
||||
|
||||
core="$1"
|
||||
rom="$2"
|
||||
shift 2
|
||||
|
||||
if [ -f "/bin/remote-exec" ]; then
|
||||
echo retroarch-clover-child "$core" "\"$rom\"" ${1+"$@"} > /var/exec.flag
|
||||
else
|
||||
exec retroarch-clover-child "$core" "\"$rom\"" ${1+"$@"}
|
||||
fi
|
@ -1,322 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
source /etc/preinit
|
||||
script_init
|
||||
|
||||
#### Variable Definitions ##################################################
|
||||
|
||||
HOME=/etc/libretro
|
||||
corename="$1"
|
||||
noprefix="${corename#km_}"
|
||||
core="$HOME/core/${1}_libretro.so"
|
||||
rom="$2"
|
||||
filename="$(basename "$rom")"
|
||||
id="${filename%.*}"
|
||||
extension="${filename##*.}"
|
||||
newrsram=/var/saves/retroarch
|
||||
autosave="/var/cache/retroarch/$id.state.auto"
|
||||
t_suffix=_time.txt
|
||||
debug=0
|
||||
bezel_mode=0
|
||||
clovercon_file=/dev/clovercon1
|
||||
shift 2
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
[ "$1" == "--load-state-file" ] && load="$2"
|
||||
[ "$1" == "--save-on-quit" ] && save="$2"
|
||||
[ "$1" == "--rollback-input-dir" ] && load="$2/savestate"
|
||||
[ "$1" == "--rollback-output-dir" ] && save="$2/savestate"
|
||||
[ "$1" == "--save-screenshot-on-quit" ] && screenshot="$2"
|
||||
[ "$1" == "--save-data-backing-file" ] && sram="$2"
|
||||
[ "$1" == "--graphic-filter" ] && filter="$2"
|
||||
[ "$1" == "--enable-crt-scanlines" ] && crt=1
|
||||
[ "$1" == "--video-mode" ] && [ "$2" == "crt-filter" ] && filter=crt720 && crt=1
|
||||
[ "$1" == "--video-mode" ] && [ "$2" == "keep-aspect-ratio" ] && filter=gpu720
|
||||
[ "$1" == "--video-mode" ] && [ "$2" == "pixel-perfect" ] && filter=ppu
|
||||
[ "$1" == "--smooth43" ] && smooth43=1
|
||||
[ "$1" == "--no-smooth" ] && no_smooth=1
|
||||
[ "$1" == "--no-scanlines" ] && no_scanlines=1
|
||||
[ "$1" == "--bezel-mode" ] && bezel_mode=1
|
||||
[ "$1" == "--title-code" ] && title_code="$2"
|
||||
[ "$1" == "--ra-extra" ] && extra="$2"
|
||||
[ "$1" == "--ra-nosaves" ] && nosaves=1
|
||||
[ "$1" == "--load-time-path" ] && timefile_load="$2"
|
||||
[ "$1" == "--save-time-path" ] && timefile_save="$2"
|
||||
[ "$1" == "--replay-inputs" ] && demo=1
|
||||
[ "$1" == "--decorative-frame-path" ] && frame="$2"
|
||||
[ "$1" == "--debug-usb" ] && debug=1
|
||||
[ "$1" == "--debug-nand" ] && debug=2
|
||||
[ "$1" == "--custom-loadscreen" ] && custom_loadscreen="$2"
|
||||
shift
|
||||
done
|
||||
|
||||
#### Visuals ###############################################################
|
||||
|
||||
#Retrospective fix for hakchi port splashes
|
||||
if ! echo $corename | grep "prboom\|tyrquake\|cannonball"; then
|
||||
umount "$rootfs/share/retroarch/assets/RAloading-min.png"
|
||||
fi
|
||||
|
||||
# Display Splash Screen
|
||||
if [ ! -z "$custom_loadscreen" ]; then
|
||||
decodepng "$rootfs/share/retroarch/assets/$custom_loadscreen" > /dev/fb0;
|
||||
else
|
||||
if [ -f "$mountpoint/media/hakchi/RA_loading_screens/$noprefix.png" ] && [ -f "$rootfs/share/retroarch/assets/RAloading-min.png" ]; then
|
||||
decodepng "$mountpoint/media/hakchi/RA_loading_screens/$noprefix.png" > /dev/fb0;
|
||||
else
|
||||
if [ -f "$rootfs/share/retroarch/assets/core_loading_screens/$noprefix.png" ] && [ -f "$rootfs/share/retroarch/assets/RAloading-min.png" ]; then
|
||||
decodepng "$rootfs/share/retroarch/assets/core_loading_screens/$noprefix.png" > /dev/fb0;
|
||||
else
|
||||
decodepng "$rootfs/share/retroarch/assets/RAloading-min.png" > /dev/fb0;
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#### Network Mounting ######################################################
|
||||
|
||||
if [ -f "/media/hakchi/retroarch-mounted.cfg" ]; then
|
||||
mv -f /media/hakchi/retroarch-mounted.cfg /etc/libretro/
|
||||
fi
|
||||
|
||||
source /etc/libretro/retroarch-mounted.cfg
|
||||
if [ "$ra_mount_enable" == "true" ] && [ ! -z "${ra_mount_address// }" ] && [ ! -d /var/mount ]; then
|
||||
mkdir -p /var/mount
|
||||
if [ ! -z "${ra_mount_user// }" ] && [ ! -z "${ra_mount_pass// }" ]; then
|
||||
mount -t cifs -o user=$ra_mount_user,pass=$ra_mount_pass $ra_mount_address /var/mount
|
||||
elif [ ! -z "${ra_mount_user// }" ] && [ -z "${ra_mount_pass// }" ]; then
|
||||
mount -t cifs -o user=$ra_mount_user $ra_mount_address /var/mount
|
||||
else
|
||||
mount -t cifs $ra_mount_address /var/mount
|
||||
fi
|
||||
fi
|
||||
|
||||
#### Saves and Configs #####################################################
|
||||
|
||||
[ ! -z "$demo" ] && load="$(dirname "$load")/savestate"
|
||||
|
||||
# Create cache and /var/saves/retroarch directories
|
||||
mkdir -p /var/cache/retroarch
|
||||
mkdir -p "$newrsram"
|
||||
|
||||
# Create a "cartridge.sram" file of 21B to avoid hakchi2 save-state manager from removing the folder
|
||||
# Just in case we're going the "/var/saves/CLV-Z-RETROARCH" way
|
||||
# if [ -f "/var/saves/CLV-Z-RETROARCH/cartridge.sram" ]; then
|
||||
# [ "$(wc -c </var/saves/CLV-Z-RETROARCH/cartridge.sram)" -lt 21 ] && rm /var/saves/CLV-Z-RETROARCH/cartridge.sram && dd if=/dev/zero of=/var/saves/CLV-Z-RETROARCH/cartridge.sram bs=21 count=1
|
||||
# else
|
||||
# dd if=/dev/zero of=/var/saves/CLV-Z-RETROARCH/cartridge.sram bs=21 count=1
|
||||
# fi
|
||||
|
||||
# Moving RetroArch saves from "/var/saves/" to "/var/saves/retroarch/" if the ID is known (if the .desktop is on the console atm)
|
||||
if [ -z "$(ls -A "$newrsram")" ]; then # so this whole part only executes at the 1st launch
|
||||
if [ -d "/media/hakchi" ]; then
|
||||
desktop_search="/media/hakchi/games"
|
||||
else
|
||||
desktop_search="/var/lib/hakchi/games"
|
||||
fi
|
||||
for rasaves in /var/saves/CLV-*; do
|
||||
fdsgame=0
|
||||
canoecheck=0
|
||||
gameid="$(basename "$rasaves")"
|
||||
# [ "$gameid" = "CLV-Z-RETROARCH" ] && continue
|
||||
if [ -f "$rasaves/cartridge.sram" ] && [ -f "$rasaves/cartridge.sram.hash" ]; then
|
||||
[ "$(tail -c 20 "$rasaves/cartridge.sram")" = "$(cat "$rasaves/cartridge.sram.hash")" ] && canoecheck=1 # check if thats a Canoe save
|
||||
fi
|
||||
if [ "$canoecheck" = 0 ] && [ -f "$rasaves/cartridge.sram" ]; then
|
||||
if [ ! -z "$(find "$desktop_search" -name "$gameid.desktop")" ]; then # search for .desktop file
|
||||
filename2="$(cat `find "$desktop_search" -name "$gameid.desktop"` | grep "^Exec=" | basename `awk '{print $2}'`)"
|
||||
[ "${filename2##*.}" = "fds" ] && fdsgame=1
|
||||
filename2="${filename2%.*}"
|
||||
if [ ! -z "$(cat `find "$desktop_search" -name "$gameid.desktop"` | grep "/bin/gpsp")" ]; then
|
||||
mv "$rasaves/cartridge.sram" "$newrsram/$filename2.sav" # rename the file to .sav if its a gpSP save
|
||||
elif [ ! -z "$(cat `find "$desktop_search" -name "$gameid.desktop"` | grep "/bin/nes\|/bin/nestopia")" ] && [ "$fdsgame" = 1 ]; then
|
||||
mv "$rasaves/cartridge.sram" "$newrsram/$filename2.sav" # rename the file to .sav if its a FDS Nestopia save
|
||||
else
|
||||
mv "$rasaves/cartridge.sram" "$newrsram/$filename2.srm" # rename the file to .srm
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if ls "$rasaves" | grep -w "brm$"; then
|
||||
mv "$rasaves/"*.brm "$newrsram" # no need to rename those, just move
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Copy savestates from USB if any
|
||||
if [ -d "/media/data/ra_savestates" ] && ls "/media/data/ra_savestates/$title_code/$id.state"*; then
|
||||
cp "/media/data/ra_savestates/$title_code/$id.state"* /var/cache/retroarch
|
||||
fi
|
||||
|
||||
# Move mame config files to "/var/saves/retroarch"
|
||||
if [ -d "/etc/libretro/.config/retroarch/config/arcade" ]; then
|
||||
if [ ! -z "$(ls -A /etc/libretro/.config/retroarch/config/arcade)" ]; then
|
||||
mv /etc/libretro/.config/retroarch/config/arcade/* "$newrsram"
|
||||
[ -z "$(ls -A /etc/libretro/.config/retroarch/config/arcade)" ] && rmdir /etc/libretro/.config/retroarch/config/arcade
|
||||
fi
|
||||
fi
|
||||
|
||||
# saves if any
|
||||
if [ ! -z "$load" ] && [ -f "$load" ] && [ -z "$nosaves" ]; then
|
||||
if [ "$(hexdump -n 2 -e '1/1 "%02X"' "$load")" == "1F8B" ]; then
|
||||
cp -f "$load" "$autosave.gz"
|
||||
gunzip -f "$autosave.gz"
|
||||
else
|
||||
cp -f "$load" "$autosave"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Moving and renaming save from "/var/saves/CLV-*/cartridge.*" to "/var/saves/retroarch/$id.*" that were previously unknown
|
||||
if [ "$noprefix" == "nestopia" ] && [ "$extension" == "fds" ]; then
|
||||
[ ! -z "$sram" ] && [ -f "$sram" ] && mv "$sram" "$newrsram/$id.sav"
|
||||
elif [ "$noprefix" == "gpsp" ]; then
|
||||
[ ! -z "$sram" ] && [ -f "$sram" ] && mv "$sram" "$newrsram/$id.sav"
|
||||
elif [ "$noprefix" == "genesis_plus_gx" ]; then
|
||||
[ -f "/var/saves/$title_code/$id.brm" ] && mv "/var/saves/$title_code/$id.brm" "$newrsram"
|
||||
else
|
||||
[ ! -z "$sram" ] && [ -f "$sram" ] && mv "$sram" "$newrsram/$id.srm"
|
||||
fi
|
||||
|
||||
#### General ###############################################################
|
||||
|
||||
#Overcommit this. (Should solve dumb crashes due to memory limits)
|
||||
echo "1" > "/proc/sys/vm/overcommit_memory"
|
||||
|
||||
[ -z "$timefile_save" ] && timefile_save="$load$t_suffix"
|
||||
[ -z "$timefile_load" ] && timefile_load="$load$t_suffix"
|
||||
|
||||
# Hold L button while starting a game to toggle bezel-mode for this game
|
||||
if [ -e "$clovercon_file" ] && [ "$(cat $clovercon_file)" == "0004" ]; then
|
||||
if [ "$bezel_mode" == "0" ]; then
|
||||
sed -i "s/^Exec.*/& --bezel-mode/" "$gamepath/$title_code/$title_code.desktop" && bezel_mode=1
|
||||
else
|
||||
sed -i "s/ --bezel-mode//g" "$gamepath/$title_code/$title_code.desktop" && bezel_mode=0
|
||||
fi
|
||||
fi
|
||||
# Hold R button while starting a game to toggle bezel-mode for this core
|
||||
if [ -e "$clovercon_file" ] && [ "$(cat $clovercon_file)" == "0008" ]; then
|
||||
[ ! -f "$HOME/bezel-core" ] && touch "$HOME/bezel-core"
|
||||
if grep "^$corename$" "$HOME/bezel-core"; then
|
||||
sed -i "/^$corename$/d" "$HOME/bezel-core"
|
||||
else
|
||||
echo "$corename" >> "$HOME/bezel-core"
|
||||
fi
|
||||
fi
|
||||
[ -f "$HOME/bezel-core" ] && grep "^$corename$" "$HOME/bezel-core" && bezel_mode=1
|
||||
|
||||
# Smooth, border and scanlines
|
||||
if [ "$bezel_mode" == "1" ]; then
|
||||
[ "$filter" == "crt720" ] && overlay1=scanlines.png && overlay2="$frame.png"
|
||||
else
|
||||
[ "$filter" == "crt720" ] && overlay1=scanlines.png
|
||||
fi
|
||||
[ "$filter" == "crt720" ] && [ ! -z "$no_scanlines" ] || [ ! "$filter" == "crt720" ] && overlay1="$frame.png"
|
||||
retroarch_watchdog --configEdit /etc/libretro/.config/retroarch/overlay/default.cfg overlay0_overlay "$overlay1" overlay0_desc0_overlay "$overlay2"
|
||||
retroarch_watchdog --configEdit /etc/libretro/.config/retroarch/overlay/default_scanlines.cfg overlay0_desc0_overlay "$frame.png"
|
||||
|
||||
ra_config_args=""
|
||||
# Functions to make the rest easier
|
||||
smooth(){ ra_config_args="$ra_config_args video_smooth $1"; }
|
||||
overlay(){ ra_config_args="$ra_config_args input_overlay_enable $1"; }
|
||||
overlay_file(){ ra_config_args="$ra_config_args input_overlay ~/.config/retroarch/overlay/$1"; }
|
||||
int_scale(){ ra_config_args="$ra_config_args video_scale_integer $1"; }
|
||||
ratio(){ ra_config_args="$ra_config_args aspect_ratio_index $1"; }
|
||||
width(){ ra_config_args="$ra_config_args custom_viewport_width $1"; }
|
||||
height(){ ra_config_args="$ra_config_args custom_viewport_height $1"; }
|
||||
posx(){ ra_config_args="$ra_config_args custom_viewport_x $1"; }
|
||||
posy(){ ra_config_args="$ra_config_args custom_viewport_y $1"; }
|
||||
|
||||
# Smooth and bezel-mode
|
||||
if [ "$bezel_mode" == "1" ]; then
|
||||
[ "$filter" == "crt720" ] && width 877 && posx 201
|
||||
[ "$filter" == "gpu720" ] && smooth false && width 877 && posx 201
|
||||
[ "$filter" == "ppu" ] && smooth false && width 768 && posx 256
|
||||
ratio 22 && overlay true && overlay_file default.cfg && height 672 && posy 24 && int_scale true
|
||||
fi
|
||||
[ "$filter" == "crt720" ] && overlay true
|
||||
[ "$filter" == "crt720" ] && [ -z "$no_smooth" ] && smooth true
|
||||
[ "$filter" == "crt720" ] && [ ! -z "$no_smooth" ] && smooth false
|
||||
[ "$filter" == "gpu720" ] && [ ! -z "$smooth43" ] && smooth true
|
||||
|
||||
# Set config for standalone launch mode
|
||||
if [ -z "${corename// }" ]; then
|
||||
ra_config_args="$ra_config_args savefile_directory /var/saves/CLV-Z-RETROARCH"
|
||||
ra_config_args="$ra_config_args savestate_directory /var/saves/CLV-Z-RASAVESTATES"
|
||||
ra_config_args="$ra_config_args savestate_auto_save false"
|
||||
ra_config_args="$ra_config_args savestate_auto_load false"
|
||||
ra_config_args="$ra_config_args autosave_interval 0"
|
||||
fi
|
||||
|
||||
[ ! -z "$ra_config_args" ] && retroarch_watchdog --configEdit /etc/libretro/retroarch.cfg $ra_config_args
|
||||
|
||||
#### Runtime ###############################################################
|
||||
|
||||
if [ -f "/media/hakchi/RA_DEV_MODE" ]; then #Devmode Active (Record current session)
|
||||
if [ -z "${corename// }" ]; then
|
||||
rm -f /media/Development_RetroArch.log
|
||||
echo "Pre RA load Core Temp: $(more /sys/devices/virtual/thermal/thermal_zone0/temp)" >> /media/Development_RA_temp.log
|
||||
retroarch -c "$HOME/retroarch.cfg" -vf > /media/Development_RetroArch.log 2>&1 &
|
||||
else
|
||||
rm -f /media/Development_RetroArch.log
|
||||
echo "Pre RA load Core Temp: $(more /sys/devices/virtual/thermal/thermal_zone0/temp)" >> /media/Development_RA_temp.log
|
||||
retroarch -c "$HOME/retroarch.cfg" -vfL "$core" "$rom" "$extra" > /media/Development_RetroArch.log 2>&1 &
|
||||
fi
|
||||
else
|
||||
if [ -z "${corename// }" ]; then
|
||||
retroarch -c "$HOME/retroarch.cfg" -vf &
|
||||
fi
|
||||
if [ "$debug" == "0" ]; then #Default
|
||||
retroarch -c "$HOME/retroarch.cfg" -vfL "$core" "$rom" "$extra" &
|
||||
fi
|
||||
if [ "$debug" == "1" ]; then #Verbose USB mode
|
||||
retroarch -c "$HOME/retroarch.cfg" -vfL "$core" "$rom" "$extra" > "/media/${filename}_RetroArch.log" 2>&1 &
|
||||
fi
|
||||
if [ "$debug" == "2" ]; then #Verbose NAND mode
|
||||
retroarch -c "$HOME/retroarch.cfg" -vfL "$core" "$rom" "$extra" > "/tmp/${filename}_RetroArch.log" 2>&1 &
|
||||
fi
|
||||
fi
|
||||
|
||||
#### Watchdog ##############################################################
|
||||
|
||||
# Set Watchdog Arguments
|
||||
watchdog_args="$!"
|
||||
# Demo mode enabled
|
||||
[ ! -z "$demo" ] && watchdog_args="$watchdog_args --demo"
|
||||
# Set Screenshot Args
|
||||
[ ! -z "$screenshot" ] && [ -z "$nosaves" ] && watchdog_args="$watchdog_args --screenshot $screenshot"
|
||||
# Load Time Played
|
||||
[ -f "$timefile_load" ] && watchdog_args="$watchdog_args --time $(cat "$timefile_load")"
|
||||
[ -z "$demo" ] && watchdog_args="$watchdog_args --timePath $timefile_save"
|
||||
|
||||
# Create output folders
|
||||
[ ! -z "$save" ] && mkdir -p "$(dirname "$save")"
|
||||
[ ! -z "$sram" ] && mkdir -p "$(dirname "$sram")"
|
||||
[ ! -z "$screenshot" ] && mkdir -p "$(dirname "$screenshot")"
|
||||
|
||||
# Run retroarch watchdog
|
||||
retroarch_watchdog $watchdog_args
|
||||
|
||||
#### Cleanup ###############################################################
|
||||
|
||||
# Saves!
|
||||
[ ! -z "$save" ] && [ -f "$autosave" ] && [ -z "$nosaves" ] && gzip -f "$autosave" && mv -f "$autosave.gz" "$save"
|
||||
|
||||
# Restore Retroarch Config
|
||||
retroarch_watchdog --configRestore /etc/libretro/retroarch.cfg
|
||||
|
||||
# Copy savestates to USB if any and delete cache folder
|
||||
if [ -d "/media/hakchi" ] && ls "/var/cache/retroarch/$id".*[^auto]; then
|
||||
[ ! -d "/media/data/ra_savestates/$title_code" ] && mkdir -p "/media/data/ra_savestates/$title_code"
|
||||
cp "/var/cache/retroarch/$id".*[^auto] "/media/data/ra_savestates/$title_code"
|
||||
fi
|
||||
rm -rf /var/cache/retroarch/
|
||||
|
||||
#Remove network drive mount if Hakchi Mount mod is enabled
|
||||
if [ ! -f "$rootfs/etc/hakchi_mount_mod" ]; then
|
||||
umount "/var/mount" && rm -rf "/var/mount"
|
||||
fi
|
||||
|
||||
if [ -f "/media/hakchi/RA_DEV_MODE" ]; then #Devmode Active (Record current session)
|
||||
echo "Post RA load Core Temp: $(more /sys/devices/virtual/thermal/thermal_zone0/temp)" >> /media/Development_RA_temp.log
|
||||
fi
|
||||
|
||||
# Back to the shell
|
||||
uistart
|
@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
source /etc/preinit
|
||||
script_init
|
||||
|
||||
uistop
|
||||
|
||||
exec retroarch-clover-child
|
||||
if [ -f "/bin/remote-exec" ]; then
|
||||
echo retroarch-clover-child > /var/exec.flag
|
||||
else
|
||||
exec retroarch-clover-child
|
||||
fi
|
@ -1,18 +0,0 @@
|
||||
Hakchi_Libretro_Initialise(){
|
||||
if [ -z "$(mount | grep "/etc/libretro ")" ] && [ -d "$mountpoint/media/$modname" ] && [ "$cfg_usb_rw" == "y" ]; then
|
||||
local externalPath="$mountpoint/media/data/ra_data"
|
||||
local localPath="$rootfs/etc/libretro/.config/retroarch"
|
||||
for ra_folders in database thumbnails playlists downloads; do
|
||||
if [ ! -d "$externalPath/$ra_folders" ]; then
|
||||
mkdir -p "$externalPath/$ra_folders"
|
||||
copy "$localPath/$ra_folders" "$externalPath"
|
||||
rm -rf "$localPath/$ra_folders/"*
|
||||
fi
|
||||
mount_bind "$externalPath/$ra_folders" "$localPath/$ra_folders"
|
||||
overmount "${localPath#$rootfs}/$ra_folders"
|
||||
done
|
||||
unset ra_folders
|
||||
fi
|
||||
[ -f "$mountpoint/usr/bin/clover-kachikachi" ] && overmount /usr/bin/clover-kachikachi
|
||||
[ -f "$mountpoint/usr/bin/clover-canoe-shvc" ] && overmount /usr/bin/clover-canoe-shvc
|
||||
}
|
@ -1 +0,0 @@
|
||||
Hakchi_Libretro_Initialise
|
@ -1,55 +0,0 @@
|
||||
echo "Grabbing old config variables..."
|
||||
cheevos_username=$(grep -i "cheevos_username*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
cheevos_password=$(grep -i "cheevos_password*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
cheevos_token=$(grep -i "cheevos_token*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
netplay_nickname=$(grep -i "netplay_nickname*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
netplay_mitm_server=$(grep -i "netplay_mitm_server*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
netplay_ip_port=$(grep -i "netplay_ip_port*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
netplay_ip_address=$(grep -i "netplay_ip_address*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
netplay_password=$(grep -i "netplay_password*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
netplay_spectate_password=$(grep -i "netplay_spectate_password*" $rootfs/etc/libretro/retroarch.cfg)
|
||||
|
||||
echo "Uninstalling old version of Hakchi RetroArch neo..."
|
||||
var=$(hakchi pack_list | grep "Hakchi_Retroarch_Neo_") && hakchi pack_uninstall $var
|
||||
echo "Uninstalled $var, Installing new version now..."
|
||||
|
||||
transfer_default
|
||||
chmod +x $rootfs/bin/*
|
||||
chmod +x $rootfs/usr/bin/*
|
||||
mkdir -p $rootfs/etc/libretro/system
|
||||
[ -f "/newroot/usr/share/kachikachi/fds_bios.bin" ] && cp -f /newroot/usr/share/kachikachi/fds_bios.bin $rootfs/etc/libretro/system/disksys.rom
|
||||
mkdir -p $rootfs/etc/options_menu/retroarch/default_files
|
||||
copy $rootfs/etc/libretro/retroarch.cfg $rootfs/etc/options_menu/retroarch/default_files/
|
||||
copy $rootfs/etc/libretro/retroarch-core-options.cfg $rootfs/etc/options_menu/retroarch/default_files/
|
||||
loadscr_path=$rootfs/share/retroarch/assets/core_loading_screens
|
||||
for arcade_loadscr in "$loadscr_path/fbalpha2012.png" "$loadscr_path/fbalpha2012_cps1.png" "$loadscr_path/fbalpha2012_cps2.png" "$loadscr_path/fbalpha2012_cps3.png" "$loadscr_path/fbalpha2012_neogeo.png" "$loadscr_path/fb_alpha.png" "$loadscr_path/mame2003.png" "$loadscr_path/mame2003_xtreme.png" "$loadscr_path/mame2010.png" "$loadscr_path/mame2014.png"; do
|
||||
if [ ! -e "$arcade_loadscr" ]; then
|
||||
ln -s "${loadscr_path#/newroot}/mame2000.png" "$arcade_loadscr"
|
||||
fi
|
||||
done
|
||||
for snes_loadscr in "$loadscr_path/snes9x2002.png" "$loadscr_path/snes9x2005.png" "$loadscr_path/snes9x2010.png"; do
|
||||
if [ ! -e "$snes_loadscr" ]; then
|
||||
ln -s "${loadscr_path#/newroot}/snes9x.png" "$snes_loadscr"
|
||||
fi
|
||||
done
|
||||
[ ! -e "$loadscr_path/fceumm.png" ] && ln -s ${loadscr_path#/newroot}/nestopia.png $loadscr_path/fceumm.png
|
||||
[ ! -e "$loadscr_path/mupen64plus.png" ] && ln -s ${loadscr_path#/newroot}/glupen64.png $loadscr_path/mupen64plus.png
|
||||
[ ! -e "$loadscr_path/genesis_plus_gx.png" ] && ln -s ${loadscr_path#/newroot}/picodrive.png $loadscr_path/genesis_plus_gx.png
|
||||
|
||||
|
||||
echo "Reloading built in config..."
|
||||
sed -i -e 's/cheevos_username = "[^"]*"/cheevos_username = "'$cheevos_username'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
sed -i -e 's/cheevos_password = "[^"]*"/cheevos_password = "'$cheevos_password'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
sed -i -e 's/cheevos_token = "[^"]*"/cheevos_token = "'$cheevos_token'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
sed -i -e 's/netplay_mitm_server = "[^"]*"/netplay_mitm_server = "'$netplay_mitm_server'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
sed -i -e 's/netplay_ip_port = "[^"]*"/netplay_ip_port = "'$netplay_ip_port'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
sed -i -e 's/netplay_ip_address = "[^"]*"/netplay_ip_address = "'$netplay_ip_address'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
sed -i -e 's/netplay_spectate_password = "[^"]*"/netplay_spectate_password = "'$netplay_spectate_password'"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
|
||||
if [ "$cheevos_username" == "hakchiresources" ]; then
|
||||
sed -i -e 's/cheevos_enable = "[^"]*"/cheevos_enable = "false"/g' $rootfs/etc/libretro/retroarch.cfg
|
||||
fi
|
||||
|
||||
|
||||
echo "Install complete!"
|
||||
return 1
|
@ -1,49 +0,0 @@
|
||||
|
||||
## New Release Overview video
|
||||
|
||||
## Changelog
|
||||
|
||||
### 1.7.3b - July 2018
|
||||
|
||||
**Please note: NES cores are no longer bundled with RA. You will need to download them seperately**
|
||||
|
||||
**Please note: Standalone RetroArch Saves will be located in your saves under CLV-RETROARCH**
|
||||
|
||||
- Huge amount of optimisation and streamlining reduced deployed package size by over half! (Complete RA now only ~5mb compared to ~12mb)
|
||||
- RA Saves and savestates fully functional and working for all cores (that support them!)
|
||||
- Launching RetroArch standalone now fully functional and working. Saves also supported.
|
||||
- Switching roms within RetroArch standalone now supports saving.
|
||||
- Stability fixes for intensive cores (N64, PSX) reducing the risk of C8 crashing.
|
||||
- Added ability to now download and update cores directly from the RA menu via HakchiCloud!
|
||||
- Added network storage support. You can now play entire rom sets and media directly from your networked drives!
|
||||
- Playlist support now implemented. Add thousands of roms to your RetroArch GUI with boxart and thumbnails and launch the roms directly from the GUI (No GUI limit!)
|
||||
- New layout look
|
||||
- Saving mechanism reworked, better functionality and Hakchi Save Manager support.
|
||||
- Loading and shutting down of RetroArch times reduced via optimisation.
|
||||
- Fixed occasional C8 errors when launching RetroArch directly
|
||||
- Holding R now enables bezel mode per core instead of individual games
|
||||
- Numerous bug fixes
|
||||
|
||||
### 1.7.3a - May 2018
|
||||
|
||||
- Built with preconfigured network and achievement support. (As soon as network connection is available, network and achievements are enabled.)
|
||||
- New RetroArch binary 1.7.3 (completely overhauled audio mixer)
|
||||
- Few RA bug fixes
|
||||
- Default GUI is now changed to XMB with the purpose of using network and achievements.
|
||||
- A few mapping issues Fixed for keyboard to gamepad
|
||||
- Saves mame config properly (dip switches, etc.)
|
||||
- Optimizations to avoid to many writes on NAND
|
||||
- Boot sequence optimised
|
||||
- Doom and Quake splash screen bug fixed.
|
||||
|
||||
RetroArch and Retroarch Cores by libretro
|
||||
|
||||
Hakchi RetroArch Neo main development by Swingflip, Bslenul and CompCom
|
||||
|
||||
Hakchi by MadMonkey
|
||||
|
||||
Special thanks to Team Hakchi Resources, Team Shinkansen and MadMonkey
|
||||
|
||||
https://hakchiresources.com
|
||||
|
||||
(c) 2016-2018
|
@ -1057,11 +1057,12 @@ static void handle_hotplug(android_input_t *android,
|
||||
* This device is composed of two hid devices
|
||||
* We make it look like one device
|
||||
*/
|
||||
else if(strstr(device_model, "R800") &&
|
||||
(
|
||||
strstr(device_name, "keypad-game-zeus") ||
|
||||
strstr(device_name, "keypad-zeus")
|
||||
)
|
||||
else if((strstr(device_model, "R800") || strstr(device_model, "Xperia Play")) &&
|
||||
(
|
||||
strstr(device_name, "keypad-game-zeus") ||
|
||||
strstr(device_name, "keypad-zeus") ||
|
||||
strstr(device_name, "Android Gamepad")
|
||||
)
|
||||
)
|
||||
{
|
||||
/* only use the hack if the device is one of the built-in devices */
|
||||
|
152
input/drivers/ps2_input.c
Normal file
152
input/drivers/ps2_input.c
Normal file
@ -0,0 +1,152 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include <libpad.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <libretro.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "../input_driver.h"
|
||||
|
||||
typedef struct ps2_input
|
||||
{
|
||||
bool blocked;
|
||||
const input_device_driver_t *joypad;
|
||||
} ps2_input_t;
|
||||
|
||||
static void ps2_input_poll(void *data)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
|
||||
if (ps2 && ps2->joypad)
|
||||
ps2->joypad->poll();
|
||||
}
|
||||
|
||||
static int16_t ps2_input_state(void *data,
|
||||
rarch_joypad_info_t joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
return input_joypad_pressed(ps2->joypad, joypad_info, port, binds[port], id);
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
if (binds[port])
|
||||
return input_joypad_analog(ps2->joypad, joypad_info, port, idx, id, binds[port]);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ps2_input_free_input(void *data)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
|
||||
if (ps2 && ps2->joypad)
|
||||
ps2->joypad->destroy();
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
static void* ps2_input_initialize(const char *joypad_driver)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)calloc(1, sizeof(*ps2));
|
||||
if (!ps2)
|
||||
return NULL;
|
||||
|
||||
ps2->joypad = input_joypad_init_driver(joypad_driver, ps2);
|
||||
|
||||
return ps2;
|
||||
}
|
||||
|
||||
static uint64_t ps2_input_get_capabilities(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return (1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_ANALOG);
|
||||
}
|
||||
|
||||
static const input_device_driver_t *ps2_input_get_joypad_driver(void *data)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
if (ps2)
|
||||
return ps2->joypad;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ps2_input_grab_mouse(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
(void)state;
|
||||
}
|
||||
|
||||
static bool ps2_input_set_rumble(void *data, unsigned port,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
|
||||
if (ps2 && ps2->joypad)
|
||||
return input_joypad_set_rumble(ps2->joypad,
|
||||
port, effect, strength);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ps2_input_keyboard_mapping_is_blocked(void *data)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
if (!ps2)
|
||||
return false;
|
||||
return ps2->blocked;
|
||||
}
|
||||
|
||||
static void ps2_input_keyboard_mapping_set_block(void *data, bool value)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
if (!ps2)
|
||||
return;
|
||||
ps2->blocked = value;
|
||||
}
|
||||
|
||||
input_driver_t input_ps2 = {
|
||||
ps2_input_initialize,
|
||||
ps2_input_poll,
|
||||
ps2_input_state,
|
||||
ps2_input_free_input,
|
||||
NULL,
|
||||
NULL,
|
||||
ps2_input_get_capabilities,
|
||||
"ps2",
|
||||
ps2_input_grab_mouse,
|
||||
NULL,
|
||||
ps2_input_set_rumble,
|
||||
ps2_input_get_joypad_driver,
|
||||
NULL,
|
||||
ps2_input_keyboard_mapping_is_blocked,
|
||||
ps2_input_keyboard_mapping_set_block,
|
||||
};
|
@ -11,12 +11,14 @@
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
#include <switch.h>
|
||||
|
||||
#define MULTITOUCH_LIMIT 4 /* supports up to this many fingers at once */
|
||||
#define TOUCH_AXIS_MAX 0x7fff /* abstraction of pointer coords */
|
||||
#endif
|
||||
|
||||
#include "../input_driver.h"
|
||||
|
||||
#define MAX_PADS 10
|
||||
#define TOUCH_AXIS_MAX 0x7fff /* abstraction of pointer coords */
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@ -27,16 +29,15 @@ typedef struct switch_input
|
||||
bool blocked;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
uint32_t touch_x;
|
||||
uint32_t touch_y;
|
||||
|
||||
uint32_t touch_scale_x;
|
||||
uint32_t touch_scale_y;
|
||||
|
||||
uint32_t touch_half_resolution_x;
|
||||
uint32_t touch_half_resolution_y;
|
||||
|
||||
bool touch_state;
|
||||
bool touch_state[MULTITOUCH_LIMIT];
|
||||
uint32_t touch_x[MULTITOUCH_LIMIT];
|
||||
uint32_t touch_y[MULTITOUCH_LIMIT];
|
||||
#endif
|
||||
} switch_input_t;
|
||||
|
||||
@ -50,15 +51,18 @@ static void switch_input_poll(void *data)
|
||||
#ifdef HAVE_LIBNX
|
||||
uint32_t touch_count = hidTouchCount();
|
||||
|
||||
sw->touch_state = touch_count > 0;
|
||||
|
||||
if (sw->touch_state)
|
||||
for (int i = 0; i < MULTITOUCH_LIMIT; i++)
|
||||
{
|
||||
touchPosition touch_position;
|
||||
hidTouchRead(&touch_position, 0);
|
||||
sw->touch_state[i] = touch_count > i;
|
||||
|
||||
sw->touch_x = touch_position.px;
|
||||
sw->touch_y = touch_position.py;
|
||||
if (sw->touch_state[i])
|
||||
{
|
||||
touchPosition touch_position;
|
||||
hidTouchRead(&touch_position, i);
|
||||
|
||||
sw->touch_x[i] = touch_position.px;
|
||||
sw->touch_y[i] = touch_position.py;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -76,17 +80,17 @@ void calc_touch_scaling(switch_input_t *sw, uint32_t x, uint32_t y, uint32_t axi
|
||||
static int16_t switch_pointer_device_state(switch_input_t *sw,
|
||||
unsigned id, unsigned idx)
|
||||
{
|
||||
if (idx != 0)
|
||||
if (idx >= MULTITOUCH_LIMIT)
|
||||
return 0;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_POINTER_PRESSED:
|
||||
return sw->touch_state;
|
||||
return sw->touch_state[idx];
|
||||
case RETRO_DEVICE_ID_POINTER_X:
|
||||
return ((sw->touch_x - sw->touch_half_resolution_x) * sw->touch_scale_x);
|
||||
return ((sw->touch_x[idx] - sw->touch_half_resolution_x) * sw->touch_scale_x);
|
||||
case RETRO_DEVICE_ID_POINTER_Y:
|
||||
return ((sw->touch_y - sw->touch_half_resolution_y) * sw->touch_scale_y);
|
||||
return ((sw->touch_y[idx] - sw->touch_half_resolution_y) * sw->touch_scale_y);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -133,6 +137,10 @@ static void switch_input_free_input(void *data)
|
||||
sw->joypad->destroy();
|
||||
|
||||
free(sw);
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
hidExit();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void* switch_input_init(const char *joypad_driver)
|
||||
@ -141,6 +149,10 @@ static void* switch_input_init(const char *joypad_driver)
|
||||
if (!sw)
|
||||
return NULL;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
hidInitialize();
|
||||
#endif
|
||||
|
||||
sw->joypad = input_joypad_init_driver(joypad_driver, sw);
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
|
@ -1284,7 +1284,7 @@ static bool btstack_try_load(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH)
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) || defined(HAVE_COCOA_METAL)
|
||||
run_loop_init_ptr(RUN_LOOP_COCOA);
|
||||
#else
|
||||
run_loop_init_ptr(RUN_LOOP_POSIX);
|
||||
|
167
input/drivers_joypad/ps2_joypad.c
Normal file
167
input/drivers_joypad/ps2_joypad.c
Normal file
@ -0,0 +1,167 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2013-2014 - CatalystG
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include "../input_driver.h"
|
||||
|
||||
#include "libpad.h"
|
||||
|
||||
#define PS2_MAX_PADS 1
|
||||
|
||||
/*
|
||||
* Global var's
|
||||
*/
|
||||
// pad_dma_buf is provided by the user, one buf for each pad
|
||||
// contains the pad's current state
|
||||
static char padBuf[256] __attribute__((aligned(64)));
|
||||
|
||||
static uint64_t pad_state[PS2_MAX_PADS];
|
||||
|
||||
|
||||
static const char *ps2_joypad_name(unsigned pad)
|
||||
{
|
||||
return "PS2 Controller";
|
||||
}
|
||||
|
||||
static bool ps2_joypad_init(void *data)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned players_count = PS2_MAX_PADS;
|
||||
|
||||
for (i = 0; i < players_count; i++)
|
||||
{
|
||||
bool auto_configure = input_autoconfigure_connect( ps2_joypad_name(i),
|
||||
NULL,
|
||||
ps2_joypad.ident,
|
||||
i,
|
||||
0,
|
||||
0);
|
||||
if (!auto_configure) {
|
||||
input_config_set_device_name(i, ps2_joypad_name(i));
|
||||
}
|
||||
|
||||
padInit(i);
|
||||
|
||||
int ret;
|
||||
int port, slot;
|
||||
|
||||
port = 0; // 0 -> Connector 1, 1 -> Connector 2
|
||||
slot = 0; // Always zero if not using multitap
|
||||
|
||||
printf("PortMax: %d\n", padGetPortMax());
|
||||
printf("SlotMax: %d\n", padGetSlotMax(port));
|
||||
|
||||
|
||||
if((ret = padPortOpen(port, slot, padBuf)) == 0) {
|
||||
printf("padOpenPort failed: %d\n", ret);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ps2_joypad_button(unsigned port_num, uint16_t joykey)
|
||||
{
|
||||
if (port_num >= PS2_MAX_PADS)
|
||||
return false;
|
||||
|
||||
return (pad_state[port_num] & (UINT64_C(1) << joykey));
|
||||
}
|
||||
|
||||
static void ps2_joypad_get_buttons(unsigned port_num, input_bits_t *state)
|
||||
{
|
||||
BIT256_CLEAR_ALL_PTR(state);
|
||||
}
|
||||
|
||||
static int16_t ps2_joypad_axis(unsigned port_num, uint32_t joyaxis)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ps2_joypad_poll(void)
|
||||
{
|
||||
unsigned player;
|
||||
unsigned players_count = PS2_MAX_PADS;
|
||||
struct padButtonStatus buttons;
|
||||
|
||||
for (player = 0; player < players_count; player++)
|
||||
{
|
||||
unsigned j, k;
|
||||
unsigned i = player;
|
||||
unsigned p = player;
|
||||
|
||||
int ret = padRead(player, player, &buttons); // port, slot, buttons
|
||||
if (ret != 0)
|
||||
{
|
||||
int32_t state_tmp = 0xffff ^ buttons.btns;
|
||||
|
||||
pad_state[i] = 0;
|
||||
|
||||
pad_state[i] |= (state_tmp & PAD_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_UP) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_START) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_SELECT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_TRIANGLE) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_SQUARE) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_CROSS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_CIRCLE) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_R1) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_L1) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_R2) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R2) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_L2) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L2) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_R3) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R3) : 0;
|
||||
pad_state[i] |= (state_tmp & PAD_L3) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L3) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static bool ps2_joypad_query_pad(unsigned pad)
|
||||
{
|
||||
return pad < PS2_MAX_PADS && pad_state[pad];
|
||||
}
|
||||
|
||||
static bool ps2_joypad_rumble(unsigned pad,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static void ps2_joypad_destroy(void)
|
||||
{
|
||||
}
|
||||
|
||||
input_device_driver_t ps2_joypad = {
|
||||
ps2_joypad_init,
|
||||
ps2_joypad_query_pad,
|
||||
ps2_joypad_destroy,
|
||||
ps2_joypad_button,
|
||||
ps2_joypad_get_buttons,
|
||||
ps2_joypad_axis,
|
||||
ps2_joypad_poll,
|
||||
ps2_joypad_rumble,
|
||||
ps2_joypad_name,
|
||||
"ps2",
|
||||
};
|
@ -34,6 +34,7 @@
|
||||
#include <psp2/ctrl.h>
|
||||
#include <psp2/touch.h>
|
||||
#define PSP_MAX_PADS 4
|
||||
static int psp2_model;
|
||||
static SceCtrlPortInfo old_ctrl_info, curr_ctrl_info;
|
||||
static SceCtrlActuator actuators[PSP_MAX_PADS] = {0};
|
||||
|
||||
@ -63,7 +64,7 @@ extern uint64_t lifecycle_state;
|
||||
static const char *psp_joypad_name(unsigned pad)
|
||||
{
|
||||
#ifdef VITA
|
||||
if (!sceCtrlIsMultiControllerSupported())
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
return "Vita Controller";
|
||||
|
||||
switch (curr_ctrl_info.port[pad + 1])
|
||||
@ -88,7 +89,8 @@ static bool psp_joypad_init(void *data)
|
||||
(void)data;
|
||||
|
||||
#if defined(VITA)
|
||||
if (!sceCtrlIsMultiControllerSupported())
|
||||
psp2_model = sceKernelGetModelForCDialog();
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
{
|
||||
sceTouchSetSamplingState(SCE_TOUCH_PORT_BACK, SCE_TOUCH_SAMPLING_STATE_START);
|
||||
sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START);
|
||||
@ -190,7 +192,7 @@ static void psp_joypad_poll(void)
|
||||
#endif
|
||||
|
||||
#ifdef VITA
|
||||
if (!sceCtrlIsMultiControllerSupported())
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
players_count = 1;
|
||||
else
|
||||
{
|
||||
@ -235,7 +237,7 @@ static void psp_joypad_poll(void)
|
||||
SceCtrlData state_tmp;
|
||||
unsigned i = player;
|
||||
#if defined(VITA)
|
||||
unsigned p = (sceCtrlIsMultiControllerSupported()) ? player + 1 : player;
|
||||
unsigned p = (psp2_model == SCE_KERNEL_MODEL_VITATV) ? player + 1 : player;
|
||||
if (curr_ctrl_info.port[p] == SCE_CTRL_TYPE_UNPAIRED)
|
||||
continue;
|
||||
#elif defined(SN_TARGET_PSP2)
|
||||
@ -259,7 +261,7 @@ static void psp_joypad_poll(void)
|
||||
continue;
|
||||
#endif
|
||||
#if defined(VITA)
|
||||
if (!sceCtrlIsMultiControllerSupported()
|
||||
if (psp2_model == SCE_KERNEL_MODEL_VITA
|
||||
&& settings->bools.input_backtouch_enable)
|
||||
{
|
||||
unsigned i;
|
||||
@ -330,7 +332,7 @@ static bool psp_joypad_rumble(unsigned pad,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
#ifdef VITA
|
||||
if (!sceCtrlIsMultiControllerSupported())
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
return false;
|
||||
|
||||
switch (effect)
|
||||
|
@ -80,6 +80,8 @@ struct udev_joypad
|
||||
char *path;
|
||||
int32_t vid;
|
||||
int32_t pid;
|
||||
/* Deal with analog triggers that report -32767 to 32767 */
|
||||
bool neg_trigger[NUM_AXES];
|
||||
};
|
||||
|
||||
struct joypad_udev_entry
|
||||
@ -217,6 +219,14 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char
|
||||
if (abs->maximum > abs->minimum)
|
||||
{
|
||||
pad->axes[axes] = udev_compute_axis(abs, abs->value);
|
||||
/* Deal with analog triggers that report -32767 to 32767
|
||||
by testing if the axis initial value is negative, allowing for
|
||||
for some slop (1300 =~ 4%)in an axis centred around 0.
|
||||
The actual work is done in udev_joypad_axis.
|
||||
All bets are off if you're sitting on it. Reinitailise it by unpluging
|
||||
and plugging back in. */
|
||||
if (udev_compute_axis(abs, abs->value) < -1300)
|
||||
pad->neg_trigger[i] = true;
|
||||
pad->axes_bind[i] = axes++;
|
||||
}
|
||||
}
|
||||
@ -662,12 +672,20 @@ static int16_t udev_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||
if (AXIS_NEG_GET(joyaxis) < NUM_AXES)
|
||||
{
|
||||
val = pad->axes[AXIS_NEG_GET(joyaxis)];
|
||||
/* Deal with analog triggers that report -32767 to 32767 */
|
||||
if (((AXIS_NEG_GET(joyaxis) == ABS_Z) || (AXIS_NEG_GET(joyaxis) == ABS_RZ))
|
||||
&& (pad->neg_trigger[AXIS_NEG_GET(joyaxis)]))
|
||||
val = (val + 0x7fff) / 2;
|
||||
if (val > 0)
|
||||
val = 0;
|
||||
}
|
||||
else if (AXIS_POS_GET(joyaxis) < NUM_AXES)
|
||||
{
|
||||
val = pad->axes[AXIS_POS_GET(joyaxis)];
|
||||
/* Deal with analog triggers that report -32767 to 32767 */
|
||||
if (((AXIS_POS_GET(joyaxis) == ABS_Z) || (AXIS_POS_GET(joyaxis) == ABS_RZ))
|
||||
&& (pad->neg_trigger[AXIS_POS_GET(joyaxis)]))
|
||||
val = (val + 0x7fff) / 2;
|
||||
if (val < 0)
|
||||
val = 0;
|
||||
}
|
||||
|
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