#131403 - ShannonB - Fri Jun 15, 2007 5:03 am
Ok, going through the Tonc tutorials: http://www.coranac.com/tonc/text/first.htm
(Brilliant tutorial by the way, just going through the math section and I actually understand stuff I never thought I'd get that quickly)
Anyway, he makes a #define to point to the Display control register, which I get.
#define REG_DISPCNT *((volatile u32*)(MEM_IO+0x0000))
He previously #define MEM_IO as the address for the display control register.
#define MEM_IO 0x04000000
What I DON'T get, is why he adds 0x0000 to the memory address.
It might be something really simple such as me not having all the math basics of Hexadecimal down, or maybe I don't get pointers properly, but I just can't figure out why and what it does. Can anyone explain?
_________________
"Do you know what the chain of command is? It's the chain I get and beat you with until you understand who's in rutting command here!" -Jayne Cobb
(Brilliant tutorial by the way, just going through the math section and I actually understand stuff I never thought I'd get that quickly)
Anyway, he makes a #define to point to the Display control register, which I get.
#define REG_DISPCNT *((volatile u32*)(MEM_IO+0x0000))
He previously #define MEM_IO as the address for the display control register.
#define MEM_IO 0x04000000
What I DON'T get, is why he adds 0x0000 to the memory address.
It might be something really simple such as me not having all the math basics of Hexadecimal down, or maybe I don't get pointers properly, but I just can't figure out why and what it does. Can anyone explain?
_________________
"Do you know what the chain of command is? It's the chain I get and beat you with until you understand who's in rutting command here!" -Jayne Cobb