[RSP] Macro-out some more WIN32 UI-specific stuff.

This commit is contained in:
2016-02-15 15:55:07 -05:00
parent b349f3c239
commit 6075a2f4a3
2 changed files with 32 additions and 13 deletions

View File

@ -30,8 +30,11 @@
#include <commctrl.h> #include <commctrl.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Common/StdString.h> #include <Common/StdString.h>
#include <Common/stdtypes.h>
#include "../Settings/Settings.h" #include "../Settings/Settings.h"
extern "C" { extern "C" {
@ -50,7 +53,10 @@ extern "C" {
void ClearAllx86Code(void); void ClearAllx86Code(void);
void ProcessMenuItem(int ID); void ProcessMenuItem(int ID);
#ifdef _WIN32
Boolean CALLBACK CompilerDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); Boolean CALLBACK CompilerDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
HMENU hRSPMenu = NULL;
#endif
Boolean GraphicsHle = TRUE, AudioHle, ConditionalMove; Boolean GraphicsHle = TRUE, AudioHle, ConditionalMove;
Boolean DebuggingEnabled = FALSE, Boolean DebuggingEnabled = FALSE,
@ -62,14 +68,13 @@ Boolean DebuggingEnabled = FALSE,
LogX86Code = FALSE; LogX86Code = FALSE;
uint32_t CPUCore = RecompilerCPU; uint32_t CPUCore = RecompilerCPU;
HANDLE hMutex = NULL; void * hMutex = NULL;
DEBUG_INFO DebugInfo; DEBUG_INFO DebugInfo;
RSP_INFO RSPInfo; RSP_INFO RSPInfo;
void * hinstDLL; void * hinstDLL;
HMENU hRSPMenu = NULL;
extern BYTE * pLastSecondary; extern uint8_t * pLastSecondary;
} }
enum { enum {
@ -176,9 +181,13 @@ EXPORT void CloseDLL(void)
input: a handle to the window that calls this function input: a handle to the window that calls this function
output: none output: none
*******************************************************************/ *******************************************************************/
EXPORT void DllAbout(HWND hParent) EXPORT void DllAbout(void * hParent)
{ {
MessageBox(hParent,AboutMsg(),"About",MB_OK | MB_ICONINFORMATION ); #ifdef _WIN32
MessageBox((HWND)hParent, AboutMsg(), "About", MB_OK | MB_ICONINFORMATION);
#else
puts(AboutMsg());
#endif
} }
#ifdef _WIN32 #ifdef _WIN32
@ -242,12 +251,14 @@ EXPORT void GetDllInfo(PLUGIN_INFO * PluginInfo)
EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo) EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo)
{ {
#ifdef _WIN32
if (hRSPMenu == NULL) if (hRSPMenu == NULL)
{ {
hRSPMenu = LoadMenu((HINSTANCE)hinstDLL,MAKEINTRESOURCE(RspMenu)); hRSPMenu = LoadMenu((HINSTANCE)hinstDLL,MAKEINTRESOURCE(RspMenu));
FixMenuState(); FixMenuState();
} }
DebugInfo->hRSPMenu = hRSPMenu; DebugInfo->hRSPMenu = hRSPMenu;
#endif
DebugInfo->ProcessMenuItem = ProcessMenuItem; DebugInfo->ProcessMenuItem = ProcessMenuItem;
DebugInfo->UseBPoints = TRUE; DebugInfo->UseBPoints = TRUE;
@ -260,7 +271,7 @@ EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo)
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;
} }
@ -369,6 +380,7 @@ EXPORT void InitiateRSPDebugger(DEBUG_INFO Debug_Info)
DebugInfo = Debug_Info; DebugInfo = Debug_Info;
} }
#ifdef _WIN32
void ProcessMenuItem(int ID) void ProcessMenuItem(int ID)
{ {
UINT uState; UINT uState;
@ -529,6 +541,7 @@ void ProcessMenuItem(int ID)
break; break;
} }
} }
#endif
/****************************************************************** /******************************************************************
Function: RomOpen Function: RomOpen
@ -730,7 +743,11 @@ EXPORT void EnableDebugging(Boolean Enabled)
Compiler.bAlignVector = GetSetting(Set_AlignVector); Compiler.bAlignVector = GetSetting(Set_AlignVector);
SetCPU(CPUCore); SetCPU(CPUCore);
} }
FixMenuState(); #ifdef _WIN32
FixMenuState();
#else
fputs("FixMenuState()\n", stderr);
#endif
if (LogRDP) if (LogRDP)
{ {
StartRDPLog(); StartRDPLog();
@ -791,13 +808,15 @@ EXPORT void PluginLoaded(void)
AudioHle = Set_AudioHle != 0 ? GetSystemSetting(Set_AudioHle) : false; AudioHle = Set_AudioHle != 0 ? GetSystemSetting(Set_AudioHle) : false;
GraphicsHle = Set_GraphicsHle != 0 ? GetSystemSetting(Set_GraphicsHle) : true; GraphicsHle = Set_GraphicsHle != 0 ? GetSystemSetting(Set_GraphicsHle) : true;
#ifdef _WIN32
hMutex = CreateMutex(NULL, FALSE, NULL); hMutex = (HANDLE)CreateMutex(NULL, FALSE, NULL);
#endif
SetCPU(CPUCore); SetCPU(CPUCore);
} }
void UseUnregisteredSetting (int /*SettingID*/) #ifdef _WIN32
void UseUnregisteredSetting(int /*SettingID*/)
{ {
DebugBreak(); DebugBreak();
} }
#endif

View File

@ -34,7 +34,7 @@ void Enter_RSP_Commands_Window ( void );
void RefreshRSPCommands ( void ); void RefreshRSPCommands ( void );
void SetRSPCommandToRunning ( void ); void SetRSPCommandToRunning ( void );
void SetRSPCommandToStepping ( void ); void SetRSPCommandToStepping ( void );
void SetRSPCommandViewto ( UINT NewLocation ); void SetRSPCommandViewto(unsigned int NewLocation);
extern DWORD Stepping_Commands, WaitingForStep; extern DWORD Stepping_Commands, WaitingForStep;
extern Boolean InRSPCommandsWindow; extern Boolean InRSPCommandsWindow;