libmsx
C library for MSX
|
#include <opll_buf.h>
Buffered access to OPLL registers.
More...
Functions | |
void | OPLL_init (void) |
MSX Initialize internal buffer for OPLL. | |
void | OPLL_put (uint8_t reg, uint8_t val) |
MSX Put a pair of OPLL register number and its value to the internal buffer. | |
void | OPLL_rhythm_mode (bool on) |
MSX Turn RHYTHM mode on/off. | |
void | OPLL_rhythm (uint8_t val) |
MSX Key-on/off RHYTHM set. | |
void | OPLL_stop (struct OPLL *opll) |
MSX Stop (Pause) playing sound on OPLL | |
void | OPLL_play (struct OPLL *opll) |
MSX Play sound on OPLL | |
Variables | |
uint8_t | opll_buffer [64] |
MSX Cache of OPLL registers. | |
#include <opll_buf.h>
Buffered access to OPLL registers.
Provides simple APIs for sound driver developpers.
Example
The following code shows a sound driver/replayer template for the MSX-MUSIC (OPLL).
void OPLL_init | ( | void | ) |
MSX
Initialize internal buffer for OPLL.
This must be called at least once before OPLL_stop() or OPLL_play().
void OPLL_put | ( | uint8_t | reg, |
uint8_t | val | ||
) |
MSX
Put a pair of OPLL register number and its value to the internal buffer.
Put the pair of OPLL register #reg
and its value val
into the internal FIFO buffer. Then, by calling OPLL_play()
, all values in the FIFO buffer are written to OPLL.
reg | OPLL register number
|
val | a value to be written to the register. |
void OPLL_rhythm_mode | ( | bool | on | ) |
MSX
Turn RHYTHM mode on/off.
on | Specify the mode:
|
void OPLL_rhythm | ( | uint8_t | val | ) |
MSX
Key-on/off RHYTHM set.
val | Key-on/off switch for each RHYTHM set:
|
void OPLL_stop | ( | struct OPLL * | opll | ) |
MSX
Stop (Pause) playing sound on OPLL
opll | pointer to the OPLL handle. |
void OPLL_play | ( | struct OPLL * | opll | ) |
MSX
Play sound on OPLL
This function applies the values in the internal buffer to OPLL.
opll | pointer to the OPLL handle. |
|
extern |
MSX
Cache of OPLL registers.