Skip to content

Commit

Permalink
OpenDingux port improvements: Phase 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgleaver committed Oct 1, 2020
1 parent 9444117 commit 3bd66cc
Show file tree
Hide file tree
Showing 26 changed files with 1,136 additions and 137 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,6 @@ gfx/common/wayland/xdg-decoration-unstable-v1.h
gfx/common/wayland/xdg-decoration-unstable-v1.c
gfx/common/wayland/xdg-shell.c
gfx/common/wayland/xdg-shell.h

# DINGUX
*.opk
6 changes: 5 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,10 @@ ifeq ($(TARGET), retroarch_orbis)
frontend/drivers/platform_orbis.o
endif

ifeq ($(DINGUX), 1)
OBJ += dingux/dingux_utils.o
endif

ifeq ($(HAVE_WAYLAND), 1)
OBJ += gfx/drivers_context/wayland_ctx.o \
input/common/wayland_common.o \
Expand Down Expand Up @@ -2328,7 +2332,7 @@ endif
### Android Play Feature Delivery ###
### (Play Store build core ###
### downloader) ###
###############WIP###################
#####################################
ifeq ($(ANDROID), 1)
OBJ += play_feature_delivery/play_feature_delivery.o
endif
Expand Down
1 change: 1 addition & 0 deletions Makefile.dingux
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PACKAGE_NAME = retroarch

DEBUG ?= 0

DINGUX = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_7ZIP = 1
Expand Down
189 changes: 189 additions & 0 deletions Makefile.rg350
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
TOOLCHAIN_DIR=/opt/gcw0-toolchain/usr/bin
CC = $(TOOLCHAIN_DIR)/mipsel-gcw0-linux-uclibc-gcc
CXX = $(TOOLCHAIN_DIR)/mipsel-gcw0-linux-uclibc-g++
PACKAGE_NAME = retroarch

DEBUG ?= 0

DINGUX = 1
HAVE_SCREENSHOTS = 0
HAVE_REWIND = 1
HAVE_7ZIP = 1
HAVE_AL = 1
# ALSA freezes when switching back from menu
HAVE_ALSA = 0
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 1
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_CHD = 1
HAVE_COMMAND = 1
HAVE_CXX = 1
HAVE_DR_MP3 = 1
HAVE_DYNAMIC = 1
HAVE_EGL = 0
HAVE_FREETYPE = 0
HAVE_GDI = 1
HAVE_GETADDRINFO = 1
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 = 1
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 = 1
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

OS = Linux
TARGET = retroarch
OPK_NAME = retroarch_rg350.opk

OBJ :=
LINK := $(CXX)
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE
LIBS := -ldl -lz -lrt -lcrypto -lssl -ludev -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -flto
INCLUDE_DIRS = -I/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
LIBRARY_DIRS = -L/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
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_AL=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_UDEV=1

SDL_DINGUX_CFLAGS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config --cflags)
SDL_DINGUX_LIBS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config --libs)
FREETYPE_CFLAGS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config --cflags)
FREETYPE_LIBS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/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 += -O2 -DNDEBUG
endif

include Makefile.common

DEF_FLAGS += $(INCLUDE_DIRS)
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=Retroarch
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 $@),)
$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)

$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<

$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<

$(OBJDIR)/%.o: %.m
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo OBJC $<),)
$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<

$(OBJDIR)/%.o: %.S $(HEADERS)
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo AS $<),)
$(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.gcw0.desktop
rm -f $(OPK_NAME)
cp media/ico_src/icon32.png retroarch.png
$(TOOLCHAIN_DIR)/mksquashfs retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
rm -f default.gcw0.desktop retroarch.png

.PHONY: all clean opk

print-%:
@echo '$*=$($*)'
16 changes: 14 additions & 2 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@

/* To start in Fullscreen, or not. */

#ifdef HAVE_STEAM
/* Start in fullscreen mode for Steam build */
#if defined(HAVE_STEAM) || defined(DINGUX)
/* Start in fullscreen mode for Steam and
* Dingux builds */
#define DEFAULT_FULLSCREEN true
#else
#define DEFAULT_FULLSCREEN false
Expand All @@ -199,8 +200,13 @@

/* Fullscreen resolution. A value of 0 uses the desktop
* resolution. */
#if defined(DINGUX)
#define DEFAULT_FULLSCREEN_X 320
#define DEFAULT_FULLSCREEN_Y 240
#else
#define DEFAULT_FULLSCREEN_X 0
#define DEFAULT_FULLSCREEN_Y 0
#endif

/* Number of threads to use for video recording */
#define DEFAULT_VIDEO_RECORD_THREADS 2
Expand Down Expand Up @@ -355,6 +361,12 @@
#define DEFAULT_ASPECT_RATIO_IDX ASPECT_RATIO_CORE
#endif

#if defined(DINGUX)
/* Enables aspect ratio correction (1:1 PAR) when
* using the IPU hardware scaler in Dingux devices */
#define DEFAULT_DINGUX_IPU_KEEP_ASPECT true
#endif

/* Save configuration file on exit. */
#define DEFAULT_CONFIG_SAVE_ON_EXIT true

Expand Down
9 changes: 5 additions & 4 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,9 @@ static const enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_ANDROI
static const enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
#endif

#if defined(_3DS) && defined(HAVE_RGUI)
#if (defined(_3DS) || defined(DINGUX)) && defined(HAVE_RGUI)
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI;
#else
#if defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_MATERIALUI;
#elif defined(HAVE_OZONE)
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_OZONE;
Expand All @@ -536,7 +535,6 @@ static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI;
#else
static const enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_NULL;
#endif
#endif

/* All config related settings go here. */

Expand Down Expand Up @@ -1458,6 +1456,9 @@ static struct config_bool_setting *populate_settings_bool(
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);
#if defined(DINGUX)
SETTING_BOOL("video_dingux_ipu_keep_aspect", &settings->bools.video_dingux_ipu_keep_aspect, true, DEFAULT_DINGUX_IPU_KEEP_ASPECT, false);
#endif
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);
SETTING_BOOL("auto_screenshot_filename", &settings->bools.auto_screenshot_filename, true, DEFAULT_AUTO_SCREENSHOT_FILENAME, false);
Expand Down
1 change: 1 addition & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ typedef struct settings
bool video_force_aspect;
bool video_crop_overscan;
bool video_aspect_ratio_auto;
bool video_dingux_ipu_keep_aspect;
bool video_scale_integer;
bool video_shader_enable;
bool video_shader_watch_files;
Expand Down
Loading

0 comments on commit 3bd66cc

Please sign in to comment.