#39817 - FeaRog - Tue Apr 12, 2005 5:46 pm
Hey,
I've been trying to read from the GBA cart in the ARM9 code, and it always seems to return zero. Trying to DMA from it also doesn't seem to work. I can access it fine using the ARM7, but I'd much rather use the ARM9 if possible.
Does anyone know if it is possible? If so, how exactly? I must be missing something.
Also, do we have any RPC or semaphore mechanisms to communicate between the two processors?
Cheers!
#39862 - tepples - Wed Apr 13, 2005 12:22 am
I have no experience with the Nintendo DS in specific, but given that the ARM7 CPU has been compared to the "I/O processors" in the Jaguar and PS2, here's how I'd design it on a high level.
On ARM7:
Put something like gbfs_copy_obj() on the ARM7. Then make a wrapper around it that takes a list of files and a destination address and copies them from ROM. Have your ARM7 main code repeatedly check a "start" flag in shared memory and, once it becomes set, process the list and set a "finish" flag.
On ARM9:
Construct a list of files to be copied into RAM, set the start flag, and do other things while waiting for the finish flag to become set.
This will work, but having the ARM7 spin on "start" may not be the best idea battery-consumption-wise.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#39865 - FeaRog - Wed Apr 13, 2005 12:45 am
Thats essentially what I'm doing, but the performance is shocking. The ARM7 spinning on the flag in shared memory seems to be killing performance. The swiWaitForVBlank() function doesn't seem to work at the moment, so without that wait it is continually checking the flag and hogging the memory bus. I don't want to load everything at the start and then stop the loader (if I were doing that I'd just compile everything into the main executable). Performance would probably be much improved with a decent delay between checks, or a different communication mechanism between the two (semaphores? RPC? anyone know what options we have here?)
If possible I'd still like to use the arm9 for it. An interest point of note is that while I can't upload a texture to VRAM directly from the GBA cart, it seems that I can DMA a display list directly from it (!) I'll have to do some more testing to quadruple-check this one and make sure I'm not smoking something...
#39866 - tepples - Wed Apr 13, 2005 12:48 am
FeaRog wrote: |
The swiWaitForVBlank() function doesn't seem to work at the moment, so without that wait it is continually checking the flag and hogging the memory bus [...] Performance would probably be much improved with a decent delay between checks, or a different communication mechanism between the two (semaphores? RPC? anyone know what options we have here?) |
You could have it spin while waiting for hblank.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#39867 - DekuTree64 - Wed Apr 13, 2005 1:08 am
Until Dovoto and company figure out a few more things about the hardware, I'd suggest making an ARM7 data loading system that checks a flag/queue on VBlank, and have the ARM9 tell it to load all necessary assets at the start of each level.
It's a little less flexible, but should be nice and simple to get set up, and doesn't involve the loss of my job :)
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku