*.emu's and Snes9x


apersonthinks

Member
Joined
Sep 28, 2011
Messages
387
Robert Broglia has recently added X11 and alsa support to his emulators. I tried to compile GBA.emu and it almost finished, except it refused to recognize the existence of the EGL libraries. Since the *.emus require GCC 4.7+, I used pandebian sid to compile them. I also downloaded the latest GLES_CM and EGL headers from khronos.org and copied all of the various egl libraries included on the pandora and in the C/C++ dev tools pnd into /usr/lib. I have added -lEGL and -lGLES to the CPPFLAGS. I get undefined reference errors to various egl functions which I have determined are included correctly header-wise.
 
Undefined reference errors come up when it's trying to link (if the headers were missing, it would just warn you about 'implicit declaration of ...'. )


Have you got



Code:
-lGLES_CM and -lEGL


in LDFLAGS?


Also, if you've downloaded the latest headers, you'll also need to compile the latest libraries to go with them (headers that match the libraries on the OS are in cdevtools or http://www.openpandora.org/feeds/unstable/armv7a/libgles-omap3-dev_4.00.00.01-r6.5_armv7a.ipk)
 
Last edited by a moderator:
With the new headers, it compiles but says



Code:
X Error of failed request: BadWindows (invalid Window parameter)

Major opcode of failed request: 18 (X_ChangeProperty)

Resource id in failed request: 0x0

Serial number of failed request: 19

Current serial number in output stream: 24

With the old (I assume correct) headers:



Code:
error: invalid conversion from 'X11Window {aka long unsigned int} to 'EGLNativeWindowType {aka void*}'

I am now trying it using the libraries included in the gingerbread pnd.


If this doesn't work, I will try it in slackware.
 
Last edited by a moderator:
You may also try under Slack (gcc-4.7.1, same as Deb, i thk).
Tried compiling in slackware as all my attempts with debian (even mesa GL) failed. Now in slackware, libfreetype.so complains that inflateInit2_ was not found but existed in libz. I added libz and still get the same error (Edit: the inflateInit2_ is something to do with japanese characters or something as it only affects NGP.emu). It appears that at least opengles works in slackware. GLES doesn't want to work now for the stupidest reason. It cannot find glBlendEquationOES, yet its defined in GLES/glext.h and that file is included.
 
Last edited by a moderator:
Can't help you much here.


Indeed, libz is shipped.


Also, note that the default Slackware prefix is --prefix=/usr


Tried Google ?
 
If I remember correctly, the libz thing was also an issue when I tried to compile the NGP.emu for android myself. The prefix shouldn't be an issue as it picks up the other libraries just fine. Its mainly this blasted opengl stuff that needs to be fixed. Again, whoever thought up gles was an idiot.
 
A Google search for glBlendEquationOES gave me:


You could try using GLES2. It has glBlendEquation implemented in gl2.h
 
Guess ill try replacing gles with gles2 next time I boot into slackware. I thought it was defined in <GLES/glext.h> but idk.
 
Re: glBlendEquationOES, this is an opengles extension, and gles extensions are not made externally available (they are not put in the symbol table, so the linker can't find them). This sort of thing is normally handled by GLEW ("GL Extension Wrangler") - there's a version for GLES but there's no point getting it working for just one function.


To successfully call the function, you need to find it's address first. So your code needs to have something like:



Code:
/* global area at top of file */

PFNGLBLENDEQUATIONOESPROC glBlendEquationOES_ptr = NULL;


/* initialization area */

glBlendEquationOES_ptr = (PFNGLBLENDEQUATIONOESPROC) eglGetProcAddress("glBlendEquationOES");


/* when you want to call it */

    if (glBlendEquationOES_ptr)

	    glBlendEquationOES_ptr(mode);


If you're using Pickle's eglport, then eglport.c is a good place to put this (initialize it during EGL_Open(), and define a function called EGL_glBlendEquationOES that calls it, and call EGL_glBlendEquationOES from the main code.
 
Tried compiling in slackware as all my attempts with debian (even mesa GL) failed. Now in slackware, libfreetype.so complains that inflateInit2_ was not found but existed in libz. I added libz and still get the same error (Edit: the inflateInit2_ is something to do with japanese characters or something as it only affects NGP.emu). It appears that at least opengles works in slackware. GLES doesn't want to work now for the stupidest reason. It cannot find glBlendEquationOES, yet its defined in GLES/glext.h and that file is included.

No need to worry about glBlendEquationOES since it's not used in any of the emulators. I did a quick compile with the arm-none-linux-gnueabi toolchain I normally use for WebOS and substituted in the Pandora includes/libs. It only took some small changes to get it compiling properly so I'll include them in the next update (1.5.3). Below I've linked GBC.emu (gbcemu-debug) and a rendering test (textureUploadTest-debug). I don't have a Pandora but maybe one of you guys can give them a try. For the rendering test, selecting a command from the menu shows a flashing pattern for 5 secs and then prints the average fps. Hopefully you'll get around 60fps for each :)


http://www.explusalp...20121130.tar.xz
 
Tried compiling in slackware as all my attempts with debian (even mesa GL) failed. Now in slackware, libfreetype.so complains that inflateInit2_ was not found but existed in libz. I added libz and still get the same error (Edit: the inflateInit2_ is something to do with japanese characters or something as it only affects NGP.emu). It appears that at least opengles works in slackware. GLES doesn't want to work now for the stupidest reason. It cannot find glBlendEquationOES, yet its defined in GLES/glext.h and that file is included.

No need to worry about glBlendEquationOES since it's not used in any of the emulators. I did a quick compile with the arm-none-linux-gnueabi toolchain I normally use for WebOS and substituted in the Pandora includes/libs. It only took some small changes to get it compiling properly so I'll include them in the next update (1.5.3). Below I've linked GBC.emu (gbcemu-debug) and a rendering test (textureUploadTest-debug). I don't have a Pandora but maybe one of you guys can give them a try. For the rendering test, selecting a command from the menu shows a flashing pattern for 5 secs and then prints the average fps. Hopefully you'll get around 60fps for each :)


http://www.explusalp...20121130.tar.xz
 

Attachments

  • gbcemu.txt
    2.9 KB · Views: 273
  • textureTest.txt
    2.4 KB · Views: 287
Last edited by a moderator:
The only X calls at that point are the ones to initialize the mouse cursor graphic for future mouse hiding support. I've disabled them in this build so check if it gets any further:


http://www.explusalp...20121216.tar.xz


About the toolchain I'm using, I compiled a cross gcc-4.7.2 for arm-none-linux-gnueabi on my Gentoo system. Then I used the script on this page to get all the includes/libs from the Pandora:


http://boards.openpa...andoraorg-ipks/


However, some things were still missing like libbluetooth.so, so I took them from pandora-rootfs.tar.bz2


http://openpandora.org/firmware/
 
Last edited by a moderator:
This time it loads but any input, mouse or keyboard, causes it to close.
 

Attachments

  • texlog.txt
    6 KB · Views: 221
Last edited by a moderator:
Back
Top