RSP: Convert base code to be compiled as c++ instead of C

This commit is contained in:
zilmar 2023-06-01 17:11:26 +09:30
parent a39ebe7d37
commit 1522f17b9c
27 changed files with 335 additions and 355 deletions

2
.gitignore vendored
View File

@ -57,6 +57,8 @@ Thumbs.db
/Plugin/RSP/lib /Plugin/RSP/lib
/Plugin/RSP/map /Plugin/RSP/map
/Plugin/RSP/pdb /Plugin/RSP/pdb
/Plugin/RSP/Project64-RSP_d.dll
/Plugin/RSP/Project64-RSP.dll
/Plugin/RSP/RSP 1.7.dll /Plugin/RSP/RSP 1.7.dll
/Plugin/RSP/RSP_d 1.7.dll /Plugin/RSP/RSP_d 1.7.dll
/Plugin/RSP/RSP-HLE_d.dll /Plugin/RSP/RSP-HLE_d.dll

View File

@ -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\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\PJ64_NRage.dll"; DestDir: "{app}\Plugin\Input"
Source: "{#BaseDir}\Plugin\Input\Project64-Input.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\example.js"; DestDir: "{app}\Scripts"
Source: "{#BaseDir}\Scripts\api_documentation.js"; DestDir: "{app}\Scripts" Source: "{#BaseDir}\Scripts\api_documentation.js"; DestDir: "{app}\Scripts"
Source: "{#BaseDir}\JS-API-Documentation.html"; DestDir: "{app}" Source: "{#BaseDir}\JS-API-Documentation.html"; DestDir: "{app}"

View File

@ -376,13 +376,14 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
// Plugin // Plugin
#ifdef _WIN32 #ifdef _WIN32
AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll"));
#ifdef _DEBUG #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_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_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_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")); AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin", "Controller Dll", "Input\\Project64-Input_d.dll"));
#else #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_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_GFX_Current, new CSettingTypeApplication("Plugin", "Graphics Dll", Plugin_GFX_Default));
AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Project64-Audio.dll")); AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Project64-Audio.dll"));

View File

@ -10,7 +10,8 @@
#define FINISH_BLOCK 9 #define FINISH_BLOCK 9
#define FINISH_SUB_BLOCK 10 #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 // Standard MIPS PC-relative branch
// Returns the new PC, based on whether the condition passes // Returns the new PC, based on whether the condition passes

View File

@ -1688,7 +1688,7 @@ void rsp_UnknownOpcode (void) {
} else { } else {
sprintf(Message,"Unhandled Opcode\n%s\n\nStopping emulation.\n\nWOuld you like to open the debugger?", sprintf(Message,"Unhandled Opcode\n%s\n\nStopping emulation.\n\nWOuld you like to open the debugger?",
RSPOpcodeName(RSPOpC.Hex,*PrgCount)); 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) { if (response == IDYES) {
Enter_RSP_Commands_Window (); Enter_RSP_Commands_Window ();
} }

View File

@ -14,7 +14,6 @@
#include <stdint.h> #include <stdint.h>
#include "../Settings/Settings.h" #include "../Settings/Settings.h"
extern "C" {
#include "Rsp.h" #include "Rsp.h"
#include "Cpu.h" #include "Cpu.h"
#include "Recompiler CPU.h" #include "Recompiler CPU.h"
@ -52,7 +51,6 @@ RSP_INFO RSPInfo;
void * hinstDLL; void * hinstDLL;
extern uint8_t * pLastSecondary; extern uint8_t * pLastSecondary;
}
enum { enum {
Set_BreakOnStart, Set_CPUCore, Set_LogRDP, Set_LogX86Code, Set_Profiling, Set_IndvidualBlock, Set_BreakOnStart, Set_CPUCore, Set_LogRDP, Set_LogX86Code, Set_Profiling, Set_IndvidualBlock,
@ -134,7 +132,7 @@ void DisplayError(char* Message, ...)
vsprintf( Msg, Message, ap ); vsprintf( Msg, Message, ap );
va_end( ap ); va_end( ap );
#ifdef _WIN32 #ifdef _WIN32
MessageBox(NULL, Msg, "Error", MB_OK | MB_ICONERROR); MessageBoxA(NULL, Msg, "Error", MB_OK | MB_ICONERROR);
#else #else
fputs(&Msg[0], stderr); fputs(&Msg[0], stderr);
#endif #endif
@ -230,7 +228,7 @@ filled by the function. (see def above)
Output: None Output: None
*/ */
EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo) EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * _DebugInfo)
{ {
#ifdef _WIN32 #ifdef _WIN32
if (hRSPMenu == NULL) if (hRSPMenu == NULL)
@ -238,22 +236,22 @@ EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo)
hRSPMenu = LoadMenu((HINSTANCE)hinstDLL,MAKEINTRESOURCE(RspMenu)); hRSPMenu = LoadMenu((HINSTANCE)hinstDLL,MAKEINTRESOURCE(RspMenu));
FixMenuState(); FixMenuState();
} }
DebugInfo->hRSPMenu = hRSPMenu; _DebugInfo->hRSPMenu = hRSPMenu;
#endif #endif
DebugInfo->ProcessMenuItem = ProcessMenuItem; _DebugInfo->ProcessMenuItem = ProcessMenuItem;
DebugInfo->UseBPoints = TRUE; _DebugInfo->UseBPoints = TRUE;
sprintf(DebugInfo->BPPanelName," RSP "); sprintf(_DebugInfo->BPPanelName," RSP ");
DebugInfo->Add_BPoint = Add_BPoint; _DebugInfo->Add_BPoint = Add_BPoint;
DebugInfo->CreateBPPanel = CreateBPPanel; _DebugInfo->CreateBPPanel = CreateBPPanel;
DebugInfo->HideBPPanel = HideBPPanel; _DebugInfo->HideBPPanel = HideBPPanel;
DebugInfo->PaintBPPanel = PaintBPPanel; _DebugInfo->PaintBPPanel = PaintBPPanel;
DebugInfo->RefreshBpoints = RefreshBpoints; _DebugInfo->RefreshBpoints = RefreshBpoints;
DebugInfo->RemoveAllBpoint = RemoveAllBpoint; _DebugInfo->RemoveAllBpoint = RemoveAllBpoint;
DebugInfo->RemoveBpoint = RemoveBpoint; _DebugInfo->RemoveBpoint = RemoveBpoint;
DebugInfo->ShowBPPanel = ShowBPPanel; _DebugInfo->ShowBPPanel = ShowBPPanel;
DebugInfo->Enter_RSP_Commands_Window = Enter_RSP_Commands_Window; _DebugInfo->Enter_RSP_Commands_Window = Enter_RSP_Commands_Window;
} }
/* /*

View File

@ -1,9 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <windows.h> #include <windows.h>
#include <shellapi.h> #include <shellapi.h>
extern "C" {
#include "profiling.h" #include "profiling.h"
}
#pragma warning(disable:4786) #pragma warning(disable:4786)
#include <Common/StdString.h> #include <Common/StdString.h>
#include <Common/File.h> #include <Common/File.h>
@ -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(); ResetCounters();
} }
}; };

View File

@ -56,7 +56,7 @@ void Create_RSP_Commands_Window ( int Child )
if ( Child ) if ( Child )
{ {
InRSPCommandsWindow = TRUE; InRSPCommandsWindow = TRUE;
DialogBox( hinstDLL, "RSPCOMMAND", NULL,(DLGPROC)RSP_Commands_Proc ); DialogBoxA( (HINSTANCE)hinstDLL, "RSPCOMMAND", NULL,(DLGPROC)RSP_Commands_Proc );
InRSPCommandsWindow = FALSE; InRSPCommandsWindow = FALSE;
memset(RSPCommandLine,0,sizeof(RSPCommandLine)); memset(RSPCommandLine,0,sizeof(RSPCommandLine));
@ -147,7 +147,7 @@ void DumpRSPCode (void)
DWORD location, dwWritten; DWORD location, dwWritten;
HANDLE hLogFile = NULL; HANDLE hLogFile = NULL;
strcpy(LogFileName,GetCommandLine() + 1); strcpy(LogFileName,GetCommandLineA() + 1);
if (strchr(LogFileName,'\"')) if (strchr(LogFileName,'\"'))
{ {
@ -169,7 +169,7 @@ void DumpRSPCode (void)
strcat(LogFileName,"\\RSP code.txt"); 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); FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
SetFilePointer(hLogFile,0,NULL,FILE_BEGIN); SetFilePointer(hLogFile,0,NULL,FILE_BEGIN);
@ -202,7 +202,7 @@ void DumpRSPData (void)
DWORD location, dwWritten; DWORD location, dwWritten;
HANDLE hLogFile = NULL; HANDLE hLogFile = NULL;
strcpy(LogFileName,GetCommandLine() + 1); strcpy(LogFileName,GetCommandLineA() + 1);
if (strchr(LogFileName,'\"')) if (strchr(LogFileName,'\"'))
{ {
@ -223,7 +223,7 @@ void DumpRSPData (void)
strcat(LogFileName,"\\RSP data.txt"); 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); FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
SetFilePointer(hLogFile,0,NULL,FILE_BEGIN); 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, SetRect(&TextRect,ditem->rcItem.left,ditem->rcItem.top, ditem->rcItem.left + 83,
ditem->rcItem.bottom); ditem->rcItem.bottom);
DrawText( DrawTextA(
ditem->hDC, ditem->hDC,
&Offset[0], printed_offset, &Offset[0], printed_offset,
&TextRect, &TextRect,
@ -335,7 +335,7 @@ void DrawRSPCommand ( LPARAM lParam )
SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165, SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165,
ditem->rcItem.bottom); ditem->rcItem.bottom);
DrawText( DrawTextA(
ditem->hDC, ditem->hDC,
&Instruction[0], printed_instruction, &Instruction[0], printed_instruction,
&TextRect, &TextRect,
@ -344,7 +344,7 @@ void DrawRSPCommand ( LPARAM lParam )
SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right, SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right,
ditem->rcItem.bottom); ditem->rcItem.bottom);
DrawText( DrawTextA(
ditem->hDC, ditem->hDC,
&Arguments[0], printed_arguments, &Arguments[0], printed_arguments,
&TextRect, &TextRect,
@ -353,7 +353,7 @@ void DrawRSPCommand ( LPARAM lParam )
} }
else else
{ {
DrawText( DrawTextA(
ditem->hDC, ditem->hDC,
&Command[0], (signed int)strlen(Command), &Command[0], (signed int)strlen(Command),
&ditem->rcItem, &ditem->rcItem,
@ -444,11 +444,11 @@ void Paint_RSP_Commands (HWND hDlg)
hOldFont = (HFONT)SelectObject( ps.hdc,GetStockObject(DEFAULT_GUI_FONT ) ); hOldFont = (HFONT)SelectObject( ps.hdc,GetStockObject(DEFAULT_GUI_FONT ) );
OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT );
TextOut( ps.hdc, 23,16,"Offset",6); TextOutA( ps.hdc, 23,16,"Offset",6);
TextOut( ps.hdc, 97,16,"Instruction",11); TextOutA( ps.hdc, 97,16,"Instruction",11);
TextOut( ps.hdc, 180,16,"Arguments",9); TextOutA( ps.hdc, 180,16,"Arguments",9);
TextOut( ps.hdc, 354,2," Address ",9); TextOutA( ps.hdc, 354,2," Address ",9);
TextOut( ps.hdc, 358,19,"0x1",3); TextOutA( ps.hdc, 358,19,"0x1",3);
SelectObject( ps.hdc,hOldFont ); SelectObject( ps.hdc,hOldFont );
SetBkMode( ps.hdc, OldBkMode ); SetBkMode( ps.hdc, OldBkMode );
@ -464,7 +464,7 @@ void RefreshRSPCommands ( void )
if (InRSPCommandsWindow == FALSE) { return; } if (InRSPCommandsWindow == FALSE) { return; }
GetWindowText(hAddress,AsciiAddress,sizeof(AsciiAddress)); GetWindowTextA(hAddress,AsciiAddress,sizeof(AsciiAddress));
location = AsciiToHex(AsciiAddress) & ~3; location = AsciiToHex(AsciiAddress) & ~3;
if (location > 0xF88) { location = 0xF88; } if (location > 0xF88) { location = 0xF88; }
@ -579,14 +579,14 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
char Value[20]; char Value[20];
SCROLLINFO si; SCROLLINFO si;
GetWindowText(hAddress,Value,sizeof(Value)); GetWindowTextA(hAddress,Value,sizeof(Value));
location = AsciiToHex(Value) & ~3; location = AsciiToHex(Value) & ~3;
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case SB_THUMBTRACK: case SB_THUMBTRACK:
sprintf(Value,"%03X",((short int)HIWORD(wParam) << 2 )); sprintf(Value,"%03X",((short int)HIWORD(wParam) << 2 ));
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = (short int)HIWORD(wParam); 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) if (location < 0xF88)
{ {
sprintf(Value,"%03X",location + 0x4); sprintf(Value,"%03X",location + 0x4);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location + 0x4) >> 2); si.nPos = ((location + 0x4) >> 2);
@ -605,7 +605,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
else else
{ {
sprintf(Value,"%03X",0xF88); sprintf(Value,"%03X",0xF88);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = (0xFFC >> 2); si.nPos = (0xFFC >> 2);
@ -616,7 +616,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
if (location > 0x4 ) if (location > 0x4 )
{ {
sprintf(Value,"%03X",location - 0x4); sprintf(Value,"%03X",location - 0x4);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location - 0x4) >> 2); si.nPos = ((location - 0x4) >> 2);
@ -625,7 +625,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
else else
{ {
sprintf(Value,"%03X",0); sprintf(Value,"%03X",0);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = 0; si.nPos = 0;
@ -636,7 +636,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
if ((location + 0x74)< 0xF88) if ((location + 0x74)< 0xF88)
{ {
sprintf(Value,"%03X",location + 0x74); sprintf(Value,"%03X",location + 0x74);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location + 0x74) >> 2); si.nPos = ((location + 0x74) >> 2);
@ -645,7 +645,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
else else
{ {
sprintf(Value,"%03X",0xF88); sprintf(Value,"%03X",0xF88);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = (0xF8F >> 2); si.nPos = (0xF8F >> 2);
@ -656,7 +656,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
if ((location - 0x74) > 0x74 ) if ((location - 0x74) > 0x74 )
{ {
sprintf(Value,"%03X",location - 0x74); sprintf(Value,"%03X",location - 0x74);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = ((location - 0x74) >> 2); si.nPos = ((location - 0x74) >> 2);
@ -665,7 +665,7 @@ LRESULT CALLBACK RSP_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
else else
{ {
sprintf(Value,"%03X",0); sprintf(Value,"%03X",0);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
si.cbSize = sizeof(si); si.cbSize = sizeof(si);
si.fMask = SIF_POS; si.fMask = SIF_POS;
si.nPos = 0; si.nPos = 0;
@ -688,9 +688,9 @@ void RSP_Commands_Setup ( HWND hDlg )
char Location[10]; char Location[10];
DWORD X, Y, WndPos; 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, LBS_OWNERDRAWFIXED | LBS_NOTIFY,14,30,303,445, hDlg,
(HMENU)IDC_LIST, hinstDLL,NULL ); (HMENU)IDC_LIST, (HINSTANCE)hinstDLL,NULL );
if ( hList) if ( hList)
{ {
SendMessage(hList,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); 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); sprintf(Location, "%03X", PrgCount ? *PrgCount : 0);
hAddress = CreateWindowEx(0,"EDIT",Location, WS_CHILD | ES_UPPERCASE | WS_VISIBLE | hAddress = CreateWindowExA(0,"EDIT",Location, WS_CHILD | ES_UPPERCASE | WS_VISIBLE |
WS_BORDER | WS_TABSTOP,375,17,36,18, hDlg,(HMENU)IDC_ADDRESS,hinstDLL, NULL ); WS_BORDER | WS_TABSTOP,375,17,36,18, hDlg,(HMENU)IDC_ADDRESS, (HINSTANCE)hinstDLL, NULL );
if (hAddress) if (hAddress)
{ {
SendMessage(hAddress,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hAddress,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
SendMessage(hAddress,EM_SETLIMITTEXT, (WPARAM)3,(LPARAM)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, 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) if (hFunctionlist)
{ {
SendMessage(hFunctionlist,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); 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, BS_DEFPUSHBUTTON | WS_VISIBLE | WS_TABSTOP, 347,56,100,24, hDlg,(HMENU)IDC_GO_BUTTON,
hinstDLL,NULL ); (HINSTANCE)hinstDLL,NULL );
if (hGoButton) if (hGoButton)
{ {
SendMessage(hGoButton,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); 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, 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) if (hBreakButton)
{ {
SendMessage(hBreakButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); 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, 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) if (hStepButton)
{ {
SendMessage(hStepButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); 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, 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) if (hSkipButton)
{ {
SendMessage(hSkipButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); 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) 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, 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) if (hBPButton)
{ {
SendMessage(hBPButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hBPButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
@ -764,9 +764,9 @@ void RSP_Commands_Setup ( HWND hDlg )
} }
WndPos += 29; 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, 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) if (hRSPRegisters)
{ {
SendMessage(hRSPRegisters,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hRSPRegisters,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
@ -775,9 +775,9 @@ void RSP_Commands_Setup ( HWND hDlg )
WndPos += 29; WndPos += 29;
if (DebugInfo.Enter_R4300i_Commands_Window != NULL) 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, 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) if (hR4300iDebugger)
{ {
SendMessage(hR4300iDebugger,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hR4300iDebugger,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
@ -787,9 +787,9 @@ void RSP_Commands_Setup ( HWND hDlg )
WndPos += 29; WndPos += 29;
if (DebugInfo.Enter_R4300i_Register_Window != NULL) 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, 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) if (hR4300iRegisters)
{ {
SendMessage(hR4300iRegisters,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hR4300iRegisters,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
@ -799,17 +799,17 @@ void RSP_Commands_Setup ( HWND hDlg )
WndPos += 29; WndPos += 29;
if (DebugInfo.Enter_Memory_Window != NULL) 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, 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) if (hMemory)
{ {
SendMessage(hMemory,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hMemory,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
} }
hScrlBar = CreateWindowEx(WS_EX_STATICEDGE, "SCROLLBAR","", WS_CHILD | WS_VISIBLE | hScrlBar = CreateWindowExA(WS_EX_STATICEDGE, "SCROLLBAR","", WS_CHILD | WS_VISIBLE |
WS_TABSTOP | SBS_VERT, 318,14,18,439, hDlg, (HMENU)IDC_SCRL_BAR, hinstDLL, NULL ); WS_TABSTOP | SBS_VERT, 318,14,18,439, hDlg, (HMENU)IDC_SCRL_BAR, (HINSTANCE)hinstDLL, NULL );
if ( RSP_Running ) if ( RSP_Running )
{ {
@ -824,7 +824,7 @@ void RSP_Commands_Setup ( HWND hDlg )
X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2; X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2;
Y = (GetSystemMetrics( SM_CYSCREEN ) - WindowHeight) / 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); SetWindowPos(hDlg,NULL,X,Y,WindowWidth,WindowHeight, SWP_NOZORDER | SWP_SHOWWINDOW);
} }
@ -1323,13 +1323,13 @@ void SetRSPCommandViewto ( UINT NewLocation )
if (InRSPCommandsWindow == FALSE) { return; } if (InRSPCommandsWindow == FALSE) { return; }
GetWindowText(hAddress,Value,sizeof(Value)); GetWindowTextA(hAddress,Value,sizeof(Value));
location = AsciiToHex(Value) & ~3; location = AsciiToHex(Value) & ~3;
if ( NewLocation < location || NewLocation >= location + 120 ) if ( NewLocation < location || NewLocation >= location + 120 )
{ {
sprintf(Value,"%03X",NewLocation); sprintf(Value,"%03X",NewLocation);
SetWindowText(hAddress,Value); SetWindowTextA(hAddress,Value);
} }
else else
{ {

View File

@ -39,7 +39,7 @@ WNDPROC RefreshProc;
// RSP registers // RSP registers
UWORD32 RSP_GPR[32], RSP_Flags[4]; UWORD32 RSP_GPR[32], RSP_Flags[4];
UDWORD RSP_ACCUM[8]; UDWORD RSP_ACCUM[8];
VECTOR RSP_Vect[32]; VECTOR RSP_Vect[32] alignas(16);
char * GPR_Strings[32] = { char * GPR_Strings[32] = {
"R0", "AT", "V0", "V1", "A0", "A1", "A2", "A3", "R0", "AT", "V0", "V1", "A0", "A1", "A2", "A3",
@ -52,7 +52,7 @@ void Create_RSP_Register_Window ( int Child ) {
DWORD ThreadID; DWORD ThreadID;
if ( Child ) { if ( Child ) {
InRSPRegisterWindow = TRUE; InRSPRegisterWindow = TRUE;
DialogBox( hinstDLL, "RSPREGISTERS", NULL,(DLGPROC) RSP_Registers_Proc ); DialogBoxA( (HINSTANCE)hinstDLL, "RSPREGISTERS", NULL,(DLGPROC) RSP_Registers_Proc );
InRSPRegisterWindow = FALSE; InRSPRegisterWindow = FALSE;
} else { } else {
if (!InRSPRegisterWindow) { if (!InRSPRegisterWindow) {
@ -121,25 +121,25 @@ void PaintRSP_HiddenPanel (HWND hWnd) {
rcBox.right = 425; rcBox.bottom = 50; rcBox.right = 425; rcBox.bottom = 50;
FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW); FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW);
hOldFont = SelectObject( ps.hdc, hOldFont = (HFONT)SelectObject( ps.hdc,
GetStockObject(DEFAULT_GUI_FONT) ); GetStockObject((int)DEFAULT_GUI_FONT) );
OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT );
TextOut( ps.hdc, 80,34,"Accumulators",12); TextOutA( ps.hdc, 80,34,"Accumulators",12);
TextOut( ps.hdc, 80,56,"Accumulator 0:",14); TextOutA( ps.hdc, 80,56,"Accumulator 0:",14);
TextOut( ps.hdc, 80,81,"Accumulator 1:",14); TextOutA( ps.hdc, 80,81,"Accumulator 1:",14);
TextOut( ps.hdc, 80,106,"Accumulator 2:",14); TextOutA( ps.hdc, 80,106,"Accumulator 2:",14);
TextOut( ps.hdc, 80,131,"Accumulator 3:",14); TextOutA( ps.hdc, 80,131,"Accumulator 3:",14);
TextOut( ps.hdc, 80,156,"Accumulator 4:",14); TextOutA( ps.hdc, 80,156,"Accumulator 4:",14);
TextOut( ps.hdc, 80,181,"Accumulator 5:",14); TextOutA( ps.hdc, 80,181,"Accumulator 5:",14);
TextOut( ps.hdc, 80,206,"Accumulator 6:",14); TextOutA( ps.hdc, 80,206,"Accumulator 6:",14);
TextOut( ps.hdc, 80,231,"Accumulator 7:",14); TextOutA( ps.hdc, 80,231,"Accumulator 7:",14);
TextOut( ps.hdc, 371,34,"RSP Flags",9); TextOutA( ps.hdc, 371,34,"RSP Flags",9);
TextOut( ps.hdc, 375,86,"Flag 0:",7); TextOutA( ps.hdc, 375,86,"Flag 0:",7);
TextOut( ps.hdc, 375,116,"Flag 2:",7); TextOutA( ps.hdc, 375,116,"Flag 2:",7);
TextOut( ps.hdc, 375,146,"Flag 3:",7); TextOutA( ps.hdc, 375,146,"Flag 3:",7);
TextOut( ps.hdc, 375,176,"Flag 4:",7); TextOutA( ps.hdc, 375,176,"Flag 4:",7);
SelectObject( ps.hdc,hOldFont ); SelectObject( ps.hdc,hOldFont );
SetBkMode( ps.hdc, OldBkMode ); SetBkMode( ps.hdc, OldBkMode );
@ -159,26 +159,26 @@ void PaintRSP_CP0Panel (HWND hWnd) {
rcBox.bottom = 275; rcBox.bottom = 275;
DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT );
hOldFont = SelectObject( ps.hdc, hOldFont = (HFONT)SelectObject( ps.hdc,
GetStockObject(DEFAULT_GUI_FONT) ); GetStockObject(DEFAULT_GUI_FONT) );
OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT );
TextOut( ps.hdc, 53,48,"Reg 0 - SP memory address:",26); TextOutA( ps.hdc, 53,48,"Reg 0 - SP memory address:",26);
TextOut( ps.hdc, 53,76,"Reg 1 - SP DRAM DMA address:",28); TextOutA( ps.hdc, 53,76,"Reg 1 - SP DRAM DMA address:",28);
TextOut( ps.hdc, 53,104,"Reg 2 - SP read DMA length:",27); TextOutA( ps.hdc, 53,104,"Reg 2 - SP read DMA length:",27);
TextOut( ps.hdc, 53,132,"Reg 3 - SP write DMA length:",28); TextOutA( ps.hdc, 53,132,"Reg 3 - SP write DMA length:",28);
TextOut( ps.hdc, 53,160,"Reg 4 - SP status:",18); TextOutA( ps.hdc, 53,160,"Reg 4 - SP status:",18);
TextOut( ps.hdc, 53,188,"Reg 5 - SP DMA full:",20); TextOutA( ps.hdc, 53,188,"Reg 5 - SP DMA full:",20);
TextOut( ps.hdc, 53,216,"Reg 6 - SP DMA busy:",20); TextOutA( ps.hdc, 53,216,"Reg 6 - SP DMA busy:",20);
TextOut( ps.hdc, 53,244,"Reg 7 - SP semaphore:",21); TextOutA( ps.hdc, 53,244,"Reg 7 - SP semaphore:",21);
TextOut( ps.hdc, 313,48,"Reg 8 - DP CMD DMA start:",25); TextOutA( ps.hdc, 313,48,"Reg 8 - DP CMD DMA start:",25);
TextOut( ps.hdc, 313,76,"Reg 9 - DP CMD DMA end:",23); TextOutA( ps.hdc, 313,76,"Reg 9 - DP CMD DMA end:",23);
TextOut( ps.hdc, 313,104,"Reg 10 - DP CMD DMA current:",28); TextOutA( ps.hdc, 313,104,"Reg 10 - DP CMD DMA current:",28);
TextOut( ps.hdc, 313,132,"Reg 11 - DP CMD status:",23); TextOutA( ps.hdc, 313,132,"Reg 11 - DP CMD status:",23);
TextOut( ps.hdc, 313,160,"Reg 12 - DP clock counter:",26); TextOutA( ps.hdc, 313,160,"Reg 12 - DP clock counter:",26);
TextOut( ps.hdc, 313,188,"Reg 13 - DP buffer busy counter:",32); TextOutA( ps.hdc, 313,188,"Reg 13 - DP buffer busy counter:",32);
TextOut( ps.hdc, 313,216,"Reg 14 - DP pipe busy counter:",30); TextOutA( 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, 313,244,"Reg 15 - DP TMEM load counter:",30);
SelectObject( ps.hdc,hOldFont ); SelectObject( ps.hdc,hOldFont );
SetBkMode( ps.hdc, OldBkMode ); SetBkMode( ps.hdc, OldBkMode );
@ -198,42 +198,42 @@ void PaintRSP_GPRPanel (HWND hWnd) {
rcBox.bottom = 275; rcBox.bottom = 275;
DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT );
hOldFont = SelectObject( ps.hdc, hOldFont = (HFONT)SelectObject( ps.hdc,
GetStockObject(DEFAULT_GUI_FONT) ); GetStockObject(DEFAULT_GUI_FONT) );
OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT );
TextOut( ps.hdc, 53,46,"R0 - Reg 0:",11); TextOutA( ps.hdc, 53,46,"R0 - Reg 0:",11);
TextOut( ps.hdc, 53,66,"AT - Reg 1:",11); TextOutA( ps.hdc, 53,66,"AT - Reg 1:",11);
TextOut( ps.hdc, 53,86,"V0 - Reg 2:",11); TextOutA( ps.hdc, 53,86,"V0 - Reg 2:",11);
TextOut( ps.hdc, 53,106,"V1 - Reg 3:",11); TextOutA( ps.hdc, 53,106,"V1 - Reg 3:",11);
TextOut( ps.hdc, 53,126,"A0 - Reg 4:",11); TextOutA( ps.hdc, 53,126,"A0 - Reg 4:",11);
TextOut( ps.hdc, 53,146,"A1 - Reg 5:",11); TextOutA( ps.hdc, 53,146,"A1 - Reg 5:",11);
TextOut( ps.hdc, 53,166,"A2 - Reg 6:",11); TextOutA( ps.hdc, 53,166,"A2 - Reg 6:",11);
TextOut( ps.hdc, 53,186,"A3 - Reg 7:",11); TextOutA( ps.hdc, 53,186,"A3 - Reg 7:",11);
TextOut( ps.hdc, 53,206,"T0 - Reg 8:",11); TextOutA( ps.hdc, 53,206,"T0 - Reg 8:",11);
TextOut( ps.hdc, 53,226,"T1 - Reg 9:",11); TextOutA( ps.hdc, 53,226,"T1 - Reg 9:",11);
TextOut( ps.hdc, 53,246,"T2 - Reg 10:",12); TextOutA( ps.hdc, 53,246,"T2 - Reg 10:",12);
TextOut( ps.hdc, 228,46,"T3 - Reg 11:",12); TextOutA( ps.hdc, 228,46,"T3 - Reg 11:",12);
TextOut( ps.hdc, 228,66,"T4 - Reg 12:",12); TextOutA( ps.hdc, 228,66,"T4 - Reg 12:",12);
TextOut( ps.hdc, 228,86,"T5 - Reg 13:",12); TextOutA( ps.hdc, 228,86,"T5 - Reg 13:",12);
TextOut( ps.hdc, 228,106,"T6 - Reg 14:",12); TextOutA( ps.hdc, 228,106,"T6 - Reg 14:",12);
TextOut( ps.hdc, 228,126,"T7 - Reg 15:",12); TextOutA( ps.hdc, 228,126,"T7 - Reg 15:",12);
TextOut( ps.hdc, 228,146,"S0 - Reg 16:",12); TextOutA( ps.hdc, 228,146,"S0 - Reg 16:",12);
TextOut( ps.hdc, 228,166,"S1 - Reg 17:",12); TextOutA( ps.hdc, 228,166,"S1 - Reg 17:",12);
TextOut( ps.hdc, 228,186,"S2 - Reg 18:",12); TextOutA( ps.hdc, 228,186,"S2 - Reg 18:",12);
TextOut( ps.hdc, 228,206,"S3 - Reg 19:",12); TextOutA( ps.hdc, 228,206,"S3 - Reg 19:",12);
TextOut( ps.hdc, 228,226,"S4 - Reg 20:",12); TextOutA( ps.hdc, 228,226,"S4 - Reg 20:",12);
TextOut( ps.hdc, 228,246,"S5 - Reg 21:",12); TextOutA( ps.hdc, 228,246,"S5 - Reg 21:",12);
TextOut( ps.hdc, 408,46,"S6 - Reg 22:",12); TextOutA( ps.hdc, 408,46,"S6 - Reg 22:",12);
TextOut( ps.hdc, 408,66,"S7 - Reg 23:",12); TextOutA( ps.hdc, 408,66,"S7 - Reg 23:",12);
TextOut( ps.hdc, 408,86,"T8 - Reg 24:",12); TextOutA( ps.hdc, 408,86,"T8 - Reg 24:",12);
TextOut( ps.hdc, 408,106,"T9 - Reg 25:",12); TextOutA( ps.hdc, 408,106,"T9 - Reg 25:",12);
TextOut( ps.hdc, 408,126,"K0 - Reg 26:",12); TextOutA( ps.hdc, 408,126,"K0 - Reg 26:",12);
TextOut( ps.hdc, 408,146,"K1 - Reg 27:",12); TextOutA( ps.hdc, 408,146,"K1 - Reg 27:",12);
TextOut( ps.hdc, 408,166,"GP - Reg 28:",12); TextOutA( ps.hdc, 408,166,"GP - Reg 28:",12);
TextOut( ps.hdc, 408,186,"SP - Reg 29:",12); TextOutA( ps.hdc, 408,186,"SP - Reg 29:",12);
TextOut( ps.hdc, 408,206,"S8 - Reg 30:",12); TextOutA( ps.hdc, 408,206,"S8 - Reg 30:",12);
TextOut( ps.hdc, 408,226,"RA - Reg 31:",12); TextOutA( ps.hdc, 408,226,"RA - Reg 31:",12);
SelectObject( ps.hdc,hOldFont ); SelectObject( ps.hdc,hOldFont );
SetBkMode( ps.hdc, OldBkMode ); SetBkMode( ps.hdc, OldBkMode );
@ -253,26 +253,26 @@ void PaintRSP_Vector1_Panel (HWND hWnd) {
rcBox.bottom = 275; rcBox.bottom = 275;
DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT );
hOldFont = SelectObject( ps.hdc, hOldFont = (HFONT)SelectObject( ps.hdc,
GetStockObject(DEFAULT_GUI_FONT) ); GetStockObject(DEFAULT_GUI_FONT) );
OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT );
TextOut( ps.hdc, 20,48,"$v0:",4); TextOutA( ps.hdc, 20,48,"$v0:",4);
TextOut( ps.hdc, 20,76,"$v1:",4); TextOutA( ps.hdc, 20,76,"$v1:",4);
TextOut( ps.hdc, 20,104,"$v2:",4); TextOutA( ps.hdc, 20,104,"$v2:",4);
TextOut( ps.hdc, 20,132,"$v3:",4); TextOutA( ps.hdc, 20,132,"$v3:",4);
TextOut( ps.hdc, 20,160,"$v4:",4); TextOutA( ps.hdc, 20,160,"$v4:",4);
TextOut( ps.hdc, 20,188,"$v5:",4); TextOutA( ps.hdc, 20,188,"$v5:",4);
TextOut( ps.hdc, 20,216,"$v6:",4); TextOutA( ps.hdc, 20,216,"$v6:",4);
TextOut( ps.hdc, 20,244,"$v7:",4); TextOutA( ps.hdc, 20,244,"$v7:",4);
TextOut( ps.hdc, 310,48,"$v8:",4); TextOutA( ps.hdc, 310,48,"$v8:",4);
TextOut( ps.hdc, 310,76,"$v9:",4); TextOutA( ps.hdc, 310,76,"$v9:",4);
TextOut( ps.hdc, 310,104,"$v10:",5); TextOutA( ps.hdc, 310,104,"$v10:",5);
TextOut( ps.hdc, 310,132,"$v11:",5); TextOutA( ps.hdc, 310,132,"$v11:",5);
TextOut( ps.hdc, 310,160,"$v12:",5); TextOutA( ps.hdc, 310,160,"$v12:",5);
TextOut( ps.hdc, 310,188,"$v13:",5); TextOutA( ps.hdc, 310,188,"$v13:",5);
TextOut( ps.hdc, 310,216,"$v14:",5); TextOutA( ps.hdc, 310,216,"$v14:",5);
TextOut( ps.hdc, 310,244,"$v15:",5); TextOutA( ps.hdc, 310,244,"$v15:",5);
SelectObject( ps.hdc,hOldFont ); SelectObject( ps.hdc,hOldFont );
SetBkMode( ps.hdc, OldBkMode ); SetBkMode( ps.hdc, OldBkMode );
@ -292,26 +292,26 @@ void PaintRSP_Vector2_Panel (HWND hWnd) {
rcBox.bottom = 275; rcBox.bottom = 275;
DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT );
hOldFont = SelectObject( ps.hdc, hOldFont = (HFONT)SelectObject( ps.hdc,
GetStockObject(DEFAULT_GUI_FONT) ); GetStockObject(DEFAULT_GUI_FONT) );
OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); OldBkMode = SetBkMode( ps.hdc, TRANSPARENT );
TextOut( ps.hdc, 20,48,"$v16:",5); TextOutA( ps.hdc, 20,48,"$v16:",5);
TextOut( ps.hdc, 20,76,"$v17:",5); TextOutA( ps.hdc, 20,76,"$v17:",5);
TextOut( ps.hdc, 20,104,"$v18:",5); TextOutA( ps.hdc, 20,104,"$v18:",5);
TextOut( ps.hdc, 20,132,"$v19:",5); TextOutA( ps.hdc, 20,132,"$v19:",5);
TextOut( ps.hdc, 20,160,"$v20:",5); TextOutA( ps.hdc, 20,160,"$v20:",5);
TextOut( ps.hdc, 20,188,"$v21:",5); TextOutA( ps.hdc, 20,188,"$v21:",5);
TextOut( ps.hdc, 20,216,"$v22:",5); TextOutA( ps.hdc, 20,216,"$v22:",5);
TextOut( ps.hdc, 20,244,"$v23:",5); TextOutA( ps.hdc, 20,244,"$v23:",5);
TextOut( ps.hdc, 310,48,"$v24:",5); TextOutA( ps.hdc, 310,48,"$v24:",5);
TextOut( ps.hdc, 310,76,"$v25:",5); TextOutA( ps.hdc, 310,76,"$v25:",5);
TextOut( ps.hdc, 310,104,"$v26:",5); TextOutA( ps.hdc, 310,104,"$v26:",5);
TextOut( ps.hdc, 310,132,"$v27:",5); TextOutA( ps.hdc, 310,132,"$v27:",5);
TextOut( ps.hdc, 310,160,"$v28:",5); TextOutA( ps.hdc, 310,160,"$v28:",5);
TextOut( ps.hdc, 310,188,"$v29:",5); TextOutA( ps.hdc, 310,188,"$v29:",5);
TextOut( ps.hdc, 310,216,"$v30:",5); TextOutA( ps.hdc, 310,216,"$v30:",5);
TextOut( ps.hdc, 310,244,"$v31:",5); TextOutA( ps.hdc, 310,244,"$v31:",5);
SelectObject( ps.hdc,hOldFont ); SelectObject( ps.hdc,hOldFont );
SetBkMode( ps.hdc, OldBkMode ); SetBkMode( ps.hdc, OldBkMode );
@ -400,15 +400,15 @@ void SetupRSP_HiddenPanel (HWND hDlg) {
int count; int count;
for (count = 0; count < 8;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, 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); SendMessage(hHIDDEN[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
for (count = 0; count < 4;count ++) { 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, 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); SendMessage(hHIDDEN[count + 8],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
} }
@ -417,15 +417,15 @@ void SetupRSP_CP0Panel (HWND hDlg) {
int count; int count;
for (count = 0; count < 8;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, 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); SendMessage(hCP0[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
for (count = 0; count < 8;count ++) { 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, 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); SendMessage(hCP0[ count + 8 ],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
} }
@ -434,21 +434,21 @@ void SetupRSP_GPRPanel (HWND hDlg) {
int count; int count;
for (count = 0; count < 11;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, 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); SendMessage(hGPR[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
for (count = 0; count < 11;count ++) { 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, 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); SendMessage(hGPR[ count + 11 ],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
for (count = 0; count < 10;count ++) { 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, 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); SendMessage(hGPR[ count + 22 ],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
} }
@ -458,10 +458,10 @@ void SetupRSP_RegistersMain (HWND hDlg) {
#define WindowHeight 325 #define WindowHeight 325
DWORD X, Y; DWORD X, Y;
hTab = CreateWindowEx(0,WC_TABCONTROL,"", WS_TABSTOP | WS_CHILD | WS_VISIBLE,5,6,616,290, hTab = CreateWindowExA(0,WC_TABCONTROLA,"", WS_TABSTOP | WS_CHILD | WS_VISIBLE,5,6,616,290,
hDlg,(HMENU)IDC_TAB_CONTROL,hinstDLL,NULL ); hDlg,(HMENU)IDC_TAB_CONTROL, (HINSTANCE)hinstDLL,NULL );
if ( hTab ) { if ( hTab ) {
TC_ITEM item; TC_ITEMA item;
SendMessage(hTab, WM_SETFONT, (WPARAM)GetStockObject( DEFAULT_GUI_FONT ), 0); SendMessage(hTab, WM_SETFONT, (WPARAM)GetStockObject( DEFAULT_GUI_FONT ), 0);
item.mask = TCIF_TEXT | TCIF_PARAM; item.mask = TCIF_TEXT | TCIF_PARAM;
item.pszText = " General Purpose "; item.pszText = " General Purpose ";
@ -478,7 +478,7 @@ void SetupRSP_RegistersMain (HWND hDlg) {
TabCtrl_InsertItem( hTab,3, &item); TabCtrl_InsertItem( hTab,3, &item);
item.lParam = Vector2; item.lParam = Vector2;
item.pszText = " RSP Vectors $v16 - $v31 "; 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 ); SetupRSP_HiddenPanel ( hDlg );
@ -487,7 +487,7 @@ void SetupRSP_RegistersMain (HWND hDlg) {
SetupRSP_Vect1Panel ( hDlg ); SetupRSP_Vect1Panel ( hDlg );
SetupRSP_Vect2Panel ( 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 #ifdef _M_IX86
RefreshProc = (WNDPROC)SetWindowLong(hStatic, GWL_WNDPROC, (long)RefreshRSP_RegProc); RefreshProc = (WNDPROC)SetWindowLong(hStatic, GWL_WNDPROC, (long)RefreshRSP_RegProc);
#else #else
@ -496,7 +496,7 @@ void SetupRSP_RegistersMain (HWND hDlg) {
UpdateRSPRegistersScreen (); UpdateRSPRegistersScreen ();
ShowRSP_RegisterPanel ( GeneralPurpose ); ShowRSP_RegisterPanel ( GeneralPurpose );
SetWindowText(hDlg," RSP Registers"); SetWindowTextA(hDlg," RSP Registers");
//if ( !GetStoredWinPos( "RSP Registers", &X, &Y ) ) { //if ( !GetStoredWinPos( "RSP Registers", &X, &Y ) ) {
X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2; X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2;
@ -509,15 +509,15 @@ void SetupRSP_Vect1Panel (HWND hDlg) {
int count; int count;
for (count = 0; count < 8;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, 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); SendMessage(hVECT1[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
for (count = 0; count < 8;count ++) { 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, 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); SendMessage(hVECT1[count + 8],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
} }
@ -526,15 +526,15 @@ void SetupRSP_Vect2Panel (HWND hDlg) {
int count; int count;
for (count = 0; count < 8;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, 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); SendMessage(hVECT2[count],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
for (count = 0; count < 8;count ++) { 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, 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); SendMessage(hVECT2[count + 8],WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
} }
} }
@ -575,70 +575,70 @@ void UpdateRSPRegistersScreen ( void ) {
case GeneralPurpose: case GeneralPurpose:
for (count = 0; count < 32;count ++) { for (count = 0; count < 32;count ++) {
sprintf(RegisterValue," 0x%08X",RSP_GPR[count].UW); sprintf(RegisterValue," 0x%08X",RSP_GPR[count].UW);
SetWindowText(hGPR[count],RegisterValue); SetWindowTextA(hGPR[count],RegisterValue);
} }
break; break;
case ControlProcessor0: case ControlProcessor0:
if (RSPInfo.SP_MEM_ADDR_REG) if (RSPInfo.SP_MEM_ADDR_REG)
{ {
sprintf(RegisterValue," 0x%08X",*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); 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); 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); 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); 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); 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); 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); sprintf(RegisterValue," 0x%08X",*RSPInfo.SP_SEMAPHORE_REG);
SetWindowText(hCP0[7],RegisterValue); SetWindowTextA(hCP0[7],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_START_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_START_REG);
SetWindowText(hCP0[8],RegisterValue); SetWindowTextA(hCP0[8],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_END_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_END_REG);
SetWindowText(hCP0[9],RegisterValue); SetWindowTextA(hCP0[9],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_CURRENT_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_CURRENT_REG);
SetWindowText(hCP0[10],RegisterValue); SetWindowTextA(hCP0[10],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_STATUS_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_STATUS_REG);
SetWindowText(hCP0[11],RegisterValue); SetWindowTextA(hCP0[11],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_CLOCK_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_CLOCK_REG);
SetWindowText(hCP0[12],RegisterValue); SetWindowTextA(hCP0[12],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_BUFBUSY_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_BUFBUSY_REG);
SetWindowText(hCP0[13],RegisterValue); SetWindowTextA(hCP0[13],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_PIPEBUSY_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_PIPEBUSY_REG);
SetWindowText(hCP0[14],RegisterValue); SetWindowTextA(hCP0[14],RegisterValue);
sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_TMEM_REG); sprintf(RegisterValue," 0x%08X",*RSPInfo.DPC_TMEM_REG);
SetWindowText(hCP0[15],RegisterValue); SetWindowTextA(hCP0[15],RegisterValue);
} }
break; break;
case HiddenRegisters: case HiddenRegisters:
for (count = 0; count < 8;count ++) { for (count = 0; count < 8;count ++) {
sprintf(RegisterValue," 0x%08X - %08X",RSP_ACCUM[count].W[1], RSP_ACCUM[count].W[0]); 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 ++) { for (count = 0; count < 3;count ++) {
sprintf(RegisterValue," 0x%04X",RSP_Flags[count].UHW[0]); 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]); sprintf(RegisterValue," 0x%04X",RSP_Flags[2].UHW[0]);
SetWindowText(hHIDDEN[11],RegisterValue); SetWindowTextA(hHIDDEN[11],RegisterValue);
break; break;
case Vector1: case Vector1:
for (count = 0; count < 16;count ++) { for (count = 0; count < 16;count ++) {
sprintf(RegisterValue," 0x%08X - %08X - %08X - %08X", RSP_Vect[count].W[3], 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]); RSP_Vect[count].W[2], RSP_Vect[count].W[1], RSP_Vect[count].W[0]);
SetWindowText(hVECT1[count],RegisterValue); SetWindowTextA(hVECT1[count],RegisterValue);
} }
break; break;
case Vector2: case Vector2:
for (count = 0; count < 16;count ++) { for (count = 0; count < 16;count ++) {
sprintf(RegisterValue," 0x%08X - %08X - %08X - %08X", RSP_Vect[count + 16].W[3], 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]); 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; break;
} }

View File

@ -20,7 +20,7 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}</ProjectGuid> <ProjectGuid>{A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}</ProjectGuid>
<RootNamespace>RSP</RootNamespace> <RootNamespace>Project64-RSP</RootNamespace>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
@ -32,43 +32,38 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<PropertyGroup> <PropertyGroup>
<TargetName>RSP 1.7</TargetName> <TargetName>Project64-RSP</TargetName>
<TargetName Condition="'$(Configuration)'=='Debug'">RSP_d 1.7</TargetName> <TargetName Condition="'$(Configuration)'=='Debug'">Project64-RSP_d</TargetName>
<OutDir>$(SolutionDir)Plugin\RSP\</OutDir> <OutDir>$(SolutionDir)Plugin\RSP\</OutDir>
<OutDir Condition="'$(Platform)'=='x64'">$(SolutionDir)Plugin64\RSP\</OutDir> <OutDir Condition="'$(Platform)'=='x64'">$(SolutionDir)Plugin64\RSP\</OutDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<PrecompiledHeader /> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link />
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Bscmake>
<PreBuildEvent> <PreBuildEvent>
<Command>"$(SolutionDir)Source\Script\UpdateVersion.cmd" "$(Configuration)" "$(Platform)" "$(SolutionDir)Source\RSP\Version.h.in" "$(SolutionDir)Source\RSP\Version.h"</Command> <Command>"$(SolutionDir)Source\Script\UpdateVersion.cmd" "$(Configuration)" "$(Platform)" "$(SolutionDir)Source\RSP\Version.h.in" "$(SolutionDir)Source\RSP\Version.h"</Command>
</PreBuildEvent> </PreBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="breakpoint.c" /> <ClCompile Include="breakpoint.cpp" />
<ClCompile Include="Cpu.c" /> <ClCompile Include="Cpu.cpp" />
<ClCompile Include="dma.c" /> <ClCompile Include="dma.cpp" />
<ClCompile Include="Interpreter CPU.c" /> <ClCompile Include="Interpreter CPU.cpp" />
<ClCompile Include="Interpreter Ops.c" /> <ClCompile Include="Interpreter Ops.cpp" />
<ClCompile Include="log.cpp" /> <ClCompile Include="log.cpp" />
<ClCompile Include="Main.cpp" /> <ClCompile Include="Main.cpp" />
<ClCompile Include="memory.c" /> <ClCompile Include="memory.cpp" />
<ClCompile Include="Mmx.c" /> <ClCompile Include="Mmx.cpp" />
<ClCompile Include="Profiling.cpp" /> <ClCompile Include="Profiling.cpp" />
<ClCompile Include="Recompiler Analysis.c" /> <ClCompile Include="Recompiler Analysis.cpp" />
<ClCompile Include="Recompiler CPU.c" /> <ClCompile Include="Recompiler CPU.cpp" />
<ClCompile Include="Recompiler Ops.c" /> <ClCompile Include="Recompiler Ops.cpp" />
<ClCompile Include="Recompiler Sections.c" /> <ClCompile Include="Recompiler Sections.cpp" />
<ClCompile Include="RSP Command.c" /> <ClCompile Include="RSP Command.cpp" />
<ClCompile Include="RSP Register.c" /> <ClCompile Include="RSP Register.cpp" />
<ClCompile Include="Sse.c" /> <ClCompile Include="Sse.cpp" />
<ClCompile Include="X86.c" /> <ClCompile Include="X86.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="breakpoint.h" /> <ClInclude Include="breakpoint.h" />
@ -96,11 +91,9 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Common\Common.vcxproj"> <ProjectReference Include="..\Common\Common.vcxproj">
<Project>{b4a4b994-9111-42b1-93c2-6f1ca8bc4421}</Project> <Project>{b4a4b994-9111-42b1-93c2-6f1ca8bc4421}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Settings\Settings.vcxproj"> <ProjectReference Include="..\Settings\Settings.vcxproj">
<Project>{8b9961b1-88d9-4ea3-a752-507a00dd9f3d}</Project> <Project>{8b9961b1-88d9-4ea3-a752-507a00dd9f3d}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\UpdateVersion\UpdateVersion.vcxproj"> <ProjectReference Include="..\UpdateVersion\UpdateVersion.vcxproj">
<Project>{1968162c-0793-491d-91a1-81645a24d399}</Project> <Project>{1968162c-0793-491d-91a1-81645a24d399}</Project>

View File

@ -17,62 +17,6 @@
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions> <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ClCompile Include="breakpoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Cpu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dma.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Interpreter CPU.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Interpreter Ops.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="log.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="memory.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Mmx.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Profiling.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler Analysis.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler CPU.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler Ops.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler Sections.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RSP Command.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RSP Register.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Sse.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="X86.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="breakpoint.h"> <ClInclude Include="breakpoint.h">
<Filter>Header Files\RSP Header Files</Filter> <Filter>Header Files\RSP Header Files</Filter>
@ -134,4 +78,60 @@
<Filter>Resource Files</Filter> <Filter>Resource Files</Filter>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ClCompile Include="breakpoint.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Cpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dma.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Interpreter CPU.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Interpreter Ops.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="log.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="memory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Mmx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Profiling.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler Analysis.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler CPU.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler Ops.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Recompiler Sections.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RSP Command.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RSP Register.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Sse.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="X86.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project> </Project>

View File

@ -607,7 +607,7 @@ void LinkBranches(RSP_BLOCK * Block) {
for (Count = 0; Count < CurrentBlock.ResolveCount; Count++) { for (Count = 0; Count < CurrentBlock.ResolveCount; Count++) {
Target = CurrentBlock.BranchesToResolve[Count].TargetPC; Target = CurrentBlock.BranchesToResolve[Count].TargetPC;
X86Code = *(JumpTable + (Target >> 2)); X86Code = (BYTE *)*(JumpTable + (Target >> 2));
if (!X86Code) { if (!X86Code) {
*PrgCount = Target; *PrgCount = Target;
@ -622,7 +622,7 @@ void LinkBranches(RSP_BLOCK * Block) {
*Block = Save; *Block = Save;
CPU_Message("===== (End generate code: %04X) =====", Target); CPU_Message("===== (End generate code: %04X) =====", Target);
CPU_Message(""); CPU_Message("");
X86Code = *(JumpTable + (Target >> 2)); X86Code = (BYTE *)*(JumpTable + (Target >> 2));
} }
JumpWord = CurrentBlock.BranchesToResolve[Count].X86JumpLoc; JumpWord = CurrentBlock.BranchesToResolve[Count].X86JumpLoc;
@ -710,7 +710,7 @@ Boolean IsJumpLabel(DWORD PC)
} }
void CompilerLinkBlocks(void) { void CompilerLinkBlocks(void) {
BYTE * KnownCode = *(JumpTable + (CompilePC >> 2)); BYTE * KnownCode = (BYTE *)*(JumpTable + (CompilePC >> 2));
CPU_Message("***** Linking block to X86: %08X *****", KnownCode); CPU_Message("***** Linking block to X86: %08X *****", KnownCode);
NextInstruction = FINISH_BLOCK; NextInstruction = FINISH_BLOCK;
@ -866,7 +866,7 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) {
while (RSP_Running) while (RSP_Running)
{ {
Block = *(JumpTable + (*PrgCount >> 2)); Block = (BYTE *)*(JumpTable + (*PrgCount >> 2));
if (Block == NULL) { if (Block == NULL) {
if (Profiling && !IndvidualBlock) { if (Profiling && !IndvidualBlock) {
@ -890,7 +890,7 @@ DWORD RunRecompilerCPU ( DWORD Cycles ) {
CompilerRSPBlock(); CompilerRSPBlock();
#endif #endif
Block = *(JumpTable + (*PrgCount >> 2)); Block = (BYTE *)*(JumpTable + (*PrgCount >> 2));
// We are done compiling, but we may have references // We are done compiling, but we may have references
// to fill in still either from this block, or jumps // to fill in still either from this block, or jumps

View File

@ -92,7 +92,7 @@ void Branch_AddRef(DWORD Target, DWORD * X86Loc) {
if (CurrentBlock.ResolveCount >= 150) { if (CurrentBlock.ResolveCount >= 150) {
CompilerWarning("Out of branch reference space"); CompilerWarning("Out of branch reference space");
} else { } else {
BYTE * KnownCode = *(JumpTable + (Target >> 2)); BYTE * KnownCode = (BYTE *)(*(JumpTable + (Target >> 2)));
if (KnownCode == NULL) { if (KnownCode == NULL) {
DWORD i = CurrentBlock.ResolveCount; DWORD i = CurrentBlock.ResolveCount;

View File

@ -1,10 +1,6 @@
#pragma once #pragma once
#include <Project64-plugin-spec/Rsp.h> #include <Project64-plugin-spec/Rsp.h>
#if defined(__cplusplus)
extern "C" {
#endif
#include <stdint.h> #include <stdint.h>
#include "Types.h" #include "Types.h"
@ -24,8 +20,4 @@ extern int DebuggingEnabled, Profiling, IndvidualBlock, ShowErrors, BreakOnStart
extern uint32_t CPUCore; extern uint32_t CPUCore;
extern DEBUG_INFO DebugInfo; extern DEBUG_INFO DebugInfo;
extern RSP_INFO RSPInfo; extern RSP_INFO RSPInfo;
extern void * hinstDLL; extern void * hinstDLL;
#if defined(__cplusplus)
}
#endif

View File

@ -7,11 +7,14 @@
#define IDC_LOCATION_EDIT 105 #define IDC_LOCATION_EDIT 105
HWND BPoint_Win_hDlg, hRSPLocation = NULL; HWND BPoint_Win_hDlg, hRSPLocation = NULL;
BPOINT BPoint[MaxBPoints];
int NoOfBpoints;
void Add_BPoint ( void ) void Add_BPoint ( void )
{ {
char Title[10]; char Title[10];
GetWindowText(hRSPLocation,Title,sizeof(Title)); GetWindowTextA(hRSPLocation,Title,sizeof(Title));
if (!AddRSP_BPoint(AsciiToHex(Title),TRUE )) { if (!AddRSP_BPoint(AsciiToHex(Title),TRUE )) {
SendMessage(hRSPLocation,EM_SETSEL,(WPARAM)0,(LPARAM)-1); SendMessage(hRSPLocation,EM_SETSEL,(WPARAM)0,(LPARAM)-1);
SetFocus(hRSPLocation); 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?", sprintf(Message,"Break when:\n\nRSP's program counter = 0x%03X\n\nIs this correct?",
Location); 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) if (Response == IDNO)
{ {
return FALSE; return FALSE;
@ -79,17 +82,17 @@ void CreateBPPanel ( void * hDlg, rectangle rcBox )
rcBox = rcBox; // Remove warning of unused 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, hRSPLocation = CreateWindowExA(0,"EDIT","", WS_CHILD | WS_BORDER | ES_UPPERCASE | WS_TABSTOP,
83,90,100,17,hDlg,(HMENU)IDC_LOCATION_EDIT,RSPInfo.hInst,NULL); 83,90,100,17, (HWND)hDlg,(HMENU)IDC_LOCATION_EDIT,(HINSTANCE)RSPInfo.hInst,NULL);
if (hRSPLocation) if (hRSPLocation)
{ {
char Title[20]; char Title[20];
SendMessage(hRSPLocation,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); SendMessage(hRSPLocation,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0);
SendMessage(hRSPLocation,EM_SETLIMITTEXT,(WPARAM)3,(LPARAM)0); SendMessage(hRSPLocation,EM_SETLIMITTEXT,(WPARAM)3,(LPARAM)0);
sprintf(Title,"%03X",*PrgCount); sprintf(Title,"%03X",*PrgCount);
SetWindowText(hRSPLocation,Title); SetWindowTextA(hRSPLocation,Title);
} }
} }
@ -100,8 +103,8 @@ void HideBPPanel ( void )
void PaintBPPanel ( window_paint ps ) void PaintBPPanel ( window_paint ps )
{ {
TextOut( ps.hdc, 29,60,"Break when the program counter equals",37); TextOutA((HDC)ps.hdc, 29,60,"Break when the program counter equals",37);
TextOut( ps.hdc, 59,85,"0x",2); TextOutA((HDC)ps.hdc, 59,85,"0x",2);
} }
void ShowBPPanel ( void ) void ShowBPPanel ( void )
@ -117,9 +120,9 @@ void RefreshBpoints ( void * hList )
for (count = 0; count < NoOfBpoints; count ++ ) { for (count = 0; count < NoOfBpoints; count ++ ) {
sprintf(Message," at 0x%03X (RSP)", BPoint[count].Location); sprintf(Message," at 0x%03X (RSP)", BPoint[count].Location);
location = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)Message); location = SendMessageA((HWND)hList, LB_ADDSTRING, 0, (LPARAM)Message);
SendMessage( SendMessageA(
hList, (HWND)hList,
LB_SETITEMDATA, LB_SETITEMDATA,
(WPARAM)location, (WPARAM)location,
(LPARAM)BPoint[count].Location (LPARAM)BPoint[count].Location
@ -132,12 +135,12 @@ void RemoveAllBpoint ( void )
NoOfBpoints = 0; NoOfBpoints = 0;
} }
void RemoveBpoint ( HWND hList, int index ) void RemoveBpoint (void * hList, int index )
{ {
LRESULT response; LRESULT response;
uint32_t location; 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) if (response < 0 || response > 0x7FFFFFFFL)
{ {
DisplayError( DisplayError(

View File

@ -6,8 +6,8 @@ typedef struct {
unsigned int Location; unsigned int Location;
} BPOINT; } BPOINT;
BPOINT BPoint[MaxBPoints]; extern BPOINT BPoint[MaxBPoints];
int NoOfBpoints; extern int NoOfBpoints;
void Add_BPoint ( void ); void Add_BPoint ( void );
void CreateBPPanel ( void * hDlg, rectangle rcBox ); void CreateBPPanel ( void * hDlg, rectangle rcBox );

View File

@ -5,11 +5,10 @@
#include <Common/Log.h> #include <Common/Log.h>
#include <Common/path.h> #include <Common/path.h>
extern "C" {
#include "Log.h" #include "Log.h"
#include "Rsp.h" #include "Rsp.h"
#include "Rsp Registers.h" #include "Rsp Registers.h"
}
CLog * RDPLog = NULL; CLog * RDPLog = NULL;
CLog * CPULog = NULL; CLog * CPULog = NULL;

View File

@ -1,7 +1,3 @@
#ifdef __cplusplus
extern "C" {
#endif
void StartCPULog ( void ); void StartCPULog ( void );
void StopCPULog ( void ); void StopCPULog ( void );
void CPU_Message ( const char * Message, ...); void CPU_Message ( const char * Message, ...);
@ -12,8 +8,4 @@ void RDP_Message ( const char * Message, ...);
void RDP_LogDlist ( void ); void RDP_LogDlist ( void );
void RDP_LogMT0 ( DWORD PC, int Reg, DWORD Value ); void RDP_LogMT0 ( DWORD PC, int Reg, DWORD Value );
void RDP_LogMF0 ( DWORD PC, int Reg ); void RDP_LogMF0 ( DWORD PC, int Reg );
void RDP_LogLoc ( DWORD PC ); void RDP_LogLoc ( DWORD PC );
#ifdef __cplusplus
}
#endif

View File

@ -4,7 +4,8 @@ enum { MaxMaps = 32 };
#include "Rsp.h" #include "Rsp.h"
#include "RSP Registers.h" #include "RSP Registers.h"
DWORD NoOfMaps, MapsCRC[MaxMaps], Table; DWORD NoOfMaps, MapsCRC[MaxMaps];
uint32_t Table;
BYTE * RecompCode, * RecompCodeSecondary, * RecompPos, *JumpTables; BYTE * RecompCode, * RecompCodeSecondary, * RecompPos, *JumpTables;
void ** JumpTable; void ** JumpTable;
@ -58,7 +59,7 @@ void ResetJumpTables ( void )
NoOfMaps = 0; NoOfMaps = 0;
} }
void SetJumpTable (DWORD End) { void SetJumpTable (uint32_t End) {
DWORD CRC, count; DWORD CRC, count;
CRC = 0; CRC = 0;