Page 1 of 1
ARM7 & ARM9
Posted: Sun Oct 31, 2010 1:01 pm
by HeavyDude
Probably a very silly question but...
When adding sound and keyboard routines for homebrew do you need to add ARM7 specific files or can you put everything in the same file? And does the toolchain/compiler whatever sort everything out for you?
Secondly what are the best compiler options for ensuring your code runs as fast as possible?
I might be being completely stupid but I thought I'd ask.
Re: ARM7 & ARM9
Posted: Sun Oct 31, 2010 4:33 pm
by Izhido
You no longer need a custom ARM7 segment in order to use all of the DS hardware. If you do not have a very specific, special need to build an ARM7 segment, don't use it. Check the "arm9" project in /examples/nds/templates. That's all you need to get started
.
Re: ARM7 & ARM9
Posted: Mon Nov 01, 2010 10:46 am
by WinterMute
You really shouldn't put everything in the same file unless it's a very, very simple project. Splitting your code up over several source files makes your compile time shorter which leads to greater productivity. At the very least your data should be compiled separately or loaded from the filesystem on demand.
There are no particular compiler options to make sure your code runs as fast as possible - this is done by determining which parts of your code take the most time and adjusting the algorithms and/or amount of code in those sections.
Re: ARM7 & ARM9
Posted: Mon Nov 01, 2010 12:10 pm
by HeavyDude
Thanks for that, no I wasn't going to put all the code in the same file I was merely asking if the key input and sound stuff should be kept separate from the other code because it's ARM7 related.
Basically I got confused because I've read up and noticed ARM7 stuff in a separate file but when checking the examples there doesn't seem to a need to do so.
Anyway my code for the buttons and touch screen all work as expected and the DS is making noise when required (albeit not very tuneful).
I guess I've, in a way, answered my own question there.
In response to your second reply, how does the DS like the code written?
For example
Code: Select all
z=get_pixel_value(x,y);
adjust_colour(z);
or
Code: Select all
adjust_colour(get_pixel_value(x,y));
I'm just trying to get an idea on how to write my code to get the best out of the compiler and the DS. I get the feeling, having read up a bit, that you wouldn't write the code in the same way you would for Win32. (I could be totally wrong of course!)