gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > How to test a dldi ?

#119399 - viruseb - Thu Feb 22, 2007 6:12 pm

Hi,
I'm wondering how to use iprintf in iointerface.c for debugging purpose.
The fact is I have a nice io_g6.c which works wonderfully and a iointerface.c (which is a simple copy/paste of io_g6.c) which doesn't work (reading's ok but not always writing). In a nutshell the same code works when integrated in fatlib and doesn't work when patched.
So if i can add some debugging output inside the g6fl it will help me greatly.

#119408 - Diddl - Thu Feb 22, 2007 8:15 pm

I have same problem with my DS Link card. Works fine on gba_nds_fat but not as DLDI.

And another problem with Neo MK5 G16 card. This DLDI file works fine with old Devkit 19a but not on Devkit20. I have no idea why. All other DLDI (except DS Link DLDI) works fine with Devkit20.

#119470 - viruseb - Fri Feb 23, 2007 9:21 am

I'm wondering if it's possible to modify the linking stage of the dldi to add stdio lib. But I don't think it will fit in 32Ko afterward.

#119486 - simonjhall - Fri Feb 23, 2007 2:04 pm

If you just wanna get some strings out, in your main() function (ie before entry to any fat stuff) malloc a bit of memory which can be used as a text buffer. Then put the address of that buffer somewhere in memory - I often trash the first instruction of the program (it's never gonna get run again, right?).

Then inside your driver when you want to print stuff out, pick up the address of the buffer and write your message into that.

To actually print the message, add code into a vblank handler (or something similar) which will print the string out.

This is what I do to do ARM7/9 comms, except with locks in there too. If you don't have locks then if your driver does two print string commands without a vertical blank in between then the first message will never appear...

Does this make any sense? Or have I explained it in a useless way? :-)

Oh and this will increase only your DLDI driver size by a tiny amount.
_________________
Big thanks to everyone who donated for Quake2

#119488 - viruseb - Fri Feb 23, 2007 2:43 pm

It's perfectly clear even if it's not the easiest way I would have dream of :)