mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 14:49:22 +00:00
Revert "Temp, doesn't build"
This reverts commit cf90785d59af9a295825573be7813a06b7766666.
This commit is contained in:
parent
206b6337af
commit
63afdeccc3
14 changed files with 219 additions and 71 deletions
|
@ -51,7 +51,11 @@ int I2CBusSimple::BusRead(u8 slave_addr, u8 addr, int count, u8* data_out)
|
||||||
{
|
{
|
||||||
// TODO: Does this make sense? The transmitter can't NACK a read... it's the receiver that
|
// TODO: Does this make sense? The transmitter can't NACK a read... it's the receiver that
|
||||||
// does that
|
// does that
|
||||||
data_out[i] = slave->ReadByte(addr + i);
|
auto byte = slave->ReadByte(addr + i);
|
||||||
|
if (byte.has_value())
|
||||||
|
data_out[i] = byte.value();
|
||||||
|
else
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +207,18 @@ void I2CBus::SCLRisingEdge(const bool sda)
|
||||||
ASSERT_MSG(WII_IPC, slave != nullptr,
|
ASSERT_MSG(WII_IPC, slave != nullptr,
|
||||||
"Expected device with ID {:02x} to be on the I2C bus as it was earlier",
|
"Expected device with ID {:02x} to be on the I2C bus as it was earlier",
|
||||||
i2c_address.value());
|
i2c_address.value());
|
||||||
current_byte = slave->ReadByte(device_address.value());
|
std::optional<u8> byte = slave->ReadByte(device_address.value());
|
||||||
|
if (!byte.has_value())
|
||||||
|
{
|
||||||
|
WARN_LOG_FMT(WII_IPC, "Failed to read from device {:02x} at address {:02x}",
|
||||||
|
i2c_address.value(), device_address.value());
|
||||||
|
// TODO
|
||||||
|
current_byte = 0xff;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
current_byte = byte.value();
|
||||||
|
}
|
||||||
// INFO_LOG_FMT(WII_IPC, "AVE: Read from {:02x} ({}) -> {:02x}", device_address.value(),
|
// INFO_LOG_FMT(WII_IPC, "AVE: Read from {:02x} ({}) -> {:02x}", device_address.value(),
|
||||||
// IOS::GetAVERegisterName(device_address.value()), current_byte);
|
// IOS::GetAVERegisterName(device_address.value()), current_byte);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,27 +17,30 @@ class I2CSlave
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual bool Matches(u8 slave_addr) = 0;
|
virtual bool Matches(u8 slave_addr) = 0;
|
||||||
virtual u8 ReadByte(u8 addr) = 0;
|
virtual std::optional<u8> ReadByte(u8 addr) = 0;
|
||||||
virtual bool WriteByte(u8 addr, u8 value) = 0;
|
virtual bool WriteByte(u8 addr, u8 value) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
template <u8 slave_addr_val, typename T>
|
||||||
~I2CSlave() = default;
|
class I2CSlaveSimple : I2CSlave
|
||||||
|
{
|
||||||
template<typename T>
|
public:
|
||||||
static u8 RawRead(T* reg_data, u8 addr)
|
bool Matches(u8 slave_addr) override { return slave_addr == slave_addr_val; }
|
||||||
|
std::optional<u8> ReadByte(u8 addr) { return data_bytes[addr]; }
|
||||||
|
bool WriteByte(u8 addr, u8 value)
|
||||||
{
|
{
|
||||||
static_assert(std::is_standard_layout_v<T> && std::is_trivially_copyable_v<T>);
|
data_bytes[addr] = value;
|
||||||
static_assert(sizeof(T) == 0x100);
|
return true;
|
||||||
return reinterpret_cast<u8*>(reg_data)[addr];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
union
|
||||||
static void RawWrite(T* reg_data, u8 addr, u8 value)
|
|
||||||
{
|
{
|
||||||
|
T data;
|
||||||
|
std::array<u8, 0x100> data_bytes;
|
||||||
|
};
|
||||||
|
|
||||||
static_assert(std::is_standard_layout_v<T> && std::is_trivially_copyable_v<T>);
|
static_assert(std::is_standard_layout_v<T> && std::is_trivially_copyable_v<T>);
|
||||||
static_assert(sizeof(T) == 0x100);
|
static_assert(sizeof(T) == 0x100);
|
||||||
reinterpret_cast<u8*>(reg_data)[addr] = value;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class I2CBusBase
|
class I2CBusBase
|
||||||
|
|
|
@ -29,20 +29,26 @@ void CameraLogic::DoState(PointerWrap& p)
|
||||||
// FYI: m_is_enabled is handled elsewhere.
|
// FYI: m_is_enabled is handled elsewhere.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CameraLogic::Matches(u8 slave_addr)
|
int CameraLogic::BusRead(u8 slave_addr, u8 addr, int count, u8* data_out)
|
||||||
{
|
{
|
||||||
return I2C_ADDR == slave_addr && m_is_enabled;
|
if (I2C_ADDR != slave_addr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!m_is_enabled)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return RawRead(&m_reg_data, addr, count, data_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 CameraLogic::ReadByte(u8 addr)
|
int CameraLogic::BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in)
|
||||||
{
|
{
|
||||||
return RawRead(&m_reg_data, addr);
|
if (I2C_ADDR != slave_addr)
|
||||||
}
|
return 0;
|
||||||
|
|
||||||
bool CameraLogic::WriteByte(u8 addr, u8 value)
|
if (!m_is_enabled)
|
||||||
{
|
return 0;
|
||||||
RawWrite(&m_reg_data, addr, value);
|
|
||||||
return true;
|
return RawWrite(&m_reg_data, addr, count, data_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<CameraPoint, CameraLogic::NUM_POINTS>
|
std::array<CameraPoint, CameraLogic::NUM_POINTS>
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
#include "Common/ChunkFile.h"
|
#include "Common/ChunkFile.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/I2C.h"
|
|
||||||
#include "Core/HW/WiimoteEmu/Dynamics.h"
|
#include "Core/HW/WiimoteEmu/Dynamics.h"
|
||||||
|
#include "Core/HW/WiimoteEmu/I2CBus.h"
|
||||||
#include "InputCommon/ControllerEmu/ControlGroup/Cursor.h"
|
#include "InputCommon/ControllerEmu/ControlGroup/Cursor.h"
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
|
@ -101,7 +101,7 @@ struct IRFull : IRExtended
|
||||||
};
|
};
|
||||||
static_assert(sizeof(IRFull) == 9, "Wrong size");
|
static_assert(sizeof(IRFull) == 9, "Wrong size");
|
||||||
|
|
||||||
class CameraLogic : public Common::I2CSlave
|
class CameraLogic : public I2CSlave
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// OEM sensor bar distance between LED clusters in meters.
|
// OEM sensor bar distance between LED clusters in meters.
|
||||||
|
@ -175,9 +175,9 @@ public:
|
||||||
// The real wiimote reads camera data from the i2c bus at offset 0x37:
|
// The real wiimote reads camera data from the i2c bus at offset 0x37:
|
||||||
static const u8 REPORT_DATA_OFFSET = offsetof(Register, camera_data);
|
static const u8 REPORT_DATA_OFFSET = offsetof(Register, camera_data);
|
||||||
|
|
||||||
bool Matches(u8 slave_addr) override;
|
private:
|
||||||
u8 ReadByte(u8 addr) override;
|
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) override;
|
||||||
bool WriteByte(u8 addr, u8 value) override;
|
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) override;
|
||||||
|
|
||||||
Register m_reg_data{};
|
Register m_reg_data{};
|
||||||
|
|
||||||
|
|
|
@ -71,19 +71,14 @@ void None::DoState(PointerWrap& p)
|
||||||
// Nothing needed.
|
// Nothing needed.
|
||||||
}
|
}
|
||||||
|
|
||||||
bool None::Matches(u8 slave_addr)
|
int None::BusRead(u8 slave_addr, u8 addr, int count, u8* data_out)
|
||||||
{
|
{
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<u8> None::ReadByte(u8 addr)
|
int None::BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in)
|
||||||
{
|
{
|
||||||
return std::nullopt;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
bool None::WriteByte(u8 addr, u8 value)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EncryptedExtension::ReadDeviceDetectPin() const
|
bool EncryptedExtension::ReadDeviceDetectPin() const
|
||||||
|
|
|
@ -10,15 +10,15 @@
|
||||||
|
|
||||||
#include "Common/ChunkFile.h"
|
#include "Common/ChunkFile.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/I2C.h"
|
|
||||||
#include "Core/HW/WiimoteEmu/Encryption.h"
|
#include "Core/HW/WiimoteEmu/Encryption.h"
|
||||||
|
#include "Core/HW/WiimoteEmu/I2CBus.h"
|
||||||
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
||||||
|
|
||||||
namespace WiimoteEmu
|
namespace WiimoteEmu
|
||||||
{
|
{
|
||||||
struct DesiredExtensionState;
|
struct DesiredExtensionState;
|
||||||
|
|
||||||
class Extension : public ControllerEmu::EmulatedController, public Common::I2CSlave
|
class Extension : public ControllerEmu::EmulatedController, public I2CSlave
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit Extension(const char* name);
|
explicit Extension(const char* name);
|
||||||
|
@ -56,9 +56,8 @@ private:
|
||||||
void Reset() override;
|
void Reset() override;
|
||||||
void DoState(PointerWrap& p) override;
|
void DoState(PointerWrap& p) override;
|
||||||
|
|
||||||
bool Matches(u8 slave_addr) override;
|
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) override;
|
||||||
std::optional<u8> ReadByte(u8 addr) override;
|
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) override;
|
||||||
bool WriteByte(u8 addr, u8 value) override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// This class provides the encryption and initialization behavior of most extensions.
|
// This class provides the encryption and initialization behavior of most extensions.
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
|
|
||||||
#include "Core/HW/WiimoteEmu/ExtensionPort.h"
|
#include "Core/HW/WiimoteEmu/ExtensionPort.h"
|
||||||
|
|
||||||
|
#include "Common/ChunkFile.h"
|
||||||
|
|
||||||
namespace WiimoteEmu
|
namespace WiimoteEmu
|
||||||
{
|
{
|
||||||
ExtensionPort::ExtensionPort(Common::I2CBusBase* i2c_bus) : m_i2c_bus(*i2c_bus)
|
ExtensionPort::ExtensionPort(I2CBus* i2c_bus) : m_i2c_bus(*i2c_bus)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Common/I2C.h"
|
#include "Common/ChunkFile.h"
|
||||||
#include "Core/HW/WiimoteEmu/Extension/Extension.h"
|
#include "Core/HW/WiimoteEmu/Extension/Extension.h"
|
||||||
|
#include "Core/HW/WiimoteEmu/I2CBus.h"
|
||||||
|
|
||||||
namespace WiimoteEmu
|
namespace WiimoteEmu
|
||||||
{
|
{
|
||||||
|
@ -34,14 +35,14 @@ public:
|
||||||
static constexpr u8 REPORT_I2C_SLAVE = 0x52;
|
static constexpr u8 REPORT_I2C_SLAVE = 0x52;
|
||||||
static constexpr u8 REPORT_I2C_ADDR = 0x00;
|
static constexpr u8 REPORT_I2C_ADDR = 0x00;
|
||||||
|
|
||||||
explicit ExtensionPort(Common::I2CBusBase* i2c_bus);
|
explicit ExtensionPort(I2CBus* i2c_bus);
|
||||||
|
|
||||||
bool IsDeviceConnected() const;
|
bool IsDeviceConnected() const;
|
||||||
void AttachExtension(Extension* dev);
|
void AttachExtension(Extension* dev);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Extension* m_extension = nullptr;
|
Extension* m_extension = nullptr;
|
||||||
Common::I2CBusBase& m_i2c_bus;
|
I2CBus& m_i2c_bus;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace WiimoteEmu
|
} // namespace WiimoteEmu
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
// Copyright 2019 Dolphin Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "Core/HW/WiimoteEmu/I2CBus.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
namespace WiimoteEmu
|
||||||
|
{
|
||||||
|
void I2CBus::AddSlave(I2CSlave* slave)
|
||||||
|
{
|
||||||
|
m_slaves.emplace_back(slave);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2CBus::RemoveSlave(I2CSlave* slave)
|
||||||
|
{
|
||||||
|
m_slaves.erase(std::remove(m_slaves.begin(), m_slaves.end(), slave), m_slaves.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2CBus::Reset()
|
||||||
|
{
|
||||||
|
m_slaves.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
int I2CBus::BusRead(u8 slave_addr, u8 addr, int count, u8* data_out)
|
||||||
|
{
|
||||||
|
for (auto& slave : m_slaves)
|
||||||
|
{
|
||||||
|
auto const bytes_read = slave->BusRead(slave_addr, addr, count, data_out);
|
||||||
|
|
||||||
|
// A slave responded, we are done.
|
||||||
|
if (bytes_read)
|
||||||
|
return bytes_read;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int I2CBus::BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in)
|
||||||
|
{
|
||||||
|
for (auto& slave : m_slaves)
|
||||||
|
{
|
||||||
|
auto const bytes_written = slave->BusWrite(slave_addr, addr, count, data_in);
|
||||||
|
|
||||||
|
// A slave responded, we are done.
|
||||||
|
if (bytes_written)
|
||||||
|
return bytes_written;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace WiimoteEmu
|
|
@ -0,0 +1,75 @@
|
||||||
|
// Copyright 2019 Dolphin Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
|
namespace WiimoteEmu
|
||||||
|
{
|
||||||
|
class I2CBus;
|
||||||
|
|
||||||
|
class I2CSlave
|
||||||
|
{
|
||||||
|
friend I2CBus;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~I2CSlave() = default;
|
||||||
|
|
||||||
|
virtual int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) = 0;
|
||||||
|
virtual int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) = 0;
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static int RawRead(T* reg_data, u8 addr, int count, u8* data_out)
|
||||||
|
{
|
||||||
|
static_assert(std::is_standard_layout_v<T> && std::is_trivially_copyable_v<T>);
|
||||||
|
static_assert(0x100 == sizeof(T));
|
||||||
|
|
||||||
|
// TODO: addr wraps around after 0xff
|
||||||
|
|
||||||
|
u8* src = reinterpret_cast<u8*>(reg_data) + addr;
|
||||||
|
count = std::min(count, int(reinterpret_cast<u8*>(reg_data + 1) - src));
|
||||||
|
|
||||||
|
std::copy_n(src, count, data_out);
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
static int RawWrite(T* reg_data, u8 addr, int count, const u8* data_in)
|
||||||
|
{
|
||||||
|
static_assert(std::is_standard_layout_v<T> && std::is_trivially_copyable_v<T>);
|
||||||
|
static_assert(0x100 == sizeof(T));
|
||||||
|
|
||||||
|
// TODO: addr wraps around after 0xff
|
||||||
|
|
||||||
|
u8* dst = reinterpret_cast<u8*>(reg_data) + addr;
|
||||||
|
count = std::min(count, int(reinterpret_cast<u8*>(reg_data + 1) - dst));
|
||||||
|
|
||||||
|
std::copy_n(data_in, count, dst);
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class I2CBus
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void AddSlave(I2CSlave* slave);
|
||||||
|
void RemoveSlave(I2CSlave* slave);
|
||||||
|
|
||||||
|
void Reset();
|
||||||
|
|
||||||
|
// TODO: change int to u16 or something
|
||||||
|
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out);
|
||||||
|
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Pointers are unowned:
|
||||||
|
std::vector<I2CSlave*> m_slaves;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace WiimoteEmu
|
|
@ -248,9 +248,8 @@ private:
|
||||||
ActivationStatus GetActivationStatus() const;
|
ActivationStatus GetActivationStatus() const;
|
||||||
PassthroughMode GetPassthroughMode() const;
|
PassthroughMode GetPassthroughMode() const;
|
||||||
|
|
||||||
bool Matches(u8 slave_addr) override;
|
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) override;
|
||||||
u8 ReadByte(u8 addr) override;
|
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) override;
|
||||||
bool WriteByte(u8 addr, u8 value) override;
|
|
||||||
|
|
||||||
bool ReadDeviceDetectPin() const override;
|
bool ReadDeviceDetectPin() const override;
|
||||||
|
|
||||||
|
@ -260,7 +259,7 @@ private:
|
||||||
u8 m_progress_timer = {};
|
u8 m_progress_timer = {};
|
||||||
|
|
||||||
// The port on the end of the motion plus:
|
// The port on the end of the motion plus:
|
||||||
Common::I2CBusSimple m_i2c_bus;
|
I2CBus m_i2c_bus;
|
||||||
ExtensionPort m_extension_port{&m_i2c_bus};
|
ExtensionPort m_extension_port{&m_i2c_bus};
|
||||||
};
|
};
|
||||||
} // namespace WiimoteEmu
|
} // namespace WiimoteEmu
|
||||||
|
|
|
@ -153,29 +153,30 @@ void SpeakerLogic::SetSpeakerEnabled(bool enabled)
|
||||||
m_speaker_enabled = enabled;
|
m_speaker_enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpeakerLogic::Matches(u8 slave_addr)
|
int SpeakerLogic::BusRead(u8 slave_addr, u8 addr, int count, u8* data_out)
|
||||||
{
|
{
|
||||||
return I2C_ADDR == slave_addr;
|
if (I2C_ADDR != slave_addr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return RawRead(®_data, addr, count, data_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 SpeakerLogic::ReadByte(u8 addr)
|
int SpeakerLogic::BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in)
|
||||||
{
|
{
|
||||||
return RawRead(®_data, addr);
|
if (I2C_ADDR != slave_addr)
|
||||||
}
|
return 0;
|
||||||
|
|
||||||
bool SpeakerLogic::WriteByte(u8 addr, u8 value)
|
|
||||||
{
|
|
||||||
if (0x00 == addr)
|
if (0x00 == addr)
|
||||||
{
|
{
|
||||||
SpeakerData(data_in, count, m_speaker_pan_setting.GetValue() / 100);
|
SpeakerData(data_in, count, m_speaker_pan_setting.GetValue() / 100);
|
||||||
// TODO: Does writing immediately change the decoder config even when active
|
return count;
|
||||||
// or does a write to 0x08 activate the new configuration or something?
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RawWrite(®_data, addr, value);
|
// TODO: Does writing immediately change the decoder config even when active
|
||||||
|
// or does a write to 0x08 activate the new configuration or something?
|
||||||
|
return RawWrite(®_data, addr, count, data_in);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace WiimoteEmu
|
} // namespace WiimoteEmu
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "Common/ChunkFile.h"
|
#include "Common/ChunkFile.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/I2C.h"
|
#include "Core/HW/WiimoteEmu/I2CBus.h"
|
||||||
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
||||||
|
|
||||||
namespace WiimoteEmu
|
namespace WiimoteEmu
|
||||||
|
@ -17,7 +17,7 @@ struct ADPCMState
|
||||||
|
|
||||||
class Wiimote;
|
class Wiimote;
|
||||||
|
|
||||||
class SpeakerLogic : public Common::I2CSlave
|
class SpeakerLogic : public I2CSlave
|
||||||
{
|
{
|
||||||
friend class Wiimote;
|
friend class Wiimote;
|
||||||
|
|
||||||
|
@ -63,9 +63,8 @@ private:
|
||||||
|
|
||||||
static_assert(0x100 == sizeof(Register));
|
static_assert(0x100 == sizeof(Register));
|
||||||
|
|
||||||
bool Matches(u8 slave_addr) override;
|
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) override;
|
||||||
u8 ReadByte(u8 addr) override;
|
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) override;
|
||||||
bool WriteByte(u8 addr, u8 value) override;
|
|
||||||
|
|
||||||
Register reg_data{};
|
Register reg_data{};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Common/Config/Config.h"
|
#include "Common/Config/Config.h"
|
||||||
#include "Common/I2C.h"
|
|
||||||
|
|
||||||
#include "Core/HW/WiimoteCommon/WiimoteReport.h"
|
#include "Core/HW/WiimoteCommon/WiimoteReport.h"
|
||||||
|
|
||||||
|
@ -18,6 +17,7 @@
|
||||||
#include "Core/HW/WiimoteEmu/Dynamics.h"
|
#include "Core/HW/WiimoteEmu/Dynamics.h"
|
||||||
#include "Core/HW/WiimoteEmu/Encryption.h"
|
#include "Core/HW/WiimoteEmu/Encryption.h"
|
||||||
#include "Core/HW/WiimoteEmu/ExtensionPort.h"
|
#include "Core/HW/WiimoteEmu/ExtensionPort.h"
|
||||||
|
#include "Core/HW/WiimoteEmu/I2CBus.h"
|
||||||
#include "Core/HW/WiimoteEmu/MotionPlus.h"
|
#include "Core/HW/WiimoteEmu/MotionPlus.h"
|
||||||
#include "Core/HW/WiimoteEmu/Speaker.h"
|
#include "Core/HW/WiimoteEmu/Speaker.h"
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ private:
|
||||||
MotionPlus m_motion_plus;
|
MotionPlus m_motion_plus;
|
||||||
CameraLogic m_camera_logic;
|
CameraLogic m_camera_logic;
|
||||||
|
|
||||||
Common::I2CBusSimple m_i2c_bus;
|
I2CBus m_i2c_bus;
|
||||||
|
|
||||||
ExtensionPort m_extension_port{&m_i2c_bus};
|
ExtensionPort m_extension_port{&m_i2c_bus};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue