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 problems whith compiler optimizations

#39056 - Helius - Sun Apr 03, 2005 11:15 pm

Hi!

I have problems when compiling with -O, -O1 or -O2 flags in DevkitARM.

It seems that DMA is not working with compiler optimizations beacause when I disable them the DMA works fine. Any ideas?

Thanks.

#39057 - tepples - Sun Apr 03, 2005 11:19 pm

You're likely missing a volatile somewhere in your headers. How does your header define the DMA registers?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#39092 - Helius - Mon Apr 04, 2005 1:50 pm

Looks like this:

Code:
#define GBA_REG_DMA3SAD     *(u32*)0x40000D4
#define GBA_REG_DMA3SAD_L   *(u16*)0x40000D4
#define GBA_REG_DMA3SAD_H   *(u16*)0x40000D6
#define GBA_REG_DMA3DAD     *(u32*)0x40000D8
#define GBA_REG_DMA3DAD_L   *(u16*)0x40000D8
#define GBA_REG_DMA3DAD_H   *(u16*)0x40000DA
#define GBA_REG_DMA3CNT     *(u32*)0x40000DC
#define GBA_REG_DMA3CNT_L   *(u16*)0x40000DC
#define GBA_REG_DMA3CNT_H   *(u16*)0x40000DE

#39094 - Helius - Mon Apr 04, 2005 2:03 pm

Sorry but I'm new to this forum, I have read the FAQ and I have now the DMA working with optimizations.

Thanks.