aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fmdriver/fmdriver_fmp.c14
-rw-r--r--libopna/opnadrum.c1
2 files changed, 8 insertions, 7 deletions
diff --git a/fmdriver/fmdriver_fmp.c b/fmdriver/fmdriver_fmp.c
index 54f6753..9abfaaa 100644
--- a/fmdriver/fmdriver_fmp.c
+++ b/fmdriver/fmdriver_fmp.c
@@ -3208,20 +3208,20 @@ static void fmp_title(
int l = 0;
int li = 0;
for (int si = 0;; si++) {
- if (l >= 3) {
- // Z8X
- fmp->pdzf.mode = 1;
- return;
- }
if ((offset + si) >= fmp->datalen) {
- fmp->comment[l][0] = 0;
+ if (l < 3) fmp->comment[l][0] = 0;
return;
}
if (li >= FMP_COMMENT_BUFLEN) {
- fmp->comment[l][0] = 0;
+ if (l < 3) fmp->comment[l][0] = 0;
return;
}
uint8_t c = fmp->data[offset+si];
+ if (l >= 3) {
+ // Z8X
+ if (c) fmp->pdzf.mode = 1;
+ return;
+ }
if (c == '\r') {
continue;
} else if (c == '\n') {
diff --git a/libopna/opnadrum.c b/libopna/opnadrum.c
index c3e8d38..5bb3f56 100644
--- a/libopna/opnadrum.c
+++ b/libopna/opnadrum.c
@@ -94,6 +94,7 @@ void opna_drum_mix(struct opna_drum *drum, int16_t *buf, int samples) {
co *= 15 - (level&7);
co >>= 1+(level>>3);
unsigned outlevel = co > 0 ? co : -co;
+ if (!drum->drums[d].left && !drum->drums[d].right) outlevel = 0;
if (outlevel > levels[d]) levels[d] = outlevel;
if (!(drum->mask & (1u << d))) {
if (drum->drums[d].left) lo += co;