Skip to content

Commit

Permalink
[64bit] Get nrage and rsp compiling as 64bit
Browse files Browse the repository at this point in the history
  • Loading branch information
project64 committed May 16, 2015
1 parent 8bf7405 commit 13e62d7
Show file tree
Hide file tree
Showing 23 changed files with 150 additions and 69 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,20 @@ Thumbs.db
/Plugin/RSP/pdb
/Plugin/RSP/RSP 1.7.dll
/Plugin/RSP/RSP_d 1.7.dll
/Plugin64/GFX/lib
/Plugin64/GFX/map
/Plugin64/GFX/pdb
/Plugin64/GFX/PJ64Glide64.dll
/Plugin64/GFX/PJ64Glide64_d.dll
/Plugin64/Input/lib
/Plugin64/Input/map
/Plugin64/Input/pdb
/Plugin64/Input/PJ64_NRage.dll
/Plugin64/Input/PJ64_NRage_d.dll
/Plugin64/RSP/lib
/Plugin64/RSP/map
/Plugin64/RSP/pdb
/Plugin64/RSP/RSP 1.7.dll
/Plugin64/RSP/RSP_d 1.7.dll
/Source/3rd Party/wx/lib/vc_lib/mswu/wx/msw/rcdefs.h
/Source/3rd Party/wx/lib/vc_lib/mswud/wx/msw/rcdefs.h
2 changes: 2 additions & 0 deletions Bin/Debug64/Config/Project64.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default]
ConfigFile=..\..\Config\Project64.cfg
2 changes: 2 additions & 0 deletions Bin/Release64/Config/Project64.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default]
ConfigFile=..\..\Config\Project64.cfg
1 change: 1 addition & 0 deletions Config/Project64.cfg.development
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Instant Save=..\..\Save\
Instant Save - Use Selected=1
Lang=..\..\Lang
Plugin=..\..\Plugin\
Plugin64=..\..\Plugin64\
Plugin - Use Selected=1
Save=..\..\Save\
Save - Use Selected=1
Expand Down
18 changes: 12 additions & 6 deletions Project64.vs2013.sln
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Global
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Debug|x64.Build.0 = Debug|x64
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|Win32.ActiveCfg = Release|Win32
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|Win32.Build.0 = Release|Win32
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|x64.ActiveCfg = Release|Win32
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|x64.ActiveCfg = Release|x64
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|x64.Build.0 = Release|x64
{7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Debug|Win32.ActiveCfg = Debug|Win32
{7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Debug|Win32.Build.0 = Debug|Win32
{7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -71,13 +72,15 @@ Global
{7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Release|x64.Build.0 = Release|x64
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|Win32.ActiveCfg = Debug|Win32
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|Win32.Build.0 = Debug|Win32
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|x64.ActiveCfg = Debug|Win32
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|x64.ActiveCfg = Debug|x64
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|x64.Build.0 = Debug|x64
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Release|Win32.ActiveCfg = Release|Win32
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Release|Win32.Build.0 = Release|Win32
{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Release|x64.ActiveCfg = Release|Win32
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|Win32.ActiveCfg = Debug|Win32
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|Win32.Build.0 = Debug|Win32
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|x64.ActiveCfg = Debug|Win32
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|x64.ActiveCfg = Debug|x64
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|x64.Build.0 = Debug|x64
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Release|Win32.ActiveCfg = Release|Win32
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Release|Win32.Build.0 = Release|Win32
{8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Release|x64.ActiveCfg = Release|Win32
Expand All @@ -87,7 +90,8 @@ Global
{3326E128-33AF-422C-BB7C-67CC6B915610}.Debug|x64.Build.0 = Debug|x64
{3326E128-33AF-422C-BB7C-67CC6B915610}.Release|Win32.ActiveCfg = Release|Win32
{3326E128-33AF-422C-BB7C-67CC6B915610}.Release|Win32.Build.0 = Release|Win32
{3326E128-33AF-422C-BB7C-67CC6B915610}.Release|x64.ActiveCfg = Release|Win32
{3326E128-33AF-422C-BB7C-67CC6B915610}.Release|x64.ActiveCfg = Release|x64
{3326E128-33AF-422C-BB7C-67CC6B915610}.Release|x64.Build.0 = Release|x64
{4BC6906B-213E-40D7-9FC7-1A93E228393D}.Debug|Win32.ActiveCfg = Debug|Win32
{4BC6906B-213E-40D7-9FC7-1A93E228393D}.Debug|Win32.Build.0 = Debug|Win32
{4BC6906B-213E-40D7-9FC7-1A93E228393D}.Debug|x64.ActiveCfg = Debug|Win32
Expand All @@ -100,7 +104,8 @@ Global
{731BD205-2826-4631-B7AF-117658E88DBC}.Debug|x64.Build.0 = Debug|x64
{731BD205-2826-4631-B7AF-117658E88DBC}.Release|Win32.ActiveCfg = Release|Win32
{731BD205-2826-4631-B7AF-117658E88DBC}.Release|Win32.Build.0 = Release|Win32
{731BD205-2826-4631-B7AF-117658E88DBC}.Release|x64.ActiveCfg = Release|Win32
{731BD205-2826-4631-B7AF-117658E88DBC}.Release|x64.ActiveCfg = Release|x64
{731BD205-2826-4631-B7AF-117658E88DBC}.Release|x64.Build.0 = Release|x64
{360A34F3-3172-4B09-8BC9-B3FBEE677863}.Debug|Win32.ActiveCfg = Debug|Win32
{360A34F3-3172-4B09-8BC9-B3FBEE677863}.Debug|x64.ActiveCfg = Debug|Win32
{360A34F3-3172-4B09-8BC9-B3FBEE677863}.Release|Win32.ActiveCfg = Release|Win32
Expand Down Expand Up @@ -156,7 +161,8 @@ Global
{2DADDAA5-0F57-46ED-A974-747908DDC7F3}.Release|x64.ActiveCfg = Release|Win32
{FD617E80-9E40-4138-85DA-B94633972E6A}.Debug|Win32.ActiveCfg = Debug|Win32
{FD617E80-9E40-4138-85DA-B94633972E6A}.Debug|Win32.Build.0 = Debug|Win32
{FD617E80-9E40-4138-85DA-B94633972E6A}.Debug|x64.ActiveCfg = Debug|Win32
{FD617E80-9E40-4138-85DA-B94633972E6A}.Debug|x64.ActiveCfg = Debug|x64
{FD617E80-9E40-4138-85DA-B94633972E6A}.Debug|x64.Build.0 = Debug|x64
{FD617E80-9E40-4138-85DA-B94633972E6A}.Release|Win32.ActiveCfg = Release|Win32
{FD617E80-9E40-4138-85DA-B94633972E6A}.Release|Win32.Build.0 = Release|Win32
{FD617E80-9E40-4138-85DA-B94633972E6A}.Release|x64.ActiveCfg = Release|Win32
Expand Down
Binary file added Source/3rd Party/directx/lib64/dinput8.lib
Binary file not shown.
Binary file added Source/3rd Party/directx/lib64/dxguid.lib
Binary file not shown.
6 changes: 1 addition & 5 deletions Source/Project64/Multilanguage/Language Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,7 @@ LRESULT CALLBACK LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
lResult = HTCAPTION;
}
#ifdef _M_IX86
SetWindowLong(hDlg, DWL_MSGRESULT, lResult);
#else
g_Notify->BreakPoint(__FILEW__,__LINE__);
#endif
SetWindowLong(hDlg, DWLP_MSGRESULT, lResult);
return TRUE;
}
break;
Expand Down
8 changes: 5 additions & 3 deletions Source/Project64/Plugins/Plugin List.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ void CPluginList::AddPluginFromDir ( CPath Dir)
hLib = NULL;
}

UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS );
//UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS );
WriteTraceF(TraceDebug,__FUNCTION__ ": loading %s",(LPCSTR)Dir);
hLib = LoadLibrary(Dir);
SetErrorMode(LastErrorMode);
hLib = LoadLibrary(Dir);
//SetErrorMode(LastErrorMode);

if (hLib == NULL)
{
DWORD LoadError = GetLastError();
WriteTraceF(TraceDebug, __FUNCTION__ ": failed to loadi %s (error: %d)", (LPCSTR)Dir, LoadError);
continue;
}

Expand Down
4 changes: 0 additions & 4 deletions Source/Project64/Project64.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,6 @@
<Project>{b4a4b994-9111-42b1-93c2-6f1ca8bc4421}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\Glide64\Glide64.vcxproj">
<Project>{a4d13408-a794-4199-8fc7-4a9a32505005}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
11 changes: 9 additions & 2 deletions Source/Project64/Settings/Settings Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,18 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory","Game - Use Selected",false));

AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin",Directory_PluginInitial,Directory_PluginSelected,Directory_PluginUseSelected));
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin",""));
#ifdef _M_IX86
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", ""));
AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory","Plugin",Directory_PluginInitial));
AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory","Plugin - Use Selected",false));
AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin",""));

#else
AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin64", ""));
AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin64", Directory_PluginInitial));
AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory", "Plugin - Use Selected", false));
AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin64", ""));
#endif

AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot",Directory_SnapShotInitial,Directory_SnapShotSelected,Directory_SnapShotUseSelected));
AddHandler(Directory_SnapShotInitial, new CSettingTypeRelativePath("Screenshots",""));
AddHandler(Directory_SnapShotSelected, new CSettingTypeApplicationPath("Directory","Snap Shot",Directory_SnapShotInitial));
Expand Down
8 changes: 1 addition & 7 deletions Source/Project64/User Interface/Gui Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,14 +1139,8 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
{
lResult = HTCAPTION;
}
#ifdef _M_IX86
SetWindowLong(hWnd, DWL_MSGRESULT, lResult);
#else
g_Notify->BreakPoint(__FILEW__,__LINE__);
#endif

SetWindowLong(hWnd, DWLP_MSGRESULT, lResult);
return TRUE;

}
break;
case WM_CTLCOLORSTATIC:
Expand Down
21 changes: 15 additions & 6 deletions Source/RSP/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ const char * AboutMsg ( void )
/************ Functions ***********/
DWORD AsciiToHex (char * HexValue)
{
DWORD Count, Finish, Value = 0;
DWORD Value = 0;

Finish = strlen(HexValue);
size_t Finish = strlen(HexValue);
if (Finish > 8 ) { Finish = 8; }

for (Count = 0; Count < Finish; Count++)
for (size_t Count = 0; Count < Finish; Count++)
{
Value = (Value << 4);
switch( HexValue[Count] )
Expand Down Expand Up @@ -273,6 +273,7 @@ void DetectCpuSpecs(void)
DWORD AMD_Features = 0;

__try {
#ifdef _M_IX86
_asm {
/* Intel features */
mov eax, 1
Expand All @@ -284,7 +285,15 @@ void DetectCpuSpecs(void)
cpuid
or [AMD_Features], edx
}
} __except ( EXCEPTION_EXECUTE_HANDLER) {
#else
int cpuInfo[4];
__cpuid(cpuInfo, 1);
Intel_Features = cpuInfo[3];
__cpuid(cpuInfo, 0x80000001);
AMD_Features = cpuInfo[3];
#endif
}
__except (EXCEPTION_EXECUTE_HANDLER) {
AMD_Features = Intel_Features = 0;
}

Expand Down Expand Up @@ -411,7 +420,7 @@ void ProcessMenuItem(int ID)
}
break;
case ID_COMPILER:
DialogBox(hinstDLL, "RSPCOMPILER", HWND_DESKTOP, CompilerDlgProc);
DialogBox(hinstDLL, "RSPCOMPILER", HWND_DESKTOP, (DLGPROC)CompilerDlgProc);
break;
case ID_BREAKONSTARTOFTASK:
{
Expand Down Expand Up @@ -768,5 +777,5 @@ __declspec(dllexport) void PluginLoaded (void)

void UseUnregisteredSetting (int /*SettingID*/)
{
_asm int 3
DebugBreak();
}
19 changes: 13 additions & 6 deletions Source/RSP/Profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typedef struct { SPECIAL_TIMERS Timer; char * Name; } TIMER_NAME;
DWORD OldTimerAddr = StopTimer();
m_CurrentTimerAddr = Address;

#ifdef _M_IX86
DWORD HiValue, LoValue;
_asm {
pushad
Expand All @@ -69,14 +70,17 @@ typedef struct { SPECIAL_TIMERS Timer; char * Name; } TIMER_NAME;
}
m_StartTimeHi = HiValue;
m_StartTimeLo = LoValue;
#else
DebugBreak();
#endif
return OldTimerAddr;
}
DWORD StopTimer ( void )
{
DWORD HiValue, LoValue;

{
if (m_CurrentTimerAddr == Timer_None) { return m_CurrentTimerAddr; }

#ifdef _M_IX86
DWORD HiValue, LoValue;
_asm {
pushad
rdtsc
Expand All @@ -85,19 +89,22 @@ typedef struct { SPECIAL_TIMERS Timer; char * Name; } TIMER_NAME;
popad
}

__int64 StopTime = ((unsigned __int64)HiValue << 32) + (unsigned __int64)LoValue;
__int64 StopTime = ((unsigned __int64)HiValue << 32) + (unsigned __int64)LoValue;
__int64 StartTime = ((unsigned __int64)m_StartTimeHi << 32) + (unsigned __int64)m_StartTimeLo;
__int64 TimeTaken = StopTime - StartTime;

PROFILE_ENRTY Entry = m_Entries.find(m_CurrentTimerAddr);
if (Entry != m_Entries.end())
{
Entry->second += TimeTaken;
}
else
{
m_Entries.insert(PROFILE_ENRTIES::value_type(m_CurrentTimerAddr,TimeTaken));
m_Entries.insert(PROFILE_ENRTIES::value_type(m_CurrentTimerAddr, TimeTaken));
}
#else
DebugBreak();
#endif

DWORD OldTimerAddr = m_CurrentTimerAddr;
m_CurrentTimerAddr = Timer_None;
Expand Down
2 changes: 1 addition & 1 deletion Source/RSP/RSP Command.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ void RSP_Commands_Setup ( HWND hDlg )
SendMessage(hList,LB_SETITEMHEIGHT, (WPARAM)0,(LPARAM)MAKELPARAM(14, 0));
}

sprintf(Location,"%03X",*PrgCount);
sprintf(Location, "%03X", PrgCount ? *PrgCount : 0);
hAddress = CreateWindowEx(0,"EDIT",Location, WS_CHILD | ES_UPPERCASE | WS_VISIBLE |
WS_BORDER | WS_TABSTOP,375,17,36,18, hDlg,(HMENU)IDC_ADDRESS,hinstDLL, NULL );
if (hAddress)
Expand Down
8 changes: 6 additions & 2 deletions Source/RSP/RSP Register.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ LRESULT CALLBACK RSP_Registers_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
HideRSP_RegisterPanel (CurrentPanel);
item.mask = TCIF_PARAM;
TabCtrl_GetItem( hTab, TabCtrl_GetCurSel( hTab ), &item );
CurrentPanel = item.lParam;
CurrentPanel = (int)item.lParam;
InvalidateRect( hStatic, NULL, FALSE );
UpdateRSPRegistersScreen();
ShowRSP_RegisterPanel ( CurrentPanel );
Expand Down Expand Up @@ -513,7 +513,11 @@ void SetupRSP_RegistersMain (HWND hDlg) {
SetupRSP_Vect2Panel ( hDlg );

hStatic = CreateWindowEx(0,"STATIC","", WS_CHILD|WS_VISIBLE, 5,6,616,290,hDlg,0,hinstDLL,NULL );
RefreshProc = (FARPROC)SetWindowLong( hStatic,GWL_WNDPROC,(long)RefreshRSP_RegProc);
#ifdef _M_IX86
RefreshProc = (FARPROC)SetWindowLong(hStatic, GWL_WNDPROC, (long)RefreshRSP_RegProc);
#else
DebugBreak();
#endif

UpdateRSPRegistersScreen ();
ShowRSP_RegisterPanel ( GeneralPurpose );
Expand Down
13 changes: 12 additions & 1 deletion Source/RSP/RSP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}</ProjectGuid>
Expand All @@ -25,15 +33,18 @@
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Project="$(SolutionDir)PropertySheets/Win32.Release.props" />
<Import Project="$(SolutionDir)PropertySheets/Win32.Release.props" Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<Import Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Project="$(SolutionDir)PropertySheets/Win32.Debug.props" />
<Import Project="$(SolutionDir)PropertySheets/Win32.Debug.props" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup>
<TargetName>RSP 1.7</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">RSP_d 1.7</TargetName>
<OutDir>$(SolutionDir)Plugin\RSP\</OutDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">RSP_d 1.7</TargetName>
<OutDir>$(SolutionDir)Plugin64\RSP\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
Expand Down
8 changes: 8 additions & 0 deletions Source/RSP/Recompiler CPU.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,11 +933,15 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) {
StartTimer(*PrgCount);
}

#ifdef _M_IX86
_asm {
pushad
call Block
popad
}
#else
DebugBreak();
#endif
if (Profiling && IndvidualBlock) {
StopTimer();
}
Expand All @@ -948,7 +952,11 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) {
}

if (IsMmxEnabled == TRUE) {
#ifdef _M_IX86
_asm emms
#else
DebugBreak();
#endif
}
return Cycles;
}
Loading

0 comments on commit 13e62d7

Please sign in to comment.