Vita: Try to fix insta crash on real hardware

This commit is contained in:
UnknownShadow200 2023-12-06 21:17:30 +11:00
parent cf90a60117
commit b4c30b7122
3 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,6 @@
ifeq ($(strip $(PS2SDK)),)
$(error "PS2SDK must be set in your environment")
endif
BUILD_DIR = build-ps2 BUILD_DIR = build-ps2
CFILES := $(wildcard src/*.c) CFILES := $(wildcard src/*.c)

View File

@ -463,6 +463,7 @@ static void Networking_LoadIOPModules(void) {
union SocketAddress { union SocketAddress {
struct sockaddr raw; struct sockaddr raw;
struct sockaddr_in v4; struct sockaddr_in v4;
struct sockaddr_storage total; // matches size of addr returned by getaddrinfo
}; };
static int ParseHost(union SocketAddress* addr, const char* host) { static int ParseHost(union SocketAddress* addr, const char* host) {

View File

@ -387,9 +387,22 @@ cc_result Socket_CheckWritable(cc_socket s, cc_bool* writable) {
/*########################################################################################################################* /*########################################################################################################################*
*--------------------------------------------------------Platform---------------------------------------------------------* *--------------------------------------------------------Platform---------------------------------------------------------*
*#########################################################################################################################*/ *#########################################################################################################################*/
static char net_memory[256 * 1024]; // TOD: 512 * 1024 ?
static void InitNetworking(void) {
SceNetInitParam param;
param.memory = net_memory;
param.size = sizeof(net_memory);
param.flags = 0;
int ret = sceNetInit(&param);
if (ret < 0) Platform_Log1("Network init failed: %i", &ret);
}
void Platform_Init(void) { void Platform_Init(void) {
/*pspDebugSioInit();*/ /*pspDebugSioInit();*/
// TODO: sceNetInit(); InitNetworking();
epoll_id = sceNetEpollCreate("CC poll", 0); epoll_id = sceNetEpollCreate("CC poll", 0);
} }
void Platform_Free(void) { } void Platform_Free(void) { }