uint8_t *enable_list = (uint8_t *)FCRAM_PATCHLIST_LOC;
static struct options_s options[] = {
- // space
- { 0, "", "", not_option, 0, 0 },
// Patches.
{ 0, "\x1b[32;40mGeneral Options\x1b[0m", "", not_option, 0, 0 },
extern void waitcycles(uint32_t cycles);
uint32_t
-wait_key()
+wait_key(int sleep)
{
- #define ARM9_APPROX_DELAY_MAX 134058675 / 85
- waitcycles(ARM9_APPROX_DELAY_MAX); // Approximately what a human can input - fine tuning needed (sorry, TASers!)
+ if (sleep) {
+ #define ARM9_APPROX_DELAY_MAX 134058675 / 85
+ waitcycles(ARM9_APPROX_DELAY_MAX); // Approximately what a human can input - fine tuning needed (sorry, TASers!)
+ }
uint32_t ret = 0, get = 0;
while (ret == 0) {
void
header(char *append)
{
- fprintf(stdout, "\x1b[30;42m.corbenik//%s %s\x1b[0m\n", VERSION, append);
+ fprintf(stdout, "\x1b[30;42m ");
+ set_cursor(TOP_SCREEN, 0, 0);
+ fprintf(stdout, "\x1b[30;42m Corbenik//%s %s\x1b[0m\n\n", VERSION, append);
}
static int current_menu_index_patches = 0;
return 0;
}
+// This is dual purpose. When we actually list
+// patches to build the cache - desc_is_fname
+// will be set to 1.
+
void
list_patches_build(char *name, int desc_is_fname)
{
memset(enable_list, 0, FCRAM_SPACING / 2);
+ if (!desc_is_fname) {
+ strncpy(patches[0].name, "\x1b[40;32mPatches\x1b[0m", 64);
+ strncpy(patches[0].desc, "", 255);
+ patches[0].index = 0;
+ patches[0].allowed = not_option;
+ patches[0].a = 0;
+ patches[0].b = 0;
+
+ current_menu_index_patches += 1;
+ }
+
char fpath[256];
strncpy(fpath, name, 256);
list_patches_build_back(fpath, desc_is_fname);
" Version: %s (%x)\n",
native->version_string, native->version, agb->version_string, agb->version, twl->version_string, twl->version);
- wait_key();
+ wait_key(1);
need_redraw = 1;
clear_screen(TOP_SCREEN);
" <https://github.com/chaoskagami/corbenik>\n"
"\n");
- wait_key();
+ wait_key(1);
need_redraw = 1;
clear_screen(TOP_SCREEN);
}
static struct options_s main_s[] = {
- // space
{ 0, "Options", "", call_fun, (uint32_t)menu_options, 0 },
{ 0, "Patches", "", call_fun, (uint32_t)menu_patches, 0 },
{ 0, "Info", "", call_fun, (uint32_t)menu_info, 0 },
// TODO - Basically all this needs to move to patcher programs.
-uint32_t wait_key();
+uint32_t wait_key(int sleep);
extern int patch_services();
extern int patch_modules();
wait()
{
if (config.options[OPTION_TRACE] && !doing_autoboot) {
- fprintf(stderr, " [WAIT]");
- wait_key();
+ fprintf(stderr, "[Waiting...]");
+ wait_key(0); // No delay on traces.
}
- fprintf(stderr, "\r \r");
+ fprintf(stderr, " \r");
}
void list_patches_build(char *name, int desc_is_fname);