What's wrong with this? I don't see a white screen. I filled the whole area with white, but I'm being pointed to a totally different area of memory.
Code:
#include <stdint.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char** argv)
{
uint16_t volatile* regs;
uint32_t mem_len;
uint16_t* mapped_mem;
int32_t mem_fd;
mem_fd = open("/dev/mem", O_RDWR);
mapped_mem = mmap(0, 0x500000, PROT_READ|PROT_WRITE, MAP_SHARED,
mem_fd, 0x3101000);
regs = mmap(0, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, 0xC0000000);
memset(mapped_mem, 0xFF, 0x500000);
regs[0x290E>>1] = 0x3101000 & 0xFFFF;
regs[0x2910>>1] = 0x3101000 >> 16;
regs[0x2912>>1] = 0x3101000 & 0xFFFF;
regs[0x2914>>1] = 0x3101000 >> 16;
sleep(2);
munmap(mapped_mem, 0x500000);
close(mem_fd);
chdir("/usr/gp2x");
execl("gp2xmenu", "gp2xmenu", (char*)0);
return 0;
}