nx_main/main.c
//This is implemented here due to the hid code.
This is implemented here due to the hid code.
This is implemented here due to the hid code .
bool menuUpdate(void) {
    bool exitflag = 0;
    menu_s* menu = menuGetCurrent();
    u32 down = hidKeysDown(CONTROLLER_P1_AUTO);
    handleTouch(menu);
    if (down & KEY_Y)
    {
        launchMenuNetloaderTask();
    }
    else if (down & KEY_A)
    {
        menuHandleAButton();
    }
    else if (down & KEY_B)
    {
        launchMenuBackTask();
    }
    else if(down & KEY_MINUS){
        themeMenuStartup();
    }
    else if (down & KEY_PLUS)
    {
        exitflag = 1;
    }
    else if (menu->nEntries > 0)
    {
        int move = 0;
        if (down & KEY_LEFT) move--;
        if (down & KEY_RIGHT) move++;
        if (down & KEY_DOWN) move-=7;
        if (down & KEY_UP) move+=7;
        int newEntry = menu->curEntry + move;
        if (newEntry < 0) newEntry = 0;
        if (newEntry >= menu->nEntries) newEntry = menu->nEntries-1;
        menu->curEntry = newEntry;
    }
    return exitflag;
}
bool menuUpdate ( void ) { bool exitflag = 0 ; menu_s * menu = menuGetCurrent ( ) ; u32 down = hidKeysDown ( CONTROLLER_P1_AUTO ) ; handleTouch ( menu ) ; if ( down & KEY_Y ) { launchMenuNetloaderTask ( ) ; } else if ( down & KEY_A ) { menuHandleAButton ( ) ; } else if ( down & KEY_B ) { launchMenuBackTask ( ) ; } else if ( down & KEY_MINUS ) { themeMenuStartup ( ) ; } else if ( down & KEY_PLUS ) { exitflag = 1 ; } else if ( menu -> nEntries > 0 ) { int move = 0 ; if ( down & KEY_LEFT ) move -- ; if ( down & KEY_RIGHT ) move ++ ; if ( down & KEY_DOWN ) move -= 7 ; if ( down & KEY_UP ) move += 7 ; int newEntry = menu -> curEntry + move ; if ( newEntry < 0 ) newEntry = 0 ; if ( newEntry >= menu -> nEntries ) newEntry = menu -> nEntries - 1 ; menu -> curEntry = newEntry ; } return exitflag ; }
This is implemented here due to the hid code.
This is implemented here due to the hid code .