Add ability to dump Balance Board data to local udp port.

This probably won't work on Mac...
This commit is contained in:
Matthew Parlane 2013-07-03 23:01:52 +12:00
parent 3de5b1bed9
commit 998c4042c2
4 changed files with 17 additions and 1 deletions

View File

@ -409,6 +409,7 @@ void SConfig::LoadSettings()
ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false); ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);
ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false); ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false);
ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0); ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
ini.Get("Core", "BBDumpPort", &m_LocalCoreStartupParameter.iBBDumpPort, -1);
ini.Get("Core", "VBeam", &m_LocalCoreStartupParameter.bVBeamSpeedHack, false); ini.Get("Core", "VBeam", &m_LocalCoreStartupParameter.bVBeamSpeedHack, false);
ini.Get("Core", "SyncGPU", &m_LocalCoreStartupParameter.bSyncGPU, false); ini.Get("Core", "SyncGPU", &m_LocalCoreStartupParameter.bSyncGPU, false);
ini.Get("Core", "FastDiscSpeed", &m_LocalCoreStartupParameter.bFastDiscSpeed, false); ini.Get("Core", "FastDiscSpeed", &m_LocalCoreStartupParameter.bFastDiscSpeed, false);

View File

@ -36,7 +36,7 @@ SCoreStartupParameter::SCoreStartupParameter()
bMergeBlocks(false), bEnableMemcardSaving(true), bMergeBlocks(false), bEnableMemcardSaving(true),
bDPL2Decoder(false), iLatency(14), bDPL2Decoder(false), iLatency(14),
bRunCompareServer(false), bRunCompareClient(false), bRunCompareServer(false), bRunCompareClient(false),
bMMU(false), bDCBZOFF(false), iTLBHack(0), bVBeamSpeedHack(false), bMMU(false), bDCBZOFF(false), iTLBHack(0), iBBDumpPort(0), bVBeamSpeedHack(false),
bSyncGPU(false), bFastDiscSpeed(false), bSyncGPU(false), bFastDiscSpeed(false),
SelectedLanguage(0), bWii(false), SelectedLanguage(0), bWii(false),
bConfirmStop(false), bHideCursor(false), bConfirmStop(false), bHideCursor(false),
@ -65,6 +65,7 @@ void SCoreStartupParameter::LoadDefaults()
bMMU = false; bMMU = false;
bDCBZOFF = false; bDCBZOFF = false;
iTLBHack = 0; iTLBHack = 0;
iBBDumpPort = -1;
bVBeamSpeedHack = false; bVBeamSpeedHack = false;
bSyncGPU = false; bSyncGPU = false;
bFastDiscSpeed = false; bFastDiscSpeed = false;

View File

@ -122,6 +122,7 @@ struct SCoreStartupParameter
bool bMMU; bool bMMU;
bool bDCBZOFF; bool bDCBZOFF;
int iTLBHack; int iTLBHack;
int iBBDumpPort;
bool bVBeamSpeedHack; bool bVBeamSpeedHack;
bool bSyncGPU; bool bSyncGPU;
bool bFastDiscSpeed; bool bFastDiscSpeed;

View File

@ -12,6 +12,8 @@
#include "Timer.h" #include "Timer.h"
#include "Host.h" #include "Host.h"
#include "ConfigManager.h" #include "ConfigManager.h"
#include "SFML/Network.hpp"
#include "WiimoteReal.h" #include "WiimoteReal.h"
@ -210,6 +212,12 @@ bool Wiimote::Read()
if (result > 0 && m_channel > 0) if (result > 0 && m_channel > 0)
{ {
if (Core::g_CoreStartupParameter.iBBDumpPort > 0 && index == WIIMOTE_BALANCE_BOARD)
{
static sf::SocketUDP Socket;
Socket.Send((char*)rpt.data(), rpt.size(), sf::IPAddress::LocalHost, Core::g_CoreStartupParameter.iBBDumpPort);
}
// Add it to queue // Add it to queue
rpt.resize(result); rpt.resize(result);
m_read_reports.Push(std::move(rpt)); m_read_reports.Push(std::move(rpt));
@ -234,6 +242,11 @@ bool Wiimote::Write()
if (!is_speaker_data || m_last_audio_report.GetTimeDifference() > 5) if (!is_speaker_data || m_last_audio_report.GetTimeDifference() > 5)
{ {
if (Core::g_CoreStartupParameter.iBBDumpPort > 0 && index == WIIMOTE_BALANCE_BOARD)
{
static sf::SocketUDP Socket;
Socket.Send((char*)rpt.data(), rpt.size(), sf::IPAddress::LocalHost, Core::g_CoreStartupParameter.iBBDumpPort);
}
IOWrite(rpt.data(), rpt.size()); IOWrite(rpt.data(), rpt.size());
if (is_speaker_data) if (is_speaker_data)