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 > first arm7 test

#129199 - naleksiev - Sun May 20, 2007 4:43 pm

Hello. This is my arm7 test.

Code:
void VblankHandler(void)
{
   BG_PALETTE_SUB[1]++;
}

int main()
{
   irqInit();
   irqSet(IRQ_VBLANK, VblankHandler);

   // Keep the ARM7 idle
   while (1) swiWaitForVBlank();
}


I was hoping to figured out if my arm7 code works at all before I start writing the real functionality, unfortunately it doesn't.

If I add the VblankHandler to my arm9 code I can see the background changing

Code:
void VblankHandler(void)
{
   BG_PALETTE_SUB[1]++;
}


I couldn't find what's wrong with my code.
- Is my code wrong and why?
- Is there something special that I need to do to make both CPUs boot? Right now I just compile the arm7 and arm9 parts separately and then combine them with ndstool.exe from devkitARM.

#129205 - Lick - Sun May 20, 2007 6:01 pm

ARM7 doesn't have access to the 2D graphics engine.

You really should download the libnds examples and use the template projects. Those contain prewritten Makefiles and a lot of good stuff.
_________________
http://licklick.wordpress.com

#129214 - naleksiev - Sun May 20, 2007 6:36 pm

I know about this template and still I want to use my Makefile, it's using the same steps as the template.

I notice that arm7 doesn't have any of the graphics defines. So I add the define BG_PALETTE_SUB . Is this what you mean by arm7 doesn't have access to the 2D graphics engine? Or maybe it doesn't have access to the this part of the memory?

Code:
#define BG_PALETTE_SUB   ((uint16*)0x05000400)

#129220 - tepples - Sun May 20, 2007 6:53 pm

naleksiev wrote:
I notice that arm7 doesn't have any of the graphics defines. So I add the define BG_PALETTE_SUB . Is this what you mean by arm7 doesn't have access to the 2D graphics engine? Or maybe it doesn't have access to the this part of the memory?

The latter is the case. You will need to run graphics code on the ARM9.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#129228 - naleksiev - Sun May 20, 2007 7:30 pm

Thank you!

I'll assume that my arm7 code is executed correct and I'll proceed with the sound code for it.

#129366 - naleksiev - Tue May 22, 2007 4:15 am

Finally I can send all messages I want to the arm7 and my sound is working. Once I setup the sound channel I can't modify it. For example I tried to change the panning but nothing is changing in the sound. Also I tried to play a new sound on the same channel also without success.
The only way I can modify something or run a new sound is if I first stop the channel and then setup a new one.
But then I have another issue it can't be done in the same frame.

Can someone give me an idea what's wrong. Is there a workaround or maybe gave me some docs about sound on NDS.

Thank you.

#129408 - Lick - Tue May 22, 2007 4:17 pm

Panning: it should be changeable while the channel is playing.

Another sound: use another channel.

Docs: try gbatek. (gzipped)
_________________
http://licklick.wordpress.com

#129409 - naleksiev - Tue May 22, 2007 4:24 pm

I'm 90% sure it's not changeable :( Or maybe I need to do something else after I set the panning bits?

I'll give a try to be sure it wasn't my fault.

And thank you for the specification.