Commits

wahrhaft  committed daa382f Merge

merge from fixes branch

  • Participants
  • Parent commits f6c4bb7, cbfb248

Comments (0)

Files changed (14)

File src/Glide64/Config.cpp

     return ConfigGetParamInt(video_general_section, itemname);
 }
 
+PackedScreenResolution Config_ReadScreenSettings()
+{
+    PackedScreenResolution packedResolution;
+
+    packedResolution.width = ConfigGetParamInt(video_general_section, "ScreenWidth");
+    packedResolution.height = ConfigGetParamInt(video_general_section, "ScreenHeight");
+    packedResolution.fullscreen = ConfigGetParamBool(video_general_section, "Fullscreen");
+
+    return packedResolution;
+}
+
 BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create, int isBoolean)
 {
     VLOG("Getting value %s", itemname);

File src/Glide64/Config.h

 
 BOOL Config_Open();
 int Config_ReadScreenInt(const char *itemname);
+PackedScreenResolution Config_ReadScreenSettings();
 BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create=TRUE, BOOL isBoolean=TRUE);
 
 

File src/Glide64/GlideExtensions.h

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 #define GR_BUFFER_TEXTUREBUFFER_EXT       0x6
 #define GR_BUFFER_TEXTUREAUXBUFFER_EXT    0x7
 

File src/Glide64/Ini.cpp

 	if (!INI_FindSection(path, false))
 	{
 		printf("Could not find [%s] section in INI file!", path);
-		exit(1);
 	}
 }
 

File src/Glide64/Main.cpp

 static void DrawFrameBuffer ();
 
 
-void (*renderCallback)() = NULL;
+void (*renderCallback)(int) = NULL;
 static void (*l_DebugCallback)(void *, int, const char *) = NULL;
 static void *l_DebugCallContext = NULL;
 
       settings.scr_res_y = settings.res_y = resolutions[settings.res_data][1];
     }
     */
+	
+	PackedScreenResolution tmpRes = Config_ReadScreenSettings();
+	settings.res_data = tmpRes.resolution;
+	settings.scr_res_x = settings.res_x = tmpRes.width;
+	settings.scr_res_y = settings.res_y = tmpRes.height;
 
     //frame buffer
     int smart_read = ini->Read(_T("fb_smart"), -1);
   info.size = sizeof(GrLfbInfo_t);
   if (grLfbLock (GR_LFB_READ_ONLY,
     GR_BUFFER_FRONTBUFFER,
-    GR_LFBWRITEMODE_565,
+    GR_LFBWRITEMODE_888,
     GR_ORIGIN_UPPER_LEFT,
     FXFALSE,
     &info))
   VLOG ("ShowCFB ()\n");
 }
 
-EXPORT void CALL SetRenderingCallback(void (*callback)())
+EXPORT void CALL SetRenderingCallback(void (*callback)(int))
 {
   VLOG("CALL SetRenderingCallback (*)\n");
     renderCallback = callback;
     if ((settings.show_fps & 0xF) || settings.clock)
       set_message_combiner ();
 #ifdef FPS
-    float y = 0;//(float)settings.res_y;
+    float y = (float)settings.res_y;
     if (settings.show_fps & 0x0F)
     {
       if (settings.show_fps & 4)
       {
         if (region)   // PAL
-          output (0, y, 1, "%d%% ", (int)pal_percent);
+          output (0, y, 0, "%d%% ", (int)pal_percent);
         else
-          output (0, y, 1, "%d%% ", (int)ntsc_percent);
-        y += 16;
+          output (0, y, 0, "%d%% ", (int)ntsc_percent);
+        y -= 16;
       }
       if (settings.show_fps & 2)
       {
-        output (0, y, 1, "VI/s: %.02f ", vi);
-        y += 16;
+        output (0, y, 0, "VI/s: %.02f ", vi);
+        y -= 16;
       }
       if (settings.show_fps & 1)
-        output (0, y, 1, "FPS: %.02f ", fps);
+        output (0, y, 0, "FPS: %.02f ", fps);
     }
 #endif
 
         }
         hotkey_info.hk_filtering--;
       }
-      output (120.0f, 0.0f, 1, message, 0);
+      output (120.0f, (float)settings.res_y, 0, message, 0);
     }
   }
     #ifdef OLDAPI

File src/Glide64/cursor.h

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 wxUint8 cursor[] = {127,
 255,
 127,

File src/Glide64/font.h

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 wxUint8 font[] = {255,
 255,
 255,

File src/Glide64/winlnxdefs.h

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+* Copyright (c) 2012-2013 balrog, wahrhaft
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+
 #ifndef WINLNXDEFS_H
 #define WINLNXDEFS_H
 

File src/GlideHQ/tc-1.1+/types.h

+/*
+ * Texture compression
+ * Version:  1.0
+ *
+ * Copyright (C) 2004  Daniel Borca   All Rights Reserved.
+ *
+ * this is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * this is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        
+ */
+
 #ifndef TYPES_H_included
 #define TYPES_H_included
 

File src/Glitch64/combiner.cpp

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 #ifdef _WIN32
 #include <windows.h>
 #else // _WIN32

File src/Glitch64/geometry.cpp

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 #include <stdio.h>
 #ifdef _WIN32
 #include <windows.h>

File src/Glitch64/main.cpp

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 #define SAVE_CBUFFER
 
 #ifdef _WIN32
 #include <IL/il.h>
 #endif
 
-extern void (*renderCallback)();
+extern void (*renderCallback)(int);
 
 wrapper_config config = {0, 0, 0, 0};
 int screen_width, screen_height;
   width = ConfigGetParamInt(video_general_section, "ScreenWidth");
   height = ConfigGetParamInt(video_general_section, "ScreenHeight");
   fullscreen = ConfigGetParamBool(video_general_section, "Fullscreen");
-
+  int vsync = ConfigGetParamBool(video_general_section, "VerticalSync");
   //viewport_offset = ((screen_resolution>>2) > 20) ? screen_resolution >> 2 : 20;
   // ZIGGY viewport_offset is WIN32 specific, with SDL just set it to zero
   viewport_offset = 0; //-10 //-20;
 
   // ZIGGY not sure, but it might be better to let the system choose
   CoreVideo_GL_SetAttribute(M64P_GL_DOUBLEBUFFER, 1);
+  CoreVideo_GL_SetAttribute(M64P_GL_SWAP_CONTROL, vsync);
   CoreVideo_GL_SetAttribute(M64P_GL_BUFFER_SIZE, 16);
   //   SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32);
   //   SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
 FX_ENTRY void FX_CALL
 grBufferSwap( FxU32 swap_interval )
 {
+	glFinish();
 //  printf("rendercallback is %p\n", renderCallback);
   if(renderCallback)
-      (*renderCallback)();
+      (*renderCallback)(1);
   int i;
   LOG("grBufferSwap(%d)\r\n", swap_interval);
   //printf("swap\n");

File src/Glitch64/main.h

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 #ifndef MAIN_H
 #define MAIN_H
 

File src/Glitch64/textures.cpp

+/*
+* Glide64 - Glide video plugin for Nintendo 64 emulators.
+* Copyright (c) 2002  Dave2001
+* Copyright (c) 2003-2009  Sergey 'Gonetz' Lipski
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 #ifdef _WIN32
 #include <windows.h>
 #else // _WIN32