Skip to content

Commit

Permalink
network: tentative fix for 2k sport games
Browse files Browse the repository at this point in the history
Fix port 5011 outbound packets instead of incoming ones for original hw
interop.
Issue #1112
  • Loading branch information
flyinghead committed Jun 16, 2023
1 parent 2511a19 commit 67a7637
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/network/picoppp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ struct socket_pair
len = r;
data = buf;
}
if (pico_sock->remote_port == short_be(5011) && len >= 5)
{
// Visual Concepts sport games
if (buf[0] == 1)
memcpy(&buf[1], &pico_sock->local_addr.ip4.addr, 4);
}

int r2 = pico_socket_send(pico_sock, data, (int)len);
if (r2 < 0)
Expand Down Expand Up @@ -332,6 +326,9 @@ static void read_from_dc_socket(pico_socket *pico_sock, sock_t nat_sock)
int r = pico_socket_read(pico_sock, buf, sizeof(buf));
if (r > 0)
{
if (pico_sock->local_port == short_be(5011) && r >= 5 && buf[0] == 1)
// Visual Concepts sport games
memcpy(&buf[1], &public_ip.addr, 4);
if (send(nat_sock, buf, r, 0) < r)
{
perror("tcp_callback send");
Expand Down

0 comments on commit 67a7637

Please sign in to comment.