aboutsummaryrefslogtreecommitdiff
path: root/libopna/opna.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-03-14 19:07:57 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-03-14 19:07:57 +0900
commit16be4100808e09a94e802adb58bc1c79e5eefd65 (patch)
tree002942b6503b7f706a6bfe9b05df538d1d97320e /libopna/opna.c
parent45e73c2aa4868a602e8120e50812e1641af342e2 (diff)
libopna: enable register read
Diffstat (limited to 'libopna/opna.c')
-rw-r--r--libopna/opna.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libopna/opna.c b/libopna/opna.c
index fb9e24a..10155d0 100644
--- a/libopna/opna.c
+++ b/libopna/opna.c
@@ -17,6 +17,11 @@ void opna_writereg(struct opna *opna, unsigned reg, unsigned val) {
opna_adpcm_writereg(&opna->adpcm, reg, val);
}
+unsigned opna_readreg(const struct opna *opna, unsigned reg) {
+ if (reg > 0xfu) return 0xff;
+ return opna_ssg_readreg(&opna->ssg, reg);
+}
+
void opna_mix(struct opna *opna, int16_t *buf, unsigned samples) {
opna_fm_mix(&opna->fm, buf, samples);
opna_ssg_mix_55466(&opna->ssg, &opna->resampler, buf, samples);