forked from dolphin-emu/dolphin
clang-format'ed over every touched file
This commit is contained in:
@@ -11,11 +11,11 @@
|
|||||||
#include "Core/HW/EXI/EXI_DeviceAGP.h"
|
#include "Core/HW/EXI/EXI_DeviceAGP.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceDummy.h"
|
#include "Core/HW/EXI/EXI_DeviceDummy.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP.h"
|
#include "Core/HW/EXI/EXI_DeviceEthernetTAP.h"
|
||||||
|
#include "Core/HW/EXI/EXI_DeviceEthernetTCP.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceGecko.h"
|
#include "Core/HW/EXI/EXI_DeviceGecko.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceIPL.h"
|
#include "Core/HW/EXI/EXI_DeviceIPL.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceMemoryCard.h"
|
#include "Core/HW/EXI/EXI_DeviceMemoryCard.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceMic.h"
|
#include "Core/HW/EXI/EXI_DeviceMic.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceEthernetTCP.h"
|
|
||||||
#include "Core/HW/Memmap.h"
|
#include "Core/HW/Memmap.h"
|
||||||
|
|
||||||
namespace ExpansionInterface
|
namespace ExpansionInterface
|
||||||
|
@@ -47,7 +47,6 @@ CEXIEthernetBase::CEXIEthernetBase()
|
|||||||
mac_addr = parsed.value();
|
mac_addr = parsed.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
memcpy(&m_bba_mem[BBA_NAFR_PAR0], mac_addr.data(), mac_addr.size());
|
memcpy(&m_bba_mem[BBA_NAFR_PAR0], mac_addr.data(), mac_addr.size());
|
||||||
|
|
||||||
// HACK: .. fully established 100BASE-T link
|
// HACK: .. fully established 100BASE-T link
|
||||||
@@ -582,4 +581,4 @@ wait_for_next:
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
} // namespace ExpansionInterface
|
||||||
|
@@ -7,8 +7,8 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <vector>
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include <vector>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Common/Flag.h"
|
#include "Common/Flag.h"
|
||||||
|
@@ -2,12 +2,12 @@
|
|||||||
// Licensed under GPLv2+
|
// Licensed under GPLv2+
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "Core/HW/EXI/EXI_DeviceEthernetTAP_Win32.h"
|
||||||
#include "Common/Assert.h"
|
#include "Common/Assert.h"
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP.h"
|
#include "Core/HW/EXI/EXI_DeviceEthernetTAP.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceEthernetTAP_Win32.h"
|
|
||||||
|
|
||||||
namespace Win32TAPHelper
|
namespace Win32TAPHelper
|
||||||
{
|
{
|
||||||
|
@@ -39,7 +39,8 @@ bool CEXIEthernetTCP::Activate()
|
|||||||
DEBUG_LOG(SP1, "Connecting...");
|
DEBUG_LOG(SP1, "Connecting...");
|
||||||
|
|
||||||
m_socket = std::make_unique<sf::TcpSocket>();
|
m_socket = std::make_unique<sf::TcpSocket>();
|
||||||
const sf::Socket::Status status = m_socket->connect(SConfig::GetInstance().m_bba_server, SConfig::GetInstance().m_bba_port);
|
const sf::Socket::Status status =
|
||||||
|
m_socket->connect(SConfig::GetInstance().m_bba_server, SConfig::GetInstance().m_bba_port);
|
||||||
if (status != sf::Socket::Done)
|
if (status != sf::Socket::Done)
|
||||||
{
|
{
|
||||||
ERROR_LOG(SP1, "Could not connect: %i", status);
|
ERROR_LOG(SP1, "Could not connect: %i", status);
|
||||||
@@ -102,7 +103,11 @@ void CEXIEthernetTCP::ReadThreadHandler(CEXIEthernetTCP* self)
|
|||||||
selector.add(*self->m_socket);
|
selector.add(*self->m_socket);
|
||||||
|
|
||||||
// are we currently waiting for size (4 bytes) or payload?
|
// are we currently waiting for size (4 bytes) or payload?
|
||||||
enum class SocketState { Size, Payload };
|
enum class SocketState
|
||||||
|
{
|
||||||
|
Size,
|
||||||
|
Payload
|
||||||
|
};
|
||||||
|
|
||||||
SocketState state{SocketState::Size};
|
SocketState state{SocketState::Size};
|
||||||
|
|
||||||
|
@@ -9,7 +9,10 @@
|
|||||||
#include "Common/Flag.h"
|
#include "Common/Flag.h"
|
||||||
#include "Core/HW/EXI/EXI_DeviceEthernetBase.h"
|
#include "Core/HW/EXI/EXI_DeviceEthernetBase.h"
|
||||||
|
|
||||||
namespace sf { class TcpSocket; }
|
namespace sf
|
||||||
|
{
|
||||||
|
class TcpSocket;
|
||||||
|
}
|
||||||
|
|
||||||
namespace ExpansionInterface
|
namespace ExpansionInterface
|
||||||
{
|
{
|
||||||
|
@@ -4,17 +4,15 @@
|
|||||||
|
|
||||||
#include "DolphinQt/BBAClient.h"
|
#include "DolphinQt/BBAClient.h"
|
||||||
|
|
||||||
#include <QTcpSocket>
|
|
||||||
#include <QHostAddress>
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
|
#include <QHostAddress>
|
||||||
|
#include <QTcpSocket>
|
||||||
|
|
||||||
#include "DolphinQt/BBAServer.h"
|
|
||||||
#include "DolphinQt/BBADebug.h"
|
#include "DolphinQt/BBADebug.h"
|
||||||
|
#include "DolphinQt/BBAServer.h"
|
||||||
|
|
||||||
BBAClient::BBAClient(QTcpSocket &socket, BBAServer &server) :
|
BBAClient::BBAClient(QTcpSocket& socket, BBAServer& server)
|
||||||
QObject(&server),
|
: QObject(&server), m_socket(socket), m_server(server)
|
||||||
m_socket(socket),
|
|
||||||
m_server(server)
|
|
||||||
{
|
{
|
||||||
m_socket.setParent(this);
|
m_socket.setParent(this);
|
||||||
connect(&m_socket, &QIODevice::readyRead, this, &BBAClient::ReadyRead);
|
connect(&m_socket, &QIODevice::readyRead, this, &BBAClient::ReadyRead);
|
||||||
|
@@ -30,7 +30,8 @@ private slots:
|
|||||||
void ReadyRead();
|
void ReadyRead();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class SocketState {
|
enum class SocketState
|
||||||
|
{
|
||||||
Size,
|
Size,
|
||||||
Payload
|
Payload
|
||||||
};
|
};
|
||||||
|
@@ -8,9 +8,7 @@
|
|||||||
|
|
||||||
#include "DolphinQt/BBAServer.h"
|
#include "DolphinQt/BBAServer.h"
|
||||||
|
|
||||||
BBADebug::BBADebug(BBAServer &server) :
|
BBADebug::BBADebug(BBAServer& server) : QDebug(&m_log_line), m_server(server)
|
||||||
QDebug(&m_log_line),
|
|
||||||
m_server(server)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,17 +4,15 @@
|
|||||||
|
|
||||||
#include "DolphinQt/BBAServer.h"
|
#include "DolphinQt/BBAServer.h"
|
||||||
|
|
||||||
#include <QTcpServer>
|
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
|
#include <QTcpServer>
|
||||||
#include <QTimerEvent>
|
#include <QTimerEvent>
|
||||||
|
|
||||||
#include "DolphinQt/BBAClient.h"
|
#include "DolphinQt/BBAClient.h"
|
||||||
#include "DolphinQt/BBADebug.h"
|
#include "DolphinQt/BBADebug.h"
|
||||||
|
|
||||||
BBAServer::BBAServer(QObject *parent) :
|
BBAServer::BBAServer(QObject* parent) : QObject(parent), m_server(*new QTcpServer(this))
|
||||||
QObject(parent),
|
|
||||||
m_server(*new QTcpServer(this))
|
|
||||||
{
|
{
|
||||||
connect(&m_server, &QTcpServer::newConnection, this, &BBAServer::NewConnection);
|
connect(&m_server, &QTcpServer::newConnection, this, &BBAServer::NewConnection);
|
||||||
}
|
}
|
||||||
@@ -25,7 +23,8 @@ bool BBAServer::Listen(const QHostAddress &address, quint16 port)
|
|||||||
if (result)
|
if (result)
|
||||||
LogInfo() << "Started listening on" << address << port;
|
LogInfo() << "Started listening on" << address << port;
|
||||||
else
|
else
|
||||||
LogInfo() << "Could not start listening on" << address << port << "because" << m_server.errorString();
|
LogInfo() << "Could not start listening on" << address << port << "because"
|
||||||
|
<< m_server.errorString();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,23 +4,21 @@
|
|||||||
|
|
||||||
#include "DolphinQt/BBAServerWindow.h"
|
#include "DolphinQt/BBAServerWindow.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QDialogButtonBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QPlainTextEdit>
|
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTime>
|
#include <QPlainTextEdit>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QTime>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
BBAServerWindow::BBAServerWindow(QWidget *parent) :
|
BBAServerWindow::BBAServerWindow(QWidget* parent) : QDialog(parent), m_server(this)
|
||||||
QDialog(parent),
|
|
||||||
m_server(this)
|
|
||||||
{
|
{
|
||||||
auto* vbox_layout = new QVBoxLayout(this);
|
auto* vbox_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
@@ -78,7 +76,8 @@ void BBAServerWindow::Toggle()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!m_server.Listen(m_host_addr->text(), m_port->value()))
|
if (!m_server.Listen(m_host_addr->text(), m_port->value()))
|
||||||
QMessageBox::warning(this, tr("Could not start listening!"), tr("Could not start listening:\n\n%0").arg(m_server.ErrorString()));
|
QMessageBox::warning(this, tr("Could not start listening!"),
|
||||||
|
tr("Could not start listening:\n\n%0").arg(m_server.ErrorString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
@@ -86,7 +85,8 @@ void BBAServerWindow::Toggle()
|
|||||||
|
|
||||||
void BBAServerWindow::LogOutput(const QDateTime& timestamp, const QString& log_line)
|
void BBAServerWindow::LogOutput(const QDateTime& timestamp, const QString& log_line)
|
||||||
{
|
{
|
||||||
m_log_output->appendPlainText(QStringLiteral("%0: %1").arg(timestamp.toString(QStringLiteral("HH:mm:ss.zzz")), log_line));
|
m_log_output->appendPlainText(
|
||||||
|
QStringLiteral("%0: %1").arg(timestamp.toString(QStringLiteral("HH:mm:ss.zzz")), log_line));
|
||||||
auto* scroll_bar = m_log_output->verticalScrollBar();
|
auto* scroll_bar = m_log_output->verticalScrollBar();
|
||||||
scroll_bar->setValue(scroll_bar->maximum());
|
scroll_bar->setValue(scroll_bar->maximum());
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
BBAServer server(&app);
|
BBAServer server(&app);
|
||||||
|
|
||||||
QObject::connect(&server, &BBAServer::Information, [](const QDateTime ×tamp, const QString &logLine){
|
QObject::connect(&server, &BBAServer::Information,
|
||||||
|
[](const QDateTime& timestamp, const QString& logLine) {
|
||||||
Q_UNUSED(timestamp)
|
Q_UNUSED(timestamp)
|
||||||
qInfo().noquote() << logLine;
|
qInfo().noquote() << logLine;
|
||||||
});
|
});
|
||||||
|
@@ -4,20 +4,19 @@
|
|||||||
|
|
||||||
#include "DolphinQt/Config/BBAConfigWidget.h"
|
#include "DolphinQt/Config/BBAConfigWidget.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QDialogButtonBox>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QToolButton>
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QSpinBox>
|
#include <QLineEdit>
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "Common/Network.h"
|
#include "Common/Network.h"
|
||||||
|
|
||||||
BBAConfigWidget::BBAConfigWidget(bool show_server, QWidget* parent) :
|
BBAConfigWidget::BBAConfigWidget(bool show_server, QWidget* parent) : QDialog(parent)
|
||||||
QDialog(parent)
|
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Broadband Adapter Configuration"));
|
setWindowTitle(tr("Broadband Adapter Configuration"));
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
@@ -119,7 +118,8 @@ void BBAConfigWidget::Submit()
|
|||||||
|
|
||||||
void BBAConfigWidget::GenerateMac()
|
void BBAConfigWidget::GenerateMac()
|
||||||
{
|
{
|
||||||
m_mac_addr->setText(QString::fromStdString(Common::MacAddressToString(Common::GenerateMacAddress(Common::MACConsumer::BBA))));
|
m_mac_addr->setText(QString::fromStdString(
|
||||||
|
Common::MacAddressToString(Common::GenerateMacAddress(Common::MACConsumer::BBA))));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BBAConfigWidget::TextChanged(const QString& text)
|
void BBAConfigWidget::TextChanged(const QString& text)
|
||||||
|
@@ -9,7 +9,8 @@
|
|||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
|
|
||||||
class BBAConfigWidget : public QDialog {
|
class BBAConfigWidget : public QDialog
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user