Core
NDP_Initialize
void NDP_Initialize()

Driver initialization. Must be called first before accessing any other functions

NDP_SetMusicData
void NDP_SetMusicData(
const voidaddr
)

Song data start address setting

Parameters
addr
const void*

Address of the music data. This should point to a .NDP binary data without the 7 bytes BASIC headers

NDP_Play
void NDP_Play()

Start playing (clears the work area to zero and starts playing from music start)

NDP_Stop
void NDP_Stop()

Stops playback

NDP_Update
void NDP_Update()

Update a music frame. Must be called at each graphics frame; ideally from the interrupt code.

NDP_Release
void NDP_Release()

Release the driver. Only needed if you would like to initilize the driver again

Utility
NDP_MuteChannel1

Temporary mute channel A

Parameters
frames

Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)

NDP_MuteChannel2

Temporary mute channel B

Parameters
frames

Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)

NDP_MuteChannel3

Temporary mute channel C

Parameters
frames

Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)

NDP_MuteChannel
inline void NDP_MuteChannel(
u8 channel,
u8 frames
)

Temporary mute the given channel

Parameters
channel
u8

Channel number

NDP_CHANNEL_A
NDP_CHANNEL_B
NDP_CHANNEL_C

frames - Number of frames to mute (1:Cancel, 2 to 254:Duraton, 255:Permanent)

NDP_SetVolume
void NDP_SetVolume(
u8 vol
)

Set master volume

Parameters
vol
u8

New master volume

NDP_FadeOut
void NDP_FadeOut(
u8 speed
)

Start fade-out current music

Parameters
speed
u8

Number of frames for each stage (the small the quicker)

NDP_PlayFadeIn
void NDP_PlayFadeIn(
u8 speed
)

Starts playing music while fading-in

Parameters
speed
u8

Number of frames for each stage (the small the quicker)

NDP_SetToneColor
void NDP_SetToneColor(
const voidaddr
)

Set tone color data

Parameters
addr
const void*

Address of tone color definition table

NDP_GetVersion
u16 NDP_GetVersion()

Driver version number

Return

NDP driver version (for example, 0x0104 is version 1.0.4)

NDP_SetInitFlag
inline void NDP_SetInitFlag(
u8 flag
)

Set initialization flag

SFX
NDP_SetSFXData
inline void NDP_SetSFXData(
const voidaddr
)

Set sound effects data address

Parameters
addr
const void*

Address of the sound effects data. This should point to a .NDS binary data without the 7 bytes BASIC headers

NDP_GetSFXNumber
inline u8 NDP_GetSFXNumber()

Get the number of sound effect into the current bank.  NDP_SetSFXData must be called first

Return

Number of sound effect in the current bank

NDP_GetSFXOffset
inline u16 NDP_GetSFXOffset(
u8 sfx
)

Get the offset of a given sound effect into the current bank.  NDP_SetSFXData must be called first

Parameters
sfx
u8

Index of the sound effect

Return

Offset of the given sound effect from the start of the bank data

NDP_PlaySFX
void NDP_PlaySFX(
u8 sfx
)

Play a given sound effect.  NDP_SetSFXData must be called first

Parameters
sfx
u8

Index of the sound effect to playback

Status
NDP_GetStatus
inline u8 NDP_GetStatus()

Playing status (NDP_STATUS_xxx)

Return
NDP_STATUS_STOPPED
NDP_STATUS_PLAYING
NDP_IsPlaying
inline bool NDP_IsPlaying()

Whether or not music is currently playing

Return

FALSE if music is not playing

NDP_IsStopped
inline bool NDP_IsStopped()

Whether or not music is currently stopped

Return

FALSE if music is not stopped

NDP_HasTrackEnded
inline bool NDP_HasTrackEnded(
u8 track
)

Whether or not each track has reached the end

Parameters
track
u8

ID of the track

NDP_TRACK_1
NDP_TRACK_2
NDP_TRACK_3
NDP_TRACK_RYTHM
NDP_TRACK_ALL
Return

FALSE if the given track hasn't reached its end

NDP_HasMusicEnded
inline bool NDP_HasMusicEnded()

Whether or not all tracks have reached the end

Return

FALSE if the music hasn't reached the end

NDP_GetLoopCount
inline u8 NDP_GetLoopCount()

Number of times the music has looped

Return

If the music does not have an infinite loop, check +0BH in the music data and return 255 when the music finishes playing

NDP_IsFadding
inline u8 NDP_IsFadding()

Fade setting

Return
0: No fade
1–255: Fade count
NDP_GetFadeType
inline u8 NDP_GetFadeType()

Get th fade type

Return
NDP_FADE_OUT
NDP_FADE_IN
NDP_IsInitialized
inline bool NDP_IsInitialized()

Is the driver initialized

Return

FALSE if driver not initialized