]> Chaos Git - corbenik/corbenik.git/commitdiff
Code is wrong. Correct it.
authorchaoskagami <chaos.kagami@gmail.com>
Sun, 19 Jun 2016 10:46:59 +0000 (06:46 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Sun, 19 Jun 2016 10:46:59 +0000 (06:46 -0400)
source/patch/emunand.c

index 65601f1cd80f7c9687619e25e621ddb126b060d2..ac2de8c0562d397e37acb8f2e6846ae67efb6e56 100644 (file)
@@ -40,13 +40,15 @@ verify_emunand(uint32_t index, uint32_t *off, uint32_t *head)
 
     uint32_t offset;
     if (nandSize > 0x200000)
-        offset = 0x400000 * index;
+        offset = 0x400000;
     else
-        offset = 0x200000 * index;
+        offset = 0x200000;
 
     if (config.options[OPTION_EMUNAND_REVERSE]) {
         // Subtract offset from back of disk.
-        offset = ( getMMCDevice(1)->total_size - 1) - offset;
+        offset = (getMMCDevice(1)->total_size - 1) - (offset * (index + 1));
+    } else {
+        offset = offset * index;
     }
 
     // Check for RedNAND/Normal physical layout on SD