Skip to content

Commit

Permalink
DEV9: Add adapter reset function
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastRar authored and refractionpcsx2 committed Mar 27, 2022
1 parent 284ec35 commit b23873e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pcsx2/DEV9/net.cpp
Expand Up @@ -67,6 +67,12 @@ void tx_put(NetPacket* pkt)
//pkt must be copied if its not processed by here, since it can be allocated on the callers stack
}

void ad_reset()
{
if (nif != nullptr)
nif->reset();
}

NetAdapter* GetNetAdapter()
{
NetAdapter* na = nullptr;
Expand Down
3 changes: 3 additions & 0 deletions pcsx2/DEV9/net.h
Expand Up @@ -117,6 +117,7 @@ class NetAdapter
virtual bool isInitialised() = 0;
virtual bool recv(NetPacket* pkt); //gets a packet
virtual bool send(NetPacket* pkt); //sends the packet and deletes it when done
virtual void reset(){};
virtual void reloadSettings() = 0;
virtual void close(){};
virtual ~NetAdapter();
Expand Down Expand Up @@ -145,6 +146,8 @@ class NetAdapter
};

void tx_put(NetPacket* ptr);
void ad_reset();

void InitNet();
void ReconfigureLiveNet(const Pcsx2Config& old_config);
void TermNet();
1 change: 1 addition & 0 deletions pcsx2/DEV9/smap.cpp
Expand Up @@ -267,6 +267,7 @@ void emac3_write(u32 addr)
if (value == 0x380f0000)
{
Console.WriteLn("DEV9: Adapter Detection Hack - Resetting RX/TX");
ad_reset();
_DEV9irq(SMAP_INTR_RXEND | SMAP_INTR_TXEND | SMAP_INTR_TXDNV, 5);
}
break;
Expand Down

0 comments on commit b23873e

Please sign in to comment.