What's new

Who wants to help with a osx port?

Slougi

New member
Ok, what sort of resolution do we need, I'm assuming a multiple of 32 pixels.

Yep. Different systems use different sizes by default so an icon that scales to different sizes would be cool.

It would probably be easier to install osx86 if you want to play with osx, kalyway does a pretty good install for intel based PC systems, I'm sure you know where to look :D

I do, but I think I prefer the macbook :)
 
OP
Danny

Danny

Programmer | Moderator
I have tomorrow off work so I will make a start on the port.

That is if the 3 new Xbox 360 games I just got don't tear me away from it :p

I'll post tomorrow if I make any progress.
 

thatmariolover

New member
Ok, what sort of resolution do we need, I'm assuming a multiple of 32 pixels.

It would probably be easier to install osx86 if you want to play with osx, kalyway does a pretty good install for intel based PC systems, I'm sure you know where to look :D

Yeah, when I say I have a Quad core Intel Mac at my disposal I mean I've got a Kalyway install on my PC. Almost as good as the real thing if you have compatible hardware.
 
Last edited:
OP
Danny

Danny

Programmer | Moderator
The same unfortunately. I got distracted with other work I had planned to do on my day off.

I have Thursday off, although I have a lot planned for that day. So again no promises but maybe I will get chance to work on it. :)
 

Auria

New member
I've been trying to build mupen (svn) on my OS X computer.

Here's the changes I've had to do so far (build not yet done)
Some of it are hacky, others could go in though

(I'm on PPC though. so it may vary a little on intel macs)

EDIT: Removed, see next post for a more compelte one
 
Last edited:

Auria

New member
Okay I fully got it to build on OS X! It doesn't run since I'm on PPC, but here's the changes

"safe" compatibility changes :
Code:
Index: glN64/DepthBuffer.cpp
===================================================================
--- glN64/DepthBuffer.cpp	(revision 497)
+++ glN64/DepthBuffer.cpp	(working copy)
@@ -1,4 +1,4 @@
-#include <malloc.h>
+#include <stdlib.h>
 #include "DepthBuffer.h"
 #include "Types.h"
Index: glN64/OpenGL.cpp
===================================================================
--- glN64/OpenGL.cpp	(revision 497)
+++ glN64/OpenGL.cpp	(working copy)
@@ -131,7 +131,7 @@
         glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)wglGetProcAddress( "glGetFinalCombinerInputParameterfvNV" );
         glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)wglGetProcAddress( "glGetFinalCombinerInputParameterivNV" );
 #endif // !__LINUX__
-        glGetIntegerv( GL_MAX_GENERAL_COMBINERS_NV, &OGL.maxGeneralCombiners );
+        glGetIntegerv( GL_MAX_GENERAL_COMBINERS_NV, (GLint*) &OGL.maxGeneralCombiners );
     }
 
     if ((OGL.ARB_multitexture = isExtensionSupported( "GL_ARB_multitexture" )))
@@ -142,7 +142,7 @@
         glMultiTexCoord2fARB        = (PFNGLMULTITEXCOORD2FARBPROC)wglGetProcAddress( "glMultiTexCoord2fARB" );
 #endif // !__LINUX__
 
-        glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &OGL.maxTextureUnits );
+        glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, (GLint*) &OGL.maxTextureUnits );
         OGL.maxTextureUnits = min( 8, OGL.maxTextureUnits ); // The plugin only supports 8, and 4 is really enough
     }
Index: rice_video/Makefile
===================================================================
--- rice_video/Makefile	(revision 497)
+++ rice_video/Makefile	(working copy)
@@ -5,7 +5,7 @@
 
 # local CFLAGS, LIBS, and LDFLAGS
 CFLAGS += -DUSE_GTK `sdl-config --cflags` $(GTK_FLAGS) -fpic -DPIC -Wall
-LDFLAGS	+= -L/usr/X11R6/lib `sdl-config --libs` -lGL -shared -Wl,-Bsymbolic
+LDFLAGS	+= `sdl-config --libs` $(LIBGL_LIBS) $(PLUGIN_LDFLAGS)
 
 # set options
 
Index: rice_video/DeviceBuilder.cpp
===================================================================
--- rice_video/DeviceBuilder.cpp	(revision 497)
+++ rice_video/DeviceBuilder.cpp	(working copy)
@@ -235,7 +235,7 @@
             {
                 int maxUnit = 2;
                 COGLGraphicsContext *pcontext = (COGLGraphicsContext *)(CGraphicsContext::g_pGraphicsContext);
-                glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&maxUnit);
+                glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&maxUnit);
 
                 if( pcontext->IsExtensionSupported("GL_ARB_fragment_program") )
                 {
Index: rice_video/OGLFragmentShaders.cpp
===================================================================
--- rice_video/OGLFragmentShaders.cpp	(revision 497)
+++ rice_video/OGLFragmentShaders.cpp	(working copy)
@@ -286,7 +286,7 @@
 #ifdef _DEBUG
         char *str = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
 #endif
-        glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, &position);
+        glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, (GLint*)&position);
         if( position >= 0 )
         {
 #ifdef _DEBUG
Index: rice_video/OGLExtCombiner.cpp
===================================================================
--- rice_video/OGLExtCombiner.cpp	(revision 497)
+++ rice_video/OGLExtCombiner.cpp	(working copy)
@@ -67,7 +67,7 @@
         if( pcontext->IsExtensionSupported("GL_EXT_texture_env_combine") || pcontext->IsExtensionSupported("GL_ARB_texture_env_combine") )
         {
             m_bOGLExtCombinerSupported = true;
-            glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&m_maxTexUnits);
+            glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&m_maxTexUnits);
             if( m_maxTexUnits > 8 ) m_maxTexUnits = 8;
 
             TRACE0("Starting Ogl 1.4 multitexture combiner" );
Index: rice_video/RenderExt.cpp
===================================================================
--- rice_video/RenderExt.cpp	(revision 497)
+++ rice_video/RenderExt.cpp	(working copy)
@@ -781,8 +781,8 @@
 
     // save the current clamp type
     int iClampS, iClampT;
-    glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &iClampS);
-    glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &iClampT);
+    glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (GLint*)&iClampS);
+    glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (GLint*)&iClampT);
     // force clamp type to CLAMP_EDGE (experiments show sometimes this is set to hex 0x2901 - invalid value)
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
Index: rice_video/OGLExtRender.cpp
===================================================================
--- rice_video/OGLExtRender.cpp	(revision 497)
+++ rice_video/OGLExtRender.cpp	(working copy)
@@ -26,7 +26,7 @@
     OGLRender::Initialize();
 
     // Initialize multitexture
-    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB,&m_maxTexUnits);
+    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&m_maxTexUnits);
 
     for( int i=0; i<8; i++ )
         m_textureUnitMap[i] = -1;
Index: rice_video/liblinux/BMGUtils.c
===================================================================
--- rice_video/liblinux/BMGUtils.c	(revision 497)
+++ rice_video/liblinux/BMGUtils.c	(working copy)
@@ -25,7 +25,7 @@
 // POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
 */
 
-#include <malloc.h>
+#include <stdlib.h>
 #include "BMGUtils.h"
 
 #ifndef _WIN32
Index: rice_video/liblinux/BMGImage.c
===================================================================
--- rice_video/liblinux/BMGImage.c	(revision 497)
+++ rice_video/liblinux/BMGImage.c	(working copy)
@@ -3,7 +3,7 @@
 //
 // Copyright (C) 2001 Michael S. Heiman
 */
-#include <malloc.h>
+#include <stdlib.h>
 #include <memory.h>
 #include <setjmp.h>
 #include "BMGUtils.h"
Index: memory/dma.c
===================================================================
--- memory/dma.c	(revision 497)
+++ memory/dma.c	(working copy)
@@ -35,7 +35,7 @@
 #include "../r4300/r4300.h"
 #include "../r4300/interupt.h"
 #include "../r4300/macros.h"
-#include <malloc.h>
+#include <stdlib.h>
 #include "pif.h"
 #include "flashram.h"
 #include "../main/guifuncs.h"
Index: opengl/OGLFT.h
===================================================================
--- opengl/OGLFT.h	(revision 497)
+++ opengl/OGLFT.h	(working copy)
@@ -57,7 +57,7 @@
         R, G, B, A
     };
 
-    typedef void (*GLUTessCallback)();
+    typedef GLvoid (*GLUTessCallback)(...);
     
     class Library 
     {
@@ -439,11 +439,11 @@
             static int lineToCallback ( FT_Vector* to, Filled* filled );
             static int conicToCallback ( FT_Vector* control, FT_Vector* to, Filled* filled);
             static int cubicToCallback ( FT_Vector* control1, FT_Vector* control2,FT_Vector* to, Filled* filled );
-            static void vertexCallback ( VertexInfo* vertex );
-            static void beginCallback ( GLenum which );
-            static void endCallback ( void );
-            static void combineCallback ( GLdouble coords[3], void* vertex_data[4],GLfloat weight[4], void** out_data,Filled* filled );
-            static void errorCallback ( GLenum error_code );
+            static GLvoid vertexCallback ( VertexInfo* vertex );
+            static GLvoid beginCallback ( GLenum which );
+            static GLvoid endCallback ( void );
+            static GLvoid combineCallback ( GLdouble coords[3], void* vertex_data[4],GLfloat weight[4], void** out_data,Filled* filled );
+            static GLvoid errorCallback ( GLenum error_code );
     };
 
     class Raster : public Face 
Index: opengl/osd.cpp
===================================================================
--- opengl/osd.cpp	(revision 497)
+++ opengl/osd.cpp	(working copy)
@@ -266,7 +266,7 @@
     bool bSecColorArray = glIsEnabled(GL_SECONDARY_COLOR_ARRAY);
 
     // deactivate all the texturing units
-    int  iActiveTex;
+    GLint  iActiveTex;
     bool bTexture2D[8];
     glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &iActiveTex);
     for (i = 0; i < 8; i++)
Index: opengl/OGLFT.cpp
===================================================================
--- opengl/OGLFT.cpp	(revision 497)
+++ opengl/OGLFT.cpp	(working copy)
@@ -2354,7 +2354,7 @@
         return 0;
     }
 
-    void Filled::vertexCallback (VertexInfo* vertex)
+    GLvoid Filled::vertexCallback (VertexInfo* vertex)
     {
         if(vertex->color_tess_ != 0) glColor4fv(vertex->color_tess_->color(vertex->v_));
         if(vertex->texture_tess_ != 0) glTexCoord2fv(vertex->texture_tess_->texCoord(vertex->v_));
@@ -2362,17 +2362,17 @@
         glVertex3dv(vertex->v_);
     }
 
-    void Filled::beginCallback (GLenum which)
+    GLvoid Filled::beginCallback (GLenum which)
     {
         glBegin(which);
     }
 
-    void Filled::endCallback (void)
+    GLvoid Filled::endCallback (void)
     {
         glEnd();
     }
 
-    void Filled::combineCallback (GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], void** out_data, Filled* filled)
+    GLvoid Filled::combineCallback (GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], void** out_data, Filled* filled)
     {
         (void)vertex_data;
         (void)weight;
@@ -2381,7 +2381,7 @@
         filled->extraVertices().push_back(vertex);
     }
 
-    void Filled::errorCallback (GLenum error_code)
+    GLvoid Filled::errorCallback (GLenum error_code)
     {
         std::cerr << "hmm. error during tessellation?:" << gluErrorString(error_code)<< std::endl;
     }
Index: main/gui_gtk/main_gtk.c
===================================================================
--- main/gui_gtk/main_gtk.c	(revision 497)
+++ main/gui_gtk/main_gtk.c	(working copy)
@@ -56,7 +56,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
Index: glide64/Makefile
===================================================================
--- glide64/Makefile	(revision 497)
+++ glide64/Makefile	(working copy)
@@ -14,7 +14,7 @@
 
 # local CFLAGS, LIBS, and LDFLAGS
 CFLAGS = -O2 -Wall -g -DGCC -DUSE_GTK $(SDL_CFLAGS) $(GTK_FLAGS) -Iwrapper/ -ffast-math -funroll-loops
-LDFLAGS	= -shared -Wl,-Bsymbolic -lGL -lGLU -L/usr/X11R6/lib $(SDL_LIBS)
+LDFLAGS	= $(PLUGIN_LDFLAGS) $(LIBGL_LIBS) `sdl-config --libs`
 
 # set special flags per-system
 ifeq ($(CPU), X86)
Index: glide64/wrapper/combiner.cpp
===================================================================
--- glide64/wrapper/combiner.cpp	(revision 497)
+++ glide64/wrapper/combiner.cpp	(working copy)
@@ -350,14 +350,14 @@
         glLinkProgramARB(program_object);
         glUseProgramObjectARB(program_object);
 
-        glGetObjectParameterivARB(program_object, GL_OBJECT_LINK_STATUS_ARB , &log_length);
+        glGetObjectParameterivARB(program_object, GL_OBJECT_LINK_STATUS_ARB , (GLint*)&log_length);
         if(!log_length)
         {
-            glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log);
+            glGetInfoLogARB(fragment_shader_object, 2048, (GLint*)&log_length, shader_log);
             if(log_length) display_warning(shader_log);
-            glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
+            glGetInfoLogARB(vertex_shader_object, 2048, (GLint*)&log_length, shader_log);
             if(log_length) display_warning(shader_log);
-            glGetInfoLogARB(program_object, 2048, &log_length, shader_log);
+            glGetInfoLogARB(program_object, 2048, (GLint*)&log_length, shader_log);
             if(log_length) display_warning(shader_log);
         }
 
@@ -400,14 +400,14 @@
         glLinkProgramARB(program_object);
         glUseProgramObjectARB(program_object);
 
-        glGetObjectParameterivARB(program_object, GL_OBJECT_LINK_STATUS_ARB , &log_length);
+        glGetObjectParameterivARB(program_object, GL_OBJECT_LINK_STATUS_ARB , (GLint*)&log_length);
         if(!log_length)
         {
-            glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log);
+            glGetInfoLogARB(fragment_shader_object, 2048, (GLint*)&log_length, shader_log);
             if(log_length) display_warning(shader_log);
-            glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
+            glGetInfoLogARB(vertex_shader_object, 2048, (GLint*)&log_length, shader_log);
             if(log_length) display_warning(shader_log);
-            glGetInfoLogARB(program_object, 2048, &log_length, shader_log);
+            glGetInfoLogARB(program_object, 2048,(GLint*) &log_length, shader_log);
             if(log_length) display_warning(shader_log);
         }
 
@@ -639,16 +639,16 @@
     glLinkProgramARB(program_object);
     glUseProgramObjectARB(program_object);
 
-    glGetObjectParameterivARB(program_object, GL_OBJECT_LINK_STATUS_ARB , &log_length);
+    glGetObjectParameterivARB(program_object, GL_OBJECT_LINK_STATUS_ARB , (GLint*)&log_length);
     if(!log_length)
     {
         glGetInfoLogARB(shader_programs[number_of_programs].fragment_shader_object, 
-            2048, &log_length, shader_log);
+            2048, (GLint*)&log_length, shader_log);
         if(log_length) display_warning(shader_log);
-        glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
+        glGetInfoLogARB(vertex_shader_object, 2048, (GLint*)&log_length, shader_log);
         if(log_length) display_warning(shader_log);
         glGetInfoLogARB(program_object, 
-            2048, &log_length, shader_log);
+            2048,(GLint*)&log_length, shader_log);
         if(log_length) display_warning(shader_log);
     }
 
Index: glide64/wrapper/textures.cpp
===================================================================
--- glide64/wrapper/textures.cpp	(revision 497)
+++ glide64/wrapper/textures.cpp	(working copy)
@@ -72,7 +72,7 @@
         }
         aux = aux->next;
     }
-  glDeleteTextures(n, t);
+  glDeleteTextures(n, (const GLuint*)t);
     free(t);
     //printf("RMVTEX nbtex is now %d (%06x - %06x)\n", nbTex, idmin, idmax);
 }
Index: glide64/wrapper/main.cpp
===================================================================
--- glide64/wrapper/main.cpp	(revision 497)
+++ glide64/wrapper/main.cpp	(working copy)
@@ -695,13 +695,13 @@
   show_warning = 0;
 
   nbTextureUnits = 0;
-    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &nbTextureUnits);
+    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&nbTextureUnits);
     if (nbTextureUnits == 1) display_warning("You need a video card that has at least 2 texture units");
   
   nbAuxBuffers = 0;
   int getDisableAuxbuf();
   if (!getDisableAuxbuf())
-    glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &nbAuxBuffers);
+    glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, (GLint*)&nbAuxBuffers);
   if (nbAuxBuffers > 0)
     printf("Congratulations, you have %d auxilliary buffers, we'll use them wisely !\n", nbAuxBuffers);
 
@@ -888,9 +888,9 @@
   {
     for (i=0; i<nb_fb; i++)
     {
-      glDeleteTextures( 1, &(fbs[i].texid) );
-      glDeleteFramebuffersEXT( 1, &(fbs[i].fbid) );
-      glDeleteRenderbuffersEXT( 1, &(fbs[i].zbid) );
+      glDeleteTextures( 1,(GLuint*) &(fbs[i].texid) );
+      glDeleteFramebuffersEXT( 1, (GLuint*)&(fbs[i].fbid) );
+      glDeleteRenderbuffersEXT( 1, (GLuint*)&(fbs[i].zbid) );
     }
   }
 #endif
@@ -1130,8 +1130,8 @@
         }
         else //create new FBO at the same address, delete old one
         {
-          glDeleteFramebuffersEXT( 1, &(fbs[i].fbid) );
-          glDeleteRenderbuffersEXT( 1, &(fbs[i].zbid) );
+          glDeleteFramebuffersEXT( 1, (GLuint*)&(fbs[i].fbid) );
+          glDeleteRenderbuffersEXT( 1, (GLuint*)&(fbs[i].zbid) );
           if (nb_fb > 1)
             memmove(&(fbs[i]), &(fbs[i+1]), sizeof(fb)*(nb_fb-i));
           nb_fb--;
@@ -1142,8 +1142,8 @@
     
     remove_tex(pBufferAddress, pBufferAddress + width*height*2/*grTexFormatSize(fmt)*/);
     //create new FBO 
-    glGenFramebuffersEXT( 1, &(fbs[nb_fb].fbid) );
-    glGenRenderbuffersEXT( 1, &(fbs[nb_fb].zbid) );
+    glGenFramebuffersEXT( 1, (GLuint*)&(fbs[nb_fb].fbid) );
+    glGenRenderbuffersEXT( 1, (GLuint*)&(fbs[nb_fb].zbid) );
     glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, fbs[nb_fb].zbid );
     // VP ported from mudlord
     glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height);
Index: glide64/wrapper/glidesys.h
===================================================================
--- glide64/wrapper/glidesys.h	(revision 497)
+++ glide64/wrapper/glidesys.h	(working copy)
@@ -102,7 +102,7 @@
 #  define GLIDE_OS        GLIDE_OS_DOS32
 #elif defined(__WIN32__)
 #  define GLIDE_OS        GLIDE_OS_WIN32
-#elif defined(macintosh)
+#elif defined(__APPLE__)
 #  define GLIDE_OS        GLIDE_OS_MACOS
 #else
 #error "Unknown OS"
Index: r4300/r4300.c
===================================================================
--- r4300/r4300.c	(revision 497)
+++ r4300/r4300.c	(working copy)
@@ -36,7 +36,7 @@
 #include "macros.h"
 #include "recomp.h"
 #include "recomph.h"
-#include <malloc.h>
+#include <stdlib.h>
 
 #ifdef DBG
 extern int debugger_mode;
Index: r4300/recomp.c
===================================================================
--- r4300/recomp.c	(revision 497)
+++ r4300/recomp.c	(working copy)
@@ -27,7 +27,7 @@
  *
 **/
 
-#include <malloc.h>
+#include <stdlib.h>
 
 #include "recomp.h"
 #include "macros.h"

hackish bits/needs proper implementation :
Code:
Index: install.sh
===================================================================
--- install.sh	(revision 497)
+++ install.sh	(working copy)
@@ -38,7 +38,7 @@
 INSTALLDIR=${PREFIX}/share/mupen64plus
 
 echo "Installing Mupen64Plus to $PREFIX"
-$INSTALL -D -m 0755 mupen64plus "${BINDIR}/mupen64plus" || exit $?
+$INSTALL -c -m 0755 mupen64plus "${BINDIR}/mupen64plus" || exit $?
 $INSTALL -d -v "${INSTALLDIR}" || exit $?
 $INSTALL -d -v "${INSTALLDIR}/config" || exit $?
 $INSTALL -m 0644 config/* "${INSTALLDIR}/config" || exit $?
Index: glN64/Textures.cpp
===================================================================
--- glN64/Textures.cpp	(revision 497)
+++ glN64/Textures.cpp	(working copy)
@@ -11,6 +11,15 @@
 #define GL_GLEXT_PROTOTYPES
 #include <GL/gl.h>
 
+#ifdef __APPLE__
+// FIXME... I have no clue why these are not picked up from the GL includes
+#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
+#endif
+
 #include "OpenGL.h"
 #include "Textures.h"
 #include "GBI.h"
Index: glN64/Makefile
===================================================================
--- glN64/Makefile	(revision 497)
+++ glN64/Makefile	(working copy)
@@ -15,6 +15,8 @@
   OBJECTS = Config_gtk2.o
 endif
 
+LDFLAGS += -lpng
+
 # list of object files to generate
 OBJECTS += glN64.o \
 	OpenGL.o \
Index: glN64/Config_gtk2.cpp
===================================================================
--- glN64/Config_gtk2.cpp	(revision 497)
+++ glN64/Config_gtk2.cpp	(working copy)
@@ -1,4 +1,4 @@
-#include <features.h>
+//#include <features.h>
 #include <dlfcn.h>
 #include <unistd.h>
 #include "../main/winlnxdefs.h"
Index: glN64/gDP.cpp
===================================================================
--- glN64/gDP.cpp	(revision 497)
+++ glN64/gDP.cpp	(working copy)
@@ -23,6 +23,15 @@
 #include <stdlib.h>
 #endif
 
+#ifdef __APPLE__
+// FIXME... I have no clue why these are not picked up from the GL includes
+#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
+#endif
+
 gDPInfo gDP;
 
 void gDPSetOtherMode( u32 mode0, u32 mode1 )
Index: glN64/NV_register_combiners.h
===================================================================
--- glN64/NV_register_combiners.h	(revision 497)
+++ glN64/NV_register_combiners.h	(working copy)
@@ -2,6 +2,10 @@
 #define GL_GLEXT_PROTOTYPES
 #include <GL/gl.h>
 
+#ifdef __APPLE__
+#define APIENTRY
+#endif
+
 /* NVidia extensions */
 extern void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
 extern void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
Index: pre.mk
===================================================================
--- pre.mk	(revision 497)
+++ pre.mk	(working copy)
@@ -35,10 +35,11 @@
   # throw error
   $(error pkg-config not installed!)
 endif
-ifneq ("$(shell pkg-config gtk+-2.0 --modversion | head -c 2)", "2.")
-  # throw error
-  $(error No GTK 2.x development libraries found!)
-endif
+# head doesn't take a '-c' argument (?)
+#ifneq ("$(shell pkg-config gtk+-2.0 --modversion | head -c 2)", "2.")
+#  # throw error
+#  $(error No GTK 2.x development libraries found!)
+#endif
 
 # set GTK flags and libraries
 GTK_FLAGS	= $(shell pkg-config gtk+-2.0 --cflags) -D_GTK2
@@ -77,7 +78,7 @@
 CC      = gcc
 CXX     = g++
 LD      = g++
-STRIP   = strip --strip-all
+STRIP   = strip -S
 RM      = rm
 MV      = mv
 CP      = cp
@@ -157,7 +158,7 @@
 FREETYPE_LIBS	= $(shell freetype-config --libs)
 FREETYPE_FLAGS	= $(shell freetype-config --cflags)
 
-PLUGIN_LDFLAGS	= -Wl,-Bsymbolic -shared
+PLUGIN_LDFLAGS	= -bundle
 
-LIBGL_LIBS	= -L/usr/X11R6/lib -lGL -lGLU
+LIBGL_LIBS	= -framework OpenGL
 
Index: jttl_audio/Makefile
===================================================================
--- jttl_audio/Makefile	(revision 497)
+++ jttl_audio/Makefile	(working copy)
@@ -29,8 +29,11 @@
 OBJECTS = main.o
 
 # build targets
-all: jttl_audio.so
+#all: jttl_audio.so
 
+# seems unusable on non-linux systems
+all:
+
 clean:
 	rm -f *.o *.so
 
Index: rice_video/OGLCombinerTNT2.cpp
===================================================================
--- rice_video/OGLCombinerTNT2.cpp	(revision 497)
+++ rice_video/OGLCombinerTNT2.cpp	(working copy)
@@ -19,6 +19,19 @@
 #define GL_GLEXT_PROTOTYPES
 #include <GL/gl.h>
 
+#ifdef __APPLE__
+// FIXME - no clue why it's not picked from header
+#define GL_COMBINE_EXT                    0x8570
+#define GL_COMBINE_RGB_EXT                0x8571
+#define GL_COMBINE_ALPHA_EXT              0x8572
+#define GL_RGB_SCALE_EXT                  0x8573
+#define GL_ADD_SIGNED_EXT                 0x8574
+#define GL_INTERPOLATE_EXT                0x8575
+#define GL_CONSTANT_EXT                   0x8576
+#define GL_PRIMARY_COLOR_EXT              0x8577
+#define GL_PREVIOUS_EXT                   0x8578
+#endif
+
 #include "stdafx.h"
 
 //========================================================================
@@ -207,6 +220,10 @@
 
     // Texture unit 0
     glActiveTexture(GL_TEXTURE0_ARB);
+#ifndef GL_COMBINE4_NV
+    //FIXME hack to get it to build
+#define GL_COMBINE4_NV GL_COMBINE_ARB
+#endif
     glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV);
     m_pOGLRender->EnableTexUnit(0,TRUE);
     glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, res.unit1.rgbOp);
Index: rice_video/RenderBase.cpp
===================================================================
--- rice_video/RenderBase.cpp	(revision 497)
+++ rice_video/RenderBase.cpp	(working copy)
@@ -1289,6 +1289,13 @@
 // Assumes dwAddr has already been checked! 
 // Don't inline - it's too big with the transform macros
 
+#ifdef NO_ASM
+void ProcessVertexDataSSE(uint32 dwAddr, uint32 dwV0, uint32 dwNum)
+{
+    // FIXME - this function seems to have no NO_ASM equivalent
+}
+#endif
+
 #if !defined(NO_ASM)
 void ProcessVertexDataSSE(uint32 dwAddr, uint32 dwV0, uint32 dwNum)
 {
Index: rice_video/Config.h
===================================================================
--- rice_video/Config.h	(revision 497)
+++ rice_video/Config.h	(working copy)
@@ -359,7 +359,7 @@
     s8    nCountryID;
     uint8  nUnknown5;
 };
-#pragma pack()
+//#pragma pack()
 
 typedef struct 
 {
Index: rice_video/OGLRender.cpp
===================================================================
--- rice_video/OGLRender.cpp	(revision 497)
+++ rice_video/OGLRender.cpp	(working copy)
@@ -20,6 +20,10 @@
 #include <GL/gl.h>
 #include "stdafx.h"
 
+#ifndef GL_MIRRORED_REPEAT_IBM 
+#define GL_MIRRORED_REPEAT_IBM            0x8370 
+#endif 
+
 // Fix me, use OGL internal L/T and matrix stack
 // Fix me, use OGL lookupAt function
 // Fix me, use OGL DisplayList
Index: Makefile
===================================================================
--- Makefile	(revision 497)
+++ Makefile	(working copy)
@@ -1,7 +1,7 @@
 # Makefile for Mupen64Plus
 
 # include pre-make file with a bunch of definitions
-USES_KDE4 = true
+USES_KDE4 = false
 include ./pre.mk
 
 # local CFLAGS, LIBS, and LDFLAGS
@@ -229,13 +229,18 @@
   endif
 endif
 
+# even with GTK GUI, there seems to be C++ code
+# and I get errors if I try to link with gcc and not g++
+
 # select proper compiler for final mupen64plus linking
-ifeq ($(GUI), KDE4)
-  MUPENCC = $(CXX)
-else
-  MUPENCC = $(CC)
-endif
+#ifeq ($(GUI), KDE4)
+#  MUPENCC = $(CXX)
+#else
+#  MUPENCC = $(CC)
+#endif
 
+MUPENCC = $(CXX)
+
 # build targets
 targets:
 	@echo "Mupen64Plus makefile. "
@@ -267,11 +272,11 @@
 all: $(ALL)
 
 mupen64plus: $(OBJECTS)
-	$(MUPENCC) $^ $(LDFLAGS) $(LIBS) -Wl,-export-dynamic -lpthread -ldl -o $@
+	$(MUPENCC) $^ $(LDFLAGS) $(LIBS) -lpthread -ldl -o $@
 	$(STRIP) $@
 
 mupen64plus_dbg: $(OBJECTS) main/main_gtk.o
-	$(MUPENCC) $^ $(LDFLAGS) $(LIBS) -Wl,-export-dynamic -lpthread -ldl -o $@
+	$(MUPENCC) $^ $(LDFLAGS) $(LIBS) -lpthread -ldl -o $@
 
 install:
 	./install.sh $(PREFIX)
Index: mupen64_audio/main.c
===================================================================
--- mupen64_audio/main.c	(revision 497)
+++ mupen64_audio/main.c	(working copy)
@@ -6,7 +6,8 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include <linux/soundcard.h>
+// FIXME- quick hack to get it to build
+//#include <linux/soundcard.h>
 #include <unistd.h>
 #include <pthread.h>
 #include <sys/time.h>
@@ -38,8 +39,8 @@
     f = 48628316 / (*AudioInfo.AI_DACRATE_REG + 1);
     break;
      }
-   if (ioctl(dsp, SNDCTL_DSP_SPEED, &f) == -1)
-     printf("error initializing frequency:%x\n", f);
+   //if (ioctl(dsp, SNDCTL_DSP_SPEED, &f) == -1)
+   //  printf("error initializing frequency:%x\n", f);
    frequency = f;
 }
 
@@ -330,21 +331,22 @@
      }
    dsp = open("/dev/dsp", O_WRONLY);
    if (dsp == -1) printf("error opening /dev/dsp\n");
-   if (ioctl(dsp, SNDCTL_DSP_RESET) == -1)
-     printf("error resetting sound card\n");
+   //if (ioctl(dsp, SNDCTL_DSP_RESET) == -1)
+   //  printf("error resetting sound card\n");
    f = 0x20010;
-   if (ioctl(dsp, SNDCTL_DSP_SETFRAGMENT, &val) == -1)
-     printf("error setting fragment size\n");
-   if (ioctl(dsp, SNDCTL_DSP_STEREO, &channel) == -1)
-     printf("error setting stereo mode\n");
-   if (!channel)
-     printf("error setting stereo mode\n");
-   format = AFMT_S16_LE;
-   if (ioctl(dsp, SNDCTL_DSP_SAMPLESIZE, &format) == -1)
-     printf("error initializing format\n");
+   //if (ioctl(dsp, SNDCTL_DSP_SETFRAGMENT, &val) == -1)
+   //  printf("error setting fragment size\n");
+   //if (ioctl(dsp, SNDCTL_DSP_STEREO, &channel) == -1)
+   //  printf("error setting stereo mode\n");
+  // if (!channel)
+   //  printf("error setting stereo mode\n");
+   //format = AFMT_S16_LE;
+   format = 0;
+   //if (ioctl(dsp, SNDCTL_DSP_SAMPLESIZE, &format) == -1)
+   //  printf("error initializing format\n");
    f = 32000;
-   if (ioctl(dsp, SNDCTL_DSP_SPEED, &f) == -1)
-     printf("error initializing frequency:%d\n", f);
+   //if (ioctl(dsp, SNDCTL_DSP_SPEED, &f) == -1)
+   //  printf("error initializing frequency:%d\n", f);
    sem_init(&sem, 0, 0);
    sem_init(&sem2,0, 1);
    //sem_init(&semt,0, 0);
@@ -358,7 +360,7 @@
 RomClosed( void )
 {
 
-   ioctl(dsp, SNDCTL_DSP_SYNC);
+   //ioctl(dsp, SNDCTL_DSP_SYNC);
    closed = 1;
    sem_post(&sem);
    sem_post(&sem);
Index: main/volume.c
===================================================================
--- main/volume.c	(revision 497)
+++ main/volume.c	(working copy)
@@ -30,6 +30,19 @@
 /* Sound volume functions.
  */
 
+#ifdef __APPLE__
+
+// <sys/soundcard.h> doesn't seem to exist on OS X
+// FIXME
+
+void volSet(int percent){}
+int volGet(void){ return 75; }
+void volMute(void){}
+int volIsMuted(void){ return 0; }
+void volChange(int delta){}
+
+#else
+
 #include <sys/soundcard.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -150,3 +163,4 @@
     volSet(volGet() + delta);
 }
 
+#endif
\ No newline at end of file
Index: blight_input/plugin.c
===================================================================
--- blight_input/plugin.c	(revision 497)
+++ blight_input/plugin.c	(working copy)
@@ -20,7 +20,11 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <dirent.h>
+
+// FIXME- totally broken on non-linux platforms
+#ifdef __LINUX__
 #include <linux/input.h>
+#endif
 
 #include "plugin.h"
 
@@ -453,9 +457,11 @@
 
 BYTE lastCommand[6];
 
+#ifdef __LINUX__
 struct ff_effect ffeffect[3];
 struct ff_effect ffstrong[3];
 struct ff_effect ffweak[3];
+#endif
 
 BYTE DataCRC( BYTE *Data, int iLenght )
 {
@@ -514,6 +520,7 @@
 void
 ControllerCommand(int Control, BYTE *Command)
 {
+    #ifdef __LINUX__
     BYTE *Data = &Command[5];
     struct input_event play;
 
@@ -581,6 +588,7 @@
             /*printf( "Write eeprom\n" );*/
             break;
         }
+#endif
 }
 
 /******************************************************************
@@ -860,6 +868,7 @@
 void
 GetKeys( int Control, BUTTONS *Keys )
 {
+    #ifdef __LINUX__
     struct input_event play;
     int b, axis_val, axis_max_val, axis_val_tmp;
     SDL_Event event;
@@ -1111,10 +1120,12 @@
                 perror("Error starting rumble effect");
         }
     }
+#endif
 }
 
 int InitiateRumble(int cntrl)
 {
+    #ifdef __LINUX__
     DIR *dp;
     struct dirent *ep;
     unsigned long features[4];
@@ -1208,6 +1219,7 @@
     ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffweak[cntrl]);
 
     printf("["PLUGIN_NAME"]: Rumble activated on N64 joystick #%i\n", cntrl + 1);
+#endif
 }
 
 /******************************************************************
Index: blight_input/Makefile
===================================================================
--- blight_input/Makefile	(revision 497)
+++ blight_input/Makefile	(working copy)
@@ -15,8 +15,11 @@
 	pad.o
 
 # build targets
-all: blight_input.so
+#all: blight_input.so
 
+# this plug-in is totally unusable on non-linux platforms
+all:
+
 clean:
 	rm -f *.o *.so ttftoh arial.ttf.c
 
Index: glide64/Makefile
===================================================================
--- glide64/Makefile	(revision 497)
+++ glide64/Makefile	(working copy)
@@ -125,7 +125,7 @@
 
 $(TARGET): $(OBJECTS)
 	$(LD) $(OBJECTS) $(GTK_LIBS) $(LDFLAGS) -o $@
-	$(STRIP) --strip-all $@
+	$(STRIP) $@
 
 Main.o: font.h cursor.h
 font.h:	compiletex
 

Auria

New member
It would most likely compile, though I doubt it would run, as I "butchered" away non-working pieces of code instead of fixing them.

Though that's a needed start, though before going further I guess we'd need the support of some core mupen dev to at least go on and apply the safer bits
 

Tillin9

Mupen64Plus Dev.
You should PM Richard42 and ask for svn access and for an OSX branch since you're already submitting code. ;)

I know its been mentioned before in this thread, but I'll give a big thank you to anyone who merges in the working PPC dynarec from this project - http://code.google.com/p/mupen64gc/ Since you're on PPC OSX and want a full speed emu on your platform, that's what you'd need to do.

Something on the dev. team's todo list is to contact that project and ask for a more formal arrangement to work together. But as you can see from many of the posts in this forum, we need to try to keep our foucs narrow for things to actually get accomplished. If you're interested in pursuing a PPC OSX port, feel free to take up this task.

P.S. Sorry if I'm coming off a tad strong but we can always use a few more devs.
 

Auria

New member
Hey Tillin9,

I understand what you mean, though SVN access for me is a little too much, I know very little about emulators, what I've done is merely fix the obvious errors and point out the other ones. I could consider PM'ing a dev though, or maybe opening a ticket on the bug tracker for some of the safest changes
 

Slougi

New member
Hey Tillin9,

I understand what you mean, though SVN access for me is a little too much, I know very little about emulators, what I've done is merely fix the obvious errors and point out the other ones. I could consider PM'ing a dev though, or maybe opening a ticket on the bug tracker for some of the safest changes

Emulators aren't different from any other program really. Not knowing about them at least shouldn't keep you from contributing - i know next to nothing about dynarecs and things like that myself ;)
 
Bugger, I'm still working late, I know its only an icon but everything is the sum of its parts, hopefully I'll get a few done next week.
 

Shin_Gouki

New member
hello there!
IS there already a "test" version for x86 MAC osx? Or do i have to build it myself? Which tools you use to test only gcc?
 

DarkJezter

New member
Not having much experience here, do you know if there is much difference between binaries produced with xcode vs gcc running in the osx posix compatibility layer?

I know on win32 systems that having native tool support is ideal (MSVC support), I guess I'm wondering if this is equally as important on osx or not
 

Auria

New member
Not having much experience here, do you know if there is much difference between binaries produced with xcode vs gcc running in the osx posix compatibility layer?

It is NOT a compatibility layer, OS X IS a Unix system (don't think about something like MSYS, on OS X there is no faking of POSIX, it's the actual system. OS X is a BSD derivate, remember). XCode just fires gcc/g++ commands. The binary produced by XCode and the one produced on the terminal are exactly the same.

IS there already a "test" version for x86 MAC osx? Or do i have to build it myself? Which tools you use to test only gcc?
There is no test version for OS X, many modules in mupen are closely tied with Linux

It can be built using the makefiles, provided you use the patches provided higher in this ost. Still, I wouldn't recommend trying this if you're not a programmer, and you should not expect it to work with the raw patches provided above. They do much more in the way of showing problems than in fixing thems
 
Last edited:

Top