Merge pull request #95 from death-droid/VersionHAdd

Version h add
This commit is contained in:
zilmar 2015-02-18 07:38:53 +11:00
commit 065b9961c5
27 changed files with 236 additions and 265 deletions

View File

@ -181,10 +181,6 @@
RelativePath="Trace.cpp" RelativePath="Trace.cpp"
> >
</File> </File>
<File
RelativePath="Version.cpp"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
@ -242,10 +238,6 @@
RelativePath="TraceDefs.h" RelativePath="TraceDefs.h"
> >
</File> </File>
<File
RelativePath="Version.h"
>
</File>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>

View File

@ -49,7 +49,6 @@
<PrecompiledHeader>Create</PrecompiledHeader> <PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile> </ClCompile>
<ClCompile Include="Trace.cpp" /> <ClCompile Include="Trace.cpp" />
<ClCompile Include="Version.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="CriticalSection.h" /> <ClInclude Include="CriticalSection.h" />
@ -65,7 +64,6 @@
<ClInclude Include="stdafx.h" /> <ClInclude Include="stdafx.h" />
<ClInclude Include="Trace.h" /> <ClInclude Include="Trace.h" />
<ClInclude Include="TraceDefs.h" /> <ClInclude Include="TraceDefs.h" />
<ClInclude Include="Version.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

View File

@ -41,9 +41,6 @@
<ClCompile Include="Trace.cpp"> <ClCompile Include="Trace.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Version.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="CriticalSection.h"> <ClInclude Include="CriticalSection.h">
@ -85,8 +82,5 @@
<ClInclude Include="TraceDefs.h"> <ClInclude Include="TraceDefs.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,145 +0,0 @@
#include "stdafx.h"
#pragma comment(lib, "version.lib")
stdstr ReadVersionInfo( BYTE * Array, LPCTSTR Info )
{
// Read the list of languages and code pages. We will use only the first one.
struct SLangCP { WORD wLang; WORD wCP; } * pTrans ;
UINT nVersionLen = 0 ;
BOOL bRetCode = ::VerQueryValue( Array, TEXT("\\VarFileInfo\\Translation"), (LPVOID*)&pTrans, &nVersionLen );
if (!bRetCode)
{
WriteTrace(TraceError,_T("ReadVersionInfo(): VerQueryValue failed"));
return _T("");
}
// Get the file version
TCHAR szLookup[MAX_PATH] ;
_stprintf( szLookup, TEXT("\\StringFileInfo\\%04x%04x\\%s"),pTrans[0].wLang, pTrans[0].wCP,Info ) ;
LPTSTR pszVersion = NULL ;
bRetCode = ::VerQueryValue( Array, szLookup, (LPVOID*)&pszVersion, &nVersionLen ) ;
if (!bRetCode)
{
WriteTrace(TraceError,_T("ReadVersionInfo(): VerQueryValue failed"));
return _T("");
}
if (_tcscmp(Info,VERSION_PRODUCT_VERSION) == 0 || _tcscmp(Info,VERSION_FILE_VERSION) == 0)
{
for (ULONG Pos = 0; Pos < _tcslen(pszVersion); Pos ++) {
if (pszVersion[Pos] == ',')
{
pszVersion[Pos] = '.';
}
}
}
return pszVersion;
}
bool HasFileVersionInfo( LPCTSTR /*Info*/, LPCTSTR FileName )
{
DWORD dwHandle;
DWORD Size = GetFileVersionInfoSize((LPTSTR)FileName,&dwHandle);
if ( Size == 0)
{
return false;
}
return true;
}
stdstr FileVersionInfo( LPCTSTR Info, LPCTSTR FileName )
{
stdstr Result;
if(FileName)
{
if(_tcslen(FileName) != 0)
{
DWORD dwHandle = 0;
DWORD Size = GetFileVersionInfoSize((LPSTR)FileName,&dwHandle);
if ( Size == 0)
{
//WriteTraceF(TraceError,_T("FileVersionInfo(%s, %s): GetFileVersionInfoSize failed, error (%s)"),Info,FileName,BaseException::GetLastErrorDescription(GetLastError()).c_str());
return TEXT("");
}
BYTE * Array = new BYTE [Size+(1*sizeof(TCHAR))];
if(Array)
{
memset(Array, 0, Size+(1*sizeof(TCHAR)));
try
{
if (!GetFileVersionInfo((LPSTR)FileName,0,Size,Array))
{
//WriteTraceF(TraceError,_T("FileVersionInfo(%s, %s): GetFileVersionInfo(%d) failed, error (%s)"),Info,FileName,Size,BaseException::GetLastErrorDescription(GetLastError()).c_str());
delete [] Array;
return _T("");
}
}
catch (...)
{
WriteTrace(TraceError,_T("Unhandled exception in FileVersionInfo (1)"));
delete [] Array;
return _T("");
}
try
{
Result = ReadVersionInfo(Array,Info);
if(!Result.empty())
{
if (strcmp(Info,VERSION_PRODUCT_VERSION) == 0)
{
Result.Replace(" ","");
}
} else {
WriteTraceF(TraceError,_T("FileVersionInfo(%s), ReadVersionInfo() failed"), FileName);
}
}
catch (...)
{
WriteTrace(TraceError,_T("Unhandled exception in FileVersionInfo (2)"));
delete [] Array;
return _T("");
}
delete [] Array;
}
else
{
WriteTraceF(TraceError,_T("Failed to allocate %d bytes"), Size+(1*sizeof(TCHAR)));
}
}
else
{
WriteTraceF(TraceError,_T("FileVersionInfo received a pointer to an empty string"));
}
}
else
{
WriteTraceF(TraceError,_T("FileVersionInfo received NULL pointer"));
}
return Result;
}
stdstr VersionInfo(LPCTSTR Info, HMODULE hModule)
{
TCHAR FileName[MAX_PATH];
if (GetModuleFileName(hModule,FileName,sizeof(FileName)) != 0)
{
return FileVersionInfo(Info,FileName);
}
return TEXT("");
}

View File

@ -1,16 +0,0 @@
#pragma once
#define VERSION_COMPANY_NAME "CompanyName"
#define VERSION_FILE_DESCRIPTION "FileDescription"
#define VERSION_FILE_VERSION "FileVersion"
#define VERSION_INTERNAL_NAME "InternalName"
#define VERSION_LEGAL_COPYRIGHT "LegalCopyright"
#define VERSION_ORIGINAL_FILE_NAME "OriginalFileName"
#define VERSION_PRODUCT_NAME "ProductName"
#define VERSION_PRODUCT_VERSION "ProductVersion"
#include "std string.h"
bool HasFileVersionInfo ( LPCSTR Info, LPCSTR FileName );
stdstr FileVersionInfo ( LPCSTR Info, LPCSTR FileName );
stdstr VersionInfo ( LPCSTR Info, HMODULE hModule = NULL);

View File

@ -15,6 +15,5 @@
#include "Log Class.h" #include "Log Class.h"
#include "TraceDefs.h" #include "TraceDefs.h"
#include "Trace.h" #include "Trace.h"
#include "Version.h"
#include "md5.h" #include "md5.h"
#include "Smart Pointer.h" #include "Smart Pointer.h"

View File

@ -2,6 +2,8 @@
// //
#include "resource.h" #include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
#include "WinResrc.h" #include "WinResrc.h"
@ -67,34 +69,30 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,1 FILEVERSION VER_FILE_VERSION
PRODUCTVERSION 2,0,0,1 PRODUCTVERSION VER_PRODUCT_VERSION
FILEFLAGSMASK 0x17L FILEFLAGSMASK 0x1fL
#ifdef _DEBUG FILEFLAGS VER_FILEFLAGS
FILEFLAGS 0x1L FILEOS VER_FILEOS
#else FILETYPE VER_FILETYPE
FILEFLAGS 0x0L FILESUBTYPE 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "0c0904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "FileDescription", "Glide 64 for Project64" VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0"
VALUE "FileVersion", "2, 0, 0, 1" VALUE "FileVersion", VER_FILE_VERSION_STR "\0"
VALUE "InternalName", "Glide64" VALUE "InternalName", VER_INTERNAL_NAME_STR "\0"
VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0"
VALUE "OriginalFilename", "Glide64.dll" VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0"
VALUE "ProductName", "Glide 64 for Project64" VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", "2, 0, 0, 1" VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
BEGIN BEGIN
VALUE "Translation", 0xc09, 1200 VALUE "Translation", 0x409, 1200
END END
END END

View File

@ -198,6 +198,10 @@
RelativePath="ucode09rdp.h" RelativePath="ucode09rdp.h"
> >
</File> </File>
<File
RelativePath="Version.h""
>
</File>
<File <File
RelativePath="ucodeFB.h" RelativePath="ucodeFB.h"
> >

View File

@ -110,6 +110,7 @@
<ClInclude Include="rdp.h" /> <ClInclude Include="rdp.h" />
<ClInclude Include="TexBuffer.h" /> <ClInclude Include="TexBuffer.h" />
<ClInclude Include="Util.h" /> <ClInclude Include="Util.h" />
<ClInclude Include="Version.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="CRC.cpp" /> <ClCompile Include="CRC.cpp" />

View File

@ -127,6 +127,7 @@
<ClInclude Include="rdp.h" /> <ClInclude Include="rdp.h" />
<ClInclude Include="TexBuffer.h" /> <ClInclude Include="TexBuffer.h" />
<ClInclude Include="Util.h" /> <ClInclude Include="Util.h" />
<ClInclude Include="Version.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="CRC.cpp"> <ClCompile Include="CRC.cpp">

View File

@ -38,7 +38,8 @@
//**************************************************************** //****************************************************************
#include "Gfx #1.3.h" #include "Gfx #1.3.h"
#include <Common/Version.h> #include "Version.h"
#include <Common/std string.h>
#include <Settings/Settings.h> #include <Settings/Settings.h>
#include <wx/fileconf.h> #include <wx/fileconf.h>
@ -1459,9 +1460,9 @@ void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo )
PluginInfo->Version = 0x0104; // Set to 0x0104 PluginInfo->Version = 0x0104; // Set to 0x0104
PluginInfo->Type = PLUGIN_TYPE_GFX; // Set to PLUGIN_TYPE_GFX PluginInfo->Type = PLUGIN_TYPE_GFX; // Set to PLUGIN_TYPE_GFX
#ifdef _DEBUG #ifdef _DEBUG
sprintf(PluginInfo->Name,"Glide64 For PJ64 (Debug): %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); sprintf(PluginInfo->Name, "Glide64 For PJ64 (Debug): %s", VER_FILE_VERSION_STR);
#else #else
sprintf(PluginInfo->Name,"Glide64 For PJ64: %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); sprintf(PluginInfo->Name,"Glide64 For PJ64: %s", VER_FILE_VERSION_STR);
#endif #endif
// If DLL supports memory these memory options then set them to TRUE or FALSE // If DLL supports memory these memory options then set them to TRUE or FALSE

50
Source/Glide64/Version.h Normal file
View File

@ -0,0 +1,50 @@
/*
* 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 STRINGIZE2(s) #s
#define STRINGIZE(s) STRINGIZE2(s)
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 0
#define VERSION_BUILD 1
#define VER_FILE_DESCRIPTION_STR "Glide 64 for Project64"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD
#define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \
"." STRINGIZE(VERSION_MINOR) \
"." STRINGIZE(VERSION_REVISION) \
"." STRINGIZE(VERSION_BUILD) \
#define VER_PRODUCTNAME_STR "Glide64"
#define VER_PRODUCT_VERSION VER_FILE_VERSION
#define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_STR
#define VER_ORIGINAL_FILENAME_STR VER_PRODUCTNAME_STR ".dll"
#define VER_INTERNAL_NAME_STR VER_PRODUCTNAME_STR
#define VER_COPYRIGHT_STR "Copyright (C) 2013"
#ifdef _DEBUG
#define VER_VER_DEBUG VS_FF_DEBUG
#else
#define VER_VER_DEBUG 0
#endif
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEFLAGS VER_VER_DEBUG
#define VER_FILETYPE VFT_APP

View File

@ -777,6 +777,10 @@
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl" Filter="h;hpp;hxx;hm;inl"
> >
<File
RelativePath="Version.h""
>
</File>
<File <File
RelativePath="Multilanguage.h" RelativePath="Multilanguage.h"
> >

View File

@ -201,6 +201,7 @@
<ClInclude Include="Settings.h" /> <ClInclude Include="Settings.h" />
<ClInclude Include="stdafx.h" /> <ClInclude Include="stdafx.h" />
<ClInclude Include="User Interface.h" /> <ClInclude Include="User Interface.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="WTL App.h" /> <ClInclude Include="WTL App.h" />
<ClInclude Include="Settings\Debug Settings.h" /> <ClInclude Include="Settings\Debug Settings.h" />
<ClInclude Include="Settings\Game Settings.h" /> <ClInclude Include="Settings\Game Settings.h" />

View File

@ -833,5 +833,8 @@
<ClInclude Include="Plugins\Plugin Base.h"> <ClInclude Include="Plugins\Plugin Base.h">
<Filter>Header Files\Plugin Headers</Filter> <Filter>Header Files\Plugin Headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -8,7 +8,6 @@
#include <common//Log Class.h> #include <common//Log Class.h>
#include <common/TraceDefs.h> #include <common/TraceDefs.h>
#include <common/Trace.h> #include <common/Trace.h>
#include <common/Version.h>
#include <common/path.h> #include <common/path.h>
#include <common/Smart Pointer.h> #include <common/Smart Pointer.h>
#include <common/Ini File Class.h> #include <common/Ini File Class.h>

View File

@ -72,6 +72,8 @@ CMainGui::~CMainGui (void)
bool CMainGui::RegisterWinClass ( void ) bool CMainGui::RegisterWinClass ( void )
{ {
stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR);
WNDCLASS wcl; WNDCLASS wcl;
wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
@ -84,7 +86,7 @@ bool CMainGui::RegisterWinClass ( void )
wcl.lpfnWndProc = (WNDPROC)MainGui_Proc; wcl.lpfnWndProc = (WNDPROC)MainGui_Proc;
wcl.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wcl.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wcl.lpszMenuName = NULL; wcl.lpszMenuName = NULL;
wcl.lpszClassName = "Project64 2.0"; wcl.lpszClassName = VersionDisplay.c_str();
if (RegisterClass(&wcl) == 0) return false; if (RegisterClass(&wcl) == 0) return false;
return true; return true;
} }
@ -310,7 +312,8 @@ void CMainGui::Caption (LPCSTR Caption) {
void CMainGui::Create (const char * WindowTitle) void CMainGui::Create (const char * WindowTitle)
{ {
m_hMainWindow = (HWND)CreateWindowEx(WS_EX_ACCEPTFILES, "Project64 2.0", WindowTitle, WS_OVERLAPPED | WS_CLIPCHILDREN | stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR);
m_hMainWindow = (HWND)CreateWindowEx(WS_EX_ACCEPTFILES, VersionDisplay.c_str(), WindowTitle, WS_OVERLAPPED | WS_CLIPCHILDREN |
WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX,5,5,640,480, WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX,5,5,640,480,
NULL,NULL,GetModuleHandle(NULL),this ); NULL,NULL,GetModuleHandle(NULL),this );
m_Created = m_hMainWindow != NULL; m_Created = m_hMainWindow != NULL;
@ -1070,8 +1073,7 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
SendDlgItemMessage(hWnd,IDC_THANK_LIST,WM_SETFONT,(WPARAM)hTextFont,TRUE); SendDlgItemMessage(hWnd,IDC_THANK_LIST,WM_SETFONT,(WPARAM)hTextFont,TRUE);
//SetCapture(hWnd); //SetCapture(hWnd);
stdstr StrVersion(VersionInfo(VERSION_PRODUCT_VERSION)); stdstr_f VersionDisplay("Version: %s", VER_FILE_VERSION_STR);
stdstr_f VersionDisplay("Version: %s",StrVersion.c_str());
SetWindowText(GetDlgItem(hWnd,IDC_VERSION),VersionDisplay.c_str()); SetWindowText(GetDlgItem(hWnd,IDC_VERSION),VersionDisplay.c_str());
} }
break; break;

View File

@ -1,6 +1,7 @@
// Microsoft Visual C++ generated resource script. // Microsoft Visual C++ generated resource script.
// //
#include "resource.h" #include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
@ -934,30 +935,25 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,1,0,1 FILEVERSION VER_FILE_VERSION
PRODUCTVERSION 2,1,0,1 PRODUCTVERSION VER_PRODUCT_VERSION
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG FILEFLAGS VER_FILEFLAGS
FILEFLAGS 0x1L FILEOS VER_FILEOS
#else FILETYPE VER_FILETYPE
FILEFLAGS 0x0L FILESUBTYPE 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", " " VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0"
VALUE "FileDescription", "Project 64" VALUE "FileVersion", VER_FILE_VERSION_STR "\0"
VALUE "FileVersion", "2, 1, 0, 1" VALUE "InternalName", VER_INTERNAL_NAME_STR "\0"
VALUE "InternalName", "Project64" VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0"
VALUE "LegalCopyright", "Copyright © 2013" VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0"
VALUE "OriginalFilename", "Project64.exe" VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductName", " Project64" VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0"
VALUE "ProductVersion", "2, 1, 0, 1"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -0,0 +1,41 @@
/****************************************************************************
* *
* Project 64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#define STRINGIZE2(s) #s
#define STRINGIZE(s) STRINGIZE2(s)
#define VERSION_MAJOR 2
#define VERSION_MINOR 1
#define VERSION_REVISION 0
#define VERSION_BUILD 1
#define VER_FILE_DESCRIPTION_STR "Project 64"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD
#define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \
"." STRINGIZE(VERSION_MINOR) \
"." STRINGIZE(VERSION_REVISION) \
"." STRINGIZE(VERSION_BUILD) \
#define VER_PRODUCTNAME_STR "Project64"
#define VER_PRODUCT_VERSION VER_FILE_VERSION
#define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_STR
#define VER_ORIGINAL_FILENAME_STR VER_PRODUCTNAME_STR ".exe"
#define VER_INTERNAL_NAME_STR VER_PRODUCTNAME_STR
#define VER_COPYRIGHT_STR "Copyright (C) 2013"
#ifdef _DEBUG
#define VER_VER_DEBUG VS_FF_DEBUG
#else
#define VER_VER_DEBUG 0
#endif
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEFLAGS VER_VER_DEBUG
#define VER_FILETYPE VFT_APP

View File

@ -173,16 +173,7 @@ const char * AppName ( void )
static stdstr Name; static stdstr Name;
if (Name.empty()) if (Name.empty())
{ {
stdstr StrVersion(VersionInfo(VERSION_PRODUCT_VERSION)); Name = stdstr_f("Project64 %s", VER_FILE_VERSION_STR);
strvector parts = StrVersion.Tokenize(".");
if (parts.size() == 4)
{
Name = stdstr_f("Project64 %s.%s",parts[0].c_str(),parts[1].c_str());
}
else
{
Name = "Project64";
}
} }
return Name.c_str(); return Name.c_str();
} }
@ -226,7 +217,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window"); WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window");
stdstr WinTitle(AppName()); stdstr WinTitle(AppName());
WinTitle.Format("Project64 %s",VersionInfo(VERSION_PRODUCT_VERSION).c_str()); WinTitle.Format("Project64 %s", VER_FILE_VERSION_STR);
CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false); CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false);
CMainMenu MainMenu(&MainWindow); CMainMenu MainMenu(&MainWindow);

View File

@ -21,6 +21,7 @@
#include "N64 System.h" #include "N64 System.h"
#include "Plugin.h" #include "Plugin.h"
#include "Support.h" #include "Support.h"
#include "Version.h"
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#include <Aclapi.h> #include <Aclapi.h>

View File

@ -30,7 +30,6 @@
#include <stdio.h> #include <stdio.h>
#include <common/std string.h> #include <common/std string.h>
#include <common/Version.h>
#include "../Settings/Settings.h" #include "../Settings/Settings.h"
extern "C" { extern "C" {
@ -44,6 +43,7 @@ extern "C" {
#include "profiling.h" #include "profiling.h"
#include "log.h" #include "log.h"
#include "resource.h" #include "resource.h"
#include "Version.h"
void ClearAllx86Code(void); void ClearAllx86Code(void);
void ProcessMenuItem(int ID); void ProcessMenuItem(int ID);
@ -86,12 +86,12 @@ short Set_AudioHle = 0, Set_GraphicsHle = 0;
/************ DLL info **************/ /************ DLL info **************/
const char * AppName ( void ) const char * AppName ( void )
{ {
static stdstr_f Name("RSP %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); static stdstr_f Name("RSP %s", VER_FILE_VERSION_STR);
return Name.c_str(); return Name.c_str();
} }
const char * AboutMsg ( void ) const char * AboutMsg ( void )
{ {
static stdstr_f Msg("RSP emulation Plugin\nMade for Project64 (c)\nVersion %s\n\nby Jabo & Zilmar",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); static stdstr_f Msg("RSP emulation Plugin\nMade for Project64 (c)\nVersion %s\n\nby Jabo & Zilmar", VER_FILE_VERSION_STR);
return Msg.c_str(); return Msg.c_str();
} }
@ -169,10 +169,6 @@ __declspec(dllexport) void DllAbout ( HWND hParent ) {
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD /*fdwReason*/, LPVOID /*lpvReserved*/ ){ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD /*fdwReason*/, LPVOID /*lpvReserved*/ ){
hinstDLL = hinst; hinstDLL = hinst;
if (strcmp(VersionInfo(VERSION_INTERNAL_NAME).c_str(),"Project64") != 0)
{
return FALSE;
}
return TRUE; return TRUE;
} }
/****************************************************************** /******************************************************************
@ -187,9 +183,9 @@ __declspec(dllexport) void GetDllInfo ( PLUGIN_INFO * PluginInfo ) {
PluginInfo->Version = 0x0102; PluginInfo->Version = 0x0102;
PluginInfo->Type = PLUGIN_TYPE_RSP; PluginInfo->Type = PLUGIN_TYPE_RSP;
#ifdef _DEBUG #ifdef _DEBUG
sprintf(PluginInfo->Name,"RSP Debug Plugin %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); sprintf(PluginInfo->Name, "RSP Debug Plugin %s", VER_FILE_VERSION_STR);
#else #else
sprintf(PluginInfo->Name,"RSP Plugin %s",VersionInfo(VERSION_PRODUCT_VERSION,hinstDLL).c_str()); sprintf(PluginInfo->Name, "RSP Plugin %s", VER_FILE_VERSION_STR);
#endif #endif
PluginInfo->NormalMemory = FALSE; PluginInfo->NormalMemory = FALSE;
PluginInfo->MemoryBswaped = TRUE; PluginInfo->MemoryBswaped = TRUE;

View File

@ -1,6 +1,7 @@
// Microsoft Visual C++ generated resource script. // Microsoft Visual C++ generated resource script.
// //
#include "resource.h" #include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
@ -198,35 +199,30 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,7,0,9 FILEVERSION VER_FILE_VERSION
PRODUCTVERSION 1,7,0,9 PRODUCTVERSION VER_PRODUCT_VERSION
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG FILEFLAGS VER_FILEFLAGS
FILEFLAGS 0x1L FILEOS VER_FILEOS
#else FILETYPE VER_FILETYPE
FILEFLAGS 0x0L FILESUBTYPE 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "0c0904b0" BLOCK "0c0904b0"
BEGIN BEGIN
VALUE "CompanyName", "Project64" VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0"
VALUE "FileDescription", "RSP emulation Plugin" VALUE "FileVersion", VER_FILE_VERSION_STR "\0"
VALUE "FileVersion", "1, 7, 0, 9" VALUE "InternalName", VER_INTERNAL_NAME_STR "\0"
VALUE "InternalName", "RSP Plugin" VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0"
VALUE "LegalCopyright", "Copyright © 2008" VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0"
VALUE "OriginalFilename", "RSP.dll" VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductName", " RSP" VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0"
VALUE "ProductVersion", "1, 7, 0, 9"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
BEGIN BEGIN
VALUE "Translation", 0xc09, 1200 VALUE "Translation", 0x409, 1200
END END
END END

View File

@ -222,6 +222,10 @@
<Filter <Filter
Name="RSP Header Files" Name="RSP Header Files"
> >
<File
RelativePath="Version.h""
>
</File>
<File <File
RelativePath="breakpoint.h" RelativePath="breakpoint.h"
> >

View File

@ -98,6 +98,7 @@
<ClInclude Include="RSP Registers.h" /> <ClInclude Include="RSP Registers.h" />
<ClInclude Include="Rsp.h" /> <ClInclude Include="Rsp.h" />
<ClInclude Include="Types.h" /> <ClInclude Include="Types.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="X86.h" /> <ClInclude Include="X86.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -125,6 +125,9 @@
<ClInclude Include="X86.h"> <ClInclude Include="X86.h">
<Filter>Header Files\RSP Header Files</Filter> <Filter>Header Files\RSP Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Version.h">
<Filter>Header Files\RSP Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="RSP.rc"> <ResourceCompile Include="RSP.rc">

56
Source/RSP/Version.h Normal file
View File

@ -0,0 +1,56 @@
/*
* RSP Compiler plug in for Project 64 (A Nintendo 64 emulator).
*
* (c) Copyright 2001 jabo (jabo@emulation64.com) and
* zilmar (zilmar@emulation64.com)
*
* pj64 homepage: www.pj64.net
*
* Permission to use, copy, modify and distribute Project64 in both binary and
* source form, for non-commercial purposes, is hereby granted without fee,
* providing that this license information and copyright notice appear with
* all copies and any derived work.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event shall the authors be held liable for any damages
* arising from the use of this software.
*
* Project64 is freeware for PERSONAL USE only. Commercial users should
* seek permission of the copyright holders first. Commercial use includes
* charging money for Project64 or software derived from Project64.
*
* The copyright holders request that bug fixes and improvements to the code
* should be forwarded to them so if they want them.
*
*/
#define STRINGIZE2(s) #s
#define STRINGIZE(s) STRINGIZE2(s)
#define VERSION_MAJOR 1
#define VERSION_MINOR 7
#define VERSION_REVISION 0
#define VERSION_BUILD 9
#define VER_FILE_DESCRIPTION_STR "RSP emulation Plugin"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD
#define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \
"." STRINGIZE(VERSION_MINOR) \
"." STRINGIZE(VERSION_REVISION) \
"." STRINGIZE(VERSION_BUILD) \
#define VER_PRODUCTNAME_STR "RSP"
#define VER_PRODUCT_VERSION VER_FILE_VERSION
#define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_STR
#define VER_ORIGINAL_FILENAME_STR VER_PRODUCTNAME_STR ".dll"
#define VER_INTERNAL_NAME_STR VER_PRODUCTNAME_STR
#define VER_COPYRIGHT_STR "Copyright (C) 2008"
#ifdef _DEBUG
#define VER_VER_DEBUG VS_FF_DEBUG
#else
#define VER_VER_DEBUG 0
#endif
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEFLAGS VER_VER_DEBUG
#define VER_FILETYPE VFT_APP