#define OBJPaletteMem ((volatile u16 *)0x5000200)
Is fastest and proper. If you don't declare it volatile, the compiler
may optimize out references to the memory in ways you don't want. This
#define doesn't use a memory location, like the third declaration below
does, and requires one less indirect memory fetch (is faster).
Happy New Year to everyone!
=> -----Original Message-----
=> From: PurpleDecay@... [mailto:PurpleDecay@...]
=> Sent: Wednesday, January 01, 2003 11:52 AM
=> To: gbadev@yahoogroups.com
=> Subject: [gbadev] accessing memory
=>
=>
=> i've been looking at various gba.h files and have a question
=> about setting up
=> memory locations. I've notived 3 main ways people are doing this....
=>
=> #define OBJPaletteMem 0x5000200
=> #define OBJPaletteMem (u16*)0x5000200
=> u16* OBJPaletteMem = (u16*)0x5000200;
=>
=> Can someone please explain which method is best? Am i right
=> in assuming one
=> method is faster?
=>
=> thanks
=>
=>
=>
=>
=>
=>
=> Your use of Yahoo! Groups is subject to
=> http://docs.yahoo.com/info/terms/
=>
=>
=>