Skip to content

Commit

Permalink
Merge branch 'libretro:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kokoko3k authored Mar 5, 2024
2 parents fd4e0b1 + 952ac2a commit 0a9d96c
Show file tree
Hide file tree
Showing 91 changed files with 35,282 additions and 1,181 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/webOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI webOS

on:
push:
pull_request:
repository_dispatch:
types: [run_build]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v4

- name: Download ares-cli-rs
uses: robinraju/[email protected]
with:
repository: "webosbrew/ares-cli-rs"
latest: true
fileName: "ares-package_*.deb"
out-file-path: "temp"

- name: Update packages
run: sudo apt-get -yq update

- name: Install webOS CLI
run: sudo apt-get -yq install ./temp/*.deb

- name: Download webOS NDK
uses: robinraju/[email protected]
with:
repository: "openlgtv/buildroot-nc4"
latest: true
fileName: "arm-webos-linux-gnueabi_sdk-buildroot.tar.gz"
out-file-path: "/tmp"

- name: Extract webOS NDK
shell: bash
working-directory: /tmp
run: |
tar xzf arm-webos-linux-gnueabi_sdk-buildroot.tar.gz
./arm-webos-linux-gnueabi_sdk-buildroot/relocate-sdk.sh
- name: Compile RA
run: |
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
make -f Makefile.webos ADD_SDL2_LIB=1 -j$(getconf _NPROCESSORS_ONLN)
52 changes: 35 additions & 17 deletions Makefile.webos
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
include version.all

$(call assert,$(call seq,$(TARGET_PREFIX),arm-webos-linux-gnueabi-),webOS SDK isn't setup properly. See https://github.com/webosbrew/meta-lg-webos-ndk#compile-program-by-command-line)
ifneq ($(CROSS_COMPILE),arm-webos-linux-gnueabi-)
$(error You need webOS toolchain to build this. See https://github.com/webosbrew/native-toolchain)
endif

ifdef SDKTARGETSYSROOT
$(warning OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain)
STAGING_DIR = $(SDKTARGETSYSROOT)
else ifndef STAGING_DIR
$(error Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain)
endif

WEBOS_FREETYPE_CONFIG ?= $(STAGING_DIR)/usr/bin/freetype-config

WEBOS_FREETYPE_CONFIG ?= $(SDKTARGETSYSROOT)/usr/bin/freetype-config
WEBOS_INC_DIR ?= $(STAGING_DIR)/usr/include
WEBOS_LIB_DIR ?= $(STAGING_DIR)/usr/lib

WEBOS_INC_DIR ?= $(SDKTARGETSYSROOT)/usr/include
WEBOS_LIB_DIR ?= $(SDKTARGETSYSROOT)/usr/lib
ADD_SDL2_LIB ?= 0
SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.0-2/SDL2-2.30.0-webos.tar.gz

ADD_SDL2_LIB ?= 0

#########################
#########################

Expand Down Expand Up @@ -122,15 +132,15 @@ OS = Linux
TARGET = retroarch

OBJ :=
LINK := $(CXX)
LINK := $(CC)
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
LIBS := -ldl -lz -lrt -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections
LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections
INCLUDE_DIRS = -I$(WEBOS_INC_DIR)
LIBRARY_DIRS = -L$(WEBOS_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
Expand All @@ -142,12 +152,12 @@ DEFINES += -DHAVE_PULSE
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
DEFINES += -DHAVE_UPDATE_CORE_INFO

PKG_CONFIG=$(SDKTARGETSYSROOT)/../../bin/pkg-config

SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2)
SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2)
PKG_CONFIG=pkg-config
SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2)
SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2)
OPENGLES_LIBS = -lGLESv2
PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse)
PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse)
MMAP_LIBS = -lc
NEON_CFLAGS = -mfpu=neon
NEON_ASFLAGS = -mfpu=neon
Expand Down Expand Up @@ -225,18 +235,26 @@ clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf SDL
rm -rf webos/*.ipk
rm -rf webos/dist

ipk: $(TARGET)
sdl2: $(TARGET)
ifeq ($(ADD_SDL2_LIB), 1)
@echo "Downloading SDL2 prebuilt"
mkdir -p SDL
wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf -
endif

ipk: $(TARGET) sdl2
rm -rf webos/dist
mkdir -p webos/dist/lib
echo "$$APPINFO" > webos/dist/appinfo.json
cp -t webos/dist -vf $(TARGET) webos/icon160.png
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libstdc++.so.6
ifeq ($(ADD_SDL2_LIB), 1)
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libSDL2-2.0.so.0
endif
ifeq ($(ADD_SDL2_LIB), 1)
cp -t webos/dist/lib -vf SDL/lib/libSDL2-2.0.so.0
endif
$(STRIP) webos/dist/$(TARGET)
cd webos && ares-package dist

Expand Down
2 changes: 1 addition & 1 deletion config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@
#if defined(HAKCHI)
#define DEFAULT_BUILDBOT_SERVER_URL "http://hakchicloud.com/Libretro_Cores/"
#elif defined(WEBOS)
#define DEFAULT_BUILDBOT_SERVER_URL "https://www.webosbrew.org/retroarch-cores/armv7a/"
#define DEFAULT_BUILDBOT_SERVER_URL "http://retroarch-cores.webosbrew.org/armv7a/"
#elif defined(ANDROID)
#if defined(ANDROID_ARM_V7)
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"
Expand Down
1 change: 1 addition & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -5082,6 +5082,7 @@ bool config_save_autoconf_profile(const
}
}

RARCH_LOG("[Autoconf]: Writing autoconf file for device \"%s\" to \"%s\".\n", device_name, autoconf_file);
ret = config_file_write(conf, autoconf_file, false);

end:
Expand Down
1 change: 1 addition & 0 deletions frontend/frontend_salamander.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ static void salamander_init(char *s, size_t len)
{
config_set_path(config, "libretro_path", s);
config_file_write(config, config_path, false);
RARCH_DBG("Salamander config file written to \"%s\".\n", config_path);
config_file_free(config);
}
}
Expand Down
37 changes: 37 additions & 0 deletions gfx/common/uwpgdi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef UWPGDI_H_
#define UWPGDI_H_


#include <windows.h>

#include <GL/gl.h>

#if !defined(_GDI32_)
#define WINGDIAPI_UWP __declspec(dllimport)
#else
#define WINGDIAPI_UWP __declspec(dllexport)
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
* Undeclared APIs exported by libgallium on UWP
*/

WINGDIAPI_UWP HGLRC WINAPI wglCreateContext(HDC);
WINGDIAPI_UWP BOOL WINAPI wglDeleteContext(HGLRC);
WINGDIAPI_UWP BOOL WINAPI wglMakeCurrent(HDC, HGLRC);
WINGDIAPI_UWP BOOL APIENTRY wglSwapBuffers(HDC hdc);
WINGDIAPI_UWP PROC APIENTRY wglGetProcAddress(LPCSTR lpszProc);
WINGDIAPI_UWP BOOL APIENTRY wglShareLists(
HGLRC unnamedParam1,
HGLRC unnamedParam2
);

#ifdef __cplusplus
}
#endif

#endif UWPGDI_H_
14 changes: 13 additions & 1 deletion gfx/drivers/gl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4085,6 +4085,11 @@ static const gfx_ctx_driver_t *gl2_get_context(gl2_t *gl)
major = 3;
minor = 0;
}
else
{
major = 2;
minor = 0;
}
#else
enum gfx_ctx_api api = GFX_CTX_OPENGL_API;
#endif
Expand Down Expand Up @@ -4348,7 +4353,14 @@ static void *gl2_init(const video_info_t *video,
goto error;

if (!string_is_empty(version))
sscanf(version, "%d.%d", &gl->version_major, &gl->version_minor);
{
if (string_starts_with(version, "OpenGL ES "))
sscanf(version, "OpenGL ES %d.%d", &gl->version_major, &gl->version_minor);
else if (string_starts_with(version, "OpenGL "))
sscanf(version, "OpenGL %d.%d", &gl->version_major, &gl->version_minor);
else
sscanf(version, "%d.%d", &gl->version_major, &gl->version_minor);
}

{
size_t len = 0;
Expand Down
Loading

0 comments on commit 0a9d96c

Please sign in to comment.