NITRO-SDK CHANGELOG

# NITRO-SDK 4.2 Series Revision History

-> TWL-SDK Revision History

NITRO-SDK 4.2 Release Version (2007/12/10)
  Note 51-01: (WBT) Fixed a bug in the `WBT_CancelCurrentCommand` function
  Known Issues in NITRO-SDK Version 4.2 Release Version

NITRO-SDK 4.2 RC (2007/11/28)
  Note 50-01: (MI) Added LZ77 extended compression format
  Note 50-02: (GX) Changed the `GX_SetVCount` Function
  Note 50-03: (MATH) Revised the `fft-2` sample demo
  Note 50-04: (MI) Fixed a problem with Huffman compression
  Note 50-05: (OS) Corrected a problem with the V-Count alarm
  Note 50-06: (PM) Fixed an inconsistency in tick values before and after calling the `PM-GoSleepMode` function
  Note 50-07: (PRC) Corrected the `pdic2c.pl` sample demo tool
  Note 50-08: (TOOL) Eliminated the parameter that allowed specification of LZ77 compression when using `ntrcomp.exe`
  Note 50-09: (TOOL) Added an endian specification when outputting text using `ntrcomp.exe`
  Note 50-10: (TOOL) Added 8-, 16-, and 32-byte alignment for the output data size when using `ntrcomp.exe`
  Note 50-11: (TOOL) Added a decompression option to `ntrcomp.exe`
  Note 50-12: (WBT) Eliminated a bug related to block transfer to multiple child devices
  Note 50-13: (WM) Changed the send size limit for `WM_SetMPDataToPort*` functions
  Note 50-14: (WM) Corrected the `dataSharing-model` sample demo
  Note 50-15: (MATH) Revised the `wmPadRead-child` sample demo
  Note 50-16: (WM) Eased the limit on the maximum child device send size
  Note 50-17: (WM) Added an initialization function for receive-only mode
  Known Issues in NITRO-SDK Version 4.2 RC

NITRO-SDK 4.2 PR (2007/10/22)
  Note 49-01: (CARD) Added data-writing functions for FLASH devices
  Note 49-02: (CARD) Made Card Library Compatible with New Backup Devices
  Note 49-03: (CARD) Corrected a problem with asynchronous backup functions
  Note 49-04: (DevEnv) Standardized Filenames for make Builds
  Note 49-05: (GX) Changed the `GX_SetVCount` Function
  Note 49-06: (MATH) Changed the implementation of the MATH_CountLeadingZeros function in the thumb library
  Note 49-07: (MATH) Corrected Sample Demos
  Note 49-08: (MB) Fixed a bug specific to the MB_EndToIdle function
  Note 49-09: (MB) Added documentation for Icon data
  Note 49-10: (MB) Fixed bug specific to dynamic reading from memory files
  Note 49-11: (MB) Revised value of the callback argument for a pseudo-multiboot child
  Note 49-12: (MB) Corrected a problem related to terminating the library during transmission
  Note 49-13: (OS) Changed the OS_SetPeriodicVAlarm function
  Note 49-14: (OS) Changed the reference for the OS_SetThreadDestructor function
  Note 49-15: (PM) Corrected LCD control functions
  Note 49-16: (PRC) Updated documentation that describes the figure recognition library
  Note 49-17: (TP) Revised the V-count interrupt used with auto-sampling
  Note 49-18: (WBT) Corrected header files
  Note 49-19: (WBT) Fixed bug in which an infinite loop was caused by delays in preparing data for transfer
  Note 49-20: (WFS) Added a note specific to termination for WFS child devices
  Note 49-21: (WFS) Corrected a memory leak in the WFS_ExecuteRomServerThread function
  Note 49-22: (WFS) Corrected a problem related to block transfer processing during card access
  Note 49-23: (WM) Eliminated a Bug specific to changing parameters during MP communications
  Note 49-24: (WM) Adjusted the V-count range for V-blank synchronization
  Note 49-25: (WM) Eliminated the ball sample demo
  Note 49-26: (WM) Corrected Sample Demos
  Note 49-27: (WM) Eliminated a bug specific to Sequential communications to a child device immediately after connection
  Note 49-28: (Misc) Corrected header file dependency errors
  Known Issues in NITRO-SDK Version 4.2 PR

## NITRO-SDK Version 4.2 Release Version

(2007/12/10)

### Note 51-01: (WBT) Fixed a bug in the `WBT_CancelCurrentCommand` function

Eliminated the following bug: If the `WBT_CancelCurrentCommand` function was called before the completion of a command that was issued to more than one partners, the next command that the cancelled partner issued would never complete.

### Known Issues in NITRO-SDK Version 4.2 Release Version

- Correct results were not being obtained due to a problem with the `MATH_FFTReal` function.
  Until this can be corrected, be sure to insert 0 into the imaginary part of input to the `MATH_FFT` function.

## NITRO-SDK Version 4.2 RC

(2007/11/28)

### Note 50-01: (MI) Added LZ77 extended compression format

Added LZ77 extended compression format.
LZ77 extended compression is available by using the `-lex` option with `ntrcomp.exe` or by using the `MI_CompressLZEx` function or `MI_CompressLZExFast` function.
For decompression, extract data using the existing LZ77 decompression functions.
Although you can expect a higher compression ratio than when using conventional LZ77 compression, when worst case compression speed is compared, considerably more time is required compared to conventional LZ77 compression.
Decompression speed is about the same for both the extended version and conventional version.

### Note 50-02: (GX) Changed the `GX_SetVCount` Function

Revised code and increased the limit because it was insufficient due to the change described in Note 46-08.
The function reference was also revised to correspond with this change.

### Note 50-03: (MATH) Revised the `fft-2` sample demo

Eliminated a bug related to the on-screen display of the `math/fft-2` sample demo and Fourier transformation processing.
In addition, changed the specifications of the spectral display for mic input using a bar, and added a new display mode divided into scales.

### Note 50-04: (MI) Fixed a problem with Huffman compression

A problem with Huffman compression when using the nrtcomp tool and the `MI_CompressHuffman` function was found where incorrect compression results would sometimes occur when 8-bit encoding was encoded in 17 or more bits.
This problem has been corrected.

### Note 50-05: (OS) Corrected a problem with the V-Count alarm

A problem was eliminated that caused some V-count alarms to no longer be issued if execution was interrupted and restarted repeatedly by the debugger when using more than one periodic V-count alarm.
This problem was also corrected in automatic sampling of the touch panel because it uses this feature.

### Note 50-06: (PM) Fixed an inconsistency in tick values before and after calling the `PM-GoSleepMode` function

A problem was corrected where an inconsistency would occur in the tick value obtained by the `OS_GetTick` function before and after sleep. This was caused because the `PM_GoSleepMode` function was prohibiting timer interrupts for 7.5 frames or more.

### Note 50-07: (PRC) Corrected the `pdic2c.pl` sample demo tool

A problem with the `pdic2c.pl` tool for the sample demo was corrected where processing was not performed correctly unless a comment was included for each line of input data.

### Note 50-08: (TOOL) Eliminated the parameter that allowed specification of LZ77 compression when using `ntrcomp.exe`

Although it used to be possible when using the `ntrcomp` tool to perform LZ77 compression to specify the start offset value for text string match searches as an option, beginning from NitroSDK 3.0, this parameter is no longer used.
Since this parameter has already become unnecessary, it has been officially eliminated and deleted from documentation and help.

### Note 50-09: (TOOL) Added an endian specification when outputting text using `ntrcomp.exe`

Although there was a `-t[width]` option with the ntrcomp tool for outputting results as C language array definition text, if 2 or 4 was specified for `width`, data was output in little endian format.
A `-T[width]` option has therefore been added as an option for outputting text data in big-endian format.

### Note 50-10: (TOOL) Added 8-, 16-, and 32-byte alignment for the output data size when using `ntrcomp.exe`

The `ntrcomp` tool had a feature for aligning compressed data to a 4-byte boundary by applying the `-A4` option. The specifications have been changed so that 8-byte, 16-byte, and 32-byte can be specified for the alignment boundary by specifying `-A8`, `-A16`, or `-A32`, respectively.

### Note 50-11: (TOOL) Added a decompression option to `ntrcomp.exe`

The `-x` option has been added to the `ntrcomp` tool for decompressing data compressed using `ntrcomp.exe` on a PC.

### Note 50-12: (WBT) Eliminated a bug related to block transfer to multiple child devices

A problem was corrected where, depending on the timing, a normal completion acknowledgment was never received for some child devices in cases where block transfer requests for the same ID were issued simultaneously by more than one child device.

### Note 50-13: (WM) Changed the send size limit for `WM_SetMPDataToPort*` functions

Although the error `WM_ERRCODE_INVALID_PARAM` has been returned up until now if there was an attempt to use the `WM_SetMPDataToPort*` function to send data having a size larger than the maximum send size currently set for the local host.
However, note that the send queue will be continuously blocked if data quantities larger than the send capacity are set.

### Note 50-14: (WM) Corrected the `dataSharing-model` sample demo

The following revisions have been made to the WM samples.

- Display processing added as described in Note 49-25 has been slightly improved so that it is easier to check that data sharing is being performed accurately when using the `$NitroSDK/build/demos/wm/dataSharing-model` sample demo.

### Note 50-15: (MATH) Revised the `wmPadRead-child` sample demo

Specifications of the `wmPadRead-child` sample demo have been changed in line with changes made so that the `mpdlntr2rvl` sample demo supported by the Wii uses data sharing.
In addition, a problem was corrected where appropriate operations were not being performed by multi-boot child device programs.
The demo library used on the child device has therefore been changed from WC to WH.

### Note 50-16: (WM) Eased the limit on the maximum child device send size

Although it has been impossible up until now to subsequently specify a value for the child device send capacity after the child device send capacity was specified by the parent using `WMParentParam.childMaxSize`, this restriction has been eliminated.
However, note that transmissions will stop if a value greater than the capacity of the parent device's receive buffer is set.

### Note 50-17: (WM) Added an initialization function for receive-only mode

The `WM_EnableForListening` and `WM_InitializeForListening` functions have been added for initializing the wireless system in receive-only mode.
Rather than prohibiting operations that require radio transmission, use of this function allows passive scanning for surrounding beacons without causing the power LED to flash at variable speed.

### Known Issues in NITRO-SDK Version 4.2 RC

- Correct results were not being obtained due to a problem with the `MATH_FFTReal` function.
  Until this can be corrected, be sure to insert 0 into the imaginary part of input to the `MATH_FFT` function.

## NITRO-SDK Version 4.2 PR

(2007/10/22)

### Note 49-01: (CARD) Added data-writing functions for FLASH devices

Added the following data-writing functions for FLASH devices to the SDK.
Large-capacity flash devices that cannot use the `CARD_WriteFlash` function must instead use these functions.

- CARD_EraseFlashSector
- CARD_EraseFlashSectorAsync
- CARD_ProgramFlash
- CARD_ProgramFlashAsync
- CARD_ProgramAndVerifyFlash
- CARD_ProgramAndVerifyFlashAsync
- CARD_WriteFlashSector
- CARD_WriteFlashSectorAsync
- CARD_WriteAndVerifyFlashSector
- CARD_WriteAndVerifyFlashSectorAsync

### Note 49-02: (CARD) Made Card Library Compatible with New Backup Devices

Made the CARD library compatible with 64MB FLASH backup devices and added `CARD_BACKUP_TYPE_FLASH_64MBITS` to the `CARDBackupType` enumerated type.
In relation, the reference and sample demos were updated.

### Note 49-03: (CARD) Corrected a problem with asynchronous backup functions

Fixed the following bug: Abnormal state management inside the CARD library would sometimes arise when a process was waiting for the completion of an asynchronous backup function in a thread with higher priority than the CARD library's internal thread and then a synchronous backup function was called.

### Note 49-04: (DevEnv) Standardized Filenames for make Builds

Made the following revision: when building with `make`, an error no longer occurs even if the name in the `Static` section of the `lsf` file differs with the file specified by `TARGET_BIN`. As a result, when selecting the name to use for the generated file, the name generated from the `TARGET_BIN` specified by the `makelcf` command line option has priority over the name in the `Static` section.
This feature is currently disabled by default in order to confirm its operation.
To enable it, you need to set a value for the NITRO_TRGNAME variable.
(For example,
`% make TARGET_BIN=myapp.srl clean`
`% make TARGET_BIN=myapp.srl NITRO_TRGNAME=TRUE`

### Note 49-05: (GX) Changed the GX_SetVCount Function

The runtime restriction checking was not catching everything; the function was revised to perform more adequate checking.

### Note 49-06: (MATH) Changed the implementation of the MATH_CountLeadingZeros function in the thumb library

The `MATH_CountLeadingZeros` function had until now been used in the `thumb` code library to call `thumb` code implementations of functions, but its operation has now been switched to `ARM` code, and it calls a `CLZ` command. This change improves both code size and run speed.

### Note 49-07: (MATH) Corrected Sample Demos

In the `$NitroSDK/build/demos/math/qsort` sample demo, the comparison function used in sorting handled the compared values as s32 values. Because of this sometimes the comparison result would overflow.
This has been corrected so that calculations are done with s64.

### Note 49-08: (MB) Fixed a bug specific to the MB_EndToIdle function

Fixed the following bug: when the `IDLE` state was ended by a call to the `MB_EndToIdle` function, the settings for the `WM_SetBeaconIndication` function called inside the library still remained valid.

### Note 49-09: (MB) Added documentation for Icon data

Added documentation about the Icon data used with DS Download Play, explaining the image format and creation of Icon data.

### Note 49-10: (MB) Fixed bug specific to dynamic reading from memory files

Fixed the following bug: when a memory file generated by the `FS_CreateFileFromMemory` function was specified as a `MB_ReadSegment` function argument, program delivery processing would not execute.

### Note 49-11: (MB) Revised value of the callback argument for a pseudo-multiboot child

When a pseudo-multiboot child scans for a parent, it can get parent information from the callback argument. Until now, when the callback class was `MB_FAKESCAN_PARENT_LOST`, the `gameInfo` and `bssDesc` members of the `MBFakeScanCallback` structure would be set to NULL.
This has been revised so that even when the class is `MB_FAKESCAN_PARENT_LOST`, `gameInfo` and `bssDesc` are set to the parent information obtained last and those values are returned.

### Note 49-12: (MB) Corrected a problem related to terminating the library during transmission

If the MB_End function was called while a program for which delayed loading had been specified with the MB_ReadSegment function, and was actually being transmitted, the condition test would fail within the library and a forced halt would occur. This problem has been corrected.

### Note 49-13: (OS) Changed the OS_SetPeriodicVAlarm function

Fixed the following problem: an incorrect threshold value was set for the check to determine if the value entered in the `OS_SetPeriodicVAlarm` function's `delay` argument was within a valid range.

### Note 49-14: (OS) Changed the reference for the OS_SetThreadDestructor function

Added notes about destructor functions to the `OS_SetThreadDestructor` function references.

### Note 49-15: (PM) Corrected LCD control functions

Revised the LCD control functions so that when the state is `LCD OFF`, microphone power is off, and when the state is `LCD ON`, microphone power is restored to its original state.

### Note 49-16: (PRC) Updated documentation that describes the figure recognition library

Indicated that the Decuma Handwriting Recognition library can be used when all that is required is hand-written character recognition.

### Note 49-17: (TP) Revised the V-count interrupt used with auto-sampling

The touch panel's auto-sampling makes use of V-count interrupts. However, when the application called the `GX_SetVCount` function, it would sometimes perform inappropriately. This was corrected to not use the V-count interrupts between lines 200 and 214. When settings are made that would cause auto-sampling to occur between lines 200 and 214, sampling is performed at line 215.

### Note 49-18: (WBT) Corrected header files

Made slight revisions to the specification range for `extern "C"` in `$NitroSDK/include/nitro/wbt/context.h`. This does not change the actual behavior of the program.

### Note 49-19: (WBT) Fixed bug in which an infinite loop was caused by delays in preparing data for transfer

Fixed the following bug: when the `WBT` library's `WBT_CMD_PREPARE_SEND_DATA` callback is delayed because the application had not prepared data for transmission, subsequent responses from the parent would enter an infinite loop inside the library and the parent program would freeze.
This bug was introduced in NITRO-SDK 4.1 PR and occurs only in that and subsequent releases.

### Note 49-20: (WFS) Added a note specific to termination for WFS child devices

If wireless communications are ended when a child is using the `WFS` library to access files, the process will remain blocked unless the `WFS_EndClient` function is called to notify the library that communications were terminated. A note about this has been added to the Function Reference.

### Note 49-21: (WFS) Corrected a memory leak in the WFS_ExecuteRomServerThread function

Fixed the following bug: the memory for threads generated internally by a call to the `WFS_ExecuteRomServerThread` function was not released when the `WFS_EndServer` function was called.

### Note 49-22: (WFS) Corrected a problem related to block transfer processing during card access

Fixed the following bug: if the parent was made to wait for card access during a file access request from a `WFS` child, in some cases the process would enter an infinite loop inside the `WFS_CallServerPacketSendHook` function called by the parent.

### Note 49-23: (WM) Eliminated a Bug specific to changing parameters during MP communications

Corrected two problems listed below, both of which emerged as a result of changes to NITRO-SDK 4.1 PR described in Note 46-23.

- During MP communications, the MP frequency could not be modified with the `WM_SetMPParameter` or `WM_SetMPFrequency` function.
- Values for `WMMPParam.minFrequency`, `WMMPParam.maxFrequency` and `WMMPParam.defaultRetryCount`, set by the `WM_SetMPParameter` function, would not become effective until the `WM_StartMP` function was called again.

### Note 49-24: (WM) Adjusted the V-count range for V-blank synchronization

To synchronize V blanks during MP communications, the V-count value might roll back from a maximum of 212 lines to 202 lines. The maximum value has been changed to 210 lines.

### Note 49-25: (WM) Eliminated the ball sample demo

Eliminated the `$NitroSDK/build/demos/wm/ball` sample because, having been designed for the original NITRO-SDK wireless specifications, it is no longer appropriate.
An example of sharing game information using data sharing has been added to the `$NitroSDK/build/demos/wm/dataSharing-model` sample. Refer to it now that `ball` has been removed.

### Note 49-26: (WM) Corrected Sample Demos

The following revisions have been made to the WM samples.

- In `$NitroSDK/build/demos/wireless_shared/wh/default/wh_config.h`, the constant value `4` that was used without explanation inside the `WH_PARENT_MAX_SIZE` macro has been replaced by `WM_SIZE_DS_PARENT_HEADER`.
- In the `$NitroSDK/build/demos/wireless_shared/wh` sample, there are functions that take a prepared `void*` pointer as an argument. In those functions in which the pointer content does not change, the pointer has been changed to `const void*`.
- Combined the wireless control samples located in `$NitroSDK/build/demos/wireless_shared/`.
  The `WC` sample now makes internal use of the `WH` sample, but its existing features can still be used as they were originally.
  In future, the wireless control sample will be integrated into `WH` and the `WC` code will be gradually eliminated.
- In the `WH` sample, the `WM_StartScanEx` function is now used instead of `WM_StartScan` when scanning for parents.
  In a wireless environment with multiple access points, the `WM_StartScan` function may require thirty seconds or more to find a parent.
  The use of the `WM_StartScanEx` function is recommended particularly when connecting to a Wii.
  This was also added to the description of the Wireless Communications library.
- Fixed the following bug: in the `$NitroSDK/bbuild/demos/wm/dataShare-model` sample, nearly one frame's worth of data is empty while key input information is obtained and sent through data sharing; if there was a delay that ought to last two frames, it actually lasted for three frames.

### Note 49-27: (WM) Eliminated a bug specific to Sequential communications to a child device immediately after connection

Fixed the following bug: when Sequential communications were conducted with a child immediately after connection, in some cases the parent would assume the transmission was successful even if the data had not reached the child.

### Note 49-28: (Misc) Corrected header file dependency errors

Fixed the following bug: undefined errors sometimes occurred for a number of constants and functions when the precompiled header feature was disabled and `fx.h` and `gx.h` were included directly instead of `nitro.h`.

### Known Issues in NITRO-SDK Version 4.2 PR

None.

Nintendo Technical Support Center

CONFIDENTIAL