Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Infrastructure: sceNetInet and sceNetResolver support. #18578

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,12 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/HLE/sceNet.h
Core/HLE/sceNetAdhoc.cpp
Core/HLE/sceNetAdhoc.h
Core/HLE/sceNetInet.cpp
Core/HLE/sceNetInet.h
Core/HLE/sceNetApctl.cpp
Core/HLE/sceNetApctl.h
Core/HLE/sceNetResolver.cpp
Core/HLE/sceNetResolver.h
Core/HLE/proAdhoc.h
Core/HLE/proAdhoc.cpp
Core/HLE/proAdhocServer.h
Expand Down Expand Up @@ -2248,6 +2254,12 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/MIPS/MIPSVFPUFallbacks.h
Core/MIPS/MIPSAsm.cpp
Core/MIPS/MIPSAsm.h
Core/Net/InetCommon.cpp
Core/Net/InetCommon.h
Core/Net/NetResolver.cpp
Core/Net/NetResolver.h
Core/Net/InetSocket.cpp
Core/Net/InetSocket.h
Core/MemFault.cpp
Core/MemFault.h
Core/MemMap.cpp
Expand Down Expand Up @@ -2337,6 +2349,11 @@ include_directories(ext/libchdr/include)
target_link_libraries(${CoreLibName} Common native chdr kirk cityhash sfmt19937 xbrz xxhash rcheevos ${GlslangLibs}
${CoreExtraLibs} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_DL_LIBS})

# Winsock
if(WIN32)
target_link_libraries(${CoreLibName} ws2_32 winhttp)
endif()

if(NOT HTTPS_NOT_AVAILABLE)
target_link_libraries(${CoreLibName} naett)
if(WIN32)
Expand Down
11 changes: 11 additions & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,10 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
mPostShaderSetting[it.first] = std::stof(it.second);
}

const Section *hostOverrideSetting = iniFile.GetOrCreateSection("HostAliases");
// TODO: relocate me before PR
mHostToAlias = hostOverrideSetting->ToMap();

// Load post process shader names
vPostShaderNames.clear();
for (const auto& it : postShaderChain->ToMap()) {
Expand Down Expand Up @@ -1323,6 +1327,13 @@ bool Config::Save(const char *saveReason) {
}
}

// TODO: relocate me before PR
Section *hostOverrideSetting = iniFile.GetOrCreateSection("HostAliases");
hostOverrideSetting->Clear();
for (auto& it : mHostToAlias) {
hostOverrideSetting->Set(it.first.c_str(), it.second.c_str());
}

Section *control = iniFile.GetOrCreateSection("Control");
control->Delete("DPadRadius");

Expand Down
2 changes: 2 additions & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ struct Config {
// Networking
std::string proAdhocServer;
bool bEnableWlan;
std::map<std::string, std::string> mHostToAlias; // TODO: mPostShaderSetting
bool bEnableAdhocServer;
bool bEnableUPnP;
bool bUPnPUseOriginalPort;
Expand All @@ -453,6 +454,7 @@ struct Config {
int iFirmwareVersion;
bool bBypassOSKWithKeyboard;


// Virtual reality
bool bEnableVR;
bool bEnable6DoF;
Expand Down
25 changes: 25 additions & 0 deletions Core/HLE/FunctionWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,21 @@ template<int func(int, int, int, u32, int)> void WrapI_IIIUI() {
RETURN(retval);
}

template<int func(int, int, int, u32, u32)> void WrapI_IIIUU() {
int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
RETURN(retval);
}

template<int func(int, u32, u32, int, int)> void WrapI_IUUII() {
int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
RETURN(retval);
}

template<int func(int, u32, u32, int, int, int)> void WrapI_IUUIII() {
int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
RETURN(retval);
}

template<int func(int, const char *, int, u32, u32)> void WrapI_ICIUU() {
int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3), PARAM(4));
RETURN(retval);
Expand Down Expand Up @@ -699,6 +709,11 @@ template<int func(int, u32, u32, u32, u32, u32)> void WrapI_IUUUUU() {
RETURN(retval);
}

template<int func(int, u32, u32, int, u32, u32)> void WrapI_IUUIUU() {
int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
RETURN(retval);
}

template<int func(int, u32, int, int)> void WrapI_IUII() {
int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
RETURN(retval);
Expand Down Expand Up @@ -755,6 +770,11 @@ template<int func(int, u32, u32, u32)> void WrapI_IUUU() {
RETURN(retval);
}

template<int func(int, u32, u32, int)> void WrapI_IUUI() {
int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
RETURN(retval);
}

template<int func(int, u32, u32)> void WrapI_IUU() {
int retval = func(PARAM(0), PARAM(1), PARAM(2));
RETURN(retval);
Expand Down Expand Up @@ -800,6 +820,11 @@ template <int func(int, const char *, int)> void WrapI_ICI() {
RETURN(retval);
}

template <int func(int, const char *, u32)> void WrapI_ICU() {
int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2));
RETURN(retval);
}

template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){
u32 retval = func(PARAM(0), Memory::GetPointerWrite(PARAM(1)), Memory::GetPointerWrite(PARAM(2)), Memory::GetPointerWrite(PARAM(3)), Memory::GetPointerWrite(PARAM(4)), PARAM(5), PARAM(6) );
RETURN(retval);
Expand Down
4 changes: 4 additions & 0 deletions Core/HLE/HLETables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
#include "sceSfmt19937.h"
#include "sceG729.h"
#include "KUBridge.h"
#include "sceNetInet.h"
#include "sceNetResolver.h"

#define N(s) s

Expand Down Expand Up @@ -236,6 +238,8 @@ void RegisterAllModules() {
Register_sceFont();
Register_sceNet();
Register_sceNetAdhoc();
Register_sceNetInet();
Register_sceNetResolver();
Register_sceRtc();
Register_sceWlanDrv();
Register_sceMpeg();
Expand Down
1 change: 1 addition & 0 deletions Core/HLE/proAdhoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "Core/HLE/sceKernelMutex.h"
#include "Core/HLE/sceUtility.h"

// TODO: move this to some common set
#ifdef _WIN32
#undef errno
#undef ESHUTDOWN
Expand Down
Loading
Loading