From 33761c0b65242de6ec4a00f9547de05641b42809 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 27 Aug 2013 00:22:44 +1200 Subject: [PATCH] More cleaning. --- .../Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 1 - .../Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 16 ++++------- .../IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp | 28 +++++++------------ .../Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h | 3 -- 4 files changed, 15 insertions(+), 33 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 95b1f6ee97..aa1df13536 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -67,7 +67,6 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string& static u8 key_sd [0x10] = {0xab, 0x01, 0xb9, 0xd8, 0xe1, 0x62, 0x2b, 0x08, 0xaf, 0xba, 0xd8, 0x4d, 0xbf, 0xc2, 0xa5, 0x5d}; static u8 key_ecc [0x1e] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; static u8 key_empty[0x10] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static u8 key_ecc_r[0x1e] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; // default key table u8* CWII_IPC_HLE_Device_es::keyTable[11] = { diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp index e06240bd83..657110f3bb 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -611,7 +611,6 @@ bool CWII_IPC_HLE_Device_net_ip_top::Close(u32 _CommandAddress, bool _bForce) static int inet_pton(const char *src, unsigned char *dst) { - static const char digits[] = "0123456789"; int saw_digit, octets; char ch; unsigned char tmp[4], *tp; @@ -917,9 +916,9 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress) case IOCTL_SO_INETNTOP: { - u32 af = Memory::Read_U32(BufferIn); + //u32 af = Memory::Read_U32(BufferIn); //u32 validAddress = Memory::Read_U32(BufferIn + 4); - u32 src = Memory::Read_U32(BufferIn + 8); + //u32 src = Memory::Read_U32(BufferIn + 8); char ip_s[16]; sprintf(ip_s, "%i.%i.%i.%i", Memory::Read_U8(BufferIn + 8), @@ -1126,8 +1125,8 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtlV(u32 CommandAddress) u32 _BufferIn = 0, _BufferIn2 = 0, _BufferIn3 = 0; u32 BufferInSize = 0, BufferInSize2 = 0, BufferInSize3 = 0; - u32 _BufferOut = 0, _BufferOut2 = 0, _BufferOut3 = 0; - u32 BufferOutSize = 0, BufferOutSize2 = 0, BufferOutSize3 = 0; + u32 _BufferOut = 0, _BufferOut2 = 0; + u32 BufferOutSize = 0, BufferOutSize2 = 0; if (CommandBuffer.InBuffer.size() > 0) { @@ -1155,12 +1154,7 @@ bool CWII_IPC_HLE_Device_net_ip_top::IOCtlV(u32 CommandAddress) _BufferOut2 = CommandBuffer.PayloadBuffer.at(1).m_Address; BufferOutSize2 = CommandBuffer.PayloadBuffer.at(1).m_Size; } - if (CommandBuffer.PayloadBuffer.size() > 2) - { - _BufferOut3 = CommandBuffer.PayloadBuffer.at(2).m_Address; - BufferOutSize3 = CommandBuffer.PayloadBuffer.at(2).m_Size; - } - + u32 param = 0, param2 = 0, param3, param4, param5 = 0; switch (CommandBuffer.Parameter) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp index 4dbad637b2..0fb400d2db 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp @@ -91,19 +91,19 @@ bool CWII_IPC_HLE_Device_net_ssl::IOCtl(u32 _CommandAddress) u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C); u32 Command = Memory::Read_U32(_CommandAddress + 0x0C); - - u32 ReturnValue = ExecuteCommand(Command, BufferIn, BufferInSize, BufferOut, BufferOutSize); - Memory::Write_U32(ReturnValue, _CommandAddress + 0x4); + + WARN_LOG(WII_IPC_SSL, "%s unknown %i " + "(BufferIn: (%08x, %i), BufferOut: (%08x, %i)", + GetDeviceName().c_str(), Command, + BufferIn, BufferInSize, BufferOut, BufferOutSize); + Memory::Write_U32(0, _CommandAddress + 0x4); return true; } bool CWII_IPC_HLE_Device_net_ssl::IOCtlV(u32 _CommandAddress) { - u32 ReturnValue = 0; SIOCtlVBuffer CommandBuffer(_CommandAddress); - s32 returnValue = 0; - u32 _BufferIn = 0, _BufferIn2 = 0, _BufferIn3 = 0; u32 BufferInSize = 0, BufferInSize2 = 0, BufferInSize3 = 0; @@ -507,18 +507,10 @@ _SSL_NEW_ERROR: BufferOut2, BufferOutSize2, BufferOut3, BufferOutSize3); break; } - - Memory::Write_U32(ReturnValue, _CommandAddress+4); + + // SSL return codes are written to BufferIn + Memory::Write_U32(0, _CommandAddress+4); + return true; } -u32 CWII_IPC_HLE_Device_net_ssl::ExecuteCommand(u32 _Command, - u32 _BufferIn, u32 BufferInSize, - u32 BufferOut, u32 BufferOutSize) -{ - WARN_LOG(WII_IPC_SSL, "%s unknown %i " - "(BufferIn: (%08x, %i), BufferOut: (%08x, %i)", - GetDeviceName().c_str(), _Command, - _BufferIn, BufferInSize, BufferOut, BufferOutSize); - return 0; -} diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h index a49a08f5b7..8615eeef34 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h @@ -97,9 +97,6 @@ public: static WII_SSL _SSL[NET_SSL_MAXINSTANCES]; -private: - u32 ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _BufferInSize, u32 _BufferOut, u32 _BufferOutSize); - u32 ExecuteCommandV(u32 _Parameter, SIOCtlVBuffer CommandBuffer); }; #endif