/node-3ds-smdh

Reads and writes Nintendo 3DS SMDH files

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

3ds-smdh

Reads and writes Nintendo 3DS SMDH files

API Reference

Classes

SMDH

Typedefs

TitleObject : Object
TitleBuffer : Buffer

A Buffer object that is exactly 0x200 bytes long

TitleObjects : Object.<TitleObject>
BitmapObject : Object

SMDH

Kind: global class

new SMDH([buffer])

A class for reading and writing 3DS SMDH data.

Param Type Description
[buffer] Buffer An existing SMDH buffer to load

smdH.writeTitleBuffer(buffer, index) ⇒ SMDH

Writes the title buffer to the SMDH buffer at the specified index

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
buffer TitleBuffer The buffer to write
index Integer The index to write to

smdH.getTitle(index) ⇒ TitleObject

Gets the title object from the SMDH at the specified index

Kind: instance method of SMDH

Param Type Description
index Integer The title index to read

smdH.getJapaneseTitle() ⇒ TitleObject

Gets the Japanese title object

Kind: instance method of SMDH

smdH.getEnglishTitle() ⇒ TitleObject

Gets the English title object

Kind: instance method of SMDH

smdH.getFrenchTitle() ⇒ TitleObject

Gets the French title object

Kind: instance method of SMDH

smdH.getGermanTitle() ⇒ TitleObject

Gets the German title object

Kind: instance method of SMDH

smdH.getItalianTitle() ⇒ TitleObject

Gets the Italian title object

Kind: instance method of SMDH

smdH.getSpanishTitle() ⇒ TitleObject

Gets the Spanish title object

Kind: instance method of SMDH

smdH.getSimplifiedChineseTitle() ⇒ TitleObject

Gets the Simplified Chinese title object

Kind: instance method of SMDH

smdH.getKoreanTitle() ⇒ TitleObject

Gets the Korean title object

Kind: instance method of SMDH

smdH.getDutchTitle() ⇒ TitleObject

Gets the Dutch title object

Kind: instance method of SMDH

smdH.getPortugueseTitle() ⇒ TitleObject

Gets the Portuguese title object

Kind: instance method of SMDH

smdH.getRussianTitle() ⇒ TitleObject

Gets the Russian title object

Kind: instance method of SMDH

smdH.getTraditionalChineseTitle() ⇒ TitleObject

Gets the Traditional Chinese title object

Kind: instance method of SMDH

smdH.getAllTitles() ⇒ TitleObjects

Gets object with the all title objects

Kind: instance method of SMDH

smdH.setTitle(index, shortDescription, longDescription, publisher) ⇒ SMDH

Sets the title in the SMDH for the specified index

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
index Integer The title index to write to
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setJapaneseTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Japanese title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setEnglishTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the English title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setFrenchTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the French title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setGermanTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the German title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setItalianTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Italian title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setSpanishTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Spanish title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setSimplifiedChineseTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Simplified Chinese title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setKoreanTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Korean title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setDutchTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Dutch title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setPortugueseTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Portuguese title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setRussianTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Russian title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setTraditionalChineseTitle(shortDescription, longDescription, publisher) ⇒ SMDH

Sets the Traditional Chinese title

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.setAllTitles(shortDescription, longDescription, publisher) ⇒ SMDH

Sets all of the titles

Kind: instance method of SMDH
Returns: SMDH - The current class

Param Type Description
shortDescription String The short description, max of 64 characters
longDescription String The long description, max of 128 characters
publisher String The publisher, max of 64 characters

smdH.getSmallIcon([callback]) ⇒ Promise.<PNG>

Get the small icon image as a pngjs PNG object

Kind: instance method of SMDH
Returns: Promise.<PNG> - A promise with a pngjs PNG object

Param Type Description
[callback] function An optional node.js style callback

smdH.getLargeIcon([callback]) ⇒ Promise.<PNG>

Get the small icon image as a pngjs PNG object

Kind: instance method of SMDH
Returns: Promise.<PNG> - A promise with a pngjs PNG object

Param Type Description
[callback] function An optional node.js style callback

smdH.setIcon(bitmap, iconSize, [callback]) ⇒ Promise.<Buffer>

Sets the icon specified with iconSize

Kind: instance method of SMDH
Returns: Promise.<Buffer> - The current SMDH buffer

Param Type Description
bitmap BitmapObject A pngjs PNG-like object with RGBA bitmap data, width, and height. Must be either 24x24 or 48x48.
iconSize Integer The destination icon size, 24 sets the small icon, and 48 sets the large icon
[callback] function An optional node.js style callback

smdH.setIcons(bitmap, [callback]) ⇒ Promise.<buffer>

Sets both the small and large icons

Kind: instance method of SMDH
Returns: Promise.<buffer> - The current SMDH data buffer

Param Type Description
bitmap BitmapObject A square bitmap object
[callback] function An optional node.js style callback

smdH.getBuffer() ⇒ Buffer

Gets the current SMDH buffer

Kind: instance method of SMDH
Returns: Buffer - The SMDH data buffer

TitleObject : Object

Kind: global typedef
Properties

Name Type Description
shortDescription String The short description
longDescription String The long description
publisher String The publisher

TitleBuffer : Buffer

A Buffer object that is exactly 0x200 bytes long

Kind: global typedef

TitleObjects : Object.<TitleObject>

Kind: global typedef
Properties

Name Type Description
japanese TitleObject The Japanese title object
english TitleObject The English title object
french TitleObject The French title object
german TitleObject The German title object
italian TitleObject The Italian title object
spanish TitleObject The Spanish title object
simplifiedChinese TitleObject The Simplified Chinese title object
korean TitleObject The Korean title object
dutch TitleObject The Dutch title object
portuguese TitleObject The Portuguese title object
russian TitleObject The Russian title object
traditionalChinese TitleObject The Traditional Chinese title object

BitmapObject : Object

Kind: global typedef
Properties

Name Type Description
data Buffer Raw RGBA bitmap data buffer
width Integer Image width
height Integer Image height