libmsx
C library for MSX
Loading...
Searching...
No Matches
audio_buf.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
17#ifndef AUDIO_BUF_H_
18#define AUDIO_BUF_H_
19
20#include "memfile.h"
21#include <stdint.h>
22
42extern uint8_t audio_buf_cache[256];
43
49void audio_buf_init(void);
50
58void audio_buf_clear(void);
59
165void audio_buf_put(uint8_t priority, uint8_t cmd, uint8_t val);
166
185inline uint8_t audio_buf_get(uint8_t cmd) {
186 return audio_buf_cache[cmd];
187}
188
202
215void audio_buf_play(void);
216
224void audio_buf_stop(void);
225
228#endif // AUDIO_BUF_H_
void audio_buf_clear(void)
MSX Clear the internal FIFO of the libmsx audio replayer.
void audio_buf_init(void)
MSX Initialize the buffer for the libmsx audio replayer.
void audio_buf_stop(void)
MSX Stop (Pause) playing sound on PSG, SCC/SCC+, and OPLL.
void audio_buf_play(void)
MSX Process all requests in the internal FIFO of the libmsx audio replayer.
uint8_t audio_buf_get(uint8_t cmd)
MSX Return the latest value of the specified command.
Definition audio_buf.h:185
void audio_buf_put(uint8_t priority, uint8_t cmd, uint8_t val)
MSX Put requests to the internal FIFO of the libmsx audio replayer.
uint8_t audio_buf_cache[256]
The latest value of each command.
void audio_buf_restore(void)
MSX Put a request into the internal FIFO to restore the cached value.
Stream interface for ROM / RAM / MegaROM.