diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..f05377140 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,38 @@ +* text=auto + +# normal text files +*.6 text +AUTHORS text +*.c text +*.cfg text +*.cht text +*.conf text +COPYING text +*.cpp text +*.def text +*-license text +*.h text +*.html text +*.ini text +INSTALL text +LICENSES text +Makefile text +*.py text +README text +RELEASE text +*.S text +*.sh text +*.txt text +*.ver text + +# windows specific text files +*.sln text eol=crlf +*.vcproj text eol=crlf +*.vcxproj text eol=crlf +*.vcxproj.filters text eol=crlf + +# binary files +*.gz binary +*.ttf binary +cursor.tex binary +font.tex binary diff --git a/projects/msvc11/mupen64plus-video-rice.vcxproj b/projects/msvc11/mupen64plus-video-rice.vcxproj index e26192e56..e0708c2d0 100644 --- a/projects/msvc11/mupen64plus-video-rice.vcxproj +++ b/projects/msvc11/mupen64plus-video-rice.vcxproj @@ -1,217 +1,217 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {7D4AFF6A-B7D9-4C25-975A-038B8079098E} - mupen64plusvideorice - Win32Proj - - - - DynamicLibrary - MultiByte - true - v110 - - - DynamicLibrary - MultiByte - v110 - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - true - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - false - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;%(AdditionalDependencies) - true - Windows - MachineX86 - - - - - ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - Default - - - user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;%(AdditionalDependencies) - true - Windows - true - true - MachineX86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {7D4AFF6A-B7D9-4C25-975A-038B8079098E} + mupen64plusvideorice + Win32Proj + + + + DynamicLibrary + MultiByte + true + v110 + + + DynamicLibrary + MultiByte + v110 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + ..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + Default + + + user32.lib;gdi32.lib;opengl32.lib;glu32.lib;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\lib\libpng.lib;%(AdditionalDependencies) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/msvc8/mupen64plus-video-rice.vcproj b/projects/msvc8/mupen64plus-video-rice.vcproj index 34cc0b867..7b8a9a659 100644 --- a/projects/msvc8/mupen64plus-video-rice.vcproj +++ b/projects/msvc8/mupen64plus-video-rice.vcproj @@ -1,652 +1,652 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/osal_dynamiclib_win32.c b/src/osal_dynamiclib_win32.c index 4455cee52..685d717c9 100644 --- a/src/osal_dynamiclib_win32.c +++ b/src/osal_dynamiclib_win32.c @@ -1,74 +1,74 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Mupen64plus-ui-console - osal_dynamiclib_win32.c * - * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * - * Copyright (C) 2009 Richard Goedeken * - * * - * 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 * - * (at your option) 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., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include - -#include "m64p_types.h" -#include "osal_dynamiclib.h" - -m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) -{ - if (pLibHandle == NULL || pccLibraryPath == NULL) - return M64ERR_INPUT_ASSERT; - - *pLibHandle = LoadLibrary(pccLibraryPath); - - if (*pLibHandle == NULL) - { - char *pchErrMsg; - DWORD dwErr = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); - fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg); - LocalFree(pchErrMsg); - return M64ERR_INPUT_NOT_FOUND; - } - - return M64ERR_SUCCESS; -} - -void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) -{ - if (pccProcedureName == NULL) - return NULL; - - return GetProcAddress(LibHandle, pccProcedureName); -} - -m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) -{ - int rval = FreeLibrary(LibHandle); - - if (rval == 0) - { - char *pchErrMsg; - DWORD dwErr = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); - fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg); - LocalFree(pchErrMsg); - return M64ERR_INTERNAL; - } - - return M64ERR_SUCCESS; -} +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-ui-console - osal_dynamiclib_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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 * + * (at your option) 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include + +#include "m64p_types.h" +#include "osal_dynamiclib.h" + +m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath) +{ + if (pLibHandle == NULL || pccLibraryPath == NULL) + return M64ERR_INPUT_ASSERT; + + *pLibHandle = LoadLibrary(pccLibraryPath); + + if (*pLibHandle == NULL) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INPUT_NOT_FOUND; + } + + return M64ERR_SUCCESS; +} + +void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName) +{ + if (pccProcedureName == NULL) + return NULL; + + return GetProcAddress(LibHandle, pccProcedureName); +} + +m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle) +{ + int rval = FreeLibrary(LibHandle); + + if (rval == 0) + { + char *pchErrMsg; + DWORD dwErr = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL); + fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg); + LocalFree(pchErrMsg); + return M64ERR_INTERNAL; + } + + return M64ERR_SUCCESS; +} diff --git a/src/osal_files_win32.c b/src/osal_files_win32.c index cfddd212b..dd06fbedf 100644 --- a/src/osal_files_win32.c +++ b/src/osal_files_win32.c @@ -1,145 +1,145 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Mupen64plus-core - osal_files_win32.c * - * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * - * Copyright (C) 2009 Richard Goedeken * - * * - * 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 * - * (at your option) 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., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This file contains the definitions for the unix-specific file handling - * functions - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "osal_files.h" - -/* global functions */ - -int osal_is_directory(const char* name) -{ - char DirName[MAX_PATH + 1]; - int namelen = 0; - - /* we must remove any trailing backslash on the end of the pathname, or this will fail */ - strncpy(DirName, name, MAX_PATH); - DirName[MAX_PATH] = 0; - namelen = strlen(DirName); - if (namelen > 0 && DirName[namelen-1] == '\\') - DirName[namelen-1] = 0; - return (GetFileAttributes(DirName) & FILE_ATTRIBUTE_DIRECTORY); -} - -int osal_mkdirp(const char *dirpath, int mode) -{ - struct _stat fileinfo; - size_t dirpathlen = strlen(dirpath); - char *currpath = _strdup(dirpath); - - /* first, remove sub-dirs on the end (by replacing slashes with NULL chars) until we find an existing directory */ - while (strlen(currpath) > 1 && _stat(currpath, &fileinfo) != 0) - { - char *lastslash = strrchr(currpath, '\\'); - if (lastslash == NULL) - { - free(currpath); - return 1; /* error: we never found an existing directory, this path is bad */ - } - *lastslash = 0; - } - - /* then walk up the path chain, creating directories along the way */ - do - { - if (currpath[strlen(currpath)-1] != '\\' && _stat(currpath, &fileinfo) != 0) - { - if (_mkdir(currpath) != 0) - { - free(currpath); - return 2; /* mkdir failed */ - } - } - if (strlen(currpath) == dirpathlen) - break; - else - currpath[strlen(currpath)] = '\\'; - } while (1); - - free(currpath); - return 0; -} - -typedef struct { - HANDLE hFind; - WIN32_FIND_DATA find_data; -} dir_search_info; - -void * osal_search_dir_open(const char *pathname) -{ - char SearchString[MAX_PATH + 1]; - dir_search_info *pInfo = malloc(sizeof(dir_search_info)); - - if (pInfo == NULL) - return NULL; - - pInfo->hFind = INVALID_HANDLE_VALUE; - pInfo->find_data.cFileName[0] = 0; - - if (pathname[strlen(pathname)-1] == '\\') - _snprintf(SearchString, MAX_PATH, "%s*", pathname); - else - _snprintf(SearchString, MAX_PATH, "%s\\*", pathname); - SearchString[MAX_PATH] = 0; - - pInfo->hFind = FindFirstFile(SearchString, &pInfo->find_data); - return (void *) pInfo; -} - -const char *osal_search_dir_read_next(void * search_info) -{ - static char last_filename[_MAX_PATH]; - dir_search_info *pInfo = (dir_search_info *) search_info; - - if (pInfo == NULL || pInfo->hFind == INVALID_HANDLE_VALUE || pInfo->find_data.cFileName[0] == 0) - return NULL; - - strcpy(last_filename, pInfo->find_data.cFileName); - - if (FindNextFile(pInfo->hFind, &pInfo->find_data) == 0) - { - pInfo->find_data.cFileName[0] = 0; - } - - return last_filename; -} - -void osal_search_dir_close(void * search_info) -{ - dir_search_info *pInfo = (dir_search_info *) search_info; - - if (pInfo != NULL) - { - if (pInfo->hFind != INVALID_HANDLE_VALUE) - FindClose(pInfo->hFind); - free(pInfo); - } -} +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus-core - osal_files_win32.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2009 Richard Goedeken * + * * + * 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 * + * (at your option) 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This file contains the definitions for the unix-specific file handling + * functions + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "osal_files.h" + +/* global functions */ + +int osal_is_directory(const char* name) +{ + char DirName[MAX_PATH + 1]; + int namelen = 0; + + /* we must remove any trailing backslash on the end of the pathname, or this will fail */ + strncpy(DirName, name, MAX_PATH); + DirName[MAX_PATH] = 0; + namelen = strlen(DirName); + if (namelen > 0 && DirName[namelen-1] == '\\') + DirName[namelen-1] = 0; + return (GetFileAttributes(DirName) & FILE_ATTRIBUTE_DIRECTORY); +} + +int osal_mkdirp(const char *dirpath, int mode) +{ + struct _stat fileinfo; + size_t dirpathlen = strlen(dirpath); + char *currpath = _strdup(dirpath); + + /* first, remove sub-dirs on the end (by replacing slashes with NULL chars) until we find an existing directory */ + while (strlen(currpath) > 1 && _stat(currpath, &fileinfo) != 0) + { + char *lastslash = strrchr(currpath, '\\'); + if (lastslash == NULL) + { + free(currpath); + return 1; /* error: we never found an existing directory, this path is bad */ + } + *lastslash = 0; + } + + /* then walk up the path chain, creating directories along the way */ + do + { + if (currpath[strlen(currpath)-1] != '\\' && _stat(currpath, &fileinfo) != 0) + { + if (_mkdir(currpath) != 0) + { + free(currpath); + return 2; /* mkdir failed */ + } + } + if (strlen(currpath) == dirpathlen) + break; + else + currpath[strlen(currpath)] = '\\'; + } while (1); + + free(currpath); + return 0; +} + +typedef struct { + HANDLE hFind; + WIN32_FIND_DATA find_data; +} dir_search_info; + +void * osal_search_dir_open(const char *pathname) +{ + char SearchString[MAX_PATH + 1]; + dir_search_info *pInfo = malloc(sizeof(dir_search_info)); + + if (pInfo == NULL) + return NULL; + + pInfo->hFind = INVALID_HANDLE_VALUE; + pInfo->find_data.cFileName[0] = 0; + + if (pathname[strlen(pathname)-1] == '\\') + _snprintf(SearchString, MAX_PATH, "%s*", pathname); + else + _snprintf(SearchString, MAX_PATH, "%s\\*", pathname); + SearchString[MAX_PATH] = 0; + + pInfo->hFind = FindFirstFile(SearchString, &pInfo->find_data); + return (void *) pInfo; +} + +const char *osal_search_dir_read_next(void * search_info) +{ + static char last_filename[_MAX_PATH]; + dir_search_info *pInfo = (dir_search_info *) search_info; + + if (pInfo == NULL || pInfo->hFind == INVALID_HANDLE_VALUE || pInfo->find_data.cFileName[0] == 0) + return NULL; + + strcpy(last_filename, pInfo->find_data.cFileName); + + if (FindNextFile(pInfo->hFind, &pInfo->find_data) == 0) + { + pInfo->find_data.cFileName[0] = 0; + } + + return last_filename; +} + +void osal_search_dir_close(void * search_info) +{ + dir_search_info *pInfo = (dir_search_info *) search_info; + + if (pInfo != NULL) + { + if (pInfo->hFind != INVALID_HANDLE_VALUE) + FindClose(pInfo->hFind); + free(pInfo); + } +}