set wifi time interval to 34 cycles instead of 33. games seem sensitive to the general timing of wifi vs the rest of the system, and this seems to make things run better, atleast until I rewrite this to use a proper scheduler.

This commit is contained in:
Arisotura 2022-08-27 11:42:43 +02:00
parent 728eb38b88
commit 47bc7bb323
1 changed files with 17 additions and 3 deletions

View File

@ -582,8 +582,8 @@ void SendMPReply(u16 clienttime, u16 clientmask)
slot->Valid = false; slot->Valid = false;
} }
if (RAM[slot->Addr+4] > 0) //if (RAM[slot->Addr+4] > 0)
printf("REPLY RETRY COUNTER %d\n", RAM[slot->Addr+4]); // printf("REPLY RETRY COUNTER %d (%04X)\n", RAM[slot->Addr+4], IOPORT(W_TXSlotReply2));
// this seems to be set upon IRQ0 // this seems to be set upon IRQ0
// TODO: how does it behave if the packet addr is changed before it gets sent? (maybe just not possible) // TODO: how does it behave if the packet addr is changed before it gets sent? (maybe just not possible)
@ -1254,6 +1254,12 @@ bool CheckRX(int type) // 0=regular 1=MP replies 2=MP host frames
// make RX header // make RX header
/*if ((rxflags&0xF)==0xD)
{
u16 clientfail = *(u16*)&RXBuffer[12+0x1A];
if (clientfail) printf("CLIENT FAIL: %04X\n", clientfail);
}*/
if (bssidmatch) rxflags |= 0x8000; if (bssidmatch) rxflags |= 0x8000;
*(u16*)&RXBuffer[0] = rxflags; *(u16*)&RXBuffer[0] = rxflags;
@ -1551,7 +1557,8 @@ void USTimer(u32 param)
// TODO: make it more accurate, eventually // TODO: make it more accurate, eventually
// in the DS, the wifi system has its own 22MHz clock and doesn't use the system clock // in the DS, the wifi system has its own 22MHz clock and doesn't use the system clock
NDS::ScheduleEvent(NDS::Event_Wifi, true, 33, USTimer, 0); //NDS::ScheduleEvent(NDS::Event_Wifi, true, 33, USTimer, 0);
NDS::ScheduleEvent(NDS::Event_Wifi, true, 34, USTimer, 0);
} }
@ -2052,6 +2059,13 @@ void Write(u32 addr, u16 val)
case 0xD0: case 0xD0:
printf("RXFILTER=%04X\n", val); printf("RXFILTER=%04X\n", val);
break; break;
case 0x94:
/*{
u32 pc = NDS::GetPC(1);
if (pc != 0x027F027C && pc != 0x027EBBD4)
printf("SET REPLY1 TO %04X, %08X\n", val, pc);
}*/
break;
default: default:
//printf("WIFI unk: write %08X %04X\n", addr, val); //printf("WIFI unk: write %08X %04X\n", addr, val);