]> Chaos Git - corbenik/corbenik.git/commitdiff
No, that menu gap is not normal on o3ds.
authorchaoskagami <chaos.kagami@gmail.com>
Wed, 24 Aug 2016 05:06:38 +0000 (01:06 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Wed, 24 Aug 2016 05:08:00 +0000 (01:08 -0400)
How long have you guys been dealing with that one? Seriously, should have been reported long before now; it was a bug.

Also, minor note to self.

source/menu-backend.c
source/patch/module.c

index fc58efac22ac8d0c9bf7acf8c734a9df3f464f8b..d12576b88d058a00896a9a548a3fbdbc6fadebef 100644 (file)
@@ -90,19 +90,23 @@ show_menu(struct options_s *options, uint8_t *toggles)
         else
             header("A:Enter B:Back DPAD:Nav Select:Info");
 
-
-        for (int i = window_top; options[i].index != -1; ++i) { // -1 Sentinel.
-            if (i > window_bottom)
+        for (int i = window_top, skip = 0; options[i].index != -1; ++i) { // -1 Sentinel.
+            if (i > window_bottom + skip)
                 break;
 
+            if (options[i].allowed == boolean_val_n3ds && !is_n3ds) {
+                ++skip;
+                continue;
+            }
+
             // NOTE - Signed to unsigned conversion here. Again, not an issue.
-            set_cursor(TOP_SCREEN, 0, (unsigned int)(i - window_top + 2) );
+            set_cursor(TOP_SCREEN, 0, (unsigned int)(i - window_top - skip + 2) );
 
             int indent = options[i].indent;
             for(int j=0; j < indent; j++)
                 fprintf(TOP_SCREEN, "  ");
 
-            if (options[i].allowed == boolean_val || (is_n3ds && options[i].allowed == boolean_val_n3ds)) {
+            if (options[i].allowed == boolean_val || options[i].allowed == boolean_val_n3ds) {
                 if (cursor_y == i) {
                     accent_color(TOP_SCREEN, 1);
                     fprintf(TOP_SCREEN, ">>\x1b[0m ");
index aba1a61ffc884a1b70f4efd275e6acd4b77e9988..1120168a2dc664c63950105f67d51c406e89285e 100644 (file)
@@ -39,6 +39,8 @@ inject_module(char* fpath)
             if (module->contentSize > sysmodule->contentSize) {
                 uint32_t need_units = (module->contentSize - sysmodule->contentSize);
 
+                // FIXME - We're potentially corrupting memory here depending on whether we go over the theoretical maximum size of FIRM
+
                 memmove((uint8_t *)sysmodule + module->contentSize * 0x200, (uint8_t *)sysmodule + sysmodule->contentSize * 0x200,
                         ((uint32_t)firm_modules + firm_size) - ((uint32_t)sysmodule + (module->contentSize * 0x200)));