mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
nakee's new logmanager. added a console window for windows builds (prints to parent console on non-win32). also fix some random wxw bugs: main window's position is saved when using debugger, disabling windows from the tools menu are saved settings, some other small fixes
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2675 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -214,7 +214,7 @@ void Config::Load(bool ChangePad)
|
||||
// =============================
|
||||
|
||||
// Logging
|
||||
Console::Print("Load()\n");
|
||||
INFO_LOG(CONSOLE, "Load()\n");
|
||||
}
|
||||
|
||||
void Config::Save(int Slot)
|
||||
@ -352,5 +352,5 @@ void Config::Save(int Slot)
|
||||
// =============================
|
||||
|
||||
// Logging
|
||||
Console::Print("Save()\n");
|
||||
INFO_LOG(CONSOLE, "Save()\n");
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ void ConfigDialog::OnKeyDown(wxKeyEvent& event)
|
||||
// Input button clicked
|
||||
void ConfigDialog::OnButtonClick(wxCommandEvent& event)
|
||||
{
|
||||
//Console::Print("OnButtonClick: %i\n", g_Pressed);
|
||||
//INFO_LOG(CONSOLE, "OnButtonClick: %i\n", g_Pressed);
|
||||
|
||||
// Don't allow space to start a new Press Key option, that will interfer with setting a key to space
|
||||
if (g_Pressed == WXK_SPACE) { g_Pressed = 0; return; }
|
||||
@ -391,7 +391,7 @@ void ConfigDialog::DoSave(bool ChangePad, int Slot)
|
||||
// Then change it back to ""
|
||||
ToBlank();
|
||||
|
||||
Console::Print("WiiMoteEmu::PadMapping[%i].ID = %i\n", Page, m_Joyname[Page]->GetSelection());
|
||||
INFO_LOG(CONSOLE, "WiiMoteEmu::PadMapping[%i].ID = %i\n", Page, m_Joyname[Page]->GetSelection());
|
||||
}
|
||||
//////////////////////////////////////
|
||||
|
||||
@ -1439,7 +1439,7 @@ void ConfigDialog::DoConnectReal()
|
||||
}
|
||||
else
|
||||
{
|
||||
Console::Print("Post Message: %i\n", g_RealWiiMoteInitialized);
|
||||
INFO_LOG(CONSOLE, "Post Message: %i\n", g_RealWiiMoteInitialized);
|
||||
if (g_RealWiiMoteInitialized)
|
||||
{
|
||||
WiiMoteReal::Shutdown();
|
||||
@ -1471,11 +1471,11 @@ void ConfigDialog::DoUseReal()
|
||||
if (g_Config.bNunchuckConnected || g_Config.bClassicControllerConnected)
|
||||
UsingExtension = true;
|
||||
|
||||
Console::Print("\nDoUseReal() Connect extension: %i\n", !UsingExtension);
|
||||
INFO_LOG(CONSOLE, "\nDoUseReal() Connect extension: %i\n", !UsingExtension);
|
||||
DoExtensionConnectedDisconnected(UsingExtension ? 0 : 1);
|
||||
|
||||
UsingExtension = !UsingExtension;
|
||||
Console::Print("\nDoUseReal() Connect extension: %i\n", !UsingExtension);
|
||||
INFO_LOG(CONSOLE, "\nDoUseReal() Connect extension: %i\n", !UsingExtension);
|
||||
DoExtensionConnectedDisconnected(UsingExtension ? 1 : 0);
|
||||
|
||||
if(g_EmulatorRunning)
|
||||
@ -1650,7 +1650,7 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
||||
if (m_RecordHotKeyNunchuck[i]->GetSelection() == m_RecordHotKeyNunchuck[CurrentChoiceBox]->GetSelection()) m_RecordHotKeyNunchuck[i]->SetSelection(10);
|
||||
if (m_RecordHotKeyIR[i]->GetSelection() == m_RecordHotKeyIR[CurrentChoiceBox]->GetSelection()) m_RecordHotKeyIR[i]->SetSelection(10);
|
||||
|
||||
//Console::Print("HotKey: %i %i\n",
|
||||
//INFO_LOG(CONSOLE, "HotKey: %i %i\n",
|
||||
// m_RecordHotKey[i]->GetSelection(), m_RecordHotKey[CurrentChoiceBox]->GetSelection());
|
||||
}
|
||||
break;
|
||||
@ -1710,7 +1710,7 @@ void ConfigDialog::UpdateControls()
|
||||
// -------------
|
||||
void ConfigDialog::UpdateGUI(int Slot)
|
||||
{
|
||||
//Console::Print("UpdateGUI: \n");
|
||||
//INFO_LOG(CONSOLE, "UpdateGUI: \n");
|
||||
|
||||
// Update the gamepad settings
|
||||
UpdateGUIButtonMapping(Page);
|
||||
|
@ -61,12 +61,12 @@ void ConfigDialog::PadOpen(int Open) // Open for slot 1, 2, 3 or 4
|
||||
// Check that we got a good pad
|
||||
if (!WiiMoteEmu::joyinfo.at(WiiMoteEmu::PadMapping[Open].ID).Good)
|
||||
{
|
||||
Console::Print("A bad pad was selected\n");
|
||||
INFO_LOG(CONSOLE, "A bad pad was selected\n");
|
||||
WiiMoteEmu::PadState[Open].joy = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
Console::Print("Update the Slot %i handle to Id %i\n", Page, WiiMoteEmu::PadMapping[Open].ID);
|
||||
INFO_LOG(CONSOLE, "Update the Slot %i handle to Id %i\n", Page, WiiMoteEmu::PadMapping[Open].ID);
|
||||
WiiMoteEmu::PadState[Open].joy = SDL_JoystickOpen(WiiMoteEmu::PadMapping[Open].ID);
|
||||
}
|
||||
void ConfigDialog::PadClose(int Close) // Close for slot 1, 2, 3 or 4
|
||||
@ -118,7 +118,7 @@ void ConfigDialog::SetButtonTextAll(int id, char text[128])
|
||||
|
||||
void ConfigDialog::SaveButtonMappingAll(int Slot)
|
||||
{
|
||||
//Console::Print("SaveButtonMappingAll()\n");
|
||||
//INFO_LOG(CONSOLE, "SaveButtonMappingAll()\n");
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@ -211,7 +211,7 @@ void ConfigDialog::UpdateGUIButtonMapping(int controller)
|
||||
m_bCcRd[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Cc.Rd).c_str()));
|
||||
#endif
|
||||
|
||||
//Console::Print("m_bWmA[%i] = %i = %s\n", controller, WiiMoteEmu::PadMapping[controller].Wm.A, InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.A).c_str());
|
||||
//INFO_LOG(CONSOLE, "m_bWmA[%i] = %i = %s\n", controller, WiiMoteEmu::PadMapping[controller].Wm.A, InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.A).c_str());
|
||||
}
|
||||
|
||||
/* Populate the PadMapping array with the dialog items settings (for example
|
||||
@ -257,7 +257,7 @@ void ConfigDialog::SaveButtonMapping(int controller, bool DontChangeId, int From
|
||||
m_AnalogTriggerL[FromSlot]->GetValue().ToLong(&value); WiiMoteEmu::PadMapping[controller].Axis.Tl = value;
|
||||
m_AnalogTriggerR[FromSlot]->GetValue().ToLong(&value); WiiMoteEmu::PadMapping[controller].Axis.Tr = value;
|
||||
|
||||
//Console::Print("WiiMoteEmu::PadMapping[%i].ID = %i, m_Joyname[%i]->GetSelection() = %i\n",
|
||||
//INFO_LOG(CONSOLE, "WiiMoteEmu::PadMapping[%i].ID = %i, m_Joyname[%i]->GetSelection() = %i\n",
|
||||
// controller, WiiMoteEmu::PadMapping[controller].ID, FromSlot, m_Joyname[FromSlot]->GetSelection());
|
||||
|
||||
// Replace "-1" with ""
|
||||
@ -320,7 +320,7 @@ void ConfigDialog::SaveKeyboardMapping(int Controller, int Id, int Key)
|
||||
case IDB_CC_RD: WiiMoteEmu::PadMapping[Controller].Cc.Rd = Key; break;
|
||||
}
|
||||
|
||||
//Console::Print("WiiMoteEmu::PadMapping[%i].Wm.A = %i", Controller, WiiMoteEmu::PadMapping[Controller].Wm.A);
|
||||
//INFO_LOG(CONSOLE, "WiiMoteEmu::PadMapping[%i].Wm.A = %i", Controller, WiiMoteEmu::PadMapping[Controller].Wm.A);
|
||||
}
|
||||
|
||||
// Replace the harder to understand -1 with "" for the sake of user friendliness
|
||||
@ -421,14 +421,14 @@ void ConfigDialog::SetButtonText(int id, char text[128], int _Page)
|
||||
case IDB_CC_RD: m_bCcRd[controller]->SetLabel(wxString::FromAscii(text)); break;
|
||||
default: break;
|
||||
}
|
||||
//Console::Print("SetButtonText: %s\n", text);
|
||||
//INFO_LOG(CONSOLE, "SetButtonText: %s\n", text);
|
||||
}
|
||||
|
||||
// Get the text in the textbox for the buttons
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
wxString ConfigDialog::GetButtonText(int id, int _Page)
|
||||
{
|
||||
//Console::Print("GetButtonText: %i\n", id);
|
||||
//INFO_LOG(CONSOLE, "GetButtonText: %i\n", id);
|
||||
|
||||
// Set controller value
|
||||
int controller;
|
||||
@ -510,7 +510,7 @@ void ConfigDialog::DoGetButtons(int GetId)
|
||||
bool Stop = false; // Stop the timer
|
||||
// =======================
|
||||
|
||||
//Console::Print("Before (%i) Id:%i %i IsRunning:%i\n",
|
||||
//INFO_LOG(CONSOLE, "Before (%i) Id:%i %i IsRunning:%i\n",
|
||||
// GetButtonWaitingTimer, GetButtonWaitingID, GetId, m_ButtonMappingTimer->IsRunning());
|
||||
|
||||
// If the Id has changed or the timer is not running we should start one
|
||||
@ -539,7 +539,7 @@ void ConfigDialog::DoGetButtons(int GetId)
|
||||
#if wxUSE_TIMER
|
||||
m_ButtonMappingTimer->Start( floor((double)(1000 / TimesPerSecond)) );
|
||||
#endif
|
||||
Console::Print("Timer Started for Pad:%i GetId:%i\n"
|
||||
INFO_LOG(CONSOLE, "Timer Started for Pad:%i GetId:%i\n"
|
||||
"Allowed input is Axis:%i LeftRight:%i XInput:%i Button:%i Hat:%i\n",
|
||||
WiiMoteEmu::PadMapping[Controller].ID, GetId,
|
||||
Axis, LeftRight, XInput, Button, Hat);
|
||||
@ -578,7 +578,7 @@ void ConfigDialog::DoGetButtons(int GetId)
|
||||
SetButtonText(GetId, format);
|
||||
|
||||
/* Debug
|
||||
Console::Print("Keyboard: %i\n", g_Pressed);*/
|
||||
INFO_LOG(CONSOLE, "Keyboard: %i\n", g_Pressed);*/
|
||||
}
|
||||
|
||||
// Time's up
|
||||
@ -610,7 +610,7 @@ void ConfigDialog::DoGetButtons(int GetId)
|
||||
several disabled slots. */
|
||||
SaveButtonMappingAll(Controller);
|
||||
|
||||
Console::Print("Timer Stopped for Pad:%i GetId:%i\n",
|
||||
INFO_LOG(CONSOLE, "Timer Stopped for Pad:%i GetId:%i\n",
|
||||
WiiMoteEmu::PadMapping[Controller].ID, GetId);
|
||||
}
|
||||
|
||||
@ -630,7 +630,7 @@ void ConfigDialog::DoGetButtons(int GetId)
|
||||
|
||||
// Debugging
|
||||
/*
|
||||
Console::Print("Change: %i %i %i %i '%s' '%s' '%s' '%s'\n",
|
||||
INFO_LOG(CONSOLE, "Change: %i %i %i %i '%s' '%s' '%s' '%s'\n",
|
||||
WiiMoteEmu::PadMapping[0].halfpress, WiiMoteEmu::PadMapping[1].halfpress, WiiMoteEmu::PadMapping[2].halfpress, WiiMoteEmu::PadMapping[3].halfpress,
|
||||
m_JoyButtonHalfpress[0]->GetValue().c_str(), m_JoyButtonHalfpress[1]->GetValue().c_str(), m_JoyButtonHalfpress[2]->GetValue().c_str(), m_JoyButtonHalfpress[3]->GetValue().c_str()
|
||||
);*/
|
||||
@ -657,7 +657,7 @@ void ConfigDialog::Convert2Box(int &x)
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void ConfigDialog::PadGetStatus()
|
||||
{
|
||||
//Console::Print("SDL_WasInit: %i\n", SDL_WasInit(0));
|
||||
//INFO_LOG(CONSOLE, "SDL_WasInit: %i\n", SDL_WasInit(0));
|
||||
|
||||
/* Return if it's not detected. The ID should never be less than zero here, it can only be that
|
||||
because of a manual ini file change, but we make that check anway. */
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
void ConfigDialog::LoadFile()
|
||||
{
|
||||
Console::Print("LoadFile()\n");
|
||||
INFO_LOG(CONSOLE, "LoadFile()\n");
|
||||
|
||||
IniFile file;
|
||||
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
@ -79,7 +79,7 @@ void ConfigDialog::LoadFile()
|
||||
}
|
||||
void ConfigDialog::SaveFile()
|
||||
{
|
||||
Console::Print("SaveFile\n");
|
||||
INFO_LOG(CONSOLE, "SaveFile\n");
|
||||
|
||||
IniFile file;
|
||||
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
@ -115,7 +115,7 @@ void ConfigDialog::SaveFile()
|
||||
}
|
||||
|
||||
file.Save(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
Console::Print("SaveFile()\n");
|
||||
INFO_LOG(CONSOLE, "SaveFile()\n");
|
||||
}
|
||||
/////////////////////////////
|
||||
|
||||
@ -371,7 +371,7 @@ void ConfigDialog::ConvertToString()
|
||||
TmpStr += StringFromFormat("%s", m_vRecording.at(i).z >= 0 ? StringFromFormat("+%03i", m_vRecording.at(i).z).c_str() : StringFromFormat("%04i", m_vRecording.at(i).z).c_str());
|
||||
if (i < ((int)m_vRecording.size() - 1)) TmpStr += ",";
|
||||
|
||||
//Console::Print("%s\n", TmpStr.c_str());
|
||||
//INFO_LOG(CONSOLE, "%s\n", TmpStr.c_str());
|
||||
|
||||
// Write the IR data
|
||||
TmpIR += ArrayToString(m_vRecording.at(i).IR, IRBytes, 0, 30, false);
|
||||
@ -391,7 +391,7 @@ void ConfigDialog::ConvertToString()
|
||||
}
|
||||
|
||||
// Debug
|
||||
Console::Print("Saved: [%i / %i] %03i %03i %03i\n", i, m_vRecording.size(), m_vRecording.at(i).x, m_vRecording.at(i).y, m_vRecording.at(i).z);
|
||||
INFO_LOG(CONSOLE, "Saved: [%i / %i] %03i %03i %03i\n", i, m_vRecording.size(), m_vRecording.at(i).x, m_vRecording.at(i).y, m_vRecording.at(i).z);
|
||||
}
|
||||
|
||||
// Recordings per second
|
||||
@ -424,7 +424,7 @@ void ConfigDialog::ConvertToString()
|
||||
|
||||
file.Save(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
|
||||
Console::Print("Save recording to WiimoteMovement.ini\n");
|
||||
INFO_LOG(CONSOLE, "Save recording to WiimoteMovement.ini\n");
|
||||
}
|
||||
|
||||
// Timeout the recording
|
||||
@ -493,7 +493,7 @@ void ConfigDialog::DoRecordA(bool Pressed)
|
||||
else
|
||||
{
|
||||
m_RecordButton[m_iRecordTo]->SetLabel(wxT("Done"));
|
||||
Console::Print("Done: %i %i\n", m_bWaitForRecording, m_bRecording);
|
||||
INFO_LOG(CONSOLE, "Done: %i %i\n", m_bWaitForRecording, m_bRecording);
|
||||
//m_bAllowA = true;
|
||||
ConvertToString();
|
||||
}
|
||||
@ -504,11 +504,11 @@ void ConfigDialog::DoRecordA(bool Pressed)
|
||||
void ConfigDialog::DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int _IRBytes)
|
||||
{
|
||||
//std::string Tmp1 = ArrayToString(_IR, 20, 0, 30);
|
||||
//Console::Print("DoRecordMovement: %s\n", Tmp1.c_str());
|
||||
//INFO_LOG(CONSOLE, "DoRecordMovement: %s\n", Tmp1.c_str());
|
||||
|
||||
if (!m_bRecording) return;
|
||||
|
||||
//Console::Print("DoRecordMovement: %03i %03i %03i\n", _x, _y, _z);
|
||||
//INFO_LOG(CONSOLE, "DoRecordMovement: %03i %03i %03i\n", _x, _y, _z);
|
||||
|
||||
SRecording Tmp;
|
||||
Tmp.x = _x;
|
||||
|
@ -95,11 +95,11 @@ void WmDataReporting(u16 _channelID, wm_data_reporting* dr)
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Continuous: %x", dr->continuous);
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " All The Time: %x (not only on data change)", dr->all_the_time);
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Mode: 0x%02x", dr->mode);
|
||||
Console::Print("Data reporting:\n");
|
||||
Console::Print(" Continuous: %x\n", dr->continuous);
|
||||
Console::Print(" All The Time: %x (not only on data change)\n", dr->all_the_time);
|
||||
Console::Print(" Mode: 0x%02x\n", dr->mode);
|
||||
Console::Print(" Channel: 0x%04x\n", _channelID);
|
||||
INFO_LOG(CONSOLE, "Data reporting:\n");
|
||||
INFO_LOG(CONSOLE, " Continuous: %x\n", dr->continuous);
|
||||
INFO_LOG(CONSOLE, " All The Time: %x (not only on data change)\n", dr->all_the_time);
|
||||
INFO_LOG(CONSOLE, " Mode: 0x%02x\n", dr->mode);
|
||||
INFO_LOG(CONSOLE, " Channel: 0x%04x\n", _channelID);
|
||||
|
||||
g_ReportingMode = dr->mode;
|
||||
g_ReportingChannel = _channelID;
|
||||
|
@ -32,8 +32,6 @@
|
||||
#include "Logging.h" // for startConsoleWin, Console::Print, GetConsoleHwnd
|
||||
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
//extern void __Log(int log, const char *format, ...);
|
||||
//extern void __Log(int log, int v, const char *format, ...);
|
||||
|
||||
namespace WiiMoteEmu
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ void TiltTest(u8 x, u8 y, u8 z)
|
||||
std::string To = StringFromFormat("%s\nTo: X:%i Y:%i Z:%i Roll:%s Pitch:%s", From.c_str(), x, y, z,
|
||||
(_Roll >= 0) ? StringFromFormat(" %03i", (int)_Roll).c_str() : StringFromFormat("%04i", (int)_Roll).c_str(),
|
||||
(_Pitch >= 0) ? StringFromFormat(" %03i", (int)_Pitch).c_str() : StringFromFormat("%04i", (int)_Pitch).c_str());
|
||||
Console::Print("%s\n", To.c_str());
|
||||
INFO_LOG(CONSOLE, "%s\n", To.c_str());
|
||||
}
|
||||
////////////////////////////////////
|
||||
|
||||
|
@ -127,10 +127,10 @@ void GetMousePos(float& x, float& y)
|
||||
}
|
||||
// Logging
|
||||
/*
|
||||
Console::ClearScreen();
|
||||
Console::Print("Screen Width:%4.0f Height:%4.0f Ratio:%1.2f\n", WinWidth, WinHeight, Ratio);
|
||||
Console::Print("Picture Width:%4.1f Height:%4.1f YOffset:%4.0f XOffset:%4.0f\n", PictureWidth, PictureHeight, YOffset, XOffset);
|
||||
Console::Print("----------------------------------------------------------------\n");
|
||||
// Console::ClearScreen();
|
||||
INFO_LOG(CONSOLE, "Screen Width:%4.0f Height:%4.0f Ratio:%1.2f\n", WinWidth, WinHeight, Ratio);
|
||||
INFO_LOG(CONSOLE, "Picture Width:%4.1f Height:%4.1f YOffset:%4.0f XOffset:%4.0f\n", PictureWidth, PictureHeight, YOffset, XOffset);
|
||||
INFO_LOG(CONSOLE, "----------------------------------------------------------------\n");
|
||||
*/
|
||||
}
|
||||
// -------------------------------------
|
||||
@ -157,9 +157,9 @@ void GetMousePos(float& x, float& y)
|
||||
|
||||
// Logging
|
||||
/*
|
||||
Console::Print("Crop Ratio:%1.2f IncrWidth:%3.0f IncrHeight:%3.0f\n", Ratio, IncreasedWidth, IncreasedHeight);
|
||||
Console::Print("Picture Width:%4.1f Height:%4.1f YOffset:%4.0f XOffset:%4.0f\n", PictureWidth, PictureHeight, YOffset, XOffset);
|
||||
Console::Print("----------------------------------------------------------------\n");
|
||||
INFO_LOG(CONSOLE, "Crop Ratio:%1.2f IncrWidth:%3.0f IncrHeight:%3.0f\n", Ratio, IncreasedWidth, IncreasedHeight);
|
||||
INFO_LOG(CONSOLE, "Picture Width:%4.1f Height:%4.1f YOffset:%4.0f XOffset:%4.0f\n", PictureWidth, PictureHeight, YOffset, XOffset);
|
||||
INFO_LOG(CONSOLE, "----------------------------------------------------------------\n");
|
||||
*/
|
||||
}
|
||||
// -------------------------------------
|
||||
@ -172,9 +172,9 @@ void GetMousePos(float& x, float& y)
|
||||
// Logging
|
||||
// -------------
|
||||
/*
|
||||
Console::Print("GetCursorPos: %i %i\n", point.x, point.y);
|
||||
Console::Print("GetClientRect: %i %i %i %i\n", Rect.left, Rect.right, Rect.top, Rect.bottom);
|
||||
Console::Print("Position X:%1.2f Y:%1.2f\n", x, y);
|
||||
INFO_LOG(CONSOLE, "GetCursorPos: %i %i\n", point.x, point.y);
|
||||
INFO_LOG(CONSOLE, "GetClientRect: %i %i %i %i\n", Rect.left, Rect.right, Rect.top, Rect.bottom);
|
||||
INFO_LOG(CONSOLE, "Position X:%1.2f Y:%1.2f\n", x, y);
|
||||
*/
|
||||
// ---------------------------
|
||||
|
||||
@ -220,7 +220,7 @@ void GetCalibrationChecksum()
|
||||
sum += nunchuck_calibration[i];
|
||||
u8 Check1 = sum + 0x55;
|
||||
u8 Check2 = sum + 0xaa;
|
||||
Console::Print("0x%02x 0x%02x", Check1, Check2);
|
||||
INFO_LOG(CONSOLE, "0x%02x 0x%02x", Check1, Check2);
|
||||
}
|
||||
// ================
|
||||
|
||||
@ -230,7 +230,7 @@ void GetCalibrationChecksum()
|
||||
// ----------------
|
||||
void LoadRecordedMovements()
|
||||
{
|
||||
Console::Print("LoadRecordedMovements()\n");
|
||||
INFO_LOG(CONSOLE, "LoadRecordedMovements()\n");
|
||||
|
||||
IniFile file;
|
||||
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
@ -238,7 +238,7 @@ void LoadRecordedMovements()
|
||||
for(int i = 0; i < RECORDING_ROWS; i++)
|
||||
{
|
||||
// Logging
|
||||
//Console::Print("Recording%i ", i + 1);
|
||||
//INFO_LOG(CONSOLE, "Recording%i ", i + 1);
|
||||
|
||||
// Temporary storage
|
||||
int iTmp;
|
||||
@ -310,10 +310,10 @@ void LoadRecordedMovements()
|
||||
// ---------------------------------
|
||||
// Log results
|
||||
// ---------
|
||||
/*Console::Print("Time:%f\n", Tmp.Time);
|
||||
/*INFO_LOG(CONSOLE, "Time:%f\n", Tmp.Time);
|
||||
std::string TmpIRLog = ArrayToString(Tmp.IR, TmpIRBytes, 0, 30);
|
||||
Console::Print("IR: %s\n", TmpIRLog.c_str());
|
||||
Console::Print("\n");*/
|
||||
INFO_LOG(CONSOLE, "IR: %s\n", TmpIRLog.c_str());
|
||||
INFO_LOG(CONSOLE, "\n");*/
|
||||
}
|
||||
|
||||
// Get HotKey
|
||||
@ -335,7 +335,7 @@ void LoadRecordedMovements()
|
||||
else
|
||||
TmpIRLog = "";
|
||||
|
||||
Console::Print("Size:%i HotKey:%i PlSpeed:%i IR:%s X:%i Y:%i Z:%i\n",
|
||||
INFO_LOG(CONSOLE, "Size:%i HotKey:%i PlSpeed:%i IR:%s X:%i Y:%i Z:%i\n",
|
||||
VRecording.at(i).Recording.size(), VRecording.at(i).HotKeyWiimote, VRecording.at(i).PlaybackSpeed,
|
||||
TmpIRLog.c_str(),
|
||||
VRecording.at(i).Recording.at(0).x, VRecording.at(i).Recording.at(0).y, VRecording.at(i).Recording.at(0).z
|
||||
@ -355,7 +355,7 @@ void UpdateEeprom()
|
||||
g_wm.cal_g.y = g_Eeprom[27] - g_Eeprom[24];
|
||||
g_wm.cal_g.z = g_Eeprom[28] - g_Eeprom[24];
|
||||
|
||||
Console::Print("\nUpdateEeprom: %i %i %i\n",
|
||||
INFO_LOG(CONSOLE, "\nUpdateEeprom: %i %i %i\n",
|
||||
WiiMoteEmu::g_Eeprom[22], WiiMoteEmu::g_Eeprom[23], WiiMoteEmu::g_Eeprom[28]);
|
||||
|
||||
if(g_Config.bNunchuckConnected)
|
||||
@ -373,7 +373,7 @@ void UpdateEeprom()
|
||||
g_nu.jy.min = g_RegExt[0x2c];
|
||||
g_nu.jy.center = g_RegExt[0x2d];
|
||||
|
||||
Console::Print("UpdateNunchuck: %i %i %i %i %i\n\n",
|
||||
INFO_LOG(CONSOLE, "UpdateNunchuck: %i %i %i %i %i\n\n",
|
||||
WiiMoteEmu::g_RegExt[0x2a], WiiMoteEmu::g_RegExt[0x2d],
|
||||
WiiMoteEmu::g_RegExt[0x20], WiiMoteEmu::g_RegExt[0x21], WiiMoteEmu::g_RegExt[0x26]);
|
||||
}
|
||||
@ -396,7 +396,7 @@ void UpdateEeprom()
|
||||
g_cc.Tl.neutral = g_RegExt[0x2c];
|
||||
g_cc.Tr.neutral = g_RegExt[0x2d];
|
||||
|
||||
Console::Print("UpdateCC: %i %i %i %i %i\n\n",
|
||||
INFO_LOG(CONSOLE, "UpdateCC: %i %i %i %i %i\n\n",
|
||||
WiiMoteEmu::g_RegExt[0x2a], WiiMoteEmu::g_RegExt[0x2d],
|
||||
WiiMoteEmu::g_RegExt[0x20], WiiMoteEmu::g_RegExt[0x21], WiiMoteEmu::g_RegExt[0x26]);
|
||||
}
|
||||
@ -460,7 +460,7 @@ void SetDefaultExtensionRegistry()
|
||||
memcpy(g_RegExt + 0xfa, classic_id, sizeof(classic_id));
|
||||
}
|
||||
|
||||
Console::Print("\nSetDefaultExtensionRegistry()\n\n");
|
||||
INFO_LOG(CONSOLE, "\nSetDefaultExtensionRegistry()\n\n");
|
||||
|
||||
UpdateEeprom();
|
||||
}
|
||||
@ -518,7 +518,7 @@ void DoState(void* ptr, int mode)
|
||||
these variables. */
|
||||
void Shutdown(void)
|
||||
{
|
||||
Console::Print("ShutDown\n");
|
||||
INFO_LOG(CONSOLE, "ShutDown\n");
|
||||
|
||||
ResetVariables();
|
||||
|
||||
@ -529,7 +529,7 @@ void Shutdown(void)
|
||||
if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID)
|
||||
if (joyinfo.at(PadMapping[i].ID).Good)
|
||||
{
|
||||
Console::Print("ShutDown: %i\n", PadState[i].joy);
|
||||
INFO_LOG(CONSOLE, "ShutDown: %i\n", PadState[i].joy);
|
||||
/* SDL_JoystickClose() crashes for some reason so I avoid this for now, SDL_Quit() should
|
||||
close the pads to I think */
|
||||
//if(SDL_JoystickOpened(PadMapping[i].ID)) SDL_JoystickClose(PadState[i].joy);
|
||||
@ -582,7 +582,7 @@ void CheckAckDelay()
|
||||
}
|
||||
AckDelay.at(i).Delay--;
|
||||
|
||||
//Console::Print("%i 0x%04x 0x%02x", i, AckDelay.at(i).ChannelID, AckDelay.at(i).ReportID);
|
||||
//INFO_LOG(CONSOLE, "%i 0x%04x 0x%02x", i, AckDelay.at(i).ChannelID, AckDelay.at(i).ReportID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -595,7 +595,7 @@ void CheckAckDelay()
|
||||
// ----------------
|
||||
void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
//Console::Print("Emu InterruptChannel\n");
|
||||
//INFO_LOG(CONSOLE, "Emu InterruptChannel\n");
|
||||
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, "=============================================================");
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, "Wiimote_Input");
|
||||
@ -657,7 +657,7 @@ void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
|
||||
void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
//Console::Print("Emu ControlChannel\n");
|
||||
//INFO_LOG(CONSOLE, "Emu ControlChannel\n");
|
||||
|
||||
const u8* data = (const u8*)_pData;
|
||||
// Dump raw data
|
||||
@ -665,7 +665,7 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
INFO_LOG(WII_IPC_WIIMOTE, "Wiimote_ControlChannel");
|
||||
std::string Temp = ArrayToString(data, 0, _Size);
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
Console::Print("\n%s: ControlChannel: %s\n", Tm().c_str(), Temp.c_str());
|
||||
INFO_LOG(CONSOLE, "\n%s: ControlChannel: %s\n", Tm().c_str(), Temp.c_str());
|
||||
#endif
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Data: %s", Temp.c_str());
|
||||
}
|
||||
@ -724,7 +724,7 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
void Update()
|
||||
{
|
||||
//LOG(WII_IPC_WIIMOTE, "Wiimote_Update");
|
||||
//Console::Print("Emu Update: %i\n", g_ReportingMode);
|
||||
//INFO_LOG(CONSOLE, "Emu Update: %i\n", g_ReportingMode);
|
||||
|
||||
// Check if the pad state should be updated
|
||||
if ((g_Config.Trigger.Type == g_Config.Trigger.TRIGGER || g_Config.Trigger.Type == g_Config.Trigger.ANALOG1 || g_Config.Trigger.Type == g_Config.Trigger.ANALOG2
|
||||
|
@ -171,8 +171,8 @@ void GetJoyState(InputCommon::CONTROLLER_STATE_NEW &_PadState, InputCommon::CONT
|
||||
#endif
|
||||
|
||||
/* Debugging
|
||||
Console::ClearScreen();
|
||||
Console::Print(
|
||||
// Console::ClearScreen();
|
||||
DEBUG_LOG(CONSOLE,
|
||||
"Controller and handle: %i %i\n"
|
||||
|
||||
"Triggers:%i %i %i %i %i\n"
|
||||
|
@ -96,7 +96,7 @@ void HidOutputReport(u16 _channelID, wm_report* sr) {
|
||||
case WM_REQUEST_STATUS: // 0x15
|
||||
if (!g_Config.bUseRealWiimote || !g_RealWiiMotePresent) WmRequestStatus(_channelID, (wm_request_status*)sr->data);
|
||||
//Temp = ArrayToString(sr->data, sizeof(wm_request_status), 0);
|
||||
//Console::Print("\n%s: InterruptChannel: %s\n", Tm().c_str(), Temp.c_str());
|
||||
//INFO_LOG(CONSOLE, "\n%s: InterruptChannel: %s\n", Tm().c_str(), Temp.c_str());
|
||||
break;
|
||||
case WM_READ_DATA: // 0x17
|
||||
if (!g_Config.bUseRealWiimote || !g_RealWiiMotePresent) WmReadData(_channelID, (wm_read_data*)sr->data);
|
||||
@ -107,7 +107,7 @@ void HidOutputReport(u16 _channelID, wm_report* sr) {
|
||||
case WM_IR_PIXEL_CLOCK: // 0x13
|
||||
case WM_IR_LOGIC: // 0x1a
|
||||
WARN_LOG(WII_IPC_WIIMOTE, " IR Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
|
||||
Console::Print("IR Enable/Disable 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
|
||||
INFO_LOG(CONSOLE, "IR Enable/Disable 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
|
||||
if(sr->data[0] == 0x02) g_IR = 0;
|
||||
else if(sr->data[0] == 0x06) g_IR = 1;
|
||||
break;
|
||||
@ -118,13 +118,13 @@ void HidOutputReport(u16 _channelID, wm_report* sr) {
|
||||
|
||||
case WM_SPEAKER_ENABLE: // 0x14
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " WM Speaker Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
|
||||
//Console::Print("Speaker Enable/Disable 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
|
||||
//INFO_LOG(CONSOLE, "Speaker Enable/Disable 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
|
||||
if(sr->data[0] == 0x02) g_Speaker = 0;
|
||||
else if(sr->data[0] == 0x06) g_Speaker = 1;
|
||||
break;
|
||||
case WM_SPEAKER_MUTE: // 0x19
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " WM Mute Enable 0x%02x: 0x%02x", sr->channel, sr->data[0]);
|
||||
//Console::Print("Speaker Mute/Unmute 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
|
||||
//INFO_LOG(CONSOLE, "Speaker Mute/Unmute 0x%02x: 0x%02x\n", sr->channel, sr->data[0]);
|
||||
if(sr->data[0] == 0x02) g_SpeakerVoice = 0; // g_SpeakerVoice
|
||||
else if(sr->data[0] == 0x06) g_SpeakerVoice = 1;
|
||||
break;
|
||||
@ -204,13 +204,13 @@ void WmSendAck(u16 _channelID, u8 _reportID, u32 address)
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Report ID: %02x", _reportID);
|
||||
//std::string Temp = ArrayToString(DataFrame, Offset, 0);
|
||||
//LOGV(WII_IPC_WIIMOTE, 2, " Data: %s", Temp.c_str());
|
||||
//Console::Print("%s: WMSendAck: %s\n", Tm(true).c_str(), Temp.c_str());
|
||||
//INFO_LOG(CONSOLE, "%s: WMSendAck: %s\n", Tm(true).c_str(), Temp.c_str());
|
||||
|
||||
/* Debug. Write the report for extension registry writes.
|
||||
if((_reportID == 0x16 || _reportID == 0x17) && ((address >> 16) & 0xfe) == 0xa4)
|
||||
{
|
||||
Console::Print("\nWMSendAck Report ID: %02x Encryption: %02x\n", _reportID, g_RegExt[0xf0]);
|
||||
Console::Print("Data: %s\n", Temp.c_str());
|
||||
INFO_LOG(CONSOLE, "\nWMSendAck Report ID: %02x Encryption: %02x\n", _reportID, g_RegExt[0xf0]);
|
||||
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());
|
||||
}*/
|
||||
|
||||
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
|
||||
@ -248,7 +248,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
|
||||
return;
|
||||
}
|
||||
SendReadDataReply(_channelID, g_Eeprom + address, address, (u8)size);
|
||||
/*Console::Print("Read RegEeprom: Size: %i, Address: %08x, Offset: %08x\n",
|
||||
/*INFO_LOG(CONSOLE, "Read RegEeprom: Size: %i, Address: %08x, Offset: %08x\n",
|
||||
size, address, (address & 0xffff));*/
|
||||
}
|
||||
else if(rd->space == WM_SPACE_REGS1 || rd->space == WM_SPACE_REGS2)
|
||||
@ -263,7 +263,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa2: g_RegSpeaker");
|
||||
/*Tmp = ArrayToString(g_RegSpeaker, size, (address & 0xffff));
|
||||
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
|
||||
Console::Print("Read RegSpkr: Size %i Address %08x Offset %08x\nData %s\n",
|
||||
INFO_LOG(CONSOLE, "Read RegSpkr: Size %i Address %08x Offset %08x\nData %s\n",
|
||||
size, address, (address & 0xffff), Tmp.c_str());*/
|
||||
break;
|
||||
case 0xA4:
|
||||
@ -272,7 +272,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa4: Read ExtReg");
|
||||
/*Tmp = ArrayToString(g_RegExt, size, (address & 0xffff), 40);
|
||||
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
|
||||
Console::Print("Read RegExt: Size %i Address %08x Offset %08x\nData %s\n",
|
||||
INFO_LOG(CONSOLE, "Read RegExt: Size %i Address %08x Offset %08x\nData %s\n",
|
||||
size, address, (address & 0xffff), Tmp.c_str());*/
|
||||
break;
|
||||
case 0xB0:
|
||||
@ -281,7 +281,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Case: 0xb0 g_RegIr");
|
||||
/*Tmp = ArrayToString(g_RegIr, size, (address & 0xffff));
|
||||
//LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
|
||||
Console::Print("Read RegIR: Size %i Address %08x Offset %08x\nData %s\n",
|
||||
INFO_LOG(CONSOLE, "Read RegIR: Size %i Address %08x Offset %08x\nData %s\n",
|
||||
size, address, (address & 0xffff), Tmp.c_str());*/
|
||||
break;
|
||||
default:
|
||||
@ -297,12 +297,12 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
|
||||
if(((address >> 16) & 0xfe) == 0xa4)
|
||||
{
|
||||
/* Debugging
|
||||
Console::Print("\n\nWmReadData Address: %08x Offset: %08x Size: %i byte\n",
|
||||
INFO_LOG(CONSOLE, "\n\nWmReadData Address: %08x Offset: %08x Size: %i byte\n",
|
||||
address, address & 0xffff, (u8)size);
|
||||
// Debugging
|
||||
u32 offset = address & 0xffff;
|
||||
std::string Temp = ArrayToString(g_RegExt, size, offset);
|
||||
Console::Print("Unencrypted data:\n%s\n", Temp.c_str());*/
|
||||
INFO_LOG(CONSOLE, "Unencrypted data:\n%s\n", Temp.c_str());*/
|
||||
|
||||
// Check if encrypted reads is on
|
||||
if(g_RegExt[0xf0] == 0xaa)
|
||||
@ -319,7 +319,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
|
||||
|
||||
/* Debugging: Show the encrypted data
|
||||
std::string Temp = ArrayToString(g_RegExtTmp, size, offset);
|
||||
Console::Print("Encrypted data:\n%s\n", Temp.c_str());*/
|
||||
INFO_LOG(CONSOLE, "Encrypted data:\n%s\n", Temp.c_str());*/
|
||||
}
|
||||
}
|
||||
//-------------
|
||||
@ -405,14 +405,14 @@ void SendReadDataReply(u16 _channelID, void* _Base, u16 _Address, u8 _Size)
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Error: 0x%x", pReply->error);
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Size: 0x%x", pReply->size);
|
||||
DEBUG_LOG(WII_IPC_WIIMOTE, " Address: 0x%04x", pReply->address);
|
||||
/*Console::Print(" SendReadDataReply()\n");
|
||||
Console::Print(" Offset: 0x%x\n", Offset);
|
||||
Console::Print(" dataOffset: 0x%x\n", dataOffset);
|
||||
Console::Print(" copySize: 0x%x\n", copySize);
|
||||
Console::Print(" Size: 0x%x\n", pReply->size);
|
||||
Console::Print(" Address: 0x%04x\n", Common::swap16(pReply->address));*/
|
||||
/*INFO_LOG(CONSOLE, " SendReadDataReply()\n");
|
||||
INFO_LOG(CONSOLE, " Offset: 0x%x\n", Offset);
|
||||
INFO_LOG(CONSOLE, " dataOffset: 0x%x\n", dataOffset);
|
||||
INFO_LOG(CONSOLE, " copySize: 0x%x\n", copySize);
|
||||
INFO_LOG(CONSOLE, " Size: 0x%x\n", pReply->size);
|
||||
INFO_LOG(CONSOLE, " Address: 0x%04x\n", Common::swap16(pReply->address));*/
|
||||
//std::string Temp = ArrayToString(data, 0x40);
|
||||
//Console::Print("Data:\n%s\n", Temp.c_str());
|
||||
//INFO_LOG(CONSOLE, "Data:\n%s\n", Temp.c_str());
|
||||
|
||||
// Send a piece
|
||||
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
|
||||
@ -456,7 +456,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
|
||||
return;
|
||||
}
|
||||
memcpy(g_Eeprom + address, wd->data, wd->size);
|
||||
/*Console::Print("Write RegEeprom: Size: %i, Address: %08x, Offset: %08x\n",
|
||||
/*INFO_LOG(CONSOLE, "Write RegEeprom: Size: %i, Address: %08x, Offset: %08x\n",
|
||||
wd->size, address, (address & 0xffff));*/
|
||||
}
|
||||
// Write to registers
|
||||
@ -470,9 +470,9 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
|
||||
block = g_RegSpeaker;
|
||||
blockSize = WIIMOTE_REG_SPEAKER_SIZE;
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa2: RegSpeaker");
|
||||
/*Console::Print("Write RegSpeaker: Size: %i, Address: %08x, Offset: %08x\n",
|
||||
/*INFO_LOG(CONSOLE, "Write RegSpeaker: Size: %i, Address: %08x, Offset: %08x\n",
|
||||
wd->size, address, (address & 0xffff));
|
||||
Console::Print("Data: %s\n", Temp.c_str());*/
|
||||
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());*/
|
||||
break;
|
||||
case 0xA4:
|
||||
block = g_RegExt; // Extension Controller register
|
||||
@ -480,17 +480,17 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
|
||||
//LOGV(WII_IPC_WIIMOTE, 0, " *******************************************************");
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa4: ExtReg");
|
||||
//LOGV(WII_IPC_WIIMOTE, 0, " *******************************************************");
|
||||
/*Console::Print("Write RegExt Size: %i Address: %08x Offset: %08x \n",
|
||||
/*INFO_LOG(CONSOLE, "Write RegExt Size: %i Address: %08x Offset: %08x \n",
|
||||
wd->size, address, (address & 0xffff));
|
||||
Console::Print("Data: %s\n", Temp.c_str());*/
|
||||
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());*/
|
||||
break;
|
||||
case 0xB0:
|
||||
block = g_RegIr;
|
||||
blockSize = WIIMOTE_REG_IR_SIZE;
|
||||
INFO_LOG(WII_IPC_WIIMOTE, " Case 0xb0: RegIr");
|
||||
/*Console::Print("Write RegIR Size: %i Address: %08x Offset: %08x \n",
|
||||
/*INFO_LOG(CONSOLE, "Write RegIR Size: %i Address: %08x Offset: %08x \n",
|
||||
wd->size, address, (address & 0xffff));
|
||||
Console::Print("Data: %s\n", Temp.c_str());*/
|
||||
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());*/
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(WII_IPC_WIIMOTE, "WmWriteData: bad register block!");
|
||||
@ -518,8 +518,8 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
|
||||
if(blockSize == WIIMOTE_REG_EXT_SIZE)
|
||||
{
|
||||
/* Debugging. Write the data.
|
||||
Console::Print("Data: %s\n", Temp.c_str());
|
||||
Console::Print("Current address: %08x\n", address); */
|
||||
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());
|
||||
INFO_LOG(CONSOLE, "Current address: %08x\n", address); */
|
||||
|
||||
/* Run the key generation on all writes in the key area, it doesn't matter
|
||||
that we send it parts of a key, only the last full key will have an
|
||||
|
@ -40,9 +40,6 @@
|
||||
// Declarations and definitions
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
//extern void __Log(int log, const char *format, ...);
|
||||
//extern void __Log(int log, int v, const char *format, ...);
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
namespace WiiMoteEmu
|
||||
|
@ -262,8 +262,8 @@ void wiimote_gen_key(wiimote_key *key, u8 *keydata)
|
||||
for(int i=0;i<6;i++)
|
||||
skey[5-i] = keydata[i+10];
|
||||
|
||||
Console::Print("rand: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", rand[0], rand[1], rand[2], rand[3], rand[4], rand[5], rand[6], rand[7], rand[8], rand[9]);
|
||||
Console::Print("key: %02x %02x %02x %02x %02x %02x\n", skey[0], skey[1], skey[2], skey[3], skey[4], skey[5]);
|
||||
INFO_LOG(CONSOLE, "rand: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", rand[0], rand[1], rand[2], rand[3], rand[4], rand[5], rand[6], rand[7], rand[8], rand[9]);
|
||||
INFO_LOG(CONSOLE, "key: %02x %02x %02x %02x %02x %02x\n", skey[0], skey[1], skey[2], skey[3], skey[4], skey[5]);
|
||||
|
||||
for(idx = 0; idx < 7; idx++)
|
||||
{
|
||||
@ -272,12 +272,12 @@ void wiimote_gen_key(wiimote_key *key, u8 *keydata)
|
||||
break;
|
||||
}
|
||||
// default case is idx = 7 which is valid (homebrew uses it for the 0x17 case)
|
||||
Console::Print("idx: %d\n", idx);
|
||||
INFO_LOG(CONSOLE, "idx: %d\n", idx);
|
||||
|
||||
gentabs(rand, skey, idx, key->ft, key->sb);
|
||||
|
||||
Console::Print("ft: %02x %02x %02x %02x %02x %02x %02x %02x\n", key->ft[0], key->ft[1], key->ft[2], key->ft[3], key->ft[4], key->ft[5], key->ft[6], key->ft[7]);
|
||||
Console::Print("sb: %02x %02x %02x %02x %02x %02x %02x %02x\n", key->sb[0], key->sb[1], key->sb[2], key->sb[3], key->sb[4], key->sb[5], key->sb[6], key->sb[7]);
|
||||
INFO_LOG(CONSOLE, "ft: %02x %02x %02x %02x %02x %02x %02x %02x\n", key->ft[0], key->ft[1], key->ft[2], key->ft[3], key->ft[4], key->ft[5], key->ft[6], key->ft[7]);
|
||||
INFO_LOG(CONSOLE, "sb: %02x %02x %02x %02x %02x %02x %02x %02x\n", key->sb[0], key->sb[1], key->sb[2], key->sb[3], key->sb[4], key->sb[5], key->sb[6], key->sb[7]);
|
||||
|
||||
// for homebrew, ft and sb are all 0x97 which is equivalent to 0x17
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ int G2Accelerometer(int _G, int XYZ, int Wm)
|
||||
int Return = (int)Accelerometer;
|
||||
|
||||
// Logging
|
||||
//Console::Print("G2Accelerometer():%f %f %f %f\n", Neutral, OneG, G, Accelerometer);
|
||||
//INFO_LOG(CONSOLE, "G2Accelerometer():%f %f %f %f\n", Neutral, OneG, G, Accelerometer);
|
||||
|
||||
// Boundaries
|
||||
if (Return > 255) Return = 255;
|
||||
@ -130,14 +130,14 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
||||
if(VRecording.at(g_RecordingPlaying[Wm]).Recording.size() == 0)
|
||||
{
|
||||
g_RecordingPlaying[Wm] = -1;
|
||||
Console::Print("Empty\n\n");
|
||||
INFO_LOG(CONSOLE, "Empty\n\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return if the playback speed is unset
|
||||
if(VRecording.at(g_RecordingPlaying[Wm]).PlaybackSpeed < 0)
|
||||
{
|
||||
Console::Print("PlaybackSpeed empty: %i\n\n", g_RecordingPlaying[Wm]);
|
||||
INFO_LOG(CONSOLE, "PlaybackSpeed empty: %i\n\n", g_RecordingPlaying[Wm]);
|
||||
g_RecordingPlaying[Wm] = -1;
|
||||
return false;
|
||||
}
|
||||
@ -152,7 +152,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
||||
)
|
||||
)
|
||||
{
|
||||
Console::Print("Wrong IR mode: %i\n\n", g_RecordingPlaying[Wm]);
|
||||
INFO_LOG(CONSOLE, "Wrong IR mode: %i\n\n", g_RecordingPlaying[Wm]);
|
||||
g_RecordingPlaying[Wm] = -1;
|
||||
return false;
|
||||
}
|
||||
@ -160,7 +160,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
||||
// Get starting time
|
||||
if(g_RecordingCounter[Wm] == 0)
|
||||
{
|
||||
Console::Print("\n\nBegin: %i\n", Wm);
|
||||
INFO_LOG(CONSOLE, "\n\nBegin: %i\n", Wm);
|
||||
g_RecordingStart[Wm] = GetDoubleTime();
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
||||
g_RecordingPlaying[Wm] = -1;
|
||||
g_RecordingStart[Wm] = 0;
|
||||
g_RecordingCurrentTime[Wm] = 0;
|
||||
Console::Print("End: %i\n\n", Wm);
|
||||
INFO_LOG(CONSOLE, "End: %i\n\n", Wm);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -204,13 +204,13 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
||||
if (g_DebugAccelerometer)
|
||||
{
|
||||
//Console::ClearScreen();
|
||||
Console::Print("Current time: [%i / %i] %f %f\n",
|
||||
INFO_LOG(CONSOLE, "Current time: [%i / %i] %f %f\n",
|
||||
g_RecordingPoint[Wm], VRecording.at(g_RecordingPlaying[Wm]).Recording.size(),
|
||||
VRecording.at(g_RecordingPlaying[Wm]).Recording.at(g_RecordingPoint[Wm]).Time, g_RecordingCurrentTime[Wm]
|
||||
);
|
||||
Console::Print("Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
|
||||
INFO_LOG(CONSOLE, "Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
|
||||
}
|
||||
//Console::Print("Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
|
||||
//INFO_LOG(CONSOLE, "Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
|
||||
|
||||
g_RecordingCounter[Wm]++;
|
||||
|
||||
@ -272,7 +272,7 @@ bool IsSwitchPressed(int _Key)
|
||||
int RecordingCheckKeys(int WmNuIr)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
//Console::Print("RecordingCheckKeys: %i\n", Wiimote);
|
||||
//INFO_LOG(CONSOLE, "RecordingCheckKeys: %i\n", Wiimote);
|
||||
|
||||
// Check if we have a HotKey match
|
||||
bool Match = false;
|
||||
@ -287,7 +287,7 @@ int RecordingCheckKeys(int WmNuIr)
|
||||
|| VRecording.at(i).HotKeyIR == j && WmNuIr == 2 && IsNumericalKeyPressed(j))
|
||||
&& (IsSwitchPressed(VRecording.at(i).HotKeySwitch) || VRecording.at(i).HotKeySwitch == 3))
|
||||
{
|
||||
//Console::Print("Match: %i %i\n", i, Key);
|
||||
//INFO_LOG(CONSOLE, "Match: %i %i\n", i, Key);
|
||||
Match = true;
|
||||
Recording = i;
|
||||
break;
|
||||
@ -485,7 +485,7 @@ void SingleShake(u8 &_y, u8 &_z, int i)
|
||||
Shake[i] = -1;
|
||||
}
|
||||
#endif
|
||||
//if (Shake[i] > -1) Console::Print("Shake: %i\n", Shake[i]);
|
||||
//if (Shake[i] > -1) INFO_LOG(CONSOLE, "Shake: %i\n", Shake[i]);
|
||||
}
|
||||
|
||||
|
||||
@ -609,7 +609,7 @@ void TiltWiimoteKeyboard(float &Roll, float &Pitch)
|
||||
else
|
||||
{
|
||||
Pitch = KbDegree;
|
||||
//Console::Print("Degree: %2.1f\n", KbDegree);
|
||||
//INFO_LOG(CONSOLE, "Degree: %2.1f\n", KbDegree);
|
||||
}
|
||||
// --------------------
|
||||
#endif
|
||||
@ -642,9 +642,9 @@ void Tilt(u8 &_x, u8 &_y, u8 &_z)
|
||||
if (g_DebugData)
|
||||
{
|
||||
//Console::ClearScreen();
|
||||
/*Console::Print("L:%2.1f R:%2.1f Lx:%2.1f Range:%2.1f Degree:%2.1f L:%i R:%i\n",
|
||||
/*INFO_LOG(CONSOLE, "L:%2.1f R:%2.1f Lx:%2.1f Range:%2.1f Degree:%2.1f L:%i R:%i\n",
|
||||
Tl, Tr, Lx, Range, Degree, PadState[Page].Axis.Tl, PadState[Page].Axis.Tr);*/
|
||||
/*Console::Print("Roll:%2.1f Pitch:%2.1f\n", Roll, Pitch);*/
|
||||
/*INFO_LOG(CONSOLE, "Roll:%2.1f Pitch:%2.1f\n", Roll, Pitch);*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -662,7 +662,7 @@ void FillReportAcc(wm_accel& _acc)
|
||||
{
|
||||
// If the recording reached the end or failed somehow we will not return
|
||||
if (RecordingPlay(_acc.x, _acc.y, _acc.z, 0)) return;
|
||||
//Console::Print("X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
|
||||
//INFO_LOG(CONSOLE, "X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
|
||||
}
|
||||
// ---------------------
|
||||
|
||||
@ -767,13 +767,13 @@ void FillReportAcc(wm_accel& _acc)
|
||||
|
||||
|
||||
//if(consoleDisplay == 0)
|
||||
Console::Print("x: %03i | y: %03i | z: %03i | A:%i B:%i C:%i a:%i b:%i c:%i d:%i X:%i Y:%i Z:%i\n",
|
||||
INFO_LOG(CONSOLE, "x: %03i | y: %03i | z: %03i | A:%i B:%i C:%i a:%i b:%i c:%i d:%i X:%i Y:%i Z:%i\n",
|
||||
_acc.x, _acc.y, _acc.z,
|
||||
A, B, C,
|
||||
a, b, c, d,
|
||||
X, Y, Z
|
||||
);
|
||||
Console::Print("x: %03i | y: %03i | z: %03i | X:%i Y:%i Z:%i | AX:%i AY:%i AZ:%i \n",
|
||||
INFO_LOG(CONSOLE, "x: %03i | y: %03i | z: %03i | X:%i Y:%i Z:%i | AX:%i AY:%i AZ:%i \n",
|
||||
_acc.x, _acc.y, _acc.z,
|
||||
X, Y, Z,
|
||||
AX, AY, AZ
|
||||
@ -804,7 +804,7 @@ void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
|
||||
}
|
||||
else
|
||||
{
|
||||
//Console::Print("X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
|
||||
//INFO_LOG(CONSOLE, "X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
|
||||
if (RecordingPlayIR(_ir0)) return;
|
||||
}
|
||||
// ---------------------
|
||||
@ -857,7 +857,7 @@ void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
|
||||
|
||||
//Console::ClearScreen();
|
||||
//if(consoleDisplay == 1)
|
||||
Console::Print("x0:%03i x1:%03i y0:%03i y1:%03i | T:%i L:%i R:%i B:%i S:%i\n",
|
||||
INFO_LOG(CONSOLE, "x0:%03i x1:%03i y0:%03i y1:%03i | T:%i L:%i R:%i B:%i S:%i\n",
|
||||
x0, x1, y0, y1, Top, Left, Right, Bottom, SensorBarRadius
|
||||
);*/
|
||||
// ------------------
|
||||
@ -898,7 +898,7 @@ void FillReportIRBasic(wm_ir_basic& _ir0, wm_ir_basic& _ir1)
|
||||
// We are playing back a recording, we don't accept any manual input this time
|
||||
else
|
||||
{
|
||||
//Console::Print("X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
|
||||
//INFO_LOG(CONSOLE, "X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
|
||||
if (RecordingPlayIR(_ir0)) return;
|
||||
}
|
||||
// ---------------------
|
||||
@ -958,11 +958,11 @@ void FillReportIRBasic(wm_ir_basic& _ir0, wm_ir_basic& _ir1)
|
||||
//ClearScreen();
|
||||
//if(consoleDisplay == 1)
|
||||
|
||||
Console::Print("x1:%03i x2:%03i y1:%03i y2:%03i irx1:%02x y1:%02x x2:%02x y2:%02x | T:%i L:%i R:%i B:%i S:%i\n",
|
||||
INFO_LOG(CONSOLE, "x1:%03i x2:%03i y1:%03i y2:%03i irx1:%02x y1:%02x x2:%02x y2:%02x | T:%i L:%i R:%i B:%i S:%i\n",
|
||||
x1, x2, y1, y2, _ir0.x1, _ir0.y1, _ir1.x2, _ir1.y2, Top, Left, Right, Bottom, SensorBarRadius
|
||||
);
|
||||
Console::Print("\n");
|
||||
Console::Print("ir0.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir0.y1:%02x y1h:%02x y2:%02x y2h:%02x | ir1.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir1.y1:%02x y1h:%02x y2:%02x y2h:%02x\n",
|
||||
INFO_LOG(CONSOLE, "\n");
|
||||
INFO_LOG(CONSOLE, "ir0.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir0.y1:%02x y1h:%02x y2:%02x y2h:%02x | ir1.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir1.y1:%02x y1h:%02x y2:%02x y2h:%02x\n",
|
||||
_ir0.x1, _ir0.x1Hi, _ir0.x2, _ir0.x2Hi,
|
||||
_ir0.y1, _ir0.y1Hi, _ir0.y2, _ir0.y2Hi,
|
||||
_ir1.x1, _ir1.x1Hi, _ir1.x2, _ir1.x2Hi,
|
||||
|
@ -22,7 +22,6 @@
|
||||
// Includes
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include <iostream>
|
||||
#include "ConsoleWindow.h"
|
||||
//////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
#include "wiiuse.h" // Externals
|
||||
|
||||
#include "ConsoleWindow.h" // Common
|
||||
#include "StringUtil.h"
|
||||
#include "Timer.h"
|
||||
#include "pluginspecs_wiimote.h"
|
||||
@ -49,26 +48,26 @@ int GetReportSize(struct wiimote_t* wm)
|
||||
|
||||
void handle_ctrl_status(struct wiimote_t* wm)
|
||||
{
|
||||
Console::Print("\n\n--- CONTROLLER STATUS [wiimote id %i] ---\n", wm->unid);
|
||||
INFO_LOG(CONSOLE, "\n\n--- CONTROLLER STATUS [wiimote id %i] ---\n", wm->unid);
|
||||
|
||||
Console::Print("attachment: %i\n", wm->exp.type);
|
||||
Console::Print("speaker: %i\n", WIIUSE_USING_SPEAKER(wm));
|
||||
Console::Print("ir: %i\n", WIIUSE_USING_IR(wm));
|
||||
Console::Print("leds: %i %i %i %i\n", WIIUSE_IS_LED_SET(wm, 1), WIIUSE_IS_LED_SET(wm, 2), WIIUSE_IS_LED_SET(wm, 3), WIIUSE_IS_LED_SET(wm, 4));
|
||||
Console::Print("battery: %f %%\n", wm->battery_level);
|
||||
INFO_LOG(CONSOLE, "attachment: %i\n", wm->exp.type);
|
||||
INFO_LOG(CONSOLE, "speaker: %i\n", WIIUSE_USING_SPEAKER(wm));
|
||||
INFO_LOG(CONSOLE, "ir: %i\n", WIIUSE_USING_IR(wm));
|
||||
INFO_LOG(CONSOLE, "leds: %i %i %i %i\n", WIIUSE_IS_LED_SET(wm, 1), WIIUSE_IS_LED_SET(wm, 2), WIIUSE_IS_LED_SET(wm, 3), WIIUSE_IS_LED_SET(wm, 4));
|
||||
INFO_LOG(CONSOLE, "battery: %f %%\n", wm->battery_level);
|
||||
}
|
||||
|
||||
bool IRDataOK(struct wiimote_t* wm)
|
||||
{
|
||||
//Console::Print("IRDataOK: ");
|
||||
//INFO_LOG(CONSOLE, "IRDataOK: ");
|
||||
// The report size is 0x33 = 18, 0x37 = 22 withouth the leading (a1) byte
|
||||
int ReportSize = GetReportSize(wm);
|
||||
for(int i = 0; i < ReportSize; i++)
|
||||
{
|
||||
//Console::Print("%02x ", wm->event_buf[i]);
|
||||
//INFO_LOG(CONSOLE, "%02x ", wm->event_buf[i]);
|
||||
if (wm->event_buf[i] > 0)
|
||||
{
|
||||
//Console::Print("\n");
|
||||
//INFO_LOG(CONSOLE, "\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -77,21 +76,21 @@ bool IRDataOK(struct wiimote_t* wm)
|
||||
|
||||
void handle_event(struct wiimote_t* wm)
|
||||
{
|
||||
//Console::Print("\n\n--- EVENT [id %i] ---\n", wm->unid);
|
||||
//INFO_LOG(CONSOLE, "\n\n--- EVENT [id %i] ---\n", wm->unid);
|
||||
|
||||
// if a button is pressed, report it
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_A)) Console::Print("A pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_B)) Console::Print("B pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_UP)) Console::Print("UP pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_DOWN)) Console::Print("DOWN pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_LEFT)) Console::Print("LEFT pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_RIGHT)) Console::Print("RIGHT pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_MINUS)) Console::Print("MINUS pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_PLUS)) Console::Print("PLUS pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_ONE)) Console::Print("ONE pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_A)) INFO_LOG(CONSOLE, "A pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_B)) INFO_LOG(CONSOLE, "B pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_UP)) INFO_LOG(CONSOLE, "UP pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_DOWN)) INFO_LOG(CONSOLE, "DOWN pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_LEFT)) INFO_LOG(CONSOLE, "LEFT pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_RIGHT)) INFO_LOG(CONSOLE, "RIGHT pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_MINUS)) INFO_LOG(CONSOLE, "MINUS pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_PLUS)) INFO_LOG(CONSOLE, "PLUS pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_ONE)) INFO_LOG(CONSOLE, "ONE pressed\n");
|
||||
//if (IS_PRESSED(wm, WIIMOTE_BUTTON_ONE)) g_Run = false;
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_TWO)) Console::Print("TWO pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_HOME)) Console::Print("HOME pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_TWO)) INFO_LOG(CONSOLE, "TWO pressed\n");
|
||||
if (IS_PRESSED(wm, WIIMOTE_BUTTON_HOME)) INFO_LOG(CONSOLE, "HOME pressed\n");
|
||||
|
||||
|
||||
// Pressing minus will tell the wiimote we are no longer interested in movement.
|
||||
@ -168,7 +167,7 @@ void handle_event(struct wiimote_t* wm)
|
||||
//Tmp += "Data: " + TmpData;
|
||||
|
||||
//Console::ClearScreen();
|
||||
//Console::Print("%s\n\n", Tmp.c_str());
|
||||
//INFO_LOG(CONSOLE, "%s\n\n", Tmp.c_str());
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if(frame)
|
||||
@ -214,8 +213,8 @@ void handle_event(struct wiimote_t* wm)
|
||||
// wxT("Current: %03u %03u %03u"), Gx, Gy, Gz));
|
||||
|
||||
if(frame->m_bRecording)
|
||||
Console::Print("Wiiuse Recorded accel x, y, z: %03i %03i %03i\n", Gx, Gy, Gz);
|
||||
//Console::Print("Wiiuse Recorded accel x, y, z: %02x %02x %02x\n", Gx, Gy, Gz);
|
||||
INFO_LOG(CONSOLE, "Wiiuse Recorded accel x, y, z: %03i %03i %03i\n", Gx, Gy, Gz);
|
||||
//INFO_LOG(CONSOLE, "Wiiuse Recorded accel x, y, z: %02x %02x %02x\n", Gx, Gy, Gz);
|
||||
}
|
||||
|
||||
// Send the data to be saved
|
||||
@ -233,8 +232,8 @@ void handle_event(struct wiimote_t* wm)
|
||||
/*
|
||||
if(!g_DebugData)
|
||||
{
|
||||
Console::ClearScreen();
|
||||
Console::Print("Roll:%03i Pitch:%03i\n", (int)wm->orient.roll, (int)wm->orient.pitch);
|
||||
// Console::ClearScreen();
|
||||
INFO_LOG(CONSOLE, "Roll:%03i Pitch:%03i\n", (int)wm->orient.roll, (int)wm->orient.pitch);
|
||||
}
|
||||
// Convert Roll and Pitch from 180 to 0x8000
|
||||
int Roll = (int)wm->orient.roll * (0x8000 / 180);
|
||||
@ -337,7 +336,7 @@ void ReadWiimote()
|
||||
{
|
||||
Temp = ArrayToString(g_WiiMotesFromWiiUse[0]->read_req->buf, sizeof(WiiMoteEmu::EepromData_0), 0, 30);
|
||||
memcpy(WiiMoteEmu::g_Eeprom, g_WiiMotesFromWiiUse[0]->read_req->buf, sizeof(WiiMoteEmu::EepromData_0));
|
||||
Console::Print("EEPROM: %s\n", Temp.c_str());
|
||||
INFO_LOG(CONSOLE, "EEPROM: %s\n", Temp.c_str());
|
||||
WiiMoteEmu::UpdateEeprom();
|
||||
g_RunTemporary = false;
|
||||
}
|
||||
@ -352,17 +351,17 @@ void ReadWiimote()
|
||||
*/
|
||||
//wiiuse_set_nunchuk_orient_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 90.0f);
|
||||
//wiiuse_set_nunchuk_accel_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 100);
|
||||
Console::Print("Nunchuk inserted.\n");
|
||||
INFO_LOG(CONSOLE, "Nunchuk inserted.\n");
|
||||
break;
|
||||
|
||||
case WIIUSE_CLASSIC_CTRL_INSERTED:
|
||||
Console::Print("Classic controller inserted.\n");
|
||||
INFO_LOG(CONSOLE, "Classic controller inserted.\n");
|
||||
break;
|
||||
|
||||
case WIIUSE_GUITAR_HERO_3_CTRL_INSERTED:
|
||||
// some expansion was inserted
|
||||
//handle_ctrl_status(wiimotes[i]);
|
||||
Console::Print("Guitar Hero 3 controller inserted.\n");
|
||||
INFO_LOG(CONSOLE, "Guitar Hero 3 controller inserted.\n");
|
||||
break;
|
||||
|
||||
case WIIUSE_NUNCHUK_REMOVED:
|
||||
@ -370,7 +369,7 @@ void ReadWiimote()
|
||||
case WIIUSE_GUITAR_HERO_3_CTRL_REMOVED:
|
||||
// some expansion was removed
|
||||
//handle_ctrl_status(wiimotes[i]);
|
||||
Console::Print("An expansion was removed.\n");
|
||||
INFO_LOG(CONSOLE, "An expansion was removed.\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -37,7 +37,6 @@ worked.
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#include "Common.h" // Common
|
||||
#include "StringUtil.h"
|
||||
#include "ConsoleWindow.h" // For Start, Print, GetHwnd
|
||||
#include "Timer.h"
|
||||
|
||||
#define EXCLUDEMAIN_H // Avoid certain declarations in main.h
|
||||
@ -61,6 +60,7 @@ worked.
|
||||
// Declarations and definitions
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
SWiimoteInitialize g_WiimoteInitialize;
|
||||
PLUGIN_GLOBALS* globals = NULL;
|
||||
|
||||
// General
|
||||
bool g_EmulatorRunning = false;
|
||||
@ -170,7 +170,11 @@ extern "C" void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals) {}
|
||||
void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
{
|
||||
globals = _pPluginGlobals;
|
||||
LogManager::SetInstance((LogManager *)globals->logManager);
|
||||
}
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show) {}
|
||||
|
||||
@ -229,7 +233,7 @@ extern "C" void Initialize(void *init)
|
||||
|
||||
DoInitialize();
|
||||
|
||||
Console::Print("ISOId: %08x %s\n", g_WiimoteInitialize.ISOId, Hex2Ascii(g_WiimoteInitialize.ISOId).c_str());
|
||||
INFO_LOG(CONSOLE, "ISOId: %08x %s\n", g_WiimoteInitialize.ISOId, Hex2Ascii(g_WiimoteInitialize.ISOId).c_str());
|
||||
}
|
||||
|
||||
// If a game is not running this is called by the Configuration window when it's closed
|
||||
@ -261,7 +265,7 @@ extern "C" void Shutdown(void)
|
||||
#endif
|
||||
WiiMoteEmu::Shutdown();
|
||||
|
||||
Console::Close();
|
||||
// Console::Close();
|
||||
}
|
||||
|
||||
|
||||
@ -319,7 +323,7 @@ extern "C" void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _
|
||||
// Check for custom communication
|
||||
if(_channelID == 99 && data[0] == WIIMOTE_RECONNECT)
|
||||
{
|
||||
Console::Print("\n\nWiimote Disconnected\n\n");
|
||||
INFO_LOG(CONSOLE, "\n\nWiimote Disconnected\n\n");
|
||||
g_EmulatorRunning = false;
|
||||
g_WiimoteUnexpectedDisconnect = true;
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
@ -380,10 +384,6 @@ extern "C" void Wiimote_Update()
|
||||
|
||||
// Debugging
|
||||
#ifdef _WIN32
|
||||
// Open console
|
||||
if( GetAsyncKeyState(VK_SHIFT) && GetAsyncKeyState(VK_CONTROL) && GetAsyncKeyState(VK_MENU) && GetAsyncKeyState(VK_INSERT) )
|
||||
OpenConsole();
|
||||
|
||||
if( GetAsyncKeyState(VK_HOME) && g_DebugComm ) g_DebugComm = false; // Page Down
|
||||
else if (GetAsyncKeyState(VK_HOME) && !g_DebugComm ) g_DebugComm = true;
|
||||
|
||||
@ -393,8 +393,8 @@ extern "C" void Wiimote_Update()
|
||||
if( GetAsyncKeyState(VK_NEXT) && g_DebugAccelerometer ) g_DebugAccelerometer = false; // Home
|
||||
else if (GetAsyncKeyState(VK_NEXT) && !g_DebugAccelerometer ) g_DebugAccelerometer = true;
|
||||
|
||||
if( GetAsyncKeyState(VK_END) && g_DebugCustom ) { g_DebugCustom = false; Console::Print("Custom Debug: Off\n");} // End
|
||||
else if (GetAsyncKeyState(VK_END) && !g_DebugCustom ) {g_DebugCustom = true; Console::Print("Custom Debug: Off\n");}
|
||||
if( GetAsyncKeyState(VK_END) && g_DebugCustom ) { g_DebugCustom = false; INFO_LOG(CONSOLE, "Custom Debug: Off\n");} // End
|
||||
else if (GetAsyncKeyState(VK_END) && !g_DebugCustom ) {g_DebugCustom = true; INFO_LOG(CONSOLE, "Custom Debug: Off\n");}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -417,16 +417,17 @@ extern "C" unsigned int Wiimote_GetAttachedControllers()
|
||||
// ----------------------------------------
|
||||
// Debugging window
|
||||
// ----------
|
||||
/*
|
||||
void OpenConsole(bool Open)
|
||||
{
|
||||
// Close the console window
|
||||
#ifdef _WIN32
|
||||
if (Console::GetHwnd() != NULL && !Open)
|
||||
// if (Console::GetHwnd() != NULL && !Open)
|
||||
#else
|
||||
if (false)
|
||||
#endif
|
||||
{
|
||||
Console::Close();
|
||||
// Console::Close();
|
||||
// Wait here until we have let go of the button again
|
||||
#ifdef _WIN32
|
||||
while(GetAsyncKeyState(VK_INSERT)) {Sleep(10);}
|
||||
@ -435,16 +436,16 @@ void OpenConsole(bool Open)
|
||||
}
|
||||
|
||||
// Open the console window
|
||||
Console::Open(140, 1000, "Wiimote"); // give room for 20 rows
|
||||
Console::Print("\n\nWiimote console opened\n");
|
||||
// Console::Open(140, 1000, "Wiimote"); // give room for 20 rows
|
||||
INFO_LOG(CONSOLE, "\n\nWiimote console opened\n");
|
||||
|
||||
// Move window
|
||||
#ifdef _WIN32
|
||||
//MoveWindow(Console::GetHwnd(), 0,400, 100*8,10*14, true); // small window
|
||||
//MoveWindow(Console::GetHwnd(), 400,0, 100*8,70*14, true); // big window
|
||||
MoveWindow(Console::GetHwnd(), 200,0, 140*8,70*14, true); // big wide window
|
||||
// MoveWindow(Console::GetHwnd(), 200,0, 140*8,70*14, true); // big wide window
|
||||
#endif
|
||||
}
|
||||
}*/
|
||||
// ---------------
|
||||
|
||||
// ----------------------------------------
|
||||
@ -500,7 +501,7 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
Name = "WM_STATUS_REPORT";
|
||||
{
|
||||
wm_status_report* pStatus = (wm_status_report*)(data + 2);
|
||||
Console::Print("\n"
|
||||
INFO_LOG(CONSOLE, "\n"
|
||||
"Extension Controller: %i\n"
|
||||
//"Speaker enabled: %i\n"
|
||||
//"IR camera enabled: %i\n"
|
||||
@ -566,8 +567,8 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (frame) frame->UpdateGUI();
|
||||
#endif
|
||||
Console::Print("%s", TmpData.c_str());
|
||||
Console::Print("Game got the decrypted extension ID: %02x%02x\n\n", data[7], data[8]);
|
||||
INFO_LOG(CONSOLE, "%s", TmpData.c_str());
|
||||
INFO_LOG(CONSOLE, "Game got the decrypted extension ID: %02x%02x\n\n", data[7], data[8]);
|
||||
}
|
||||
else if(data[4] == 0x50)
|
||||
{
|
||||
@ -579,8 +580,8 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (frame) frame->UpdateGUI();
|
||||
#endif
|
||||
Console::Print("%s", TmpData.c_str());
|
||||
Console::Print("Game got the decrypted extension ID: %02x%02x%02x%02x%02x%02x\n\n", data[7], data[8], data[9], data[10], data[11], data[12]);
|
||||
INFO_LOG(CONSOLE, "%s", TmpData.c_str());
|
||||
INFO_LOG(CONSOLE, "Game got the decrypted extension ID: %02x%02x%02x%02x%02x%02x\n\n", data[7], data[8], data[9], data[10], data[11], data[12]);
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------
|
||||
@ -594,13 +595,13 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
{
|
||||
if(data[6] == 0x10)
|
||||
{
|
||||
Console::Print("\nGame got the Wiimote calibration:\n");
|
||||
Console::Print("Cal_zero.x: %i\n", data[7 + 6]);
|
||||
Console::Print("Cal_zero.y: %i\n", data[7 + 7]);
|
||||
Console::Print("Cal_zero.z: %i\n", data[7 + 8]);
|
||||
Console::Print("Cal_g.x: %i\n", data[7 + 10]);
|
||||
Console::Print("Cal_g.y: %i\n", data[7 + 11]);
|
||||
Console::Print("Cal_g.z: %i\n", data[7 +12]);
|
||||
INFO_LOG(CONSOLE, "\nGame got the Wiimote calibration:\n");
|
||||
INFO_LOG(CONSOLE, "Cal_zero.x: %i\n", data[7 + 6]);
|
||||
INFO_LOG(CONSOLE, "Cal_zero.y: %i\n", data[7 + 7]);
|
||||
INFO_LOG(CONSOLE, "Cal_zero.z: %i\n", data[7 + 8]);
|
||||
INFO_LOG(CONSOLE, "Cal_g.x: %i\n", data[7 + 10]);
|
||||
INFO_LOG(CONSOLE, "Cal_g.y: %i\n", data[7 + 11]);
|
||||
INFO_LOG(CONSOLE, "Cal_g.z: %i\n", data[7 +12]);
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------
|
||||
@ -619,37 +620,37 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
|
||||
if (g_Config.bNunchuckConnected)
|
||||
{
|
||||
Console::Print("\nGame got the Nunchuck calibration:\n");
|
||||
Console::Print("Cal_zero.x: %i\n", data[7 + 0]);
|
||||
Console::Print("Cal_zero.y: %i\n", data[7 + 1]);
|
||||
Console::Print("Cal_zero.z: %i\n", data[7 + 2]);
|
||||
Console::Print("Cal_g.x: %i\n", data[7 + 4]);
|
||||
Console::Print("Cal_g.y: %i\n", data[7 + 5]);
|
||||
Console::Print("Cal_g.z: %i\n", data[7 + 6]);
|
||||
Console::Print("Js.Max.x: %i\n", data[7 + 8]);
|
||||
Console::Print("Js.Min.x: %i\n", data[7 + 9]);
|
||||
Console::Print("Js.Center.x: %i\n", data[7 + 10]);
|
||||
Console::Print("Js.Max.y: %i\n", data[7 + 11]);
|
||||
Console::Print("Js.Min.y: %i\n", data[7 + 12]);
|
||||
Console::Print("JS.Center.y: %i\n\n", data[7 + 13]);
|
||||
INFO_LOG(CONSOLE, "\nGame got the Nunchuck calibration:\n");
|
||||
INFO_LOG(CONSOLE, "Cal_zero.x: %i\n", data[7 + 0]);
|
||||
INFO_LOG(CONSOLE, "Cal_zero.y: %i\n", data[7 + 1]);
|
||||
INFO_LOG(CONSOLE, "Cal_zero.z: %i\n", data[7 + 2]);
|
||||
INFO_LOG(CONSOLE, "Cal_g.x: %i\n", data[7 + 4]);
|
||||
INFO_LOG(CONSOLE, "Cal_g.y: %i\n", data[7 + 5]);
|
||||
INFO_LOG(CONSOLE, "Cal_g.z: %i\n", data[7 + 6]);
|
||||
INFO_LOG(CONSOLE, "Js.Max.x: %i\n", data[7 + 8]);
|
||||
INFO_LOG(CONSOLE, "Js.Min.x: %i\n", data[7 + 9]);
|
||||
INFO_LOG(CONSOLE, "Js.Center.x: %i\n", data[7 + 10]);
|
||||
INFO_LOG(CONSOLE, "Js.Max.y: %i\n", data[7 + 11]);
|
||||
INFO_LOG(CONSOLE, "Js.Min.y: %i\n", data[7 + 12]);
|
||||
INFO_LOG(CONSOLE, "JS.Center.y: %i\n\n", data[7 + 13]);
|
||||
}
|
||||
else // g_Config.bClassicControllerConnected
|
||||
{
|
||||
Console::Print("\nGame got the Classic Controller calibration:\n");
|
||||
Console::Print("Lx.Max: %i\n", data[7 + 0]);
|
||||
Console::Print("Lx.Min: %i\n", data[7 + 1]);
|
||||
Console::Print("Lx.Center: %i\n", data[7 + 2]);
|
||||
Console::Print("Ly.Max: %i\n", data[7 + 3]);
|
||||
Console::Print("Ly.Min: %i\n", data[7 + 4]);
|
||||
Console::Print("Ly.Center: %i\n", data[7 + 5]);
|
||||
Console::Print("Rx.Max.x: %i\n", data[7 + 6]);
|
||||
Console::Print("Rx.Min.x: %i\n", data[7 + 7]);
|
||||
Console::Print("Rx.Center.x: %i\n", data[7 + 8]);
|
||||
Console::Print("Ry.Max.y: %i\n", data[7 + 9]);
|
||||
Console::Print("Ry.Min: %i\n", data[7 + 10]);
|
||||
Console::Print("Ry.Center: %i\n\n", data[7 + 11]);
|
||||
Console::Print("Lt.Neutral: %i\n", data[7 + 12]);
|
||||
Console::Print("Rt.Neutral %i\n\n", data[7 + 13]);
|
||||
INFO_LOG(CONSOLE, "\nGame got the Classic Controller calibration:\n");
|
||||
INFO_LOG(CONSOLE, "Lx.Max: %i\n", data[7 + 0]);
|
||||
INFO_LOG(CONSOLE, "Lx.Min: %i\n", data[7 + 1]);
|
||||
INFO_LOG(CONSOLE, "Lx.Center: %i\n", data[7 + 2]);
|
||||
INFO_LOG(CONSOLE, "Ly.Max: %i\n", data[7 + 3]);
|
||||
INFO_LOG(CONSOLE, "Ly.Min: %i\n", data[7 + 4]);
|
||||
INFO_LOG(CONSOLE, "Ly.Center: %i\n", data[7 + 5]);
|
||||
INFO_LOG(CONSOLE, "Rx.Max.x: %i\n", data[7 + 6]);
|
||||
INFO_LOG(CONSOLE, "Rx.Min.x: %i\n", data[7 + 7]);
|
||||
INFO_LOG(CONSOLE, "Rx.Center.x: %i\n", data[7 + 8]);
|
||||
INFO_LOG(CONSOLE, "Ry.Max.y: %i\n", data[7 + 9]);
|
||||
INFO_LOG(CONSOLE, "Ry.Min: %i\n", data[7 + 10]);
|
||||
INFO_LOG(CONSOLE, "Ry.Center: %i\n\n", data[7 + 11]);
|
||||
INFO_LOG(CONSOLE, "Lt.Neutral: %i\n", data[7 + 12]);
|
||||
INFO_LOG(CONSOLE, "Rt.Neutral %i\n\n", data[7 + 13]);
|
||||
}
|
||||
|
||||
// Save the values if they come from the real Wiimote
|
||||
@ -677,7 +678,7 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
}
|
||||
|
||||
// Show the encrypted data
|
||||
Console::Print("%s", TmpData.c_str());
|
||||
INFO_LOG(CONSOLE, "%s", TmpData.c_str());
|
||||
}
|
||||
// ---------------------------------------------
|
||||
|
||||
@ -720,7 +721,7 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
break;
|
||||
default:
|
||||
//PanicAlert("%s ReadDebugging: Unknown channel 0x%02x", (Emu ? "Emu" : "Real"), data[1]);
|
||||
Console::Print("%s ReadDebugging: Unknown channel 0x%02x", (Emu ? "Emu" : "Real"), data[1]);
|
||||
INFO_LOG(CONSOLE, "%s ReadDebugging: Unknown channel 0x%02x", (Emu ? "Emu" : "Real"), data[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -728,8 +729,8 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
{
|
||||
std::string TmpData = ArrayToString(data, size + 2, 0, 30);
|
||||
//LOGV(WII_IPC_WIIMOTE, 3, " Data: %s", Temp.c_str());
|
||||
Console::Print("Read[%s] %s: %s\n", (Emu ? "Emu" : "Real"), Name.c_str(), TmpData.c_str()); // No timestamp
|
||||
//Console::Print(" (%s): %s\n", Tm(true).c_str(), Temp.c_str()); // Timestamp
|
||||
INFO_LOG(CONSOLE, "Read[%s] %s: %s\n", (Emu ? "Emu" : "Real"), Name.c_str(), TmpData.c_str()); // No timestamp
|
||||
//INFO_LOG(CONSOLE, " (%s): %s\n", Tm(true).c_str(), Temp.c_str()); // Timestamp
|
||||
}
|
||||
|
||||
if (DataReport && g_DebugData)
|
||||
@ -801,7 +802,7 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
// ---------------------------------------------
|
||||
// Test the angles to x, y, z values formula by calculating the values back and forth
|
||||
// -----------
|
||||
/*Console::ClearScreen();
|
||||
/* //Console::ClearScreen();
|
||||
// Show a test of our calculations
|
||||
WiiMoteEmu::TiltTest(data[4], data[5], data[6]);
|
||||
u8 x, y, z;
|
||||
@ -840,24 +841,24 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
|
||||
// -------------------------
|
||||
|
||||
// Classic Controller data
|
||||
Console::Print("Read[%s]: %s | %s | %s | %s | %s\n", (Emu ? "Emu" : "Real"),
|
||||
INFO_LOG(CONSOLE, "Read[%s]: %s | %s | %s | %s | %s\n", (Emu ? "Emu" : "Real"),
|
||||
TmpCore.c_str(), TmpAccel.c_str(), TmpIR.c_str(), TmpExt.c_str(), CCData.c_str());
|
||||
// Formatted data only
|
||||
//Console::Print("Read[%s]: 0x%02x | %s | %s | %s\n", (Emu ? "Emu" : "Real"), data[1], RollPitch.c_str(), GForce.c_str(), IRData.c_str());
|
||||
//INFO_LOG(CONSOLE, "Read[%s]: 0x%02x | %s | %s | %s\n", (Emu ? "Emu" : "Real"), data[1], RollPitch.c_str(), GForce.c_str(), IRData.c_str());
|
||||
// IR data
|
||||
//Console::Print("Read[%s]: %s | %s\n", (Emu ? "Emu" : "Real"), TmpData.c_str(), IRData.c_str());
|
||||
//INFO_LOG(CONSOLE, "Read[%s]: %s | %s\n", (Emu ? "Emu" : "Real"), TmpData.c_str(), IRData.c_str());
|
||||
// Accelerometer data
|
||||
//Console::Print("Read[%s]: %s | %s | %s | %s | %s | %s | %s\n", (Emu ? "Emu" : "Real"),
|
||||
//INFO_LOG(CONSOLE, "Read[%s]: %s | %s | %s | %s | %s | %s | %s\n", (Emu ? "Emu" : "Real"),
|
||||
// TmpCore.c_str(), TmpAccel.c_str(), TmpIR.c_str(), TmpExt.c_str(), RollPitch.c_str(), GForce.c_str(), CCData.c_str());
|
||||
// Timestamp
|
||||
//Console::Print(" (%s): %s\n", Tm(true).c_str(), Temp.c_str());
|
||||
//INFO_LOG(CONSOLE, " (%s): %s\n", Tm(true).c_str(), Temp.c_str());
|
||||
|
||||
}
|
||||
if(g_DebugAccelerometer)
|
||||
{
|
||||
// Accelerometer only
|
||||
Console::ClearScreen();
|
||||
Console::Print("Accel x, y, z: %03u %03u %03u\n", data[4], data[5], data[6]);
|
||||
// Console::ClearScreen();
|
||||
INFO_LOG(CONSOLE, "Accel x, y, z: %03u %03u %03u\n", data[4], data[5], data[6]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -916,18 +917,18 @@ void InterruptDebugging(bool Emu, const void* _pData)
|
||||
Name.append(" REG_SPEAKER");
|
||||
if(data[6] == 7)
|
||||
{
|
||||
Console::Print("\nSound configuration:\n");
|
||||
INFO_LOG(CONSOLE, "\nSound configuration:\n");
|
||||
if(data[8] == 0x00)
|
||||
{
|
||||
memcpy(&SampleValue, &data[9], 2);
|
||||
Console::Print(" Data format: 4-bit ADPCM (%i Hz)\n", 6000000 / SampleValue);
|
||||
Console::Print(" Volume: %02i%%\n\n", (data[11] / 0x40) * 100);
|
||||
INFO_LOG(CONSOLE, " Data format: 4-bit ADPCM (%i Hz)\n", 6000000 / SampleValue);
|
||||
INFO_LOG(CONSOLE, " Volume: %02i%%\n\n", (data[11] / 0x40) * 100);
|
||||
}
|
||||
else if (data[8] == 0x40)
|
||||
{
|
||||
memcpy(&SampleValue, &data[9], 2);
|
||||
Console::Print(" Data format: 8-bit PCM (%i Hz)\n", 12000000 / SampleValue);
|
||||
Console::Print(" Volume: %02i%%\n\n", (data[11] / 0xff) * 100);
|
||||
INFO_LOG(CONSOLE, " Data format: 8-bit PCM (%i Hz)\n", 12000000 / SampleValue);
|
||||
INFO_LOG(CONSOLE, " Volume: %02i%%\n\n", (data[11] / 0xff) * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -941,7 +942,7 @@ void InterruptDebugging(bool Emu, const void* _pData)
|
||||
WiiMoteEmu::g_Encryption = true;
|
||||
else if (data[7] == 0x55)
|
||||
WiiMoteEmu::g_Encryption = false;
|
||||
Console::Print("\nExtension enryption turned %s\n\n", WiiMoteEmu::g_Encryption ? "On" : "Off");
|
||||
INFO_LOG(CONSOLE, "\nExtension enryption turned %s\n\n", WiiMoteEmu::g_Encryption ? "On" : "Off");
|
||||
}
|
||||
break;
|
||||
case 0xb0:
|
||||
@ -985,10 +986,11 @@ void InterruptDebugging(bool Emu, const void* _pData)
|
||||
case WM_SPEAKER_MUTE: // 0x19
|
||||
if (g_DebugComm) Name.append("WM_SPEAKER");
|
||||
size = 1;
|
||||
if(data[1] == 0x14)
|
||||
Console::Print("\nSpeaker %s\n\n", (data[2] == 0x06) ? "On" : "Off");
|
||||
else if(data[1] == 0x19)
|
||||
Console::Print("\nSpeaker %s\n\n", (data[2] == 0x06) ? "Muted" : "Unmuted");
|
||||
if(data[1] == 0x14) {
|
||||
INFO_LOG(CONSOLE, "\nSpeaker %s\n\n", (data[2] == 0x06) ? "On" : "Off");
|
||||
} else if(data[1] == 0x19) {
|
||||
INFO_LOG(CONSOLE, "\nSpeaker %s\n\n", (data[2] == 0x06) ? "Muted" : "Unmuted");
|
||||
}
|
||||
break;
|
||||
case WM_WRITE_SPEAKER_DATA: // 0x18
|
||||
if (g_DebugComm) Name.append("WM_SPEAKER_DATA");
|
||||
@ -997,22 +999,22 @@ void InterruptDebugging(bool Emu, const void* _pData)
|
||||
|
||||
default:
|
||||
size = 15;
|
||||
Console::Print("%s InterruptDebugging: Unknown channel 0x%02x", (Emu ? "Emu" : "Real"), data[1]);
|
||||
INFO_LOG(CONSOLE, "%s InterruptDebugging: Unknown channel 0x%02x", (Emu ? "Emu" : "Real"), data[1]);
|
||||
break;
|
||||
}
|
||||
if (g_DebugComm && !SoundData)
|
||||
{
|
||||
std::string Temp = ArrayToString(data, size + 2, 0, 30);
|
||||
//LOGV(WII_IPC_WIIMOTE, 3, " Data: %s", Temp.c_str());
|
||||
Console::Print("%s: %s\n", Name.c_str(), Temp.c_str()); // No timestamp
|
||||
//Console::Print(" (%s): %s\n", Tm(true).c_str(), Temp.c_str()); // Timestamp
|
||||
INFO_LOG(CONSOLE, "%s: %s\n", Name.c_str(), Temp.c_str()); // No timestamp
|
||||
//INFO_LOG(CONSOLE, " (%s): %s\n", Tm(true).c_str(), Temp.c_str()); // Timestamp
|
||||
}
|
||||
if (g_DebugSoundData && SoundData)
|
||||
{
|
||||
std::string Temp = ArrayToString(data, size + 2, 0, 30);
|
||||
//LOGV(WII_IPC_WIIMOTE, 3, " Data: %s", Temp.c_str());
|
||||
Console::Print("%s: %s\n", Name.c_str(), Temp.c_str()); // No timestamp
|
||||
//Console::Print(" (%s): %s\n", Tm(true).c_str(), Temp.c_str()); // Timestamp
|
||||
INFO_LOG(CONSOLE, "%s: %s\n", Name.c_str(), Temp.c_str()); // No timestamp
|
||||
//INFO_LOG(CONSOLE, " (%s): %s\n", Tm(true).c_str(), Temp.c_str()); // Timestamp
|
||||
}
|
||||
|
||||
}
|
||||
@ -1058,7 +1060,7 @@ int GetUpdateRate()
|
||||
// Calculate the time and save it
|
||||
int Time = (int)(10 / (GetDoubleTime() - g_UpdateTime));
|
||||
g_UpdateTimeList.push_back(Time);
|
||||
//Console::Print("Time: %i %f\n", Time, GetDoubleTime());
|
||||
//INFO_LOG(CONSOLE, "Time: %i %f\n", Time, GetDoubleTime());
|
||||
|
||||
int TotalTime = 0;
|
||||
for (int i = 0; i < (int)g_UpdateTimeList.size(); i++)
|
||||
@ -1099,31 +1101,3 @@ void DoInitialize()
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
// Logging functions
|
||||
//******************************************************************************
|
||||
|
||||
void __Log(int log, const char *_fmt, ...)
|
||||
{
|
||||
char Msg[512];
|
||||
va_list ap;
|
||||
|
||||
va_start( ap, _fmt );
|
||||
vsprintf( Msg, _fmt, ap );
|
||||
va_end( ap );
|
||||
|
||||
g_WiimoteInitialize.pLog(Msg, 0);
|
||||
}
|
||||
|
||||
|
||||
void __Logv(int log, int v, const char *_fmt, ...)
|
||||
{
|
||||
char Msg[512];
|
||||
va_list ap;
|
||||
|
||||
va_start( ap, _fmt );
|
||||
vsprintf( Msg, _fmt, ap );
|
||||
va_end( ap );
|
||||
|
||||
g_WiimoteInitialize.pLog(Msg, v);
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ int GetUpdateRate();
|
||||
void InterruptDebugging(bool Emu, const void* _pData);
|
||||
void ReadDebugging(bool Emu, const void* _pData, int Size);
|
||||
bool IsFocus();
|
||||
void OpenConsole(bool Open = false);
|
||||
|
||||
|
||||
// Movement recording
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "Common.h"
|
||||
#include "Thread.h"
|
||||
#include "StringUtil.h"
|
||||
#include "ConsoleWindow.h"
|
||||
#include "Timer.h"
|
||||
#include "pluginspecs_wiimote.h"
|
||||
|
||||
@ -129,7 +128,7 @@ void SendData(u16 _channelID, const u8* _pData, u32 _Size)
|
||||
|
||||
// Debugging
|
||||
//std::string Temp = ArrayToString(WriteEvent.m_PayLoad, 28, 0, 30);
|
||||
//Console::Print("Wiimote Write:\n%s\n", Temp.c_str());
|
||||
//INFO_LOG(CONSOLE, "Wiimote Write:\n%s\n", Temp.c_str());
|
||||
}
|
||||
m_pCriticalSection->Leave();
|
||||
}
|
||||
@ -146,7 +145,7 @@ void ReadData()
|
||||
// Send data to the Wiimote
|
||||
if (!m_EventWriteQueue.empty())
|
||||
{
|
||||
//Console::Print("Writing data to the Wiimote\n");
|
||||
//INFO_LOG(CONSOLE, "Writing data to the Wiimote\n");
|
||||
SEvent& rEvent = m_EventWriteQueue.front();
|
||||
wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, MAX_PAYLOAD);
|
||||
m_EventWriteQueue.pop();
|
||||
@ -194,7 +193,7 @@ void ReadData()
|
||||
//if(GetAsyncKeyState('V'))
|
||||
{
|
||||
std::string Temp = ArrayToString(pBuffer, 20, 0, 30);
|
||||
Console::Print("Data: %s\n", Temp.c_str());
|
||||
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());
|
||||
} */
|
||||
#endif
|
||||
}
|
||||
@ -309,7 +308,7 @@ void SendAcc(u8 _ReportID)
|
||||
wiiuse_io_write(WiiMoteReal::g_WiiMotesFromWiiUse[0], (byte*)DataAcc, MAX_PAYLOAD);
|
||||
|
||||
std::string Temp = ArrayToString(DataAcc, 28, 0, 30);
|
||||
Console::Print("SendAcc: %s\n", Temp.c_str());
|
||||
INFO_LOG(CONSOLE, "SendAcc: %s\n", Temp.c_str());
|
||||
|
||||
//22 00 00 _reportID 00
|
||||
}
|
||||
@ -348,7 +347,7 @@ int Initialize()
|
||||
g_WiiMotesFromWiiUse = wiiuse_init(MAX_WIIMOTES);
|
||||
g_NumberOfWiiMotes = wiiuse_find(g_WiiMotesFromWiiUse, MAX_WIIMOTES, 5);
|
||||
if (g_NumberOfWiiMotes > 0) g_RealWiiMotePresent = true;
|
||||
Console::Print("Found No of Wiimotes: %i\n", g_NumberOfWiiMotes);
|
||||
INFO_LOG(CONSOLE, "Found No of Wiimotes: %i\n", g_NumberOfWiiMotes);
|
||||
|
||||
// Remove the wiiuse_poll() threshold
|
||||
wiiuse_set_accel_threshold(g_WiiMotesFromWiiUse[0], 0);
|
||||
@ -362,7 +361,7 @@ int Initialize()
|
||||
// I don't seem to need wiiuse_connect() in Windows. But Linux needs it.
|
||||
#ifndef _WIN32
|
||||
int Connect = wiiuse_connect(g_WiiMotesFromWiiUse, MAX_WIIMOTES);
|
||||
Console::Print("Connected: %i\n", Connect);
|
||||
INFO_LOG(CONSOLE, "Connected: %i\n", Connect);
|
||||
#endif
|
||||
|
||||
// If we are connecting from the config window without a game running we flash the lights
|
||||
@ -431,13 +430,13 @@ void Shutdown(void)
|
||||
|
||||
void InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
//Console::Print("Real InterruptChannel\n");
|
||||
//INFO_LOG(CONSOLE, "Real InterruptChannel\n");
|
||||
g_WiiMotes[0]->SendData(_channelID, (const u8*)_pData, _Size);
|
||||
}
|
||||
|
||||
void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
//Console::Print("Real ControlChannel\n");
|
||||
//INFO_LOG(CONSOLE, "Real ControlChannel\n");
|
||||
g_WiiMotes[0]->SendData(_channelID, (const u8*)_pData, _Size);
|
||||
}
|
||||
|
||||
@ -447,7 +446,7 @@ void ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
|
||||
// ---------------
|
||||
void Update()
|
||||
{
|
||||
//Console::Print("Real Update\n");
|
||||
//INFO_LOG(CONSOLE, "Real Update\n");
|
||||
for (int i = 0; i < g_NumberOfWiiMotes; i++)
|
||||
{
|
||||
g_WiiMotes[i]->Update();
|
||||
|
Reference in New Issue
Block a user