Created
February 14, 2018 21:20
-
-
Save Miouyouyou/73f36a01ae28c99bfeb3ac4b087e72f6 to your computer and use it in GitHub Desktop.
Buggy patches for Reicast... It still does not work but it adds a RK3288 (Tinkerboard) option in the Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d21c904098ed99638e9b710fc065a03f7c4860a6 Mon Sep 17 00:00:00 2001 | |
From: Myy Miouyouyou <[email protected]> | |
Date: Wed, 14 Feb 2018 21:19:08 +0000 | |
Subject: [PATCH] Various buggy Rocky and GLES patches | |
--- | |
core/rend/gles/gles.cpp | 8 +++++++- | |
core/rend/gles/gles.h | 3 +++ | |
shell/linux/Makefile | 20 ++++++++++++++++---- | |
3 files changed, 26 insertions(+), 5 deletions(-) | |
diff --git a/core/rend/gles/gles.cpp b/core/rend/gles/gles.cpp | |
index a2bc1be..e68a9e9 100755 | |
--- a/core/rend/gles/gles.cpp | |
+++ b/core/rend/gles/gles.cpp | |
@@ -22,6 +22,9 @@ int fbdev = -1; | |
#endif | |
#endif | |
+#include <EGL/eglext.h> | |
+ | |
+ | |
/* | |
GL|ES 2 | |
Slower, smaller subset of gl2 | |
@@ -363,8 +366,11 @@ int screen_height; | |
gl.setup.native_wind=(EGLNativeWindowType)wind; | |
gl.setup.native_disp=(EGLNativeDisplayType)disp; | |
+ gl.setup.display = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, gl.setup.native_disp, NULL); | |
+ | |
//try to get a display | |
- gl.setup.display = eglGetDisplay(gl.setup.native_disp); | |
+ if(gl.setup.display == EGL_NO_DISPLAY) | |
+ gl.setup.display = eglGetDisplay(gl.setup.native_disp); | |
//if failed, get the default display (this will not happen in win32) | |
if(gl.setup.display == EGL_NO_DISPLAY) | |
diff --git a/core/rend/gles/gles.h b/core/rend/gles/gles.h | |
index c77e67f..458ce48 100755 | |
--- a/core/rend/gles/gles.h | |
+++ b/core/rend/gles/gles.h | |
@@ -9,7 +9,10 @@ | |
#include <OpenGLES/ES2/glext.h> | |
#else | |
#if !defined(TARGET_NACL32) | |
+#define EGL_EGLEXT_PROTOTYPES | |
+#define EGL_PLATFORM_GBM_KHR 0x31D7 | |
#include <EGL/egl.h> | |
+#include <EGL/eglext.h> | |
#endif | |
#include <GLES2/gl2.h> | |
#include <GLES2/gl2ext.h> | |
diff --git a/shell/linux/Makefile b/shell/linux/Makefile | |
index 3ec8c7c..b128739 100644 | |
--- a/shell/linux/Makefile | |
+++ b/shell/linux/Makefile | |
@@ -20,7 +20,7 @@ ASFLAGS := | |
LDFLAGS := | |
INCS := | |
LIBS := | |
-CFLAGS := | |
+CFLAGS := -I/usr/local/n64/include | |
CXXFLAGS := | |
# Platform auto-detection | |
@@ -43,6 +43,7 @@ ifeq (,$(platform)) | |
endif | |
else ifneq (,$(findstring arm,$(ARCH))) | |
HARDWARE = $(shell grep Hardware /proc/cpuinfo) | |
+ NODENAME = $(shell uname -n) | |
ifneq (,$(findstring BCM2709,$(HARDWARE))) | |
platform = rpi2 | |
else ifneq (,$(findstring AM33XX,$(HARDWARE))) | |
@@ -53,7 +54,7 @@ ifeq (,$(platform)) | |
platform = odroidc1 | |
else ifneq (,$(findstring ODROID-XU3,$(HARDWARE))) | |
platform = odroidxu3 | |
- else ifneq (,$(findstring ODROID-XU4,$(HARDWARE))) | |
+ else ifneq (,$(findstring ODROID-XU4,$(HARDWARE))) | |
platform = odroidxu3 | |
else ifneq (,$(findstring ODROIDXU,$(HARDWARE))) | |
platform = odroidxu | |
@@ -65,6 +66,8 @@ ifeq (,$(platform)) | |
platform = odroidu2 | |
else ifneq (,$(findstring ODROIDU2,$(HARDWARE))) | |
platform = odroidu2 | |
+ else ifneq (,$(findstring tinkerboard,$(NODENAME))) | |
+ platform = rk3288 | |
else | |
platform = armv7h | |
endif | |
@@ -184,6 +187,15 @@ else ifneq (,$(findstring odroid,$(platform))) | |
endif | |
endif | |
+# Tinkerboard (And various RK3288 systems) | |
+else ifneq (,$(findstring rk3288,$(platform))) | |
+ MFLAGS += -marm -mfpu=neon -mfloat-abi=hard -funroll-loops -mcpu=cortex-a12 -mtune=cortex-a12 | |
+ ASFLAGS += -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a12 -mtune=cortex-a12 | |
+ # I don't know if single-precision-constant is a good idea on this platform... (Myy) | |
+ CFLAGS += -D TARGET_RK3288 -D TARGET_LINUX_ARMELv7 -DARM_HARDFP -fsingle-precision-constant | |
+ USE_GLES := 1 | |
+ USE_SDL := 1 | |
+ | |
# GCW Zero | |
else ifneq (,$(findstring gcwz,$(platform))) | |
NOT_ARM := 1 | |
@@ -239,8 +251,8 @@ ifndef NOT_ARM | |
endif | |
ifdef USE_SDL | |
- CXXFLAGS += `sdl2-config --cflags` -D USE_SDL | |
- LIBS += `sdl2-config --libs` | |
+ CXXFLAGS += $(shell sdl2-config --cflags) -D USE_SDL | |
+ LIBS += $(shell sdl2-config --libs) | |
endif | |
ifdef PGO_MAKE | |
-- | |
2.7.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment