mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 08:10:30 -10:00
Compare commits
101
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fca7bc52ed | ||
|
|
159190cc14 | ||
|
|
984c3a22a3 | ||
|
|
1d7cae2ceb | ||
|
|
1f2e42cdc2 | ||
|
|
2cb67d1172 | ||
|
|
5813228c6c | ||
|
|
dea5b5347d | ||
|
|
f39e554586 | ||
|
|
f646fea03f | ||
|
|
f9ae48c3f6 | ||
|
|
1e11cbf6b4 | ||
|
|
ecebcf8215 | ||
|
|
8f7646ded8 | ||
|
|
b96fd5933c | ||
|
|
03676061b4 | ||
|
|
777ba7c5c3 | ||
|
|
bfb5f58b90 | ||
|
|
2004545f96 | ||
|
|
e80fb4f386 | ||
|
|
83958a4402 | ||
|
|
8292f31ea0 | ||
|
|
d0a9de01a3 | ||
|
|
c809ecd623 | ||
|
|
2ff9bfb24d | ||
|
|
ab34a0a34f | ||
|
|
c5e2099dd9 | ||
|
|
5a2e4237c4 | ||
|
|
9d0585a280 | ||
|
|
f0ef3904d5 | ||
|
|
7fe952ddeb | ||
|
|
73bcd7a692 | ||
|
|
316c07c226 | ||
|
|
2a579f4418 | ||
|
|
8f8fbab4f9 | ||
|
|
411ff301c7 | ||
|
|
2fb7ba22e5 | ||
|
|
761a17ccd8 | ||
|
|
f466cc5143 | ||
|
|
47067b691e | ||
|
|
83a262ceae | ||
|
|
15c661a374 | ||
|
|
43d24114b3 | ||
|
|
e4a3946998 | ||
|
|
0087928aa5 | ||
|
|
2d2bd625c6 | ||
|
|
6e4228b054 | ||
|
|
5972ed9cc6 | ||
|
|
2dc0fdcfee | ||
|
|
4fd3cac319 | ||
|
|
66eed86ccf | ||
|
|
79dc998a7b | ||
|
|
75a33b3662 | ||
|
|
ac72d19f5c | ||
|
|
49e584c6f6 | ||
|
|
d30d2abe10 | ||
|
|
637266be03 | ||
|
|
05744bb69f | ||
|
|
7531223846 | ||
|
|
7ba551864b | ||
|
|
0988f7fb8a | ||
|
|
d016a0929b | ||
|
|
b01ae6b366 | ||
|
|
309af5d526 | ||
|
|
66d98af48b | ||
|
|
97ee822f35 | ||
|
|
4646da6df8 | ||
|
|
6f6a4e59df | ||
|
|
4a95cb7b54 | ||
|
|
e81e53bdf6 | ||
|
|
ae48da5ebf | ||
|
|
3d24439276 | ||
|
|
6b0a46d5d2 | ||
|
|
456346e0c6 | ||
|
|
1440b46eb0 | ||
|
|
9f7e55e59d | ||
|
|
ef13fc1b9e | ||
|
|
513dcdc502 | ||
|
|
b17e274ff6 | ||
|
|
29774bd84a | ||
|
|
95f0b6e0b8 | ||
|
|
ab8af924c0 | ||
|
|
a0e12fecde | ||
|
|
af52212e6d | ||
|
|
ff7f56e996 | ||
|
|
261adaf100 | ||
|
|
b9c32276bf | ||
|
|
e639d2b09a | ||
|
|
2cc841a6cb | ||
|
|
9194a3b24d | ||
|
|
b5d9ed60e7 | ||
|
|
7a1e97f8c0 | ||
|
|
fb7b1ec1a0 | ||
|
|
9729b5a917 | ||
|
|
53fffbd670 | ||
|
|
8643cb22dd | ||
|
|
47582ffa41 | ||
|
|
f48c668447 | ||
|
|
c61f6aafc1 | ||
|
|
e24274a314 | ||
|
|
5a8106308e |
No files matched your search
+16
@@ -1,4 +1,20 @@
|
||||
# Future
|
||||
- AUTOCONFIG: Use correct port index in input device configured/disconnected notifications
|
||||
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions.
|
||||
- MENU: Prevent font-related segfaults when using extremely small scales/window sizes
|
||||
- MENU: Fix 'gfx_display_draw_texture_slice()'
|
||||
- MENU/FONT: Enable correct vertical alignment of text (+ font rendering fixes)
|
||||
- MENU/OZONE: Update timedate style options for Last Played sublabel metadata
|
||||
- MENU/OZONE: Hide 'Menu Color Theme' setting when 'Use preferred system color theme' is enabled
|
||||
- MENU/OZONE: Fix thumbnail switching via 'scan' button functionality
|
||||
- MENU/OZONE: Prevent glitches when rendering Ozone's selection cursor
|
||||
- MENU/XMB: Fix thumbnail switching via 'scan' button functionality
|
||||
- ODROID GO ADVANCE: Add DRM HW context driver
|
||||
- PSL1GHT: Initial port
|
||||
- SCANNER: Prevent redundant playlist entries when handling M3U content
|
||||
- SCANNER/ANDROID: Fix content scanner being unable to identify certain games from CHD images (raw data sector/subcode)
|
||||
|
||||
# 1.8.5
|
||||
- 3DS: Keep the bottom screen hidden on sleep/wakeup. When the 3DS wakes back up after being closed, the bottom screen needs to be reinitialized. Adding the condition here will cause the screen to be turned on or off based on the state of ctr_bottom_screen_enabled, as you'd expect
|
||||
- ANDROID/CHROMEBOOK/CRASH: Fix Chromebook crashes (on x86 x64) when touching the screen
|
||||
- BUGFIX: Prevent double input when using 'return' key (hardware) to close on-screen keyboard
|
||||
|
||||
+17
-2
@@ -426,6 +426,8 @@ ifeq ($(HAVE_QT), 1)
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
DEF_FLAGS += -fPIC
|
||||
else ifneq ($(findstring BSD,$(OS)),)
|
||||
DEF_FLAGS += -fPIC
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1118,7 +1120,12 @@ OBJ += gfx/drivers_context/gfx_null_ctx.o
|
||||
|
||||
ifeq ($(HAVE_KMS), 1)
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
|
||||
ifeq ($(HAVE_ODROIDGO2), 1)
|
||||
OBJ += gfx/drivers_context/drm_go2_ctx.o
|
||||
else
|
||||
OBJ += gfx/drivers_context/drm_ctx.o
|
||||
endif
|
||||
DEF_FLAGS += $(GBM_CFLAGS) $(DRM_CFLAGS)
|
||||
LIBS += $(GBM_LIBS) $(DRM_LIBS)
|
||||
endif
|
||||
@@ -1733,7 +1740,8 @@ endif
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/bmp/rbmp_encode.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax_full.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/image_transfer.o
|
||||
$(LIBRETRO_COMM_DIR)/formats/image_transfer.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/m3u/m3u_file.o
|
||||
|
||||
# Gong embedded core
|
||||
ifeq ($(HAVE_GONG),1)
|
||||
@@ -1756,7 +1764,13 @@ endif
|
||||
# Accessibility
|
||||
ifeq ($(HAVE_ACCESSIBILITY), 1)
|
||||
DEFINES += -DHAVE_ACCESSIBILITY
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LIBS += -lsapi
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Things that depend on network availability
|
||||
|
||||
@@ -2116,6 +2130,7 @@ ifeq ($(HAVE_ODROIDGO2), 1)
|
||||
LIBS += -lrga -lpng -lz
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/libgo2/include
|
||||
OBJ += $(DEPS_DIR)/libgo2/src/display.o \
|
||||
$(DEPS_DIR)/libgo2/src/queue.o
|
||||
$(DEPS_DIR)/libgo2/src/queue.o \
|
||||
gfx/drivers/oga_gfx.o
|
||||
endif
|
||||
##################################
|
||||
+66
-4
@@ -75,15 +75,22 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
STATIC_BUILD = 1
|
||||
ifneq (,$(findstring msvc,$(platform)))
|
||||
LIBS := $(WHOLE_START) $(WHOLE_END)
|
||||
else
|
||||
STATIC_BUILD = 0
|
||||
endif
|
||||
ifneq (,$(findstring unix,$(platform)))
|
||||
STATIC_BUILD = 0
|
||||
endif
|
||||
ifeq (qnx, $(platform))
|
||||
STATIC_BUILD = 0
|
||||
endif
|
||||
|
||||
ifeq ($(STATIC_BUILD), 0)
|
||||
LIBS := $(WHOLE_START) $(WHOLE_END)
|
||||
else
|
||||
LIBS := $(WHOLE_START) -lretro_$(platform) $(WHOLE_END)
|
||||
endif
|
||||
endif
|
||||
|
||||
libogc_platform :=
|
||||
|
||||
@@ -791,6 +798,44 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
export INCLUDE := $(INCLUDE);libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
|
||||
export LIB := $(LIB)
|
||||
endif
|
||||
else ifeq (qnx,$(platform))
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_NETPLAYDISCOVERY := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_XMB := 1
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
HAVE_DYLIB := 1
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_GRIFFIN_CPP := 0
|
||||
WANT_GLSLANG := 0
|
||||
HAVE_CONFIGFILE := 1
|
||||
CC=qcc -Vgcc_ntoarmv7le
|
||||
CXX=QCC -Vgcc_ntoarmv7le
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
PLATCFLAGS += -DHAVE_SHADERPIPELINE -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_GLSLANG -DHAVE_BUILTINGLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_GFX_WIDGETS -DHAVE_CONFIGFILE -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_XCB -DHAVE_EGL -DHAVE_BB10 -DHAVE_GLSL -DHAVE_AL -DRARCH_MOBILE
|
||||
EXT_TARGET := $(TARGET_NAME)
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)
|
||||
INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I.
|
||||
LIBS += -lEGL -lbps -lscreen -lsocket -lm -lGLESv2 -lOpenAL
|
||||
else ifneq (,$(findstring unix,$(platform)))
|
||||
HAVE_AUDIOMIXER := 1
|
||||
HAVE_RPNG := 1
|
||||
@@ -1096,7 +1141,12 @@ $(APP_BOOTER_DIR)/app_booter.bin:
|
||||
$(MAKE) -C $(APP_BOOTER_DIR)
|
||||
|
||||
pkg: all
|
||||
ifeq ($(platform), wii)
|
||||
ifeq ($(platform), qnx)
|
||||
mkdir -p pkg/qnx/pkg
|
||||
cp -r $(EXT_TARGET) pkg/qnx/pkg/RetroArch
|
||||
cp -r media/canvas.png pkg/qnx/pkg/canvas.png
|
||||
cp -r media/retroarch-96x96.png pkg/qnx/pkg/retroarch-96x96.png
|
||||
else ifeq ($(platform), wii)
|
||||
cp -r $(EXT_TARGET) pkg/wii/CORE.dol
|
||||
else ifeq ($(platform), ngc)
|
||||
cp -r $(EXT_TARGET) pkg/ngc/CORE.dol
|
||||
@@ -1104,6 +1154,18 @@ else ifeq ($(platform), psp1)
|
||||
psp-fixup-imports$(EXT) $(EXT_TARGET)
|
||||
endif
|
||||
|
||||
ifeq ($(platform), qnx)
|
||||
retroarch-dev.bar: pkg
|
||||
ifeq ($(QNX_DEBUGTOKEN),)
|
||||
blackberry-nativepackager -package $@ -devMode pkg/qnx/bar-descriptor.xml -C pkg/qnx/pkg pkg/qnx/pkg/*
|
||||
else
|
||||
blackberry-nativepackager -package $@ -devMode -debugToken $(QNX_DEBUGTOKEN) pkg/qnx/bar-descriptor.xml -C pkg/qnx/pkg pkg/qnx/pkg/*
|
||||
endif
|
||||
|
||||
retroarch-release.bar: pkg
|
||||
blackberry-nativepackager -package $@ pkg/qnx/bar-descriptor.xml -C pkg/qnx/pkg pkg/qnx/pkg/*
|
||||
endif
|
||||
|
||||
shaders-checkout:
|
||||
@if test -d $(SHADER_CG_DIR); then \
|
||||
echo "[SHADER CHECKOUT::] Git pulling common-shaders..."; \
|
||||
|
||||
+30
-66
@@ -1,29 +1,39 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
# Clear the implicit built in rules
|
||||
#-------------------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
#-------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(PSL1GHT)),)
|
||||
$(error "Please set PSL1GHT in your environment. export PSL1GHT=<path>")
|
||||
endif
|
||||
|
||||
include $(PSL1GHT)/ppu_rules
|
||||
|
||||
include version.all
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 1
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CC = $(PS3DEV)/ppu/bin/ppu-gcc
|
||||
CXX = $(PS3DEV)/ppu/bin/ppu-g++
|
||||
LD = $(PS3DEV)/ppu/bin/ppu-ld
|
||||
|
||||
CONTENT_ID_FULL = UP0001-SSNE10000_00-0000000000000001
|
||||
CONTENTID = UP0001-SSNE10001_00-0000000000000001
|
||||
APPID = SSNE10001
|
||||
TITLE = Retroarch PSL1GHT
|
||||
PACKAGE_BASENAME := retroarch_psl1ght
|
||||
|
||||
ELF_TARGET := retroarch_psl1ght.elf
|
||||
EBOOT_PATH = pkg/ps3/USRDIR/EBOOT.BIN
|
||||
CORE_PATH = pkg/ps3/USRDIR/cores/CORE.SELF
|
||||
SELF_TARGET := $(ELF_TARGET:.elf=.self)
|
||||
CORE_PATH = pkg/psl1ght/pkg/USRDIR/cores/CORE.SELF
|
||||
|
||||
INCLUDE := -I. -I$(PS3DEV)/ppu/include -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib
|
||||
LIBDIRS := -L$(PS3DEV)/ppu/lib -L$(PS3DEV)/portlibs/ppu/lib -L.
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude
|
||||
LIBDIRS += -L.
|
||||
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__ -mcpu=cell
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lrgl_ps3 -lretro_psl1ght -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl
|
||||
LIBS := -lretro_psl1ght -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
@@ -38,46 +48,10 @@ endif
|
||||
|
||||
PKG_SCRIPT = tools/ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
MAKE_SELF_WC = make_self_wc
|
||||
MAKE_SELF = make_self_npdrm
|
||||
PYTHON2 = python2
|
||||
GIT = git
|
||||
else
|
||||
PKG_FINALIZE = package_finalize.exe
|
||||
MAKE_SELF_WC = make_self_wc.exe
|
||||
MAKE_SELF = make_self_npdrm.exe
|
||||
PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = tools/ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
PKG_FINALIZE = package_finalize
|
||||
MAKE_SELF_WC = make_self_wc
|
||||
MAKE_SELF = make_self_npdrm
|
||||
PYTHON2 = python2
|
||||
GIT = git
|
||||
else
|
||||
PKG_FINALIZE = package_finalize.exe
|
||||
MAKE_SELF_WC = make_self_wc.exe
|
||||
MAKE_SELF = make_self_npdrm.exe
|
||||
PYTHON2 = python2.exe
|
||||
GIT = git.exe
|
||||
endif
|
||||
|
||||
MAKE_FSELF_NPDRM = $(CELL_SDK)/host-win32/bin/make_fself_npdrm.exe
|
||||
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/host-win32/bin/make_package_npdrm.exe
|
||||
|
||||
OBJ = griffin/griffin.o
|
||||
|
||||
@@ -92,7 +66,7 @@ endif
|
||||
SHARED_FLAGS :=
|
||||
|
||||
SHARED_FLAGS += -DHAVE_VIDEO_LAYOUT
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DRARCH_INTERNAL -DHAVE_MULTIMAN -DHAVE_RGUI
|
||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||
CXXFLAGS += $(SHARED_FLAGS)
|
||||
|
||||
@@ -103,28 +77,18 @@ else
|
||||
CXXFLAGS += -03 -g
|
||||
endif
|
||||
|
||||
all: $(ELF_TARGET)
|
||||
all: $(SELF_TARGET)
|
||||
|
||||
$(ELF_TARGET): $(OBJ)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
create-core: $(SELF_TARGET)
|
||||
cp $(SELF_TARGET) $(CORE_PATH)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
create-npdrm-core:
|
||||
$(MAKE_FSELF_NPDRM) $(ELF_TARGET) $(CORE_PATH)
|
||||
|
||||
create-core:
|
||||
$(MAKE_SELF_WC) $(ELF_TARGET) $(CORE_PATH)
|
||||
|
||||
pkg: $(ELF_TARGET) create-npdrm-core
|
||||
$(MAKE_PACKAGE_NPDRM) pkg/ps3/package.conf ps3/pkg
|
||||
|
||||
pkg-signed: $(ELF_TARGET) create-core
|
||||
$(PYTHON2) $(PKG_SCRIPT) --contentid $(CONTENT_ID_FULL) pkg/ps3 retroarch-ps3-cfw-$(PACKAGE_VERSION).pkg
|
||||
pkg: create-core
|
||||
$(PKG) --contentid $(CONTENTID) pkg/psl1ght/pkg/ $(PACKAGE_BASENAME).pkg
|
||||
# cp $(PACKAGE_BASENAME).pkg $(PACKAGE_BASENAME).gnpdrm.pkg
|
||||
# $(PACKAGE_FINALIZE) $(PACKAGE_BASENAME).gnpdrm.pkg
|
||||
|
||||
clean:
|
||||
rm -f $(ELF_TARGET)
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
# Clear the implicit built in rules
|
||||
#-------------------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
#-------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(PSL1GHT)),)
|
||||
$(error "Please set PSL1GHT in your environment. export PSL1GHT=<path>")
|
||||
endif
|
||||
|
||||
include $(PSL1GHT)/ppu_rules
|
||||
|
||||
include version.all
|
||||
|
||||
DEBUG = 0
|
||||
HAVE_LOGGER = 0
|
||||
HAVE_FILE_LOGGER = 1
|
||||
|
||||
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
|
||||
PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
|
||||
CONTENTID = UP0001-SSNE10001_00-0000000000000001
|
||||
APPID = SSNE10001
|
||||
TITLE = Retroarch PSL1GHT
|
||||
PACKAGE_BASENAME := retroarch_psl1ght
|
||||
|
||||
ELF_TARGET := retroarch_psl1ght_salamander.elf
|
||||
ELF_TARGET_NONSTRIPPED := retroarch_psl1ght_salamander_nonstripped.elf
|
||||
EBOOT_PATH = pkg/psl1ght/pkg/USRDIR/EBOOT.BIN
|
||||
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude
|
||||
LIBDIRS += -L.
|
||||
|
||||
MACHDEP := -D__CELLOS_LV2__ -D__PSL1GHT__ -mcpu=cell -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lgcm_sys -lrsx -lsysutil -lio -lnet -lsysmodule -lrt -llv2 -lm
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
PKG_SCRIPT = tools/ps3/ps3py/pkg.py
|
||||
ifeq ($(shell uname), Linux)
|
||||
GIT = git
|
||||
else
|
||||
GIT = git.exe
|
||||
endif
|
||||
|
||||
OBJ = frontend/frontend_salamander.o \
|
||||
frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_ps3.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/vfs/vfs_implementation.o \
|
||||
libretro-common/file/config_file.o \
|
||||
file_path_str.o \
|
||||
verbosity.o
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
SHARED_FLAGS :=
|
||||
|
||||
SHARED_FLAGS += -DHAVE_VIDEO_LAYOUT
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DHAVE_MULTIMAN -DHAVE_RGUI -DIS_SALAMANDER
|
||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||
CXXFLAGS += $(SHARED_FLAGS)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3 -g
|
||||
CXXFLAGS += -03 -g
|
||||
endif
|
||||
|
||||
all: create-salamander
|
||||
|
||||
$(ELF_TARGET_NONSTRIPPED): $(OBJ)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
|
||||
|
||||
$(ELF_TARGET): $(ELF_TARGET_NONSTRIPPED)
|
||||
$(STRIP) $< -o $@
|
||||
$(SPRX) $@
|
||||
|
||||
create-salamander: $(ELF_TARGET)
|
||||
$(SELF_NPDRM) $(ELF_TARGET) $(EBOOT_PATH) $(CONTENTID)
|
||||
|
||||
pkg: create-salamander
|
||||
$(PKG) --contentid $(CONTENTID) pkg/psl1ght/pkg/ $(PACKAGE_BASENAME).pkg
|
||||
# cp $(PACKAGE_BASENAME).pkg $(PACKAGE_BASENAME).gnpdrm.pkg
|
||||
# $(PACKAGE_FINALIZE) $(PACKAGE_BASENAME).gnpdrm.pkg
|
||||
|
||||
clean:
|
||||
rm -f $(ELF_TARGET)
|
||||
rm -f $(OBJ)
|
||||
|
||||
.PHONY: clean
|
||||
@@ -340,6 +340,9 @@
|
||||
#define DEFAULT_VIDEO_SMOOTH false
|
||||
#endif
|
||||
|
||||
/* Graphics context specific scaling */
|
||||
#define DEFAULT_VIDEO_CTX_SCALING false
|
||||
|
||||
/* On resize and fullscreen, rendering area will stay 4:3 */
|
||||
#define DEFAULT_FORCE_ASPECT true
|
||||
|
||||
@@ -406,6 +409,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OZONE
|
||||
/* Ozone colour theme: 1 == Basic Black */
|
||||
#define DEFAULT_OZONE_COLOR_THEME 1
|
||||
#define DEFAULT_OZONE_COLLAPSE_SIDEBAR false
|
||||
#define DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME true
|
||||
#define DEFAULT_OZONE_SCROLL_CONTENT_METADATA false
|
||||
|
||||
+2
-1
@@ -1402,6 +1402,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("video_crop_overscan", &settings->bools.video_crop_overscan, true, DEFAULT_CROP_OVERSCAN, false);
|
||||
SETTING_BOOL("video_scale_integer", &settings->bools.video_scale_integer, true, DEFAULT_SCALE_INTEGER, false);
|
||||
SETTING_BOOL("video_smooth", &settings->bools.video_smooth, true, DEFAULT_VIDEO_SMOOTH, false);
|
||||
SETTING_BOOL("video_ctx_scaling", &settings->bools.video_ctx_scaling, true, DEFAULT_VIDEO_CTX_SCALING, false);
|
||||
SETTING_BOOL("video_force_aspect", &settings->bools.video_force_aspect, true, DEFAULT_FORCE_ASPECT, false);
|
||||
SETTING_BOOL("video_threaded", video_driver_get_threaded(), true, DEFAULT_VIDEO_THREADED, false);
|
||||
SETTING_BOOL("video_shared_context", &settings->bools.video_shared_context, true, DEFAULT_VIDEO_SHARED_CONTEXT, false);
|
||||
@@ -1826,7 +1827,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("materialui_landscape_layout_optimization", &settings->uints.menu_materialui_landscape_layout_optimization, true, DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION, false);
|
||||
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, DEFAULT_MENU_SHADER_PIPELINE, false);
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, 1, false);
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, DEFAULT_OZONE_COLOR_THEME, false);
|
||||
#endif
|
||||
#endif
|
||||
SETTING_UINT("audio_out_rate", &settings->uints.audio_out_rate, true, DEFAULT_OUTPUT_RATE, false);
|
||||
|
||||
@@ -91,6 +91,7 @@ typedef struct settings
|
||||
bool video_black_frame_insertion;
|
||||
bool video_vfilter;
|
||||
bool video_smooth;
|
||||
bool video_ctx_scaling;
|
||||
bool video_force_aspect;
|
||||
bool video_crop_overscan;
|
||||
bool video_aspect_ratio_auto;
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#ifndef _PS3_DEFINES_H
|
||||
#define _PS3_DEFINES_H
|
||||
|
||||
#include <sdk_version.h>
|
||||
|
||||
/*============================================================
|
||||
AUDIO PROTOTYPES
|
||||
============================================================ */
|
||||
@@ -71,6 +69,7 @@ extern int audioAddData(uint32_t portNum, float *data, uint32_t frames, float vo
|
||||
#define sys_semaphore_t sys_sem_t
|
||||
|
||||
#else
|
||||
#include <sdk_version.h>
|
||||
#include <cell/audio.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/synchronization.h>
|
||||
@@ -330,6 +329,11 @@ extern int audioAddData(uint32_t portNum, float *data, uint32_t frames, float vo
|
||||
#define sys_ppu_thread_join sysThreadJoin
|
||||
#define sys_ppu_thread_exit sysThreadExit
|
||||
|
||||
#define sys_process_exit sysProcessExit
|
||||
#define sys_game_process_exitspawn sysProcessExitSpawn2
|
||||
|
||||
#define SYS_PROCESS_PRIMARY_STACK_SIZE_1M SYS_PROCESS_SPAWN_STACK_SIZE_1M
|
||||
|
||||
#define SYS_PPU_THREAD_CREATE_JOINABLE 0 /* FIXME - not sure if this is correct */
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
#include <sys/ppu_thread.h>
|
||||
@@ -572,6 +576,7 @@ extern int audioAddData(uint32_t portNum, float *data, uint32_t frames, float vo
|
||||
#define socketclose close
|
||||
|
||||
#define sys_net_initialize_network netInitialize
|
||||
#define sys_net_finalize_network netFinalizeNetwork
|
||||
#else
|
||||
#include <netex/net.h>
|
||||
#include <np.h>
|
||||
|
||||
Vendored
+5
-3
@@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
typedef struct go2_display go2_display_t;
|
||||
@@ -78,18 +79,19 @@ void* go2_surface_map(go2_surface_t* surface);
|
||||
void go2_surface_unmap(go2_surface_t* surface);
|
||||
void go2_surface_blit(go2_surface_t* srcSurface, int srcX, int srcY, int srcWidth, int srcHeight,
|
||||
go2_surface_t* dstSurface, int dstX, int dstY, int dstWidth, int dstHeight,
|
||||
go2_rotation_t rotation);
|
||||
go2_rotation_t rotation, int scale_mode);
|
||||
int go2_surface_save_as_png(go2_surface_t* surface, const char* filename);
|
||||
|
||||
|
||||
go2_frame_buffer_t* go2_frame_buffer_create(go2_surface_t* surface);
|
||||
void go2_frame_buffer_destroy(go2_frame_buffer_t* frame_buffer);
|
||||
go2_surface_t* go2_frame_buffer_surface_get(go2_frame_buffer_t* frame_buffer);
|
||||
go2_display_t* go2_presenter_display_get(go2_presenter_t* presenter);
|
||||
|
||||
|
||||
go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, uint32_t background_color);
|
||||
go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, uint32_t background_color, bool managed);
|
||||
void go2_presenter_destroy(go2_presenter_t* presenter);
|
||||
void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, go2_rotation_t rotation);
|
||||
void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, go2_rotation_t rotation, int scale_mode);
|
||||
|
||||
|
||||
go2_context_t* go2_context_create(go2_display_t* display, int width, int height, const go2_context_attributes_t* attributes);
|
||||
|
||||
Vendored
+86
-81
@@ -71,7 +71,6 @@ typedef struct go2_surface
|
||||
int stride;
|
||||
uint32_t format;
|
||||
int prime_fd;
|
||||
bool is_mapped;
|
||||
uint8_t* map;
|
||||
} go2_surface_t;
|
||||
|
||||
@@ -93,6 +92,7 @@ typedef struct go2_presenter
|
||||
sem_t freeSem;
|
||||
sem_t usedSem;
|
||||
volatile bool terminating;
|
||||
bool managed;
|
||||
} go2_presenter_t;
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ go2_display_t* go2_display_create()
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
go2_display_t* result = malloc(sizeof(*result));
|
||||
if (!result)
|
||||
{
|
||||
@@ -121,7 +120,7 @@ go2_display_t* go2_display_create()
|
||||
|
||||
|
||||
drmModeRes* resources = drmModeGetResources(result->fd);
|
||||
if (!resources)
|
||||
if (!resources)
|
||||
{
|
||||
printf("drmModeGetResources failed: %s\n", strerror(errno));
|
||||
goto err_01;
|
||||
@@ -164,7 +163,7 @@ go2_display_t* go2_display_create()
|
||||
mode = NULL;
|
||||
}
|
||||
|
||||
if (!mode)
|
||||
if (!mode)
|
||||
{
|
||||
printf("DRM_MODE_TYPE_PREFERRED not found.\n");
|
||||
goto err_03;
|
||||
@@ -184,7 +183,7 @@ go2_display_t* go2_display_create()
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
drmModeFreeEncoder(encoder);
|
||||
encoder = NULL;
|
||||
}
|
||||
@@ -195,13 +194,13 @@ go2_display_t* go2_display_create()
|
||||
printf("could not find encoder!\n");
|
||||
goto err_03;
|
||||
}
|
||||
|
||||
|
||||
result->crtc_id = encoder->crtc_id;
|
||||
|
||||
drmModeFreeEncoder(encoder);
|
||||
drmModeFreeConnector(connector);
|
||||
drmModeFreeResources(resources);
|
||||
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
@@ -243,7 +242,7 @@ void go2_display_present(go2_display_t* display, go2_frame_buffer_t* frame_buffe
|
||||
int ret = drmModeSetCrtc(display->fd, display->crtc_id, frame_buffer->fb_id, 0, 0, &display->connector_id, 1, &display->mode);
|
||||
if (ret)
|
||||
{
|
||||
printf("drmModeSetCrtc failed.\n");
|
||||
printf("drmModeSetCrtc failed.\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +284,7 @@ uint32_t go2_display_backlight_get(go2_display_t* display)
|
||||
value = atoi(buffer);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
float percent = value / (float)max * 100.0f;
|
||||
@@ -298,7 +297,7 @@ void go2_display_backlight_set(go2_display_t* display, uint32_t value)
|
||||
int max = 255;
|
||||
char buffer[BACKLIGHT_BUFFER_SIZE + 1];
|
||||
|
||||
|
||||
|
||||
if (value > 100) value = 100;
|
||||
|
||||
fd = open(BACKLIGHT_BRIGHTNESS_MAX_NAME, O_RDONLY);
|
||||
@@ -331,13 +330,13 @@ void go2_display_backlight_set(go2_display_t* display, uint32_t value)
|
||||
printf("go2_display_backlight_set write failed.\n");
|
||||
}
|
||||
|
||||
close(fd);
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("go2_display_backlight_set open failed.\n");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -371,7 +370,7 @@ int go2_drm_format_get_bpp(uint32_t format)
|
||||
case DRM_FORMAT_BGR565:
|
||||
result = 16;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case DRM_FORMAT_RGB888:
|
||||
case DRM_FORMAT_BGR888:
|
||||
@@ -443,6 +442,7 @@ go2_surface_t* go2_surface_create(go2_display_t* display, int width, int height,
|
||||
result->height = height;
|
||||
result->stride = args.pitch;
|
||||
result->format = format;
|
||||
result->map = NULL;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -459,7 +459,7 @@ void go2_surface_destroy(go2_surface_t* surface)
|
||||
int io = drmIoctl(surface->display->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &args);
|
||||
if (io < 0)
|
||||
{
|
||||
printf("DRM_IOCTL_MODE_DESTROY_DUMB failed.\n");
|
||||
printf("DRM_IOCTL_MODE_DESTROY_DUMB failed.\n");
|
||||
}
|
||||
|
||||
free(surface);
|
||||
@@ -511,10 +511,9 @@ out:
|
||||
|
||||
void* go2_surface_map(go2_surface_t* surface)
|
||||
{
|
||||
if (surface->is_mapped)
|
||||
if (surface->map)
|
||||
return surface->map;
|
||||
|
||||
|
||||
int prime_fd = go2_surface_prime_fd(surface);
|
||||
surface->map = mmap(NULL, surface->size, PROT_READ | PROT_WRITE, MAP_SHARED, prime_fd, 0);
|
||||
if (surface->map == MAP_FAILED)
|
||||
@@ -523,17 +522,14 @@ void* go2_surface_map(go2_surface_t* surface)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
surface->is_mapped = true;
|
||||
return surface->map;
|
||||
}
|
||||
|
||||
void go2_surface_unmap(go2_surface_t* surface)
|
||||
{
|
||||
if (surface->is_mapped)
|
||||
if (surface->map)
|
||||
{
|
||||
munmap(surface->map, surface->size);
|
||||
|
||||
surface->is_mapped = false;
|
||||
surface->map = NULL;
|
||||
}
|
||||
}
|
||||
@@ -545,29 +541,29 @@ static uint32_t go2_rkformat_get(uint32_t drm_fourcc)
|
||||
{
|
||||
case DRM_FORMAT_RGBA8888:
|
||||
return RK_FORMAT_RGBA_8888;
|
||||
|
||||
|
||||
case DRM_FORMAT_RGBX8888:
|
||||
return RK_FORMAT_RGBX_8888;
|
||||
|
||||
|
||||
case DRM_FORMAT_RGB888:
|
||||
return RK_FORMAT_RGB_888;
|
||||
|
||||
|
||||
case DRM_FORMAT_ARGB8888:
|
||||
case DRM_FORMAT_XRGB8888:
|
||||
return RK_FORMAT_BGRA_8888;
|
||||
|
||||
|
||||
case DRM_FORMAT_RGB565:
|
||||
return RK_FORMAT_RGB_565;
|
||||
|
||||
case DRM_FORMAT_RGBA5551:
|
||||
return RK_FORMAT_RGBA_5551;
|
||||
|
||||
|
||||
case DRM_FORMAT_RGBA4444:
|
||||
return RK_FORMAT_RGBA_4444;
|
||||
|
||||
case DRM_FORMAT_BGR888:
|
||||
return RK_FORMAT_BGR_888;
|
||||
|
||||
|
||||
default:
|
||||
printf("RKFORMAT not supported. ");
|
||||
printf("drm_fourcc=%c%c%c%c\n", drm_fourcc & 0xff, drm_fourcc >> 8 & 0xff, drm_fourcc >> 16 & 0xff, drm_fourcc >> 24);
|
||||
@@ -577,7 +573,7 @@ static uint32_t go2_rkformat_get(uint32_t drm_fourcc)
|
||||
|
||||
void go2_surface_blit(go2_surface_t* srcSurface, int srcX, int srcY, int srcWidth, int srcHeight,
|
||||
go2_surface_t* dstSurface, int dstX, int dstY, int dstWidth, int dstHeight,
|
||||
go2_rotation_t rotation)
|
||||
go2_rotation_t rotation, int scale_mode)
|
||||
{
|
||||
rga_info_t dst = { 0 };
|
||||
dst.fd = go2_surface_prime_fd(dstSurface);
|
||||
@@ -634,13 +630,12 @@ void go2_surface_blit(go2_surface_t* srcSurface, int srcX, int srcY, int srcWidt
|
||||
B_SPLINE = 0x3,
|
||||
}; /*bicubic coefficient*/
|
||||
#endif
|
||||
src.scale_mode = 2;
|
||||
|
||||
src.scale_mode = scale_mode;
|
||||
|
||||
int ret = c_RkRgaBlit(&src, &dst, NULL);
|
||||
if (ret)
|
||||
{
|
||||
printf("c_RkRgaBlit failed.\n");
|
||||
printf("c_RkRgaBlit failed.\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,14 +647,14 @@ int go2_surface_save_as_png(go2_surface_t* surface, const char* filename)
|
||||
|
||||
|
||||
png_byte color_type = 0;
|
||||
png_byte bit_depth = 0;
|
||||
png_byte bit_depth = 0;
|
||||
switch (surface->format)
|
||||
{
|
||||
{
|
||||
case DRM_FORMAT_RGBA8888:
|
||||
color_type = PNG_COLOR_TYPE_RGBA;
|
||||
bit_depth = 8;
|
||||
break;
|
||||
|
||||
|
||||
case DRM_FORMAT_RGB888:
|
||||
color_type = PNG_COLOR_TYPE_RGB;
|
||||
bit_depth = 8;
|
||||
@@ -733,7 +728,7 @@ int go2_surface_save_as_png(go2_surface_t* surface, const char* filename)
|
||||
|
||||
/* write bytes */
|
||||
png_bytep src = (png_bytep)go2_surface_map(surface);
|
||||
row_pointers = malloc(sizeof(png_bytep) * surface->height);
|
||||
row_pointers = malloc(sizeof(png_bytep) * surface->height);
|
||||
for (int y = 0; y < surface->height; ++y)
|
||||
{
|
||||
row_pointers[y] = src + (surface->stride * y);
|
||||
@@ -891,14 +886,19 @@ static void* go2_presenter_renderloop(void* arg)
|
||||
sem_post(&presenter->freeSem);
|
||||
}
|
||||
|
||||
prevFrameBuffer = dstFrameBuffer;
|
||||
prevFrameBuffer = dstFrameBuffer;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, uint32_t background_color)
|
||||
go2_display_t* go2_presenter_display_get(go2_presenter_t* presenter)
|
||||
{
|
||||
return presenter->display;
|
||||
}
|
||||
|
||||
go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, uint32_t background_color, bool managed)
|
||||
{
|
||||
go2_presenter_t* result = malloc(sizeof(*result));
|
||||
if (!result)
|
||||
@@ -913,67 +913,74 @@ go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, u
|
||||
result->display = display;
|
||||
result->format = format;
|
||||
result->background_color = background_color;
|
||||
result->freeFrameBuffers = go2_queue_create(BUFFER_COUNT);
|
||||
result->usedFrameBuffers = go2_queue_create(BUFFER_COUNT);
|
||||
result->managed = managed;
|
||||
if (managed) {
|
||||
result->freeFrameBuffers = go2_queue_create(BUFFER_COUNT);
|
||||
result->usedFrameBuffers = go2_queue_create(BUFFER_COUNT);
|
||||
|
||||
int width = go2_display_width_get(display);
|
||||
int height = go2_display_height_get(display);
|
||||
int width = go2_display_width_get(display);
|
||||
int height = go2_display_height_get(display);
|
||||
|
||||
for (int i = 0; i < BUFFER_COUNT; ++i)
|
||||
{
|
||||
go2_surface_t* surface = go2_surface_create(display, width, height, format);
|
||||
go2_frame_buffer_t* frameBuffer = go2_frame_buffer_create(surface);
|
||||
for (int i = 0; i < BUFFER_COUNT; ++i)
|
||||
{
|
||||
go2_surface_t* surface = go2_surface_create(display, width, height, format);
|
||||
go2_frame_buffer_t* frameBuffer = go2_frame_buffer_create(surface);
|
||||
|
||||
go2_queue_push(result->freeFrameBuffers, frameBuffer);
|
||||
go2_queue_push(result->freeFrameBuffers, frameBuffer);
|
||||
}
|
||||
|
||||
sem_init(&result->usedSem, 0, 0);
|
||||
sem_init(&result->freeSem, 0, BUFFER_COUNT);
|
||||
|
||||
pthread_mutex_init(&result->queueMutex, NULL);
|
||||
|
||||
pthread_create(&result->renderThread, NULL, go2_presenter_renderloop, result);
|
||||
}
|
||||
else {
|
||||
result->freeFrameBuffers = go2_queue_create(0);
|
||||
result->usedFrameBuffers = go2_queue_create(0);
|
||||
}
|
||||
|
||||
|
||||
sem_init(&result->usedSem, 0, 0);
|
||||
sem_init(&result->freeSem, 0, BUFFER_COUNT);
|
||||
|
||||
pthread_mutex_init(&result->queueMutex, NULL);
|
||||
|
||||
pthread_create(&result->renderThread, NULL, go2_presenter_renderloop, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void go2_presenter_destroy(go2_presenter_t* presenter)
|
||||
{
|
||||
presenter->terminating = true;
|
||||
sem_post(&presenter->usedSem);
|
||||
if (presenter->managed) {
|
||||
presenter->terminating = true;
|
||||
sem_post(&presenter->usedSem);
|
||||
|
||||
pthread_join(presenter->renderThread, NULL);
|
||||
pthread_mutex_destroy(&presenter->queueMutex);
|
||||
pthread_join(presenter->renderThread, NULL);
|
||||
pthread_mutex_destroy(&presenter->queueMutex);
|
||||
|
||||
sem_destroy(&presenter->freeSem);
|
||||
sem_destroy(&presenter->usedSem);
|
||||
sem_destroy(&presenter->freeSem);
|
||||
sem_destroy(&presenter->usedSem);
|
||||
|
||||
|
||||
while(go2_queue_count_get(presenter->usedFrameBuffers) > 0)
|
||||
{
|
||||
go2_frame_buffer_t* frameBuffer = go2_queue_pop(presenter->usedFrameBuffers);
|
||||
|
||||
go2_surface_t* surface = frameBuffer->surface;
|
||||
|
||||
go2_frame_buffer_destroy(frameBuffer);
|
||||
go2_surface_destroy(surface);
|
||||
}
|
||||
while(go2_queue_count_get(presenter->usedFrameBuffers) > 0)
|
||||
{
|
||||
go2_frame_buffer_t* frameBuffer = go2_queue_pop(presenter->usedFrameBuffers);
|
||||
|
||||
while(go2_queue_count_get(presenter->freeFrameBuffers) > 0)
|
||||
{
|
||||
go2_frame_buffer_t* frameBuffer = go2_queue_pop(presenter->freeFrameBuffers);
|
||||
|
||||
go2_surface_t* surface = frameBuffer->surface;
|
||||
go2_surface_t* surface = frameBuffer->surface;
|
||||
|
||||
go2_frame_buffer_destroy(frameBuffer);
|
||||
go2_surface_destroy(surface);
|
||||
go2_frame_buffer_destroy(frameBuffer);
|
||||
go2_surface_destroy(surface);
|
||||
}
|
||||
|
||||
while(go2_queue_count_get(presenter->freeFrameBuffers) > 0)
|
||||
{
|
||||
go2_frame_buffer_t* frameBuffer = go2_queue_pop(presenter->freeFrameBuffers);
|
||||
|
||||
go2_surface_t* surface = frameBuffer->surface;
|
||||
|
||||
go2_frame_buffer_destroy(frameBuffer);
|
||||
go2_surface_destroy(surface);
|
||||
}
|
||||
}
|
||||
|
||||
free(presenter);
|
||||
}
|
||||
|
||||
void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, go2_rotation_t rotation)
|
||||
void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, go2_rotation_t rotation, int scale_mode)
|
||||
{
|
||||
sem_wait(&presenter->freeSem);
|
||||
|
||||
@@ -1012,7 +1019,7 @@ void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int
|
||||
}
|
||||
|
||||
|
||||
go2_surface_blit(surface, srcX, srcY, srcWidth, srcHeight, dstSurface, dstX, dstY, dstWidth, dstHeight, rotation);
|
||||
go2_surface_blit(surface, srcX, srcY, srcWidth, srcHeight, dstSurface, dstX, dstY, dstWidth, dstHeight, rotation, scale_mode);
|
||||
|
||||
|
||||
pthread_mutex_lock(&presenter->queueMutex);
|
||||
@@ -1022,8 +1029,6 @@ void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int
|
||||
sem_post(&presenter->usedSem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define BUFFER_MAX (3)
|
||||
|
||||
typedef struct buffer_surface_pair
|
||||
@@ -1034,7 +1039,7 @@ typedef struct buffer_surface_pair
|
||||
|
||||
typedef struct go2_context
|
||||
{
|
||||
go2_display_t* display;
|
||||
go2_display_t* display;
|
||||
int width;
|
||||
int height;
|
||||
go2_context_attributes_t attributes;
|
||||
|
||||
Vendored
+7
-3
@@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
typedef struct go2_display go2_display_t;
|
||||
@@ -78,7 +79,7 @@ void* go2_surface_map(go2_surface_t* surface);
|
||||
void go2_surface_unmap(go2_surface_t* surface);
|
||||
void go2_surface_blit(go2_surface_t* srcSurface, int srcX, int srcY, int srcWidth, int srcHeight,
|
||||
go2_surface_t* dstSurface, int dstX, int dstY, int dstWidth, int dstHeight,
|
||||
go2_rotation_t rotation);
|
||||
go2_rotation_t rotation, int scale_mode);
|
||||
int go2_surface_save_as_png(go2_surface_t* surface, const char* filename);
|
||||
|
||||
|
||||
@@ -87,9 +88,10 @@ void go2_frame_buffer_destroy(go2_frame_buffer_t* frame_buffer);
|
||||
go2_surface_t* go2_frame_buffer_surface_get(go2_frame_buffer_t* frame_buffer);
|
||||
|
||||
|
||||
go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, uint32_t background_color);
|
||||
go2_presenter_t* go2_presenter_create(go2_display_t* display, uint32_t format, uint32_t background_color, bool managed);
|
||||
void go2_presenter_destroy(go2_presenter_t* presenter);
|
||||
void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, go2_rotation_t rotation);
|
||||
void go2_presenter_post(go2_presenter_t* presenter, go2_surface_t* surface, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, go2_rotation_t rotation, int scale_mode);
|
||||
go2_display_t* go2_presenter_display_get(go2_presenter_t* presenter);
|
||||
|
||||
|
||||
go2_context_t* go2_context_create(go2_display_t* display, int width, int height, const go2_context_attributes_t* attributes);
|
||||
@@ -100,6 +102,8 @@ void go2_context_swap_buffers(go2_context_t* context);
|
||||
go2_surface_t* go2_context_surface_lock(go2_context_t* context);
|
||||
void go2_context_surface_unlock(go2_context_t* context, go2_surface_t* surface);
|
||||
|
||||
go2_frame_buffer_t* go2_frame_buffer_create(go2_surface_t* surface);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+34
-13
@@ -80,6 +80,13 @@ platform=ngc
|
||||
MAKEFILE_GRIFFIN=yes
|
||||
EXT=a
|
||||
|
||||
# PSL1GHT
|
||||
elif [ $PLATFORM = "psl1ght" ] ; then
|
||||
platform=psl1ght
|
||||
SALAMANDER=yes
|
||||
EXT=a
|
||||
ps3appid=SSNE10001
|
||||
|
||||
# DEX PS3
|
||||
elif [ $PLATFORM = "dex-ps3" ] ; then
|
||||
platform=ps3
|
||||
@@ -250,7 +257,13 @@ for f in `ls -v *_${platform}.${EXT}`; do
|
||||
fi
|
||||
|
||||
# Move executable files
|
||||
if [ $platform = "ps3" ] ; then
|
||||
if [ $platform = "psl1ght" ] ; then
|
||||
mv -fv ../retroarch_psl1ght.self ../pkg/psl1ght/pkg/USRDIR/cores/"${name}_libretro_${platform}.SELF"
|
||||
if [ -d ../../dist/info ]; then
|
||||
mkdir -p ../pkg/psl1ght/USRDIR/cores/info
|
||||
cp -fv ../../dist/info/"${name}_libretro.info" ../pkg/psl1ght/USRDIR/pkg/cores/info/"${name}_libretro.info"
|
||||
fi
|
||||
elif [ $platform = "ps3" ] ; then
|
||||
if [ $PLATFORM = "ode-ps3" ] ; then
|
||||
mv -fv ../CORE.SELF ../pkg/${platform}_iso/PS3_GAME/USRDIR/cores/"${name}_libretro_${platform}.SELF"
|
||||
if [ -d ../../dist/info ]; then
|
||||
@@ -299,7 +312,9 @@ for f in `ls -v *_${platform}.${EXT}`; do
|
||||
fi
|
||||
|
||||
# Remove executable files
|
||||
if [ $platform = "ps3" ] ; then
|
||||
if [ $platform = "psl1ght" ] ; then
|
||||
rm -f ../retroarch_${platform}.elf ../retroarch_${platform}.self ../CORE.SELF
|
||||
elif [ $platform = "ps3" ] ; then
|
||||
rm -f ../retroarch_${platform}.elf ../retroarch_${platform}.self ../CORE.SELF
|
||||
elif [ $PLATFORM = "ps2" ] ; then
|
||||
rm -f ../retroarchps2.elf
|
||||
@@ -340,7 +355,7 @@ for f in `ls -v *_${platform}.${EXT}`; do
|
||||
done
|
||||
|
||||
# Additional build step
|
||||
if [ $platform = "ps3" ] ; then
|
||||
if [ $platform = "ps3" ] || [ $platform = "psl1ght" ] ; then
|
||||
if [ $PLATFORM = "ode-ps3" ] ; then
|
||||
echo Deploy : Assets...
|
||||
if [ -d ../media/assets ]; then
|
||||
@@ -367,29 +382,33 @@ if [ $platform = "ps3" ] ; then
|
||||
cp -r ../media/shaders_cg/* ../pkg/${platform}_iso/PS3_GAME/USRDIR/cores/shaders_cg
|
||||
fi
|
||||
else
|
||||
ps3pkgdir=pkg/ps3/SSNE10000
|
||||
if [ $platform = psl1ght ]; then
|
||||
ps3pkgdir=pkg/psl1ght/pkg
|
||||
fi
|
||||
echo Deploy : Assets...
|
||||
if [ -d ../media/assets ]; then
|
||||
mkdir -p ../pkg/${platform}/SSNE10000/USRDIR/cores/assets
|
||||
cp -r ../media/assets/* ../pkg/${platform}/SSNE10000/USRDIR/cores/assets
|
||||
mkdir -p ../${ps3pkgdir}/USRDIR/cores/assets
|
||||
cp -r ../media/assets/* ../${ps3pkgdir}/USRDIR/cores/assets
|
||||
fi
|
||||
echo Deploy : Databases...
|
||||
if [ -d ../media/libretrodb/rdb ]; then
|
||||
mkdir -p ../pkg/${platform}/SSNE10000/USRDIR/cores/database/rdb
|
||||
cp -r ../media/libretrodb/rdb/* ../pkg/${platform}/SSNE10000/USRDIR/cores/database/rdb
|
||||
mkdir -p ../${ps3pkgdir}/USRDIR/cores/database/rdb
|
||||
cp -r ../media/libretrodb/rdb/* ../${ps3pkgdir}/USRDIR/cores/database/rdb
|
||||
fi
|
||||
if [ -d ../media/libretrodb/cursors ]; then
|
||||
mkdir -p ../pkg/${platform}/SSNE10000/USRDIR/cores/database/cursors
|
||||
cp -r ../media/libretrodb/cursors/* ../pkg/${platform}/SSNE10000/USRDIR/cores/database/cursors
|
||||
mkdir -p ../${ps3pkgdir}/USRDIR/cores/database/cursors
|
||||
cp -r ../media/libretrodb/cursors/* ../${ps3pkgdir}/USRDIR/cores/database/cursors
|
||||
fi
|
||||
echo Deploy : Overlays...
|
||||
if [ -d ../media/overlays ]; then
|
||||
mkdir -p ../pkg/${platform}/SSNE10000/USRDIR/cores/overlays
|
||||
cp -r ../media/overlays/* ../pkg/${platform}/SSNE10000/USRDIR/cores/overlays
|
||||
mkdir -p ../${ps3pkgdir}/USRDIR/cores/overlays
|
||||
cp -r ../media/overlays/* ../${ps3pkgdir}/USRDIR/cores/overlays
|
||||
fi
|
||||
echo Deploy : Shaders...
|
||||
if [ -d ../media/shaders_cg ]; then
|
||||
mkdir -p ../pkg/${platform}/SSNE10000/USRDIR/cores/shaders_cg
|
||||
cp -r ../media/shaders_cg/* ../pkg/${platform}/SSNE10000/USRDIR/cores/shaders_cg
|
||||
mkdir -p ../${ps3pkgdir}/USRDIR/cores/shaders_cg
|
||||
cp -r ../media/shaders_cg/* ../${ps3pkgdir}/USRDIR/cores/shaders_cg
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -408,6 +427,8 @@ elif [ $PLATFORM = "cex-ps3" ] ; then
|
||||
(cd ../tools/ps3/ps3py && python2 setup.py build)
|
||||
find ../tools/ps3/ps3py/build -name '*.dll' -exec cp {} ../tools/ps3/ps3py \;
|
||||
../tools/ps3/ps3py/pkg.py --contentid UP0001-SSNE10000_00-0000000000000001 ../pkg/${platform}/SSNE10000/ ../pkg/${platform}/RetroArch.PS3.CEX.PS3.pkg
|
||||
elif [ $PLATFORM = "psl1ght" ] ; then
|
||||
pkg.py --contentid UP0001-SSNE10001_00-0000000000000001 ../pkg/psl1ght/pkg/ ../pkg/psl1ght/RetroArch.PSL1GHT.pkg
|
||||
elif [ $PLATFORM = "ode-ps3" ] ; then
|
||||
rsync -av ../pkg/${platform}_iso/PS3_GAME/USRDIR/cores/*.SELF ../pkg/${platform}/${PLATFORM}/
|
||||
$SCETOOL_PATH $SCETOOL_FLAGS_ODE ../retroarch-salamander_${platform}.elf ../pkg/${platform}_iso/PS3_GAME/USRDIR/EBOOT.BIN
|
||||
|
||||
+125
-63
@@ -17,14 +17,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sys/process.h>
|
||||
#if !defined(__PSL1GHT__)
|
||||
#include <sysutil/sysutil_common.h>
|
||||
#ifdef IS_SALAMANDER
|
||||
#endif
|
||||
#if defined (IS_SALAMANDER) && !defined(__PSL1GHT__)
|
||||
#include <netex/net.h>
|
||||
#include <np.h>
|
||||
#include <np/drm.h>
|
||||
#include <cell/sysmodule.h>
|
||||
#endif
|
||||
|
||||
#include <lv2/process.h>
|
||||
#include <sys/process.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -45,7 +48,11 @@
|
||||
#include "../../defaults.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#ifdef __PSL1GHT__
|
||||
#define EMULATOR_CONTENT_DIR "SSNE10001"
|
||||
#else
|
||||
#define EMULATOR_CONTENT_DIR "SSNE10000"
|
||||
#endif
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
#define NP_POOL_SIZE (128*1024)
|
||||
@@ -100,6 +107,108 @@ static void callback_sysutil_exit(uint64_t status,
|
||||
}
|
||||
#endif
|
||||
|
||||
static void fill_derived_paths()
|
||||
{
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY],
|
||||
g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]));
|
||||
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_CORE],
|
||||
"info",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"savestates", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SRAM],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"savefiles", sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"shaders_cg", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER]));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
|
||||
#endif
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CURSOR],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"database/cursors", sizeof(g_defaults.dirs[DEFAULT_DIR_CURSOR]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE], "cheats",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
}
|
||||
|
||||
static void use_app_path(char *content_info_path)
|
||||
{
|
||||
fill_pathname_join(content_info_path, "/dev_hdd0/game/",
|
||||
EMULATOR_CONTENT_DIR, PATH_MAX_LENGTH);
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PORT], content_info_path,
|
||||
"USRDIR", sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
|
||||
}
|
||||
|
||||
#ifdef __PSL1GHT__
|
||||
static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
void *args, void *params_data)
|
||||
{
|
||||
#ifndef IS_SALAMANDER
|
||||
bool original_verbose = verbosity_is_enabled();
|
||||
verbosity_enable();
|
||||
#endif
|
||||
|
||||
(void)args;
|
||||
#if defined(HAVE_LOGGER) && !defined(IS_SALAMANDER)
|
||||
logger_init();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
#ifndef IS_SALAMANDER
|
||||
retro_main_log_file_init("/dev_hdd0/game/" EMULATOR_CONTENT_DIR "/USRDIR/retroarch-log.txt", false);
|
||||
#else
|
||||
retro_main_log_file_init("/dev_hdd0/game/" EMULATOR_CONTENT_DIR "/USRDIR/retroarch-log-salamander.txt", false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
char content_info_path[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
use_app_path(content_info_path);
|
||||
fill_derived_paths();
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
if (original_verbose)
|
||||
verbosity_enable();
|
||||
else
|
||||
verbosity_disable();
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
void *args, void *params_data)
|
||||
{
|
||||
@@ -113,7 +222,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
#if defined(HAVE_LOGGER)
|
||||
logger_init();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
retro_main_log_file_init("/retroarch-log.txt");
|
||||
retro_main_log_file_init("/dev_hdd0/retroarch-log.txt", false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -199,10 +308,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
#ifdef HAVE_MULTIMAN
|
||||
if (multiman_detected)
|
||||
{
|
||||
fill_pathname_join(content_info_path, "/dev_hdd0/game/",
|
||||
EMULATOR_CONTENT_DIR, sizeof(content_info_path));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PORT], content_info_path,
|
||||
"USRDIR", sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
|
||||
use_app_path(content_info_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -215,62 +321,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
RARCH_LOG("usrDirPath : [%s].\n", g_defaults.dirs[DEFAULT_DIR_PORT]);
|
||||
}
|
||||
|
||||
strlcpy(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY],
|
||||
g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CONTENT_HISTORY]));
|
||||
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_CORE],
|
||||
"info",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"savestates", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SRAM],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"savefiles", sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"shaders_cg", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER]));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dirs[DEFAULT_DIR_PORT],
|
||||
file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
|
||||
#endif
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CURSOR],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"database/cursors", sizeof(g_defaults.dirs[DEFAULT_DIR_CURSOR]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE], "cheats",
|
||||
sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS],
|
||||
g_defaults.dirs[DEFAULT_DIR_CORE],
|
||||
"logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS]));
|
||||
fill_derived_paths();
|
||||
}
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
@@ -280,6 +331,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
|
||||
verbosity_disable();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void frontend_ps3_init(void *data)
|
||||
{
|
||||
@@ -401,15 +453,21 @@ static int frontend_ps3_exec_exitspawn(const char *path,
|
||||
int ret;
|
||||
unsigned i;
|
||||
char spawn_data[256];
|
||||
#ifndef __PSL1GHT__
|
||||
SceNpDrmKey *license_data = NULL;
|
||||
#endif
|
||||
|
||||
for(i = 0; i < sizeof(spawn_data); ++i)
|
||||
spawn_data[i] = i & 0xff;
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
ret = sceNpDrmProcessExitSpawn(license_data, path,
|
||||
(const char** const)argv, envp, (sys_addr_t)spawn_data,
|
||||
256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
|
||||
|
||||
#else
|
||||
ret = -1;
|
||||
#endif
|
||||
|
||||
if(ret < 0)
|
||||
{
|
||||
RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n");
|
||||
@@ -452,7 +510,9 @@ static void frontend_ps3_exec(const char *path, bool should_load_game)
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
sceNpTerm();
|
||||
#endif
|
||||
sys_net_finalize_network();
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP);
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_NET);
|
||||
@@ -498,7 +558,9 @@ static void frontend_ps3_exitspawn(char *s, size_t len, char *args)
|
||||
frontend_ps3_exec(s, should_load_game);
|
||||
|
||||
#ifdef IS_SALAMANDER
|
||||
#ifndef __PSL1GHT__
|
||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
||||
#endif
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
||||
cellSysmoduleLoadModule(CELL_SYSMODULE_IO);
|
||||
#endif
|
||||
|
||||
@@ -102,8 +102,6 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[],
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], data_path,
|
||||
"layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
|
||||
#endif
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADERS], data_path,
|
||||
"shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADERS]));
|
||||
|
||||
/* user data */
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS], user_path,
|
||||
@@ -116,8 +114,6 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[],
|
||||
"downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER], user_path,
|
||||
"filters/audio", sizeof(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_VIDEO_FILTER], user_path,
|
||||
"filters/video", sizeof(g_defaults.dirs[DEFAULT_VIDEO_FILTER]));
|
||||
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], user_path,
|
||||
@@ -130,8 +126,6 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[],
|
||||
"states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM], user_path,
|
||||
"system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_THUMBNAIL], user_path,
|
||||
"thumbnails", sizeof(g_defaults.dirs[DEFAULT_DIR_THUMBNAIL]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS], user_path,
|
||||
"wallpapers", sizeof(g_defaults.dirs[DEFAULT_DIR_WALLPAPERS]));
|
||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_LOGS], user_path,
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
#include "../../msg_hash.h"
|
||||
#include "platform_win32.h"
|
||||
|
||||
#ifdef HAVE_NVDA
|
||||
#include "../../nvdaController.h"
|
||||
#endif
|
||||
|
||||
#ifndef SM_SERVERR2
|
||||
#define SM_SERVERR2 89
|
||||
#endif
|
||||
@@ -717,6 +721,74 @@ static bool frontend_win32_set_fork(enum frontend_fork fork_mode)
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
static const char *accessibility_win_language_id(const char* language)
|
||||
{
|
||||
if (string_is_equal(language,"en"))
|
||||
return "409";
|
||||
else if (string_is_equal(language,"it"))
|
||||
return "410";
|
||||
else if (string_is_equal(language,"sv"))
|
||||
return "041d";
|
||||
else if (string_is_equal(language,"fr"))
|
||||
return "040c";
|
||||
else if (string_is_equal(language,"de"))
|
||||
return "407";
|
||||
else if (string_is_equal(language,"he"))
|
||||
return "040d";
|
||||
else if (string_is_equal(language,"id"))
|
||||
return "421";
|
||||
else if (string_is_equal(language,"es"))
|
||||
return "040a";
|
||||
else if (string_is_equal(language,"nl"))
|
||||
return "413";
|
||||
else if (string_is_equal(language,"ro"))
|
||||
return "418";
|
||||
else if (string_is_equal(language,"pt_pt"))
|
||||
return "816";
|
||||
else if (string_is_equal(language,"pt_bt") || string_is_equal(language,"pt"))
|
||||
return "416";
|
||||
else if (string_is_equal(language,"th"))
|
||||
return "041e";
|
||||
else if (string_is_equal(language,"ja"))
|
||||
return "411";
|
||||
else if (string_is_equal(language,"sk"))
|
||||
return "041b";
|
||||
else if (string_is_equal(language,"hi"))
|
||||
return "439";
|
||||
else if (string_is_equal(language,"ar"))
|
||||
return "401";
|
||||
else if (string_is_equal(language,"hu"))
|
||||
return "040e";
|
||||
else if (string_is_equal(language,"zh_tw") || string_is_equal(language,"zh"))
|
||||
return "804";
|
||||
else if (string_is_equal(language,"el"))
|
||||
return "408";
|
||||
else if (string_is_equal(language,"ru"))
|
||||
return "419";
|
||||
else if (string_is_equal(language,"nb"))
|
||||
return "414";
|
||||
else if (string_is_equal(language,"da"))
|
||||
return "406";
|
||||
else if (string_is_equal(language,"fi"))
|
||||
return "040b";
|
||||
else if (string_is_equal(language,"zh_hk"))
|
||||
return "0c04";
|
||||
else if (string_is_equal(language,"zh_cn"))
|
||||
return "804";
|
||||
else if (string_is_equal(language,"tr"))
|
||||
return "041f";
|
||||
else if (string_is_equal(language,"ko"))
|
||||
return "412";
|
||||
else if (string_is_equal(language,"pl"))
|
||||
return "415";
|
||||
else if (string_is_equal(language,"cs"))
|
||||
return "405";
|
||||
else
|
||||
return "";
|
||||
|
||||
|
||||
}
|
||||
|
||||
static const char *accessibility_win_language_code(const char* language)
|
||||
{
|
||||
if (string_is_equal(language,"en"))
|
||||
@@ -730,9 +802,9 @@ static const char *accessibility_win_language_code(const char* language)
|
||||
else if (string_is_equal(language,"de"))
|
||||
return "Microsoft Stefan Desktop";
|
||||
else if (string_is_equal(language,"he"))
|
||||
return "Microsoft Hemant Desktop";
|
||||
else if (string_is_equal(language,"id"))
|
||||
return "Microsoft Asaf Desktop";
|
||||
else if (string_is_equal(language,"id"))
|
||||
return "Microsoft Andika Desktop";
|
||||
else if (string_is_equal(language,"es"))
|
||||
return "Microsoft Pablo Desktop";
|
||||
else if (string_is_equal(language,"nl"))
|
||||
@@ -806,13 +878,56 @@ static bool create_win32_process(char* cmd)
|
||||
return true;
|
||||
}
|
||||
|
||||
#define COBJMACROS
|
||||
#include <sapi.h>
|
||||
#include <ole2.h>
|
||||
|
||||
ISpVoice* pVoice = NULL;
|
||||
bool USE_POWERSHELL = false;
|
||||
bool USE_NVDA = true;
|
||||
bool USE_NVDA_BRAILLE = false;
|
||||
|
||||
static bool is_narrator_running_windows(void)
|
||||
{
|
||||
DWORD status = 0;
|
||||
if (pi_set == false)
|
||||
bool res;
|
||||
|
||||
if (USE_POWERSHELL)
|
||||
{
|
||||
if (pi_set == false)
|
||||
return false;
|
||||
if (GetExitCodeProcess(&g_pi, &status) && status == STILL_ACTIVE)
|
||||
return true;
|
||||
return false;
|
||||
if (GetExitCodeProcess(&g_pi, &status) && status == STILL_ACTIVE)
|
||||
}
|
||||
#ifdef HAVE_NVDA
|
||||
else if (USE_NVDA)
|
||||
{
|
||||
long res=nvdaController_testIfRunning();
|
||||
if(res!=0)
|
||||
{
|
||||
RARCH_LOG("Error communicating with NVDA\n");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
/*
|
||||
nvdaController_speakText(L"This is a test speech message");
|
||||
nvdaController_brailleMessage(L"This is a test braille message");
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
SPVOICESTATUS pStatus;
|
||||
if (pVoice != NULL)
|
||||
{
|
||||
ISpVoice_GetStatus(pVoice, &pStatus, NULL);
|
||||
if (pStatus.dwRunningState == SPRS_IS_SPEAKING)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -822,9 +937,12 @@ static bool accessibility_speak_windows(int speed,
|
||||
char cmd[1200];
|
||||
const char *voice = get_user_language_iso639_1(true);
|
||||
const char *language = accessibility_win_language_code(voice);
|
||||
const char *langid = accessibility_win_language_id(voice);
|
||||
bool res = false;
|
||||
const char* speeds[10] = {"-10", "-7.5", "-5", "-2.5", "0", "2", "4", "6", "8", "10"};
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
if (speed < 1)
|
||||
speed = 1;
|
||||
else if (speed > 10)
|
||||
@@ -836,22 +954,70 @@ static bool accessibility_speak_windows(int speed,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strlen(language) > 0)
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.SelectVoice(\\\"%s\\\"); $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", language, speeds[speed-1], (char*) speak_text);
|
||||
else
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", speeds[speed-1], (char*) speak_text);
|
||||
if (pi_set)
|
||||
terminate_win32_process(g_pi);
|
||||
res = create_win32_process(cmd);
|
||||
if (!res)
|
||||
if (USE_POWERSHELL)
|
||||
{
|
||||
pi_set = false;
|
||||
if (strlen(language) > 0)
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.SelectVoice(\\\"%s\\\"); $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", language, speeds[speed-1], (char*) speak_text);
|
||||
else
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", speeds[speed-1], (char*) speak_text);
|
||||
if (pi_set)
|
||||
terminate_win32_process(g_pi);
|
||||
res = create_win32_process(cmd);
|
||||
if (!res)
|
||||
{
|
||||
pi_set = false;
|
||||
return true;
|
||||
}
|
||||
pi_set = true;
|
||||
return true;
|
||||
}
|
||||
#ifdef HAVE_NVDA
|
||||
else if (USE_NVDA)
|
||||
{
|
||||
long res=nvdaController_testIfRunning();
|
||||
if(res!=0)
|
||||
{
|
||||
RARCH_LOG("Error communicating with NVDA\n");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
nvdaController_cancelSpeech();
|
||||
}
|
||||
|
||||
if (USE_NVDA_BRAILLE)
|
||||
nvdaController_brailleMessage((wchar_t*) speak_text);
|
||||
else
|
||||
nvdaController_speakText((wchar_t *) speak_text);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
/* stop the old voice if running */
|
||||
CoUninitialize();
|
||||
if (pVoice != NULL)
|
||||
ISpVoice_Release(pVoice);
|
||||
pVoice = NULL;
|
||||
|
||||
/* Play the new voice */
|
||||
if (FAILED(CoInitialize(NULL)))
|
||||
return NULL;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_SpVoice, NULL, CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
wchar_t wtext[1200];
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"<rate speed=\"%s\"/><volume level=\"80\"/><lang langid=\"%s\"/>%s", speeds[speed], langid, speak_text);
|
||||
mbstowcs(wtext, cmd, strlen(cmd)+1);
|
||||
|
||||
hr = ISpVoice_Speak(pVoice, (LPWSTR) wtext, SPF_ASYNC /*SVSFlagsAsync*/, NULL);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
pi_set = true;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
_device = d;
|
||||
_layer = layer;
|
||||
#if TARGET_OS_OSX
|
||||
_layer.framebufferOnly = NO;
|
||||
_layer.displaySyncEnabled = YES;
|
||||
#endif
|
||||
_library = l;
|
||||
@@ -544,13 +545,13 @@
|
||||
NSUInteger dstStride = _viewport.width * 3;
|
||||
uint8_t *dst = buffer + (_viewport.height - 1) * dstStride;
|
||||
|
||||
for (int y = _viewport.y; y < _viewport.height; y++, src += srcStride, dst -= dstStride)
|
||||
for (int y = 0; y < _viewport.height; y++, src += srcStride, dst -= dstStride)
|
||||
{
|
||||
for (int x = _viewport.x; x < _viewport.width; x++)
|
||||
for (int x = 0; x < _viewport.width; x++)
|
||||
{
|
||||
dst[3 * x + 0] = src[4 * x + 0];
|
||||
dst[3 * x + 1] = src[4 * x + 1];
|
||||
dst[3 * x + 2] = src[4 * x + 2];
|
||||
dst[3 * x + 0] = src[4 * (_viewport.x + x) + 0];
|
||||
dst[3 * x + 1] = src[4 * (_viewport.x + x) + 1];
|
||||
dst[3 * x + 2] = src[4 * (_viewport.x + x) + 2];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -642,6 +643,14 @@
|
||||
|
||||
if (_blitCommandBuffer)
|
||||
{
|
||||
#if TARGET_OS_OSX
|
||||
if (_captureEnabled)
|
||||
{
|
||||
id<MTLBlitCommandEncoder> bce = [_blitCommandBuffer blitCommandEncoder];
|
||||
[bce synchronizeResource:_backBuffer];
|
||||
[bce endEncoding];
|
||||
}
|
||||
#endif
|
||||
// pending blits for mipmaps or render passes for slang shaders
|
||||
[_blitCommandBuffer commit];
|
||||
[_blitCommandBuffer waitUntilCompleted];
|
||||
|
||||
@@ -1072,7 +1072,7 @@ static void ctr_set_rotation(void* data, unsigned rotation)
|
||||
ctr->rotation = rotation;
|
||||
ctr->should_resize = true;
|
||||
}
|
||||
static void ctr_set_filtering(void* data, unsigned index, bool smooth)
|
||||
static void ctr_set_filtering(void* data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
ctr_video_t* ctr = (ctr_video_t*)data;
|
||||
|
||||
|
||||
+2
-2
@@ -236,7 +236,7 @@ static void d3d10_get_overlay_interface(void* data, const video_overlay_interfac
|
||||
}
|
||||
#endif
|
||||
|
||||
static void d3d10_set_filtering(void* data, unsigned index, bool smooth)
|
||||
static void d3d10_set_filtering(void* data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
unsigned i;
|
||||
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
|
||||
@@ -784,7 +784,7 @@ static void *d3d10_gfx_init(const video_info_t* video,
|
||||
}
|
||||
}
|
||||
|
||||
d3d10_set_filtering(d3d10, 0, video->smooth);
|
||||
d3d10_set_filtering(d3d10, 0, video->smooth, video->ctx_scaling);
|
||||
|
||||
{
|
||||
D3D10_BUFFER_DESC desc;
|
||||
|
||||
+2
-2
@@ -254,7 +254,7 @@ static void d3d11_get_overlay_interface(void* data, const video_overlay_interfac
|
||||
}
|
||||
#endif
|
||||
|
||||
static void d3d11_set_filtering(void* data, unsigned index, bool smooth)
|
||||
static void d3d11_set_filtering(void* data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
unsigned i;
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
|
||||
@@ -859,7 +859,7 @@ static void *d3d11_gfx_init(const video_info_t* video,
|
||||
}
|
||||
}
|
||||
|
||||
d3d11_set_filtering(d3d11, 0, video->smooth);
|
||||
d3d11_set_filtering(d3d11, 0, video->smooth, video->ctx_scaling);
|
||||
|
||||
{
|
||||
D3D11_BUFFER_DESC desc;
|
||||
|
||||
+2
-2
@@ -224,7 +224,7 @@ static void d3d12_get_overlay_interface(void* data, const video_overlay_interfac
|
||||
}
|
||||
#endif
|
||||
|
||||
static void d3d12_set_filtering(void* data, unsigned index, bool smooth)
|
||||
static void d3d12_set_filtering(void* data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
int i;
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
|
||||
@@ -958,7 +958,7 @@ static void *d3d12_gfx_init(const video_info_t* video,
|
||||
#endif
|
||||
|
||||
d3d12_init_samplers(d3d12);
|
||||
d3d12_set_filtering(d3d12, 0, video->smooth);
|
||||
d3d12_set_filtering(d3d12, 0, video->smooth, video->ctx_scaling);
|
||||
|
||||
d3d12_create_fullscreen_quad_vbo(d3d12->device, &d3d12->frame.vbo_view, &d3d12->frame.vbo);
|
||||
d3d12_create_fullscreen_quad_vbo(d3d12->device, &d3d12->menu.vbo_view, &d3d12->menu.vbo);
|
||||
|
||||
@@ -0,0 +1,692 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2020 Google
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <retro_math.h>
|
||||
#include <formats/image.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
#include "../font_driver.h"
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../command.h"
|
||||
#include "../../driver.h"
|
||||
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#ifndef HAVE_THREADS
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#endif
|
||||
|
||||
#include "../../defines/ps3_defines.h"
|
||||
|
||||
#include <rsx/rsx.h>
|
||||
#include <ppu-types.h>
|
||||
|
||||
#define CB_SIZE 0x100000
|
||||
#define HOST_SIZE (32*1024*1024)
|
||||
|
||||
#include <ppu-lv2.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sysutil/video.h>
|
||||
#include <rsx/gcm_sys.h>
|
||||
#include <rsx/rsx.h>
|
||||
#include <io/pad.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#define MAX_BUFFERS 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
int height;
|
||||
int width;
|
||||
int id;
|
||||
uint32_t *ptr;
|
||||
// Internal stuff
|
||||
uint32_t offset;
|
||||
} rsxBuffer;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float v;
|
||||
float u;
|
||||
float y;
|
||||
float x;
|
||||
} gcm_scale_vector_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
s16 x0, y0, x1, y1;
|
||||
s16 u0, v0, u1, v1;
|
||||
} gcm_vertex_t;
|
||||
|
||||
typedef struct gcm_video
|
||||
{
|
||||
video_viewport_t vp;
|
||||
rsxBuffer buffers[MAX_BUFFERS];
|
||||
rsxBuffer menuBuffers[MAX_BUFFERS];
|
||||
int currentBuffer, menuBuffer;
|
||||
gcmContextData *context;
|
||||
u16 width;
|
||||
u16 height;
|
||||
bool menu_frame_enable;
|
||||
bool rgb32;
|
||||
bool vsync;
|
||||
u32 depth_pitch;
|
||||
u32 depth_offset;
|
||||
u32 *depth_buffer;
|
||||
|
||||
bool smooth;
|
||||
unsigned rotation;
|
||||
bool keep_aspect;
|
||||
bool should_resize;
|
||||
bool msg_rendering_enabled;
|
||||
|
||||
} gcm_video_t;
|
||||
|
||||
#ifndef HAVE_THREADS
|
||||
static bool gcm_tasks_finder(retro_task_t *task,void *userdata)
|
||||
{
|
||||
return task;
|
||||
}
|
||||
task_finder_data_t gcm_tasks_finder_data = {gcm_tasks_finder, NULL};
|
||||
#endif
|
||||
|
||||
static int
|
||||
makeBuffer (rsxBuffer * buffer, u16 width, u16 height, int id)
|
||||
{
|
||||
int depth = sizeof(u32);
|
||||
int pitch = depth * width;
|
||||
int size = depth * width * height;
|
||||
|
||||
buffer->ptr = (uint32_t*) rsxMemalign (64, size);
|
||||
if (buffer->ptr == NULL)
|
||||
goto error;
|
||||
|
||||
if (rsxAddressToOffset (buffer->ptr, &buffer->offset) != 0)
|
||||
goto error;
|
||||
|
||||
/* Register the display buffer with the RSX */
|
||||
if (gcmSetDisplayBuffer (id, buffer->offset, pitch, width, height) != 0)
|
||||
goto error;
|
||||
|
||||
buffer->width = width;
|
||||
buffer->height = height;
|
||||
buffer->id = id;
|
||||
|
||||
return TRUE;
|
||||
|
||||
error:
|
||||
if (buffer->ptr != NULL)
|
||||
rsxFree (buffer->ptr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
flip (gcmContextData *context, s32 buffer)
|
||||
{
|
||||
if (gcmSetFlip (context, buffer) == 0) {
|
||||
rsxFlushBuffer (context);
|
||||
// Prevent the RSX from continuing until the flip has finished.
|
||||
gcmSetWaitFlip (context);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#define GCM_LABEL_INDEX 255
|
||||
|
||||
static void waitRSXIdle(gcmContextData *context);
|
||||
|
||||
static void
|
||||
waitFlip ()
|
||||
{
|
||||
while (gcmGetFlipStatus () != 0)
|
||||
usleep (200); /* Sleep, to not stress the cpu. */
|
||||
gcmResetFlipStatus ();
|
||||
}
|
||||
|
||||
static gcmContextData *
|
||||
initScreen (gcm_video_t* gcm)
|
||||
{
|
||||
gcmContextData *context = NULL; /* Context to keep track of the RSX buffer. */
|
||||
static gcmContextData *saved_context = NULL;
|
||||
videoState state;
|
||||
videoConfiguration vconfig;
|
||||
videoResolution res; /* Screen Resolution */
|
||||
|
||||
if (!saved_context) {
|
||||
/* Allocate a 1Mb buffer, alligned to a 1Mb boundary
|
||||
* to be our shared IO memory with the RSX. */
|
||||
void *host_addr = memalign (1024*1024, HOST_SIZE);
|
||||
|
||||
if (host_addr == NULL)
|
||||
goto error;
|
||||
|
||||
/* Initilise Reality, which sets up the command buffer and shared IO memory */
|
||||
context = rsxInit (CB_SIZE, HOST_SIZE, host_addr);
|
||||
if (context == NULL)
|
||||
goto error;
|
||||
saved_context = context;
|
||||
} else {
|
||||
context = saved_context;
|
||||
}
|
||||
|
||||
/* Get the state of the display */
|
||||
if (videoGetState (0, 0, &state) != 0)
|
||||
goto error;
|
||||
|
||||
/* Make sure display is enabled */
|
||||
if (state.state != 0)
|
||||
goto error;
|
||||
|
||||
/* Get the current resolution */
|
||||
if (videoGetResolution (state.displayMode.resolution, &res) != 0)
|
||||
goto error;
|
||||
|
||||
/* Configure the buffer format to xRGB */
|
||||
memset (&vconfig, 0, sizeof(videoConfiguration));
|
||||
vconfig.resolution = state.displayMode.resolution;
|
||||
vconfig.format = VIDEO_BUFFER_FORMAT_XRGB;
|
||||
vconfig.pitch = res.width * sizeof(u32);
|
||||
vconfig.aspect = state.displayMode.aspect;
|
||||
|
||||
gcm->width = res.width;
|
||||
gcm->height = res.height;
|
||||
|
||||
waitRSXIdle(context);
|
||||
|
||||
if (videoConfigure (0, &vconfig, NULL, 0) != 0)
|
||||
goto error;
|
||||
|
||||
if (videoGetState (0, 0, &state) != 0)
|
||||
goto error;
|
||||
|
||||
gcmSetFlipMode (GCM_FLIP_VSYNC); // Wait for VSYNC to flip
|
||||
|
||||
gcm->depth_pitch = res.width * sizeof(u32);
|
||||
gcm->depth_buffer = (u32 *) rsxMemalign (64, (res.height * gcm->depth_pitch)* 2);
|
||||
rsxAddressToOffset (gcm->depth_buffer, &gcm->depth_offset);
|
||||
|
||||
gcmResetFlipStatus();
|
||||
|
||||
return context;
|
||||
|
||||
error:
|
||||
// if (context)
|
||||
// rsxFinish (context, 0);
|
||||
|
||||
// if (gcm->host_addr)
|
||||
// free (gcm->host_addr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
waitFinish(gcmContextData *context, u32 sLabelVal)
|
||||
{
|
||||
rsxSetWriteBackendLabel (context, GCM_LABEL_INDEX, sLabelVal);
|
||||
|
||||
rsxFlushBuffer (context);
|
||||
|
||||
while(*(vu32 *) gcmGetLabelAddress (GCM_LABEL_INDEX) != sLabelVal)
|
||||
usleep(30);
|
||||
|
||||
sLabelVal++;
|
||||
}
|
||||
|
||||
static void
|
||||
waitRSXIdle(gcmContextData *context)
|
||||
{
|
||||
u32 sLabelVal = 1;
|
||||
|
||||
rsxSetWriteBackendLabel (context, GCM_LABEL_INDEX, sLabelVal);
|
||||
rsxSetWaitLabel (context, GCM_LABEL_INDEX, sLabelVal);
|
||||
|
||||
sLabelVal++;
|
||||
|
||||
waitFinish(context, sLabelVal);
|
||||
}
|
||||
|
||||
static void* gcm_init(const video_info_t* video,
|
||||
input_driver_t** input, void** input_data)
|
||||
{
|
||||
RARCH_LOG("Reached gcm_init\n");
|
||||
gcm_video_t* gcm = malloc(sizeof(gcm_video_t));
|
||||
|
||||
if (!gcm)
|
||||
return NULL;
|
||||
|
||||
memset(gcm, 0, sizeof(gcm_video_t));
|
||||
|
||||
int i;
|
||||
|
||||
gcm->context = initScreen (gcm);
|
||||
|
||||
for (i = 0; i < MAX_BUFFERS; i++)
|
||||
makeBuffer( &gcm->buffers[i], gcm->width, gcm->height, i);
|
||||
|
||||
for (i = 0; i < MAX_BUFFERS; i++)
|
||||
makeBuffer( &gcm->menuBuffers[i], gcm->width, gcm->height, i + MAX_BUFFERS);
|
||||
|
||||
flip(gcm->context, MAX_BUFFERS - 1);
|
||||
|
||||
gcm->vp.x = 0;
|
||||
gcm->vp.y = 0;
|
||||
gcm->vp.width = gcm->width;
|
||||
gcm->vp.height = gcm->height;
|
||||
gcm->vp.full_width = gcm->width;
|
||||
gcm->vp.full_height = gcm->height;
|
||||
gcm->rgb32 = video->rgb32;
|
||||
video_driver_set_size(gcm->vp.width, gcm->vp.height);
|
||||
|
||||
if (input && input_data)
|
||||
{
|
||||
void *ps3input = input_ps3.init(ps3_joypad.ident);
|
||||
*input = ps3input ? &input_ps3 : NULL;
|
||||
*input_data = ps3input;
|
||||
}
|
||||
RARCH_LOG("gcm_init done\n");
|
||||
|
||||
return gcm;
|
||||
}
|
||||
|
||||
static void black (uint32_t *dst, uint32_t *dst_end, size_t sz)
|
||||
{
|
||||
if (sz > dst_end - dst)
|
||||
sz = dst_end - dst;
|
||||
memset (dst, 0, sz * 4);
|
||||
}
|
||||
|
||||
static void blitBuffer(rsxBuffer *buffer, const void *frame, unsigned width,
|
||||
unsigned height, unsigned pitch, int rgb32, bool do_scaling)
|
||||
{
|
||||
if (width > buffer->width)
|
||||
width = buffer->width;
|
||||
if (height > buffer->height)
|
||||
height = buffer->height;
|
||||
int scale = 1, xofs = 0, yofs = 0;
|
||||
|
||||
if (do_scaling) {
|
||||
scale = buffer->width / width;
|
||||
if (scale > buffer->height / height)
|
||||
scale = buffer->height / height;
|
||||
if (scale >= 10)
|
||||
scale = 10;
|
||||
if (scale >= 1) {
|
||||
xofs = (buffer->width - width * scale) / 2;
|
||||
yofs = (buffer->height - height * scale) / 2;
|
||||
} else
|
||||
scale = 1;
|
||||
}
|
||||
|
||||
// TODO: let rsx do the copy
|
||||
int i;
|
||||
int pre_clean = xofs + buffer->width * yofs;
|
||||
uint32_t *dst = buffer->ptr;
|
||||
uint32_t *dst_end = buffer->ptr + buffer->width * buffer->height;
|
||||
|
||||
memset (dst, 0, pre_clean * 4);
|
||||
dst += pre_clean;
|
||||
|
||||
if (scale == 1) {
|
||||
if (rgb32) {
|
||||
const uint8_t *src = frame;
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
memcpy(dst, src, width * 4);
|
||||
black(dst + width, dst_end, buffer->width - width);
|
||||
dst += buffer->width;
|
||||
src += pitch;
|
||||
}
|
||||
} else {
|
||||
const uint16_t *src = frame;
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
for (int j = 0; j < width; j++, src++, dst++) {
|
||||
u16 rgb565 = *src;
|
||||
u8 r = ((rgb565 >> 8) & 0xf8);
|
||||
u8 g = ((rgb565 >> 3) & 0xfc);
|
||||
u8 b = ((rgb565 << 3) & 0xfc);
|
||||
*dst = (r<<16) | (g<<8) | b;
|
||||
}
|
||||
black(dst, dst_end, buffer->width - width);
|
||||
|
||||
dst += buffer->width - width;
|
||||
src += pitch / 2 - width;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (rgb32) {
|
||||
const uint32_t *src = frame;
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
for (int j = 0; j < width; j++, src++) {
|
||||
u32 c = *src;
|
||||
for (int k = 0; k < scale; k++, dst++)
|
||||
for (int l = 0; l < scale; l++)
|
||||
dst[l * buffer->width] = c;
|
||||
}
|
||||
for (int l = 0; l < scale; l++)
|
||||
black(dst + l * buffer->width, dst_end, buffer->width - width * scale);
|
||||
|
||||
dst += buffer->width * scale - width * scale;
|
||||
src += pitch / 4 - width;
|
||||
}
|
||||
} else {
|
||||
const uint16_t *src = frame;
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
for (int j = 0; j < width; j++, src++) {
|
||||
u16 rgb565 = *src;
|
||||
u8 r = ((rgb565 >> 8) & 0xf8);
|
||||
u8 g = ((rgb565 >> 3) & 0xfc);
|
||||
u8 b = ((rgb565 << 3) & 0xfc);
|
||||
u32 c = (r<<16) | (g<<8) | b;
|
||||
for (int k = 0; k < scale; k++, dst++)
|
||||
for (int l = 0; l < scale; l++)
|
||||
dst[l * buffer->width] = c;
|
||||
}
|
||||
for (int l = 0; l < scale; l++)
|
||||
black(dst + l * buffer->width, dst_end, buffer->width - width * scale);
|
||||
|
||||
dst += buffer->width * scale - width * scale;
|
||||
src += pitch / 2 - width;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dst < dst_end)
|
||||
memset(dst, 0, 4 * (dst_end - dst));
|
||||
}
|
||||
|
||||
static void gcm_update_screen(gcm_video_t *gcm) {
|
||||
rsxBuffer *buffer = gcm->menu_frame_enable
|
||||
? &gcm->menuBuffers[gcm->menuBuffer]
|
||||
: &gcm->buffers[gcm->currentBuffer];
|
||||
flip(gcm->context, buffer->id);
|
||||
if (gcm->vsync)
|
||||
waitFlip();
|
||||
#ifdef HAVE_SYSUTILS
|
||||
cellSysutilCheckCallback();
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool gcm_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)
|
||||
{
|
||||
gcm_video_t *gcm = (gcm_video_t*)data;
|
||||
|
||||
if(frame && width && height)
|
||||
{
|
||||
gcm->currentBuffer++;
|
||||
if (gcm->currentBuffer >= MAX_BUFFERS)
|
||||
gcm->currentBuffer = 0;
|
||||
blitBuffer(&gcm->buffers[gcm->currentBuffer], frame, width, height, pitch,
|
||||
gcm->rgb32, true);
|
||||
}
|
||||
|
||||
// TODO: translucid menu
|
||||
gcm_update_screen(gcm);
|
||||
|
||||
return true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (video_info->statistics_show)
|
||||
{
|
||||
struct font_params *osd_params = (struct font_params*)
|
||||
&video_info->osd_stat_params;
|
||||
|
||||
if (osd_params)
|
||||
{
|
||||
font_driver_render_msg(gcm, video_info->stat_text,
|
||||
(const struct font_params*)&video_info->osd_stat_params, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (msg)
|
||||
font_driver_render_msg(gcm, msg, NULL, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gcm_set_nonblock_state(void* data, bool toggle,
|
||||
bool a, unsigned b)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (gcm)
|
||||
gcm->vsync = !toggle;
|
||||
}
|
||||
|
||||
static bool gcm_alive(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gcm_focus(void* data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gcm_suppress_screensaver(void* data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gcm_free(void* data)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (!gcm)
|
||||
return;
|
||||
|
||||
gcmSetWaitFlip(gcm->context);
|
||||
for (int i = 0; i < MAX_BUFFERS; i++)
|
||||
rsxFree(gcm->buffers[i].ptr);
|
||||
for (int i = 0; i < MAX_BUFFERS; i++)
|
||||
rsxFree(gcm->menuBuffers[i].ptr);
|
||||
|
||||
//rsxFinish(gcm->context, 1);
|
||||
// free(gcm->host_addr);
|
||||
free (gcm);
|
||||
}
|
||||
|
||||
static void gcm_set_texture_frame(void* data, const void* frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
int newBuffer = gcm->menuBuffer + 1;
|
||||
if (newBuffer >= MAX_BUFFERS)
|
||||
newBuffer = 0;
|
||||
// TODO: respect alpha
|
||||
blitBuffer(&gcm->menuBuffers[newBuffer], frame, width, height,
|
||||
width * (rgb32 ? 4 : 2), rgb32, true);
|
||||
gcm->menuBuffer = newBuffer;
|
||||
|
||||
gcm_update_screen(gcm);
|
||||
}
|
||||
|
||||
static void gcm_set_texture_enable(void* data, bool state, bool full_screen)
|
||||
{
|
||||
(void) full_screen;
|
||||
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (!gcm)
|
||||
return;
|
||||
|
||||
gcm->menu_frame_enable = state;
|
||||
|
||||
gcm_update_screen(gcm);
|
||||
}
|
||||
|
||||
static void gcm_set_rotation(void* data, unsigned rotation)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (!gcm)
|
||||
return;
|
||||
|
||||
gcm->rotation = rotation;
|
||||
gcm->should_resize = true;
|
||||
}
|
||||
static void gcm_set_filtering(void* data, unsigned index, bool smooth)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (gcm)
|
||||
gcm->smooth = smooth;
|
||||
}
|
||||
|
||||
static void gcm_set_aspect_ratio(void* data, unsigned aspect_ratio_idx)
|
||||
{
|
||||
gcm_video_t *gcm = (gcm_video_t*)data;
|
||||
|
||||
if(!gcm)
|
||||
return;
|
||||
|
||||
gcm->keep_aspect = true;
|
||||
gcm->should_resize = true;
|
||||
}
|
||||
|
||||
static void gcm_apply_state_changes(void* data)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (gcm)
|
||||
gcm->should_resize = true;
|
||||
|
||||
}
|
||||
|
||||
static void gcm_viewport_info(void* data, struct video_viewport* vp)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (gcm)
|
||||
*vp = gcm->vp;
|
||||
}
|
||||
|
||||
|
||||
static void gcm_set_osd_msg(void *data,
|
||||
video_frame_info_t *video_info,
|
||||
const char *msg,
|
||||
const void *params, void *font)
|
||||
{
|
||||
gcm_video_t* gcm = (gcm_video_t*)data;
|
||||
|
||||
if (gcm && gcm->msg_rendering_enabled)
|
||||
font_driver_render_msg(data, msg, params, font);
|
||||
}
|
||||
|
||||
static uint32_t gcm_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gcm_poke_interface = {
|
||||
gcm_get_flags,
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
NULL,
|
||||
NULL,
|
||||
gcm_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL,
|
||||
gcm_set_aspect_ratio,
|
||||
gcm_apply_state_changes,
|
||||
gcm_set_texture_frame,
|
||||
gcm_set_texture_enable,
|
||||
gcm_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 gcm_get_poke_interface(void* data,
|
||||
const video_poke_interface_t** iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &gcm_poke_interface;
|
||||
}
|
||||
|
||||
static bool gcm_set_shader(void* data,
|
||||
enum rarch_shader_type type, const char* path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
video_driver_t video_gcm =
|
||||
{
|
||||
gcm_init,
|
||||
gcm_frame,
|
||||
gcm_set_nonblock_state,
|
||||
gcm_alive,
|
||||
gcm_focus,
|
||||
gcm_suppress_screensaver,
|
||||
NULL, /* has_windowed */
|
||||
gcm_set_shader,
|
||||
gcm_free,
|
||||
"gcm",
|
||||
NULL, /* set_viewport */
|
||||
gcm_set_rotation,
|
||||
gcm_viewport_info,
|
||||
NULL, /* read_viewport */
|
||||
NULL, /* read_frame_raw */
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL,
|
||||
#endif
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
NULL,
|
||||
#endif
|
||||
gcm_get_poke_interface
|
||||
};
|
||||
@@ -783,6 +783,11 @@ static void gl2_create_fbo_texture(gl_t *gl,
|
||||
bool smooth = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool video_smooth = settings->bools.video_smooth;
|
||||
#if HAVE_ODROIDGO2
|
||||
bool video_ctx_scaling = settings->bools.video_ctx_scaling;
|
||||
if (video_ctx_scaling)
|
||||
video_smooth = false;
|
||||
#endif
|
||||
bool force_srgb_disable = settings->bools.video_force_srgb_disable;
|
||||
GLuint base_filt = video_smooth ? GL_LINEAR : GL_NEAREST;
|
||||
GLuint base_mip_filt = video_smooth ?
|
||||
@@ -3833,6 +3838,12 @@ static void *gl2_init(const video_info_t *video,
|
||||
gl->tex_w = gl->tex_h = (RARCH_SCALE_BASE * video->input_scale);
|
||||
gl->keep_aspect = video->force_aspect;
|
||||
|
||||
#if defined(HAVE_ODROIDGO2)
|
||||
if (settings->bools.video_ctx_scaling)
|
||||
gl->keep_aspect = false;
|
||||
else
|
||||
#endif
|
||||
|
||||
/* Apparently need to set viewport for passes
|
||||
* when we aren't using FBOs. */
|
||||
gl2_set_shader_viewports(gl);
|
||||
@@ -3985,6 +3996,11 @@ static void gl2_update_tex_filter_frame(gl_t *gl)
|
||||
bool smooth = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool video_smooth = settings->bools.video_smooth;
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
bool video_ctx_scaling = settings->bools.video_ctx_scaling;
|
||||
if (video_ctx_scaling)
|
||||
video_smooth = false;
|
||||
#endif
|
||||
|
||||
gl2_context_bind_hw_render(gl, false);
|
||||
|
||||
@@ -4345,6 +4361,10 @@ static void gl2_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
return;
|
||||
|
||||
gl->keep_aspect = true;
|
||||
#if defined(HAVE_ODROIDGO2)
|
||||
if (config_get_ptr()->bools.video_ctx_scaling)
|
||||
gl->keep_aspect = false;
|
||||
#endif
|
||||
gl->should_resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1600,7 +1600,7 @@ static void wiiu_gfx_unload_texture(void *data, uintptr_t handle)
|
||||
MEM2_free(texture->surface.image);
|
||||
free(texture);
|
||||
}
|
||||
static void wiiu_gfx_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void wiiu_gfx_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
wiiu_video_t *wiiu = (wiiu_video_t *) data;
|
||||
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ static float metal_get_refresh_rate(void *data)
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
static void metal_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void metal_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
MetalDriver *md = (__bridge MetalDriver *)data;
|
||||
[md.frameView setFilteringIndex:index smooth:smooth];
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2011-2017 - Higor Euripedes
|
||||
*
|
||||
* 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 <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gfx/video_frame.h>
|
||||
#include <retro_assert.h>
|
||||
#include "../../verbosity.h"
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
|
||||
#include "frontend/frontend_driver.h"
|
||||
|
||||
#include "../font_driver.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
#endif
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#include <go2/display.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
|
||||
#define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1))
|
||||
|
||||
#define NATIVE_WIDTH 480
|
||||
#define NATIVE_HEIGHT 320
|
||||
|
||||
#define NUM_PAGES 2
|
||||
|
||||
typedef struct oga_video
|
||||
{
|
||||
go2_presenter_t* presenter;
|
||||
go2_display_t* display;
|
||||
go2_surface_t* frame;
|
||||
|
||||
go2_frame_buffer_t* frameBuffer[NUM_PAGES];
|
||||
int cur_page;
|
||||
|
||||
const font_renderer_driver_t *font_driver;
|
||||
void *font;
|
||||
|
||||
go2_surface_t* menu_surface;
|
||||
const void* menu_frame;
|
||||
unsigned menu_width;
|
||||
unsigned menu_height;
|
||||
unsigned menu_pitch;
|
||||
} oga_video_t;
|
||||
|
||||
go2_rotation_t oga_rotation = GO2_ROTATION_DEGREES_0;
|
||||
|
||||
static void oga_gfx_free(void *data)
|
||||
{
|
||||
oga_video_t *vid = (oga_video_t*)data;
|
||||
if (!vid)
|
||||
return;
|
||||
|
||||
if (vid->font) {
|
||||
vid->font_driver->free(vid->font);
|
||||
vid->font_driver = NULL;
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_PAGES; ++i)
|
||||
{
|
||||
go2_frame_buffer_t* frameBuffer = vid->frameBuffer[i];
|
||||
go2_surface_t* surface = go2_frame_buffer_surface_get(frameBuffer);
|
||||
|
||||
go2_frame_buffer_destroy(frameBuffer);
|
||||
go2_surface_destroy(surface);
|
||||
}
|
||||
|
||||
go2_surface_destroy(vid->frame);
|
||||
go2_surface_destroy(vid->menu_surface);
|
||||
go2_presenter_destroy(vid->presenter);
|
||||
go2_display_destroy(vid->display);
|
||||
|
||||
free(vid);
|
||||
vid = NULL;
|
||||
}
|
||||
|
||||
static void *oga_gfx_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
oga_video_t *vid = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
|
||||
|
||||
frontend_driver_install_signal_handler();
|
||||
|
||||
if (input && input_data) {
|
||||
void* udev = input_udev.init(settings->arrays.input_joypad_driver);
|
||||
if (udev) {
|
||||
*input = &input_udev;
|
||||
*input_data = udev;
|
||||
}
|
||||
else
|
||||
*input = NULL;
|
||||
}
|
||||
|
||||
vid = (oga_video_t*)calloc(1, sizeof(*vid));
|
||||
|
||||
vid->menu_frame = NULL;
|
||||
vid->display = go2_display_create();
|
||||
vid->presenter = go2_presenter_create(vid->display, DRM_FORMAT_RGB565, 0xff000000, false);
|
||||
vid->menu_surface = go2_surface_create(vid->display, NATIVE_WIDTH, NATIVE_HEIGHT, DRM_FORMAT_RGB565);
|
||||
vid->font = NULL;
|
||||
vid->font_driver = NULL;
|
||||
|
||||
int aw = MAX(ALIGN(av_info->geometry.max_width, 32), NATIVE_WIDTH);
|
||||
int ah = MAX(ALIGN(av_info->geometry.max_height, 32), NATIVE_HEIGHT);
|
||||
|
||||
printf("oga_gfx_init video %dx%d rgb32 %d smooth %d input_scale %u force_aspect %d fullscreen %d aw %d ah %d rgb %d\n",
|
||||
video->width, video->height, video->rgb32, video->smooth, video->input_scale, video->force_aspect,
|
||||
video->fullscreen, aw, ah, video->rgb32);
|
||||
|
||||
vid->frame = go2_surface_create(vid->display, aw, ah, video->rgb32 ? DRM_FORMAT_XRGB8888 : DRM_FORMAT_RGB565);
|
||||
|
||||
// bitmap only for now
|
||||
if (settings->bools.video_font_enable) {
|
||||
vid->font_driver = &bitmap_font_renderer;
|
||||
vid->font = vid->font_driver->init("", settings->floats.video_font_size);
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_PAGES; ++i)
|
||||
{
|
||||
go2_surface_t* surface = go2_surface_create(vid->display, NATIVE_HEIGHT, NATIVE_WIDTH,
|
||||
video->rgb32 ? DRM_FORMAT_XRGB8888 : DRM_FORMAT_XRGB8888);
|
||||
vid->frameBuffer[i] = go2_frame_buffer_create(surface);
|
||||
}
|
||||
vid->cur_page = 0;
|
||||
|
||||
return vid;
|
||||
}
|
||||
|
||||
int get_message_width(oga_video_t* vid, const char* msg)
|
||||
{
|
||||
int width = 0;
|
||||
for (const char* c = msg; *c; c++)
|
||||
{
|
||||
const struct font_glyph* glyph = vid->font_driver->get_glyph(vid->font, *c);
|
||||
if (unlikely(!glyph))
|
||||
continue;
|
||||
|
||||
width += glyph->advance_x;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
static void render_msg(oga_video_t* vid, go2_surface_t* surface, const char* msg, int width, int bpp)
|
||||
{
|
||||
const struct font_atlas* atlas = vid->font_driver->get_atlas(vid->font);
|
||||
int msg_width = get_message_width(vid, msg);
|
||||
int dest_x = MAX(0, width - get_message_width(vid, msg));
|
||||
|
||||
const char* c = msg;
|
||||
while (*c) {
|
||||
const struct font_glyph* g = vid->font_driver->get_glyph(vid->font, *c);
|
||||
if (!g)
|
||||
continue;
|
||||
if (dest_x + g->advance_x >= width)
|
||||
break;
|
||||
|
||||
const uint8_t* source = atlas->buffer + g->atlas_offset_y * atlas->width + g->atlas_offset_x;
|
||||
uint8_t* dest = (uint8_t*)go2_surface_map(surface) + dest_x * bpp;
|
||||
|
||||
for (int y = 0; y < g->height; y++) {
|
||||
for (int x = 0; x < g->advance_x; x++) {
|
||||
uint8_t px = (x < g->width) ? *(source++) : 0x00;
|
||||
if (bpp == 4) {
|
||||
*(dest++) = px;
|
||||
*(dest++) = px;
|
||||
*(dest++) = px;
|
||||
*(dest++) = px;
|
||||
}
|
||||
else {
|
||||
*(dest++) = px;
|
||||
*(dest++) = px;
|
||||
}
|
||||
}
|
||||
dest += go2_surface_stride_get(surface) - g->advance_x * bpp;
|
||||
source += atlas->width - g->width;
|
||||
}
|
||||
|
||||
c++;
|
||||
dest_x += g->advance_x;
|
||||
}
|
||||
}
|
||||
|
||||
static bool oga_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)
|
||||
{
|
||||
oga_video_t* vid = (oga_video_t*)data;
|
||||
go2_surface_t* dst_surface = vid->frame;
|
||||
uint8_t* src = (uint8_t*)frame;
|
||||
int bpp = go2_drm_format_get_bpp(go2_surface_format_get(dst_surface)) / 8;
|
||||
|
||||
if (unlikely(video_info->menu_is_alive)) {
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_frame(video_info);
|
||||
#endif
|
||||
dst_surface = vid->menu_surface;
|
||||
src = (uint8_t*)vid->menu_frame;
|
||||
width = vid->menu_width;
|
||||
height = vid->menu_height;
|
||||
pitch = vid->menu_pitch;
|
||||
bpp = vid->menu_pitch / vid->menu_width;
|
||||
}
|
||||
|
||||
if (unlikely(!frame || width == 0 || height == 0))
|
||||
return true;
|
||||
|
||||
// copy buffer to surface
|
||||
uint8_t* dst = (uint8_t*)go2_surface_map(dst_surface);
|
||||
int yy = height;
|
||||
int stride = width * bpp;
|
||||
while (yy > 0) {
|
||||
memcpy(dst, src, stride);
|
||||
src += pitch;
|
||||
dst += go2_surface_stride_get(dst_surface);
|
||||
--yy;
|
||||
}
|
||||
|
||||
int out_w = NATIVE_WIDTH;
|
||||
int out_h = NATIVE_HEIGHT;
|
||||
int out_x = 0;
|
||||
int out_y = 0;
|
||||
|
||||
if ((out_w != width || out_h != height))
|
||||
{
|
||||
out_w = MIN(out_h * video_driver_get_aspect_ratio(), NATIVE_WIDTH);
|
||||
out_x = MAX((NATIVE_WIDTH - out_w) / 2, 0);
|
||||
}
|
||||
|
||||
if (msg && vid->font) {
|
||||
render_msg(vid, dst_surface, msg, width, bpp);
|
||||
}
|
||||
|
||||
go2_frame_buffer_t* dstFrameBuffer = vid->frameBuffer[vid->cur_page];
|
||||
go2_surface_t* dstSurface = go2_frame_buffer_surface_get(dstFrameBuffer);
|
||||
|
||||
go2_surface_blit(dst_surface, 0, 0, width, height,
|
||||
dstSurface, out_y, out_x, out_h, out_w,
|
||||
!video_info->menu_is_alive ? oga_rotation : GO2_ROTATION_DEGREES_270, 2);
|
||||
|
||||
go2_display_t* display = go2_presenter_display_get(vid->presenter);
|
||||
go2_display_present(display, dstFrameBuffer);
|
||||
vid->cur_page = !vid->cur_page;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void oga_set_texture_frame(void *data, const void *frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
oga_video_t *vid = (oga_video_t*)data;
|
||||
|
||||
vid->menu_width = width;
|
||||
vid->menu_height = height;
|
||||
vid->menu_pitch = width * (rgb32 ? 4 : 2);
|
||||
|
||||
if (unlikely(!vid->menu_frame))
|
||||
vid->menu_frame = frame;
|
||||
}
|
||||
|
||||
static void oga_gfx_set_nonblock_state(void *a, bool b, bool c, unsigned d)
|
||||
{
|
||||
}
|
||||
|
||||
static bool oga_gfx_alive(void *data)
|
||||
{
|
||||
return !frontend_driver_get_signal_handler_state();
|
||||
}
|
||||
|
||||
static bool oga_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool oga_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool oga_gfx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void oga_gfx_viewport_info(void *data, struct video_viewport *vp)
|
||||
{
|
||||
oga_video_t *vid = (oga_video_t*)data;
|
||||
vp->x = 0;
|
||||
vp->y = 0;
|
||||
vp->width = vp->full_width = NATIVE_WIDTH;
|
||||
vp->height = vp->full_height = NATIVE_HEIGHT;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t oga_poke_interface = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
oga_set_texture_frame,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
void oga_set_rotation(void *data, unsigned rotation)
|
||||
{
|
||||
// called before init?
|
||||
(void)data;
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
oga_rotation = GO2_ROTATION_DEGREES_270;
|
||||
break;
|
||||
case 1:
|
||||
oga_rotation = GO2_ROTATION_DEGREES_180;
|
||||
break;
|
||||
case 2:
|
||||
oga_rotation = GO2_ROTATION_DEGREES_90;
|
||||
break;
|
||||
case 3:
|
||||
oga_rotation = GO2_ROTATION_DEGREES_0;
|
||||
break;
|
||||
default:
|
||||
RARCH_ERR("Unhandled rotation %hu\n", rotation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void oga_get_poke_interface(void *data, const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &oga_poke_interface;
|
||||
}
|
||||
|
||||
video_driver_t video_oga = {
|
||||
oga_gfx_init,
|
||||
oga_gfx_frame,
|
||||
oga_gfx_set_nonblock_state,
|
||||
oga_gfx_alive,
|
||||
oga_gfx_focus,
|
||||
oga_gfx_suppress_screensaver,
|
||||
oga_gfx_has_windowed,
|
||||
NULL,
|
||||
oga_gfx_free,
|
||||
"oga",
|
||||
NULL,
|
||||
oga_set_rotation,
|
||||
oga_gfx_viewport_info,
|
||||
NULL,
|
||||
NULL,
|
||||
#ifdef HAVE_OVERLAY
|
||||
NULL,
|
||||
#endif
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
NULL,
|
||||
#endif
|
||||
oga_get_poke_interface
|
||||
};
|
||||
@@ -400,7 +400,7 @@ static void ps2_gfx_free(void *data)
|
||||
static bool ps2_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path) { return false; }
|
||||
|
||||
static void ps2_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void ps2_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ static void psp_set_rotation(void *data, unsigned rotation)
|
||||
psp->rotation = rotation;
|
||||
psp->should_resize = true;
|
||||
}
|
||||
static void psp_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void psp_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
psp1_video_t *psp = (psp1_video_t*)data;
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ static bool sdl2_gfx_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void sdl2_poke_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void sdl2_poke_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
sdl2_video_t *vid = (sdl2_video_t*)data;
|
||||
vid->video.smooth = smooth;
|
||||
|
||||
@@ -272,7 +272,7 @@ static void sdl_dingux_gfx_viewport_info(void *data, struct video_viewport *vp)
|
||||
vp->height = vp->full_height = vid->screen->h;
|
||||
}
|
||||
|
||||
static void sdl_dingux_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void sdl_dingux_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ static void sdl_gfx_viewport_info(void *data, struct video_viewport *vp)
|
||||
vp->height = vp->full_height = vid->screen->h;
|
||||
}
|
||||
|
||||
static void sdl_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void sdl_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
sdl_video_t *vid = (sdl_video_t*)data;
|
||||
vid->scaler.scaler_type = smooth ? SCALER_TYPE_BILINEAR : SCALER_TYPE_POINT;
|
||||
|
||||
@@ -579,7 +579,7 @@ static void vita2d_gfx_viewport_info(void *data,
|
||||
*vp = vita->vp;
|
||||
}
|
||||
|
||||
static void vita_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void vita_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
vita_video_t *vita = (vita_video_t *)data;
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ static void xshm_gfx_free(void *data)
|
||||
|
||||
}
|
||||
|
||||
static void xshm_poke_set_filtering(void *data, unsigned index, bool smooth)
|
||||
static void xshm_poke_set_filtering(void *data, unsigned index, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+32
-135
@@ -42,11 +42,6 @@
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
#include "../common/drm_common.h"
|
||||
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
#include <go2/display.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
#include "../common/egl_common.h"
|
||||
#endif
|
||||
@@ -73,27 +68,19 @@
|
||||
|
||||
static enum gfx_ctx_api drm_api = GFX_CTX_NONE;
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
static struct gbm_bo *g_bo = NULL;
|
||||
static struct gbm_bo *g_next_bo = NULL;
|
||||
static struct gbm_surface *g_gbm_surface = NULL;
|
||||
static struct gbm_device *g_gbm_dev = NULL;
|
||||
|
||||
static bool waiting_for_flip = false;
|
||||
#endif
|
||||
|
||||
typedef struct gfx_ctx_drm_data
|
||||
{
|
||||
#ifdef HAVE_EGL
|
||||
egl_ctx_data_t egl;
|
||||
#endif
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
int fd;
|
||||
#else
|
||||
go2_display_t* display;
|
||||
go2_presenter_t* presenter;
|
||||
go2_context_t* context;
|
||||
#endif
|
||||
int interval;
|
||||
unsigned fb_width;
|
||||
unsigned fb_height;
|
||||
@@ -101,7 +88,6 @@ typedef struct gfx_ctx_drm_data
|
||||
bool core_hw_context_enable;
|
||||
} gfx_ctx_drm_data_t;
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
struct drm_fb
|
||||
{
|
||||
struct gbm_bo *bo;
|
||||
@@ -148,6 +134,26 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_swap_interval(void *data, int interval)
|
||||
{
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
drm->interval = interval;
|
||||
|
||||
if (interval > 1)
|
||||
RARCH_WARN("[KMS]: Swap intervals > 1 currently not supported. Will use swap interval of 1.\n");
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
{
|
||||
(void)data;
|
||||
(void)width;
|
||||
(void)height;
|
||||
|
||||
*resize = false;
|
||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||
}
|
||||
|
||||
static void drm_flip_handler(int fd, unsigned frame,
|
||||
unsigned sec, unsigned usec, void *data)
|
||||
{
|
||||
@@ -222,56 +228,7 @@ static bool gfx_ctx_drm_queue_flip(void)
|
||||
/* Failed to queue page flip. */
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gfx_ctx_drm_swap_interval(void *data, int interval)
|
||||
{
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
drm->interval = interval;
|
||||
|
||||
if (interval > 1)
|
||||
RARCH_WARN("[KMS]: Swap intervals > 1 currently not supported. Will use swap interval of 1.\n");
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
{
|
||||
(void)data;
|
||||
(void)width;
|
||||
(void)height;
|
||||
|
||||
*resize = false;
|
||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||
}
|
||||
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
static void gfx_ctx_drm_swap_buffers(void *data)
|
||||
{
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
|
||||
switch (drm_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
case GFX_CTX_OPENVG_API:
|
||||
#ifdef HAVE_EGL
|
||||
go2_context_swap_buffers(drm->context);
|
||||
|
||||
go2_surface_t* surface = go2_context_surface_lock(drm->context);
|
||||
go2_presenter_post(drm->presenter,
|
||||
surface,
|
||||
0, 0, 480, 320,
|
||||
0, 0, 320, 480,
|
||||
GO2_ROTATION_DEGREES_270);
|
||||
go2_context_surface_unlock(drm->context, surface);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
printf("unhandled gfx_ctx_drm_swap_buffers\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void gfx_ctx_drm_swap_buffers(void *data)
|
||||
{
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
@@ -309,6 +266,18 @@ static void gfx_ctx_drm_swap_buffers(void *data)
|
||||
gfx_ctx_drm_wait_flip(true);
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
|
||||
if (!drm)
|
||||
return;
|
||||
|
||||
*width = drm->fb_width;
|
||||
*height = drm->fb_height;
|
||||
}
|
||||
|
||||
static void free_drm_resources(gfx_ctx_drm_data_t *drm)
|
||||
{
|
||||
if (!drm)
|
||||
@@ -338,21 +307,7 @@ static void free_drm_resources(gfx_ctx_drm_data_t *drm)
|
||||
g_gbm_dev = NULL;
|
||||
g_drm_fd = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gfx_ctx_drm_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
|
||||
if (!drm)
|
||||
return;
|
||||
|
||||
*width = drm->fb_width;
|
||||
*height = drm->fb_height;
|
||||
}
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
static void gfx_ctx_drm_destroy_resources(gfx_ctx_drm_data_t *drm)
|
||||
{
|
||||
if (!drm)
|
||||
@@ -387,17 +342,14 @@ static void gfx_ctx_drm_destroy_resources(gfx_ctx_drm_data_t *drm)
|
||||
g_bo = NULL;
|
||||
g_next_bo = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void *gfx_ctx_drm_init(void *video_driver)
|
||||
{
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
int fd, i;
|
||||
unsigned monitor_index;
|
||||
unsigned gpu_index = 0;
|
||||
const char *gpu = NULL;
|
||||
struct string_list *gpu_descriptors = NULL;
|
||||
#endif
|
||||
settings_t *settings = config_get_ptr();
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)
|
||||
calloc(1, sizeof(gfx_ctx_drm_data_t));
|
||||
@@ -405,8 +357,6 @@ static void *gfx_ctx_drm_init(void *video_driver)
|
||||
|
||||
if (!drm)
|
||||
return NULL;
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
drm->fd = -1;
|
||||
|
||||
gpu_descriptors = dir_list_new("/dev/dri", NULL, false, true, false, false);
|
||||
@@ -486,14 +436,8 @@ error:
|
||||
free(drm);
|
||||
|
||||
return NULL;
|
||||
#else
|
||||
drm->display = go2_display_create();
|
||||
drm->presenter = go2_presenter_create(drm->display, DRM_FORMAT_RGB565, 0xff080808);
|
||||
return drm;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
static EGLint *gfx_ctx_drm_egl_fill_attribs(
|
||||
gfx_ctx_drm_data_t *drm, EGLint *attr)
|
||||
{
|
||||
@@ -562,9 +506,7 @@ static EGLint *gfx_ctx_drm_egl_fill_attribs(
|
||||
*attr = EGL_NONE;
|
||||
return attr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
#ifdef HAVE_EGL
|
||||
static bool gbm_choose_xrgb8888_cb(void *display_data, EGLDisplay dpy, EGLConfig config)
|
||||
{
|
||||
@@ -587,8 +529,6 @@ static bool gbm_choose_xrgb8888_cb(void *display_data, EGLDisplay dpy, EGLConfig
|
||||
|
||||
return id == GBM_FORMAT_XRGB8888;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DRM_EGL_ATTRIBS_BASE \
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT, \
|
||||
@@ -598,7 +538,6 @@ static bool gbm_choose_xrgb8888_cb(void *display_data, EGLDisplay dpy, EGLConfig
|
||||
EGL_ALPHA_SIZE, 0, \
|
||||
EGL_DEPTH_SIZE, 0
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
static bool gfx_ctx_drm_egl_set_video_mode(gfx_ctx_drm_data_t *drm)
|
||||
{
|
||||
const EGLint *attrib_ptr = NULL;
|
||||
@@ -705,11 +644,9 @@ static bool gfx_ctx_drm_set_video_mode(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool fullscreen)
|
||||
{
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
float refresh_mod;
|
||||
int i, ret = 0;
|
||||
struct drm_fb *fb = NULL;
|
||||
#endif
|
||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool black_frame_insertion = settings->bools.video_black_frame_insertion;
|
||||
@@ -720,7 +657,6 @@ static bool gfx_ctx_drm_set_video_mode(void *data,
|
||||
|
||||
frontend_driver_install_signal_handler();
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
/* If we use black frame insertion,
|
||||
* we fake a 60 Hz monitor for 120 Hz one,
|
||||
* etc, so try to match that. */
|
||||
@@ -777,13 +713,7 @@ static bool gfx_ctx_drm_set_video_mode(void *data,
|
||||
drm->fb_height,
|
||||
GBM_FORMAT_XRGB8888,
|
||||
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
|
||||
#else
|
||||
/* Hardcoded odroidgo2 display resolution */
|
||||
drm->fb_width = 480;
|
||||
drm->fb_height = 320;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
if (!g_gbm_surface)
|
||||
{
|
||||
RARCH_ERR("[KMS/EGL]: Couldn't create GBM surface.\n");
|
||||
@@ -826,25 +756,6 @@ error:
|
||||
free(drm);
|
||||
|
||||
return false;
|
||||
#else
|
||||
go2_context_attributes_t attr;
|
||||
attr.major = 3;
|
||||
attr.minor = 2;
|
||||
attr.red_bits = 8;
|
||||
attr.green_bits = 8;
|
||||
attr.blue_bits = 8;
|
||||
attr.alpha_bits = 8;
|
||||
attr.depth_bits = 0;
|
||||
attr.stencil_bits = 0;
|
||||
|
||||
/* Hardcoded odroidgo2 display resolution */
|
||||
drm->context = go2_context_create(drm->display, 480, 320, &attr);
|
||||
go2_context_make_current(drm->context);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_destroy(void *data)
|
||||
@@ -854,22 +765,8 @@ static void gfx_ctx_drm_destroy(void *data)
|
||||
if (!drm)
|
||||
return;
|
||||
|
||||
#ifndef HAVE_ODROIDGO2
|
||||
gfx_ctx_drm_destroy_resources(drm);
|
||||
free(drm);
|
||||
#else
|
||||
if (drm->context)
|
||||
{
|
||||
go2_context_destroy(drm->context);
|
||||
drm->context = NULL;
|
||||
}
|
||||
|
||||
go2_presenter_destroy(drm->presenter);
|
||||
drm->presenter = NULL;
|
||||
|
||||
go2_display_destroy(drm->display);
|
||||
drm->display = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_input_driver(void *data,
|
||||
|
||||
@@ -0,0 +1,447 @@
|
||||
/* 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/>.
|
||||
*/
|
||||
|
||||
/* KMS/DRM context, running without any window manager.
|
||||
* Based on kmscube example by Rob Clark.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <sched.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include <libdrm/drm.h>
|
||||
#include <gbm.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
#include "../common/drm_common.h"
|
||||
|
||||
#include <go2/display.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
#include "../common/egl_common.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
#include "../common/gl_common.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
|
||||
#ifndef EGL_OPENGL_ES3_BIT_KHR
|
||||
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef EGL_PLATFORM_GBM_KHR
|
||||
#define EGL_PLATFORM_GBM_KHR 0x31D7
|
||||
#endif
|
||||
|
||||
static enum gfx_ctx_api drm_api = GFX_CTX_NONE;
|
||||
|
||||
typedef struct gfx_ctx_go2_drm_data
|
||||
{
|
||||
#ifdef HAVE_EGL
|
||||
egl_ctx_data_t egl;
|
||||
#endif
|
||||
go2_display_t* display;
|
||||
go2_presenter_t* presenter;
|
||||
go2_context_t* context;
|
||||
unsigned fb_width;
|
||||
unsigned fb_height;
|
||||
unsigned ctx_w;
|
||||
unsigned ctx_h;
|
||||
bool core_hw_context_enable;
|
||||
} gfx_ctx_go2_drm_data_t;
|
||||
|
||||
static unsigned native_width = 480;
|
||||
static unsigned native_height = 320;
|
||||
|
||||
static void gfx_ctx_go2_drm_input_driver(void *data,
|
||||
const char *joypad_name,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
#ifdef HAVE_UDEV
|
||||
/* Try to set it to udev instead */
|
||||
void *udev = input_udev.init(joypad_name);
|
||||
if (udev)
|
||||
{
|
||||
*input = &input_udev;
|
||||
*input_data = udev;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
*input = NULL;
|
||||
*input_data = NULL;
|
||||
}
|
||||
|
||||
static gfx_ctx_proc_t gfx_ctx_go2_drm_get_proc_address(const char *symbol)
|
||||
{
|
||||
switch (drm_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
case GFX_CTX_OPENVG_API:
|
||||
#ifdef HAVE_EGL
|
||||
return egl_get_proc_address(symbol);
|
||||
#endif
|
||||
case GFX_CTX_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *gfx_ctx_go2_drm_init(void *video_driver)
|
||||
{
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)
|
||||
calloc(1, sizeof(gfx_ctx_go2_drm_data_t));
|
||||
|
||||
if (!drm)
|
||||
return NULL;
|
||||
|
||||
drm->display = go2_display_create();
|
||||
drm->presenter = go2_presenter_create(drm->display, DRM_FORMAT_RGB565, 0xff000000, true);
|
||||
|
||||
return drm;
|
||||
}
|
||||
|
||||
static void gfx_ctx_go2_drm_destroy(void *data)
|
||||
{
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
if (!drm) return;
|
||||
|
||||
if (drm->context)
|
||||
{
|
||||
go2_context_destroy(drm->context);
|
||||
drm->context = NULL;
|
||||
}
|
||||
|
||||
go2_presenter_destroy(drm->presenter);
|
||||
drm->presenter = NULL;
|
||||
|
||||
go2_display_destroy(drm->display);
|
||||
drm->display = NULL;
|
||||
}
|
||||
|
||||
static enum gfx_ctx_api gfx_ctx_go2_drm_get_api(void *data)
|
||||
{
|
||||
return drm_api;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_go2_drm_bind_api(void *video_driver,
|
||||
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||
{
|
||||
(void)video_driver;
|
||||
|
||||
drm_api = api;
|
||||
#ifdef HAVE_EGL
|
||||
g_egl_major = major;
|
||||
g_egl_minor = minor;
|
||||
#endif
|
||||
|
||||
switch (api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
#if defined(HAVE_EGL) && defined(HAVE_OPENGL)
|
||||
|
||||
#ifndef EGL_KHR_create_context
|
||||
if ((major * 1000 + minor) >= 3001)
|
||||
return false;
|
||||
#endif
|
||||
return egl_bind_api(EGL_OPENGL_API);
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
#if defined(HAVE_EGL) && defined(HAVE_OPENGLES)
|
||||
|
||||
#ifndef EGL_KHR_create_context
|
||||
if (major >= 3)
|
||||
return false;
|
||||
#endif
|
||||
return egl_bind_api(EGL_OPENGL_ES_API);
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
case GFX_CTX_OPENVG_API:
|
||||
#if defined(HAVE_EGL) && defined(HAVE_VG)
|
||||
return egl_bind_api(EGL_OPENVG_API);
|
||||
#endif
|
||||
case GFX_CTX_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gfx_ctx_go2_drm_swap_interval(void *data, int interval)
|
||||
{
|
||||
(void)data;
|
||||
(void)interval;
|
||||
|
||||
if (interval > 1)
|
||||
RARCH_WARN("[KMS]: Swap intervals > 1 currently not supported. Will use swap interval of 1.\n");
|
||||
}
|
||||
|
||||
static bool gfx_ctx_go2_drm_set_video_mode(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool fullscreen)
|
||||
{
|
||||
struct retro_system_av_info *av_info = NULL;
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
|
||||
if (!drm)
|
||||
return false;
|
||||
|
||||
av_info = video_viewport_get_system_av_info();
|
||||
|
||||
frontend_driver_install_signal_handler();
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool use_ctx_scaling = settings->bools.video_ctx_scaling;
|
||||
|
||||
if (use_ctx_scaling && !menu_driver_is_alive())
|
||||
{
|
||||
drm->fb_width = av_info->geometry.base_width;
|
||||
drm->fb_height = av_info->geometry.base_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
drm->fb_width = native_width;
|
||||
drm->fb_height = native_height;
|
||||
}
|
||||
|
||||
if (!drm->context)
|
||||
{
|
||||
go2_context_attributes_t attr;
|
||||
attr.major = 3;
|
||||
attr.minor = 2;
|
||||
attr.red_bits = 8;
|
||||
attr.green_bits = 8;
|
||||
attr.blue_bits = 8;
|
||||
attr.alpha_bits = 8;
|
||||
attr.depth_bits = 0;
|
||||
attr.stencil_bits = 0;
|
||||
|
||||
drm->ctx_w = MAX(av_info->geometry.max_width, native_width);
|
||||
drm->ctx_h = MAX(av_info->geometry.max_height, native_height);
|
||||
|
||||
drm->context = go2_context_create(drm->display, drm->ctx_w, drm->ctx_h, &attr);
|
||||
}
|
||||
|
||||
go2_context_make_current(drm->context);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gfx_ctx_go2_drm_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
{
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
struct retro_system_av_info* av_info = video_viewport_get_system_av_info();
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool use_ctx_scaling = settings->bools.video_ctx_scaling;
|
||||
|
||||
unsigned w;
|
||||
unsigned h;
|
||||
|
||||
if (use_ctx_scaling && !menu_driver_is_alive())
|
||||
{
|
||||
w = av_info->geometry.base_width;
|
||||
h = av_info->geometry.base_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = native_width;
|
||||
h = native_height;
|
||||
}
|
||||
|
||||
if (*width != w || *height != h)
|
||||
{
|
||||
*width = drm->fb_width = w;
|
||||
*height = drm->fb_height = h;
|
||||
*resize = false;
|
||||
}
|
||||
|
||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||
}
|
||||
|
||||
static bool gfx_ctx_go2_drm_has_focus(void *data)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_go2_drm_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
int ss = 0;
|
||||
|
||||
void (*swap_buffers)(void*);
|
||||
static void gfx_ctx_go2_drm_swap_buffers(void *data)
|
||||
{
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
|
||||
int out_w = native_width;
|
||||
int out_h = native_height;
|
||||
int out_x = 0;
|
||||
int out_y = 0;
|
||||
|
||||
int src_w = drm->fb_width;
|
||||
int src_h = drm->fb_height;
|
||||
int src_x = 0;
|
||||
int src_y = drm->ctx_h - drm->fb_height;
|
||||
|
||||
if (out_w != src_w || out_h != src_h)
|
||||
{
|
||||
out_w = out_h * video_driver_get_aspect_ratio();
|
||||
out_w = (out_w > 480) ? 480 : out_w;
|
||||
out_x = (480 - out_w) / 2;
|
||||
if (out_x < 0)
|
||||
out_x = 0;
|
||||
}
|
||||
|
||||
switch (drm_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
case GFX_CTX_OPENVG_API:
|
||||
#ifdef HAVE_EGL
|
||||
go2_context_swap_buffers(drm->context);
|
||||
|
||||
go2_surface_t* surface = go2_context_surface_lock(drm->context);
|
||||
go2_presenter_post(drm->presenter,
|
||||
surface,
|
||||
src_x, src_y, src_w, src_h,
|
||||
out_y, out_x, out_h, out_w,
|
||||
GO2_ROTATION_DEGREES_270, 2);
|
||||
go2_context_surface_unlock(drm->context, surface);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
printf("unhandled gfx_ctx_go2_drm_swap_buffers\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t gfx_ctx_go2_drm_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES);
|
||||
|
||||
if (drm->core_hw_context_enable)
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
|
||||
|
||||
if (string_is_equal(video_driver_get_ident(), "glcore"))
|
||||
{
|
||||
#if defined(HAVE_SLANG) && defined(HAVE_SPIRV_CROSS)
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_SLANG);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_GLSL);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static void gfx_ctx_go2_drm_set_flags(void *data, uint32_t flags)
|
||||
{
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
if (BIT32_GET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT))
|
||||
drm->core_hw_context_enable = true;
|
||||
}
|
||||
|
||||
static void gfx_ctx_go2_drm_bind_hw_render(void *data, bool enable)
|
||||
{
|
||||
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)data;
|
||||
|
||||
switch (drm_api)
|
||||
{
|
||||
case GFX_CTX_OPENGL_API:
|
||||
case GFX_CTX_OPENGL_ES_API:
|
||||
case GFX_CTX_OPENVG_API:
|
||||
#ifdef HAVE_EGL
|
||||
egl_bind_hw_render(&drm->egl, enable);
|
||||
#endif
|
||||
break;
|
||||
case GFX_CTX_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const gfx_ctx_driver_t gfx_ctx_go2_drm = {
|
||||
gfx_ctx_go2_drm_init,
|
||||
gfx_ctx_go2_drm_destroy,
|
||||
gfx_ctx_go2_drm_get_api,
|
||||
gfx_ctx_go2_drm_bind_api,
|
||||
gfx_ctx_go2_drm_swap_interval,
|
||||
gfx_ctx_go2_drm_set_video_mode,
|
||||
NULL, /* get_video_size */
|
||||
drm_get_refresh_rate,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_metrics */
|
||||
NULL,
|
||||
NULL, /* update_title */
|
||||
gfx_ctx_go2_drm_check_window,
|
||||
NULL, /* set_resize */
|
||||
gfx_ctx_go2_drm_has_focus,
|
||||
gfx_ctx_go2_drm_suppress_screensaver,
|
||||
false, /* has_windowed */
|
||||
gfx_ctx_go2_drm_swap_buffers,
|
||||
gfx_ctx_go2_drm_input_driver,
|
||||
gfx_ctx_go2_drm_get_proc_address,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"kms",
|
||||
gfx_ctx_go2_drm_get_flags,
|
||||
gfx_ctx_go2_drm_set_flags,
|
||||
gfx_ctx_go2_drm_bind_hw_render,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
@@ -20,9 +20,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
#include <sys/spu_initialize.h>
|
||||
#endif
|
||||
|
||||
#include <compat/strl.h>
|
||||
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
|
||||
#include "../gfx_display.h"
|
||||
|
||||
#ifdef VITA
|
||||
static float *vertices3 = NULL;
|
||||
#endif
|
||||
|
||||
static const GLfloat gl1_menu_vertexes[] = {
|
||||
0, 0,
|
||||
1, 0,
|
||||
@@ -140,16 +136,21 @@ static void gfx_display_gl1_draw(gfx_display_ctx_draw_t *draw,
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
#ifdef VITA
|
||||
if (vertices3)
|
||||
free(vertices3);
|
||||
vertices3 = (float*)malloc(sizeof(float) * 3 * draw->coords->vertices);
|
||||
int i;
|
||||
for (i = 0; i < draw->coords->vertices; i++) {
|
||||
memcpy(&vertices3[i*3], &draw->coords->vertex[i*2], sizeof(float) * 2);
|
||||
vertices3[i*3] -= 0.5f;
|
||||
vertices3[i*3+2] = 0.0f;
|
||||
{
|
||||
unsigned i;
|
||||
static float *vertices3 = NULL;
|
||||
|
||||
if (vertices3)
|
||||
free(vertices3);
|
||||
vertices3 = (float*)malloc(sizeof(float) * 3 * draw->coords->vertices);
|
||||
for (i = 0; i < draw->coords->vertices; i++)
|
||||
{
|
||||
memcpy(&vertices3[i*3], &draw->coords->vertex[i*2], sizeof(float) * 2);
|
||||
vertices3[i*3] -= 0.5f;
|
||||
vertices3[i*3+2] = 0.0f;
|
||||
}
|
||||
glVertexPointer(3, GL_FLOAT, 0, vertices3);
|
||||
}
|
||||
glVertexPointer(3, GL_FLOAT, 0, vertices3);
|
||||
#else
|
||||
glVertexPointer(2, GL_FLOAT, 0, draw->coords->vertex);
|
||||
#endif
|
||||
|
||||
@@ -143,5 +143,6 @@ font_renderer_t caca_font = {
|
||||
caca_font_get_glyph, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
caca_get_message_width /* get_message_width */
|
||||
caca_get_message_width, /* get_message_width */
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -312,14 +312,16 @@ static void ctr_font_render_message(
|
||||
const unsigned int color, float pos_x, float pos_y,
|
||||
unsigned width, unsigned height, unsigned text_align)
|
||||
{
|
||||
int lines = 0;
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
ctr_font_render_line(ctr, font, msg, strlen(msg),
|
||||
scale, color, pos_x, pos_y,
|
||||
@@ -327,7 +329,7 @@ static void ctr_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = scale / font->font_driver->get_line_height(font->font_data);
|
||||
line_height = scale / line_metrics->height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -454,14 +456,14 @@ static const struct font_glyph* ctr_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int ctr_font_get_line_height(void *data)
|
||||
static bool ctr_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
ctr_font_t* font = (ctr_font_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t ctr_font =
|
||||
@@ -474,5 +476,5 @@ font_renderer_t ctr_font =
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush_block */
|
||||
ctr_font_get_message_width,
|
||||
ctr_font_get_line_height
|
||||
ctr_font_get_line_metrics
|
||||
};
|
||||
@@ -237,14 +237,16 @@ static void d3d10_font_render_message(
|
||||
unsigned height,
|
||||
unsigned text_align)
|
||||
{
|
||||
int lines = 0;
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
d3d10_font_render_line(d3d10,
|
||||
font, msg, strlen(msg), scale, color, pos_x, pos_y,
|
||||
@@ -252,8 +254,7 @@ static void d3d10_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = font->font_driver->get_line_height(font->font_data)
|
||||
* scale / height;
|
||||
line_height = line_metrics->height * scale / height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -377,14 +378,14 @@ static const struct font_glyph* d3d10_font_get_glyph(void *data, uint32_t code)
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int d3d10_font_get_line_height(void *data)
|
||||
static bool d3d10_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
d3d10_font_t* font = (d3d10_font_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t d3d10_font = {
|
||||
@@ -396,5 +397,5 @@ font_renderer_t d3d10_font = {
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
d3d10_font_get_message_width,
|
||||
d3d10_font_get_line_height
|
||||
d3d10_font_get_line_metrics
|
||||
};
|
||||
@@ -234,14 +234,16 @@ static void d3d11_font_render_message(
|
||||
unsigned height,
|
||||
unsigned text_align)
|
||||
{
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
d3d11_font_render_line(d3d11,
|
||||
font, msg, strlen(msg), scale, color, pos_x, pos_y,
|
||||
@@ -249,7 +251,7 @@ static void d3d11_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = font->font_driver->get_line_height(font->font_data) * scale / height;
|
||||
line_height = line_metrics->height * scale / height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -372,14 +374,14 @@ static const struct font_glyph* d3d11_font_get_glyph(void *data, uint32_t code)
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int d3d11_font_get_line_height(void *data)
|
||||
static bool d3d11_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
d3d11_font_t* font = (d3d11_font_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t d3d11_font = {
|
||||
@@ -391,5 +393,5 @@ font_renderer_t d3d11_font = {
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
d3d11_font_get_message_width,
|
||||
d3d11_font_get_line_height
|
||||
d3d11_font_get_line_metrics
|
||||
};
|
||||
@@ -248,14 +248,16 @@ static void d3d12_font_render_message(
|
||||
unsigned height,
|
||||
unsigned text_align)
|
||||
{
|
||||
int lines = 0;
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
d3d12_font_render_line(d3d12,
|
||||
font, msg, strlen(msg),
|
||||
@@ -263,8 +265,7 @@ static void d3d12_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = font->font_driver->get_line_height(font->font_data)
|
||||
* scale / height;
|
||||
line_height = line_metrics->height * scale / height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -386,14 +387,14 @@ static const struct font_glyph* d3d12_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int d3d12_font_get_line_height(void *data)
|
||||
static bool d3d12_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
d3d12_font_t* font = (d3d12_font_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t d3d12_font = {
|
||||
@@ -405,5 +406,5 @@ font_renderer_t d3d12_font = {
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
d3d12_font_get_message_width,
|
||||
d3d12_font_get_line_height
|
||||
d3d12_font_get_line_metrics
|
||||
};
|
||||
@@ -236,5 +236,6 @@ font_renderer_t d3d_win32_font = {
|
||||
NULL, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
d3dfonts_w32_get_message_width
|
||||
d3dfonts_w32_get_message_width,
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -209,8 +209,9 @@ font_renderer_t gdi_font = {
|
||||
gdi_render_free_font,
|
||||
gdi_render_msg,
|
||||
"gdi font",
|
||||
gdi_font_get_glyph, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
gdi_get_message_width /* get_message_width */
|
||||
gdi_font_get_glyph, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
gdi_get_message_width, /* get_message_width */
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -383,11 +383,13 @@ static void gl1_raster_font_render_message(
|
||||
const GLfloat color[4], GLfloat pos_x, GLfloat pos_y,
|
||||
unsigned text_align)
|
||||
{
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
gl1_raster_font_render_line(font,
|
||||
msg, (unsigned)strlen(msg), scale, color, pos_x,
|
||||
@@ -395,8 +397,7 @@ static void gl1_raster_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = (float) font->font_driver->get_line_height(font->font_data) *
|
||||
scale / font->gl->vp.height;
|
||||
line_height = line_metrics->height * scale / font->gl->vp.height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -576,14 +577,14 @@ static void gl1_raster_font_bind_block(void *data, void *userdata)
|
||||
font->block = block;
|
||||
}
|
||||
|
||||
static int gl1_get_line_height(void *data)
|
||||
static bool gl1_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
gl1_raster_t *font = (gl1_raster_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t gl1_raster_font = {
|
||||
@@ -595,5 +596,5 @@ font_renderer_t gl1_raster_font = {
|
||||
gl1_raster_font_bind_block,
|
||||
gl1_raster_font_flush_block,
|
||||
gl1_get_message_width,
|
||||
gl1_get_line_height
|
||||
gl1_get_line_metrics
|
||||
};
|
||||
@@ -293,11 +293,13 @@ static void gl_core_raster_font_render_message(
|
||||
const GLfloat color[4], GLfloat pos_x, GLfloat pos_y,
|
||||
unsigned text_align)
|
||||
{
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
gl_core_raster_font_render_line(font,
|
||||
msg, (unsigned)strlen(msg), scale, color, pos_x,
|
||||
@@ -305,8 +307,7 @@ static void gl_core_raster_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = (float) font->font_driver->get_line_height(font->font_data) *
|
||||
scale / font->gl->vp.height;
|
||||
line_height = line_metrics->height * scale / font->gl->vp.height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -477,14 +478,14 @@ static void gl_core_raster_font_bind_block(void *data, void *userdata)
|
||||
font->block = block;
|
||||
}
|
||||
|
||||
static int gl_core_get_line_height(void *data)
|
||||
static bool gl_core_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
gl_core_raster_t *font = (gl_core_raster_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t gl_core_raster_font = {
|
||||
@@ -496,5 +497,5 @@ font_renderer_t gl_core_raster_font = {
|
||||
gl_core_raster_font_bind_block,
|
||||
gl_core_raster_font_flush_block,
|
||||
gl_core_get_message_width,
|
||||
gl_core_get_line_height
|
||||
gl_core_get_line_metrics
|
||||
};
|
||||
@@ -362,11 +362,13 @@ static void gl_raster_font_render_message(
|
||||
const GLfloat color[4], GLfloat pos_x, GLfloat pos_y,
|
||||
unsigned text_align)
|
||||
{
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
gl_raster_font_render_line(font,
|
||||
msg, (unsigned)strlen(msg), scale, color, pos_x,
|
||||
@@ -374,8 +376,7 @@ static void gl_raster_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = (float) font->font_driver->get_line_height(font->font_data) *
|
||||
scale / font->gl->vp.height;
|
||||
line_height = line_metrics->height * scale / font->gl->vp.height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -557,14 +558,14 @@ static void gl_raster_font_bind_block(void *data, void *userdata)
|
||||
font->block = block;
|
||||
}
|
||||
|
||||
static int gl_get_line_height(void *data)
|
||||
static bool gl_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
gl_raster_t *font = (gl_raster_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t gl_raster_font = {
|
||||
@@ -576,5 +577,5 @@ font_renderer_t gl_raster_font = {
|
||||
gl_raster_font_bind_block,
|
||||
gl_raster_font_flush_block,
|
||||
gl_get_message_width,
|
||||
gl_get_line_height
|
||||
gl_get_line_metrics
|
||||
};
|
||||
@@ -350,15 +350,18 @@ static INLINE void write_quad6(SpriteVertex *pv,
|
||||
posY:(float)posY
|
||||
aligned:(unsigned)aligned
|
||||
{
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!_font_driver->get_line_height)
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!_font_driver->get_line_metrics ||
|
||||
!_font_driver->get_line_metrics(_font_data, &line_metrics))
|
||||
{
|
||||
[self _renderLine:msg length:strlen(msg) scale:scale color:color posX:posX posY:posY aligned:aligned];
|
||||
return;
|
||||
}
|
||||
|
||||
int lines = 0;
|
||||
float line_height = _font_driver->get_line_height(_font_data) * scale / height;
|
||||
float line_height = line_metrics->height * scale / height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -545,5 +548,6 @@ font_renderer_t metal_raster_font = {
|
||||
.get_glyph = metal_raster_font_get_glyph,
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush_block */
|
||||
.get_message_width = metal_get_message_width
|
||||
.get_message_width = metal_get_message_width,
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -165,4 +165,5 @@ font_renderer_t ps2_font = {
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
NULL, /* get_message_width */
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -141,5 +141,6 @@ font_renderer_t sixel_font = {
|
||||
sixel_font_get_glyph, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
sixel_get_message_width /* get_message_width */
|
||||
sixel_get_message_width, /* get_message_width */
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -193,14 +193,16 @@ static void switch_font_render_message(
|
||||
const unsigned int color, float pos_x, float pos_y,
|
||||
unsigned text_align)
|
||||
{
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
int msgLen = strlen(msg);
|
||||
if (msgLen <= AVG_GLPYH_LIMIT)
|
||||
@@ -211,7 +213,7 @@ static void switch_font_render_message(
|
||||
}
|
||||
return;
|
||||
}
|
||||
line_height = scale / font->font_driver->get_line_height(font->font_data);
|
||||
line_height = scale / line_metrics->height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -312,13 +314,13 @@ static const struct font_glyph *switch_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void *)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int switch_font_get_line_height(void *data)
|
||||
static bool switch_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
switch_font_t *font = (switch_font_t *)data;
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t switch_font =
|
||||
@@ -331,5 +333,5 @@ font_renderer_t switch_font =
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush_block */
|
||||
switch_font_get_message_width,
|
||||
switch_font_get_line_height
|
||||
switch_font_get_line_metrics
|
||||
};
|
||||
@@ -141,5 +141,6 @@ font_renderer_t vga_font = {
|
||||
vga_font_get_glyph, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
vga_get_message_width /* get_message_width */
|
||||
vga_get_message_width, /* get_message_width */
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -225,22 +225,23 @@ static void vita2d_font_render_message(
|
||||
const unsigned int color, float pos_x, float pos_y,
|
||||
unsigned width, unsigned height, unsigned text_align)
|
||||
{
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
int lines = 0;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
vita2d_font_render_line(font, msg, strlen(msg),
|
||||
scale, color, pos_x, pos_y, width, height, text_align);
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = font->font_driver->get_line_height(font->font_data) *
|
||||
scale / font->vita->vp.height;
|
||||
line_height = line_metrics->height * scale / font->vita->vp.height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -358,14 +359,14 @@ static const struct font_glyph *vita2d_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int vita2d_font_get_line_height(void *data)
|
||||
static bool vita2d_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
vita_font_t *font = (vita_font_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t vita2d_vita_font = {
|
||||
@@ -377,5 +378,5 @@ font_renderer_t vita2d_vita_font = {
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
vita2d_font_get_message_width,
|
||||
vita2d_font_get_line_height
|
||||
vita2d_font_get_line_metrics
|
||||
};
|
||||
@@ -233,14 +233,16 @@ static void vulkan_raster_font_render_message(
|
||||
const float color[4], float pos_x, float pos_y,
|
||||
unsigned text_align)
|
||||
{
|
||||
int lines = 0;
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
|
||||
if (!msg || !*msg || !font->vk)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
if (font->vk)
|
||||
vulkan_raster_font_render_line(font, msg, strlen(msg),
|
||||
@@ -248,8 +250,7 @@ static void vulkan_raster_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = (float) font->font_driver->get_line_height(font->font_data) *
|
||||
scale / font->vk->vp.height;
|
||||
line_height = line_metrics->height * scale / font->vk->vp.height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -452,14 +453,14 @@ static const struct font_glyph *vulkan_raster_font_get_glyph(
|
||||
return glyph;
|
||||
}
|
||||
|
||||
static int vulkan_get_line_height(void *data)
|
||||
static bool vulkan_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
vulkan_raster_t *font = (vulkan_raster_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t vulkan_raster_font = {
|
||||
@@ -471,5 +472,5 @@ font_renderer_t vulkan_raster_font = {
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush_block */
|
||||
vulkan_get_message_width,
|
||||
vulkan_get_line_height
|
||||
vulkan_get_line_metrics
|
||||
};
|
||||
@@ -241,14 +241,16 @@ static void wiiu_font_render_message(
|
||||
const unsigned int color, float pos_x, float pos_y,
|
||||
unsigned width, unsigned height, unsigned text_align)
|
||||
{
|
||||
int lines = 0;
|
||||
struct font_line_metrics *line_metrics = NULL;
|
||||
int lines = 0;
|
||||
float line_height;
|
||||
|
||||
if (!msg || !*msg)
|
||||
return;
|
||||
|
||||
/* If the font height is not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_height)
|
||||
/* If font line metrics are not supported just draw as usual */
|
||||
if (!font->font_driver->get_line_metrics ||
|
||||
!font->font_driver->get_line_metrics(font->font_data, &line_metrics))
|
||||
{
|
||||
wiiu_font_render_line(wiiu, font, msg, strlen(msg),
|
||||
scale, color, pos_x, pos_y,
|
||||
@@ -256,7 +258,7 @@ static void wiiu_font_render_message(
|
||||
return;
|
||||
}
|
||||
|
||||
line_height = scale / font->font_driver->get_line_height(font->font_data);
|
||||
line_height = scale / line_metrics->height;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -381,14 +383,14 @@ static const struct font_glyph* wiiu_font_get_glyph(
|
||||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static int wiiu_font_get_line_height(void *data)
|
||||
static bool wiiu_font_get_line_metrics(void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
wiiu_font_t* font = (wiiu_font_t*)data;
|
||||
|
||||
if (!font || !font->font_driver || !font->font_data)
|
||||
return -1;
|
||||
|
||||
return font->font_driver->get_line_height(font->font_data);
|
||||
return font->font_driver->get_line_metrics(font->font_data, metrics);
|
||||
}
|
||||
|
||||
font_renderer_t wiiu_font =
|
||||
@@ -401,5 +403,5 @@ font_renderer_t wiiu_font =
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
wiiu_font_get_message_width,
|
||||
wiiu_font_get_line_height
|
||||
wiiu_font_get_line_metrics
|
||||
};
|
||||
@@ -118,5 +118,6 @@ font_renderer_t d3d_xdk1_font = {
|
||||
NULL, /* get_glyph */
|
||||
NULL, /* bind_block */
|
||||
NULL, /* flush */
|
||||
NULL /* get_message_width */
|
||||
NULL, /* get_message_width */
|
||||
NULL /* get_line_metrics */
|
||||
};
|
||||
@@ -19,7 +19,10 @@
|
||||
|
||||
#define FONT_WIDTH 5
|
||||
#define FONT_HEIGHT 10
|
||||
#define FONT_HEIGHT_BASELINE 8
|
||||
/* FONT_HEIGHT_BASELINE_OFFSET:
|
||||
* Distance in pixels from top of character
|
||||
* to baseline */
|
||||
#define FONT_HEIGHT_BASELINE_OFFSET 8
|
||||
#define FONT_WIDTH_STRIDE (FONT_WIDTH + 1)
|
||||
#define FONT_HEIGHT_STRIDE (FONT_HEIGHT + 1)
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ typedef struct bm_renderer
|
||||
unsigned scale_factor;
|
||||
struct font_glyph glyphs[BMP_ATLAS_SIZE];
|
||||
struct font_atlas atlas;
|
||||
struct font_line_metrics line_metrics;
|
||||
} bm_renderer_t;
|
||||
|
||||
static struct font_atlas *font_renderer_bmp_get_atlas(void *data)
|
||||
@@ -113,11 +114,15 @@ static void *font_renderer_bmp_init(const char *font_path, float font_size)
|
||||
handle->glyphs[i].atlas_offset_x = x;
|
||||
handle->glyphs[i].atlas_offset_y = y;
|
||||
handle->glyphs[i].draw_offset_x = 0;
|
||||
handle->glyphs[i].draw_offset_y = -FONT_HEIGHT_BASELINE * (int)handle->scale_factor;
|
||||
handle->glyphs[i].advance_x = (FONT_WIDTH + 1) * handle->scale_factor;
|
||||
handle->glyphs[i].draw_offset_y = -FONT_HEIGHT_BASELINE_OFFSET * handle->scale_factor;
|
||||
handle->glyphs[i].advance_x = FONT_WIDTH_STRIDE * handle->scale_factor;
|
||||
handle->glyphs[i].advance_y = 0;
|
||||
}
|
||||
|
||||
handle->line_metrics.ascender = (float)FONT_HEIGHT_BASELINE_OFFSET * handle->scale_factor;
|
||||
handle->line_metrics.descender = (float)(FONT_HEIGHT - FONT_HEIGHT_BASELINE_OFFSET) * handle->scale_factor;
|
||||
handle->line_metrics.height = (float)FONT_HEIGHT_STRIDE * handle->scale_factor;
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
@@ -135,14 +140,16 @@ static const char *font_renderer_bmp_get_default_font(void)
|
||||
return "";
|
||||
}
|
||||
|
||||
static int font_renderer_bmp_get_line_height(void* data)
|
||||
static bool font_renderer_bmp_get_line_metrics(
|
||||
void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
bm_renderer_t *handle = (bm_renderer_t*)data;
|
||||
bm_renderer_t *handle = (bm_renderer_t*)data;
|
||||
|
||||
if (!handle)
|
||||
return FONT_HEIGHT;
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
return FONT_HEIGHT * handle->scale_factor;
|
||||
*metrics = &handle->line_metrics;
|
||||
return true;
|
||||
}
|
||||
|
||||
font_renderer_driver_t bitmap_font_renderer = {
|
||||
@@ -152,5 +159,5 @@ font_renderer_driver_t bitmap_font_renderer = {
|
||||
font_renderer_bmp_free,
|
||||
font_renderer_bmp_get_default_font,
|
||||
"bitmap",
|
||||
font_renderer_bmp_get_line_height,
|
||||
font_renderer_bmp_get_line_metrics
|
||||
};
|
||||
@@ -52,7 +52,7 @@ typedef struct coretext_renderer
|
||||
struct font_atlas atlas;
|
||||
coretext_atlas_slot_t atlas_slots[CT_ATLAS_SIZE];
|
||||
coretext_atlas_slot_t *uc_map[0x100];
|
||||
CGFloat metrics_height;
|
||||
struct font_line_metrics line_metrics;
|
||||
} ct_font_renderer_t;
|
||||
|
||||
static struct font_atlas *font_renderer_ct_get_atlas(void *data)
|
||||
@@ -162,9 +162,19 @@ static bool coretext_font_renderer_create_atlas(CTFontRef face, ct_font_renderer
|
||||
|
||||
handle->atlas.width = max_width * CT_ATLAS_COLS;
|
||||
handle->atlas.height = max_height * CT_ATLAS_ROWS;
|
||||
handle->metrics_height += CTFontGetAscent(face);
|
||||
handle->metrics_height += CTFontGetDescent(face);
|
||||
handle->metrics_height += CTFontGetLeading(face);
|
||||
|
||||
handle->line_metrics.ascender = (float)CTFontGetAscent(face);
|
||||
handle->line_metrics.descender = (float)CTFontGetDescent(face);
|
||||
/* CTFontGetDescent() should return a positive value,
|
||||
* but I have seen several reports online of the
|
||||
* value being negative
|
||||
* > Since I cannot test this on real hardware, add
|
||||
* a simple safety check... */
|
||||
handle->line_metrics.descender = (handle->line_metrics.descender < 0.0f) ?
|
||||
(-1.0f * handle->line_metrics.descender) : handle->line_metrics.descender;
|
||||
handle->line_metrics.height =
|
||||
handle->line_metrics.ascender + handle->line_metrics.descender +
|
||||
(float)CTFontGetLeading(face);
|
||||
|
||||
handle->atlas.buffer = (uint8_t*)
|
||||
calloc(handle->atlas.width * handle->atlas.height, 1);
|
||||
@@ -343,12 +353,14 @@ static const char *font_renderer_ct_get_default_font(void)
|
||||
return default_font;
|
||||
}
|
||||
|
||||
static int font_renderer_ct_get_line_height(void *data)
|
||||
static bool font_renderer_ct_get_line_metrics(
|
||||
void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
ct_font_renderer_t *handle = (ct_font_renderer_t*)data;
|
||||
if (!handle)
|
||||
return 0;
|
||||
return handle->metrics_height;
|
||||
return false;
|
||||
*metrics = &handle->line_metrics;
|
||||
return true;
|
||||
}
|
||||
|
||||
font_renderer_driver_t coretext_font_renderer = {
|
||||
@@ -358,5 +370,5 @@ font_renderer_driver_t coretext_font_renderer = {
|
||||
font_renderer_ct_free,
|
||||
font_renderer_ct_get_default_font,
|
||||
"coretext",
|
||||
font_renderer_ct_get_line_height
|
||||
font_renderer_ct_get_line_metrics
|
||||
};
|
||||
@@ -54,6 +54,7 @@ typedef struct freetype_renderer
|
||||
freetype_atlas_slot_t atlas_slots[FT_ATLAS_SIZE];
|
||||
freetype_atlas_slot_t* uc_map[0x100];
|
||||
unsigned usage_counter;
|
||||
struct font_line_metrics line_metrics;
|
||||
} ft_font_renderer_t;
|
||||
|
||||
static struct font_atlas *font_renderer_ft_get_atlas(void *data)
|
||||
@@ -261,6 +262,10 @@ static void *font_renderer_ft_init(const char *font_path, float font_size)
|
||||
if (!font_renderer_create_atlas(handle, font_size))
|
||||
goto error;
|
||||
|
||||
handle->line_metrics.ascender = (float)handle->face->size->metrics.ascender / 64.0f;
|
||||
handle->line_metrics.descender = (float)(-handle->face->size->metrics.descender) / 64.0f;
|
||||
handle->line_metrics.height = (float)handle->face->size->metrics.height / 64.0f;
|
||||
|
||||
return handle;
|
||||
|
||||
error:
|
||||
@@ -315,12 +320,15 @@ static const char *font_renderer_ft_get_default_font(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int font_renderer_ft_get_line_height(void* data)
|
||||
static bool font_renderer_ft_get_line_metrics(
|
||||
void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
ft_font_renderer_t *handle = (ft_font_renderer_t*)data;
|
||||
if (!handle || !handle->face)
|
||||
return 0;
|
||||
return handle->face->size->metrics.height/64;
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
*metrics = &handle->line_metrics;
|
||||
return true;
|
||||
}
|
||||
|
||||
font_renderer_driver_t freetype_font_renderer = {
|
||||
@@ -330,5 +338,5 @@ font_renderer_driver_t freetype_font_renderer = {
|
||||
font_renderer_ft_free,
|
||||
font_renderer_ft_get_default_font,
|
||||
"freetype",
|
||||
font_renderer_ft_get_line_height,
|
||||
font_renderer_ft_get_line_metrics
|
||||
};
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int line_height;
|
||||
struct font_line_metrics line_metrics;
|
||||
struct font_atlas atlas;
|
||||
struct font_glyph glyphs[256];
|
||||
} stb_font_renderer_t;
|
||||
@@ -141,6 +141,7 @@ error:
|
||||
static void *font_renderer_stb_init(const char *font_path, float font_size)
|
||||
{
|
||||
int ascent, descent, line_gap;
|
||||
float scale_factor;
|
||||
stbtt_fontinfo info;
|
||||
uint8_t *font_data = NULL;
|
||||
stb_font_renderer_t *self = (stb_font_renderer_t*) calloc(1, sizeof(*self));
|
||||
@@ -161,12 +162,17 @@ static void *font_renderer_stb_init(const char *font_path, float font_size)
|
||||
goto error;
|
||||
|
||||
stbtt_GetFontVMetrics(&info, &ascent, &descent, &line_gap);
|
||||
self->line_height = ascent - descent;
|
||||
|
||||
if (font_size < 0)
|
||||
self->line_height *= stbtt_ScaleForMappingEmToPixels(&info, -font_size);
|
||||
else
|
||||
self->line_height *= stbtt_ScaleForPixelHeight(&info, font_size);
|
||||
scale_factor = (font_size < 0) ?
|
||||
stbtt_ScaleForMappingEmToPixels(&info, -font_size) :
|
||||
stbtt_ScaleForPixelHeight(&info, font_size);
|
||||
|
||||
/* Ascender, descender and line_gap values always
|
||||
* end up ~0.5 pixels too small when scaled...
|
||||
* > Add a manual correction factor */
|
||||
self->line_metrics.ascender = 0.5f + (float)ascent * scale_factor;
|
||||
self->line_metrics.descender = 0.5f + (float)(-descent) * scale_factor;
|
||||
self->line_metrics.height = 0.5f + (float)(ascent - descent + line_gap) * scale_factor;
|
||||
|
||||
free(font_data);
|
||||
|
||||
@@ -226,10 +232,14 @@ static const char *font_renderer_stb_get_default_font(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int font_renderer_stb_get_line_height(void* data)
|
||||
static bool font_renderer_stb_get_line_metrics(
|
||||
void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
stb_font_renderer_t *handle = (stb_font_renderer_t*)data;
|
||||
return handle->line_height;
|
||||
if (!handle)
|
||||
return false;
|
||||
*metrics = &handle->line_metrics;
|
||||
return true;
|
||||
}
|
||||
|
||||
font_renderer_driver_t stb_font_renderer = {
|
||||
@@ -239,5 +249,5 @@ font_renderer_driver_t stb_font_renderer = {
|
||||
font_renderer_stb_free,
|
||||
font_renderer_stb_get_default_font,
|
||||
"stb",
|
||||
font_renderer_stb_get_line_height,
|
||||
font_renderer_stb_get_line_metrics
|
||||
};
|
||||
@@ -57,8 +57,8 @@ typedef struct
|
||||
|
||||
int max_glyph_width;
|
||||
int max_glyph_height;
|
||||
int line_height;
|
||||
float scale_factor;
|
||||
struct font_line_metrics line_metrics;
|
||||
|
||||
struct font_atlas atlas;
|
||||
stb_unicode_atlas_slot_t atlas_slots[STB_UNICODE_ATLAS_SIZE];
|
||||
@@ -66,13 +66,6 @@ typedef struct
|
||||
unsigned usage_counter;
|
||||
} stb_unicode_font_renderer_t;
|
||||
|
||||
/* Ugly little thing... */
|
||||
static int INLINE round_away_from_zero(float f)
|
||||
{
|
||||
double round = (f < 0.0) ? floor((double)f) : ceil((double)f);
|
||||
return (int)round;
|
||||
}
|
||||
|
||||
static struct font_atlas *font_renderer_stb_unicode_get_atlas(void *data)
|
||||
{
|
||||
stb_unicode_font_renderer_t *self = (stb_unicode_font_renderer_t*)data;
|
||||
@@ -125,6 +118,8 @@ static const struct font_glyph *font_renderer_stb_unicode_get_glyph(
|
||||
uint8_t *dst = NULL;
|
||||
stb_unicode_atlas_slot_t* atlas_slot = NULL;
|
||||
stb_unicode_font_renderer_t *self = (stb_unicode_font_renderer_t*)data;
|
||||
float glyph_advance_x = 0.0f;
|
||||
float glyph_draw_offset_y = 0.0f;
|
||||
|
||||
if(!self)
|
||||
return NULL;
|
||||
@@ -145,9 +140,9 @@ static const struct font_glyph *font_renderer_stb_unicode_get_glyph(
|
||||
atlas_slot = font_renderer_stb_unicode_get_slot(self);
|
||||
atlas_slot->charcode = charcode;
|
||||
atlas_slot->next = self->uc_map[map_id];
|
||||
self->uc_map[map_id] = atlas_slot;
|
||||
self->uc_map[map_id] = atlas_slot;
|
||||
|
||||
glyph_index = stbtt_FindGlyphIndex(&self->info, charcode);
|
||||
glyph_index = stbtt_FindGlyphIndex(&self->info, charcode);
|
||||
|
||||
dst = (uint8_t*)self->atlas.buffer + atlas_slot->glyph.atlas_offset_x
|
||||
+ atlas_slot->glyph.atlas_offset_y * self->atlas.width;
|
||||
@@ -171,15 +166,25 @@ static const struct font_glyph *font_renderer_stb_unicode_get_glyph(
|
||||
|
||||
atlas_slot->glyph.width = self->max_glyph_width;
|
||||
atlas_slot->glyph.height = self->max_glyph_height;
|
||||
atlas_slot->glyph.advance_x = round_away_from_zero((float)advance_width * self->scale_factor);
|
||||
/* advance_x must always be rounded to the
|
||||
* *nearest* integer */
|
||||
glyph_advance_x = (float)advance_width * self->scale_factor;
|
||||
atlas_slot->glyph.advance_x = (int)((glyph_advance_x > 0.0f) ?
|
||||
(glyph_advance_x + 0.5f) : (glyph_advance_x - 0.5f));
|
||||
/* advance_y is always zero */
|
||||
atlas_slot->glyph.advance_y = 0;
|
||||
atlas_slot->glyph.draw_offset_x = round_away_from_zero((float)x0 * self->scale_factor);
|
||||
atlas_slot->glyph.draw_offset_y = round_away_from_zero((float)(-y1) * self->scale_factor);
|
||||
/* draw_offset_x must always be rounded *down*
|
||||
* to the nearest integer */
|
||||
atlas_slot->glyph.draw_offset_x = (int)((float)x0 * self->scale_factor);
|
||||
/* draw_offset_y must always be rounded *up*
|
||||
* to the nearest integer */
|
||||
glyph_draw_offset_y = (float)(-y1) * self->scale_factor;
|
||||
atlas_slot->glyph.draw_offset_y = (int)((glyph_draw_offset_y < 0.0f) ?
|
||||
floor((double)glyph_draw_offset_y) : ceil((double)glyph_draw_offset_y));
|
||||
|
||||
self->atlas.dirty = true;
|
||||
atlas_slot->last_used = self->usage_counter++;
|
||||
return &atlas_slot->glyph;
|
||||
|
||||
}
|
||||
|
||||
static bool font_renderer_stb_unicode_create_atlas(
|
||||
@@ -259,7 +264,12 @@ static void *font_renderer_stb_unicode_init(const char *font_path, float font_si
|
||||
else
|
||||
self->scale_factor = stbtt_ScaleForPixelHeight(&self->info, font_size);
|
||||
|
||||
self->line_height = (ascent - descent) * self->scale_factor;
|
||||
/* Ascender, descender and line_gap values always
|
||||
* end up ~0.5 pixels too small when scaled...
|
||||
* > Add a manual correction factor */
|
||||
self->line_metrics.ascender = 0.5f + (float)ascent * self->scale_factor;
|
||||
self->line_metrics.descender = 0.5f + ((float)(-descent) * self->scale_factor);
|
||||
self->line_metrics.height = 0.5f + (float)(ascent - descent + line_gap) * self->scale_factor;
|
||||
|
||||
if (!font_renderer_stb_unicode_create_atlas(self, font_size))
|
||||
goto error;
|
||||
@@ -321,10 +331,14 @@ static const char *font_renderer_stb_unicode_get_default_font(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int font_renderer_stb_unicode_get_line_height(void* data)
|
||||
static bool font_renderer_stb_unicode_get_line_metrics(
|
||||
void* data, struct font_line_metrics **metrics)
|
||||
{
|
||||
stb_unicode_font_renderer_t *handle = (stb_unicode_font_renderer_t*)data;
|
||||
return handle->line_height;
|
||||
if (!handle)
|
||||
return false;
|
||||
*metrics = &handle->line_metrics;
|
||||
return true;
|
||||
}
|
||||
|
||||
font_renderer_driver_t stb_unicode_font_renderer = {
|
||||
@@ -334,5 +348,5 @@ font_renderer_driver_t stb_unicode_font_renderer = {
|
||||
font_renderer_stb_unicode_free,
|
||||
font_renderer_stb_unicode_get_default_font,
|
||||
"stb-unicode",
|
||||
font_renderer_stb_unicode_get_line_height,
|
||||
font_renderer_stb_unicode_get_line_metrics
|
||||
};
|
||||
+59
-8
@@ -35,7 +35,7 @@ static const font_renderer_driver_t *font_backends[] = {
|
||||
&coretext_font_renderer,
|
||||
#endif
|
||||
#ifdef HAVE_STB_FONT
|
||||
#if defined(VITA) || defined(WIIU) || defined(ANDROID) || (defined(_WIN32) && !defined(_XBOX) && !defined(_MSC_VER) && _MSC_VER >= 1400) || (defined(_WIN32) && !defined(_XBOX) && defined(_MSC_VER)) || defined(__CELLOS_LV2__) || defined(HAVE_LIBNX) || defined(__linux__) || defined (HAVE_EMSCRIPTEN) || defined(__APPLE__)
|
||||
#if defined(VITA) || defined(WIIU) || defined(ANDROID) || (defined(_WIN32) && !defined(_XBOX) && !defined(_MSC_VER) && _MSC_VER >= 1400) || (defined(_WIN32) && !defined(_XBOX) && defined(_MSC_VER)) || defined(__CELLOS_LV2__) || defined(HAVE_LIBNX) || defined(__linux__) || defined (HAVE_EMSCRIPTEN) || defined(__APPLE__) || defined(HAVE_ODROIDGO2)
|
||||
&stb_unicode_font_renderer,
|
||||
#else
|
||||
&stb_font_renderer,
|
||||
@@ -1083,16 +1083,67 @@ int font_driver_get_message_width(void *font_data,
|
||||
|
||||
int font_driver_get_line_height(void *font_data, float scale)
|
||||
{
|
||||
int line_height;
|
||||
struct font_line_metrics *metrics = NULL;
|
||||
font_data_t *font = (font_data_t*)(font_data ? font_data : video_font_driver);
|
||||
|
||||
/* First try the line height implementation */
|
||||
if (font && font->renderer && font->renderer->get_line_height)
|
||||
if ((line_height = font->renderer->get_line_height(font->renderer_data)) != -1)
|
||||
return (int)(line_height * roundf(scale));
|
||||
/* First try the line metrics implementation */
|
||||
if (font && font->renderer && font->renderer->get_line_metrics)
|
||||
if ((font->renderer->get_line_metrics(font->renderer_data, &metrics)))
|
||||
return (int)roundf(metrics->height * scale);
|
||||
|
||||
/* Else return an approximation (width of 'a') */
|
||||
return font_driver_get_message_width(font_data, "a", 1, scale);
|
||||
/* Else return an approximation
|
||||
* (uses a fudge of standard font metrics - mostly garbage...)
|
||||
* > font_size = (width of 'a') / 0.6
|
||||
* > line_height = font_size * 1.7f */
|
||||
return (int)roundf(1.7f * (float)font_driver_get_message_width(font_data, "a", 1, scale) / 0.6f);
|
||||
}
|
||||
|
||||
int font_driver_get_line_ascender(void *font_data, float scale)
|
||||
{
|
||||
struct font_line_metrics *metrics = NULL;
|
||||
font_data_t *font = (font_data_t*)(font_data ? font_data : video_font_driver);
|
||||
|
||||
/* First try the line metrics implementation */
|
||||
if (font && font->renderer && font->renderer->get_line_metrics)
|
||||
if ((font->renderer->get_line_metrics(font->renderer_data, &metrics)))
|
||||
return (int)roundf(metrics->ascender * scale);
|
||||
|
||||
/* Else return an approximation
|
||||
* (uses a fudge of standard font metrics - mostly garbage...)
|
||||
* > font_size = (width of 'a') / 0.6
|
||||
* > ascender = 1.58 * font_size * 0.75 */
|
||||
return (int)roundf(1.58f * 0.75f * (float)font_driver_get_message_width(font_data, "a", 1, scale) / 0.6f);
|
||||
}
|
||||
|
||||
int font_driver_get_line_descender(void *font_data, float scale)
|
||||
{
|
||||
struct font_line_metrics *metrics = NULL;
|
||||
font_data_t *font = (font_data_t*)(font_data ? font_data : video_font_driver);
|
||||
|
||||
/* First try the line metrics implementation */
|
||||
if (font && font->renderer && font->renderer->get_line_metrics)
|
||||
if ((font->renderer->get_line_metrics(font->renderer_data, &metrics)))
|
||||
return (int)roundf(metrics->descender * scale);
|
||||
|
||||
/* Else return an approximation
|
||||
* (uses a fudge of standard font metrics - mostly garbage...)
|
||||
* > font_size = (width of 'a') / 0.6
|
||||
* > descender = 1.58 * font_size * 0.25 */
|
||||
return (int)roundf(1.58f * 0.25f * (float)font_driver_get_message_width(font_data, "a", 1, scale) / 0.6f);
|
||||
}
|
||||
|
||||
int font_driver_get_line_centre_offset(void *font_data, float scale)
|
||||
{
|
||||
struct font_line_metrics *metrics = NULL;
|
||||
font_data_t *font = (font_data_t*)(font_data ? font_data : video_font_driver);
|
||||
|
||||
/* First try the line metrics implementation */
|
||||
if (font && font->renderer && font->renderer->get_line_metrics)
|
||||
if ((font->renderer->get_line_metrics(font->renderer_data, &metrics)))
|
||||
return (int)roundf((metrics->ascender - metrics->descender) * 0.5f * scale);
|
||||
|
||||
/* Else return an approximation... */
|
||||
return (int)roundf((1.58f * 0.5f * (float)font_driver_get_message_width(font_data, "a", 1, scale) / 0.6f) / 2.0f);
|
||||
}
|
||||
|
||||
void font_driver_free(void *font_data)
|
||||
|
||||
+12
-2
@@ -81,6 +81,13 @@ struct font_params
|
||||
enum text_alignment text_align;
|
||||
};
|
||||
|
||||
struct font_line_metrics
|
||||
{
|
||||
float height;
|
||||
float ascender;
|
||||
float descender;
|
||||
};
|
||||
|
||||
typedef struct font_renderer
|
||||
{
|
||||
void *(*init)(void *data, const char *font_path,
|
||||
@@ -96,7 +103,7 @@ typedef struct font_renderer
|
||||
void (*flush)(unsigned width, unsigned height, void *data);
|
||||
|
||||
int (*get_message_width)(void *data, const char *msg, unsigned msg_len_full, float scale);
|
||||
int (*get_line_height)(void* data);
|
||||
bool (*get_line_metrics)(void* data, struct font_line_metrics **metrics);
|
||||
} font_renderer_t;
|
||||
|
||||
typedef struct font_renderer_driver
|
||||
@@ -114,7 +121,7 @@ typedef struct font_renderer_driver
|
||||
|
||||
const char *ident;
|
||||
|
||||
int (*get_line_height)(void* data);
|
||||
bool (*get_line_metrics)(void* data, struct font_line_metrics **metrics);
|
||||
} font_renderer_driver_t;
|
||||
|
||||
typedef struct
|
||||
@@ -159,6 +166,9 @@ void font_driver_init_osd(
|
||||
void font_driver_free_osd(void);
|
||||
|
||||
int font_driver_get_line_height(void *font_data, float scale);
|
||||
int font_driver_get_line_ascender(void *font_data, float scale);
|
||||
int font_driver_get_line_descender(void *font_data, float scale);
|
||||
int font_driver_get_line_centre_offset(void *font_data, float scale);
|
||||
|
||||
extern font_renderer_t gl_raster_font;
|
||||
extern font_renderer_t gl_core_raster_font;
|
||||
|
||||
+50
-5
@@ -713,13 +713,19 @@ font_data_t *gfx_display_font_file(
|
||||
char* fontpath, float menu_font_size, bool is_threaded)
|
||||
{
|
||||
font_data_t *font_data = NULL;
|
||||
float font_size = menu_font_size;
|
||||
|
||||
if (!dispctx)
|
||||
return NULL;
|
||||
|
||||
/* Font size must be at least 2, or font_init_first()
|
||||
* will generate a heap-buffer-overflow when using
|
||||
* many font drivers */
|
||||
font_size = (font_size > 2.0f) ? font_size : 2.0f;
|
||||
|
||||
if (!dispctx->font_init_first((void**)&font_data,
|
||||
video_driver_get_ptr(false),
|
||||
fontpath, menu_font_size, is_threaded))
|
||||
fontpath, font_size, is_threaded))
|
||||
return NULL;
|
||||
|
||||
return font_data;
|
||||
@@ -994,6 +1000,45 @@ void gfx_display_draw_texture_slice(
|
||||
math_matrix_4x4 mymat;
|
||||
unsigned i;
|
||||
float V_BL[2], V_BR[2], V_TL[2], V_TR[2], T_BL[2], T_BR[2], T_TL[2], T_TR[2];
|
||||
/* To prevent visible seams between the corners and
|
||||
* middle segments of the sliced texture, the texture
|
||||
* must be scaled such that its effective size (before
|
||||
* expansion of the middle segments) is no greater than
|
||||
* the requested display size.
|
||||
* > This is consequence of the way textures are rendered
|
||||
* in hardware...
|
||||
* > Whenever an image is scaled, the colours at the
|
||||
* transparent edges get interpolated, which means
|
||||
* the colours of the transparent pixels themselves bleed
|
||||
* into the visible area.
|
||||
* > This effectively 'blurs' anything that gets scaled
|
||||
* [SIDE NOTE: this causes additional issues if the transparent
|
||||
* pixels have the wrong colour - i.e. if they are black,
|
||||
* every edge gets a nasty dark border...]
|
||||
* > This burring is a problem because (by design) the corners
|
||||
* of the sliced texture are drawn at native resolution,
|
||||
* whereas the middle segments are stretched to fit the
|
||||
* requested dimensions. Consequently, the corners are sharp
|
||||
* while the middle segments are blurred.
|
||||
* > When *upscaling* the middle segments (i.e. display size
|
||||
* greater than texture size), the visible effects of this
|
||||
* are mostly imperceptible.
|
||||
* > When *downscaling* them, however, the interpolation effects
|
||||
* completely dominate the output image - creating an ugly
|
||||
* transition between the corners and middle parts.
|
||||
* > Since this is a property of hardware rendering, it is not
|
||||
* practical to fix this 'properly'...
|
||||
* > However: An effective workaround is to force downscaling of
|
||||
* the entire texture (including corners) whenever the
|
||||
* requested display size is less than the texture dimensions.
|
||||
* > This blurs the corners enough that the corner/middle
|
||||
* transitions are essentially invisible. */
|
||||
float max_scale_w = (float)new_w / (float)w;
|
||||
float max_scale_h = (float)new_h / (float)h;
|
||||
/* Find the minimum of scale_factor, max_scale_w, max_scale_h */
|
||||
float slice_scale = (scale_factor < max_scale_w) ?
|
||||
(scale_factor < max_scale_h) ? scale_factor : max_scale_h :
|
||||
(max_scale_w < max_scale_h) ? max_scale_w : max_scale_h;
|
||||
|
||||
/* need space for the coordinates of two triangles in a strip,
|
||||
* so 8 vertices */
|
||||
@@ -1003,15 +1048,15 @@ void gfx_display_draw_texture_slice(
|
||||
|
||||
/* normalized width/height of the amount to offset from the corners,
|
||||
* for both the vertex and texture coordinates */
|
||||
float vert_woff = (offset * scale_factor) / (float)width;
|
||||
float vert_hoff = (offset * scale_factor) / (float)height;
|
||||
float vert_woff = (offset * slice_scale) / (float)width;
|
||||
float vert_hoff = (offset * slice_scale) / (float)height;
|
||||
float tex_woff = offset / (float)w;
|
||||
float tex_hoff = offset / (float)h;
|
||||
|
||||
/* the width/height of the middle sections of both the scaled and original image */
|
||||
float vert_scaled_mid_width = (new_w - (offset * scale_factor * 2))
|
||||
float vert_scaled_mid_width = (new_w - (offset * slice_scale * 2))
|
||||
/ (float)width;
|
||||
float vert_scaled_mid_height = (new_h - (offset * scale_factor * 2))
|
||||
float vert_scaled_mid_height = (new_h - (offset * slice_scale * 2))
|
||||
/ (float)height;
|
||||
float tex_mid_width = (w - (offset * 2)) / (float)w;
|
||||
float tex_mid_height = (h - (offset * 2)) / (float)h;
|
||||
|
||||
+6
-3
@@ -530,7 +530,7 @@ void gfx_widgets_msg_queue_push(
|
||||
if (msg_widget->msg_new)
|
||||
{
|
||||
free(msg_widget->msg_new);
|
||||
msg_widget->msg_new = NULL;
|
||||
msg_widget->msg_new = NULL;
|
||||
}
|
||||
|
||||
msg_widget->msg_new = strdup(task->title);
|
||||
@@ -652,7 +652,8 @@ static void gfx_widgets_msg_queue_move(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_widgets_msg_queue_free(menu_widget_msg_t *msg, bool touch_list)
|
||||
static void gfx_widgets_msg_queue_free(
|
||||
menu_widget_msg_t *msg, bool touch_list)
|
||||
{
|
||||
size_t i;
|
||||
gfx_animation_ctx_tag tag = (uintptr_t)msg;
|
||||
@@ -2265,7 +2266,9 @@ void gfx_widgets_cleanup_load_content_animation(void)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
load_content_animation_running = false;
|
||||
free(load_content_animation_content_name);
|
||||
if (load_content_animation_content_name)
|
||||
free(load_content_animation_content_name);
|
||||
load_content_animation_content_name = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ struct thread_packet
|
||||
{
|
||||
unsigned index;
|
||||
bool smooth;
|
||||
bool ctx_scaling;
|
||||
} filtering;
|
||||
|
||||
struct
|
||||
@@ -499,7 +500,8 @@ static bool video_thread_handle_packet(
|
||||
if (thr->poke && thr->poke->set_filtering)
|
||||
thr->poke->set_filtering(thr->driver_data,
|
||||
pkt.data.filtering.index,
|
||||
pkt.data.filtering.smooth);
|
||||
pkt.data.filtering.smooth,
|
||||
pkt.data.filtering.ctx_scaling);
|
||||
video_thread_reply(thr, &pkt);
|
||||
break;
|
||||
|
||||
@@ -1078,7 +1080,7 @@ static void thread_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
video_thread_send_and_wait_user_to_thread(thr, &pkt);
|
||||
}
|
||||
|
||||
static void thread_set_filtering(void *data, unsigned idx, bool smooth)
|
||||
static void thread_set_filtering(void *data, unsigned idx, bool smooth, bool ctx_scaling)
|
||||
{
|
||||
thread_video_t *thr = (thread_video_t*)data;
|
||||
thread_packet_t pkt = { CMD_POKE_SET_FILTERING };
|
||||
|
||||
+13
-2
@@ -240,7 +240,7 @@ VIDEO CONTEXT
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
#include "../gfx/drivers_context/ps3_ctx.c"
|
||||
#elif defined(ANDROID)
|
||||
#include "../gfx/drivers_context/android_ctx.c"
|
||||
@@ -488,7 +488,9 @@ VIDEO DRIVER
|
||||
#include "../gfx/drivers/xvideo.c"
|
||||
#endif
|
||||
|
||||
#if defined(GEKKO)
|
||||
#if defined(__PSL1GHT__)
|
||||
#include "../gfx/drivers/gcm_gfx.c"
|
||||
#elif defined(GEKKO)
|
||||
#include "../gfx/drivers/gx_gfx.c"
|
||||
#elif defined(PSP)
|
||||
#include "../gfx/drivers/psp1_gfx.c"
|
||||
@@ -648,8 +650,12 @@ INPUT
|
||||
#include "../input/input_autodetect_builtin.c"
|
||||
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#ifdef __PSL1GHT__
|
||||
#include "../input/drivers/psl1ght_input.c"
|
||||
#else
|
||||
#include "../input/drivers/ps3_input.c"
|
||||
#include "../input/drivers_joypad/ps3_joypad.c"
|
||||
#endif
|
||||
#elif defined(SN_TARGET_PSP2) || defined(PSP) || defined(VITA)
|
||||
#include "../input/drivers/psp_input.c"
|
||||
#include "../input/drivers_joypad/psp_joypad.c"
|
||||
@@ -1599,3 +1605,8 @@ MANUAL CONTENT SCAN
|
||||
DISK CONTROL INTERFACE
|
||||
============================================================ */
|
||||
#include "../disk_control_interface.c"
|
||||
|
||||
/*============================================================
|
||||
MISC FILE FORMATS
|
||||
============================================================ */
|
||||
#include "../libretro-common/formats/m3u/m3u_file.c"
|
||||
@@ -1501,7 +1501,7 @@ static int16_t android_input_state(void *data,
|
||||
if (android_keyboard_port_input_pressed(binds[port], i))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -339,7 +339,7 @@ static int16_t cocoa_input_state(void *data,
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include "../input_driver.h"
|
||||
|
||||
#include "../../retroarch.h"
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
|
||||
@@ -83,7 +83,7 @@ static int16_t ctr_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -607,7 +607,7 @@ static int16_t dinput_input_state(void *data,
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "../input_driver.h"
|
||||
#include "../input_keymaps.h"
|
||||
#include "../drivers_keyboard/keyboard_event_dos.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -112,7 +113,7 @@ static int16_t dos_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "../../config.def.h"
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -174,7 +175,7 @@ static int16_t gx_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "../input_keymaps.h"
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -151,7 +152,7 @@ static int16_t linuxraw_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
typedef struct ps2_input
|
||||
{
|
||||
@@ -78,7 +79,7 @@ static int16_t ps2_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -29,12 +29,11 @@
|
||||
#include "../../defines/ps3_defines.h"
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#ifdef HAVE_MOUSE
|
||||
#ifndef __PSL1GHT__
|
||||
#define MAX_MICE 7
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -136,7 +135,7 @@ static int16_t ps3_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -81,7 +82,7 @@ static int16_t ps4_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,407 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2020 Google
|
||||
*
|
||||
* 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>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#include "../../defines/ps3_defines.h"
|
||||
|
||||
#include "../input_driver.h"
|
||||
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include "../../config.def.h"
|
||||
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
|
||||
#ifdef HAVE_MOUSE
|
||||
#define MAX_MICE 7
|
||||
#endif
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} sensor_t;
|
||||
|
||||
typedef struct ps3_input
|
||||
{
|
||||
#ifdef HAVE_MOUSE
|
||||
unsigned mice_connected;
|
||||
#endif
|
||||
const input_device_driver_t *joypad;
|
||||
} ps3_input_t;
|
||||
|
||||
static void ps3_input_poll(void *data)
|
||||
{
|
||||
ps3_input_t *ps3 = (ps3_input_t*)data;
|
||||
|
||||
if (ps3 && ps3->joypad)
|
||||
ps3->joypad->poll();
|
||||
}
|
||||
|
||||
#ifdef HAVE_MOUSE
|
||||
static int16_t ps3_mouse_device_state(ps3_input_t *ps3,
|
||||
unsigned user, unsigned id)
|
||||
{
|
||||
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int16_t ps3_input_state(void *data,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
{
|
||||
ps3_input_t *ps3 = (ps3_input_t*)data;
|
||||
|
||||
if (!ps3)
|
||||
return 0;
|
||||
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
if (id == RETRO_DEVICE_ID_JOYPAD_MASK)
|
||||
{
|
||||
unsigned i;
|
||||
int16_t ret = 0;
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
const uint64_t joykey = (binds[port][i].joykey != NO_BTN)
|
||||
? binds[port][i].joykey : joypad_info->auto_binds[i].joykey;
|
||||
const uint32_t joyaxis = (binds[port][i].joyaxis != AXIS_NONE)
|
||||
? binds[port][i].joyaxis : joypad_info->auto_binds[i].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN && ps3->joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
}
|
||||
else if (((float)abs(ps3->joypad->axis(
|
||||
joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
const uint64_t joykey = (binds[port][id].joykey != NO_BTN)
|
||||
? binds[port][id].joykey : joypad_info->auto_binds[id].joykey;
|
||||
const uint32_t joyaxis = (binds[port][id].joyaxis != AXIS_NONE)
|
||||
? binds[port][id].joyaxis : joypad_info->auto_binds[id].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN && ps3->joypad->button(
|
||||
joypad_info->joy_idx, (uint16_t)joykey))
|
||||
return true;
|
||||
if (((float)abs(ps3->joypad->axis(joypad_info->joy_idx, joyaxis)) / 0x8000) > joypad_info->axis_threshold)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
if (binds[port])
|
||||
return input_joypad_analog(ps3->joypad, joypad_info, port, idx, id, binds[port]);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ps3_input_free_input(void *data)
|
||||
{
|
||||
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
|
||||
}
|
||||
|
||||
static void* ps3_input_init(const char *joypad_driver)
|
||||
{
|
||||
ps3_input_t *ps3 = (ps3_input_t*)calloc(1, sizeof(*ps3));
|
||||
if (!ps3)
|
||||
return NULL;
|
||||
|
||||
ps3->joypad = input_joypad_init_driver(joypad_driver, ps3);
|
||||
|
||||
if (ps3->joypad)
|
||||
ps3->joypad->init(ps3);
|
||||
|
||||
return ps3;
|
||||
}
|
||||
|
||||
static uint64_t ps3_input_get_capabilities(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return
|
||||
#ifdef HAVE_MOUSE
|
||||
(1 << RETRO_DEVICE_MOUSE) |
|
||||
#endif
|
||||
(1 << RETRO_DEVICE_JOYPAD) |
|
||||
(1 << RETRO_DEVICE_ANALOG);
|
||||
}
|
||||
|
||||
static bool ps3_input_set_sensor_state(void *data, unsigned port,
|
||||
enum retro_sensor_action action, unsigned event_rate)
|
||||
{
|
||||
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ps3_input_set_rumble(void *data, unsigned port,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const input_device_driver_t *ps3_input_get_joypad_driver(void *data)
|
||||
{
|
||||
ps3_input_t *ps3 = (ps3_input_t*)data;
|
||||
if (ps3)
|
||||
return ps3->joypad;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ps3_input_grab_mouse(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
(void)state;
|
||||
}
|
||||
|
||||
input_driver_t input_ps3 = {
|
||||
ps3_input_init,
|
||||
ps3_input_poll,
|
||||
ps3_input_state,
|
||||
ps3_input_free_input,
|
||||
ps3_input_set_sensor_state,
|
||||
NULL,
|
||||
ps3_input_get_capabilities,
|
||||
"ps3",
|
||||
|
||||
ps3_input_grab_mouse,
|
||||
NULL,
|
||||
ps3_input_set_rumble,
|
||||
ps3_input_get_joypad_driver,
|
||||
NULL,
|
||||
false
|
||||
};
|
||||
|
||||
/* 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>
|
||||
|
||||
static padData pad_state[MAX_PADS];
|
||||
static bool pads_connected[MAX_PADS];
|
||||
|
||||
static INLINE int16_t convert_u8_to_s16(uint8_t val)
|
||||
{
|
||||
if (val == 0)
|
||||
return -0x7fff;
|
||||
return val * 0x0101 - 0x8000;
|
||||
}
|
||||
|
||||
static const char *ps3_joypad_name(unsigned pad)
|
||||
{
|
||||
return "SixAxis Controller";
|
||||
}
|
||||
|
||||
static void ps3_joypad_autodetect_add(unsigned autoconf_pad)
|
||||
{
|
||||
input_autoconfigure_connect(
|
||||
ps3_joypad_name(autoconf_pad),
|
||||
NULL,
|
||||
ps3_joypad.ident,
|
||||
autoconf_pad,
|
||||
0,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
static bool ps3_joypad_init(void *data)
|
||||
{
|
||||
(void)data;
|
||||
ioPadInit(7);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static u16 transform_buttons(const padData *data) {
|
||||
return (
|
||||
(data->BTN_CROSS << RETRO_DEVICE_ID_JOYPAD_B)
|
||||
| (data->BTN_SQUARE << RETRO_DEVICE_ID_JOYPAD_Y)
|
||||
| (data->BTN_SELECT << RETRO_DEVICE_ID_JOYPAD_SELECT)
|
||||
| (data->BTN_START << RETRO_DEVICE_ID_JOYPAD_START)
|
||||
| (data->BTN_UP << RETRO_DEVICE_ID_JOYPAD_UP)
|
||||
| (data->BTN_DOWN << RETRO_DEVICE_ID_JOYPAD_DOWN)
|
||||
| (data->BTN_LEFT << RETRO_DEVICE_ID_JOYPAD_LEFT)
|
||||
| (data->BTN_RIGHT << RETRO_DEVICE_ID_JOYPAD_RIGHT)
|
||||
| (data->BTN_CIRCLE << RETRO_DEVICE_ID_JOYPAD_A)
|
||||
| (data->BTN_TRIANGLE << RETRO_DEVICE_ID_JOYPAD_X)
|
||||
| (data->BTN_L1 << RETRO_DEVICE_ID_JOYPAD_L)
|
||||
| (data->BTN_R1 << RETRO_DEVICE_ID_JOYPAD_R)
|
||||
| (data->BTN_L2 << RETRO_DEVICE_ID_JOYPAD_L2)
|
||||
| (data->BTN_R2 << RETRO_DEVICE_ID_JOYPAD_R2)
|
||||
| (data->BTN_L3 << RETRO_DEVICE_ID_JOYPAD_L3)
|
||||
| (data->BTN_R3 << RETRO_DEVICE_ID_JOYPAD_R3)
|
||||
);
|
||||
}
|
||||
|
||||
static bool ps3_joypad_button(unsigned port_num, uint16_t joykey)
|
||||
{
|
||||
if (port_num >= MAX_PADS)
|
||||
return false;
|
||||
|
||||
return !!(transform_buttons(&pad_state[port_num]) & (UINT64_C(1) << joykey));
|
||||
}
|
||||
|
||||
static void ps3_joypad_get_buttons(unsigned port_num, input_bits_t *state)
|
||||
{
|
||||
if (port_num < MAX_PADS)
|
||||
{
|
||||
u16 v = transform_buttons(&pad_state[port_num]);
|
||||
BITS_COPY16_PTR( state, v);
|
||||
}
|
||||
else
|
||||
BIT256_CLEAR_ALL_PTR(state);
|
||||
}
|
||||
|
||||
static int16_t ps3_joypad_axis(unsigned port_num, uint32_t joyaxis)
|
||||
{
|
||||
int val = 0x80;
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
|
||||
if (joyaxis == AXIS_NONE || port_num >= DEFAULT_MAX_PADS)
|
||||
return 0;
|
||||
|
||||
if (AXIS_NEG_GET(joyaxis) < 4)
|
||||
{
|
||||
axis = AXIS_NEG_GET(joyaxis);
|
||||
is_neg = true;
|
||||
}
|
||||
else if (AXIS_POS_GET(joyaxis) < 4)
|
||||
{
|
||||
axis = AXIS_POS_GET(joyaxis);
|
||||
is_pos = true;
|
||||
}
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case 0:
|
||||
val = pad_state[port_num].ANA_L_H;
|
||||
break;
|
||||
case 1:
|
||||
val = pad_state[port_num].ANA_L_V;
|
||||
break;
|
||||
case 2:
|
||||
val = pad_state[port_num].ANA_R_H;
|
||||
break;
|
||||
case 3:
|
||||
val = pad_state[port_num].ANA_R_V;
|
||||
break;
|
||||
}
|
||||
|
||||
val = (val - 0x7f) * 0xff;
|
||||
if (is_neg && val > 0)
|
||||
val = 0;
|
||||
else if (is_pos && val < 0)
|
||||
val = 0;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void ps3_joypad_poll(void)
|
||||
{
|
||||
padInfo padinfo;
|
||||
ioPadGetInfo(&padinfo);
|
||||
for(int port=0; port<MAX_PADS; port++){
|
||||
if(padinfo.status[port]){
|
||||
ioPadGetData(port, &pad_state[port]);
|
||||
}
|
||||
if (!pads_connected[port] && padinfo.status[port]) {
|
||||
ps3_joypad_autodetect_add(port);
|
||||
pads_connected[port] = 1;
|
||||
} else
|
||||
{
|
||||
input_autoconfigure_disconnect(port, ps3_joypad.ident);
|
||||
pads_connected[port] = 0;
|
||||
}
|
||||
|
||||
pads_connected[port] = padinfo.status[port];
|
||||
}
|
||||
}
|
||||
|
||||
static bool ps3_joypad_query_pad(unsigned pad)
|
||||
{
|
||||
return pad < MAX_USERS && transform_buttons(&pad_state[pad]);
|
||||
}
|
||||
|
||||
static bool ps3_joypad_rumble(unsigned pad,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ps3_joypad_destroy(void)
|
||||
{
|
||||
RARCH_LOG("alive " __FILE__ ":%d\n", __LINE__);
|
||||
}
|
||||
|
||||
input_device_driver_t ps3_joypad = {
|
||||
ps3_joypad_init,
|
||||
ps3_joypad_query_pad,
|
||||
ps3_joypad_destroy,
|
||||
ps3_joypad_button,
|
||||
ps3_joypad_get_buttons,
|
||||
ps3_joypad_axis,
|
||||
ps3_joypad_poll,
|
||||
ps3_joypad_rumble,
|
||||
ps3_joypad_name,
|
||||
"ps3",
|
||||
};
|
||||
@@ -338,7 +338,7 @@ static int16_t psp_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+31
-12
@@ -135,7 +135,6 @@ static void qnx_process_gamepad_event(
|
||||
int i;
|
||||
screen_device_t device;
|
||||
qnx_input_device_t* controller = NULL;
|
||||
uint64_t *state_cur = NULL;
|
||||
|
||||
(void)type;
|
||||
|
||||
@@ -307,18 +306,35 @@ static void qnx_handle_device(qnx_input_t *qnx,
|
||||
}
|
||||
|
||||
/* Find currently connected gamepads. */
|
||||
static void qnx_discover_controllers(qnx_input_t *qnx)
|
||||
static int qnx_discover_controllers(qnx_input_t *qnx)
|
||||
{
|
||||
/* Get an array of all available devices. */
|
||||
int deviceCount;
|
||||
int deviceCount = 0;
|
||||
int ret;
|
||||
unsigned i;
|
||||
|
||||
screen_get_context_property_iv(screen_ctx,
|
||||
ret = screen_get_context_property_iv(screen_ctx,
|
||||
SCREEN_PROPERTY_DEVICE_COUNT, &deviceCount);
|
||||
if (ret < 0) {
|
||||
RARCH_ERR("Error querying SCREEN_PROPERTY_DEVICE_COUNT: [%d] %s\n",
|
||||
errno, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
screen_device_t* devices_found = (screen_device_t*)
|
||||
calloc(deviceCount, sizeof(screen_device_t));
|
||||
screen_get_context_property_pv(screen_ctx,
|
||||
if (!devices_found) {
|
||||
RARCH_ERR("Error allocating devices_found, deviceCount=%d\n",
|
||||
deviceCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = screen_get_context_property_pv(screen_ctx,
|
||||
SCREEN_PROPERTY_DEVICES, (void**)devices_found);
|
||||
if (ret < 0) {
|
||||
RARCH_ERR("Error querying SCREEN_PROPERTY_DEVICES: [%d] %s\n",
|
||||
errno, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Scan the list for gamepad and joystick devices. */
|
||||
for(i = 0; i < qnx->pads_connected; ++i)
|
||||
@@ -348,6 +364,8 @@ static void qnx_discover_controllers(qnx_input_t *qnx)
|
||||
}
|
||||
|
||||
free(devices_found);
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -596,7 +614,6 @@ static void qnx_handle_screen_event(qnx_input_t *qnx, bps_event_t *event)
|
||||
static void qnx_handle_navigator_event(
|
||||
qnx_input_t *qnx, bps_event_t *event)
|
||||
{
|
||||
navigator_window_state_t state;
|
||||
bps_event_t *event_pause = NULL;
|
||||
|
||||
switch (bps_event_get_code(event))
|
||||
@@ -652,9 +669,6 @@ static void qnx_handle_navigator_event(
|
||||
|
||||
return;
|
||||
|
||||
togglemenu:
|
||||
command_event(CMD_EVENT_MENU_TOGGLE, NULL);
|
||||
return;
|
||||
shutdown:
|
||||
rarch_ctl(RARCH_CTL_SET_SHUTDOWN, NULL);
|
||||
return;
|
||||
@@ -808,19 +822,24 @@ static int16_t qnx_input_state(void *data,
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
if (qnx_is_pressed(
|
||||
qnx, joypad_info, port, binds[port], i))
|
||||
qnx, joypad_info, binds[port], port, i))
|
||||
{
|
||||
ret |= (1 << i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
if (qnx_is_pressed(qnx, joypad_info, port, binds[port], id))
|
||||
if (qnx_is_pressed(qnx, joypad_info, binds[port], port, id))
|
||||
return true;
|
||||
break;
|
||||
case RETRO_DEVICE_ANALOG:
|
||||
if (binds[port])
|
||||
return input_joypad_analog(qnx->joypad, joypad_info,
|
||||
port, idx, id, binds[port]);
|
||||
return 0;
|
||||
case RETRO_DEVICE_KEYBOARD:
|
||||
return qnx_keyboard_pressed(qnx, id);
|
||||
case RETRO_DEVICE_POINTER:
|
||||
|
||||
@@ -536,7 +536,7 @@ static int16_t rwebinput_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -244,7 +244,7 @@ static int16_t sdl_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -407,7 +407,7 @@ static int16_t switch_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1027,7 +1027,7 @@ static int16_t udev_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <uwp/uwp_func.h>
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
// TODO: Add support for multiple mice and multiple touch
|
||||
|
||||
@@ -195,7 +196,7 @@ static int16_t uwp_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -322,7 +322,7 @@ static int16_t input_wl_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../input_keymaps.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#include "wiiu_dbg.h"
|
||||
|
||||
@@ -161,7 +162,7 @@ static int16_t wiiu_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -721,7 +721,7 @@ static int16_t winraw_input_state(void *d,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -321,8 +321,8 @@ static int16_t x_input_state(void *data,
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "../../config.def.h"
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -87,7 +88,7 @@ static int16_t xdk_input_state(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "../../config.def.h"
|
||||
|
||||
#include "../input_driver.h"
|
||||
#include "../../retorarch.h"
|
||||
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
@@ -83,7 +84,7 @@ static int16_t xenon360_input_state(void *data,
|
||||
ret |= (1 << i);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret|get_gamepad_input_override();
|
||||
}
|
||||
else
|
||||
if (state[port] & binds[port][id].joykey)
|
||||
|
||||
@@ -158,24 +158,6 @@ static void ps3_joypad_poll(void)
|
||||
{
|
||||
uint64_t *state_cur = &pad_state[port];
|
||||
*state_cur = 0;
|
||||
#ifdef __PSL1GHT__
|
||||
*state_cur |= (state_tmp.BTN_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
*state_cur |= (state_tmp.BTN_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
*state_cur |= (state_tmp.BTN_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
*state_cur |= (state_tmp.BTN_UP) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
*state_cur |= (state_tmp.BTN_START) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_START) : 0;
|
||||
*state_cur |= (state_tmp.BTN_R3) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R3) : 0;
|
||||
*state_cur |= (state_tmp.BTN_L3) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L3) : 0;
|
||||
*state_cur |= (state_tmp.BTN_SELECT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_SELECT) : 0;
|
||||
*state_cur |= (state_tmp.BTN_TRIANGLE) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X) : 0;
|
||||
*state_cur |= (state_tmp.BTN_SQUARE) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y) : 0;
|
||||
*state_cur |= (state_tmp.BTN_CROSS) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B) : 0;
|
||||
*state_cur |= (state_tmp.BTN_CIRCLE) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A) : 0;
|
||||
*state_cur |= (state_tmp.BTN_R1) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R) : 0;
|
||||
*state_cur |= (state_tmp.BTN_L1) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L) : 0;
|
||||
*state_cur |= (state_tmp.BTN_R2) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R2) : 0;
|
||||
*state_cur |= (state_tmp.BTN_L2) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_L2) : 0;
|
||||
#else
|
||||
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_LEFT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_DOWN) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_RIGHT) ? (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
@@ -222,7 +204,6 @@ static void ps3_joypad_poll(void)
|
||||
accelerometer_state[port].x = state_tmp.button[CELL_PAD_BTN_OFFSET_SENSOR_X];
|
||||
accelerometer_state[port].y = state_tmp.button[CELL_PAD_BTN_OFFSET_SENSOR_Y];
|
||||
accelerometer_state[port].z = state_tmp.button[CELL_PAD_BTN_OFFSET_SENSOR_Z];
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1685,6 +1685,15 @@ int menu_hash_get_help_ar_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Smoothens picture with bilinear filtering. \n"
|
||||
"Should be disabled if using shaders.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
|
||||
snprintf(s, len,
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
"RGA scaling and bicubic filtering. May break widgets."
|
||||
#else
|
||||
"Hardware context scaling (if available)."
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
snprintf(s, len,
|
||||
"Shows current date and/or time inside menu.");
|
||||
|
||||
@@ -1503,6 +1503,15 @@ int menu_hash_get_help_chs_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"用双线性过滤使图像平滑。 \n"
|
||||
"如果你使用了渲染器,请关闭它。");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
|
||||
snprintf(s, len,
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
"RGA scaling and bicubic filtering. May break widgets."
|
||||
#else
|
||||
"Hardware context scaling (if available)."
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
snprintf(s, len,
|
||||
"在菜单中显示当前日期和时间。");
|
||||
|
||||
@@ -1548,6 +1548,15 @@ int menu_hash_get_help_cht_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Smoothens picture with bilinear filtering. \n"
|
||||
"Should be disabled if using shaders.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
|
||||
snprintf(s, len,
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
"RGA scaling and bicubic filtering. May break widgets."
|
||||
#else
|
||||
"Hardware context scaling (if available)."
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
snprintf(s, len,
|
||||
"在選單內顯示當前日期或時間.");
|
||||
|
||||
@@ -1683,6 +1683,15 @@ int menu_hash_get_help_de_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Bild mit bilinearer Filterung glätten. \n"
|
||||
"Sollte deaktiviert werden, wenn Shader verwendet werden.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
|
||||
snprintf(s, len,
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
"RGA scaling and bicubic filtering. May break widgets."
|
||||
#else
|
||||
"Hardware context scaling (if available)."
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
snprintf(s, len,
|
||||
"Zeigt das aktuelle Datum/die aktuelle Zeit im Menü an.");
|
||||
|
||||
@@ -1752,6 +1752,15 @@ int menu_hash_get_help_el_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Smoothens picture with bilinear filtering. \n"
|
||||
"Should be disabled if using shaders.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
|
||||
snprintf(s, len,
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
"RGA scaling and bicubic filtering. May break widgets."
|
||||
#else
|
||||
"Hardware context scaling (if available)."
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
snprintf(s, len,
|
||||
"Shows current date and/or time inside menu.");
|
||||
|
||||
+9
-4
@@ -690,7 +690,6 @@ int menu_hash_get_help_es_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
snprintf(s, len,
|
||||
"Opacidad de la superposición.");
|
||||
break;
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
case MENU_ENUM_LABEL_VIDEO_LAYOUT_ENABLE:
|
||||
snprintf(s, len,
|
||||
"Activa o desactiva el diseño de vídeo actual.");
|
||||
@@ -704,7 +703,6 @@ int menu_hash_get_help_es_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Los diseños pueden contener múltiples vistas.\n"
|
||||
"Selecciona una.");
|
||||
break;
|
||||
#endif
|
||||
case MENU_ENUM_LABEL_INPUT_BIND_TIMEOUT:
|
||||
snprintf(s, len,
|
||||
"Tiempo de espera para asignar una función\n"
|
||||
@@ -1936,6 +1934,15 @@ int menu_hash_get_help_es_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Suaviza la imagen con un filtro bilineal.\n"
|
||||
"Desactiva esta opción si utilizas shaders.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_CTX_SCALING:
|
||||
snprintf(s, len,
|
||||
#ifdef HAVE_ODROIDGO2
|
||||
"RGA scaling and bicubic filtering. May break widgets."
|
||||
#else
|
||||
"Hardware context scaling (if available)."
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
snprintf(s, len,
|
||||
"Muestra la fecha o la hora actuales\n"
|
||||
@@ -2008,7 +2015,6 @@ int menu_hash_get_help_es_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Define la carpeta que contiene\n"
|
||||
"las superposiciones.");
|
||||
break;
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
case MENU_ENUM_LABEL_VIDEO_LAYOUT_DIRECTORY:
|
||||
snprintf(s, len,
|
||||
"Carpeta de diseños de vídeo.\n"
|
||||
@@ -2016,7 +2022,6 @@ int menu_hash_get_help_es_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Define la carpeta que contiene\n"
|
||||
"los diseños de vídeo.");
|
||||
break;
|
||||
#endif
|
||||
case MENU_ENUM_LABEL_INPUT_MAX_USERS:
|
||||
snprintf(s, len,
|
||||
"Indica el número máximo de usuarios\n"
|
||||
|
||||
+56
-18
@@ -2323,7 +2323,6 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_ONSCREEN_OVERLAY_SETTINGS,
|
||||
"Ajusta los controles en pantalla y los marcos."
|
||||
)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_ONSCREEN_VIDEO_LAYOUT_SETTINGS,
|
||||
"Diseño de vídeo"
|
||||
@@ -2332,7 +2331,6 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_ONSCREEN_VIDEO_LAYOUT_SETTINGS,
|
||||
"Ajusta el diseño de vídeo."
|
||||
)
|
||||
#endif
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_ONSCREEN_NOTIFICATIONS_SETTINGS,
|
||||
"Notificaciones"
|
||||
@@ -2361,12 +2359,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY,
|
||||
"Superposiciones"
|
||||
)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_LAYOUT_DIRECTORY,
|
||||
"Diseño de vídeo"
|
||||
)
|
||||
#endif
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY,
|
||||
"Opacidad"
|
||||
@@ -4367,7 +4363,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_FULLSCREEN_Y,
|
||||
"Alto en pantalla completa"
|
||||
)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_LAYOUT_ENABLE,
|
||||
"Activar diseño de vídeo"
|
||||
@@ -4392,7 +4387,6 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_LAYOUT_SELECTED_VIEW,
|
||||
"Selecciona una vista del diseño cargado."
|
||||
)
|
||||
#endif
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_WIFI_DRIVER,
|
||||
"Controlador wifi"
|
||||
@@ -6940,12 +6934,10 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_DIRECTORY,
|
||||
"En esta carpeta se guardan las superposiciones."
|
||||
)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_LAYOUT_DIRECTORY,
|
||||
"En esta carpeta se guardan los diseños de vídeo."
|
||||
)
|
||||
#endif
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_CHEAT_DATABASE_PATH,
|
||||
"En esta carpeta se guardan los archivos de trucos."
|
||||
@@ -7833,7 +7825,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_OVERLAYS,
|
||||
"Mostrar opciones de superposición"
|
||||
)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_VIDEO_LAYOUT,
|
||||
"Mostrar opciones de diseño de vídeo"
|
||||
@@ -7842,7 +7833,6 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_CONTENT_SHOW_VIDEO_LAYOUT,
|
||||
"Muestra las opciones de diseño de vídeo."
|
||||
)
|
||||
#endif
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_AUDIO_ENABLE_MENU,
|
||||
"Mezclador de audio"
|
||||
@@ -9458,17 +9448,53 @@ MSG_HASH(
|
||||
"AAAA/MM/DD - HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY,
|
||||
"MM/DD/AAAA - HH:MM"
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_YMD,
|
||||
"AAAA/MM/DD"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DM_HM,
|
||||
"DD/MM - HH:MM"
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_YM,
|
||||
"AAAA/MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY_HMS,
|
||||
"MM/DD/AAAA - HH:MM:SS"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY_HM,
|
||||
"MM/DD/AAAA - HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MD_HM,
|
||||
"MM/DD - HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY,
|
||||
"MM/DD/AAAA"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MD,
|
||||
"MM/DD"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMMYYYY_HMS,
|
||||
"DD/MM/AAAA - HH:MM:SS"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMMYYYY_HM,
|
||||
"DD/MM/AAAA - HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMM_HM,
|
||||
"DD/MM - HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMMYYYY,
|
||||
"DD/MM/AAAA"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMM,
|
||||
"DD/MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_YMD_HMS_AM_PM,
|
||||
"AAAA/MM/DD - HH:MM:SS (AM/PM)"
|
||||
@@ -9478,17 +9504,29 @@ MSG_HASH(
|
||||
"AAAA/MM/DD - HH:MM (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY_AM_PM,
|
||||
"MM/DD/AAAA - HH:MM (AM/PM)"
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY_HMS_AM_PM,
|
||||
"MM/DD/AAAA - HH:MM:SS (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DM_HM_AM_PM,
|
||||
"DD/MM - HH:MM (AM/PM)"
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MDYYYY_HM_AM_PM,
|
||||
"MM/DD/AAAA - HH:MM (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_MD_HM_AM_PM,
|
||||
"MM/DD - HH:MM (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMMYYYY_HMS_AM_PM,
|
||||
"DD/MM/AAAA - HH:MM:SS (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMMYYYY_HM_AM_PM,
|
||||
"DD/MM/AAAA - HH:MM (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE_DDMM_HM_AM_PM,
|
||||
"DD/MM - HH:MM (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_FUZZY_ARCHIVE_MATCH,
|
||||
"Búsqueda difusa de archivos"
|
||||
|
||||
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user