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.

Coding > DMA from gamepak

#1327 - torne - Thu Jan 16, 2003 8:01 pm

Hi,
I'm using DMA copy in 16 bit mode to drag tile data..etc direct from gamepak rom into VRAM. The No$GBA spec says I need to use dma3 for this, but other sources say 'anything but dma0'.. and what does the 'gamepak drq' have to do with it? =)

I'd love to test it all myself, but I don't have my flash cart yet. VBA seems to have no problem with me using DMA1 to copy from gamepak rom, but I'm not convinced it's accurate, and no$ will of course only run my code in multiboot mode which proves nothing either way =)

If someone could explain what the Gamepak DRQ setting (bit 11 of DMA?CNT_H) does, and which DMA channels can be used to copy from gamepak to vram, then I'd be very grateful. I looked around at the DMA tutorials but nothing seems to be specific about it..

Torne

#1330 - Splam - Thu Jan 16, 2003 8:38 pm

DRQ doesn't do anything unless you've got a cart specifically built to handle it.

As for the other dma types here's what they allow.

DMA0
DMA 0 allows different areas of internal memory in the main unit to access one another. It has the highest priority of the DMA channels.

DMA1 and 2
DMA channels 1 and 2 provide access between the Game Pak bus/internal memory of the main unit and internal memory of the main unit, or between the Game Pak bus/internal memory of the main unit and the direct sound FIFO. Transfers to direct-sound FIFO can be accomplished only by using DMA 1 and 2.

DMA3
DMA 3 provides memory access between the Game Pak bus and internal memory of the main unit, or between different areas of internal memory of the main unit.

I use DMA3 for pretty much everything because other than sound because 1 and 2 are used for that. I'm sure 0 would come in usefull for something REALLY important but I've not found a need for it yet.

#1336 - torne - Thu Jan 16, 2003 8:51 pm

Thanks for that. The No$GBA spec mentions the DRQ bit and has a complicated paragraph which seems to make no grammatical sense =)

T.

#1338 - Splam - Thu Jan 16, 2003 9:05 pm

hehe I'd not noticed it b4 you mentioned it. It's only on DMA3 and I think I read about it a loooong time ago, realised it was useless and my brain threw it out :)

#1348 - ampz - Thu Jan 16, 2003 10:47 pm

The gamepak IRQ, is it sensitive to level or edge? low or high level? rising or falling edge?
I can think of a few useful applications for it...

#1352 - Splam - Thu Jan 16, 2003 11:30 pm

copy/paste ;)

About Game Pak Interrupts
An interrupt request occurs when the IREQ terminal is "High".
Although the IREQ terminal is pulled "High" in the AGB hardware, the IREQ terminal is set to "Lo" when a normal Game Pak is installed. Therefore, the IREQ terminal is pulled "High" and an interrupt request occurs when the Game Pak is removed from the AGB.

#1361 - ampz - Fri Jan 17, 2003 12:13 am

Oh, sorry ;)
Well, it says "when the IREQ terminal is High", that means it's level sensitive. It could also mean that the person who wrote it does not know the difference between level and edge triggered interrupts.

#1364 - Splam - Fri Jan 17, 2003 12:54 am

hehe it's a Nintendo doc so maybe it didn't translate too well from Japanese ;) There are plenty of other mistakes in there which could be put down to bad translation.