libmsx
C library for MSX
Loading...
Searching...
No Matches
Open NDS sound effects data, and set it in the driver.
+ Collaboration diagram for Open NDS sound effects data, and set it in the driver.:

Data Structures

struct  NDSFile
 MSX Container of an opened NDS sound effects data. More...
 

Typedefs

typedef struct NDSFile NDSFile
 MSX Container of an opened NDS sound effects data.
 

Functions

int NDP_open_sfx_mem (NDSFile *nds, const uint8_t *loc, size_t size)
 MSX Open NDS sound effects data stored in ROM / RAM.
 
int NDP_open_sfx_bmem (NDSFile *nds, bmemptr_t loc, uint32_t size)
 MSX Open NDS sound effects data stored in banked memory (MegaROM).
 
int NDP_open_sfx_resource (NDSFile *nds, const char *path)
 MSX Open NDS file stored as named resources in banked memory (MegaROM).
 
void NDP_set_sfx_ptr (void *ptr)
 MSX Setup the NDS sound effects data to NDP sound driver.
 
size_t NDP_read_sfx (uint8_t index, NDSFile *nds, uint8_t *buf, size_t buf_size)
 MSX Read the NDS sound effects data.
 
bool NDP_load_sfx (uint8_t index, NDSFile *nds, uint8_t *buf, size_t buf_size)
 MSX Load and setup the NDS sound effects data to NDP sound driver.
 

Detailed Description


Data Structure Documentation

◆ NDSFile

struct NDSFile

MSX Container of an opened NDS sound effects data.

Definition at line 297 of file NDP.h.

+ Collaboration diagram for NDSFile:
Data Fields
MemFile mf

Typedef Documentation

◆ NDSFile

typedef struct NDSFile NDSFile

MSX Container of an opened NDS sound effects data.

Function Documentation

◆ NDP_open_sfx_mem()

int NDP_open_sfx_mem ( NDSFile * nds,
const uint8_t * loc,
size_t size )

MSX Open NDS sound effects data stored in ROM / RAM.

Parameters
ndsPointer to a NDSFile to be initialized.
locLocation of the NDS sound effects data.
sizeSize in bytes.
Returns
Number of sound effects contained in the NDS file.

◆ NDP_open_sfx_bmem()

int NDP_open_sfx_bmem ( NDSFile * nds,
bmemptr_t loc,
uint32_t size )

MSX Open NDS sound effects data stored in banked memory (MegaROM).

Parameters
ndsPointer to a NDSFile to be initialized.
locLocation of the NDS sound effects data.
sizeSize in bytes.
Returns
Number of sound effects contained in the NDS file.

◆ NDP_open_sfx_resource()

int NDP_open_sfx_resource ( NDSFile * nds,
const char * path )

MSX Open NDS file stored as named resources in banked memory (MegaROM).

Parameters
ndsPointer to a NDSFile to be initialized.
pathPath/File name (*.NDS) of the resource.
Returns
Number of sound effects contained in the NDS file.

◆ NDP_set_sfx_ptr()

void NDP_set_sfx_ptr ( void * ptr)

MSX Setup the NDS sound effects data to NDP sound driver.

Parameters
ptrPointer to the sound effects data.

◆ NDP_read_sfx()

size_t NDP_read_sfx ( uint8_t index,
NDSFile * nds,
uint8_t * buf,
size_t buf_size )

MSX Read the NDS sound effects data.

Read the specified sound effects data from the NDSFile into the specified RAM buffer.

Parameters
indexSound effect number.
ndsPointer to the NDSFile opened by NDP_open_sfx_*().
bufPointer to RAM buffer.
buf_sizeSize of the buffer.
Returns
the size of sound effect on success, 0 otherwise.

◆ NDP_load_sfx()

bool NDP_load_sfx ( uint8_t index,
NDSFile * nds,
uint8_t * buf,
size_t buf_size )

MSX Load and setup the NDS sound effects data to NDP sound driver.

Read the specified sound effects data from the NDSFile into the specified RAM buffer, and set the NDP sound driver to play the sound effects from the buffer.

This is almost same as the following code:

c
if (NDP_read_sfx(index, nds, buf, buf_size)) {
}
size_t NDP_read_sfx(uint8_t index, NDSFile *nds, uint8_t *buf, size_t buf_size)
MSX Read the NDS sound effects data.
void NDP_set_sfx_ptr(void *ptr)
MSX Setup the NDS sound effects data to NDP sound driver.
Parameters
indexSound effect number.
ndsPointer to the NDSFile opened by NDP_open_sfx_*().
bufPointer to RAM buffer.
buf_sizeSize of the buffer.
Returns
true on success, false otherwise.
See also
NDP_read_sfx(), NDP_set_sfx_ptr()