#147220 - Kr00pS - Sun Dec 16, 2007 2:46 pm
Hi !
I'm new in the NDS developpement. I'm making an engine for the NDS with OpenGL, I'm using Visual C++ Express 2k5 and I want to use his debugger.
Can I do this ?
#147242 - Jesse - Mon Dec 17, 2007 2:00 am
Well. You can use Visual C++ Express 2005 as an IDE, but getting a debugger running may be problematic. I gave up trying to figure out how to run a debugger on NDS code and instead make sure my engine runs on PC as well, so I can debug all platform-independant things there. I have the same solution for both the win32 .vcproj and the NDS-makefile, which seems to be an efficent way for me to work.
I hope that helps and hopefully someone else can fill you in on the debugging possibilites.
_________________
http://www.collectingsmiles.com/colors & http://www.collectingsmiles.com/hyena
#147251 - M3d10n - Mon Dec 17, 2007 5:14 am
I don't know of any way of using the VC++ debug interface with NDS projects, sorry.
Aside from testing all platform-independent stuff (algorithms, classes, methods, functions, etc) on a Win32 stub, loads of printf() calls.
When things get crashy, I use the IDEAS debugger functionality, which is very simple: you get memory execution address, disassembled instructions viewer, register contents and a memory viewer. You can use arm-eabi-addr2line.exe to find out the corresponding source file and line for a given execution address.
#147252 - Lino - Mon Dec 17, 2007 5:51 am
In freeware versione you can view your source code (for arm9 onley).
#147444 - Peter - Thu Dec 20, 2007 8:53 pm
Kr00pS wrote: |
I'm using Visual C++ Express 2k5 and I want to use his debugger. Can I do this ? |
I've written a framework which encapsulates the hardware features and runs on NDS and MS Windows with the same interface.
This allows me to write and debug game code using the Visual Studio IDE. It requires some time to get the framework ready, but low-level functions usually tend to be not so error-prone than game code and easier fixable, at least for me. OK, the NDS low-level code must be written without the advantage of the VS debugger, but peek/poke a few registers isn't so hard ;)
Debugging with VS is much more productive and I even found errors in the NDS framework routines by stepping through the windows code and keep in mind that only the low-level routines have to be implemented for each platform.
In my opinion developing a game with the rather common "printf debugging faculties" is wasting time. Don't know why people in 2007 still go this way 8-)
_________________
Kind Regards,
Peter
#147446 - M3d10n - Thu Dec 20, 2007 9:48 pm
I can't run my entire game off VC++ yet, but I setup a testbed VC project for testing my game classes (without rendering yet). It was vital to develop the quaternion and curve classes I use for my animations. Right now I'm using it to write my particle system.
I simply include the source and header files into this project, straight from the NDS project source folder. I got a dummy nds.h header in the same folder as the Win32 source files to allow the DS sources to compile under windows without major changes.
#147449 - Peter - Thu Dec 20, 2007 10:30 pm
M3d10n wrote: |
It was vital to develop the quaternion and curve classes I use for my animations. |
I use the D3DX math functions for reference/units tests. This helped me to find errors in my math routines very very easily and there are no bad suprises anymore, or at least reduced to a minimum. Every time the window version of my framework starts, it runs all unit tests. It's a bit more work to maintain the testcases, but since you have most math stuff done there remains only little work. The best thing for me about this is when I change something in the core, I immediately see if it broke something. Oh yeah, helped me to sort out things right from the beginning!
_________________
Kind Regards,
Peter
#147466 - M3d10n - Fri Dec 21, 2007 3:56 am
Hmm, sounds like a good idea.
I'm writing my own math stuff on demand, based on what needs come up on the project I'm working on. I debug them manually and never thought about setting up automated tests using already existing functions to check if they are performing as they should.
Gotta read more about unit testing. I assume it means having code that tests my methods/functions and reports if the outputs are within expected ranges?
#147477 - Peter - Fri Dec 21, 2007 8:52 am
M3d10n wrote: |
I assume it means having code that tests my methods/functions and reports if the outputs are within expected ranges? |
Exactly! Unit testing can be done very easily on "framework" stuff, since it's most just functions that operate seperate from each other. For game related code I don't think it makes sense to setup tests or at least it's much more difficult.
Several years ago I saw neat idea from Trinigy. They held a seminar about their 3d engine and unit testing. They came up with the idea, in order to drive visual tests (e.g. checking if particle systems behave as expected) by capturing a screenshot from a working version of their test. This screenshot severed for automated comparision of later tests and when the screenshots differ, they know something has changed. This can be done with the display capture maybe too. You could use it to test if your animations are rendered correctly or whatever.
_________________
Kind Regards,
Peter
#147526 - M3d10n - Sat Dec 22, 2007 4:59 am
Hmm, the visual comparison thing could also be useful for testing code which deals with textures, tiles and sprites.
I read a bit about test frameworks. Any recommendations? I've been looking into the boost one, looks simple and direct to the point enough for me.