libmsx
C library for MSX
Loading...
Searching...
No Matches
The replayer APIs of the NDP sound driver.

The replayer APIs of the NDP sound driver. More...

+ Collaboration diagram for The replayer APIs of the NDP sound driver.:

Functions

void NDP_init (void)
 MSX Initialize the NDP sound driver.
 
uint16_t NDP_version (void)
 MSX Return the version code of the NDP sound driver.
 
void NDP_play (void)
 MSX Main routine of the NDP sound driver.
 
void NDP_start (void)
 MSX Start / Resume music.
 
void NDP_pause (void)
 MSX Pause music.
 
bool NDP_is_paused (void)
 MSX Return whether paused or not.
 
void NDP_stop (void)
 MSX Stop music.
 
void NDP_set_volume (uint8_t vol)
 MSX Set maximum main-volume.
 
void NDP_fadeout (uint8_t wait)
 MSX Fade-out and stop music.
 
void NDP_fadein (uint8_t wait)
 MSX Fade-in and start music.
 
bool NDP_is_playing (void)
 MSX Return whether BGM is playing or not.
 
uint8_t NDP_get_track_status (void)
 MSX Return status for each tracks.
 
uint8_t NDP_get_loop_counter (void)
 MSX Return the loop counter value.
 

Detailed Description

The replayer APIs of the NDP sound driver.

Function Documentation

◆ NDP_init()

void NDP_init ( void )

MSX Initialize the NDP sound driver.

This function must be called once. In particular, it must be called before the first call to any other NDP APIs.

◆ NDP_version()

uint16_t NDP_version ( void )

MSX Return the version code of the NDP sound driver.

Return the 2-byte version code (major << 8) | (minor).

If major is 0, it means version “0.9.minor”, otherwise it means version “major.minor”.

For example,

  • return 0x010A for version 1.10
  • return 0x0003 for version 0.9.3
Returns
version code

◆ NDP_play()

void NDP_play ( void )

MSX Main routine of the NDP sound driver.

To play back background music and/or sound effects, this function must be called at each VSYNC timing.

The easiest way is to set this function as the VSYNC interrupt handler by calling set_vsync_handler().

◆ NDP_start()

void NDP_start ( void )

MSX Start / Resume music.

See also
NDP_fadein()

◆ NDP_pause()

void NDP_pause ( void )

MSX Pause music.

◆ NDP_is_paused()

bool NDP_is_paused ( void )

MSX Return whether paused or not.

Returns
true if paused.

◆ NDP_stop()

void NDP_stop ( void )

MSX Stop music.

See also
NDP_fadeout()

◆ NDP_set_volume()

void NDP_set_volume ( uint8_t vol)

MSX Set maximum main-volume.

Parameters
volVolume (0..15)

◆ NDP_fadeout()

void NDP_fadeout ( uint8_t wait)

MSX Fade-out and stop music.

Parameters
waitNumber of VSYNC frames per step of fade-out (wait count).

◆ NDP_fadein()

void NDP_fadein ( uint8_t wait)

MSX Fade-in and start music.

Parameters
waitNumber of VSYNC frames per step of fade-in (wait count).

◆ NDP_is_playing()

bool NDP_is_playing ( void )

MSX Return whether BGM is playing or not.

Returns
true if BGM is playing.

◆ NDP_get_track_status()

uint8_t NDP_get_track_status ( void )

MSX Return status for each tracks.

Returns
Status flags.
  • bit #3 Tracks 3 (0: finished, 1: playing)
  • bit #2 Tracks 2 (0: finished, 1: playing)
  • bit #1 Tracks 1 (0: finished, 1: playing)
  • bit #0 Tracks R (0: finished, 1: playing)

◆ NDP_get_loop_counter()

uint8_t NDP_get_loop_counter ( void )

MSX Return the loop counter value.

The loop counter starts at 0 and counts up when the song loops back.

In case of overflow (exceeding 255), the counter returns to 0.

Returns
The loop counter value.