In past versions of DevKitArm, you could write code like this:
Code: Select all
void ByteSet(char *p, char value, int size)
{
while (size)
{
*p++ = value;
size--;
}
}
This is no longer the case. The compiler will now either replace this with a call to "memset", or will generate code that does 32-bit writes to memory. So this code can no longer be used as-is to access the SRAM memory area.
You now need to use "volatile" on your pointer to prevent the compiler from being allowed to use a larger read or write size.
This even applies to VRAM, in some cases, the compiler will decide to perform 8-bit writes, even if your code did not use any such writes.
A snippet of some code:
Code: Select all
u16 *here=(u16*)0x06000000+(row&0x1F)*32;
int i = 0;
u16 space;
...
for(;i<29;i++)
{
here[i] = space;
}
So now all access to VRAM or SRAM must be done through volatile pointers, otherwise the compiler is free to pick memory access that is incompatible with the actual hardware.