#103912 - john_ward - Mon Sep 25, 2006 11:01 am
As far as I understand it, the ARM7 processor in the DS is the only one capable of reading the touch-screen.
I've been going through the devkitpro examples, and several of them accept touchscreen input (example: toon_shading) even though they don't have any obvious ARM7 references.
Is there something happening in the background which is setting up the ARM7 side for me, so I don't need to worry about this?
I quite like the 'generic' makefile used in the devkitpro examples and want to use them in my own developments - I'm just conscious of the fact that if I don't understand what's happening now then I'll be in trouble further down the road.
Apologies if this has been discussed before.
_________________
Michael, I've got the pistols
#103921 - Dark Knight ez - Mon Sep 25, 2006 1:03 pm
There's an IPC struct placed in shared (by ARM9 and ARM7) memory.
Amongst others, the touch positions are written in there by ARM7, and read out of there by ARM9.
The default ARM7 stub (which is used if you have not created your own) does this writing to IPC by default. Reading the touch values and such out of the IPC struct by ARM9 is done by the function(-call) scanKeys.
So, basicly, unless you want to so nifty stuff on ARM7, you won't have to worry about how to get the latest information you actually require because that's already done for you.
#104104 - john_ward - Tue Sep 26, 2006 4:52 pm
Is the default ARM7 stub you mention compiled and linked, or just linked, when you run make?
If it's not compiled (and just linked) then I'm guessing that using my own version would cause problems with the nice makefiles supplied in the devkitpro/libnds examples (in other words they'd need amending, and my makefile knowledge is awful).
If it is compiled before being linked in, then I should be able to just change the default source? (and if so, where does it live?)
Cheers.
_________________
Michael, I've got the pistols
#104111 - Sausage Boy - Tue Sep 26, 2006 5:14 pm
It's compiled and included with ndstool. If you want to code something for the arm7, take a look at the combined template.
_________________
"no offense, but this is the gayest game ever"
#104146 - john_ward - Tue Sep 26, 2006 7:32 pm
I've seen the combined template and it looks OK, but it doesn't seem to include the useful 'data' folder stuff that the standard examples use...(I could be wrong on this?)
It's frustrating as I'm a reasonably competent C programmer, but my lack of knowledge in the apparent black art of makefiles holds me back...
Thanks for the reply btw.
_________________
Michael, I've got the pistols
#104153 - Sausage Boy - Tue Sep 26, 2006 7:42 pm
Just make a data folder in the arm9 directory (for data for the arm9, which is pretty much what you want to use). The makefile should already be looking for this. You can always look in the arm9 makefile, it has a couple of useful, easily understandable lines in the beginning.
Actually, you need to modify the makefile slightly.
Locate this line:
Change it to
_________________
"no offense, but this is the gayest game ever"
#104160 - john_ward - Tue Sep 26, 2006 8:43 pm
Nice one - easier than I thought.
Again the help is much appreciated.
Now on to coding DOD:DS (!)
_________________
Michael, I've got the pistols