ocflags: ${OCFLAGS}
Chainloader: ${CHAINLOADER}
-Chainloader: ${UNITTESTS}
+Unit tests: ${UNITTESTS}
"
AC_OUTPUT
/* Displays a prompt on the bottom screen if the relevant option is enabled and waits on input
* to continue.
*/
-void wait();
+void wait(void);
#endif
/* Install interrupt handlers via libctr9.
*/
-void install_interrupts();
+void install_interrupts(void);
#endif
void reset();
void poweroff();
+void reset_patch_menu(void);
+void add_patch_menu(const char *name);
+
#endif
/* Loads the config file off SD from the configured location.
*/
-void load_config();
+void load_config(void);
/* Saves the config file to SD at the configured location.
*/
-void save_config();
+void save_config(void);
/* Changes an option according to internal rules. Used in menus.
*/
#define PATH_MODULE_TWL PATH_MODULES "/twl" ///< TWL FIRM Sysmodule location
#define PATH_PATCHES SBINDIR ///< Patch binary folder.
+#define PATH_AUX_PATCHES BINDIR ///< Patch binary folder.
#define PATH_BITS LIBEXECDIR ///< Path to misc bits we need (emunand code, reboot code, etc)
*
* \return Zero on success.
*/
-int generate_patch_cache();
+int generate_patch_cache(void);
int patch_svc_calls(firm_h* firm_loc);
int patch_reboot(firm_h* firm_loc);
/* Prints stats for allocation to stderr.
*/
-void print_alloc_stats();
+void print_alloc_stats(void);
/* Allocate memory for use (debugging only, don't call)
*
/* Initialize stdlib functionality. Must be called before ANY other functions here can be used.
*/
-void std_init();
+void std_init(void);
/* Take a screenshot and save to path.
*/
-void screenshot();
+void screenshot(void);
/* Fill an area on the screen with a color.
*
/* Clears background image bitmaps.
*/
-void clear_bg();
+void clear_bg(void);
/* Loads top background image from a path.
*
/* Clears the displays either to black or the background image.
*/
-void clear_screens();
+void clear_screens(void);
/* Draws a character to the screen. Internal use.
*
int changed_consoles = 0;
uint32_t cid[4];
-void list_patches_build(const char *name, int desc_is_fname);
-
void
-regenerate_config()
+regenerate_config(void)
{
for(int i=0; i < 4; i++)
config->magic[i] = CONFIG_MAGIC[i];
}
void
-mk_structure()
+mk_structure(void)
{
f_mkdir(PREFIX);
f_mkdir(LIBEXECDIR);
}
void
-update_config()
+update_config(void)
{
int updated = 0;
}
}
-void get_cfg_path();
+void get_cfg_path(void);
void
-load_config()
+load_config(void)
{
mk_structure(); // Make directory structure if needed.
}
}
- list_patches_build(PATH_PATCHES, 0);
+ reset_patch_menu();
+ add_patch_menu(PATH_PATCHES);
+ add_patch_menu(PATH_AUX_PATCHES);
update_config();
}
void
-save_config()
+save_config(void)
{
if (changed_consoles) {
FILE* f = fopen(SYSCONFDIR "/current-nand-cid", "w");
extern int doing_autoboot;
void
-wait()
+wait(void)
{
if (get_opt_u32(OPTION_TRACE) && !doing_autoboot) {
fprintf(stderr, "[Waiting...]");
fprintf(stderr, "FIQ called. Returning.\n");
}
-void install_interrupts() {
+void install_interrupts(void) {
ctr_interrupt_prepare();
ctr_irq_initialize();
int is_n3ds = 0;
int doing_autoboot = 0;
-int menu_handler();
-void shut_up();
+int menu_handler(void);
+void shut_up(void);
extern int changed_consoles;
struct options_s *firm = NULL;
static int current_menu_index_patches = 0;
-static int desc_is_fname_sto = 0;
#if defined(CHAINLOADER) && CHAINLOADER == 1
void chainload_menu();
"Internal options for the CFW.\nThese are part of " FW_NAME " itself.",
option, options, (void(*)(void*))show_menu, NULL, 0, 0 },
{ "Patches",
- "External bytecode patches found in `" PATH_PATCHES "`.\nYou can choose which to enable.",
+ "External bytecode patches found in `" PATH_PATCHES "` and `" PATH_AUX_PATCHES "` .\nYou can choose which to enable.",
option, NULL, (void(*)(void*))show_menu, NULL, 0, 0 },
// Sentinel.
return;
patches[current_menu_index_patches].name = strdup_self(p.name);
- if (desc_is_fname_sto)
- patches[current_menu_index_patches].param = strdup_self(fpath);
- else
- patches[current_menu_index_patches].desc = strdup_self(p.desc);
+ patches[current_menu_index_patches].desc = strdup_self(p.desc);
uint32_t val = p.uuid;
patches[current_menu_index_patches].func = patch_set_enable;
patches[current_menu_index_patches].value = patch_get_enable;
- if (desc_is_fname_sto)
- enable_list[p.uuid] = 0;
-
current_menu_index_patches++;
}
}
ctr_system_poweroff();
}
-// 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(const char *name, int desc_is_fname)
+reset_patch_menu(void)
{
- desc_is_fname_sto = desc_is_fname;
-
current_menu_index_patches = 0;
if (!patches)
patches[0].highlight = 1;
current_menu_index_patches += 1;
+}
+void
+add_patch_menu(const char *name)
+{
recurse_call(name, patch_func);
patches[current_menu_index_patches].name = NULL;
}
void
-menu_handler()
+menu_handler(void)
{
show_menu(main_s);
}
}
int
-generate_patch_cache()
+generate_patch_cache(void)
{
// Remove cache
rrmdir(PATH_LOADER_CACHE);
}
#ifdef MALLOC_DEBUG
-void print_alloc_stats() {
+void print_alloc_stats(void) {
fprintf(stderr, "[A] %u [F] %u [M] %u [B] %lu\n", alloc_count, free_count, allocated_memory, (uint32_t)heap_end - (uint32_t)&__end__);
}
#endif
static uint8_t alphamap[256] = {0};
-void std_init() {
+void std_init(void) {
for(uint16_t i=0; i < 0x100; i++) {
alphamap[i] = 0;
if (i > 0x7F)
}
// This is (roughly) the screenshot specs as used by smeas scrtool.
-void screenshot() {
+void screenshot(void) {
f_unlink(PATH_TEMP "/screenshot.ppm");
// Open the screenshot blob used by hbmenu et al
fprintf(stderr, "Screenshot: %s\n", PATH_TEMP "/screenshot.ppm");
}
-void clear_bg() {
+void clear_bg(void) {
memset(top_bg, 0, TOP_SIZE);
memset(bottom_bg, 0, BOTTOM_SIZE);
}
}
void
-shut_up()
+shut_up(void)
{
kill_output = 1; // Immediately cancel all output operations.
}