diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index 6f337bb35f..4a315eb803 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -1,7 +1,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -236,6 +162,151 @@
Name="VCPostBuildEventTool"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -596,14 +604,6 @@
UsePrecompiledHeader="1"
/>
-
-
-
@@ -613,7 +613,7 @@
/>
+
+
+
+#define LOGGING
+
#include "Common.h"
#include "StringUtil.h"
@@ -40,6 +42,7 @@ void PanicAlert(const char* format, ...)
{
std::string msg;
StringFromFormatV(&msg, format, args);
+ LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
panic_handler(msg.c_str(), false);
}
else
@@ -47,6 +50,7 @@ void PanicAlert(const char* format, ...)
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
+ LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
MessageBox(0, msg.c_str(), "PANIC!", MB_ICONWARNING);
#elif __GNUC__
//#error Do a messagebox!
@@ -68,6 +72,7 @@ bool PanicYesNo(const char* format, ...)
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
+ LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
retval = IDYES == MessageBox(0, msg.c_str(), "PANIC! Continue?", MB_ICONQUESTION | MB_YESNO);
#elif __GNUC__
//vprintf(format, args);
@@ -87,6 +92,7 @@ bool AskYesNo(const char* format, ...)
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
+ LOG(MASTER_LOG, "ASK: %s", msg.c_str());
retval = IDYES == MessageBox(0, msg.c_str(), "Dolphin", MB_ICONQUESTION | MB_YESNO);
#elif __GNUC__
//vprintf(format, args);
diff --git a/Source/Core/Common/Src/ExtendedTrace.cpp b/Source/Core/Common/Src/ExtendedTrace.cpp
new file mode 100644
index 0000000000..2f6968856e
--- /dev/null
+++ b/Source/Core/Common/Src/ExtendedTrace.cpp
@@ -0,0 +1,426 @@
+//////////////////////////////////////////////////////////////////////////////////////
+//
+// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
+// For companies(Austin,TX): If you would like to get my resume, send an email.
+//
+// The source is free, but if you want to use it, mention my name and e-mail address
+//
+// History:
+// 1.0 Initial version Zoltan Csizmadia
+// 1.1 WhineCube version Masken
+// 1.2 Dolphin version Masken
+//
+//////////////////////////////////////////////////////////////////////////////////////
+//
+// ExtendedTrace.cpp
+//
+
+// Include StdAfx.h, if you're using precompiled
+// header through StdAfx.h
+//#include "stdafx.h"
+
+#if defined(WIN32)
+
+#include
+#include
+#include "ExtendedTrace.h"
+using namespace std;
+
+#include
+#include
+
+#define BUFFERSIZE 0x200
+#pragma warning(disable:4996)
+
+// Unicode safe char* -> TCHAR* conversion
+void PCSTR2LPTSTR( PCSTR lpszIn, LPTSTR lpszOut )
+{
+#if defined(UNICODE)||defined(_UNICODE)
+ ULONG index = 0;
+ PCSTR lpAct = lpszIn;
+
+ for( ; ; lpAct++ )
+ {
+ lpszOut[index++] = (TCHAR)(*lpAct);
+ if ( *lpAct == 0 )
+ break;
+ }
+#else
+ // This is trivial :)
+ strcpy( lpszOut, lpszIn );
+#endif
+}
+
+// Let's figure out the path for the symbol files
+// Search path= ".;%_NT_SYMBOL_PATH%;%_NT_ALTERNATE_SYMBOL_PATH%;%SYSTEMROOT%;%SYSTEMROOT%\System32;" + lpszIniPath
+// Note: There is no size check for lpszSymbolPath!
+static void InitSymbolPath( PSTR lpszSymbolPath, PCSTR lpszIniPath )
+{
+ CHAR lpszPath[BUFFERSIZE];
+
+ // Creating the default path
+ // ".;%_NT_SYMBOL_PATH%;%_NT_ALTERNATE_SYMBOL_PATH%;%SYSTEMROOT%;%SYSTEMROOT%\System32;"
+ strcpy( lpszSymbolPath, "." );
+
+ // environment variable _NT_SYMBOL_PATH
+ if ( GetEnvironmentVariableA( "_NT_SYMBOL_PATH", lpszPath, BUFFERSIZE ) )
+ {
+ strcat( lpszSymbolPath, ";" );
+ strcat( lpszSymbolPath, lpszPath );
+ }
+
+ // environment variable _NT_ALTERNATE_SYMBOL_PATH
+ if ( GetEnvironmentVariableA( "_NT_ALTERNATE_SYMBOL_PATH", lpszPath, BUFFERSIZE ) )
+ {
+ strcat( lpszSymbolPath, ";" );
+ strcat( lpszSymbolPath, lpszPath );
+ }
+
+ // environment variable SYSTEMROOT
+ if ( GetEnvironmentVariableA( "SYSTEMROOT", lpszPath, BUFFERSIZE ) )
+ {
+ strcat( lpszSymbolPath, ";" );
+ strcat( lpszSymbolPath, lpszPath );
+ strcat( lpszSymbolPath, ";" );
+
+ // SYSTEMROOT\System32
+ strcat( lpszSymbolPath, lpszPath );
+ strcat( lpszSymbolPath, "\\System32" );
+ }
+
+ // Add user defined path
+ if ( lpszIniPath != NULL )
+ if ( lpszIniPath[0] != '\0' )
+ {
+ strcat( lpszSymbolPath, ";" );
+ strcat( lpszSymbolPath, lpszIniPath );
+ }
+}
+
+// Uninitialize the loaded symbol files
+BOOL UninitSymInfo() {
+ return SymCleanup( GetCurrentProcess() );
+}
+
+// Initializes the symbol files
+BOOL InitSymInfo( PCSTR lpszInitialSymbolPath )
+{
+ CHAR lpszSymbolPath[BUFFERSIZE];
+ DWORD symOptions = SymGetOptions();
+
+ symOptions |= SYMOPT_LOAD_LINES;
+ symOptions &= ~SYMOPT_UNDNAME;
+ SymSetOptions( symOptions );
+ InitSymbolPath( lpszSymbolPath, lpszInitialSymbolPath );
+
+ return SymInitialize( GetCurrentProcess(), lpszSymbolPath, TRUE);
+}
+
+// Get the module name from a given address
+static BOOL GetModuleNameFromAddress( UINT address, LPTSTR lpszModule )
+{
+ BOOL ret = FALSE;
+ IMAGEHLP_MODULE moduleInfo;
+
+ ::ZeroMemory( &moduleInfo, sizeof(moduleInfo) );
+ moduleInfo.SizeOfStruct = sizeof(moduleInfo);
+
+ if ( SymGetModuleInfo( GetCurrentProcess(), (DWORD)address, &moduleInfo ) )
+ {
+ // Got it!
+ PCSTR2LPTSTR( moduleInfo.ModuleName, lpszModule );
+ ret = TRUE;
+ }
+ else
+ // Not found :(
+ _tcscpy( lpszModule, _T("?") );
+
+ return ret;
+}
+
+// Get function prototype and parameter info from ip address and stack address
+static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, LPTSTR lpszSymbol )
+{
+ BOOL ret = FALSE;
+ DWORD dwDisp = 0;
+ DWORD dwSymSize = 10000;
+ TCHAR lpszUnDSymbol[BUFFERSIZE]=_T("?");
+ CHAR lpszNonUnicodeUnDSymbol[BUFFERSIZE]="?";
+ LPTSTR lpszParamSep = NULL;
+ LPTSTR lpszParsed = lpszUnDSymbol;
+ PIMAGEHLP_SYMBOL pSym = (PIMAGEHLP_SYMBOL)GlobalAlloc( GMEM_FIXED, dwSymSize );
+
+ ::ZeroMemory( pSym, dwSymSize );
+ pSym->SizeOfStruct = dwSymSize;
+ pSym->MaxNameLength = dwSymSize - sizeof(IMAGEHLP_SYMBOL);
+
+ // Set the default to unknown
+ _tcscpy( lpszSymbol, _T("?") );
+
+ // Get symbol info for IP
+ if ( SymGetSymFromAddr( GetCurrentProcess(), (ULONG)fnAddress, &dwDisp, pSym ) )
+ {
+ // Make the symbol readable for humans
+ UnDecorateSymbolName( pSym->Name, lpszNonUnicodeUnDSymbol, BUFFERSIZE,
+ UNDNAME_COMPLETE |
+ UNDNAME_NO_THISTYPE |
+ UNDNAME_NO_SPECIAL_SYMS |
+ UNDNAME_NO_MEMBER_TYPE |
+ UNDNAME_NO_MS_KEYWORDS |
+ UNDNAME_NO_ACCESS_SPECIFIERS );
+
+ // Symbol information is ANSI string
+ PCSTR2LPTSTR( lpszNonUnicodeUnDSymbol, lpszUnDSymbol );
+
+ // I am just smarter than the symbol file :)
+ if ( _tcscmp(lpszUnDSymbol, _T("_WinMain@16")) == 0 )
+ _tcscpy(lpszUnDSymbol, _T("WinMain(HINSTANCE,HINSTANCE,LPCTSTR,int)"));
+ else
+ if ( _tcscmp(lpszUnDSymbol, _T("_main")) == 0 )
+ _tcscpy(lpszUnDSymbol, _T("main(int,TCHAR * *)"));
+ else
+ if ( _tcscmp(lpszUnDSymbol, _T("_mainCRTStartup")) == 0 )
+ _tcscpy(lpszUnDSymbol, _T("mainCRTStartup()"));
+ else
+ if ( _tcscmp(lpszUnDSymbol, _T("_wmain")) == 0 )
+ _tcscpy(lpszUnDSymbol, _T("wmain(int,TCHAR * *,TCHAR * *)"));
+ else
+ if ( _tcscmp(lpszUnDSymbol, _T("_wmainCRTStartup")) == 0 )
+ _tcscpy(lpszUnDSymbol, _T("wmainCRTStartup()"));
+
+ lpszSymbol[0] = _T('\0');
+
+ // Let's go through the stack, and modify the function prototype, and insert the actual
+ // parameter values from the stack
+ if ( _tcsstr( lpszUnDSymbol, _T("(void)") ) == NULL && _tcsstr( lpszUnDSymbol, _T("()") ) == NULL)
+ {
+ ULONG index = 0;
+ for( ; ; index++ )
+ {
+ lpszParamSep = _tcschr( lpszParsed, _T(',') );
+ if ( lpszParamSep == NULL )
+ break;
+
+ *lpszParamSep = _T('\0');
+
+ _tcscat( lpszSymbol, lpszParsed );
+ _stprintf( lpszSymbol + _tcslen(lpszSymbol), _T("=0x%08X,"), *((ULONG*)(stackAddress) + 2 + index) );
+
+ lpszParsed = lpszParamSep + 1;
+ }
+
+ lpszParamSep = _tcschr( lpszParsed, _T(')') );
+ if ( lpszParamSep != NULL )
+ {
+ *lpszParamSep = _T('\0');
+
+ _tcscat( lpszSymbol, lpszParsed );
+ _stprintf( lpszSymbol + _tcslen(lpszSymbol), _T("=0x%08X)"), *((ULONG*)(stackAddress) + 2 + index) );
+
+ lpszParsed = lpszParamSep + 1;
+ }
+ }
+
+ _tcscat( lpszSymbol, lpszParsed );
+
+ ret = TRUE;
+ }
+ GlobalFree( pSym );
+
+ return ret;
+}
+
+// Get source file name and line number from IP address
+// The output format is: "sourcefile(linenumber)" or
+// "modulename!address" or
+// "address"
+static BOOL GetSourceInfoFromAddress( UINT address, LPTSTR lpszSourceInfo )
+{
+ BOOL ret = FALSE;
+ IMAGEHLP_LINE lineInfo;
+ DWORD dwDisp;
+ TCHAR lpszFileName[BUFFERSIZE] = _T("");
+ TCHAR lpModuleInfo[BUFFERSIZE] = _T("");
+
+ _tcscpy( lpszSourceInfo, _T("?(?)") );
+
+ ::ZeroMemory( &lineInfo, sizeof( lineInfo ) );
+ lineInfo.SizeOfStruct = sizeof( lineInfo );
+
+ if ( SymGetLineFromAddr( GetCurrentProcess(), address, &dwDisp, &lineInfo ) )
+ {
+ // Got it. Let's use "sourcefile(linenumber)" format
+ PCSTR2LPTSTR( lineInfo.FileName, lpszFileName );
+ TCHAR fname[_MAX_FNAME];
+ TCHAR ext[_MAX_EXT];
+ _tsplitpath(lpszFileName, NULL, NULL, fname, ext);
+ _stprintf( lpszSourceInfo, _T("%s%s(%d)"), fname, ext, lineInfo.LineNumber );
+ ret = TRUE;
+ }
+ else
+ {
+ // There is no source file information. :(
+ // Let's use the "modulename!address" format
+ GetModuleNameFromAddress( address, lpModuleInfo );
+
+ if ( lpModuleInfo[0] == _T('?') || lpModuleInfo[0] == _T('\0'))
+ // There is no modulename information. :((
+ // Let's use the "address" format
+ _stprintf( lpszSourceInfo, _T("0x%08X"), address );
+ else
+ _stprintf( lpszSourceInfo, _T("%s!0x%08X"), lpModuleInfo, address );
+
+ ret = FALSE;
+ }
+
+ return ret;
+}
+
+void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file )
+{
+ STACKFRAME callStack;
+ BOOL bResult;
+ CONTEXT context;
+ TCHAR symInfo[BUFFERSIZE] = _T("?");
+ TCHAR srcInfo[BUFFERSIZE] = _T("?");
+ HANDLE hProcess = GetCurrentProcess();
+
+ // If it's not this thread, let's suspend it, and resume it at the end
+ if ( hThread != GetCurrentThread() )
+ if ( SuspendThread( hThread ) == -1 )
+ {
+ // whaaat ?!
+ etfprint(file, "Call stack info failed\n");
+ return;
+ }
+
+ ::ZeroMemory( &context, sizeof(context) );
+ context.ContextFlags = CONTEXT_FULL;
+
+ if ( !GetThreadContext( hThread, &context ) )
+ {
+ etfprint(file, "Call stack info failed\n");
+ return;
+ }
+
+ ::ZeroMemory( &callStack, sizeof(callStack) );
+ callStack.AddrPC.Offset = context.Eip;
+ callStack.AddrStack.Offset = context.Esp;
+ callStack.AddrFrame.Offset = context.Ebp;
+ callStack.AddrPC.Mode = AddrModeFlat;
+ callStack.AddrStack.Mode = AddrModeFlat;
+ callStack.AddrFrame.Mode = AddrModeFlat;
+
+ etfprint(file, "Call stack info: \n");
+ etfprint(file, lpszMessage);
+
+ GetFunctionInfoFromAddresses( callStack.AddrPC.Offset, callStack.AddrFrame.Offset, symInfo );
+ GetSourceInfoFromAddress( callStack.AddrPC.Offset, srcInfo );
+ etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+
+ for( ULONG index = 0; ; index++ )
+ {
+ bResult = StackWalk(
+ IMAGE_FILE_MACHINE_I386,
+ hProcess,
+ hThread,
+ &callStack,
+ NULL,
+ NULL,
+ SymFunctionTableAccess,
+ SymGetModuleBase,
+ NULL);
+
+ if ( index == 0 )
+ continue;
+
+ if( !bResult || callStack.AddrFrame.Offset == 0 )
+ break;
+
+ GetFunctionInfoFromAddresses( callStack.AddrPC.Offset, callStack.AddrFrame.Offset, symInfo );
+ GetSourceInfoFromAddress( callStack.AddrPC.Offset, srcInfo );
+ etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+
+ }
+
+ if ( hThread != GetCurrentThread() )
+ ResumeThread( hThread );
+}
+
+void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file, DWORD eip, DWORD esp, DWORD ebp )
+{
+ STACKFRAME callStack;
+ BOOL bResult;
+ TCHAR symInfo[BUFFERSIZE] = _T("?");
+ TCHAR srcInfo[BUFFERSIZE] = _T("?");
+ HANDLE hProcess = GetCurrentProcess();
+
+ // If it's not this thread, let's suspend it, and resume it at the end
+ if ( hThread != GetCurrentThread() )
+ if ( SuspendThread( hThread ) == -1 )
+ {
+ // whaaat ?!
+ etfprint(file, "Call stack info failed\n");
+ return;
+ }
+
+ ::ZeroMemory( &callStack, sizeof(callStack) );
+ callStack.AddrPC.Offset = eip;
+ callStack.AddrStack.Offset = esp;
+ callStack.AddrFrame.Offset = ebp;
+ callStack.AddrPC.Mode = AddrModeFlat;
+ callStack.AddrStack.Mode = AddrModeFlat;
+ callStack.AddrFrame.Mode = AddrModeFlat;
+
+ etfprint(file, "Call stack info: \n");
+ etfprint(file, lpszMessage);
+
+ GetFunctionInfoFromAddresses( callStack.AddrPC.Offset, callStack.AddrFrame.Offset, symInfo );
+ GetSourceInfoFromAddress( callStack.AddrPC.Offset, srcInfo );
+ etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+
+ for( ULONG index = 0; ; index++ )
+ {
+ bResult = StackWalk(
+ IMAGE_FILE_MACHINE_I386,
+ hProcess,
+ hThread,
+ &callStack,
+ NULL,
+ NULL,
+ SymFunctionTableAccess,
+ SymGetModuleBase,
+ NULL);
+
+ if ( index == 0 )
+ continue;
+
+ if( !bResult || callStack.AddrFrame.Offset == 0 )
+ break;
+
+ GetFunctionInfoFromAddresses( callStack.AddrPC.Offset, callStack.AddrFrame.Offset, symInfo );
+ GetSourceInfoFromAddress( callStack.AddrPC.Offset, srcInfo );
+ etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+
+ }
+
+ if ( hThread != GetCurrentThread() )
+ ResumeThread( hThread );
+}
+
+char g_uefbuf[2048];
+
+void etfprintf(FILE *file, const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ int len = vsprintf(g_uefbuf, format, ap);
+ fwrite(g_uefbuf, 1, len, file);
+ va_end(ap);
+}
+
+void etfprint(FILE *file, const std::string &text) {
+ int len = text.length();
+ fwrite(text.data(), 1, len, file);
+}
+
+#endif //WIN32
diff --git a/Source/Core/Common/Src/ExtendedTrace.h b/Source/Core/Common/Src/ExtendedTrace.h
new file mode 100644
index 0000000000..205e1f9943
--- /dev/null
+++ b/Source/Core/Common/Src/ExtendedTrace.h
@@ -0,0 +1,56 @@
+//////////////////////////////////////////////////////////////////////////////////////
+//
+// Written by Zoltan Csizmadia, zoltan_csizmadia@yahoo.com
+// For companies(Austin,TX): If you would like to get my resume, send an email.
+//
+// The source is free, but if you want to use it, mention my name and e-mail address
+//
+// History:
+// 1.0 Initial version Zoltan Csizmadia
+// 1.1 WhineCube version Masken
+// 1.2 Dolphin version Masken
+//
+//////////////////////////////////////////////////////////////////////////////////////
+//
+// ExtendedTrace.h
+//
+
+#ifndef EXTENDEDTRACE_H_INCLUDED
+#define EXTENDEDTRACE_H_INCLUDED
+
+#if defined(WIN32)
+
+#include
+#include
+
+#include
+
+#pragma comment( lib, "imagehlp.lib" )
+
+#define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) InitSymInfo( IniSymbolPath )
+#define EXTENDEDTRACEUNINITIALIZE() UninitSymInfo()
+#define STACKTRACE(file) StackTrace( GetCurrentThread(), _T(""), file)
+#define STACKTRACE2(file, eip, esp, ebp) StackTrace(GetCurrentThread(), _T(""), file, eip, esp, ebp)
+class File;
+
+BOOL InitSymInfo( PCSTR );
+BOOL UninitSymInfo();
+void StackTrace( HANDLE, LPCTSTR, FILE *file);
+void StackTrace( HANDLE, LPCTSTR, FILE *file, DWORD eip, DWORD esp, DWORD ebp);
+
+//functions by Masken
+void etfprintf(FILE *file, const char *format, ...);
+void etfprint(FILE *file, const std::string &text);
+#define UEFBUFSIZE 2048
+extern char g_uefbuf[UEFBUFSIZE];
+
+#else //not WIN32
+
+#define EXTENDEDTRACEINITIALIZE( IniSymbolPath ) ((void)0)
+#define EXTENDEDTRACEUNINITIALIZE() ((void)0)
+#define STACKTRACE(file) ((void)0)
+#define STACKTRACE2(file, eip, esp, ebp) ((void)0)
+
+#endif //WIN32
+
+#endif //EXTENDEDTRACE_H_INCLUDED
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
index e7f2a08a6b..01a6cfbbb3 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
@@ -205,18 +205,30 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendToDevice(u16 _ConnectionHandle, u8
void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendACLFrame(u16 _ConnectionHandle, u8* _pData, u32 _Size)
{
- UACLHeader* pHeader = (UACLHeader*)Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address);
- pHeader->ConnectionHandle = _ConnectionHandle;
- pHeader->BCFlag = 0;
- pHeader->PBFlag = 2;
- pHeader->Size = _Size;
+ if(m_State == STATE_NONE && m_HCICommandMessageQueue.empty() && !m_ACLAnswer && m_pACLBuffer) {
+ LOG(WIIMOTE, "Sending ACL frame.");
+ UACLHeader* pHeader = (UACLHeader*)Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address);
+ pHeader->ConnectionHandle = _ConnectionHandle;
+ pHeader->BCFlag = 0;
+ pHeader->PBFlag = 2;
+ pHeader->Size = _Size;
- memcpy(Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address + sizeof(UACLHeader)), _pData, _Size);
+ memcpy(Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address + sizeof(UACLHeader)), _pData, _Size);
- // return reply buffer size
- Memory::Write_U32(sizeof(UACLHeader) + _Size, m_pACLBuffer->m_Address + 0x4);
+ // return reply buffer size
+ Memory::Write_U32(sizeof(UACLHeader) + _Size, m_pACLBuffer->m_Address + 0x4);
- m_ACLAnswer = true;
+ m_ACLAnswer = true;
+ } else {
+ LOG(WIIMOTE, "Queing ACL frame.");
+ //queue the packet
+ ACLFrame frame;
+ frame.ConnectionHandle = _ConnectionHandle;
+ frame.data = new u8[_Size];
+ memcpy(frame.data, _pData, _Size);
+ frame.size = _Size;
+ m_AclFrameQue.push(frame);
+ }
}
u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
@@ -274,6 +286,12 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
ReturnHCIBuffer = true;
break;
+ case STATE_CONNECT_WIIMOTE:
+ m_WiiMotes[0].Connect();
+ m_State = STATE_NONE;
+ ReturnHCIBuffer = true;
+ break;
+
default:
PanicAlert("Unknown State in USBDev");
break;
@@ -313,6 +331,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
return Addr;
}
+ //TODO: remove
if(m_DelayedEvent != EVENT_NONE && m_pHCIBuffer) {
switch(m_DelayedEvent) {
case EVENT_REQUEST_CONNECTION:
@@ -332,6 +351,20 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
return Addr;
}
+ if(!m_AclFrameQue.empty() && m_pACLBuffer) {
+ ACLFrame& frame = m_AclFrameQue.front();
+ SendACLFrame(frame.ConnectionHandle, frame.data,
+ frame.size);
+ delete frame.data;
+ m_AclFrameQue.pop();
+
+ m_ACLAnswer = false;
+ u32 Addr = m_pACLBuffer->m_Address;
+ delete m_pACLBuffer;
+ m_pACLBuffer = NULL;
+ return Addr;
+ }
+
return 0;
}
@@ -1276,6 +1309,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLinkPolicy(u8* _Input)
// command parameters
hci_write_link_policy_settings_cp* pLinkPolicy = (hci_write_link_policy_settings_cp*)_Input;
+ _dbg_assert_msg_(WIIMOTE, m_State == STATE_NONE, "m_State != NONE");
+ m_State = STATE_CONNECT_WIIMOTE;
+ m_StateTempConnectionHandle = pLinkPolicy->con_handle;
SendEventCommandStatus(HCI_CMD_WRITE_LINK_POLICY_SETTINGS);
LOG(WIIMOTE, "Command: HCI_CMD_WRITE_LINK_POLICY_SETTINGS");
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h
index 76318ea66b..ae49aecc36 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h
@@ -157,22 +157,30 @@ private:
STATE_CONNECTION_COMPLETE_EVENT,
STATE_READ_CLOCK_OFFSET,
STATE_READ_REMOTE_VER_INFO,
- STATE_READ_REMOTE_FEATURES
+ STATE_READ_REMOTE_FEATURES,
+ STATE_CONNECT_WIIMOTE
};
EState m_State;
bdaddr_t m_StateTempBD;
u16 m_StateTempConnectionHandle;
+ struct ACLFrame {
+ u16 ConnectionHandle;
+ u8* data;
+ u32 size;
+ };
+
+ std::queue m_AclFrameQue;
+
+ //TODO: get rid of these, integrate into EState.
enum EDelayedEvent
{
EVENT_NONE,
EVENT_REQUEST_CONNECTION,
EVENT_CONNECTION_COMPLETE
};
-
EDelayedEvent m_DelayedEvent;
-
void SetDelayedEvent(EDelayedEvent e);
bdaddr_t m_ControllerBD;
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp
index 84639b66f9..13371918d8 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp
@@ -18,12 +18,17 @@
#include "Common.h"
#include "WII_IPC_HLE_WiiMote.h"
+#include "l2cap.h"
#if defined(_MSC_VER)
#pragma pack(push, 1)
#endif
+#define HIDP_OUTPUT_CHANNEL 0x11
+#define HIDP_INPUT_CHANNEL 0x13
+
+
struct SL2CAP_Header
@@ -200,6 +205,44 @@ void CWII_IPC_HLE_WiiMote::SendCommandToACL(u8 _Ident, u8 _Code, u8 _CommandLeng
// SendACLFrame(DataFrame, pHeader->Length + sizeof(SL2CAP_Header));
}
+void CWII_IPC_HLE_WiiMote::Connect() {
+ SendConnectionRequest(0x1234, HIDP_OUTPUT_CHANNEL);
+ SendConnectionRequest(0x5678, HIDP_INPUT_CHANNEL);
+}
+
+void CWII_IPC_HLE_WiiMote::SendConnectionRequest(u16 scid, u16 psm) {
+ // create the channel
+ SChannel& rChannel = m_Channel[scid];
+ rChannel.PSM = psm;
+ rChannel.SCID = scid;
+
+ l2cap_conn_req cr;
+ cr.psm = psm;
+ cr.scid = scid;
+
+ LOG(WIIMOTE, " SendConnectionRequest()");
+ LOG(WIIMOTE, " Psm: 0x%04x", cr.psm);
+ LOG(WIIMOTE, " Scid: 0x%04x", cr.scid);
+
+ SendCommandToACL(L2CAP_CONN_REQ, L2CAP_CONN_REQ, sizeof(l2cap_conn_req), (u8*)&cr);
+}
+
+void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid) {
+ _dbg_assert_(WIIMOTE, DoesChannelExist(scid));
+ SChannel& rChannel = m_Channel[scid];
+
+ l2cap_conf_req cr;
+ cr.dcid = rChannel.DCID;
+ cr.flags = 0; //what goes here? check libogc.
+
+ LOG(WIIMOTE, " SendConfigurationRequest()");
+ LOG(WIIMOTE, " Dcid: 0x%04x", cr.dcid);
+ LOG(WIIMOTE, " Flags: 0x%04x", cr.flags);
+
+ SendCommandToACL(L2CAP_CONF_REQ, L2CAP_CONF_REQ, sizeof(cr), (u8*)&cr);
+}
+
+
void CWII_IPC_HLE_WiiMote::SignalChannel(u8* _pData, u32 _Size)
{
while (_Size >= sizeof(SL2CAP_Command))
@@ -218,10 +261,18 @@ void CWII_IPC_HLE_WiiMote::SignalChannel(u8* _pData, u32 _Size)
CommandCofigurationReq(pCommand->ident, _pData, pCommand->len);
break;
+ case L2CAP_CONN_RSP:
+ CommandConnectionResponse(pCommand->ident, _pData, pCommand->len);
+ break;
+
case L2CAP_DISCONN_REQ:
PanicAlert("SignalChannel - L2CAP_DISCONN_REQ (something went wrong)",pCommand->code);
break;
+ case L2CAP_CONF_RSP:
+ CommandCofigurationResponse(pCommand->ident, _pData, pCommand->len);
+ break;
+
default:
PanicAlert("SignalChannel %x",pCommand->code);
LOG(WIIMOTE, " Unknown Command-Code (0x%02x)", pCommand->code);
@@ -329,3 +380,38 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
SendCommandToACL(_Ident, L2CAP_CONF_RSP, RespLen, TempBuffer);
}
+
+void CWII_IPC_HLE_WiiMote::CommandConnectionResponse(u8 _Ident, u8* _pData, u32 _Size)
+{
+ l2cap_conn_rsp* rsp = (l2cap_conn_rsp*)_pData;
+
+ _dbg_assert_(WIIMOTE, _Size == sizeof(l2cap_conn_rsp));
+
+ LOG(WIIMOTE, " CommandConnectionResponse");
+ LOG(WIIMOTE, " DCID: 0x%04x", rsp->dcid);
+ LOG(WIIMOTE, " SCID: 0x%04x", rsp->scid);
+ LOG(WIIMOTE, " Result: 0x%04x", rsp->result);
+ LOG(WIIMOTE, " Status: 0x%04x", rsp->status);
+
+ _dbg_assert_(WIIMOTE, rsp->result == 0);
+ _dbg_assert_(WIIMOTE, rsp->status == 0);
+
+ _dbg_assert_(WIIMOTE, DoesChannelExist(rsp->scid));
+ SChannel& rChannel = m_Channel[rsp->scid];
+ rChannel.DCID = rsp->dcid;
+
+ SendConfigurationRequest(rsp->scid);
+}
+
+void CWII_IPC_HLE_WiiMote::CommandCofigurationResponse(u8 _Ident, u8* _pData, u32 _Size) {
+ l2cap_conf_rsp* rsp = (l2cap_conf_rsp*)_pData;
+
+ _dbg_assert_(WIIMOTE, _Size == sizeof(l2cap_conf_rsp));
+
+ LOG(WIIMOTE, " CommandCofigurationResponse");
+ LOG(WIIMOTE, " SCID: 0x%04x", rsp->scid);
+ LOG(WIIMOTE, " Flags: 0x%04x", rsp->flags);
+ LOG(WIIMOTE, " Result: 0x%04x", rsp->result);
+
+ _dbg_assert_(WIIMOTE, rsp->result == 0);
+}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
index 7e9cb45d3a..d60760e828 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h
@@ -42,6 +42,8 @@ public:
void SendACLFrame(u8* _pData, u32 _Size);
+ void Connect();
+
private:
// STATE_TO_SAVE
@@ -79,7 +81,12 @@ private:
void SignalChannel(u8* _pData, u32 _Size);
+ void SendConnectionRequest(u16 scid, u16 psm);
+ void SendConfigurationRequest(u16 scid);
+
void CommandConnectionReq(u8 _Ident, u8* _pData, u32 _Size);
void CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Size);
+ void CommandConnectionResponse(u8 _Ident, u8* _pData, u32 _Size);
+ void CommandCofigurationResponse(u8 _Ident, u8* _pData, u32 _Size);
};
#endif
diff --git a/Source/Core/Core/Src/IPC_HLE/l2cap.h b/Source/Core/Core/Src/IPC_HLE/l2cap.h
index f79748d93d..55f471b105 100644
--- a/Source/Core/Core/Src/IPC_HLE/l2cap.h
+++ b/Source/Core/Core/Src/IPC_HLE/l2cap.h
@@ -25,6 +25,21 @@ SOFTWARE IS DISCLAIMED.
#ifndef __L2CAP_H
#define __L2CAP_H
+//Dolphin - define missing types
+typedef unsigned short __le16;
+typedef unsigned short __u16;
+typedef unsigned char __u8;
+typedef unsigned long __u32;
+
+#ifdef _MSC_VER
+#define __attribute__(a)
+#pragma pack(push)
+#pragma pack(1)
+#pragma warning(push)
+#pragma warning(disable:4200)
+#endif
+
+
/* L2CAP defaults */
#define L2CAP_DEFAULT_MTU 672
#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
@@ -33,11 +48,13 @@ SOFTWARE IS DISCLAIMED.
#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
/* L2CAP socket address */
+#ifdef NOT_DOLPHIN
struct sockaddr_l2 {
sa_family_t l2_family;
__le16 l2_psm;
bdaddr_t l2_bdaddr;
};
+#endif
/* L2CAP socket options */
#define L2CAP_OPTIONS 0x01
@@ -190,6 +207,13 @@ struct l2cap_info_rsp {
#define L2CAP_IR_SUCCESS 0x0000
#define L2CAP_IR_NOTSUPP 0x0001
+#ifdef _MSC_VER
+#pragma warning(pop)
+#pragma pack(pop)
+#endif
+
+#ifdef NOT_DOLPHIN
+
/* ----- L2CAP connections ----- */
struct l2cap_chan_list {
struct sock *head;
@@ -262,4 +286,6 @@ struct l2cap_pinfo {
void l2cap_load(void);
+#endif //NOT_DOLPHIN
+
#endif /* __L2CAP_H */
\ No newline at end of file
diff --git a/Source/Core/DolphinWX/src/Main.cpp b/Source/Core/DolphinWX/src/Main.cpp
index 4356f887e0..a0b1a2d621 100644
--- a/Source/Core/DolphinWX/src/Main.cpp
+++ b/Source/Core/DolphinWX/src/Main.cpp
@@ -28,12 +28,37 @@
#include "Frame.h"
#include "Config.h"
#include "CodeWindow.h"
+#include "../../Common/src/ExtendedTrace.h"
IMPLEMENT_APP(DolphinApp)
CFrame* main_frame = NULL;
CCodeWindow* g_pCodeWindow = NULL;
+#ifdef WIN32
+//Has no error handling.
+//I think that if an error occurs here there's no way to handle it anyway.
+LONG WINAPI MyUnhandledExceptionFilter(LPEXCEPTION_POINTERS e) {
+ //EnterCriticalSection(&g_uefcs);
+
+ FILE* file=NULL;
+ fopen_s(&file, "exceptioninfo.txt", "a");
+ fseek(file, 0, SEEK_END);
+ etfprint(file, "\n");
+ //etfprint(file, g_buildtime);
+ //etfprint(file, "\n");
+ //dumpCurrentDate(file);
+ etfprintf(file, "Unhandled Exception\n Code: 0x%08X\n",
+ e->ExceptionRecord->ExceptionCode);
+ STACKTRACE2(file, e->ContextRecord->Eip, e->ContextRecord->Esp, e->ContextRecord->Ebp);
+ fclose(file);
+ _flushall();
+
+ //LeaveCriticalSection(&g_uefcs);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+#endif
+
// The `main program' equivalent, creating the windows and returning the
// main frame
bool DolphinApp::OnInit()
@@ -44,6 +69,9 @@ bool DolphinApp::OnInit()
#endif
#ifdef _WIN32
+ EXTENDEDTRACEINITIALIZE(".");
+ SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
+
// TODO: if First Boot
if (!cpu_info.bSSE2)
{
diff --git a/Source/Dolphin.sln b/Source/Dolphin.sln
index bd7c3b8524..ab075bd851 100644
--- a/Source/Dolphin.sln
+++ b/Source/Dolphin.sln
@@ -3,16 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcproj", "{F0B874CB-4476-4199-9315-8343D05AE684}"
ProjectSection(ProjectDependencies) = postProject
- {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoDX9", "Plugins\Plugin_VideoDX9\Plugin_VideoDX9.vcproj", "{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
ProjectSection(ProjectDependencies) = postProject
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
- {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
+ {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_PadSimple", "Plugins\Plugin_PadSimple\Plugin_PadSimple.vcproj", "{9A183B48-ECC2-4121-876A-9B3793686073}"
@@ -33,20 +33,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiscIO", "Core\DiscIO\DiscI
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoOGL", "Plugins\Plugin_VideoOGL\Plugin_VideoOGL.vcproj", "{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}"
ProjectSection(ProjectDependencies) = postProject
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
- {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
+ {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA} = {E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Core\Common\Common.vcproj", "{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}"
ProjectSection(ProjectDependencies) = postProject
- {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
- {3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
{0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
+ {3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
+ {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
@@ -75,8 +75,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_PadDX9", "Plugins\Pl
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_nJoy_SDL", "Plugins\Plugin_nJoy_SDL\Plugin_nJoy_SDL.vcproj", "{521498BE-6089-4780-8223-E67C22F4E068}"
ProjectSection(ProjectDependencies) = postProject
- {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F}
+ {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
@@ -157,16 +157,13 @@ Global
{3E03C179-8251-46E4-81F4-466F114BAC63}.Release|x64.Build.0 = Release|x64
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Debug|Win32.ActiveCfg = Debug|Win32
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Debug|Win32.Build.0 = Debug|Win32
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Debug|x64.ActiveCfg = Debug|x64
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Debug|x64.Build.0 = Debug|x64
+ {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Debug|x64.ActiveCfg = Debug|Win32
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.DebugFast|Win32.Build.0 = DebugFast|Win32
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.DebugFast|x64.ActiveCfg = DebugFast|x64
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.DebugFast|x64.Build.0 = DebugFast|x64
+ {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.DebugFast|x64.ActiveCfg = DebugFast|Win32
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Release|Win32.ActiveCfg = Release|Win32
{C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Release|Win32.Build.0 = Release|Win32
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Release|x64.ActiveCfg = Release|x64
- {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Release|x64.Build.0 = Release|x64
+ {C60D0E7A-ED05-4C67-9EE7-3A6C0D7801C8}.Release|x64.ActiveCfg = Release|Win32
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}.Debug|Win32.ActiveCfg = Debug|Win32
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}.Debug|Win32.Build.0 = Debug|Win32
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}.Debug|x64.ActiveCfg = Debug|x64
@@ -181,16 +178,13 @@ Global
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}.Release|x64.Build.0 = Release|x64
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Debug|Win32.ActiveCfg = Debug|Win32
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Debug|Win32.Build.0 = Debug|Win32
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Debug|x64.ActiveCfg = Debug|x64
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Debug|x64.Build.0 = Debug|x64
+ {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Debug|x64.ActiveCfg = Debug|Win32
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|Win32.Build.0 = DebugFast|Win32
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|x64.ActiveCfg = DebugFast|x64
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|x64.Build.0 = DebugFast|x64
+ {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.DebugFast|x64.ActiveCfg = DebugFast|Win32
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|Win32.ActiveCfg = Release|Win32
{CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|Win32.Build.0 = Release|Win32
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|x64.ActiveCfg = Release|x64
- {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|x64.Build.0 = Release|x64
+ {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160}.Release|x64.ActiveCfg = Release|Win32
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}.Debug|Win32.ActiveCfg = Debug|Win32
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}.Debug|Win32.Build.0 = Debug|Win32
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}.Debug|x64.ActiveCfg = Debug|x64
@@ -265,28 +259,22 @@ Global
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|x64.Build.0 = Release|x64
{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|Win32.ActiveCfg = Debug|Win32
{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|Win32.Build.0 = Debug|Win32
- {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|x64.ActiveCfg = Debug|x64
- {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|x64.Build.0 = Debug|x64
+ {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Debug|x64.ActiveCfg = Debug|Win32
{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|Win32.Build.0 = DebugFast|Win32
- {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|x64.ActiveCfg = DebugFast|x64
- {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|x64.Build.0 = DebugFast|x64
+ {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.DebugFast|x64.ActiveCfg = DebugFast|Win32
{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|Win32.ActiveCfg = Release|Win32
{805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|Win32.Build.0 = Release|Win32
- {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|x64.ActiveCfg = Release|x64
- {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|x64.Build.0 = Release|x64
+ {805B34AA-82A5-4875-8DC7-3C85BDC0BCEE}.Release|x64.ActiveCfg = Release|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.Debug|Win32.ActiveCfg = Debug|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.Debug|Win32.Build.0 = Debug|Win32
- {521498BE-6089-4780-8223-E67C22F4E068}.Debug|x64.ActiveCfg = Release|x64
- {521498BE-6089-4780-8223-E67C22F4E068}.Debug|x64.Build.0 = Release|x64
+ {521498BE-6089-4780-8223-E67C22F4E068}.Debug|x64.ActiveCfg = Debug|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.DebugFast|Win32.Build.0 = DebugFast|Win32
- {521498BE-6089-4780-8223-E67C22F4E068}.DebugFast|x64.ActiveCfg = DebugFast|x64
- {521498BE-6089-4780-8223-E67C22F4E068}.DebugFast|x64.Build.0 = DebugFast|x64
+ {521498BE-6089-4780-8223-E67C22F4E068}.DebugFast|x64.ActiveCfg = DebugFast|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.Release|Win32.ActiveCfg = Release|Win32
{521498BE-6089-4780-8223-E67C22F4E068}.Release|Win32.Build.0 = Release|Win32
- {521498BE-6089-4780-8223-E67C22F4E068}.Release|x64.ActiveCfg = Release|x64
- {521498BE-6089-4780-8223-E67C22F4E068}.Release|x64.Build.0 = Release|x64
+ {521498BE-6089-4780-8223-E67C22F4E068}.Release|x64.ActiveCfg = Release|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|Win32.ActiveCfg = Debug|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|Win32.Build.0 = Debug|Win32
{D6E56527-BBB9-4EAD-A6EC-49D4BF6AFCD8}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Globals.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Globals.cpp
index fe9266e0f9..bd939bfb3a 100644
--- a/Source/Plugins/Plugin_DSP_HLE/Src/Globals.cpp
+++ b/Source/Plugins/Plugin_DSP_HLE/Src/Globals.cpp
@@ -4,6 +4,11 @@
#include "Common.h"
#include "Globals.h"
+void __Log(int, const char *fmt, ...)
+{
+ DebugLog(fmt);
+}
+
void DebugLog(const char* _fmt, ...)
{
#ifdef _DEBUG