ARM7 & ARM9

support for the ARM toolchain
Post Reply
HeavyDude
Posts: 14
Joined: Sun Oct 31, 2010 12:55 pm

ARM7 & ARM9

Post by HeavyDude » Sun Oct 31, 2010 1:01 pm

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.

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: ARM7 & ARM9

Post by Izhido » Sun Oct 31, 2010 4:33 pm

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 :) .

WinterMute
Site Admin
Posts: 1865
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: ARM7 & ARM9

Post by WinterMute » Mon Nov 01, 2010 10:46 am

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

HeavyDude
Posts: 14
Joined: Sun Oct 31, 2010 12:55 pm

Re: ARM7 & ARM9

Post by HeavyDude » Mon Nov 01, 2010 12:10 pm

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!)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests