2010-04-24 21:37:39 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <windows.h>
|
|
|
|
#include <windowsx.h>
|
|
|
|
|
|
|
|
#include "SPU2.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
HINSTANCE hInst;
|
|
|
|
|
|
|
|
void SysMessage(char *fmt, ...) {
|
|
|
|
va_list list;
|
|
|
|
char tmp[512];
|
|
|
|
|
|
|
|
va_start(list,fmt);
|
|
|
|
vsprintf(tmp,fmt,list);
|
|
|
|
va_end(list);
|
|
|
|
MessageBox(0, tmp, "SPU2NULL Msg", 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2010-04-24 21:37:39 +00:00
|
|
|
switch(uMsg) {
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
LoadConfig();
|
|
|
|
if (conf.Log) CheckDlgButton(hW, IDC_LOGGING, TRUE);
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
switch(LOWORD(wParam)) {
|
|
|
|
case IDCANCEL:
|
|
|
|
EndDialog(hW, TRUE);
|
|
|
|
return TRUE;
|
|
|
|
case IDOK:
|
|
|
|
if (IsDlgButtonChecked(hW, IDC_LOGGING))
|
|
|
|
conf.Log = 1;
|
|
|
|
else conf.Log = 0;
|
|
|
|
SaveConfig();
|
|
|
|
EndDialog(hW, FALSE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
|
|
|
switch(uMsg) {
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
switch(LOWORD(wParam)) {
|
|
|
|
case IDOK:
|
|
|
|
EndDialog(hW, FALSE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CALLBACK SPU2configure() {
|
|
|
|
DialogBox(hInst,
|
|
|
|
MAKEINTRESOURCE(IDD_CONFIG),
|
2010-04-25 00:31:27 +00:00
|
|
|
GetActiveWindow(),
|
|
|
|
(DLGPROC)ConfigureDlgProc);
|
2010-04-24 21:37:39 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CALLBACK SPU2about() {
|
|
|
|
DialogBox(hInst,
|
|
|
|
MAKEINTRESOURCE(IDD_ABOUT),
|
2010-04-25 00:31:27 +00:00
|
|
|
GetActiveWindow(),
|
2010-04-24 21:37:39 +00:00
|
|
|
(DLGPROC)AboutDlgProc);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL APIENTRY DllMain(HANDLE hModule, // DLL INIT
|
2010-04-25 00:31:27 +00:00
|
|
|
DWORD dwReason,
|
2010-04-24 21:37:39 +00:00
|
|
|
LPVOID lpReserved) {
|
|
|
|
hInst = (HINSTANCE)hModule;
|
|
|
|
return TRUE; // very quick :)
|
|
|
|
}
|
|
|
|
|