Jump to content

Recommended Posts

Posted

Got TetattDS to work with 0.3b! I guess this is a problem with my D-Link DI-524 as I plugged both my PC and DS into it

(DS via wifi, ofcourse), and addressed my PC directly using its IP, and the game works. If my PC is outside DI-524, then it

doesn't work. Also wifi_example1 works perfectly with my UDP code plugged into it, if PC and DS are both in 192.168.0.*

under DI-524. With 0.3a this didn't work either.

 

Now back to my own game, it sends one UDP and the PC recieves it, and at the very same moment the PC recieves the

UDP packet my DS freezes. sendto() on the DS returns 1 (one byte payload there), so the freezing comes later. Perhaps

the interrupts get fuxored?

 

More investigations needed... :) But looks pretty good so far...

Posted

Seems that on the ARM9 side when it gets an IPC_FIFO_NOT_EMPTY interrupt (after sending that one UDP packet

to my PC server), and calls Wifi_Sync() in the interrupt handler, the game just freezes. What can happen in Wifi_Sync()

that makes the program freeze? It never returns from that while-loop? Why? It's hard to say what the code does...

Out of memory error?

 

Have to take a look at how libnds handles the interrupts, but here's mine:

 

void irqHandler(void) {

 if (REG_IF & BIT_IE_T3) {
// handle timer 3
Wifi_Timer(50);

// end
IRQ_CHECK |= BIT_IE_T3;
REG_IF |= BIT_IE_T3;
 }

 if (REG_IF & BIT_IE_IPC_FIFO_NOT_EMPTY) {
// handle IPC FIFO not empty
u32 i = REG_IPCFIFORECV;
if (i == 0x87654321)
  Wifi_Sync();

// end
IRQ_CHECK |= BIT_IE_IPC_FIFO_NOT_EMPTY;
REG_IF |= BIT_IE_IPC_FIFO_NOT_EMPTY;
 }

 if (REG_IF & BIT_IE_VBI) {
// handle vblank

// end
IRQ_CHECK |= BIT_IE_VBI;
REG_IF |= BIT_IE_VBI;
 }
}

Posted

It works! I guess... :( And I hope it does work tomorrow as well... :huh: Anyway, I disabled all dynamic memory allocations from

the sgIP_Config.h, and made wHeapAllocInit() to use a static buffer. Could be fixed prettier, but this works for me. :)

 

Yay! :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...