Ejemplo n.º 1
0
void menu_config()
{
    char *options[] = {"Enable autoboot (Press \"L\" to enter the menu)"};
    int preselected[] = {config->autoboot_enabled};

    int *result = draw_selection_menu("Configuration", sizeof(options) / sizeof(char *),
                                      options, preselected);

    // Apply the options
    config->autoboot_enabled = result[0];
}
Ejemplo n.º 2
0
void menu_toggle()
{
    char *options[] = {"Enable autoboot (Press L to enter the menu)",
                       "Force saving patched firmware"};
    int preselected[] = {config->autoboot_enabled,
                         save_firm};

    int *result = draw_selection_menu("Toggleable options", sizeof(options) / sizeof(char *),
                                      options, preselected);

    // Apply the options
    config->autoboot_enabled = result[0];
    save_firm = result[1];
    patches_modified |= result[1];
}
Ejemplo n.º 3
0
void menu_select_patches()
{
    #if MAX_CAKES > MAX_SELECTED_OPTIONS
    #error "This function needs MAX_CAKES to be <= MAX_SELECTED_OPTIONS"
    #endif

    char *options[cake_count];
    for (int i = 0; i < cake_count; i++) {
        options[i] = cake_list[i].description;
    }

    int *result = draw_selection_menu("Select your cakes", cake_count, options, cake_selected);

    config_modified |= memcmp(cake_selected, result, sizeof(cake_selected));

    // The result location will be reused for other selection menus, so we memcpy it.
    memcpy(cake_selected, result, cake_count * sizeof(int));
}
Ejemplo n.º 4
0
void menu_toggle()
{
    char *options[] = {"Enable autoboot (Press L to enter the menu)",
                       "Force saving patched firmware",
                       "Silence debug output"};
    int preselected[] = {config->autoboot_enabled,
                         save_firm,
                         config->silent_boot};

    int *result = draw_selection_menu("Toggleable options", sizeof(options) / sizeof(char *),
                                      options, preselected);

    // Apply the options
    config->autoboot_enabled = result[0];
    save_firm = result[1];
    config->silent_boot = result[2];  // This doesn't change patches.
    patches_modified |= preselected[0] ? 0 : result[0];
    patches_modified |= preselected[1] ? 0 : result[1];
}
Ejemplo n.º 5
0
void menu_select_patches()
{
    #if MAX_CAKES > MAX_SELECTED_OPTIONS
    #error "This function needs MAX_CAKES to be <= MAX_SELECTED_OPTIONS"
    #endif

    if (cake_count <= 0) {
        draw_message("No cakes loaded", "No cakes have been loaded.\nPlease copy them to: " PATH_PATCHES);
        return;
    }

    char *options[cake_count];
    for (unsigned int i = 0; i < cake_count; i++) {
        options[i] = cake_list[i].description;
    }

    int *result = draw_selection_menu("Select your cakes", cake_count, options, cake_selected);

    patches_modified |= memcmp(cake_selected, result, sizeof(cake_selected));

    // The result location will be reused for other selection menus, so we memcpy it.
    memcpy(cake_selected, result, cake_count * sizeof(int));
}