EXI: Namespace device classes

This commit is contained in:
Lioncash
2017-03-18 21:13:12 -04:00
parent ce034a8186
commit 44fb429e7e
37 changed files with 156 additions and 53 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ bool CBoot::Load_BS2(const std::string& boot_rom_filename)
SConfig::GetDirectoryForRegion(boot_region));
// Run the descrambler over the encrypted section containing BS1/BS2
CEXIIPL::Descrambler((u8*)data.data() + 0x100, 0x1AFE00);
ExpansionInterface::CEXIIPL::Descrambler((u8*)data.data() + 0x100, 0x1AFE00);
// TODO: Execution is supposed to start at 0xFFF00000, not 0x81200000;
// copying the initial boot code to 0x81200000 is a hack.
+15 -2
View File
@@ -30,6 +30,19 @@
#include "DiscIO/Enums.h"
#include "DiscIO/Volume.h"
namespace
{
void PresetTimeBaseTicks()
{
const u64 emulated_time =
ExpansionInterface::CEXIIPL::GetEmulatedTime(ExpansionInterface::CEXIIPL::GC_EPOCH);
const u64 time_base_ticks = emulated_time * 40500000ULL;
PowerPC::HostWrite_U64(time_base_ticks, 0x800030D8);
}
} // Anonymous namespace
void CBoot::RunFunction(u32 address)
{
PC = address;
@@ -93,8 +106,8 @@ bool CBoot::EmulatedBS2_GC(bool skip_app_loader)
PowerPC::HostWrite_U32(0x4c000064, 0x80000800); // Write default FPU Handler: rfi
PowerPC::HostWrite_U32(0x4c000064, 0x80000C00); // Write default Syscall Handler: rfi
PowerPC::HostWrite_U64((u64)CEXIIPL::GetEmulatedTime(CEXIIPL::GC_EPOCH) * (u64)40500000,
0x800030D8); // Preset time base ticks
PresetTimeBaseTicks();
// HIO checks this
// PowerPC::HostWrite_U16(0x8200, 0x000030e6); // Console type
+1 -1
View File
@@ -93,7 +93,7 @@ private:
std::string m_strGPUDeterminismMode;
std::array<int, MAX_BBMOTES> iWiimoteSource;
std::array<SerialInterface::SIDevices, SerialInterface::MAX_SI_CHANNELS> Pads;
std::array<TEXIDevices, ExpansionInterface::MAX_EXI_CHANNELS> m_EXIDevice;
std::array<ExpansionInterface::TEXIDevices, ExpansionInterface::MAX_EXI_CHANNELS> m_EXIDevice;
};
void ConfigCache::SaveConfig(const SConfig& config)
+3 -3
View File
@@ -571,9 +571,9 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("MemcardBPath", &m_strMemoryCardB);
core->Get("AgpCartAPath", &m_strGbaCartA);
core->Get("AgpCartBPath", &m_strGbaCartB);
core->Get("SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD);
core->Get("SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_NONE);
core->Get("SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE);
core->Get("SlotA", (int*)&m_EXIDevice[0], ExpansionInterface::EXIDEVICE_MEMORYCARD);
core->Get("SlotB", (int*)&m_EXIDevice[1], ExpansionInterface::EXIDEVICE_NONE);
core->Get("SerialPort1", (int*)&m_EXIDevice[2], ExpansionInterface::EXIDEVICE_NONE);
core->Get("BBA_MAC", &m_bba_mac);
core->Get("TimeProfiling", &bJITILTimeProfiling, false);
core->Get("OutputIR", &bJITILOutputIR, false);
+1 -1
View File
@@ -251,7 +251,7 @@ struct SConfig : NonCopyable
std::string m_strMemoryCardB;
std::string m_strGbaCartA;
std::string m_strGbaCartB;
TEXIDevices m_EXIDevice[3];
ExpansionInterface::TEXIDevices m_EXIDevice[3];
SerialInterface::SIDevices m_SIDevice[4];
std::string m_bba_mac;
@@ -10,6 +10,8 @@
#include "Core/HW/EXI/EXI_Device.h"
#include "Core/HW/EXI/EXI_DeviceEthernet.h"
namespace ExpansionInterface
{
bool CEXIETHERNET::Activate()
{
if (IsActivated())
@@ -105,3 +107,4 @@ void CEXIETHERNET::RecvStop()
{
readEnabled.Clear();
}
} // namespace ExpansionInterface
@@ -23,6 +23,8 @@
#include <sys/socket.h>
#endif
namespace ExpansionInterface
{
#define NOTIMPLEMENTED(Name) \
NOTICE_LOG(SP1, "CEXIETHERNET::%s not implemented for your UNIX", Name);
@@ -181,3 +183,4 @@ void CEXIETHERNET::RecvStop()
NOTIMPLEMENTED("RecvStop");
#endif
}
} // namespace ExpansionInterface
@@ -165,6 +165,8 @@ bool OpenTAP(HANDLE& adapter, const std::basic_string<TCHAR>& device_guid)
} // namespace Win32TAPHelper
namespace ExpansionInterface
{
bool CEXIETHERNET::Activate()
{
if (IsActivated())
@@ -362,3 +364,4 @@ void CEXIETHERNET::RecvStop()
{
readEnabled.Clear();
}
} // namespace ExpansionInterface
+5 -3
View File
@@ -6,10 +6,8 @@
#include "Common/CommonTypes.h"
class CEXIChannel;
class IEXIDevice;
class PointerWrap;
enum TEXIDevices : int;
namespace CoreTiming
{
enum class FromThread;
@@ -21,6 +19,10 @@ class Mapping;
namespace ExpansionInterface
{
class CEXIChannel;
class IEXIDevice;
enum TEXIDevices : int;
enum
{
MAX_MEMORYCARD_SLOTS = 2,
+3
View File
@@ -13,6 +13,8 @@
#include "Core/HW/EXI/EXI_Device.h"
#include "Core/HW/MMIO.h"
namespace ExpansionInterface
{
enum
{
EXI_READ,
@@ -268,3 +270,4 @@ IEXIDevice* CEXIChannel::FindDevice(TEXIDevices device_type, int custom_index)
}
return nullptr;
}
} // namespace ExpansionInterface
+7 -2
View File
@@ -8,14 +8,18 @@
#include <memory>
#include "Common/CommonTypes.h"
class IEXIDevice;
class PointerWrap;
enum TEXIDevices : int;
namespace MMIO
{
class Mapping;
}
namespace ExpansionInterface
{
class IEXIDevice;
enum TEXIDevices : int;
class CEXIChannel
{
public:
@@ -113,3 +117,4 @@ private:
// Since channels operate a bit differently from each other
u32 m_channel_id;
};
} // namespace ExpansionInterface
+3
View File
@@ -17,6 +17,8 @@
#include "Core/HW/EXI/EXI_DeviceMic.h"
#include "Core/HW/Memmap.h"
namespace ExpansionInterface
{
void IEXIDevice::ImmWrite(u32 data, u32 size)
{
while (size--)
@@ -153,3 +155,4 @@ std::unique_ptr<IEXIDevice> EXIDevice_Create(const TEXIDevices device_type, cons
return result;
}
} // namespace ExpansionInterface
+3
View File
@@ -9,6 +9,8 @@
class PointerWrap;
namespace ExpansionInterface
{
enum TEXIDevices : int
{
EXIDEVICE_DUMMY,
@@ -64,3 +66,4 @@ private:
};
std::unique_ptr<IEXIDevice> EXIDevice_Create(TEXIDevices device_type, int channel_num);
} // namespace ExpansionInterface
@@ -8,6 +8,8 @@
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
namespace ExpansionInterface
{
CEXIAD16::CEXIAD16() = default;
void CEXIAD16::SetCS(int cs)
@@ -106,3 +108,4 @@ void CEXIAD16::DoState(PointerWrap& p)
p.Do(m_command);
p.Do(m_ad16_register);
}
} // namespace ExpansionInterface
+3
View File
@@ -8,6 +8,8 @@
class PointerWrap;
namespace ExpansionInterface
{
class CEXIAD16 : public IEXIDevice
{
public:
@@ -37,3 +39,4 @@ private:
void TransferByte(u8& byte) override;
};
} // namespace ExpansionInterface
@@ -14,6 +14,8 @@
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
namespace ExpansionInterface
{
CEXIAgp::CEXIAgp(int index)
{
m_slot = index;
@@ -381,3 +383,4 @@ void CEXIAgp::DoState(PointerWrap& p)
p.Do(m_rom_size);
p.Do(m_rw_offset);
}
} // namespace ExpansionInterface
+3
View File
@@ -11,6 +11,8 @@
class PointerWrap;
namespace ExpansionInterface
{
class CEXIAgp : public IEXIDevice
{
public:
@@ -63,3 +65,4 @@ private:
u32 m_current_cmd = 0;
u32 m_return_pos = 0;
};
} // namespace ExpansionInterface
@@ -7,6 +7,8 @@
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
namespace ExpansionInterface
{
CEXIDummy::CEXIDummy(const std::string& name) : m_name{name}
{
}
@@ -42,3 +44,4 @@ bool CEXIDummy::IsPresent() const
void CEXIDummy::TransferByte(u8& byte)
{
}
} // namespace ExpansionInterface
@@ -9,6 +9,8 @@
#include "Common/CommonTypes.h"
#include "Core/HW/EXI/EXI_Device.h"
namespace ExpansionInterface
{
// Just a dummy that logs reads and writes
// to be used for EXI devices we haven't emulated
// DOES NOT FUNCTION AS "NO DEVICE INSERTED" -> Appears as unknown device
@@ -30,3 +32,4 @@ private:
std::string m_name;
};
} // namespace ExpansionInterface
@@ -15,6 +15,8 @@
#include "Core/HW/EXI/EXI.h"
#include "Core/HW/Memmap.h"
namespace ExpansionInterface
{
// XXX: The BBA stores multi-byte elements as little endian.
// Multiple parts of this implementation depend on Dolphin
// being compiled for a little endian host.
@@ -589,3 +591,4 @@ wait_for_next:
return true;
}
} // namespace ExpansionInterface

Some files were not shown because too many files have changed in this diff Show More