diff --git a/.gitignore b/.gitignore index 857c63a19..47264a707 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,8 @@ Thumbs.db /Plugin/RSP/lib /Plugin/RSP/map /Plugin/RSP/pdb +/Plugin/RSP/Project64-RSP_d.dll +/Plugin/RSP/Project64-RSP.dll /Plugin/RSP/RSP 1.7.dll /Plugin/RSP/RSP_d 1.7.dll /Plugin/RSP/RSP-HLE_d.dll diff --git a/Source/Installer/Installer.iss b/Source/Installer/Installer.iss index c8c64f339..9ebcf95f1 100644 --- a/Source/Installer/Installer.iss +++ b/Source/Installer/Installer.iss @@ -38,7 +38,7 @@ Source: "{#BaseDir}\Plugin\GFX\Project64-Video.dll"; DestDir: "{app}\Plugin\GFX" Source: "{#BaseDir}\Plugin\GFX\GLideN64\*"; DestDir: "{app}\Plugin\GFX\GLideN64"; Flags: recursesubdirs skipifsourcedoesntexist Source: "{#BaseDir}\Plugin\Input\PJ64_NRage.dll"; DestDir: "{app}\Plugin\Input" Source: "{#BaseDir}\Plugin\Input\Project64-Input.dll"; DestDir: "{app}\Plugin\Input" -Source: "{#BaseDir}\Plugin\RSP\RSP 1.7.dll"; DestDir: "{app}\Plugin\RSP" +Source: "{#BaseDir}\Plugin\RSP\Project64-RSP.dll"; DestDir: "{app}\Plugin\RSP" Source: "{#BaseDir}\Scripts\example.js"; DestDir: "{app}\Scripts" Source: "{#BaseDir}\Scripts\api_documentation.js"; DestDir: "{app}\Scripts" Source: "{#BaseDir}\JS-API-Documentation.html"; DestDir: "{app}" diff --git a/Source/Project64-core/Settings.cpp b/Source/Project64-core/Settings.cpp index 1ef761669..ff2d1cd05 100644 --- a/Source/Project64-core/Settings.cpp +++ b/Source/Project64-core/Settings.cpp @@ -376,13 +376,14 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory) // Plugin #ifdef _WIN32 - AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll")); #ifdef _DEBUG + AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\Project64-RSP_d.dll")); AddHandler(Plugin_GFX_Default, new CSettingTypeApplication("Plugin", "Graphics Dll Default", "GFX\\Project64-Video_d.dll")); AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin", "Graphics Dll", Plugin_GFX_Default)); AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Project64-Audio_d.dll")); AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin", "Controller Dll", "Input\\Project64-Input_d.dll")); #else + AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\Project64-RSP.dll")); AddHandler(Plugin_GFX_Default, new CSettingTypeApplication("Plugin", "Graphics Dll Default", "GFX\\Project64-Video.dll")); AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin", "Graphics Dll", Plugin_GFX_Default)); AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Project64-Audio.dll")); diff --git a/Source/RSP/Cpu.c b/Source/RSP/Cpu.cpp similarity index 100% rename from Source/RSP/Cpu.c rename to Source/RSP/Cpu.cpp diff --git a/Source/RSP/Interpreter CPU.c b/Source/RSP/Interpreter CPU.cpp similarity index 100% rename from Source/RSP/Interpreter CPU.c rename to Source/RSP/Interpreter CPU.cpp diff --git a/Source/RSP/Interpreter CPU.h b/Source/RSP/Interpreter CPU.h index 1d21d70a2..f9eabaf74 100644 --- a/Source/RSP/Interpreter CPU.h +++ b/Source/RSP/Interpreter CPU.h @@ -10,7 +10,8 @@ #define FINISH_BLOCK 9 #define FINISH_SUB_BLOCK 10 -extern DWORD RSP_NextInstruction, RSP_JumpTo, RSP_MfStatusCount; +extern DWORD RSP_NextInstruction, RSP_JumpTo; +extern uint32_t RSP_MfStatusCount; // Standard MIPS PC-relative branch // Returns the new PC, based on whether the condition passes diff --git a/Source/RSP/Interpreter Ops.c b/Source/RSP/Interpreter Ops.cpp similarity index 99% rename from Source/RSP/Interpreter Ops.c rename to Source/RSP/Interpreter Ops.cpp index ad813506d..726318eca 100644 --- a/Source/RSP/Interpreter Ops.c +++ b/Source/RSP/Interpreter Ops.cpp @@ -1688,7 +1688,7 @@ void rsp_UnknownOpcode (void) { } else { sprintf(Message,"Unhandled Opcode\n%s\n\nStopping emulation.\n\nWOuld you like to open the debugger?", RSPOpcodeName(RSPOpC.Hex,*PrgCount)); - response = MessageBox(NULL,Message,"Error", MB_YESNO | MB_ICONERROR); + response = MessageBoxA(NULL,Message,"Error", MB_YESNO | MB_ICONERROR); if (response == IDYES) { Enter_RSP_Commands_Window (); } diff --git a/Source/RSP/Main.cpp b/Source/RSP/Main.cpp index d1f7c578d..07d5bc8b3 100644 --- a/Source/RSP/Main.cpp +++ b/Source/RSP/Main.cpp @@ -14,7 +14,6 @@ #include #include "../Settings/Settings.h" -extern "C" { #include "Rsp.h" #include "Cpu.h" #include "Recompiler CPU.h" @@ -52,7 +51,6 @@ RSP_INFO RSPInfo; void * hinstDLL; extern uint8_t * pLastSecondary; -} enum { Set_BreakOnStart, Set_CPUCore, Set_LogRDP, Set_LogX86Code, Set_Profiling, Set_IndvidualBlock, @@ -134,7 +132,7 @@ void DisplayError(char* Message, ...) vsprintf( Msg, Message, ap ); va_end( ap ); #ifdef _WIN32 - MessageBox(NULL, Msg, "Error", MB_OK | MB_ICONERROR); + MessageBoxA(NULL, Msg, "Error", MB_OK | MB_ICONERROR); #else fputs(&Msg[0], stderr); #endif @@ -230,7 +228,7 @@ filled by the function. (see def above) Output: None */ -EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo) +EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * _DebugInfo) { #ifdef _WIN32 if (hRSPMenu == NULL) @@ -238,22 +236,22 @@ EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo) hRSPMenu = LoadMenu((HINSTANCE)hinstDLL,MAKEINTRESOURCE(RspMenu)); FixMenuState(); } - DebugInfo->hRSPMenu = hRSPMenu; + _DebugInfo->hRSPMenu = hRSPMenu; #endif - DebugInfo->ProcessMenuItem = ProcessMenuItem; + _DebugInfo->ProcessMenuItem = ProcessMenuItem; - DebugInfo->UseBPoints = TRUE; - sprintf(DebugInfo->BPPanelName," RSP "); - DebugInfo->Add_BPoint = Add_BPoint; - DebugInfo->CreateBPPanel = CreateBPPanel; - DebugInfo->HideBPPanel = HideBPPanel; - DebugInfo->PaintBPPanel = PaintBPPanel; - DebugInfo->RefreshBpoints = RefreshBpoints; - DebugInfo->RemoveAllBpoint = RemoveAllBpoint; - DebugInfo->RemoveBpoint = RemoveBpoint; - DebugInfo->ShowBPPanel = ShowBPPanel; + _DebugInfo->UseBPoints = TRUE; + sprintf(_DebugInfo->BPPanelName," RSP "); + _DebugInfo->Add_BPoint = Add_BPoint; + _DebugInfo->CreateBPPanel = CreateBPPanel; + _DebugInfo->HideBPPanel = HideBPPanel; + _DebugInfo->PaintBPPanel = PaintBPPanel; + _DebugInfo->RefreshBpoints = RefreshBpoints; + _DebugInfo->RemoveAllBpoint = RemoveAllBpoint; + _DebugInfo->RemoveBpoint = RemoveBpoint; + _DebugInfo->ShowBPPanel = ShowBPPanel; - DebugInfo->Enter_RSP_Commands_Window = Enter_RSP_Commands_Window; + _DebugInfo->Enter_RSP_Commands_Window = Enter_RSP_Commands_Window; } /* diff --git a/Source/RSP/Mmx.c b/Source/RSP/Mmx.cpp similarity index 100% rename from Source/RSP/Mmx.c rename to Source/RSP/Mmx.cpp diff --git a/Source/RSP/Profiling.cpp b/Source/RSP/Profiling.cpp index 12fe9c504..edaaed0a5 100644 --- a/Source/RSP/Profiling.cpp +++ b/Source/RSP/Profiling.cpp @@ -1,9 +1,7 @@ #include #include #include -extern "C" { #include "profiling.h" -} #pragma warning(disable:4786) #include #include @@ -158,7 +156,7 @@ public: } } - ShellExecute(NULL,"open",LogFileName.c_str(),NULL,NULL,SW_SHOW); + ShellExecuteA(NULL,"open",LogFileName.c_str(),NULL,NULL,SW_SHOW); ResetCounters(); } }; diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.cpp similarity index 91% rename from Source/RSP/RSP Command.c rename to Source/RSP/RSP Command.cpp index 705e031a6..a91144f49 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.cpp @@ -56,7 +56,7 @@ void Create_RSP_Commands_Window ( int Child ) if ( Child ) { InRSPCommandsWindow = TRUE; - DialogBox( hinstDLL, "RSPCOMMAND", NULL,(DLGPROC)RSP_Commands_Proc ); + DialogBoxA( (HINSTANCE)hinstDLL, "RSPCOMMAND", NULL,(DLGPROC)RSP_Commands_Proc ); InRSPCommandsWindow = FALSE; memset(RSPCommandLine,0,sizeof(RSPCommandLine)); @@ -147,7 +147,7 @@ void DumpRSPCode (void) DWORD location, dwWritten; HANDLE hLogFile = NULL; - strcpy(LogFileName,GetCommandLine() + 1); + strcpy(LogFileName,GetCommandLineA() + 1); if (strchr(LogFileName,'\"')) { @@ -169,7 +169,7 @@ void DumpRSPCode (void) strcat(LogFileName,"\\RSP code.txt"); - hLogFile = CreateFile(LogFileName,GENERIC_WRITE, FILE_SHARE_READ,NULL,CREATE_ALWAYS, + hLogFile = CreateFileA(LogFileName,GENERIC_WRITE, FILE_SHARE_READ,NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); SetFilePointer(hLogFile,0,NULL,FILE_BEGIN); @@ -202,7 +202,7 @@ void DumpRSPData (void) DWORD location, dwWritten; HANDLE hLogFile = NULL; - strcpy(LogFileName,GetCommandLine() + 1); + strcpy(LogFileName,GetCommandLineA() + 1); if (strchr(LogFileName,'\"')) { @@ -223,7 +223,7 @@ void DumpRSPData (void) strcat(LogFileName,"\\RSP data.txt"); - hLogFile = CreateFile(LogFileName,GENERIC_WRITE, FILE_SHARE_READ,NULL,CREATE_ALWAYS, + hLogFile = CreateFileA(LogFileName,GENERIC_WRITE, FILE_SHARE_READ,NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); SetFilePointer(hLogFile,0,NULL,FILE_BEGIN); @@ -326,7 +326,7 @@ void DrawRSPCommand ( LPARAM lParam ) { SetRect(&TextRect,ditem->rcItem.left,ditem->rcItem.top, ditem->rcItem.left + 83, ditem->rcItem.bottom); - DrawText( + DrawTextA( ditem->hDC, &Offset[0], printed_offset, &TextRect, @@ -335,7 +335,7 @@ void DrawRSPCommand ( LPARAM lParam ) SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165, ditem->rcItem.bottom); - DrawText( + DrawTextA( ditem->hDC, &Instruction[0], printed_instruction, &TextRect, @@ -344,7 +344,7 @@ void DrawRSPCommand ( LPARAM lParam ) SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right, ditem->rcItem.bottom); - DrawText( + DrawTextA( ditem->hDC, &Arguments[0], printed_arguments, &TextRect, @@ -353,7 +353,7 @@ void DrawRSPCommand ( LPARAM lParam ) } else { - DrawText( + DrawTextA( ditem->hDC, &Command[0], (signed int)strlen(Command), &ditem->rcItem, @@ -444,11 +444,11 @@ void Paint_RSP_Commands (HWND hDlg) hOldFont = (HFONT)SelectObject( ps.hdc,GetStockObject(DEFAULT_GUI_FONT ) ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - TextOut( ps.hdc, 23,16,"Offset",6); - TextOut( ps.hdc, 97,16,"Instruction",11); - TextOut( ps.hdc, 180,16,"Arguments",9); - TextOut( ps.hdc, 354,2," Address ",9); - TextOut( ps.hdc, 358,19,"0x1",3); + TextOutA( ps.hdc, 23,16,"Offset",6); + TextOutA( ps.hdc, 97,16,"Instruction",11); + TextOutA( ps.hdc, 180,16,"Arguments",9); + TextOutA( ps.hdc, 354,2," Address ",9); + TextOutA( ps.hdc, 358,19,"0x1",3); SelectObject( ps.hdc,hOldFont ); SetBkMode( ps.hdc, OldBkMode ); @@ -464,7 +464,7 @@ void RefreshRSPCommands ( void ) if (InRSPCommandsWindow == FALSE) { return; } - GetWindowText(hAddress,AsciiAddress,sizeof(AsciiAddress)); + GetWindowTextA(hAddress,AsciiAddress,sizeof(AsciiAddress)); location = AsciiToHex(AsciiAddress) & ~3; if (location > 0xF88) { location = 0xF88; } @@ -579,14 +579,14 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM char Value[20]; SCROLLINFO si; - GetWindowText(hAddress,Value,sizeof(Value)); + GetWindowTextA(hAddress,Value,sizeof(Value)); location = AsciiToHex(Value) & ~3; switch (LOWORD(wParam)) { case SB_THUMBTRACK: sprintf(Value,"%03X",((short int)HIWORD(wParam) << 2 )); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = (short int)HIWORD(wParam); @@ -596,7 +596,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if (location < 0xF88) { sprintf(Value,"%03X",location + 0x4); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = ((location + 0x4) >> 2); @@ -605,7 +605,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM else { sprintf(Value,"%03X",0xF88); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = (0xFFC >> 2); @@ -616,7 +616,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if (location > 0x4 ) { sprintf(Value,"%03X",location - 0x4); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = ((location - 0x4) >> 2); @@ -625,7 +625,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM else { sprintf(Value,"%03X",0); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = 0; @@ -636,7 +636,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if ((location + 0x74)< 0xF88) { sprintf(Value,"%03X",location + 0x74); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = ((location + 0x74) >> 2); @@ -645,7 +645,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM else { sprintf(Value,"%03X",0xF88); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = (0xF8F >> 2); @@ -656,7 +656,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if ((location - 0x74) > 0x74 ) { sprintf(Value,"%03X",location - 0x74); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = ((location - 0x74) >> 2); @@ -665,7 +665,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM else { sprintf(Value,"%03X",0); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); si.cbSize = sizeof(si); si.fMask = SIF_POS; si.nPos = 0; @@ -688,9 +688,9 @@ void RSP_Commands_Setup ( HWND hDlg ) char Location[10]; DWORD X, Y, WndPos; - hList = CreateWindowEx(WS_EX_STATICEDGE, "LISTBOX","", WS_CHILD | WS_VISIBLE | + hList = CreateWindowExA(WS_EX_STATICEDGE, "LISTBOX","", WS_CHILD | WS_VISIBLE | LBS_OWNERDRAWFIXED | LBS_NOTIFY,14,30,303,445, hDlg, - (HMENU)IDC_LIST, hinstDLL,NULL ); + (HMENU)IDC_LIST, (HINSTANCE)hinstDLL,NULL ); if ( hList) { SendMessage(hList,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); @@ -698,49 +698,49 @@ void RSP_Commands_Setup ( HWND hDlg ) } 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 ); + hAddress = CreateWindowExA(0,"EDIT",Location, WS_CHILD | ES_UPPERCASE | WS_VISIBLE | + WS_BORDER | WS_TABSTOP,375,17,36,18, hDlg,(HMENU)IDC_ADDRESS, (HINSTANCE)hinstDLL, NULL ); if (hAddress) { SendMessage(hAddress,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hAddress,EM_SETLIMITTEXT, (WPARAM)3,(LPARAM)0); } - hFunctionlist = CreateWindowEx(0,"COMBOBOX","", WS_CHILD | WS_VSCROLL | + hFunctionlist = CreateWindowExA(0,"COMBOBOX","", WS_CHILD | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | WS_TABSTOP,352,56,89,150,hDlg, - (HMENU)IDC_FUNCTION_COMBO,hinstDLL,NULL); + (HMENU)IDC_FUNCTION_COMBO, (HINSTANCE)hinstDLL,NULL); if (hFunctionlist) { SendMessage(hFunctionlist,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } - hGoButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Go", WS_CHILD | + hGoButton = CreateWindowExA(WS_EX_STATICEDGE, "BUTTON","&Go", WS_CHILD | BS_DEFPUSHBUTTON | WS_VISIBLE | WS_TABSTOP, 347,56,100,24, hDlg,(HMENU)IDC_GO_BUTTON, - hinstDLL,NULL ); + (HINSTANCE)hinstDLL,NULL ); if (hGoButton) { SendMessage(hGoButton,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } - hBreakButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Break", WS_DISABLED | + hBreakButton = CreateWindowExA(WS_EX_STATICEDGE, "BUTTON","&Break", WS_DISABLED | WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,85,100,24,hDlg, - (HMENU)IDC_BREAK_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_BREAK_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hBreakButton) { SendMessage(hBreakButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } - hStepButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Step", WS_CHILD | + hStepButton = CreateWindowExA(WS_EX_STATICEDGE, "BUTTON","&Step", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,114,100,24,hDlg, - (HMENU)IDC_STEP_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_STEP_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hStepButton) { SendMessage(hStepButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } - hSkipButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Skip", WS_CHILD | + hSkipButton = CreateWindowExA(WS_EX_STATICEDGE, "BUTTON","&Skip", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,143,100,24,hDlg, - (HMENU)IDC_SKIP_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_SKIP_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hSkipButton) { SendMessage(hSkipButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); @@ -754,9 +754,9 @@ void RSP_Commands_Setup ( HWND hDlg ) if (DebugInfo.Enter_BPoint_Window != NULL) { - hBPButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Break Points", WS_CHILD | + hBPButton = CreateWindowExA(WS_EX_STATICEDGE, "BUTTON","&Break Points", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,WndPos,100,24,hDlg, - (HMENU)IDC_BP_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_BP_BUTTON,(HINSTANCE)hinstDLL,NULL ); if (hBPButton) { SendMessage(hBPButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); @@ -764,9 +764,9 @@ void RSP_Commands_Setup ( HWND hDlg ) } WndPos += 29; - hRSPRegisters = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON", "RSP &Registers...", + hRSPRegisters = CreateWindowExA(WS_EX_STATICEDGE,"BUTTON", "RSP &Registers...", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,WndPos,100,24,hDlg, - (HMENU)IDC_RSP_REGISTERS_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_RSP_REGISTERS_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hRSPRegisters) { SendMessage(hRSPRegisters,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); @@ -775,9 +775,9 @@ void RSP_Commands_Setup ( HWND hDlg ) WndPos += 29; if (DebugInfo.Enter_R4300i_Commands_Window != NULL) { - hR4300iDebugger = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON", "R4300i &Debugger...", + hR4300iDebugger = CreateWindowExA(WS_EX_STATICEDGE,"BUTTON", "R4300i &Debugger...", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,WndPos,100,24,hDlg, - (HMENU)IDC_R4300I_DEBUGGER_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_R4300I_DEBUGGER_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hR4300iDebugger) { SendMessage(hR4300iDebugger,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); @@ -787,9 +787,9 @@ void RSP_Commands_Setup ( HWND hDlg ) WndPos += 29; if (DebugInfo.Enter_R4300i_Register_Window != NULL) { - hR4300iRegisters = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON","R4300i R&egisters...", + hR4300iRegisters = CreateWindowExA(WS_EX_STATICEDGE,"BUTTON","R4300i R&egisters...", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,WndPos,100,24,hDlg, - (HMENU)IDC_R4300I_REGISTERS_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_R4300I_REGISTERS_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hR4300iRegisters) { SendMessage(hR4300iRegisters,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); @@ -799,17 +799,17 @@ void RSP_Commands_Setup ( HWND hDlg ) WndPos += 29; if (DebugInfo.Enter_Memory_Window != NULL) { - hMemory = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON", "&Memory...", WS_CHILD | + hMemory = CreateWindowExA(WS_EX_STATICEDGE,"BUTTON", "&Memory...", WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,WndPos,100,24,hDlg, - (HMENU)IDC_MEMORY_BUTTON,hinstDLL,NULL ); + (HMENU)IDC_MEMORY_BUTTON, (HINSTANCE)hinstDLL,NULL ); if (hMemory) { SendMessage(hMemory,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } } - hScrlBar = CreateWindowEx(WS_EX_STATICEDGE, "SCROLLBAR","", WS_CHILD | WS_VISIBLE | - WS_TABSTOP | SBS_VERT, 318,14,18,439, hDlg, (HMENU)IDC_SCRL_BAR, hinstDLL, NULL ); + hScrlBar = CreateWindowExA(WS_EX_STATICEDGE, "SCROLLBAR","", WS_CHILD | WS_VISIBLE | + WS_TABSTOP | SBS_VERT, 318,14,18,439, hDlg, (HMENU)IDC_SCRL_BAR, (HINSTANCE)hinstDLL, NULL ); if ( RSP_Running ) { @@ -824,7 +824,7 @@ void RSP_Commands_Setup ( HWND hDlg ) X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2; Y = (GetSystemMetrics( SM_CYSCREEN ) - WindowHeight) / 2; //} - SetWindowText(hDlg,"RSP Commands"); + SetWindowTextA(hDlg,"RSP Commands"); SetWindowPos(hDlg,NULL,X,Y,WindowWidth,WindowHeight, SWP_NOZORDER | SWP_SHOWWINDOW); } @@ -1323,13 +1323,13 @@ void SetRSPCommandViewto ( UINT NewLocation ) if (InRSPCommandsWindow == FALSE) { return; } - GetWindowText(hAddress,Value,sizeof(Value)); + GetWindowTextA(hAddress,Value,sizeof(Value)); location = AsciiToHex(Value) & ~3; if ( NewLocation < location || NewLocation >= location + 120 ) { sprintf(Value,"%03X",NewLocation); - SetWindowText(hAddress,Value); + SetWindowTextA(hAddress,Value); } else { diff --git a/Source/RSP/RSP Register.c b/Source/RSP/RSP Register.cpp similarity index 66% rename from Source/RSP/RSP Register.c rename to Source/RSP/RSP Register.cpp index 9fb4e3824..1f7e7ab0f 100644 --- a/Source/RSP/RSP Register.c +++ b/Source/RSP/RSP Register.cpp @@ -39,7 +39,7 @@ WNDPROC RefreshProc; // RSP registers UWORD32 RSP_GPR[32], RSP_Flags[4]; UDWORD RSP_ACCUM[8]; -VECTOR RSP_Vect[32]; +VECTOR RSP_Vect[32] alignas(16); char * GPR_Strings[32] = { "R0", "AT", "V0", "V1", "A0", "A1", "A2", "A3", @@ -52,7 +52,7 @@ void Create_RSP_Register_Window ( int Child ) { DWORD ThreadID; if ( Child ) { InRSPRegisterWindow = TRUE; - DialogBox( hinstDLL, "RSPREGISTERS", NULL,(DLGPROC) RSP_Registers_Proc ); + DialogBoxA( (HINSTANCE)hinstDLL, "RSPREGISTERS", NULL,(DLGPROC) RSP_Registers_Proc ); InRSPRegisterWindow = FALSE; } else { if (!InRSPRegisterWindow) { @@ -121,25 +121,25 @@ void PaintRSP_HiddenPanel (HWND hWnd) { rcBox.right = 425; rcBox.bottom = 50; FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW); - hOldFont = SelectObject( ps.hdc, - GetStockObject(DEFAULT_GUI_FONT) ); + hOldFont = (HFONT)SelectObject( ps.hdc, + GetStockObject((int)DEFAULT_GUI_FONT) ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - TextOut( ps.hdc, 80,34,"Accumulators",12); - TextOut( ps.hdc, 80,56,"Accumulator 0:",14); - TextOut( ps.hdc, 80,81,"Accumulator 1:",14); - TextOut( ps.hdc, 80,106,"Accumulator 2:",14); - TextOut( ps.hdc, 80,131,"Accumulator 3:",14); - TextOut( ps.hdc, 80,156,"Accumulator 4:",14); - TextOut( ps.hdc, 80,181,"Accumulator 5:",14); - TextOut( ps.hdc, 80,206,"Accumulator 6:",14); - TextOut( ps.hdc, 80,231,"Accumulator 7:",14); + TextOutA( ps.hdc, 80,34,"Accumulators",12); + TextOutA( ps.hdc, 80,56,"Accumulator 0:",14); + TextOutA( ps.hdc, 80,81,"Accumulator 1:",14); + TextOutA( ps.hdc, 80,106,"Accumulator 2:",14); + TextOutA( ps.hdc, 80,131,"Accumulator 3:",14); + TextOutA( ps.hdc, 80,156,"Accumulator 4:",14); + TextOutA( ps.hdc, 80,181,"Accumulator 5:",14); + TextOutA( ps.hdc, 80,206,"Accumulator 6:",14); + TextOutA( ps.hdc, 80,231,"Accumulator 7:",14); - TextOut( ps.hdc, 371,34,"RSP Flags",9); - TextOut( ps.hdc, 375,86,"Flag 0:",7); - TextOut( ps.hdc, 375,116,"Flag 2:",7); - TextOut( ps.hdc, 375,146,"Flag 3:",7); - TextOut( ps.hdc, 375,176,"Flag 4:",7); + TextOutA( ps.hdc, 371,34,"RSP Flags",9); + TextOutA( ps.hdc, 375,86,"Flag 0:",7); + TextOutA( ps.hdc, 375,116,"Flag 2:",7); + TextOutA( ps.hdc, 375,146,"Flag 3:",7); + TextOutA( ps.hdc, 375,176,"Flag 4:",7); SelectObject( ps.hdc,hOldFont ); SetBkMode( ps.hdc, OldBkMode ); @@ -159,26 +159,26 @@ void PaintRSP_CP0Panel (HWND hWnd) { rcBox.bottom = 275; DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - hOldFont = SelectObject( ps.hdc, + hOldFont = (HFONT)SelectObject( ps.hdc, GetStockObject(DEFAULT_GUI_FONT) ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - TextOut( ps.hdc, 53,48,"Reg 0 - SP memory address:",26); - TextOut( ps.hdc, 53,76,"Reg 1 - SP DRAM DMA address:",28); - TextOut( ps.hdc, 53,104,"Reg 2 - SP read DMA length:",27); - TextOut( ps.hdc, 53,132,"Reg 3 - SP write DMA length:",28); - TextOut( ps.hdc, 53,160,"Reg 4 - SP status:",18); - TextOut( ps.hdc, 53,188,"Reg 5 - SP DMA full:",20); - TextOut( ps.hdc, 53,216,"Reg 6 - SP DMA busy:",20); - TextOut( ps.hdc, 53,244,"Reg 7 - SP semaphore:",21); - TextOut( ps.hdc, 313,48,"Reg 8 - DP CMD DMA start:",25); - TextOut( ps.hdc, 313,76,"Reg 9 - DP CMD DMA end:",23); - TextOut( ps.hdc, 313,104,"Reg 10 - DP CMD DMA current:",28); - TextOut( ps.hdc, 313,132,"Reg 11 - DP CMD status:",23); - TextOut( ps.hdc, 313,160,"Reg 12 - DP clock counter:",26); - TextOut( ps.hdc, 313,188,"Reg 13 - DP buffer busy counter:",32); - TextOut( ps.hdc, 313,216,"Reg 14 - DP pipe busy counter:",30); - TextOut( ps.hdc, 313,244,"Reg 15 - DP TMEM load counter:",30); + TextOutA( ps.hdc, 53,48,"Reg 0 - SP memory address:",26); + TextOutA( ps.hdc, 53,76,"Reg 1 - SP DRAM DMA address:",28); + TextOutA( ps.hdc, 53,104,"Reg 2 - SP read DMA length:",27); + TextOutA( ps.hdc, 53,132,"Reg 3 - SP write DMA length:",28); + TextOutA( ps.hdc, 53,160,"Reg 4 - SP status:",18); + TextOutA( ps.hdc, 53,188,"Reg 5 - SP DMA full:",20); + TextOutA( ps.hdc, 53,216,"Reg 6 - SP DMA busy:",20); + TextOutA( ps.hdc, 53,244,"Reg 7 - SP semaphore:",21); + TextOutA( ps.hdc, 313,48,"Reg 8 - DP CMD DMA start:",25); + TextOutA( ps.hdc, 313,76,"Reg 9 - DP CMD DMA end:",23); + TextOutA( ps.hdc, 313,104,"Reg 10 - DP CMD DMA current:",28); + TextOutA( ps.hdc, 313,132,"Reg 11 - DP CMD status:",23); + TextOutA( ps.hdc, 313,160,"Reg 12 - DP clock counter:",26); + TextOutA( ps.hdc, 313,188,"Reg 13 - DP buffer busy counter:",32); + TextOutA( ps.hdc, 313,216,"Reg 14 - DP pipe busy counter:",30); + TextOutA( ps.hdc, 313,244,"Reg 15 - DP TMEM load counter:",30); SelectObject( ps.hdc,hOldFont ); SetBkMode( ps.hdc, OldBkMode ); @@ -198,42 +198,42 @@ void PaintRSP_GPRPanel (HWND hWnd) { rcBox.bottom = 275; DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - hOldFont = SelectObject( ps.hdc, + hOldFont = (HFONT)SelectObject( ps.hdc, GetStockObject(DEFAULT_GUI_FONT) ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - TextOut( ps.hdc, 53,46,"R0 - Reg 0:",11); - TextOut( ps.hdc, 53,66,"AT - Reg 1:",11); - TextOut( ps.hdc, 53,86,"V0 - Reg 2:",11); - TextOut( ps.hdc, 53,106,"V1 - Reg 3:",11); - TextOut( ps.hdc, 53,126,"A0 - Reg 4:",11); - TextOut( ps.hdc, 53,146,"A1 - Reg 5:",11); - TextOut( ps.hdc, 53,166,"A2 - Reg 6:",11); - TextOut( ps.hdc, 53,186,"A3 - Reg 7:",11); - TextOut( ps.hdc, 53,206,"T0 - Reg 8:",11); - TextOut( ps.hdc, 53,226,"T1 - Reg 9:",11); - TextOut( ps.hdc, 53,246,"T2 - Reg 10:",12); - TextOut( ps.hdc, 228,46,"T3 - Reg 11:",12); - TextOut( ps.hdc, 228,66,"T4 - Reg 12:",12); - TextOut( ps.hdc, 228,86,"T5 - Reg 13:",12); - TextOut( ps.hdc, 228,106,"T6 - Reg 14:",12); - TextOut( ps.hdc, 228,126,"T7 - Reg 15:",12); - TextOut( ps.hdc, 228,146,"S0 - Reg 16:",12); - TextOut( ps.hdc, 228,166,"S1 - Reg 17:",12); - TextOut( ps.hdc, 228,186,"S2 - Reg 18:",12); - TextOut( ps.hdc, 228,206,"S3 - Reg 19:",12); - TextOut( ps.hdc, 228,226,"S4 - Reg 20:",12); - TextOut( ps.hdc, 228,246,"S5 - Reg 21:",12); - TextOut( ps.hdc, 408,46,"S6 - Reg 22:",12); - TextOut( ps.hdc, 408,66,"S7 - Reg 23:",12); - TextOut( ps.hdc, 408,86,"T8 - Reg 24:",12); - TextOut( ps.hdc, 408,106,"T9 - Reg 25:",12); - TextOut( ps.hdc, 408,126,"K0 - Reg 26:",12); - TextOut( ps.hdc, 408,146,"K1 - Reg 27:",12); - TextOut( ps.hdc, 408,166,"GP - Reg 28:",12); - TextOut( ps.hdc, 408,186,"SP - Reg 29:",12); - TextOut( ps.hdc, 408,206,"S8 - Reg 30:",12); - TextOut( ps.hdc, 408,226,"RA - Reg 31:",12); + TextOutA( ps.hdc, 53,46,"R0 - Reg 0:",11); + TextOutA( ps.hdc, 53,66,"AT - Reg 1:",11); + TextOutA( ps.hdc, 53,86,"V0 - Reg 2:",11); + TextOutA( ps.hdc, 53,106,"V1 - Reg 3:",11); + TextOutA( ps.hdc, 53,126,"A0 - Reg 4:",11); + TextOutA( ps.hdc, 53,146,"A1 - Reg 5:",11); + TextOutA( ps.hdc, 53,166,"A2 - Reg 6:",11); + TextOutA( ps.hdc, 53,186,"A3 - Reg 7:",11); + TextOutA( ps.hdc, 53,206,"T0 - Reg 8:",11); + TextOutA( ps.hdc, 53,226,"T1 - Reg 9:",11); + TextOutA( ps.hdc, 53,246,"T2 - Reg 10:",12); + TextOutA( ps.hdc, 228,46,"T3 - Reg 11:",12); + TextOutA( ps.hdc, 228,66,"T4 - Reg 12:",12); + TextOutA( ps.hdc, 228,86,"T5 - Reg 13:",12); + TextOutA( ps.hdc, 228,106,"T6 - Reg 14:",12); + TextOutA( ps.hdc, 228,126,"T7 - Reg 15:",12); + TextOutA( ps.hdc, 228,146,"S0 - Reg 16:",12); + TextOutA( ps.hdc, 228,166,"S1 - Reg 17:",12); + TextOutA( ps.hdc, 228,186,"S2 - Reg 18:",12); + TextOutA( ps.hdc, 228,206,"S3 - Reg 19:",12); + TextOutA( ps.hdc, 228,226,"S4 - Reg 20:",12); + TextOutA( ps.hdc, 228,246,"S5 - Reg 21:",12); + TextOutA( ps.hdc, 408,46,"S6 - Reg 22:",12); + TextOutA( ps.hdc, 408,66,"S7 - Reg 23:",12); + TextOutA( ps.hdc, 408,86,"T8 - Reg 24:",12); + TextOutA( ps.hdc, 408,106,"T9 - Reg 25:",12); + TextOutA( ps.hdc, 408,126,"K0 - Reg 26:",12); + TextOutA( ps.hdc, 408,146,"K1 - Reg 27:",12); + TextOutA( ps.hdc, 408,166,"GP - Reg 28:",12); + TextOutA( ps.hdc, 408,186,"SP - Reg 29:",12); + TextOutA( ps.hdc, 408,206,"S8 - Reg 30:",12); + TextOutA( ps.hdc, 408,226,"RA - Reg 31:",12); SelectObject( ps.hdc,hOldFont ); SetBkMode( ps.hdc, OldBkMode ); @@ -253,26 +253,26 @@ void PaintRSP_Vector1_Panel (HWND hWnd) { rcBox.bottom = 275; DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - hOldFont = SelectObject( ps.hdc, + hOldFont = (HFONT)SelectObject( ps.hdc, GetStockObject(DEFAULT_GUI_FONT) ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - TextOut( ps.hdc, 20,48,"$v0:",4); - TextOut( ps.hdc, 20,76,"$v1:",4); - TextOut( ps.hdc, 20,104,"$v2:",4); - TextOut( ps.hdc, 20,132,"$v3:",4); - TextOut( ps.hdc, 20,160,"$v4:",4); - TextOut( ps.hdc, 20,188,"$v5:",4); - TextOut( ps.hdc, 20,216,"$v6:",4); - TextOut( ps.hdc, 20,244,"$v7:",4); - TextOut( ps.hdc, 310,48,"$v8:",4); - TextOut( ps.hdc, 310,76,"$v9:",4); - TextOut( ps.hdc, 310,104,"$v10:",5); - TextOut( ps.hdc, 310,132,"$v11:",5); - TextOut( ps.hdc, 310,160,"$v12:",5); - TextOut( ps.hdc, 310,188,"$v13:",5); - TextOut( ps.hdc, 310,216,"$v14:",5); - TextOut( ps.hdc, 310,244,"$v15:",5); + TextOutA( ps.hdc, 20,48,"$v0:",4); + TextOutA( ps.hdc, 20,76,"$v1:",4); + TextOutA( ps.hdc, 20,104,"$v2:",4); + TextOutA( ps.hdc, 20,132,"$v3:",4); + TextOutA( ps.hdc, 20,160,"$v4:",4); + TextOutA( ps.hdc, 20,188,"$v5:",4); + TextOutA( ps.hdc, 20,216,"$v6:",4); + TextOutA( ps.hdc, 20,244,"$v7:",4); + TextOutA( ps.hdc, 310,48,"$v8:",4); + TextOutA( ps.hdc, 310,76,"$v9:",4); + TextOutA( ps.hdc, 310,104,"$v10:",5); + TextOutA( ps.hdc, 310,132,"$v11:",5); + TextOutA( ps.hdc, 310,160,"$v12:",5); + TextOutA( ps.hdc, 310,188,"$v13:",5); + TextOutA( ps.hdc, 310,216,"$v14:",5); + TextOutA( ps.hdc, 310,244,"$v15:",5); SelectObject( ps.hdc,hOldFont ); SetBkMode( ps.hdc, OldBkMode ); @@ -292,26 +292,26 @@ void PaintRSP_Vector2_Panel (HWND hWnd) { rcBox.bottom = 275; DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - hOldFont = SelectObject( ps.hdc, + hOldFont = (HFONT)SelectObject( ps.hdc, GetStockObject(DEFAULT_GUI_FONT) ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - TextOut( ps.hdc, 20,48,"$v16:",5); - TextOut( ps.hdc, 20,76,"$v17:",5); - TextOut( ps.hdc, 20,104,"$v18:",5); - TextOut( ps.hdc, 20,132,"$v19:",5); - TextOut( ps.hdc, 20,160,"$v20:",5); - TextOut( ps.hdc, 20,188,"$v21:",5); - TextOut( ps.hdc, 20,216,"$v22:",5); - TextOut( ps.hdc, 20,244,"$v23:",5); - TextOut( ps.hdc, 310,48,"$v24:",5); - TextOut( ps.hdc, 310,76,"$v25:",5); - TextOut( ps.hdc, 310,104,"$v26:",5); - TextOut( ps.hdc, 310,132,"$v27:",5); - TextOut( ps.hdc, 310,160,"$v28:",5); - TextOut( ps.hdc, 310,188,"$v29:",5); - TextOut( ps.hdc, 310,216,"$v30:",5); - TextOut( ps.hdc, 310,244,"$v31:",5); + TextOutA( ps.hdc, 20,48,"$v16:",5); + TextOutA( ps.hdc, 20,76,"$v17:",5); + TextOutA( ps.hdc, 20,104,"$v18:",5); + TextOutA( ps.hdc, 20,132,"$v19:",5); + TextOutA( ps.hdc, 20,160,"$v20:",5); + TextOutA( ps.hdc, 20,188,"$v21:",5); + TextOutA( ps.hdc, 20,216,"$v22:",5); + TextOutA( ps.hdc, 20,244,"$v23:",5); + TextOutA( ps.hdc, 310,48,"$v24:",5); + TextOutA( ps.hdc, 310,76,"$v25:",5); + TextOutA( ps.hdc, 310,104,"$v26:",5); + TextOutA( ps.hdc, 310,132,"$v27:",5); + TextOutA( ps.hdc, 310,160,"$v28:",5); + TextOutA( ps.hdc, 310,188,"$v29:",5); + TextOutA( ps.hdc, 310,216,"$v30:",5); + TextOutA( ps.hdc, 310,244,"$v31:",5); SelectObject( ps.hdc,hOldFont ); SetBkMode( ps.hdc, OldBkMode ); @@ -400,15 +400,15 @@ void SetupRSP_HiddenPanel (HWND hDlg) { int count; for (count = 0; count < 8;count ++) { - hHIDDEN[count] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hHIDDEN[count] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,170,(count*25) + 60,140,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0,(HINSTANCE)hinstDLL, NULL ); SendMessage(hHIDDEN[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } for (count = 0; count < 4;count ++) { - hHIDDEN[count + 8] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hHIDDEN[count + 8] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,425,(count*30) + 90,55,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hHIDDEN[count + 8],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } } @@ -417,15 +417,15 @@ void SetupRSP_CP0Panel (HWND hDlg) { int count; for (count = 0; count < 8;count ++) { - hCP0[count] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hCP0[count] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,225,(count*28) + 53,75,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hCP0[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } for (count = 0; count < 8;count ++) { - hCP0[count + 8] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hCP0[count + 8] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,485,(count*28) + 53,75,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hCP0[ count + 8 ],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } } @@ -434,21 +434,21 @@ void SetupRSP_GPRPanel (HWND hDlg) { int count; for (count = 0; count < 11;count ++) { - hGPR[count] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hGPR[count] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,135,(count*20) + 50,75,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hGPR[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } for (count = 0; count < 11;count ++) { - hGPR[count + 11] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hGPR[count + 11] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,315,(count*20) + 50,75,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hGPR[ count + 11 ],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } for (count = 0; count < 10;count ++) { - hGPR[count + 22] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hGPR[count + 22] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,485,(count*20) + 50,75,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hGPR[ count + 22 ],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } } @@ -458,10 +458,10 @@ void SetupRSP_RegistersMain (HWND hDlg) { #define WindowHeight 325 DWORD X, Y; - hTab = CreateWindowEx(0,WC_TABCONTROL,"", WS_TABSTOP | WS_CHILD | WS_VISIBLE,5,6,616,290, - hDlg,(HMENU)IDC_TAB_CONTROL,hinstDLL,NULL ); + hTab = CreateWindowExA(0,WC_TABCONTROLA,"", WS_TABSTOP | WS_CHILD | WS_VISIBLE,5,6,616,290, + hDlg,(HMENU)IDC_TAB_CONTROL, (HINSTANCE)hinstDLL,NULL ); if ( hTab ) { - TC_ITEM item; + TC_ITEMA item; SendMessage(hTab, WM_SETFONT, (WPARAM)GetStockObject( DEFAULT_GUI_FONT ), 0); item.mask = TCIF_TEXT | TCIF_PARAM; item.pszText = " General Purpose "; @@ -478,7 +478,7 @@ void SetupRSP_RegistersMain (HWND hDlg) { TabCtrl_InsertItem( hTab,3, &item); item.lParam = Vector2; item.pszText = " RSP Vectors $v16 - $v31 "; - TabCtrl_InsertItem( hTab,4, &item); + SendMessageA(hTab, TCM_INSERTITEMA, (WPARAM)(int)(4), (LPARAM)(const TC_ITEM *)(&item)); } SetupRSP_HiddenPanel ( hDlg ); @@ -487,7 +487,7 @@ void SetupRSP_RegistersMain (HWND hDlg) { SetupRSP_Vect1Panel ( hDlg ); SetupRSP_Vect2Panel ( hDlg ); - hStatic = CreateWindowEx(0,"STATIC","", WS_CHILD|WS_VISIBLE, 5,6,616,290,hDlg,0,hinstDLL,NULL ); + hStatic = CreateWindowExA(0,"STATIC","", WS_CHILD|WS_VISIBLE, 5,6,616,290,hDlg,0, (HINSTANCE)hinstDLL,NULL ); #ifdef _M_IX86 RefreshProc = (WNDPROC)SetWindowLong(hStatic, GWL_WNDPROC, (long)RefreshRSP_RegProc); #else @@ -496,7 +496,7 @@ void SetupRSP_RegistersMain (HWND hDlg) { UpdateRSPRegistersScreen (); ShowRSP_RegisterPanel ( GeneralPurpose ); - SetWindowText(hDlg," RSP Registers"); + SetWindowTextA(hDlg," RSP Registers"); //if ( !GetStoredWinPos( "RSP Registers", &X, &Y ) ) { X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2; @@ -509,15 +509,15 @@ void SetupRSP_Vect1Panel (HWND hDlg) { int count; for (count = 0; count < 8;count ++) { - hVECT1[count] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hVECT1[count] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,55,(count*28) + 52,254,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hVECT1[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } for (count = 0; count < 8;count ++) { - hVECT1[count + 8] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hVECT1[count + 8] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,345,(count*28) + 52,254,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hVECT1[count + 8],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } } @@ -526,15 +526,15 @@ void SetupRSP_Vect2Panel (HWND hDlg) { int count; for (count = 0; count < 8;count ++) { - hVECT2[count] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hVECT2[count] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,55,(count*28) + 52,254,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hVECT2[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } for (count = 0; count < 8;count ++) { - hVECT2[count + 8] = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | + hVECT2[count + 8] = CreateWindowExA(WS_EX_CLIENTEDGE,"EDIT","", WS_CHILD | ES_READONLY | WS_BORDER | WS_TABSTOP,345,(count*28) + 52,254,19, - hDlg,0,hinstDLL, NULL ); + hDlg,0, (HINSTANCE)hinstDLL, NULL ); SendMessage(hVECT2[count + 8],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); } } @@ -575,70 +575,70 @@ void UpdateRSPRegistersScreen ( void ) { case GeneralPurpose: for (count = 0; count < 32;count ++) { sprintf(RegisterValue," 0x%08X",RSP_GPR[count].UW); - SetWindowText(hGPR[count],RegisterValue); + SetWindowTextA(hGPR[count],RegisterValue); } break; case ControlProcessor0: if (RSPInfo.SP_MEM_ADDR_REG) { sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_MEM_ADDR_REG); - SetWindowText(hCP0[0],RegisterValue); + SetWindowTextA(hCP0[0],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_DRAM_ADDR_REG); - SetWindowText(hCP0[1],RegisterValue); + SetWindowTextA(hCP0[1],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_RD_LEN_REG); - SetWindowText(hCP0[2],RegisterValue); + SetWindowTextA(hCP0[2],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_WR_LEN_REG); - SetWindowText(hCP0[3],RegisterValue); + SetWindowTextA(hCP0[3],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_STATUS_REG); - SetWindowText(hCP0[4],RegisterValue); + SetWindowTextA(hCP0[4],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_DMA_FULL_REG); - SetWindowText(hCP0[5],RegisterValue); + SetWindowTextA(hCP0[5],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_DMA_BUSY_REG); - SetWindowText(hCP0[6],RegisterValue); + SetWindowTextA(hCP0[6],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_SEMAPHORE_REG); - SetWindowText(hCP0[7],RegisterValue); + SetWindowTextA(hCP0[7],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_START_REG); - SetWindowText(hCP0[8],RegisterValue); + SetWindowTextA(hCP0[8],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_END_REG); - SetWindowText(hCP0[9],RegisterValue); + SetWindowTextA(hCP0[9],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_CURRENT_REG); - SetWindowText(hCP0[10],RegisterValue); + SetWindowTextA(hCP0[10],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_STATUS_REG); - SetWindowText(hCP0[11],RegisterValue); + SetWindowTextA(hCP0[11],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_CLOCK_REG); - SetWindowText(hCP0[12],RegisterValue); + SetWindowTextA(hCP0[12],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_BUFBUSY_REG); - SetWindowText(hCP0[13],RegisterValue); + SetWindowTextA(hCP0[13],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_PIPEBUSY_REG); - SetWindowText(hCP0[14],RegisterValue); + SetWindowTextA(hCP0[14],RegisterValue); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_TMEM_REG); - SetWindowText(hCP0[15],RegisterValue); + SetWindowTextA(hCP0[15],RegisterValue); } break; case HiddenRegisters: for (count = 0; count < 8;count ++) { sprintf(RegisterValue," 0x%08X - %08X",RSP_ACCUM[count].W[1], RSP_ACCUM[count].W[0]); - SetWindowText(hHIDDEN[count],RegisterValue); + SetWindowTextA(hHIDDEN[count],RegisterValue); } for (count = 0; count < 3;count ++) { sprintf(RegisterValue," 0x%04X",RSP_Flags[count].UHW[0]); - SetWindowText(hHIDDEN[count + 8],RegisterValue); + SetWindowTextA(hHIDDEN[count + 8],RegisterValue); } sprintf(RegisterValue," 0x%04X",RSP_Flags[2].UHW[0]); - SetWindowText(hHIDDEN[11],RegisterValue); + SetWindowTextA(hHIDDEN[11],RegisterValue); break; case Vector1: for (count = 0; count < 16;count ++) { sprintf(RegisterValue," 0x%08X - %08X - %08X - %08X", RSP_Vect[count].W[3], RSP_Vect[count].W[2], RSP_Vect[count].W[1], RSP_Vect[count].W[0]); - SetWindowText(hVECT1[count],RegisterValue); + SetWindowTextA(hVECT1[count],RegisterValue); } break; case Vector2: for (count = 0; count < 16;count ++) { sprintf(RegisterValue," 0x%08X - %08X - %08X - %08X", RSP_Vect[count + 16].W[3], RSP_Vect[count + 16].W[2], RSP_Vect[count + 16].W[1], RSP_Vect[count + 16].W[0]); - SetWindowText(hVECT2[count],RegisterValue); + SetWindowTextA(hVECT2[count],RegisterValue); } break; } diff --git a/Source/RSP/RSP.vcxproj b/Source/RSP/RSP.vcxproj index cfc9aca7a..fe69bbabe 100644 --- a/Source/RSP/RSP.vcxproj +++ b/Source/RSP/RSP.vcxproj @@ -20,7 +20,7 @@ {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1} - RSP + Project64-RSP DynamicLibrary @@ -32,43 +32,38 @@ - RSP 1.7 - RSP_d 1.7 + Project64-RSP + Project64-RSP_d $(SolutionDir)Plugin\RSP\ $(SolutionDir)Plugin64\RSP\ - - UNICODE;_UNICODE + NotUsing - - - true - "$(SolutionDir)Source\Script\UpdateVersion.cmd" "$(Configuration)" "$(Platform)" "$(SolutionDir)Source\RSP\Version.h.in" "$(SolutionDir)Source\RSP\Version.h" - - - - - + + + + + - - + + - - - - - - - - + + + + + + + + @@ -96,11 +91,9 @@ {b4a4b994-9111-42b1-93c2-6f1ca8bc4421} - false {8b9961b1-88d9-4ea3-a752-507a00dd9f3d} - false {1968162c-0793-491d-91a1-81645a24d399} diff --git a/Source/RSP/RSP.vcxproj.filters b/Source/RSP/RSP.vcxproj.filters index 52a573bb0..f765ac53e 100644 --- a/Source/RSP/RSP.vcxproj.filters +++ b/Source/RSP/RSP.vcxproj.filters @@ -17,62 +17,6 @@ ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - Header Files\RSP Header Files @@ -134,4 +78,60 @@ Resource Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + \ No newline at end of file diff --git a/Source/RSP/Recompiler Analysis.c b/Source/RSP/Recompiler Analysis.cpp similarity index 100% rename from Source/RSP/Recompiler Analysis.c rename to Source/RSP/Recompiler Analysis.cpp diff --git a/Source/RSP/Recompiler CPU.c b/Source/RSP/Recompiler CPU.cpp similarity index 99% rename from Source/RSP/Recompiler CPU.c rename to Source/RSP/Recompiler CPU.cpp index 0fa02c7b1..208a5468f 100644 --- a/Source/RSP/Recompiler CPU.c +++ b/Source/RSP/Recompiler CPU.cpp @@ -607,7 +607,7 @@ void LinkBranches(RSP_BLOCK * Block) { for (Count = 0; Count < CurrentBlock.ResolveCount; Count++) { Target = CurrentBlock.BranchesToResolve[Count].TargetPC; - X86Code = *(JumpTable + (Target >> 2)); + X86Code = (BYTE *)*(JumpTable + (Target >> 2)); if (!X86Code) { *PrgCount = Target; @@ -622,7 +622,7 @@ void LinkBranches(RSP_BLOCK * Block) { *Block = Save; CPU_Message("===== (End generate code: %04X) =====", Target); CPU_Message(""); - X86Code = *(JumpTable + (Target >> 2)); + X86Code = (BYTE *)*(JumpTable + (Target >> 2)); } JumpWord = CurrentBlock.BranchesToResolve[Count].X86JumpLoc; @@ -710,7 +710,7 @@ Boolean IsJumpLabel(DWORD PC) } void CompilerLinkBlocks(void) { - BYTE * KnownCode = *(JumpTable + (CompilePC >> 2)); + BYTE * KnownCode = (BYTE *)*(JumpTable + (CompilePC >> 2)); CPU_Message("***** Linking block to X86: %08X *****", KnownCode); NextInstruction = FINISH_BLOCK; @@ -866,7 +866,7 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) { while (RSP_Running) { - Block = *(JumpTable + (*PrgCount >> 2)); + Block = (BYTE *)*(JumpTable + (*PrgCount >> 2)); if (Block == NULL) { if (Profiling && !IndvidualBlock) { @@ -890,7 +890,7 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) { CompilerRSPBlock(); #endif - Block = *(JumpTable + (*PrgCount >> 2)); + Block = (BYTE *)*(JumpTable + (*PrgCount >> 2)); // We are done compiling, but we may have references // to fill in still either from this block, or jumps diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.cpp similarity index 99% rename from Source/RSP/Recompiler Ops.c rename to Source/RSP/Recompiler Ops.cpp index 9acbac180..0c8fd896c 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.cpp @@ -92,7 +92,7 @@ void Branch_AddRef(DWORD Target, DWORD * X86Loc) { if (CurrentBlock.ResolveCount >= 150) { CompilerWarning("Out of branch reference space"); } else { - BYTE * KnownCode = *(JumpTable + (Target >> 2)); + BYTE * KnownCode = (BYTE *)(*(JumpTable + (Target >> 2))); if (KnownCode == NULL) { DWORD i = CurrentBlock.ResolveCount; diff --git a/Source/RSP/Recompiler Sections.c b/Source/RSP/Recompiler Sections.cpp similarity index 100% rename from Source/RSP/Recompiler Sections.c rename to Source/RSP/Recompiler Sections.cpp diff --git a/Source/RSP/Rsp.h b/Source/RSP/Rsp.h index dd6bcd65e..b4ba38e95 100644 --- a/Source/RSP/Rsp.h +++ b/Source/RSP/Rsp.h @@ -1,10 +1,6 @@ #pragma once #include -#if defined(__cplusplus) -extern "C" { -#endif - #include #include "Types.h" @@ -24,8 +20,4 @@ extern int DebuggingEnabled, Profiling, IndvidualBlock, ShowErrors, BreakOnStart extern uint32_t CPUCore; extern DEBUG_INFO DebugInfo; extern RSP_INFO RSPInfo; -extern void * hinstDLL; - -#if defined(__cplusplus) -} -#endif +extern void * hinstDLL; \ No newline at end of file diff --git a/Source/RSP/Sse.c b/Source/RSP/Sse.cpp similarity index 100% rename from Source/RSP/Sse.c rename to Source/RSP/Sse.cpp diff --git a/Source/RSP/X86.c b/Source/RSP/X86.cpp similarity index 100% rename from Source/RSP/X86.c rename to Source/RSP/X86.cpp diff --git a/Source/RSP/breakpoint.c b/Source/RSP/breakpoint.cpp similarity index 78% rename from Source/RSP/breakpoint.c rename to Source/RSP/breakpoint.cpp index 21bb47e82..afa4c9307 100644 --- a/Source/RSP/breakpoint.c +++ b/Source/RSP/breakpoint.cpp @@ -7,11 +7,14 @@ #define IDC_LOCATION_EDIT 105 HWND BPoint_Win_hDlg, hRSPLocation = NULL; +BPOINT BPoint[MaxBPoints]; +int NoOfBpoints; + void Add_BPoint ( void ) { char Title[10]; - GetWindowText(hRSPLocation,Title,sizeof(Title)); + GetWindowTextA(hRSPLocation,Title,sizeof(Title)); if (!AddRSP_BPoint(AsciiToHex(Title),TRUE )) { SendMessage(hRSPLocation,EM_SETSEL,(WPARAM)0,(LPARAM)-1); SetFocus(hRSPLocation); @@ -44,7 +47,7 @@ int AddRSP_BPoint( DWORD Location, int Confirm ) sprintf(Message,"Break when:\n\nRSP's program counter = 0x%03X\n\nIs this correct?", Location); - Response = MessageBox(BPoint_Win_hDlg, Message, "Breakpoint", MB_YESNO | MB_ICONINFORMATION); + Response = MessageBoxA(BPoint_Win_hDlg, Message, "Breakpoint", MB_YESNO | MB_ICONINFORMATION); if (Response == IDNO) { return FALSE; @@ -79,17 +82,17 @@ void CreateBPPanel ( void * hDlg, rectangle rcBox ) rcBox = rcBox; // Remove warning of unused - BPoint_Win_hDlg = hDlg; + BPoint_Win_hDlg = (HWND)hDlg; - hRSPLocation = CreateWindowEx(0,"EDIT","", WS_CHILD | WS_BORDER | ES_UPPERCASE | WS_TABSTOP, - 83,90,100,17,hDlg,(HMENU)IDC_LOCATION_EDIT,RSPInfo.hInst,NULL); + hRSPLocation = CreateWindowExA(0,"EDIT","", WS_CHILD | WS_BORDER | ES_UPPERCASE | WS_TABSTOP, + 83,90,100,17, (HWND)hDlg,(HMENU)IDC_LOCATION_EDIT,(HINSTANCE)RSPInfo.hInst,NULL); if (hRSPLocation) { char Title[20]; SendMessage(hRSPLocation,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hRSPLocation,EM_SETLIMITTEXT,(WPARAM)3,(LPARAM)0); sprintf(Title,"%03X",*PrgCount); - SetWindowText(hRSPLocation,Title); + SetWindowTextA(hRSPLocation,Title); } } @@ -100,8 +103,8 @@ void HideBPPanel ( void ) void PaintBPPanel ( window_paint ps ) { - TextOut( ps.hdc, 29,60,"Break when the program counter equals",37); - TextOut( ps.hdc, 59,85,"0x",2); + TextOutA((HDC)ps.hdc, 29,60,"Break when the program counter equals",37); + TextOutA((HDC)ps.hdc, 59,85,"0x",2); } void ShowBPPanel ( void ) @@ -117,9 +120,9 @@ void RefreshBpoints ( void * hList ) for (count = 0; count < NoOfBpoints; count ++ ) { sprintf(Message," at 0x%03X (RSP)", BPoint[count].Location); - location = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)Message); - SendMessage( - hList, + location = SendMessageA((HWND)hList, LB_ADDSTRING, 0, (LPARAM)Message); + SendMessageA( + (HWND)hList, LB_SETITEMDATA, (WPARAM)location, (LPARAM)BPoint[count].Location @@ -132,12 +135,12 @@ void RemoveAllBpoint ( void ) NoOfBpoints = 0; } -void RemoveBpoint ( HWND hList, int index ) +void RemoveBpoint (void * hList, int index ) { LRESULT response; uint32_t location; - response = SendMessage(hList, LB_GETITEMDATA, (WPARAM)index, 0); + response = SendMessage((HWND)hList, LB_GETITEMDATA, (WPARAM)index, 0); if (response < 0 || response > 0x7FFFFFFFL) { DisplayError( diff --git a/Source/RSP/breakpoint.h b/Source/RSP/breakpoint.h index 392919853..10d6755dc 100644 --- a/Source/RSP/breakpoint.h +++ b/Source/RSP/breakpoint.h @@ -6,8 +6,8 @@ typedef struct { unsigned int Location; } BPOINT; -BPOINT BPoint[MaxBPoints]; -int NoOfBpoints; +extern BPOINT BPoint[MaxBPoints]; +extern int NoOfBpoints; void Add_BPoint ( void ); void CreateBPPanel ( void * hDlg, rectangle rcBox ); diff --git a/Source/RSP/dma.c b/Source/RSP/dma.cpp similarity index 100% rename from Source/RSP/dma.c rename to Source/RSP/dma.cpp diff --git a/Source/RSP/log.cpp b/Source/RSP/log.cpp index 21696255a..0ceaea894 100644 --- a/Source/RSP/log.cpp +++ b/Source/RSP/log.cpp @@ -5,11 +5,10 @@ #include #include -extern "C" { #include "Log.h" #include "Rsp.h" #include "Rsp Registers.h" -} + CLog * RDPLog = NULL; CLog * CPULog = NULL; diff --git a/Source/RSP/log.h b/Source/RSP/log.h index 097c97275..23e355821 100644 --- a/Source/RSP/log.h +++ b/Source/RSP/log.h @@ -1,7 +1,3 @@ -#ifdef __cplusplus -extern "C" { -#endif - void StartCPULog ( void ); void StopCPULog ( void ); void CPU_Message ( const char * Message, ...); @@ -12,8 +8,4 @@ void RDP_Message ( const char * Message, ...); void RDP_LogDlist ( void ); void RDP_LogMT0 ( DWORD PC, int Reg, DWORD Value ); void RDP_LogMF0 ( DWORD PC, int Reg ); -void RDP_LogLoc ( DWORD PC ); - -#ifdef __cplusplus -} -#endif +void RDP_LogLoc ( DWORD PC ); \ No newline at end of file diff --git a/Source/RSP/memory.c b/Source/RSP/memory.cpp similarity index 99% rename from Source/RSP/memory.c rename to Source/RSP/memory.cpp index f0170955e..19c805b21 100644 --- a/Source/RSP/memory.c +++ b/Source/RSP/memory.cpp @@ -4,7 +4,8 @@ enum { MaxMaps = 32 }; #include "Rsp.h" #include "RSP Registers.h" -DWORD NoOfMaps, MapsCRC[MaxMaps], Table; +DWORD NoOfMaps, MapsCRC[MaxMaps]; +uint32_t Table; BYTE * RecompCode, * RecompCodeSecondary, * RecompPos, *JumpTables; void ** JumpTable; @@ -58,7 +59,7 @@ void ResetJumpTables ( void ) NoOfMaps = 0; } -void SetJumpTable (DWORD End) { +void SetJumpTable (uint32_t End) { DWORD CRC, count; CRC = 0;