libnds 1.3.5 / 1.3.8 FIFO problem
Posted: Sun Sep 20, 2009 9:14 pm
Hi,
I have a little problem with the FIFO based arm9->arm7 communication in the last libnds...
Actually in my 'work in progress' emulator, after a while (some minutes), X / Y keys and stylus are not working anymore...
In my code I use only arm9 -> arm7 communication for sound, and when the problem occurs sound is still working... => FIFO ARM9 => ARM7 works
I've added a debug test arm7 -> arm9 communication => FIFO ARM7 => ARM9 stops after a while
Some informations about my homebrew :
- ARM7 and ARM9 are both compiled -marm & -O3 switchs
- problem does not occur when compiled with libnds 1.3.1 / 1.3.3 (but my HBL interrupt handler is not stable with those versions on DS)
- problem occurs both on hard & no$gba emulator
- FIFO doesn't work at all with libnds 1.3.4 (in my homebrew)
- I've added some visual debug informations and recompiled the lib :
/*static*/ void fifoInternalRecvInterrupt() {
REG_IE &= ~IRQ_FIFO_NOT_EMPTY;
REG_IME=1;
u32 data, block=FIFO_BUFFER_TERMINATE;
while( !(REG_IPC_FIFO_CR & IPC_FIFO_RECV_EMPTY) ) {
data = REG_IPC_FIFO_RX;
REG_IME=0;
block=fifo_allocBlock();
if (block != FIFO_BUFFER_TERMINATE ) {
FIFO_BUFFER_DATA(block)=data;
fifo_queueBlock(&fifo_receive_queue,block,block);
}
else {
#ifdef ARM9
#define BG_PALETTE ((u16*)0x05000000)/** \brief background palette memory*/
BG_PALETTE[0] = BG_PALETTE[0] + 1;
#endif
}
REG_IME=1;
}
- When the problem occurs screen is flashing so it's seems fifo_allocBlock() in fifoInternalRecvInterrupt() return FIFO_BUFFER_TERMINATE...
Edit: Tested with FIFO_BUFFER_ENTRIES 1024 on ARM9 part... Problem still occurs... But later
I have a little problem with the FIFO based arm9->arm7 communication in the last libnds...
Actually in my 'work in progress' emulator, after a while (some minutes), X / Y keys and stylus are not working anymore...
In my code I use only arm9 -> arm7 communication for sound, and when the problem occurs sound is still working... => FIFO ARM9 => ARM7 works
I've added a debug test arm7 -> arm9 communication => FIFO ARM7 => ARM9 stops after a while
Some informations about my homebrew :
- ARM7 and ARM9 are both compiled -marm & -O3 switchs
- problem does not occur when compiled with libnds 1.3.1 / 1.3.3 (but my HBL interrupt handler is not stable with those versions on DS)
- problem occurs both on hard & no$gba emulator
- FIFO doesn't work at all with libnds 1.3.4 (in my homebrew)
- I've added some visual debug informations and recompiled the lib :
/*static*/ void fifoInternalRecvInterrupt() {
REG_IE &= ~IRQ_FIFO_NOT_EMPTY;
REG_IME=1;
u32 data, block=FIFO_BUFFER_TERMINATE;
while( !(REG_IPC_FIFO_CR & IPC_FIFO_RECV_EMPTY) ) {
data = REG_IPC_FIFO_RX;
REG_IME=0;
block=fifo_allocBlock();
if (block != FIFO_BUFFER_TERMINATE ) {
FIFO_BUFFER_DATA(block)=data;
fifo_queueBlock(&fifo_receive_queue,block,block);
}
else {
#ifdef ARM9
#define BG_PALETTE ((u16*)0x05000000)/** \brief background palette memory*/
BG_PALETTE[0] = BG_PALETTE[0] + 1;
#endif
}
REG_IME=1;
}
- When the problem occurs screen is flashing so it's seems fifo_allocBlock() in fifoInternalRecvInterrupt() return FIFO_BUFFER_TERMINATE...
Edit: Tested with FIFO_BUFFER_ENTRIES 1024 on ARM9 part... Problem still occurs... But later