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

Implement support for userbuffers on Wii U #16

Merged
merged 1 commit into from
Feb 18, 2024
Merged
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
6 changes: 5 additions & 1 deletion include/enet/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ typedef enum _ENetPeerState

enum
{
#ifdef __3DS__
#if defined(__WIIU__)
ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024,
// Send buffer size is limited since it cannot use userbuffers
ENET_HOST_SEND_BUFFER_SIZE = 0x10000 - 1,
#elif defined(__3DS__)
ENET_HOST_RECEIVE_BUFFER_SIZE = 0x20000,
ENET_HOST_SEND_BUFFER_SIZE = 0x20000,
#else
Expand Down
8 changes: 8 additions & 0 deletions unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,14 @@ enet_socket_create (int af, ENetSocketType type)
}
#endif

#ifdef __WIIU__
{
// Enable usage of userbuffers on Wii U
int on = 1;
setsockopt(sock, SOL_SOCKET, SO_RUSRBUF, (char *)&on, sizeof(on));
}
#endif

return sock;
}

Expand Down
Loading