pokitto / PokittoLib

Library for making programs on Pokitto hardware
22 stars 16 forks source link

bug using PROJ_SHOW_FPS_COUNTER in PokittoSim #73

Closed sbmrgd closed 4 years ago

sbmrgd commented 5 years ago

There is an undefined variable in SimLCD.cpp in

void Pokitto::lcdRefreshMode1(uint8_t * scrbuf, uint8_t updRectX, uint8_t updRectY, uint8_t updRectW, uint8_t updRectH, uint16_t* paletteptr)

    uint16_t x,y;
    uint16_t scanline[4][176]; // read 4 half-nibbles = 4 pixels at a time
    uint8_t *d, yoffset=0;

    // If not the full screen is updated, check the validity of the update rect.
    if ( updRectX != 0 || updRectY != 0 ||updRectW != LCDWIDTH ||updRectH != LCDHEIGHT ) {
        uint8_t org_screenx = updRectX;
        updRectX &= 0xfc; // Make the value dividable by 4.
        updRectW += org_screenx - updRectX;
        updRectW = (updRectW + 3) & 0xfc; // Make the value dividable by 4, round up.

        uint8_t org_screeny = updRectY;
        updRectY &= 0xfc; // Make the value dividable by 4.
        updRectH += org_screeny - updRectY;
        updRectH = (updRectH + 7) & 0xf8; // Make the value dividable by 8 (because of loop unroll optimization), round up.
    }

    #ifdef PROJ_SHOW_FPS_COUNTER
    xptr = 8; // <- the error is here
    setDRAMptr(8, 0);
    #else
    setDRAMptr(0, 0);
    #endif

The variable xptr is not defined (and is not needed anyway I think)

felipemanga commented 4 years ago

Looks like this has been resolved and can be closed