merge doublemelon (#2067)

non-exhaustive (but exhausting) list of changes:

* base laid for multiple window support, but will likely require more work to work correctly
* encapsulation of frontend state for proper multi-instance support
* (JIT still needs a fix for the NDS::Current workaround but we can get there later)
* new, more flexible configuration system
This commit is contained in:
Arisotura
2024-06-15 13:52:47 +02:00
committed by GitHub
parent 8e9b88d01d
commit 25a7b1ca1d
111 changed files with 16802 additions and 5042 deletions

View File

@ -71,7 +71,7 @@ bool MACEqual(const u8* a, const u8* b);
bool MACIsBroadcast(const u8* a);
WifiAP::WifiAP(Wifi* client) : Client(client)
WifiAP::WifiAP(Wifi* client, void* userdata) : Client(client), UserData(userdata)
{
}
@ -301,7 +301,7 @@ int WifiAP::SendPacket(const u8* data, int len)
*(u16*)&LANBuffer[12] = *(u16*)&data[30]; // type
memcpy(&LANBuffer[14], &data[32], lan_len - 14);
Platform::LAN_SendPacket(LANBuffer, lan_len);
Platform::Net_SendPacket(LANBuffer, lan_len, UserData);
}
}
return len;
@ -368,14 +368,23 @@ int WifiAP::RecvPacket(u8* data)
if (ClientStatus < 2) return 0;
int rxlen = Platform::LAN_RecvPacket(LANBuffer);
if (rxlen > 0)
int rxlen = Platform::Net_RecvPacket(LANBuffer, UserData);
while (rxlen > 0)
{
// check destination MAC
if (!MACIsBroadcast(&LANBuffer[0]))
{
if (!MACEqual(&LANBuffer[0], Client->GetMAC()))
return 0;
{
rxlen = Platform::Net_RecvPacket(LANBuffer, UserData);
continue;
}
}
if (MACEqual(&LANBuffer[6], Client->GetMAC()))
{
rxlen = Platform::Net_RecvPacket(LANBuffer, UserData);
continue;
}
// packet is good