| Line 26... |
Line 26... |
| 26 |
#include "toolchooser.h"
|
26 |
#include "toolchooser.h"
|
| 27 |
#include "boot.h"
|
27 |
#include "boot.h"
|
| 28 |
#include "tools.h"
|
28 |
#include "tools.h"
|
| 29 |
#include "main.h"
|
29 |
#include "main.h"
|
| 30 |
#include "util.h"
|
30 |
#include "util.h"
|
| - |
|
31 |
#include "settings.h"
|
| 31 |
#include "settingchooser.h"
|
32 |
#include "settingchooser.h"
|
| 32 |
|
33 |
|
| 33 |
|
34 |
|
| 34 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_mainchooser =
|
35 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_mainchooser =
|
| 35 |
{
|
36 |
{
|
| 36 |
.size = LIBUI_POINT(164, 10),
|
37 |
.size = LIBUI_POINT(164, 10),
|
| 37 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
38 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 38 |
.fill_color = 0xa0000000,
|
39 |
.fill_color = 0xa0000000,
|
| 39 |
.fill_color_selected = 0x60ffffff,
|
40 |
.fill_color_selected = 0x60000000,
|
| 40 |
.icon_pos = LIBUI_POINT_NULL,
|
41 |
.icon_pos = LIBUI_POINT_NULL,
|
| 41 |
.icon = LIBUI_SURFACE_NULL,
|
42 |
.icon = LIBUI_SURFACE_NULL,
|
| 42 |
.icon_opacity = 0,
|
43 |
.icon_opacity = 0,
|
| 43 |
.icon_selected = LIBUI_SURFACE_NULL,
|
44 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 44 |
.icon_selected_opacity = 0,
|
45 |
.icon_selected_opacity = 0,
|
| Line 52... |
Line 53... |
| 52 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_umsboot =
|
53 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_umsboot =
|
| 53 |
{
|
54 |
{
|
| 54 |
.size = LIBUI_POINT(164, 10),
|
55 |
.size = LIBUI_POINT(164, 10),
|
| 55 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
56 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 56 |
.fill_color = 0xa0000000,
|
57 |
.fill_color = 0xa0000000,
|
| 57 |
.fill_color_selected = 0x60ffffff,
|
58 |
.fill_color_selected = 0x60000000,
|
| 58 |
.icon_pos = LIBUI_POINT_NULL,
|
59 |
.icon_pos = LIBUI_POINT_NULL,
|
| 59 |
.icon = LIBUI_SURFACE_NULL,
|
60 |
.icon = LIBUI_SURFACE_NULL,
|
| 60 |
.icon_opacity = 0,
|
61 |
.icon_opacity = 0,
|
| 61 |
.icon_selected = LIBUI_SURFACE_NULL,
|
62 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 62 |
.icon_selected_opacity = 0,
|
63 |
.icon_selected_opacity = 0,
|
| Line 70... |
Line 71... |
| 70 |
struct chooser_renderer_list_itemdata toolchooser_rparams_diagmode =
|
71 |
struct chooser_renderer_list_itemdata toolchooser_rparams_diagmode =
|
| 71 |
{
|
72 |
{
|
| 72 |
.size = LIBUI_POINT(164, 10),
|
73 |
.size = LIBUI_POINT(164, 10),
|
| 73 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
74 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 74 |
.fill_color = 0xa0000000,
|
75 |
.fill_color = 0xa0000000,
|
| 75 |
.fill_color_selected = 0x60ffffff,
|
76 |
.fill_color_selected = 0x60000000,
|
| 76 |
.icon_pos = LIBUI_POINT_NULL,
|
77 |
.icon_pos = LIBUI_POINT_NULL,
|
| 77 |
.icon = LIBUI_SURFACE_NULL,
|
78 |
.icon = LIBUI_SURFACE_NULL,
|
| 78 |
.icon_opacity = 0,
|
79 |
.icon_opacity = 0,
|
| 79 |
.icon_selected = LIBUI_SURFACE_NULL,
|
80 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 80 |
.icon_selected_opacity = 0,
|
81 |
.icon_selected_opacity = 0,
|
| Line 88... |
Line 89... |
| 88 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_rockbox_fallback =
|
89 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_rockbox_fallback =
|
| 89 |
{
|
90 |
{
|
| 90 |
.size = LIBUI_POINT(164, 10),
|
91 |
.size = LIBUI_POINT(164, 10),
|
| 91 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
92 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 92 |
.fill_color = 0xa0000000,
|
93 |
.fill_color = 0xa0000000,
|
| 93 |
.fill_color_selected = 0x60ffffff,
|
94 |
.fill_color_selected = 0x60000000,
|
| 94 |
.icon_pos = LIBUI_POINT_NULL,
|
95 |
.icon_pos = LIBUI_POINT_NULL,
|
| 95 |
.icon = LIBUI_SURFACE_NULL,
|
96 |
.icon = LIBUI_SURFACE_NULL,
|
| 96 |
.icon_opacity = 0,
|
97 |
.icon_opacity = 0,
|
| 97 |
.icon_selected = LIBUI_SURFACE_NULL,
|
98 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 98 |
.icon_selected_opacity = 0,
|
99 |
.icon_selected_opacity = 0,
|
| Line 106... |
Line 107... |
| 106 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_clearcfg =
|
107 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_clearcfg =
|
| 107 |
{
|
108 |
{
|
| 108 |
.size = LIBUI_POINT(164, 10),
|
109 |
.size = LIBUI_POINT(164, 10),
|
| 109 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
110 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 110 |
.fill_color = 0xa0000000,
|
111 |
.fill_color = 0xa0000000,
|
| 111 |
.fill_color_selected = 0x60ffffff,
|
112 |
.fill_color_selected = 0x60000000,
|
| 112 |
.icon_pos = LIBUI_POINT_NULL,
|
113 |
.icon_pos = LIBUI_POINT_NULL,
|
| 113 |
.icon = LIBUI_SURFACE_NULL,
|
114 |
.icon = LIBUI_SURFACE_NULL,
|
| 114 |
.icon_opacity = 0,
|
115 |
.icon_opacity = 0,
|
| 115 |
.icon_selected = LIBUI_SURFACE_NULL,
|
116 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 116 |
.icon_selected_opacity = 0,
|
117 |
.icon_selected_opacity = 0,
|
| Line 124... |
Line 125... |
| 124 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_cleardb =
|
125 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_cleardb =
|
| 125 |
{
|
126 |
{
|
| 126 |
.size = LIBUI_POINT(164, 10),
|
127 |
.size = LIBUI_POINT(164, 10),
|
| 127 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
128 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 128 |
.fill_color = 0xa0000000,
|
129 |
.fill_color = 0xa0000000,
|
| 129 |
.fill_color_selected = 0x60ffffff,
|
130 |
.fill_color_selected = 0x60000000,
|
| 130 |
.icon_pos = LIBUI_POINT_NULL,
|
131 |
.icon_pos = LIBUI_POINT_NULL,
|
| 131 |
.icon = LIBUI_SURFACE_NULL,
|
132 |
.icon = LIBUI_SURFACE_NULL,
|
| 132 |
.icon_opacity = 0,
|
133 |
.icon_opacity = 0,
|
| 133 |
.icon_selected = LIBUI_SURFACE_NULL,
|
134 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 134 |
.icon_selected_opacity = 0,
|
135 |
.icon_selected_opacity = 0,
|
| Line 142... |
Line 143... |
| 142 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_reformat =
|
143 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_reformat =
|
| 143 |
{
|
144 |
{
|
| 144 |
.size = LIBUI_POINT(164, 10),
|
145 |
.size = LIBUI_POINT(164, 10),
|
| 145 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
146 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 146 |
.fill_color = 0xa0000000,
|
147 |
.fill_color = 0xa0000000,
|
| 147 |
.fill_color_selected = 0x60ffffff,
|
148 |
.fill_color_selected = 0x60000000,
|
| 148 |
.icon_pos = LIBUI_POINT_NULL,
|
149 |
.icon_pos = LIBUI_POINT_NULL,
|
| 149 |
.icon = LIBUI_SURFACE_NULL,
|
150 |
.icon = LIBUI_SURFACE_NULL,
|
| 150 |
.icon_opacity = 0,
|
151 |
.icon_opacity = 0,
|
| 151 |
.icon_selected = LIBUI_SURFACE_NULL,
|
152 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 152 |
.icon_selected_opacity = 0,
|
153 |
.icon_selected_opacity = 0,
|
| Line 160... |
Line 161... |
| 160 |
struct chooser_renderer_list_itemdata toolchooser_rparams_uninstaller =
|
161 |
struct chooser_renderer_list_itemdata toolchooser_rparams_uninstaller =
|
| 161 |
{
|
162 |
{
|
| 162 |
.size = LIBUI_POINT(164, 10),
|
163 |
.size = LIBUI_POINT(164, 10),
|
| 163 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
164 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 164 |
.fill_color = 0xa0000000,
|
165 |
.fill_color = 0xa0000000,
|
| 165 |
.fill_color_selected = 0x60ffffff,
|
166 |
.fill_color_selected = 0x60000000,
|
| 166 |
.icon_pos = LIBUI_POINT_NULL,
|
167 |
.icon_pos = LIBUI_POINT_NULL,
|
| 167 |
.icon = LIBUI_SURFACE_NULL,
|
168 |
.icon = LIBUI_SURFACE_NULL,
|
| 168 |
.icon_opacity = 0,
|
169 |
.icon_opacity = 0,
|
| 169 |
.icon_selected = LIBUI_SURFACE_NULL,
|
170 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 170 |
.icon_selected_opacity = 0,
|
171 |
.icon_selected_opacity = 0,
|
| Line 177... |
Line 178... |
| 177 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_settingchooser =
|
178 |
static struct chooser_renderer_list_itemdata toolchooser_rparams_settingchooser =
|
| 178 |
{
|
179 |
{
|
| 179 |
.size = LIBUI_POINT(164, 10),
|
180 |
.size = LIBUI_POINT(164, 10),
|
| 180 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
181 |
.fill_box = LIBUI_BOX(LIBUI_POINT(0, 0), LIBUI_POINT(164, 10)),
|
| 181 |
.fill_color = 0xa0000000,
|
182 |
.fill_color = 0xa0000000,
|
| 182 |
.fill_color_selected = 0x60ffffff,
|
183 |
.fill_color_selected = 0x60000000,
|
| 183 |
.icon_pos = LIBUI_POINT_NULL,
|
184 |
.icon_pos = LIBUI_POINT_NULL,
|
| 184 |
.icon = LIBUI_SURFACE_NULL,
|
185 |
.icon = LIBUI_SURFACE_NULL,
|
| 185 |
.icon_opacity = 0,
|
186 |
.icon_opacity = 0,
|
| 186 |
.icon_selected = LIBUI_SURFACE_NULL,
|
187 |
.icon_selected = LIBUI_SURFACE_NULL,
|
| 187 |
.icon_selected_opacity = 0,
|
188 |
.icon_selected_opacity = 0,
|
| Line 292... |
Line 293... |
| 292 |
.renderparams = &toolchooser_rparams_settingchooser
|
293 |
.renderparams = &toolchooser_rparams_settingchooser
|
| 293 |
}
|
294 |
}
|
| 294 |
}
|
295 |
}
|
| 295 |
};
|
296 |
};
|
| 296 |
|
297 |
|
| 297 |
void run_toolchooser(void** firmware, void** app, int* size)
|
298 |
void run_toolchooser()
|
| 298 |
{
|
299 |
{
|
| 299 |
while (true)
|
300 |
while (!bootinfo.valid)
|
| 300 |
{
|
301 |
{
|
| 301 |
const struct chooser_item* result = ui->chooser_run(&toolchooser);
|
302 |
const struct chooser_item* result = ui->chooser_run(&toolchooser);
|
| 302 |
if (!result || !result->user) return;
|
303 |
if (!result || !result->user) return;
|
| 303 |
void (*selected_function)(void** firmware, void** app, int* size);
|
- |
|
| 304 |
selected_function = (void(*)(void** firmware, void** app, int* size))(result->user);
|
- |
|
| 305 |
selected_function(firmware, app, size);
|
- |
|
| 306 |
if (firmware || app) return;
|
304 |
((void(*)())(result->user))();
|
| 307 |
}
|
305 |
}
|
| 308 |
}
|
306 |
}
|
| 309 |
|
307 |
|
| 310 |
void toolchooser_init()
|
308 |
void toolchooser_init()
|
| 311 |
{
|
309 |
{
|
| Line 316... |
Line 314... |
| 316 |
toolchooser_rparams.viewport.loc.buf.addr = framebuf;
|
314 |
toolchooser_rparams.viewport.loc.buf.addr = framebuf;
|
| 317 |
toolchooser_rparams.blit_src.loc.buf.addr = framebuf;
|
315 |
toolchooser_rparams.blit_src.loc.buf.addr = framebuf;
|
| 318 |
toolchooser_rparams_mainchooser.render = ui->chooser_renderer_list_show_arrow_left;
|
316 |
toolchooser_rparams_mainchooser.render = ui->chooser_renderer_list_show_arrow_left;
|
| 319 |
toolchooser_rparams_settingchooser.render = ui->chooser_renderer_list_show_arrow_right;
|
317 |
toolchooser_rparams_settingchooser.render = ui->chooser_renderer_list_show_arrow_right;
|
| 320 |
}
|
318 |
}
|
| - |
|
319 |
|
| - |
|
320 |
void toolchooser_apply_settings()
|
| - |
|
321 |
{
|
| - |
|
322 |
if (settings.snow) toolchooser.tickinterval = 50000;
|
| - |
|
323 |
else toolchooser.tickinterval = 10000000;
|
| - |
|
324 |
}
|