Provides simple APIs for sound driver developpers.
static bool paused;
void init(void) {
}
}
void play(void) {
if (!scc.slot) return;
if (paused) return;
{
for (uint8_t ch = 0; ch < 5; ch++) {
}
}
}
void start(void) {
paused = false;
}
void pause(void) {
paused = true;
__asm__("ei");
}
bool is_paused(void) {
return paused;
}
void stop(void) {
pause();
}
void main(void) {
init();
start();
uint8_t pressed = false;
for (;;) {
uint8_t clicked = pressed & ~joy;
pressed = joy;
if (is_paused()) {
start();
}
else {
pause();
}
}
}
}
void await_vsync(void)
MSX Waits for next VSYNC interrupt.
void set_vsync_handler(void(*handler)(void))
MSX Register user defined VSYNC interrupt handler.
uint8_t channel_mask
Enable / Disable bit for each of the five channels.
uint8_t volume[5]
Volume (0-15) for each of the five channels.
uint16_t fdr[5]
Frequency division ratio for each of the five channels.
void SCC_init(void)
MSX Initialize scc_buffer and internal waveform buffer.
void SCC_set_waveform(uint8_t ch, const int8_t waveform[32])
MSX Set waveform to the internal waveform buffer, for the specified channel.
void SCC_play(struct SCC *scc)
MSX Play sound on SCC/SCC+.
void SCC_stop(struct SCC *scc)
MSX Stop (Pause) playing sound on SCC/SCC+.
struct SCC_buffer scc_buffer
MSX Buffer for SCC/SCC+ registers (except for waveform registers).
void SCC_enable(const struct SCC *scc)
MSX Enable SCC/SCC+ sound chip.
void SCC_set_mode(struct SCC *scc, uint8_t mode)
MSX Set the SCC handle to SCC compatible mode or SCC+ mode.
uint8_t SCC_find(struct SCC *scc)
MSX Find SCC/SCC+ sound chip.
Using #include <msx.h> includes almost all C header files in libmsx, for ease to use.
Buffered access to SCC/SCC+ registers.
Predefined waveforms for SCC/SCC+.