1.0.1 • Published 1 year ago

3ds-smdh v1.0.1

Weekly downloads
34
License
AGPL-3.0
Repository
github
Last release
1 year ago

3ds-smdh

Reads and writes Nintendo 3DS SMDH files

API Reference

Classes

Typedefs

SMDH

Kind: global class

new SMDH(buffer)

A class for reading and writing 3DS SMDH data.

ParamTypeDescription
bufferBufferAn 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

ParamTypeDescription
bufferTitleBufferThe buffer to write
indexIntegerThe index to write to

smdH.getTitle(index) ⇒ TitleObject

Gets the title object from the SMDH at the specified index

Kind: instance method of SMDH

ParamTypeDescription
indexIntegerThe 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

ParamTypeDescription
indexIntegerThe title index to write to
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
shortDescriptionStringThe short description, max of 64 characters
longDescriptionStringThe long description, max of 128 characters
publisherStringThe 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

ParamTypeDescription
callbackfunctionAn 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

ParamTypeDescription
callbackfunctionAn 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

ParamTypeDescription
bitmapBitmapObjectA pngjs PNG-like object with RGBA bitmap data, width, and height. Must be either 24x24 or 48x48.
iconSizeIntegerThe destination icon size, 24 sets the small icon, and 48 sets the large icon
callbackfunctionAn 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

ParamTypeDescription
bitmapBitmapObjectA square bitmap object
callbackfunctionAn 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

NameTypeDescription
shortDescriptionStringThe short description
longDescriptionStringThe long description
publisherStringThe publisher

TitleBuffer : Buffer

A Buffer object that is exactly 0x200 bytes long

Kind: global typedef

TitleObjects : Object.<TitleObject>

Kind: global typedef
Properties

NameTypeDescription
japaneseTitleObjectThe Japanese title object
englishTitleObjectThe English title object
frenchTitleObjectThe French title object
germanTitleObjectThe German title object
italianTitleObjectThe Italian title object
spanishTitleObjectThe Spanish title object
simplifiedChineseTitleObjectThe Simplified Chinese title object
koreanTitleObjectThe Korean title object
dutchTitleObjectThe Dutch title object
portugueseTitleObjectThe Portuguese title object
russianTitleObjectThe Russian title object
traditionalChineseTitleObjectThe Traditional Chinese title object

BitmapObject : Object

Kind: global typedef
Properties

NameTypeDescription
dataBufferRaw RGBA bitmap data buffer
widthIntegerImage width
heightIntegerImage height