Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

DevkitARM, white screen on emulator If I use a for loop in the code?

$
0
0

This Code works great and outputs the pixels as expected:

int main(){    *(unsigned int *)0x04000000 = 0x0403;    unsigned short *Screen = (unsigned short *)0x06000000;    Screen[120 + 80 * 240] = 0x001F;    Screen[136 + 80 * 240] = 0x03E0;    Screen[120 + 96 * 240] = 0x7C00;    Screen[100] = 0x7C00;    while (1);    return 0;}

but whenever I try to add the for loop and change the vram values from within that, I get white screen on the emulator, it compiles with no errors and even warnings, but I get white screen on the emulator.

int main(){    *(unsigned int *)0x04000000 = 0x0403;    unsigned short *Screen = (unsigned short *)0x06000000;    Screen[120 + 80 * 240] = 0x001F;    Screen[136 + 80 * 240] = 0x03E0;    Screen[120 + 96 * 240] = 0x7C00;    Screen[100] = 0x7C00;    int i;    for (i = 100; i < 110; i++)    {        Screen[i] = 0x7C00;    }    while (1);    return 0;}

Viewing all articles
Browse latest Browse all 22016

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>