Closed freq-mod closed 2 years ago
Could you check out if this experimental patch behaves correctly? It does clipping and ladder effect (enable under advanced options), but I don't actually have any good test cases for this. y.txt
Didn't test on V90 yet, but:
@irixxxx bad news, miyoo build erros out:
pico/sound/ym2612_arm.S: Assembler messages:
pico/sound/ym2612_arm.S:932: Error: shift expression expected --
subne r0,r0,rx,lsl#2'`
An overlooked patch part, replace rx by r1
I did the ladder effect by subtracting 4 if the sample is negative. Maybe I did it wrong, I'll have a look. Hmm, I can see that it subtracts 4 for negative samples. Ah wait, should that be shifted to bit 4 because of the 9 bit DAC?
A certain person described ladder effect as: "[...]however, as mentioned, the YM2612 has a bug in its output DAC in regards to voltage output on the YM2612, since there's a 9-bit DAC, there's a volume range going from -256 to +255, with the center being 0 on the updated YM3438 OPN2 chip, the DAC works more or less as expected, with the crossing from positive to negative values being more or less linear on the YM2612 though, there's an error in voltage that makes the jump between positive and negative values excessively large so say you have a sequence like +4 +3 +2 +1 0 -1 -2 -3 -4 on the YM3438 it'd be more or less output like that on the YM2612, the output would turn into something more similar to +4 +3 +2 +1 -3 -4 -5 -6 -7 , even if internally it's still be +4 +3 +2 +1 0 -1 -2 -3 -4 in essence, the output DAC of the YM2612 outputs something with a signal-noise ration closer to 6-bit than 9-bit, even if the values internally are 9-bit.
yes, I know... I did it wrong, on a per channel base. Problem is, I can't do it on the whole sample easily, since the channel values are directly accumulated on sound samples of other hardware, hence I don't know if the total FM output sample is negative or not :-/ So, I'll leave that out for now, I think.
I see. Still, main issue is fixed,and ladder effect not being emulated is not the end of the world - old MAME 2612 doesn't have it as well
Didn't test it on other platforms. Possible it's again, an ARM 32-bit only flaw. Still: clipbug.zip - zip file with test ROM and recording of how should it sound like. On V90 Picodrive, it sounds like a sine wave, which isn't correct.
EDIT: x86_64 PC picodrive build is also affected