Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add ability to dump Balance Board data to local udp port.
This probably won't work on Mac...
  • Loading branch information
Parlane committed Jul 3, 2013
1 parent 3de5b1b commit 998c404
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/Core/Core/Src/ConfigManager.cpp
Expand Up @@ -409,6 +409,7 @@ void SConfig::LoadSettings()
ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);
ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false);
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", "SyncGPU", &m_LocalCoreStartupParameter.bSyncGPU, false);
ini.Get("Core", "FastDiscSpeed", &m_LocalCoreStartupParameter.bFastDiscSpeed, false);
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/CoreParameter.cpp
Expand Up @@ -36,7 +36,7 @@ SCoreStartupParameter::SCoreStartupParameter()
bMergeBlocks(false), bEnableMemcardSaving(true),
bDPL2Decoder(false), iLatency(14),
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),
SelectedLanguage(0), bWii(false),
bConfirmStop(false), bHideCursor(false),
Expand Down Expand Up @@ -65,6 +65,7 @@ void SCoreStartupParameter::LoadDefaults()
bMMU = false;
bDCBZOFF = false;
iTLBHack = 0;
iBBDumpPort = -1;
bVBeamSpeedHack = false;
bSyncGPU = false;
bFastDiscSpeed = false;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Src/CoreParameter.h
Expand Up @@ -122,6 +122,7 @@ struct SCoreStartupParameter
bool bMMU;
bool bDCBZOFF;
int iTLBHack;
int iBBDumpPort;
bool bVBeamSpeedHack;
bool bSyncGPU;
bool bFastDiscSpeed;
Expand Down
13 changes: 13 additions & 0 deletions Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
Expand Up @@ -12,6 +12,8 @@
#include "Timer.h"
#include "Host.h"
#include "ConfigManager.h"
#include "SFML/Network.hpp"


#include "WiimoteReal.h"

Expand Down Expand Up @@ -210,6 +212,12 @@ bool Wiimote::Read()

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
rpt.resize(result);
m_read_reports.Push(std::move(rpt));
Expand All @@ -234,6 +242,11 @@ bool Wiimote::Write()

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());

if (is_speaker_data)
Expand Down

0 comments on commit 998c404

Please sign in to comment.