Skip to content

Commit

Permalink
CmdWriteNandRaw: only use first 3 bytes of spare (SAData) when writin…
Browse files Browse the repository at this point in the history
…g + skip writing bad blocks
  • Loading branch information
emoose committed Mar 20, 2018
1 parent 590865d commit d3878ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions iQueDiagExtend/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ int CmdWriteNandRaw()
{
fread(buff, 1, 0x4000, nand);
fread(sparebuff, 1, 0x10, spare);

if (sparebuff[5] != 0xFF)
continue; // skip trying to write bad blocks

// when writing spare, only first 3 bytes (SA block info) need to be populated, rest can be all 0xFF
for (int i = 3; i < 0x10; i++)
sparebuff[i] = 0xFF;

__bbc_direct_writeblocks((int)direct_ptrs[0], i, 1, buff, sparebuff);

if (i % 0x10 == 0) // progress update every 16 blocks
Expand Down

0 comments on commit d3878ab

Please sign in to comment.