Write to framebuffer help

Discussion in '3DS - Homebrew Development and Emulators' started by aliak11, Jan 10, 2014.

  1. aliak11
    OP

    aliak11 Pokemon Master

    Member
    195
    310
    Dec 5, 2010
    United States
    Florida
    Can someone give an example, or explain how to write to the framebuffer to display on the top LCD. The addresses are here http://3dbrew.org/wiki/LCD.
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,739
    9,610
    Nov 21, 2005
    United Kingdom
    Have you tried a proof of concept using the REG_LCDCOLORFILL* registers?
     
  3. ernilos

    ernilos GBAtemp Regular

    Member
    152
    140
    Aug 28, 2013
    Registers won't work on ARM9
    Just satart searching in FCRAM...
     
    fierce waffle likes this.
  4. T3GZdev

    T3GZdev head of T3GZdev

    Member
    1,024
    108
    Apr 21, 2010
    United States
    it was his destiny to know
     
  5. escherbach

    escherbach GBAtemp Regular

    Member
    270
    97
    Dec 26, 2013
    Maybe something like


    int fbfd = 0;
    // Open the framebuffer for reading and writing
    fbfd = open("/dev/fb0", O_RDWR);
    if (!fbfd) {
    printf("Error: cannot open framebuffer device.\n");
    exit(1);
    }
    // Map the framebuffer to memory
    unsigned int * fbp = (unsigned int *)mmap(0, XRES*YRES*4, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);

    then fbp is a pointer to the framebuffer memory

    EDIT: or just set fbfd to the physical address?