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 > Seriously >.<;; Why isn't the DS DMA0, HDMA working li

#46932 - LOst? - Sat Jul 02, 2005 6:07 am

I have worked for days now trying to find a way to port my 2D game to DS. The main problem is my scroll table. It is needed to update the scroll values at "this frame". The only thing that can do so is DMA channel 0. Also, the HDMA needs to use DMA0 with the flag DMA_START_HBL. But in DS ARM9, DMA channel 0 is just not updating immediately, and DMA_START_HBL doesn't give any output at all.

If you believe you can help me, I will give out the source in here. I only need a way to visually see if DMA channel 0 updated "this frame" and not "previous frame".

If no DMA_START_HBL or DMA channel 0 exist on the DS: Is there any other way to do 2D raster effects?

Thank you for replies!

#46994 - LOst? - Sun Jul 03, 2005 4:52 am

Seems like no one can answer.

I guess even if I get HDMA to work, to do it on both screens, you must have a SUB_DMA0. And there is no.

So the DS was not that well designed for 2D games I guess.

#46999 - DekuTree64 - Sun Jul 03, 2005 5:50 am

DMA0 should work fine, unless maybe if ndslib uses it for sending commands to the geometry FIFO, and you're doing 3D stuff? Be it that or something else, there must be some DMA task interrupting DMA1/2/3 if you use them, so you need to find out what that is and tell it to use a lower priority DMA.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#47000 - LOst? - Sun Jul 03, 2005 6:12 am

DekuTree64 wrote:
DMA0 should work fine, unless maybe if ndslib uses it for sending commands to the geometry FIFO, and you're doing 3D stuff? Be it that or something else, there must be some DMA task interrupting DMA1/2/3 if you use them, so you need to find out what that is and tell it to use a lower priority DMA.


There might be something with ndslib. But remember I do the DMA from an interrupt.
How do I found the code for ndslib? I only have the H files and the O files.





DekuTree64, have you ever got HDMA to work on the DS? If you can at least try one you will probably see my problem.
If you find a solution, I will give you something... I will... hmm... give you... let's say something worth having.

#47003 - DekuTree64 - Sun Jul 03, 2005 6:29 am

Yeah, I've used DMA1 for an HBlank scrolling wavy effect with no problems. Just set the DMA up during VBlank, to trigger on HBlank and repeat.

Are you doing something that requires you to actually start a fresh transfer during an HBlank interrupt? How much data are you transferring? Could be that you just don't have enough time.

Ndslib should include all the source, just grab the zip from drunkencoders.com if yours doesn't have it for some reason.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#47005 - LOst? - Sun Jul 03, 2005 6:41 am

DekuTree64 wrote:
Yeah, I've used DMA1 for an HBlank scrolling wavy effect with no problems. Just set the DMA up during VBlank, to trigger on HBlank and repeat.

Are you doing something that requires you to actually start a fresh transfer during an HBlank interrupt? How much data are you transferring? Could be that you just don't have enough time.

Ndslib should include all the source, just grab the zip from drunkencoders.com if yours doesn't have it for some reason.


I'll send you my code with PM. Please take a look at it by using the real hardware. If you get it to work, or find any other bugs, I will be forever greatful!

#47012 - LOst? - Sun Jul 03, 2005 11:08 am

This thread is closed now. The problem seemed to be in stopping the HDMA0 transfer before beginning the new frame. It now works on the real hardware, and DekuTree64 was the one finding the problem so all credits go to him!

Now, I have a DS to program!