aboutsummaryrefslogtreecommitdiff
path: root/libopna/opna.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-02-19 17:25:56 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-02-19 17:25:56 +0900
commitd78900cd1497441d7712805b08072e46ee361ff8 (patch)
tree5a696ac5ffa4e6d71992c9329ff5b13ad14cf977 /libopna/opna.c
parentbe500d48fbc381273dfdc600898f68df725aa954 (diff)
add opna status display
Diffstat (limited to 'libopna/opna.c')
-rw-r--r--libopna/opna.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libopna/opna.c b/libopna/opna.c
index 4e198a0..fb9e24a 100644
--- a/libopna/opna.c
+++ b/libopna/opna.c
@@ -6,6 +6,7 @@ void opna_reset(struct opna *opna) {
opna_ssg_resampler_reset(&opna->resampler);
opna_drum_reset(&opna->drum);
opna_adpcm_reset(&opna->adpcm);
+ opna->mask = 0;
}
void opna_writereg(struct opna *opna, unsigned reg, unsigned val) {
@@ -22,3 +23,15 @@ void opna_mix(struct opna *opna, int16_t *buf, unsigned samples) {
opna_drum_mix(&opna->drum, buf, samples);
opna_adpcm_mix(&opna->adpcm, buf, samples);
}
+
+unsigned opna_get_mask(const struct opna *opna) {
+ return opna->mask;
+}
+
+void opna_set_mask(struct opna *opna, unsigned mask) {
+ opna->mask = mask & 0xffffu;
+ opna->fm.mask = mask & ((1<<(6+1))-1);
+ opna->ssg.mask = (mask >> 6) & ((1<<(3+1))-1);
+ opna->adpcm.masked = mask & LIBOPNA_CHAN_ADPCM;
+ opna->drum.mask = (mask >> 9) & ((1<<(6+1))-1);
+}