Some printf and Correct aspect ratio for Rice(s)
authorptitSeb <sebastien.chev@gmail.com>
Fri, 11 Oct 2013 13:01:24 +0000 (15:01 +0200)
committerptitSeb <sebastien.chev@gmail.com>
Fri, 11 Oct 2013 13:01:24 +0000 (15:01 +0200)
source/gles2n64/src/Config.cpp
source/gles2n64/src/OpenGL.cpp
source/gles2rice/src/OGLRender.cpp
source/rice_gles/src/Config.cpp
source/rice_gles/src/OGLRender.cpp

index c34ff6c..4d91c11 100644 (file)
@@ -214,17 +214,20 @@ void Config_LoadRomConfig(unsigned char* header)
     }
 
     LOG(LOG_MINIMAL, "Rom is %s\n", config.romPAL ? "PAL" : "NTSC");
+printf("Rom is %s\n", config.romPAL ? "PAL" : "NTSC");
 
     const char *filename = ConfigGetSharedDataFilepath("gles2n64rom.conf");
     FILE *f = fopen(filename,"r");
     if (!f)
     {
         LOG(LOG_MINIMAL, "Could not find %s Rom settings file, using global.\n", filename);
+printf("Could not find %s Rom settings file, using global.\n", filename);
         return;
     }
     else
     {
         LOG(LOG_MINIMAL, "[gles2N64]: Searching %s Database for \"%s\" ROM\n", filename, config.romName);
+printf("[gles2N64]: Searching %s Database for \"%s\" ROM\n", filename, config.romName);
         bool isRom = false;
         while (!feof(f))
         {
@@ -249,6 +252,7 @@ void Config_LoadRomConfig(unsigned char* header)
                     *val++ = '\0';
                     Config_SetOption(line,val);
                     LOG(LOG_MINIMAL, "%s = %s", line, val);
+printf("%s = %s", line, val);
                 }
             }
         }
@@ -272,11 +276,14 @@ void Config_LoadConfig()
     {
         LOG(LOG_MINIMAL, "[gles2N64]: Couldn't open config file '%s' for reading: %s\n", filename, strerror( errno ) );
         LOG(LOG_MINIMAL, "[gles2N64]: Attempting to write new Config \n");
+printf("[gles2N64]: Couldn't open config file '%s' for reading: %s\n", filename, strerror( errno ) );
+printf("[gles2N64]: Attempting to write new Config \n");
         Config_WriteConfig(filename);
     }
     else
     {
         LOG(LOG_MINIMAL, "[gles2n64]: Loading Config from %s \n", filename);
+printf("[gles2n64]: Loading Config from %s \n", filename);
 
         while (!feof( f ))
         {
@@ -297,6 +304,7 @@ void Config_LoadConfig()
         if (config.version < CONFIG_VERSION)
         {
             LOG(LOG_WARNING, "[gles2N64]: Wrong config version, rewriting config with defaults\n");
+printf("[gles2N64]: Wrong config version, rewriting config with defaults\n");
             Config_SetDefault();
             Config_WriteConfig(filename);
         }
index be71371..a6e676d 100755 (executable)
@@ -266,7 +266,7 @@ else*/
 
     // TODO: Replace SDL_SetVideoMode with something that is SDL 2.0 compatible
     //       Better yet, eliminate all SDL calls by using the Mupen64Plus core api
-    if (!(OGL.hScreen = SDL_SetVideoMode( current_w, current_h, bitsPP, SDL_HWSURFACE )))
+    if (!(OGL.hScreen = SDL_SetVideoMode( current_w, current_h, bitsPP, SDL_HWSURFACE | SDL_FULLSCREEN )))
     {
         LOG(LOG_ERROR, "Problem setting videomode %dx%d: %s\n", current_w, current_h, SDL_GetError() );
         SDL_QuitSubSystem( SDL_INIT_VIDEO );
index 542faec..d0b8cf3 100755 (executable)
@@ -1122,7 +1122,9 @@ void OGLRender::UpdateScissor()
         uint32 height = (gRDP.scissor.right*gRDP.scissor.bottom)/width;
         glEnable(GL_SCISSOR_TEST);
         OPENGL_CHECK_ERRORS;
-        glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+/*        glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+            int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) );*/
+        glScissor(80, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
             int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) );
         OPENGL_CHECK_ERRORS;
     }
@@ -1143,13 +1145,17 @@ void OGLRender::ApplyRDPScissor(bool force)
         uint32 height = (gRDP.scissor.right*gRDP.scissor.bottom)/width;
         glEnable(GL_SCISSOR_TEST);
         OPENGL_CHECK_ERRORS;
-        glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+/*        glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+            int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) );*/
+        glScissor(80, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
             int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) );
         OPENGL_CHECK_ERRORS;
     }
     else
     {
-        glScissor(int(gRDP.scissor.left*windowSetting.fMultX), int((windowSetting.uViHeight-gRDP.scissor.bottom)*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+/*        glScissor(int(gRDP.scissor.left*windowSetting.fMultX), int((windowSetting.uViHeight-gRDP.scissor.bottom)*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+            int((gRDP.scissor.right-gRDP.scissor.left)*windowSetting.fMultX), int((gRDP.scissor.bottom-gRDP.scissor.top)*windowSetting.fMultY ));*/
+        glScissor(80+int(gRDP.scissor.left*windowSetting.fMultX), int((windowSetting.uViHeight-gRDP.scissor.bottom)*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
             int((gRDP.scissor.right-gRDP.scissor.left)*windowSetting.fMultX), int((gRDP.scissor.bottom-gRDP.scissor.top)*windowSetting.fMultY ));
         OPENGL_CHECK_ERRORS;
     }
@@ -1163,7 +1169,9 @@ void OGLRender::ApplyScissorWithClipRatio(bool force)
 
     glEnable(GL_SCISSOR_TEST);
     OPENGL_CHECK_ERRORS;
-    glScissor(windowSetting.clipping.left, int((windowSetting.uViHeight-gRSP.real_clip_scissor_bottom)*windowSetting.fMultY)+windowSetting.statusBarHeightToUse,
+/*    glScissor(windowSetting.clipping.left, int((windowSetting.uViHeight-gRSP.real_clip_scissor_bottom)*windowSetting.fMultY)+windowSetting.statusBarHeightToUse,
+        windowSetting.clipping.width, windowSetting.clipping.height);*/
+    glScissor(80+windowSetting.clipping.left, int((windowSetting.uViHeight-gRSP.real_clip_scissor_bottom)*windowSetting.fMultY)+windowSetting.statusBarHeightToUse,
         windowSetting.clipping.width, windowSetting.clipping.height);
     OPENGL_CHECK_ERRORS;
 
@@ -1274,6 +1282,8 @@ void OGLRender::glViewportWrapper(GLint x, GLint y, GLsizei width, GLsizei heigh
     static GLint mx=0,my=0;
     static GLsizei m_width=0, m_height=0;
     static bool mflag=true;
+    
+    x+=80;
 
     if( x!=mx || y!=my || width!=m_width || height!=m_height || mflag!=flag)
     {
index db55255..a749357 100755 (executable)
@@ -431,7 +431,7 @@ static void ReadConfiguration(void)
 {
     windowSetting.bDisplayFullscreen = ConfigGetParamBool(l_ConfigVideoGeneral, "Fullscreen");
     windowSetting.uDisplayWidth = ConfigGetParamInt(l_ConfigVideoGeneral, "ScreenWidth");
-#ifdef HAVE_GLES0
+#ifdef HAVE_GLES
        if (windowSetting.uDisplayWidth==800)
                windowSetting.uDisplayWidth = 640;      // no strech
 #endif
index e723de9..8ced90f 100755 (executable)
@@ -1417,7 +1417,7 @@ void OGLRender::UpdateScissor()
         uint32 height = (gRDP.scissor.right*gRDP.scissor.bottom)/width;
         glEnable(GL_SCISSOR_TEST);
         OPENGL_CHECK_ERRORS;
-        glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+        glScissor(80, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
             int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) );
         OPENGL_CHECK_ERRORS;
     }
@@ -1438,13 +1438,13 @@ void OGLRender::ApplyRDPScissor(bool force)
         uint32 height = (gRDP.scissor.right*gRDP.scissor.bottom)/width;
         glEnable(GL_SCISSOR_TEST);
         OPENGL_CHECK_ERRORS;
-        glScissor(0, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+        glScissor(80, int(height*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
             int(width*windowSetting.fMultX), int(height*windowSetting.fMultY) );
         OPENGL_CHECK_ERRORS;
     }
     else
     {
-        glScissor(int(gRDP.scissor.left*windowSetting.fMultX), int((windowSetting.uViHeight-gRDP.scissor.bottom)*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
+        glScissor(80+int(gRDP.scissor.left*windowSetting.fMultX), int((windowSetting.uViHeight-gRDP.scissor.bottom)*windowSetting.fMultY+windowSetting.statusBarHeightToUse),
             int((gRDP.scissor.right-gRDP.scissor.left)*windowSetting.fMultX), int((gRDP.scissor.bottom-gRDP.scissor.top)*windowSetting.fMultY ));
         OPENGL_CHECK_ERRORS;
     }
@@ -1458,7 +1458,7 @@ void OGLRender::ApplyScissorWithClipRatio(bool force)
 
     glEnable(GL_SCISSOR_TEST);
     OPENGL_CHECK_ERRORS;
-    glScissor(windowSetting.clipping.left, int((windowSetting.uViHeight-gRSP.real_clip_scissor_bottom)*windowSetting.fMultY)+windowSetting.statusBarHeightToUse,
+    glScissor(80+windowSetting.clipping.left, int((windowSetting.uViHeight-gRSP.real_clip_scissor_bottom)*windowSetting.fMultY)+windowSetting.statusBarHeightToUse,
         windowSetting.clipping.width, windowSetting.clipping.height);
     OPENGL_CHECK_ERRORS;
 
@@ -1569,6 +1569,8 @@ void OGLRender::glViewportWrapper(GLint x, GLint y, GLsizei width, GLsizei heigh
     static GLint mx=0,my=0;
     static GLsizei m_width=0, m_height=0;
     static bool mflag=true;
+       
+       x+=80;
 
     if( x!=mx || y!=my || width!=m_width || height!=m_height || mflag!=flag)
     {