libmsx
C library for MSX
|
Data Structures | |
struct | NDPFile |
MSX Container of an opened NDP song data. More... | |
Typedefs | |
typedef struct NDPFile | NDPFile |
MSX Container of an opened NDP song data. | |
Functions | |
int | NDP_open_mem (NDPFile *ndp, const uint8_t *loc, size_t size) |
MSX Open NDP song data stored in ROM / RAM. | |
int | NDP_open_bmem (NDPFile *ndp, bmemptr_t loc, uint32_t size) |
MSX Open NDP song data stored in banked memory (MegaROM). | |
int | NDP_open_resource (NDPFile *ndp, const char *path) |
MSX Open NDP file stored as named resources in banked memory (MegaROM). | |
bool | NDP_set_bgm (NDPFile *ndp) |
MSX Setup the NDP song data to NDP sound driver. | |
bool | NDP_load_bgm (NDPFile *ndp, uint8_t *buf, size_t buf_size) |
MSX Load and setup the NDP song data to NDP sound driver. | |
bool | NDP_has_metadata (NDPFile *ndp) |
MSX Returns whether or not there is metadata in the NDP song data. | |
size_t | NDP_read_metadata (NDPFile *ndp, uint8_t *buf, size_t buf_size) |
MSX Read metadata stored in NDP song data. | |
struct NDPFile |
typedef struct NDPFile NDPFile |
MSX
Container of an opened NDP song data.
int NDP_open_mem | ( | NDPFile * | ndp, |
const uint8_t * | loc, | ||
size_t | size ) |
MSX
Open NDP song data stored in ROM / RAM.
ndp | Pointer to a NDPFile to be initialized. |
loc | Location of the NDP song data. |
size | Size in bytes. |
MSX
Open NDP song data stored in banked memory (MegaROM).
ndp | Pointer to a NDPFile to be initialized. |
loc | Location of the NDP song data. |
size | Size in bytes. |
int NDP_open_resource | ( | NDPFile * | ndp, |
const char * | path ) |
MSX
Open NDP file stored as named resources in banked memory (MegaROM).
ndp | Pointer to a NDPFile to be initialized. |
path | Path/File name (*.NDP) of the resource. |
bool NDP_set_bgm | ( | NDPFile * | ndp | ) |
MSX
Setup the NDP song data to NDP sound driver.
If the song data body is in a contiguous area of the current CPU address space or within the 16KiB segment boundaries of MegaROM, set the NDP sound driver to play directly from that area. Otherwise, fails.
ndp | Pointer to the NDPFile opened by NDP_open_*() . |
true
on success, false
otherwise. bool NDP_load_bgm | ( | NDPFile * | ndp, |
uint8_t * | buf, | ||
size_t | buf_size ) |
MSX
Load and setup the NDP song data to NDP sound driver.
If the specified RAM buffer size is large enough, load the song into the buffer and set the NDP sound driver to play from the buffer. Otherwise, fails.
ndp | Pointer to the NDPFile opened by NDP_open_*() . |
buf | Pointer to RAM buffer. |
buf_size | Size of the buffer. |
true
on success, false
otherwise. bool NDP_has_metadata | ( | NDPFile * | ndp | ) |
MSX
Returns whether or not there is metadata in the NDP song data.
ndp | Pointer to NDPFile opened by NDP_open_*() . |
true
if metadata is present, false
otherwise. size_t NDP_read_metadata | ( | NDPFile * | ndp, |
uint8_t * | buf, | ||
size_t | buf_size ) |
MSX
Read metadata stored in NDP song data.
If there is metadata in the NDP song data, it is read and written to the specified buffer. If successful, the buffer contents will be a concatenation of five C strings (zero-terminated Shift-JIS strings).
Each of the five string values corresponds to the following information in order
If the buffer size is too short, some items in the buffer will be too short or will be invalid strings.
ndp | Pointer to NDPFile opened by NDP_open_*() . |
buf | Pointer to the buffer into which the metadata will be read. |
buf_size | Size of the buffer. |