mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 02:00:41 +00:00
Basic rs90 build
DINGUX_BETA has clock_gettime libogc Add tinyalsa support to rs90
This commit is contained in:
parent
3bc06b0d57
commit
f6aeb717ba
@ -668,7 +668,7 @@ else ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
|
||||
endif
|
||||
|
||||
# MinGW requires this for some reason,
|
||||
# MinGW requires this for some reason,
|
||||
# even though the include paths are relative to the source
|
||||
INCLUDE_DIRS += -Ideps/mbedtls
|
||||
|
||||
@ -1576,8 +1576,14 @@ else ifeq ($(HAVE_SDL), 1)
|
||||
else ifeq ($(HAVE_SDL_DINGUX), 1)
|
||||
HAVE_SDL_COMMON = 1
|
||||
DEF_FLAGS += -DHAVE_SDL -DHAVE_SDL_DINGUX
|
||||
OBJ += gfx/drivers/sdl_dingux_gfx.o \
|
||||
input/drivers/sdl_dingux_input.o \
|
||||
|
||||
ifeq ($(RS90), 1)
|
||||
OBJ += gfx/drivers/sdl_rs90_gfx.o
|
||||
else
|
||||
OBJ += gfx/drivers/sdl_dingux_gfx.o
|
||||
endif
|
||||
|
||||
OBJ += input/drivers/sdl_dingux_input.o \
|
||||
input/drivers_joypad/sdl_dingux_joypad.o
|
||||
DEF_FLAGS += $(SDL_DINGUX_CFLAGS)
|
||||
LIBS += $(SDL_DINGUX_LIBS)
|
||||
@ -2296,9 +2302,9 @@ ifeq ($(HAVE_CRTSWITCHRES), 1)
|
||||
$(DEPS_DIR)/switchres/resync_windows.o
|
||||
endif
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
OBJ += $(DEPS_DIR)/switchres/display_linux.o
|
||||
OBJ += $(DEPS_DIR)/switchres/display_linux.o
|
||||
ifeq ($(HAVE_X11)$(HAVE_XRANDR), 11)
|
||||
OBJ += $(DEPS_DIR)/switchres/custom_video_xrandr.o
|
||||
OBJ += $(DEPS_DIR)/switchres/custom_video_xrandr.o
|
||||
DEFINES += -DSR_WITH_XRANDR
|
||||
endif
|
||||
endif
|
||||
@ -2325,9 +2331,9 @@ ifeq ($(HAVE_COCOA_COMMON),1)
|
||||
OBJ += input/drivers/cocoa_input.o \
|
||||
ui/drivers/ui_cocoa.o \
|
||||
ui/drivers/cocoa/cocoa_common.o
|
||||
|
||||
|
||||
ifeq ($(HAVE_OPENGL), 1)
|
||||
DEFINES += -DGL_SILENCE_DEPRECATION
|
||||
DEFINES += -DGL_SILENCE_DEPRECATION
|
||||
OBJ += gfx/drivers_context/cocoa_gl_ctx.o
|
||||
endif
|
||||
ifeq ($(HAVE_VULKAN), 1)
|
||||
@ -2482,4 +2488,3 @@ ifeq ($(HAVE_ODROIDGO2), 1)
|
||||
endif
|
||||
|
||||
##################################
|
||||
|
||||
|
236
Makefile.rs90
Normal file
236
Makefile.rs90
Normal file
@ -0,0 +1,236 @@
|
||||
#########################
|
||||
## Toolchain variables ##
|
||||
#########################
|
||||
|
||||
# Alpha toolchain
|
||||
TOOLCHAIN_DIR=/opt/rs90-toolchain
|
||||
|
||||
# All toolchain-related variables may be
|
||||
# overridden via the command line
|
||||
ifdef GCW0_CC
|
||||
CC = $(GCW0_CC)
|
||||
else
|
||||
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-gcc
|
||||
endif
|
||||
|
||||
ifdef GCW0_CXX
|
||||
CXX = $(GCW0_CXX)
|
||||
else
|
||||
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-g++
|
||||
endif
|
||||
|
||||
ifdef GCW0_STRIP
|
||||
STRIP = $(GCW0_STRIP)
|
||||
else
|
||||
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-strip
|
||||
endif
|
||||
|
||||
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/bin/sdl-config
|
||||
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/bin/freetype-config
|
||||
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
||||
|
||||
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/include
|
||||
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
RS90 = 1
|
||||
DINGUX = 1
|
||||
DINGUX_BETA = 1
|
||||
HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 0
|
||||
# ALSA freezes when switching back from menu
|
||||
HAVE_ALSA = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_FILTERS_BUILTIN = 1
|
||||
HAVE_BUILTINMBEDTLS = 0
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
|
||||
HAVE_CHD = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_EGL = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_GDI = 1
|
||||
HAVE_GETADDRINFO = 0
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 0
|
||||
HAVE_HID = 1
|
||||
HAVE_IBXM = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LANGEXTRA = 0
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_GFX_WIDGETS = 0
|
||||
HAVE_MMAP = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 0
|
||||
HAVE_OPENGL = 0
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGLES = 0
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENSSL = 1
|
||||
HAVE_OVERLAY = 0
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_SDL_DINGUX = 1
|
||||
HAVE_SHADERPIPELINE = 0
|
||||
HAVE_STB_FONT = 0
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_UDEV = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_OZONE = 0
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_LIBSHAKE = 0
|
||||
HAVE_TINYALSA = 1
|
||||
HAVE_NEAREST_RESAMPLER = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
OPK_NAME = retroarch_rs90_odbeta.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -mplt -mno-shared
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DRS90=1 -DDINGUX=1 -DDINGUX_BETA=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURopendinguxCE -flto -lasound
|
||||
LIBS := -ldl -lz -lrt -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
DEFINES += -DHAVE_ALSA
|
||||
DEFINES += -DCC_RESAMPLER_PRECISION=0
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
||||
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
||||
# AL_LIBS := -lopenal
|
||||
MMAP_LIBS = -lc
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
DEF_FLAGS += -Ofast -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS)
|
||||
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS)
|
||||
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
Q := @
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define DESKTOP_ENTRY
|
||||
[Desktop Entry]
|
||||
Name=RetroArch
|
||||
Comment=Frontend for emulators, game engines
|
||||
Exec=retroarch
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Icon=retroarch
|
||||
Categories=emulators;
|
||||
X-OD-NeedsDownscaling=true
|
||||
endef
|
||||
export DESKTOP_ENTRY
|
||||
|
||||
all: $(TARGET) opk
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -rf $(OPK_NAME)
|
||||
|
||||
opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.rs90.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
ifeq ($STRIP_BIN, 1)
|
||||
$(STRIP) --strip-unneeded retroarch
|
||||
endif
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.rs90.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.rs90.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
@ -739,7 +739,9 @@ static const bool default_savefiles_in_content_dir = false;
|
||||
static const bool default_systemfiles_in_content_dir = false;
|
||||
static const bool default_screenshots_in_content_dir = false;
|
||||
|
||||
#if defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
|
||||
#if defined(RS90)
|
||||
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_START_SELECT
|
||||
#elif defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
|
||||
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_L3_R3
|
||||
#elif defined(PS2) || defined(PSP)
|
||||
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_HOLD_START
|
||||
|
@ -70,6 +70,7 @@ enum video_driver_enum
|
||||
VIDEO_SDL,
|
||||
VIDEO_SDL2,
|
||||
VIDEO_SDL_DINGUX,
|
||||
VIDEO_SDL_RS90,
|
||||
VIDEO_EXT,
|
||||
VIDEO_WII,
|
||||
VIDEO_WIIU,
|
||||
@ -311,7 +312,11 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL;
|
||||
#elif defined(HAVE_SDL2)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL2;
|
||||
#elif defined(HAVE_SDL_DINGUX)
|
||||
#if defined(RS90)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_RS90;
|
||||
#else
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_DINGUX;
|
||||
#endif
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GDI;
|
||||
#elif defined(DJGPP)
|
||||
@ -388,7 +393,9 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_EXT;
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_NULL;
|
||||
#endif
|
||||
|
||||
#if defined(PSP) || defined(EMSCRIPTEN)
|
||||
#if defined(RS90)
|
||||
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_NEAREST;
|
||||
#elif defined(PSP) || defined(EMSCRIPTEN)
|
||||
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_CC;
|
||||
#else
|
||||
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_SINC;
|
||||
@ -852,6 +859,8 @@ const char *config_get_default_video(void)
|
||||
return "xvideo";
|
||||
case VIDEO_SDL_DINGUX:
|
||||
return "sdl_dingux";
|
||||
case VIDEO_SDL_RS90:
|
||||
return "sdl_rs90";
|
||||
case VIDEO_SDL:
|
||||
return "sdl";
|
||||
case VIDEO_SDL2:
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2011-2017 - Higor Euripedes
|
||||
* Copyright (C) 2019-2021 - James Leaver
|
||||
*
|
||||
* 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-
|
||||
|
1187
gfx/drivers/sdl_rs90_gfx.c
Normal file
1187
gfx/drivers/sdl_rs90_gfx.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -467,6 +467,14 @@ VIDEO DRIVER
|
||||
#include "../gfx/common/sdl2_common.c"
|
||||
#endif
|
||||
|
||||
#if defined(DINGUX) && defined(HAVE_SDL_DINGUX)
|
||||
#if defined(RS90)
|
||||
#include "../gfx/drivers/sdl_rs90_gfx.c"
|
||||
#else
|
||||
#include "../gfx/drivers/sdl_dingux_gfx.c"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VG
|
||||
#include "../gfx/drivers/vg.c"
|
||||
#endif
|
||||
|
@ -31,6 +31,11 @@
|
||||
#include "../../configuration.h"
|
||||
#endif
|
||||
|
||||
#if !defined(RS90)
|
||||
#define SDL_DINGUX_HAS_ANALOG 1
|
||||
#define SDL_DINGUX_HAS_MENU_TOGGLE 1
|
||||
#endif
|
||||
|
||||
/* Simple joypad driver designed to rationalise
|
||||
* the bizarre keyboard/gamepad hybrid setup
|
||||
* of OpenDingux devices */
|
||||
@ -66,7 +71,9 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
SDL_Joystick *device;
|
||||
#endif
|
||||
#if defined(HAVE_LIBSHAKE)
|
||||
dingux_joypad_rumble_t rumble;
|
||||
#endif
|
||||
@ -74,11 +81,15 @@ typedef struct
|
||||
uint16_t pad_state;
|
||||
int16_t analog_state[2][2];
|
||||
bool connected;
|
||||
#if defined(SDL_DINGUX_HAS_MENU_TOGGLE)
|
||||
bool menu_toggle;
|
||||
#endif
|
||||
} dingux_joypad_t;
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_MENU_TOGGLE)
|
||||
/* TODO/FIXME - global referenced outside */
|
||||
extern uint64_t lifecycle_state;
|
||||
#endif
|
||||
|
||||
static dingux_joypad_t dingux_joypad;
|
||||
|
||||
@ -259,6 +270,7 @@ static void sdl_dingux_joypad_connect(void)
|
||||
{
|
||||
dingux_joypad_t *joypad = (dingux_joypad_t*)&dingux_joypad;
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
/* Open joypad device */
|
||||
if (SDL_NumJoysticks() > 0)
|
||||
joypad->device = SDL_JoystickOpen(0);
|
||||
@ -266,6 +278,7 @@ static void sdl_dingux_joypad_connect(void)
|
||||
/* If joypad exists, get number of axes */
|
||||
if (joypad->device)
|
||||
joypad->num_axes = SDL_JoystickNumAxes(joypad->device);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBSHAKE)
|
||||
/* Configure rumble interface */
|
||||
@ -289,8 +302,10 @@ static void sdl_dingux_joypad_disconnect(void)
|
||||
{
|
||||
dingux_joypad_t *joypad = (dingux_joypad_t*)&dingux_joypad;
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
if (joypad->device)
|
||||
SDL_JoystickClose(joypad->device);
|
||||
#endif
|
||||
|
||||
if (joypad->connected)
|
||||
input_autoconfigure_disconnect(0, sdl_dingux_joypad.ident);
|
||||
@ -329,7 +344,9 @@ static void sdl_dingux_joypad_destroy(void)
|
||||
Shake_Quit();
|
||||
#endif
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_MENU_TOGGLE)
|
||||
BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void *sdl_dingux_joypad_init(void *data)
|
||||
@ -338,8 +355,11 @@ static void *sdl_dingux_joypad_init(void *data)
|
||||
uint32_t sdl_subsystem_flags = SDL_WasInit(0);
|
||||
|
||||
memset(joypad, 0, sizeof(dingux_joypad_t));
|
||||
#if defined(SDL_DINGUX_HAS_MENU_TOGGLE)
|
||||
BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
#endif
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
/* Initialise joystick subsystem, if required */
|
||||
if (sdl_subsystem_flags == 0)
|
||||
{
|
||||
@ -351,6 +371,7 @@ static void *sdl_dingux_joypad_init(void *data)
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBSHAKE)
|
||||
/* Initialise rumble interface */
|
||||
@ -397,6 +418,7 @@ static void sdl_dingux_joypad_get_buttons(unsigned port, input_bits_t *state)
|
||||
|
||||
static int16_t sdl_dingux_joypad_axis_state(unsigned port, uint32_t joyaxis)
|
||||
{
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
dingux_joypad_t *joypad = (dingux_joypad_t*)&dingux_joypad;
|
||||
int val = 0;
|
||||
int axis = -1;
|
||||
@ -437,6 +459,9 @@ static int16_t sdl_dingux_joypad_axis_state(unsigned port, uint32_t joyaxis)
|
||||
return 0;
|
||||
|
||||
return val;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int16_t sdl_dingux_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||
@ -465,16 +490,20 @@ static int16_t sdl_dingux_joypad_state(
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
const uint64_t joykey = (binds[i].joykey != NO_BTN)
|
||||
? binds[i].joykey : joypad_info->auto_binds[i].joykey;
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
const uint32_t joyaxis = (binds[i].joyaxis != AXIS_NONE)
|
||||
? binds[i].joyaxis : joypad_info->auto_binds[i].joyaxis;
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN &&
|
||||
#endif
|
||||
|
||||
if ((uint16_t)joykey != NO_BTN &&
|
||||
(joypad->pad_state & (1 << (uint16_t)joykey)))
|
||||
ret |= (1 << i);
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
else if (joyaxis != AXIS_NONE &&
|
||||
((float)abs(sdl_dingux_joypad_axis_state(port_idx, joyaxis))
|
||||
((float)abs(sdl_dingux_joypad_axis_state(port_idx, joyaxis))
|
||||
/ 0x8000) > joypad_info->axis_threshold)
|
||||
ret |= (1 << i);
|
||||
#endif
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -485,6 +514,7 @@ static void sdl_dingux_joypad_poll(void)
|
||||
dingux_joypad_t *joypad = (dingux_joypad_t*)&dingux_joypad;
|
||||
SDL_Event event;
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_MENU_TOGGLE)
|
||||
/* Note: The menu toggle key is an awkward special
|
||||
* case - the press/release events happen almost
|
||||
* instantaneously, and since we only sample once
|
||||
@ -496,6 +526,7 @@ static void sdl_dingux_joypad_poll(void)
|
||||
BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
joypad->menu_toggle = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* All digital inputs map to keyboard keys
|
||||
* - X: SDLK_SPACE
|
||||
@ -571,10 +602,12 @@ static void sdl_dingux_joypad_poll(void)
|
||||
case SDLK_LEFT:
|
||||
BIT16_SET(joypad->pad_state, RETRO_DEVICE_ID_JOYPAD_LEFT);
|
||||
break;
|
||||
#if defined(SDL_DINGUX_HAS_MENU_TOGGLE)
|
||||
case SDLK_HOME:
|
||||
BIT64_SET(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
joypad->menu_toggle = true;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -639,6 +672,7 @@ static void sdl_dingux_joypad_poll(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SDL_DINGUX_HAS_ANALOG)
|
||||
/* Analog inputs come from the joypad device,
|
||||
* if connected */
|
||||
if (joypad->device)
|
||||
@ -676,6 +710,7 @@ static void sdl_dingux_joypad_poll(void)
|
||||
(axis_value < -0x7FFF) ? -0x7FFF : axis_value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
input_device_driver_t sdl_dingux_joypad = {
|
||||
|
@ -872,7 +872,7 @@ bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
|
||||
int tickms = ps2_clock();
|
||||
now.tv_sec = tickms/1000;
|
||||
now.tv_nsec = tickms * 1000;
|
||||
#elif defined(__mips__) || defined(VITA) || defined(_3DS)
|
||||
#elif !defined(DINGUX_BETA) && (defined(__mips__) || defined(VITA) || defined(_3DS))
|
||||
struct timeval tm;
|
||||
|
||||
gettimeofday(&tm, NULL);
|
||||
|
@ -80,6 +80,22 @@
|
||||
#define RGUI_MIN_FB_WIDTH 256
|
||||
#define RGUI_MAX_FB_WIDTH 426
|
||||
|
||||
#if defined(DINGUX)
|
||||
#if defined(RS90)
|
||||
/* The RS-90 uses a fixed framebuffer size
|
||||
* of 240x160 */
|
||||
#define RGUI_DINGUX_ASPECT_RATIO RGUI_ASPECT_RATIO_3_2
|
||||
#define RGUI_DINGUX_FB_WIDTH 240
|
||||
#define RGUI_DINGUX_FB_HEIGHT 160
|
||||
#else
|
||||
/* Other Dingux devices (RG350 etc.) use a
|
||||
* fixed framebuffer size of 320x240 */
|
||||
#define RGUI_DINGUX_ASPECT_RATIO RGUI_ASPECT_RATIO_4_3
|
||||
#define RGUI_DINGUX_FB_WIDTH 320
|
||||
#define RGUI_DINGUX_FB_HEIGHT 240
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Maximum entry value length in characters
|
||||
* when using fixed with layouts
|
||||
* (i.e. Maximum possible 'spacing' as
|
||||
@ -1502,20 +1518,21 @@ static bool rgui_set_pixel_format_function(void)
|
||||
return transparency_supported;
|
||||
}
|
||||
|
||||
if ( string_is_equal(driver_ident, "ps2")) /* PS2 */
|
||||
if ( string_is_equal(driver_ident, "ps2")) /* PS2 */
|
||||
{
|
||||
argb32_to_pixel_platform_format = argb32_to_abgr1555;
|
||||
transparency_supported = false;
|
||||
}
|
||||
else if (string_is_equal(driver_ident, "gx")) /* GEKKO */
|
||||
else if (string_is_equal(driver_ident, "gx")) /* GEKKO */
|
||||
argb32_to_pixel_platform_format = argb32_to_rgb5a3;
|
||||
else if (string_is_equal(driver_ident, "psp1")) /* PSP */
|
||||
else if (string_is_equal(driver_ident, "psp1")) /* PSP */
|
||||
argb32_to_pixel_platform_format = argb32_to_abgr4444;
|
||||
else if (string_is_equal(driver_ident, "d3d10") || /* D3D10/11/12 */
|
||||
else if (string_is_equal(driver_ident, "d3d10") || /* D3D10/11/12 */
|
||||
string_is_equal(driver_ident, "d3d11") ||
|
||||
string_is_equal(driver_ident, "d3d12"))
|
||||
argb32_to_pixel_platform_format = argb32_to_bgra4444;
|
||||
else if (string_is_equal(driver_ident, "sdl_dingux")) /* DINGUX SDL */
|
||||
else if (string_is_equal(driver_ident, "sdl_dingux") || /* DINGUX SDL */
|
||||
string_is_equal(driver_ident, "sdl_rs90"))
|
||||
{
|
||||
argb32_to_pixel_platform_format = argb32_to_rgb565;
|
||||
transparency_supported = false;
|
||||
@ -3006,7 +3023,7 @@ static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const ch
|
||||
const char *wallpaper_key = NULL;
|
||||
bool success = false;
|
||||
#if defined(DINGUX)
|
||||
unsigned aspect_ratio = RGUI_ASPECT_RATIO_4_3;
|
||||
unsigned aspect_ratio = RGUI_DINGUX_ASPECT_RATIO;
|
||||
#else
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned aspect_ratio = settings->uints.menu_rgui_aspect_ratio;
|
||||
@ -5435,15 +5452,14 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui,
|
||||
* width value must be zero... */
|
||||
unsigned max_frame_buf_width = 424;
|
||||
#elif defined(DINGUX)
|
||||
/* Dingux devices use a fixed framebuffer size
|
||||
* of 320x240 */
|
||||
unsigned max_frame_buf_width = 320;
|
||||
/* Dingux devices use a fixed framebuffer size */
|
||||
unsigned max_frame_buf_width = RGUI_DINGUX_FB_WIDTH;
|
||||
#else
|
||||
struct video_viewport vp;
|
||||
unsigned max_frame_buf_width = RGUI_MAX_FB_WIDTH;
|
||||
#endif
|
||||
#if defined(DINGUX)
|
||||
unsigned aspect_ratio = RGUI_ASPECT_RATIO_4_3;
|
||||
unsigned aspect_ratio = RGUI_DINGUX_ASPECT_RATIO;
|
||||
unsigned aspect_ratio_lock = RGUI_ASPECT_RATIO_LOCK_NONE;
|
||||
#else
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -5469,9 +5485,8 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui,
|
||||
* values */
|
||||
rgui->frame_buf.height = p_disp->framebuf_height;
|
||||
#elif defined(DINGUX)
|
||||
/* Dingux devices use a fixed framebuffer size
|
||||
* of 320x240 */
|
||||
rgui->frame_buf.height = 240;
|
||||
/* Dingux devices use a fixed framebuffer size */
|
||||
rgui->frame_buf.height = RGUI_DINGUX_FB_HEIGHT;
|
||||
#else
|
||||
/* If window height is less than RGUI default
|
||||
* height of 240, allow the frame buffer to
|
||||
@ -6587,7 +6602,7 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
|
||||
bool bg_filler_thickness_enable = settings->bools.menu_rgui_background_filler_thickness_enable;
|
||||
bool border_filler_thickness_enable = settings->bools.menu_rgui_border_filler_thickness_enable;
|
||||
#if defined(DINGUX)
|
||||
unsigned aspect_ratio = RGUI_ASPECT_RATIO_4_3;
|
||||
unsigned aspect_ratio = RGUI_DINGUX_ASPECT_RATIO;
|
||||
unsigned aspect_ratio_lock = RGUI_ASPECT_RATIO_LOCK_NONE;
|
||||
#else
|
||||
unsigned aspect_ratio = settings->uints.menu_rgui_aspect_ratio;
|
||||
@ -6714,7 +6729,7 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
|
||||
if ((rgui->window_width != video_width) ||
|
||||
(rgui->window_height != video_height))
|
||||
{
|
||||
#if !defined(GEKKO)
|
||||
#if !defined(GEKKO) && !defined(DINGUX)
|
||||
/* If window width or height are less than the
|
||||
* RGUI default size of (320-426)x240, must enable
|
||||
* dynamic menu 'downscaling'.
|
||||
@ -6744,7 +6759,6 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
|
||||
case RGUI_ASPECT_RATIO_5_3_CENTRE:
|
||||
default_fb_width = 400;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* 4:3 */
|
||||
default_fb_width = 320;
|
||||
|
@ -7768,7 +7768,8 @@ unsigned menu_displaylist_build_list(
|
||||
case DISPLAYLIST_VIDEO_SCALING_SETTINGS_LIST:
|
||||
{
|
||||
#if defined(DINGUX)
|
||||
if (string_is_equal(settings->arrays.video_driver, "sdl_dingux"))
|
||||
if (string_is_equal(settings->arrays.video_driver, "sdl_dingux") ||
|
||||
string_is_equal(settings->arrays.video_driver, "sdl_rs90"))
|
||||
{
|
||||
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
|
||||
MENU_ENUM_LABEL_VIDEO_SCALE_INTEGER,
|
||||
|
@ -10954,7 +10954,8 @@ static bool setting_append_list(
|
||||
}
|
||||
|
||||
#if defined(DINGUX) && defined(DINGUX_BETA)
|
||||
if (string_is_equal(settings->arrays.video_driver, "sdl_dingux"))
|
||||
if (string_is_equal(settings->arrays.video_driver, "sdl_dingux") ||
|
||||
string_is_equal(settings->arrays.video_driver, "sdl_rs90"))
|
||||
{
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
@ -11209,7 +11210,8 @@ static bool setting_append_list(
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
|
||||
#if defined(DINGUX)
|
||||
if (string_is_equal(settings->arrays.video_driver, "sdl_dingux"))
|
||||
if (string_is_equal(settings->arrays.video_driver, "sdl_dingux") ||
|
||||
string_is_equal(settings->arrays.video_driver, "sdl_rs90"))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -14935,10 +14937,11 @@ static bool setting_append_list(
|
||||
general_read_handler);
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_VALUES(list, list_info, "cfg");
|
||||
|
||||
/* ps2 and sdl_dingux gfx drivers do not support
|
||||
* menu framebuffer transparency */
|
||||
/* ps2 and sdl_dingux/sdl_rs90 gfx drivers do
|
||||
* not support menu framebuffer transparency */
|
||||
if (!string_is_equal(settings->arrays.video_driver, "ps2") &&
|
||||
!string_is_equal(settings->arrays.video_driver, "sdl_dingux"))
|
||||
!string_is_equal(settings->arrays.video_driver, "sdl_dingux") &&
|
||||
!string_is_equal(settings->arrays.video_driver, "sdl_rs90"))
|
||||
{
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
|
@ -1874,6 +1874,7 @@ extern video_driver_t video_xvideo;
|
||||
extern video_driver_t video_sdl;
|
||||
extern video_driver_t video_sdl2;
|
||||
extern video_driver_t video_sdl_dingux;
|
||||
extern video_driver_t video_sdl_rs90;
|
||||
extern video_driver_t video_vg;
|
||||
extern video_driver_t video_omap;
|
||||
extern video_driver_t video_exynos;
|
||||
|
@ -645,8 +645,12 @@ static const video_driver_t *video_drivers[] = {
|
||||
&video_sdl2,
|
||||
#endif
|
||||
#ifdef HAVE_SDL_DINGUX
|
||||
#if defined(RS90)
|
||||
&video_sdl_rs90,
|
||||
#else
|
||||
&video_sdl_dingux,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_XVIDEO
|
||||
&video_xvideo,
|
||||
#endif
|
||||
@ -995,7 +999,7 @@ static input_device_driver_t *joypad_drivers[] = {
|
||||
};
|
||||
|
||||
#ifdef HAVE_HID
|
||||
static bool null_hid_joypad_query(void *data, unsigned pad) {
|
||||
static bool null_hid_joypad_query(void *data, unsigned pad) {
|
||||
return pad < MAX_USERS; }
|
||||
static const char *null_hid_joypad_name(
|
||||
void *data, unsigned pad) { return NULL; }
|
||||
@ -1665,7 +1669,7 @@ typedef struct discord_state discord_state_t;
|
||||
#endif
|
||||
|
||||
struct runloop
|
||||
{
|
||||
{
|
||||
retro_usec_t frame_time_last; /* int64_t alignment */
|
||||
|
||||
msg_queue_t msg_queue; /* ptr alignment */
|
||||
@ -1733,7 +1737,7 @@ struct rarch_state
|
||||
menu_input_t menu_input_state; /* retro_time_t alignment */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
rarch_timer_t shader_delay_timer; /* int64_t alignment */
|
||||
@ -1911,7 +1915,7 @@ struct rarch_state
|
||||
struct retro_subsystem_rom_info
|
||||
subsystem_data_roms[SUBSYSTEM_MAX_SUBSYSTEMS]
|
||||
[SUBSYSTEM_MAX_SUBSYSTEM_ROMS]; /* ptr alignment */
|
||||
|
||||
|
||||
gfx_ctx_driver_t current_video_context; /* ptr alignment */
|
||||
content_state_t content_st; /* ptr alignment */
|
||||
midi_event_t midi_drv_input_event; /* ptr alignment */
|
||||
@ -1989,7 +1993,7 @@ struct rarch_state
|
||||
size_t runahead_save_state_size;
|
||||
#endif
|
||||
|
||||
jmp_buf error_sjlj_context; /* 4-byte alignment,
|
||||
jmp_buf error_sjlj_context; /* 4-byte alignment,
|
||||
put it right before long */
|
||||
|
||||
turbo_buttons_t input_driver_turbo_btns; /* int32_t alignment */
|
||||
@ -2017,7 +2021,7 @@ struct rarch_state
|
||||
int reannounce;
|
||||
#endif
|
||||
|
||||
input_device_info_t input_device_info[MAX_INPUT_DEVICES];
|
||||
input_device_info_t input_device_info[MAX_INPUT_DEVICES];
|
||||
/* unsigned alignment */
|
||||
#ifdef HAVE_MENU
|
||||
menu_dialog_t dialog_st; /* unsigned alignment */
|
||||
@ -2093,7 +2097,7 @@ struct rarch_state
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_input_pointer_hw_state_t menu_input_pointer_hw_state;
|
||||
menu_input_pointer_hw_state_t menu_input_pointer_hw_state;
|
||||
/* int16_t alignment */
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user