1<html> 2 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 6<base target="main"> 7<title>NAND Processing Sequence</title> 8</head> 9 10<body> 11 12<h1>NAND Processing Sequence</h1> 13<p> 14The processing sequence shown here is just one example. The application does not need to follow this exactly. 15</p> 16 17<hr> 18 19<img src="./seq0.png"> 20<center>- Figure 1 -</center> 21<h3>Description (Figure 1)</h3> 22<p> 23<ul> 24<li>If insufficient free space and insufficient inodes occur at the same time, prioritize the message that notifies the insufficient free space. 25</ul> 26</p> 27 28<hr> 29 30<img src="./seq1.png"> 31<center>- Figure 2 -</center> 32<h3>Description (Figure 2)</h3> 33<p> 34<ul> 35<li>The green box in the upper-right portion of Figure 2 represents the general NAND API call. However, the NANDSimpleSafe API (and the NANDSafe API, whose use is not recommended) differ slightly depending on circumstances, as shown in Figure 3 and in this description. 36<li>The error code <code>NAND_RESULT_CORRUPT</code> indicates that the entire Wii system memory has been corrupted and is irrecoverable. You cannot expect the Wii to restart when its entire system memory has been corrupted. Therefore, if this error is encountered, not only must you stop any application program processes, but also disable the reset/shutdown processes (which are normally enabled) that correspond to the RESET/POWER buttons, and prioritize the notification as much as possible to the player about the contents of this error message. 37<li>As long as the application program observes such NAND-related restrictions as the usage of the home directory and /tmp, the <code>NAND_RESULT_MAXBLOCKS</code> and <code>NAND_RESULT_MAXFILES</code> errors should not arise. The appearance of these error codes thus indicates the possibility of a bug in the system program or application program. While in this status, system operation cannot be guaranteed. We thus recommend that, if possible, you display the specified error message when either of the error codes <code>NAND_RESULT_MAXBLOCKS</code> or <code>NAND_RESULT_MAXFILES</code> is encountered. and that you do not return to the executing routine of the application program itself. 38<li>The appearance of <code>NAND_RESULT_UNKNOWN</code> or unexpected error codes strongly suggests a bug on the SDK side. As you might expect, the system's operation cannot be guaranteed if these errors are encountered, so we recommend that you display the prescribed error message and do not restore the original processing routine of the application program. 39</ul> 40</p> 41 42<hr> 43 44<img src="./seq2.png"> 45<center>- Figure 3 -</center> 46<h3>Description (Figure 3)</h3> 47<p> 48<ul> 49<li>Figure 3 does not show the flow when a NAND function call returns an error code such as <code>NAND_RESULT_CORRUPT, NAND_RESULT_MAXBLOCKS, NAND_RESULT_MAXFILES, NAND_RESULT_BUSY,</code> or <code>NAND_RESULT_ALLOC_FAILED</code>. See the description (Figure 2). 50<li>If a NANDSimpleSafeOpen[Async] call results in <code>NAND_RESULT_ECC_CRIT</code> or <code> NAND_RESULT_AUTHENTICATION</code>, you can assume that the original file has been damaged. Therefore, after you finish releasing all resources using a <CODE>NANDSimpleSafeCancel[Async]</CODE> call, the figure shows the confirmation process of deleting the damaged file. (Notify the player that the save file has been destroyed and request confirmation to delete the file. Also see Figure 2.) 51<li>If <code>NAND_RESULT_ECC_CRIT</code> or <code>NAND_RESULT_AUTHENTICATION</code> are reported for the NANDRead[Async] or NANDWrite[Async] calls near the center of Figure 3, this indicates that the temporary file created internally by the NANDSimpleSafe functions has been corrupted. (You can assume that the contents of the original file are probably undamaged.) In contrast to the above case, do not proceed directly to the confirmation of deletion of the damaged file; instead, redo the save process from the beginning. 52</ul> 53</p> 54 55<hr> 56 57<H2>Revision History</H2> 58<p> 592007/06/xx Revised Figure 2. Added the flows to NAND_RESULT_UNKNOWN and unexpected result codes.<br>2007/05/09 Added the descriptive text for each figure.<br>2007/05/09 Added an error process sequence diagram applicable when using NANDSimpleSafe functions.<br>2007/05/09 Moved the descriptions of supplemental items.<br>2007/02/xx Added a supplement regarding the cases of insufficient memory and insufficient inodes at the same time.<br>2006/11/30 Added support for the error codes <CODE>NAND_RESULT_ALLOC_FAILED NAND_RESULT_MAXBLOCKS</CODE> and <CODE>NAND_RESULT_MAXFILES</CODE>.<br>2006/09/19 Unified terminology. Deleted the word 'entry.'<br>2006/08/30 Initial version. <BR> 60</p> 61 62 63</body> 64</html> 65