# NTMV_M2dInitForMem

## Syntax

      #include <ntmv/m2d.h>

      void NTMV_M2dInitForMem(
               NTMVM2dManualViewerInfo*    pManualViewerInfo,
               NNSFndAllocator*            pAllocator,
               void*                       manualArcData,
               void*                       uiResource,
               const NNSG2dFont *const     fonts[]);

## Arguments

`pManualViewerInfo` | Pointer to a structure that stores information used by the M2d library.
`pAllocator` | Pointer to the TWL-System allocator.
`manualArcData` | Pointer to the E-Manual binary data.
`uiResource` | Pointer to the resource data used by the M2d library. The resource data must be aligned to a 32-byte boundary.
`fonts` | Array of pointers to `NNSG2dFont` structures configured with the internal system fonts (TWL bitmap fonts) used to display the E-Manual. Pointers to font data must be set in the following order. Index 0: Large font Index 1: Medium font Index 2: Small font

## Return Values

None.

## Description

Allocates memory and configures the hardware to display the E-Manual. The TWL-System allocator handles memory allocation.

This function specifies the resource data used by the M2d library and the E-Manual binary data with pointers to memory. Use the `NTMV_M2dInitForFilePath` or `NTMV_M2dInitForFilePathEx` function to specify path strings to the ROM files.

The E-Manual binary file and the resource files used by the library are compressed with the `compBLZ` TWL-SDK tool. Use the `MI_SecureUncompressBLZ` TWL-SDK function to decompress data before passing it to this function.
Resource data used by the library must be aligned to a 32-byte boundary.

Unlike the `NTMV_M2dInitForMemEx` function, this function determines the display language for the E-Manual based on the language setting in System Settings. If an E-Manual binary file for the system's current language setting cannot be found, the manual is displayed using the topmost of the languages that were selected in TWL Manual Editor when the project was output to binary.

## See Also

`NTMV_M2dInitForMemEx`
`NTMV_M2dInitForFilePath`
`NTMV_M2dInitForFilePathEx`

## Revision History

2008/12/12 Added an explanation of the difference between this function and `NTMV_M2dInitForMemEx`.
2008/11/19 Changed the type of the `fonts` argument from `void*` to `NNSG2dFont*`.
2008/10/15 Added an explanation regarding fonts.
2008/10/01 Initial version.

CONFIDENTIAL