libretro / mupen64plus-libretro-nx

Improved mupen64plus libretro core reimplementation
GNU General Public License v2.0
231 stars 114 forks source link

iOS version black textures issues #219

Open WeedyWeedSmoker opened 4 years ago

WeedyWeedSmoker commented 4 years ago

Hi @m4xw, I thought for a long time that the iOS 64-bit version always had some "black texture issues", but it seems that's only happening with the main iOS branch… https://forums.libretro.com/t/retroarch-1-8-5-certain-textures-are-black-mupen64plus-next/27308/9

This fork from @jet082 actually works mostly fine : https://github.com/jet082/mupen64plus-libretro-nx/commit/a7adaf2e253a445081d5b450ef063f62e4dd5b8d

I really don't know how to help but the official RetroArch iOS and tvOS .ipa releases use this commit and not the latest version from your main iOS branch…

Thanks!

m4xw commented 4 years ago

Core version packed inside libretro official build is Mupen64 1.0 a7adaf2; core versione packed inside Weedy Weed Smoker ipa is 2.0.5 etc. It seems to me that both cores are broken in specifically different ways; let’s just say that “official” core 1.0 a7adaf2 seems a little less broken.

Kek, as far I am aware we don't ship it because one of the IOS bit targets fails on the bot. Must be some stale build somewhere...

You should give rebase branch a shot, its due to be released very very soon, just pulled in my GLES fixes earlier

WeedyWeedSmoker commented 4 years ago

@m4xw Yeah, I saw your rebase branch but didn't try to compile it yet at the time…

It fails with this error:

Undefined symbols for architecture arm64:
  "_using_tlb", referenced from:
      _virtual_to_physical_address in tlb.o
ld: symbol(s) not found for architecture arm64
clang: error
m4xw commented 4 years ago

Ohh yea i forgot we don't have dynarec, 1 sec

m4xw commented 4 years ago

https://github.com/libretro/mupen64plus-libretro-nx/commit/109b019ffb5f93c4dd5fad5bb4088556749b099c @WeedyWeedSmoker

WeedyWeedSmoker commented 4 years ago

@m4xw Ok, it compiles fine, but it's still plagued by the black textures issue reported earlier…

m4xw commented 4 years ago

Did you clear your shader cache?

WeedyWeedSmoker commented 4 years ago

@m4xw Yeah, cleared both the cache folder and the shaders folder…

Here is what Yoshi's story looks like for example with @jet082's fork: IMG_0497 (there is an error appearing in the gliden64.log file with this fork though): Async color buffer copies are not supported on GLES2 OpenGL Error: invalid enumerant (500)

Here is what it looks like on the rebase and iOS branch: IMG_0498 alternating for a brief moment when going to the right with this flashing: IMG_0501

I tried changing the Color buffer to RDRAM option to sync with the same result…

m4xw commented 4 years ago

https://cdn.discordapp.com/attachments/679278896872685568/725776949708062841/ffffffff.patch patch -p1 < ... enables shader error logging to gliden log

m4xw commented 4 years ago

Yo, make a GLES2 build (remove GLES3=1 from makefile)

m4xw commented 4 years ago

Its not runtime for this fork so

2020/06/25,20:32:15.009,opengl_GLInfo.cpp:46,VERBOSE, "OpenGL ES major version: 2"
2020/06/25,20:32:15.009,opengl_GLInfo.cpp:47,VERBOSE, "OpenGL ES minor version: 0"

Will need a correctly configured build, otherwise retroarch needs to be GLES3 enabled.

m4xw commented 4 years ago
ifeq ($(GLES3),1)
    ifeq ($(platform),ios-arm64)
        GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DGLES3
    else
        GLFLAGS += -DEGL -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DGLES3
    endif
    LDFLAGS += $(EGL_LIB)
    SOURCES_C += $(LIBRETRO_COMM_DIR)/glsym/glsym_es3.c
    ifeq ($(ANDROID),1)
        SOURCES_CXX += $(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GraphicBuffer/GraphicBufferWrapper.cpp \
                       $(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GraphicBuffer/PublicApi/android_hardware_buffer_compat.cpp
    endif
else ifeq ($(GLES),1)
    GLFLAGS += -DEGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2
    LDFLAGS += $(EGL_LIB)
    SOURCES_C += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.c

    ifeq ($(ANDROID),1)
        SOURCES_CXX += $(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GraphicBuffer/GraphicBufferWrapper.cpp \
                       $(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GraphicBuffer/PublicApi/android_hardware_buffer_compat.cpp
    endif
else            

This need to be changed at the tail of makefile.common too (to allow no EGL)

WeedyWeedSmoker commented 4 years ago

Ok, I'm compiling it…

In the meantime, here's the log from just applying your patch to make gliden64 verbose:

2020/06/26,01:44:00.938,mupen64plus_DisplayWindow.cpp:59,VERBOSE, "[GlideN64]: _setAttributes"
2020/06/26,01:44:00.942,mupen64plus_DisplayWindow.cpp:78,VERBOSE, "[GlideN64]: Create setting videomode 640x480"
2020/06/26,01:44:00.943,opengl_GLInfo.cpp:46,VERBOSE, "OpenGL ES major version: 2"
2020/06/26,01:44:00.943,opengl_GLInfo.cpp:47,VERBOSE, "OpenGL ES minor version: 0"
2020/06/26,01:44:00.943,opengl_GLInfo.cpp:50,VERBOSE, "OpenGL vendor: Apple Inc."
2020/06/26,01:44:00.943,opengl_GLInfo.cpp:68,VERBOSE, "OpenGL renderer: Apple A10X GPU"
2020/06/26,01:44:00.943,opengl_GLInfo.cpp:152,WARNING, "Async color buffer copies are not supported on GLES2"
2020/06/26,01:44:01.174,GBI.cpp:381,VERBOSE, "Load microcode type: 28 crc: 0x9df31081 romname: YOSHI STORY"
2020/06/26,01:44:01.175,GBI.cpp:472,VERBOSE, "Load microcode (RSP Gfx ucode F3DEX.NoN     1.23 Yoshitaka Yasumoto Nintendo.) type: 1 crc: 0xcfcb7202 romname: YOSHI STORY"
2020/06/26,01:44:01.175,GBI.cpp:381,VERBOSE, "Load microcode type: 28 crc: 0x9df31081 romname: YOSHI STORY"
m4xw commented 4 years ago

I dunno why I even merged a if platform instead of if EGL, lol

m4xw commented 4 years ago

Ah don't forget this needs a clean build

m4xw commented 4 years ago

Seems its hardcoded in GLFunctions.h too but that should be easy fix..

m4xw commented 4 years ago

libretro-common\include\glsm\glsm.h needs the ifdef for gles2 too

WeedyWeedSmoker commented 4 years ago

I'm having a hard time compiling for GLES2…

I get a bunch of

error: unknown type name 'khronos_ssize_t'
_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) {
                                                                        ^
./libretro-common/include/glsm/glsm.h:40:19: note: expanded from macro 'ptrdiff_t'
#define ptrdiff_t khronos_ssize_t
                  ^

errors,

I just changed

        GLES3=1
        FORCE_GLES3=1

to

        GLES3=0
        FORCE_GLES=1

in the makefile, and

ifeq ($(GLES3),1)
    ifeq ($(platform),ios-arm64)
        GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DGLES3

to

ifeq ($(GLES3),1)
    ifeq ($(platform),ios-arm64)
        GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2

and

else ifeq ($(GLES),1)
    GLFLAGS += -DEGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2

to

else ifeq ($(GLES),1)
    GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2

in the Makefile.common

m4xw commented 4 years ago

See my last post, it will compile with the header change to glsm and the replacement ES3->ES2 in GLFunctions.h

WeedyWeedSmoker commented 4 years ago

Ok, compiled…

I added

#ifndef IOS
#define ptrdiff_t khronos_ssize_t
#endif

to glsm.h and changed

#elif defined(OS_IOS)
#include <OpenGLES/ES3/gl.h>
#include <OpenGLES/ES3/glext.h>

to

#elif defined(OS_IOS)
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>

in GLFunctions.h

Sorry for being dumb, I'm not a developer at all and never learned code… 😄

Testing now…

m4xw commented 4 years ago

If that doesnt help for you, then I will have big troubles without a device to work with in front of me.

WeedyWeedSmoker commented 4 years ago

The black texture issue is still present on the GLES2 compiled build…

Here's the gliden64 log:

2020/06/26,02:26:35.731,mupen64plus_DisplayWindow.cpp:59,VERBOSE, "[GlideN64]: _setAttributes"
2020/06/26,02:26:35.735,mupen64plus_DisplayWindow.cpp:78,VERBOSE, "[GlideN64]: Create setting videomode 640x480"
2020/06/26,02:26:35.736,opengl_GLInfo.cpp:46,VERBOSE, "OpenGL ES major version: 2"
2020/06/26,02:26:35.736,opengl_GLInfo.cpp:47,VERBOSE, "OpenGL ES minor version: 0"
2020/06/26,02:26:35.736,opengl_GLInfo.cpp:50,VERBOSE, "OpenGL vendor: Apple Inc."
2020/06/26,02:26:35.736,opengl_GLInfo.cpp:68,VERBOSE, "OpenGL renderer: Apple A10X GPU"
2020/06/26,02:26:35.971,GBI.cpp:381,VERBOSE, "Load microcode type: 28 crc: 0x9df31081 romname: YOSHI STORY"
2020/06/26,02:26:35.973,GBI.cpp:472,VERBOSE, "Load microcode (RSP Gfx ucode F3DEX.NoN     1.23 Yoshitaka Yasumoto Nintendo.) type: 1 crc: 0xcfcb7202 romname: YOSHI STORY"
2020/06/26,02:26:35.973,GBI.cpp:381,VERBOSE, "Load microcode type: 28 crc: 0x9df31081 romname: YOSHI STORY"
m4xw commented 4 years ago

thats bad news, time to whip out the heavy weapons, -DGL_DEBUG on clean build

m4xw commented 4 years ago

(add it to CFLAGS and CXXFLAGS in case you don't know)

WeedyWeedSmoker commented 4 years ago

Adding it to PLATCFLAGS and CXX in the makefile gives me about the same errors as adding it to the GLFLAGS in the Makefile.common:

In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:6:
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h:816:35: error: conflicting types for 'rglDeleteRenderbuffers'
GL_API void           GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers)   OPENGLES_DEPRECATED(ios(3.0, 12.0), tvos(9.0, 12.0));
                                  ^
./libretro-common/include/glsm/glsmsym.h:71:37: note: expanded from macro 'glDeleteRenderbuffers'
#define glDeleteRenderbuffers       rglDeleteRenderbuffers
                                    ^
./libretro-common/include/glsm/glsmsym.h:278:6: note: previous declaration is here
void rglDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers);
     ^
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:6:
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h:823:35: error: unknown type name 'SGLenum'; did you mean 'GLenum'?
GL_API void           GL_APIENTRY glDisable (GLenum cap) OPENGLES_DEPRECATED(ios(3.0, 12.0), tvos(9.0, 12.0));
                                  ^
./libretro-common/include/glsm/glsmsym.h:98:48: note: expanded from macro 'glDisable'
#define glDisable(T)                rglDisable(S##T)
                                               ^
<scratch space>:43:1: note: expanded from here
SGLenum
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/gltypes.h:13:18: note: 'GLenum' declared here
typedef uint32_t GLenum;
                 ^
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:6:
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h:827:35: error: unknown type name 'SGLenum'; did you mean 'GLenum'?
GL_API void           GL_APIENTRY glEnable (GLenum cap) OPENGLES_DEPRECATED(ios(3.0, 12.0), tvos(9.0, 12.0));
                                  ^
./libretro-common/include/glsm/glsmsym.h:99:47: note: expanded from macro 'glEnable'
#define glEnable(T)                 rglEnable(S##T)
                                              ^
<scratch space>:52:1: note: expanded from here
SGLenum
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/gltypes.h:13:18: note: 'GLenum' declared here
typedef uint32_t GLenum;
                 ^
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:6:
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h:867:35: error: unknown type name 'SGLenum'; did you mean 'GLenum'?
GL_API GLboolean      GL_APIENTRY glIsEnabled (GLenum cap) OPENGLES_DEPRECATED(ios(3.0, 12.0), tvos(9.0, 12.0));
                                  ^
./libretro-common/include/glsm/glsmsym.h:100:50: note: expanded from macro 'glIsEnabled'
#define glIsEnabled(T)              rglIsEnabled(S##T)
                                                 ^
<scratch space>:3:1: note: expanded from here
SGLenum
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/gltypes.h:13:18: note: 'GLenum' declared here
typedef uint32_t GLenum;
                 ^
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:6:
In file included from GLideN64/src/Graphics/OpenGLContext/GLFunctions.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h:1004:35: error: conflicting types for 'rglWaitSync'
GL_API void           GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout)   OPENGLES_DEPRECATED(ios(7.0, 12.0), tvos(9.0, 12.0));
                                  ^
./libretro-common/include/glsm/glsmsym.h:182:37: note: expanded from macro 'glWaitSync'
#define glWaitSync                  rglWaitSync
                                    ^
./libretro-common/include/glsm/glsmsym.h:455:6: note: previous declaration is here
void rglWaitSync(void *sync, GLbitfield flags, uint64_t timeout);
     ^

Before adding -DGL_DEBUG, GLES2 was in front of the loaded core name instead of GLES3, but the errors seem to come from ES3/gl.h headers, did I not actually compile for GLES2 or is it expected with the latest SDK?

I can try to compile with an older Xcode iOS SDK if it helps…

m4xw commented 4 years ago

Another tester got it working with the changes I stated, but he can't get me the log of the exception, there def seem to be gl errors occurring

estefan3112 commented 4 years ago

Hi, with much patience, m4xw guided me through this: Makefile, line 336: PLATCFLAGS += -DHAVE_POSIX_MEMALIGN -DNO_ASM -DGL_DEBUG Plus GLideN64/src/Graphics/OpenGLContext/opengl_GLInfo.cpp:206 -> delete that line causing an error This builds, but the Core crashes immediately. Logfiles are empty, and I remember that the Retroarch Docs mention that logging is not supported in iOS... Best.

WeedyWeedSmoker commented 4 years ago

@m4xw Same error with an older SDK with ES3 headers referenced… I don't know if the changes I made actually made it compile for GLES2, can you check?

I posted all my changes here…


Here are my changes: In Makefile

        GLES3=1
        FORCE_GLES3=1

to

        GLES3=0
        FORCE_GLES=1

in Makefile.common

ifeq ($(GLES3),1)
    ifeq ($(platform),ios-arm64)
        GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DGLES3

to

ifeq ($(GLES3),1)
    ifeq ($(platform),ios-arm64)
        GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2

and

else ifeq ($(GLES),1)
    GLFLAGS += -DEGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2

to

else ifeq ($(GLES),1)
    GLFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2

in libretro-common/include/glsm/glsm.h

#if defined(HAVE_OPENGLES2)
typedef double GLclampd;
typedef double GLdouble;
typedef struct __GLsync* GLsync;
typedef uint64_t GLuint64;
typedef int64_t GLint64;
#define ptrdiff_t khronos_ssize_t
#endif

to

#if defined(HAVE_OPENGLES2)
typedef double GLclampd;
typedef double GLdouble;
typedef struct __GLsync* GLsync;
typedef uint64_t GLuint64;
typedef int64_t GLint64;
#ifndef IOS
#define ptrdiff_t khronos_ssize_t
#endif
#endif

in GLideN64/src/Graphics/OpenGLContext/GLFunctions.h

#elif defined(OS_IOS)
#include <OpenGLES/ES3/gl.h>
#include <OpenGLES/ES3/glext.h>

to

#elif defined(OS_IOS)
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>

This compiles fine up to this point… Showing as GLES2 next to the loaded core name…


Then in Makefile PLATCFLAGS += -DIOS -marm -DOS_IOS -DDONT_WANT_ARM_OPTIMIZATIONS to PLATCFLAGS += -DIOS -marm -DOS_IOS -DDONT_WANT_ARM_OPTIMIZATIONS -DGL_DEBUG

and

CXX = clang++ -arch arm64 -isysroot $(IOSSDK) to CXX = clang++ -arch arm64 -isysroot $(IOSSDK) -DGL_DEBUG

(but I just tried this instead in the makefile PLATCFLAGS += -DHAVE_POSIX_MEMALIGN -DNO_ASM -DGL_DEBUG and deleting the opengl_GLInfo.cpp:206 line)

I have the exact same error as I mentioned in my previous post


@estefan3112 can you send me your built core to test if I can make it run? (or just check if I was somehow correct in the changes I made?)…

WeedyWeedSmoker commented 4 years ago

@m4xw BTW I used the diff patch you sent me first

TBH I applied the patch manually, I don't really know what to use to apply a diff patch…


That means the first steps I did were:

in GLideN64/src/Graphics/OpenGLContext/GLSL/glsl_Utils.cpp

I removed the 2 occurrences of #ifdef GL_DEBUG #endif

and in GLideN64/src/Log.h

I changed #define LOG_LEVEL LOG_NONE to #define LOG_LEVEL LOG_VERBOSE

estefan3112 commented 4 years ago

https://drive.google.com/file/d/12fkSjZdJsCzWzxlNasdbB1VE7XVuUWz3/view?usp=sharing

I uploaded the entire directory with today's hacks applied as per instructions of mx4w. That one should create a GLES2 core. If you include the -DGL_DEBUG option as documented above on top.

Good luck.

WeedyWeedSmoker commented 4 years ago

@m4xw Ok, by updating to your latest commit first and making all my changes again, I had the exact same error as @estefan3112…

It now compiled fine after removing the opengl_GLInfo.cpp 206th line!

Testing now…


EDIT: @estefan3112 Sorry I just saw you posted half an hour ago… Anyway I managed to have the exact same results as you… At least there's consistency here! 😄

WeedyWeedSmoker commented 4 years ago

@m4xw And of course it crashed… I could only get an iOS default crashlog:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4376510464
      REGION TYPE                      START - END             [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                 0000000104dc4000-00000001051ec000 [ 4256K] r-x/r-x SM=COW  ...app/RetroArch

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [34195]
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:

Thread 1:
0   libsystem_pthread.dylib         0x0000000198041738 0x198033000 + 59192

Thread 2:
0   libsystem_pthread.dylib         0x0000000198041738 0x198033000 + 59192

Thread 3:
0   libsystem_pthread.dylib         0x0000000198041738 0x198033000 + 59192

Thread 4 name:  com.apple.uikit.eventfetch-thread
Thread 4:
0   libsystem_kernel.dylib          0x00000001980fb198 0x1980f7000 + 16792
1   libsystem_kernel.dylib          0x00000001980fa60c 0x1980f7000 + 13836
2   CoreFoundation                  0x00000001982a5468 0x1981fd000 + 689256
3   CoreFoundation                  0x00000001982a049c 0x1981fd000 + 668828
4   CoreFoundation                  0x000000019829fce8 0x1981fd000 + 666856
5   Foundation                      0x00000001985e301c 0x1985db000 + 32796
6   Foundation                      0x00000001985e2efc 0x1985db000 + 32508
7   UIKitCore                       0x000000019c4715dc 0x19b9a0000 + 11343324
8   Foundation                      0x0000000198711e20 0x1985db000 + 1273376
9   libsystem_pthread.dylib         0x000000019803dd98 0x198033000 + 44440
10  libsystem_pthread.dylib         0x000000019804174c 0x198033000 + 59212

Thread 5 name:  AVAudioSession Notify Thread
Thread 5:
0   libsystem_kernel.dylib          0x00000001980fb198 0x1980f7000 + 16792
1   libsystem_kernel.dylib          0x00000001980fa60c 0x1980f7000 + 13836
2   CoreFoundation                  0x00000001982a5468 0x1981fd000 + 689256
3   CoreFoundation                  0x00000001982a049c 0x1981fd000 + 668828
4   CoreFoundation                  0x000000019829fce8 0x1981fd000 + 666856
5   AVFAudio                        0x00000001a5049a2c 0x1a4fe4000 + 416300
6   AVFAudio                        0x00000001a509a7a0 0x1a4fe4000 + 747424
7   libsystem_pthread.dylib         0x000000019803dd98 0x198033000 + 44440
8   libsystem_pthread.dylib         0x000000019804174c 0x198033000 + 59212

Thread 6:
0   libsystem_kernel.dylib          0x000000019811cb58 0x1980f7000 + 154456
1   libsystem_pthread.dylib         0x0000000198036ce4 0x198033000 + 15588
2   RetroArch                       0x0000000104f80024 0x104dc4000 + 1818660
3   RetroArch                       0x0000000104ec6664 0x104dc4000 + 1058404
4   libsystem_pthread.dylib         0x000000019803dd98 0x198033000 + 44440
5   libsystem_pthread.dylib         0x000000019804174c 0x198033000 + 59212

Thread 7 name:  AURemoteIO::IOThread
Thread 7:
0   libsystem_kernel.dylib          0x00000001980fb198 0x1980f7000 + 16792
1   libsystem_kernel.dylib          0x00000001980fa60c 0x1980f7000 + 13836
2   libEmbeddedSystemAUs.dylib      0x00000001b69dc990 0x1b6951000 + 571792
3   libAudioToolboxUtility.dylib    0x00000001a36936a4 0x1a3684000 + 63140
4   libsystem_pthread.dylib         0x000000019803dd98 0x198033000 + 44440
5   libsystem_pthread.dylib         0x000000019804174c 0x198033000 + 59212

Thread 8:
0   libsystem_kernel.dylib          0x000000019811cb58 0x1980f7000 + 154456
1   libsystem_pthread.dylib         0x0000000198036ce4 0x198033000 + 15588
2   RetroArch                       0x0000000104ec6740 0x104dc4000 + 1058624
3   RetroArch                       0x0000000104f86318 0x104dc4000 + 1843992
4   RetroArch                       0x0000000104ec6664 0x104dc4000 + 1058404
5   libsystem_pthread.dylib         0x000000019803dd98 0x198033000 + 44440
6   libsystem_pthread.dylib         0x000000019804174c 0x198033000 + 59212

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x00000001196b75f0   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000111807bc0
    x4: 0x0000000000000001   x5: 0x0000000000000065   x6: 0x0000000000000000   x7: 0x00000000000005f0
    x8: 0x00000001196b75f0   x9: 0x0000000000000002  x10: 0x0000000000000001  x11: 0x0000000000000000
   x12: 0x0000000000000185  x13: 0x0000000000000001  x14: 0x00000000000003ee  x15: 0x0000000000000212
   x16: 0x00000000000007fb  x17: 0x0000000029c00000  x18: 0x0000000000000000  x19: 0x0000000282e152c0
   x20: 0x00000001196b75f0  x21: 0x0000000119875000  x22: 0x0000000000000000  x23: 0x0000000281b30640
   x24: 0x0000000000000014  x25: 0x0000000120098128  x26: 0x0000000000000004  x27: 0x0000000119908590
   x28: 0x0000000111808068   fp: 0x00000001118081f0   lr: 0x00000001196afc38
    sp: 0x0000000111807a90   pc: 0x0000000000000000 cpsr: 0x20000000
   esr: 0x82000006 (Instruction Abort) Translation fault
WeedyWeedSmoker commented 4 years ago

@m4xw BTW there's a warning that happens when compiling your branch that doesn't appear when compiling jet082's fork :

GLideN64/src/Textures.cpp:1329:31: warning: 4 enumeration values not handled in switch: 'Non', 'Line', 'Rect'... [-Wswitch]
                        switch (dwnd().getDrawer().getDrawingState()) {
                                                   ^
GLideN64/src/Textures.cpp:1329:31: note: add missing switch cases
                        switch (dwnd().getDrawer().getDrawingState()) {
                                                   ^

(there are other things like):

mupen64plus-core/src/main/main.c:844:13: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
            dd_disk->size,
            ^~~~~~~~~~~~~
mupen64plus-core/subprojects/minizip/zip.c:1249:28: warning: incompatible pointer types assigning to 'const unsigned long *' from 'const z_crc_t *' (aka 'const unsigned int *') [-Wincompatible-pointer-types]
        zi->ci.pcrc_32_tab = get_crc_table();
                           ^ ~~~~~~~~~~~~~~~
custom/dependencies/libzlib/gzlib.c:256:24: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        state->start = LSEEK(state->fd, 0, SEEK_CUR);
                       ^
custom/dependencies/libzlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
custom/dependencies/libzlib/gzlib.c:355:9: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
        ^
custom/dependencies/libzlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
custom/dependencies/libzlib/gzlib.c:396:15: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
              ^
custom/dependencies/libzlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
custom/dependencies/libzlib/gzlib.c:492:14: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
    offset = LSEEK(state->fd, 0, SEEK_CUR);
             ^
custom/dependencies/libzlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
custom/dependencies/libzlib/gzread.c:30:15: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration]
        ret = read(state->fd, buf + *have, len - *have);
              ^
custom/dependencies/libzlib/gzread.c:591:11: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    ret = close(state->fd);
          ^
custom/dependencies/libzlib/gzwrite.c:84:15: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
        got = write(state->fd, strm->next_in, strm->avail_in);
              ^
custom/dependencies/libzlib/gzwrite.c:101:33: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
            if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
                                ^
custom/dependencies/libzlib/gzwrite.c:573:9: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    if (close(state->fd) == -1)
        ^
custom/dependencies/libzlib/inflate.c:1507:61: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
                                                        ~~~ ^

and

libretro/libretro.c:400:60: warning: passing 'const size_t *' (aka 'const unsigned long *') to parameter of type 'size_t *' (aka 'unsigned long *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            load_file(info[1].path, (void**)&info[1].data, &info[1].size);
                                                           ^~~~~~~~~~~~~
./mupen64plus-core/src/main/util.h:68:70: note: passing argument to parameter 'size' here
file_status_t load_file(const char* filename, void** buffer, size_t* size);
                                                                     ^
libretro/libretro.c:506:61: warning: incompatible pointer types passing 'void *(void *)' to parameter of type 'void (*)(void)' [-Wincompatible-pointer-types]
        game_thread = co_create(65536 * sizeof(void*) * 16, EmuThreadFunction);
                                                            ^~~~~~~~~~~~~~~~~
./libretro-common/include/libco.h:58:43: note: passing argument to parameter here
cothread_t co_create(unsigned int, void (*)(void));
                                          ^

These appear while compiling @jet082's fork too:

custom/GLideN64/mupenplus/Config_mupenplus.cpp:59:11: warning: enumeration values 'INI_BLANK', 'INI_COMMENT', and 'INI_TRASH' not handled in switch [-Wswitch]
                switch (l.type)
                        ^
custom/GLideN64/mupenplus/Config_mupenplus.cpp:59:11: note: add missing switch cases
                switch (l.type)
                        ^

and

libretro-common/features/features_cpu.c:333:17: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "=r"(r)
                ^
libretro-common/features/features_cpu.c:329:16: note: use constraint modifier "w"
         "fmrx  %0, fpscr   \n\t" /* r0 = FPSCR */
                ^~
                %w0
libretro-common/features/features_cpu.c:333:17: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "=r"(r)
                ^
libretro-common/features/features_cpu.c:330:15: note: use constraint modifier "w"
         "and   %0, %0, %1  \n\t" /* r0 = r0 & 0x04086060 */
                ^~
                %w0
libretro-common/features/features_cpu.c:333:17: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "=r"(r)
                ^
libretro-common/features/features_cpu.c:330:19: note: use constraint modifier "w"
         "and   %0, %0, %1  \n\t" /* r0 = r0 & 0x04086060 */
                    ^~
                    %w0
libretro-common/features/features_cpu.c:334:16: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "r"(x), "r"(y)
               ^
libretro-common/features/features_cpu.c:330:23: note: use constraint modifier "w"
         "and   %0, %0, %1  \n\t" /* r0 = r0 & 0x04086060 */
                        ^~
                        %w1
libretro-common/features/features_cpu.c:333:17: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "=r"(r)
                ^
libretro-common/features/features_cpu.c:331:15: note: use constraint modifier "w"
         "orr   %0, %0, %2  \n\t" /* r0 = r0 | 0x03000000 */
                ^~
                %w0
libretro-common/features/features_cpu.c:333:17: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "=r"(r)
                ^
libretro-common/features/features_cpu.c:331:19: note: use constraint modifier "w"
         "orr   %0, %0, %2  \n\t" /* r0 = r0 | 0x03000000 */
                    ^~
                    %w0
libretro-common/features/features_cpu.c:334:24: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "r"(x), "r"(y)
                       ^
libretro-common/features/features_cpu.c:331:23: note: use constraint modifier "w"
         "orr   %0, %0, %2  \n\t" /* r0 = r0 | 0x03000000 */
                        ^~
                        %w2
libretro-common/features/features_cpu.c:333:17: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
         : "=r"(r)
                ^
libretro-common/features/features_cpu.c:332:23: note: use constraint modifier "w"
         "fmxr  fpscr, %0   \n\t" /* FPSCR = r0 */
                       ^~
                       %w0

but I think the first one is of interest…

m4xw commented 4 years ago

Uh it's not a C99 Codebase. Can you show me the full commandline as it compiles a C and a CPP file?

WeedyWeedSmoker commented 4 years ago

@m4xw Here are two examples taken straight from the rebase branch, no modifications to the makefile or the code…

c++ -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk -fvisibility-inlines-hidden -std=gnu++11 -D_CRT_SECURE_NO_WARNINGS -O3 -DNDEBUG -fsigned-char -ffast-math -fno-strict-aliasing -fomit-frame-pointer -fvisibility=hidden -fcommon -DGIT_VERSION=\"" 454e1948"\" -I./mupen64plus-core/subprojects/md5 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__LIBRETRO__ -DUSE_FILE32API -DM64P_PLUGIN_API -DM64P_CORE_PROTOTYPES -D_ENDUSER_RELEASE -DSINC_LOWER_QUALITY -DTXFILTER_LIB -D__VEC4_OPT -DMUPENPLUSAPI -I./custom -I./custom/mupen64plus-core -I./custom/android/include -I./custom/GLideN64 -I./GLideN64/src -I./GLideN64/src/osal -I./mupen64plus-core/src -I./mupen64plus-core/src/api -I./custom/mupen64plus-core/plugin/audio_libretro -I./libretro-common/include -I./libretro -I./GLideN64/src/inc -I./custom/dependencies/libpng -I./mupen64plus-core/subprojects/minizip -I./xxHash -I./custom/dependencies/libzlib -DHAVE_POSIX_MEMALIGN -DNO_ASM -DIOS -marm -DOS_IOS -DDONT_WANT_ARM_OPTIMIZATIONS -miphoneos-version-min=8.0 -Wno-error=implicit-function-declaration -fPIC -marm -mfpu=neon -mfloat-abi=softfp -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DGLES3 -c GLideN64/src/BufferCopy/ColorBufferToRDRAM.cpp -o GLideN64/src/BufferCopy/ColorBufferToRDRAM.o

cc -arch arm64 -marm -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk -std=gnu11 -D_CRT_SECURE_NO_WARNINGS -O3 -DNDEBUG -fsigned-char -ffast-math -fno-strict-aliasing -fomit-frame-pointer -fvisibility=hidden -fcommon -DGIT_VERSION=\"" 454e1948"\" -I./mupen64plus-core/subprojects/md5 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__LIBRETRO__ -DUSE_FILE32API -DM64P_PLUGIN_API -DM64P_CORE_PROTOTYPES -D_ENDUSER_RELEASE -DSINC_LOWER_QUALITY -DTXFILTER_LIB -D__VEC4_OPT -DMUPENPLUSAPI -I./custom -I./custom/mupen64plus-core -I./custom/android/include -I./custom/GLideN64 -I./GLideN64/src -I./GLideN64/src/osal -I./mupen64plus-core/src -I./mupen64plus-core/src/api -I./custom/mupen64plus-core/plugin/audio_libretro -I./libretro-common/include -I./libretro -I./GLideN64/src/inc -I./custom/dependencies/libpng -I./mupen64plus-core/subprojects/minizip -I./xxHash -I./custom/dependencies/libzlib -DHAVE_POSIX_MEMALIGN -DNO_ASM -DIOS -marm -DOS_IOS -DDONT_WANT_ARM_OPTIMIZATIONS -miphoneos-version-min=8.0 -Wno-error=implicit-function-declaration -fPIC -marm -mfpu=neon -mfloat-abi=softfp -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DGLES3 -c mupen64plus-core/src/asm_defines/asm_defines.c -o mupen64plus-core/src/asm_defines/asm_defines.o

jet082 commented 4 years ago

Incidentally, my laptop only recently got somewhat fixed... it has some other issues and I’ll be sending it back eventually, but not yet... I’m nowhere near set back up and I’m not sure when I will, but... if you have questions about my build I can try to answer them.

WeedyWeedSmoker commented 4 years ago

@jet082 Ok, it's been a week you left this heartwarming comment, so I think I'll ask this first…

Did you get your data back or do you have to start from scratch? (i.e. do you have a working VM yet?)

I figured the RetroArch cores compile best on macOS 10.14 Mojave, so it would be good if you can get that OS as a VM…


Do you recall having this black textures issue with this core, and if so how did you fix it?

Thanks

m4xw commented 4 years ago

@WeedyWeedSmoker try the rebase branch

m4xw commented 4 years ago

(its on develop now)

WeedyWeedSmoker commented 4 years ago

@m4xw Hi!

I just compiled and tested the latest develop commit, but sadly it still exhibits the same problems as before on iOS…

WeedyWeedSmoker commented 4 years ago

@m4xw BTW, I just tried to compile it for macOS…

Besides the error with PaletteTexture.h in GLideN64/src which have to include instead of , like iOS, there's an error which prevents compilation:

GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:345:2: error: assigning to 'PFNGLTEXIMAGE2DMULTISAMPLEPROC' (aka 'void (*)(unsigned int, int, int, int, int, unsigned char)') from incompatible type 'void (GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean)' (aka 'void (unsigned int, int, unsigned int, int, int, unsigned char)'): type mismatch at 3rd parameter ('GLint' (aka 'int') vs 'GLenum' (aka 'unsigned int'))
        ASSIGN_PROC_ADR(PFNGLTEXIMAGE2DMULTISAMPLEPROC, TexImage2DMultisample);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GLideN64/src/Graphics/OpenGLContext/GLFunctions.cpp:8:64: note: expanded from macro 'ASSIGN_PROC_ADR'
#define ASSIGN_PROC_ADR(proc_type, proc_name) ptr##proc_name = rgl##proc_name
                                                               ^~~~~~~~~~~~~~
<scratch space>:56:1: note: expanded from here
rglTexImage2DMultisample
^~~~~~~~~~~~~~~~~~~~~~~~

Thanks!


EDIT: I've just seen @kivutar is trying to fix these issues on the https://github.com/libretro/mupen64plus-libretro-nx/tree/kivutar/fixosx branch…

Still doesn't compile though… Errors out with:

mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:197: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:197: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:236: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:236: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:237: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:237: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:296: error: invalid operands in non-64-bit mode
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:299: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:299: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:300: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:300: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:304: error: invalid operands in non-64-bit mode
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:308: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:308: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:309: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:309: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:314: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:314: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:315: error: impossible combination of address sizes
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:315: error: invalid effective address
mupen64plus-core/src/device/r4300/new_dynarec/x64/linkage_x64.asm:320: error: invalid operands in non-64-bit mode

When disabling the dynarec, it complains about files being built for a newer version (10.14) than being linked (10.7)… After setting LDFLAGS += -mmacosx-version-min=10.14 for testing, it stills errors out…

Undefined symbols for architecture x86_64:
  "_dyna_jump", referenced from:
      _exception_general in cp0.o
      _TLB_refill_exception in cp0.o
  "_dyna_stop", referenced from:
      _gen_interrupt in interrupt.o
  "_dynarec_jump_to", referenced from:
      _generic_jump_to in r4300_core.o
      _savestates_load_set_pc in r4300_core.o
ld: symbol(s) not found for architecture x86_64
m4xw commented 4 years ago

Please keep the discussion on the correct issue or the PR ;)

Back to topic, I added glide support (via HAVE_GLIDE) on the wip_glide branch. Its still dirty but should run, probably worth a shot for IOS in the meanwhile!

Btw those LD symbols seem like some dynarec settings are messed up. I expect the whole makefile macos target to be rewritten.

WeedyWeedSmoker commented 4 years ago

@m4xw When compiled with HAVE_GLIDE, it errors out with:

In file included from Glide/src/Glide64/glide64_3dmath.c:45:
In file included from ./Glide/src/Glide64/rdp.h:49:
./Glide/src/Glide64/../Glitch64/glide.h:8:25: error: expected ')'
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:8:14: note: to match this '('
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
             ^
./Glide/src/Glide64/../Glitch64/glide.h:9:25: error: expected ')'
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:9:14: note: to match this '('
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
             ^
./Glide/src/Glide64/../Glitch64/glide.h:9:15: error: typedef redefinition with different types ('void (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *)' (aka 'void (unsigned int, int, int, int, int, int, unsigned int, unsigned int, const void *)') vs 'void (GLenum, GLenum, GLint)' (aka 'void (unsigned int, unsigned int, int)'))
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:8:15: note: previous definition is here
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:10:35: error: expected ')'
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                                  ^
./Glide/src/Glide64/../Glitch64/glide.h:10:24: note: to match this '('
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                       ^
./Glide/src/Glide64/../Glitch64/glide.h:10:25: error: typedef redefinition with different types ('const GLubyte *(GLenum)' (aka 'const unsigned char *(unsigned int)') vs 'void (GLenum, GLenum, GLint)' (aka 'void (unsigned int, unsigned int, int)'))
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:8:15: note: previous definition is here
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:11:8: error: unknown type name 'PFNGLGETSTRINGPROC'
extern PFNGLGETSTRINGPROC ptrGetString;
       ^
./Glide/src/Glide64/../Glitch64/glide.h:12:8: error: unknown type name 'PFNGLTEXIMAGE2DPROC'
extern PFNGLTEXIMAGE2DPROC ptrTexImage2D;
       ^
./Glide/src/Glide64/../Glitch64/glide.h:13:8: error: unknown type name 'PFNGLTEXPARAMETERIPROC'
extern PFNGLTEXPARAMETERIPROC ptrTexParameteri;In file included from 
       ^
Glide/src/Glide64/Framebuffer_glide64.c:54:
In file included from ./Glide/src/Glide64/Framebuffer_glide64.h:49:
./Glide/src/Glide64/../Glitch64/glide.h:8:25: error: expected ')'
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:8:14: note: to match this '('
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
             ^
./Glide/src/Glide64/../Glitch64/glide.h:9:25: error: expected ')'
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:9:14: note: to match this '('
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
             ^
./Glide/src/Glide64/../Glitch64/glide.h:9:15: error: typedef redefinition with different types ('void (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *)' (aka 'void (unsigned int, int, int, int, int, int, unsigned int, unsigned int, const void *)') vs 'void (GLenum, GLenum, GLint)' (aka 'void (unsigned int, unsigned int, int)'))
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:8:15: note: previous definition is here
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:10:35: error: expected ')'
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                                  ^
./Glide/src/Glide64/../Glitch64/glide.h:10:24: note: to match this '('
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                       ^
./Glide/src/Glide64/../Glitch64/glide.h:10:25: error: typedef redefinition with different types ('const GLubyte *(GLenum)' (aka 'const unsigned char *(unsigned int)') vs 'void (GLenum, GLenum, GLint)' (aka 'void (unsigned int, unsigned int, int)'))
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:8:15: note: previous definition is here
8 errors generated.
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:11:8: error: unknown type name 'PFNGLGETSTRINGPROC'
extern PFNGLGETSTRINGPROC ptrGetString;
       ^
gmake: *** [Makefile:548: Glide/src/Glide64/glide64_3dmath.o] Error 1
gmake: *** Waiting for unfinished jobs....
./Glide/src/Glide64/../Glitch64/glide.h:12:8: error: unknown type name 'PFNGLTEXIMAGE2DPROC'
extern PFNGLTEXIMAGE2DPROC ptrTexImage2D;
       ^
./Glide/src/Glide64/../Glitch64/glide.h:13:8: error: unknown type name 'PFNGLTEXPARAMETERIPROC'
extern PFNGLTEXPARAMETERIPROC ptrTexParameteri;
       ^
In file included from Glide/src/Glide64/Glide64_Ini.c:4:
In file included from ./Glide/src/Glide64/rdp.h:49:
./Glide/src/Glide64/../Glitch64/glide.h:8:25: error: expected ')'
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:8:14: note: to match this '('
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
             ^
./Glide/src/Glide64/../Glitch64/glide.h:9:25: error: expected ')'
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:9:14: note: to match this '('
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
             ^
./Glide/src/Glide64/../Glitch64/glide.h:9:15: error: typedef redefinition with different types ('void (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *)' (aka 'void (unsigned int, int, int, int, int, int, unsigned int, unsigned int, const void *)') vs 'void (GLenum, GLenum, GLint)' (aka 'void (unsigned int, unsigned int, int)'))
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:8:15: note: previous definition is here
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:10:35: error: expected ')'
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                                  ^
./Glide/src/Glide64/../Glitch64/glide.h:10:24: note: to match this '('
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                       ^
./Glide/src/Glide64/../Glitch64/glide.h:10:25: error: typedef redefinition with different types ('const GLubyte *(GLenum)' (aka 'const unsigned char *(unsigned int)') vs 'void (GLenum, GLenum, GLint)' (aka 'void (unsigned int, unsigned int, int)'))
typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
                        ^
./Glide/src/Glide64/../Glitch64/glide.h:8:15: note: previous definition is here
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
              ^
./Glide/src/Glide64/../Glitch64/glide.h:11:8: error: unknown type name 'PFNGLGETSTRINGPROC'
extern PFNGLGETSTRINGPROC ptrGetString;
       ^
./Glide/src/Glide64/../Glitch64/glide.h:12:8: error: unknown type name 'PFNGLTEXIMAGE2DPROC'
extern PFNGLTEXIMAGE2DPROC ptrTexImage2D;
       ^
./Glide/src/Glide64/../Glitch64/glide.h:13:8: error: unknown type name 'PFNGLTEXPARAMETERIPROC'
extern PFNGLTEXPARAMETERIPROC ptrTexParameteri;
       ^
8 errors generated.
m4xw commented 4 years ago

Thanks I will check the cause.

m4xw commented 4 years ago

@WeedyWeedSmoker Pushed a dirty fix to be more in line with GLideN64 and fixed a few conflicts... Highly experimental but it fixes windows so far

m4xw commented 4 years ago

(If it says undefined GL_INTENSITY8 and simliar, just steal them from nx_gl.h and slap them in)

WeedyWeedSmoker commented 4 years ago

@m4xw Yeah, I get:

Glide/src/Glitch64/glitch64_textures.c:198:25: error: use of undeclared identifier 'GL_INTENSITY8'
            *gltexfmt = GL_INTENSITY8;
                        ^
Glide/src/Glitch64/glitch64_textures.c:204:25: error: use of undeclared identifier 'GL_LUMINANCE8'
            *gltexfmt = GL_LUMINANCE8;
                        ^
Glide/src/Glitch64/glitch64_textures.c:222:25: error: use of undeclared identifier 'GL_LUMINANCE8_ALPHA8'
            *gltexfmt = GL_LUMINANCE8_ALPHA8;
                        ^
3 errors generated.

I then added:

#define GL_INTENSITY8                           0x804B
#define GL_LUMINANCE8                           0x8040
#define GL_LUMINANCE8_ALPHA8                    0x8045

just under the #includes in glitch64_textures.c

It then compiles fine, but sadly has the exact same problems as before with the GLideN64 plugin, and selecting the GLide64 plugin results in a black screen with audio…

HappehLemons commented 3 years ago

Any potential headway on this? Games like gauntlet legends still have lots of black textures making them unplayable

m4xw commented 2 years ago

Hi can someone see if this issue still occurs on develop and rebase_gliden branch?

HappehLemons commented 2 years ago

I can test this. It’s been a while but can you refresh my memory. Is there an ipa ready or does the rebase branch need to be compiled?

estefan3112 commented 2 years ago

Hi m4xw, for me the issue still persists. I compiled both branches with identical results in Yoshi's Story, and in Gauntlet Legends, the HUD display is still garbled and unsusable. Sorry for no better news. In Retroarch the core is called Mupen64Plus-Next (2.3-GLES3 git)