Skip to content

Commit c79a73e

Browse files
carmikerLukeUsher
authored andcommitted
myvision: Adjust audio frequency to match real hardware
The divider is still unconfirmed, but 21 produces the correct pitch. References: https://gitlab.com/jgemu/jollycv/-/blob/master/src/jcv_myvision.c https://www.youtube.com/watch?v=UqKuNb1Z9Uc https://www.youtube.com/watch?v=RsNxhfD7iJk
1 parent 53a63d6 commit c79a73e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ares/myvision/psg/psg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ares::MyVision {
1212

1313
stream = node->append < Node::Audio::Stream > ("PSG");
1414
stream->setChannels(1);
15-
stream->setFrequency(Constants::Colorburst::NTSC / 16);
15+
stream->setFrequency(Constants::Colorburst::NTSC / 21);
1616
}
1717

1818
auto PSG::unload()->void {
@@ -38,8 +38,8 @@ namespace ares::MyVision {
3838

3939
auto PSG::power()->void {
4040
AY38910::power();
41-
//real-hardware clock is unknown, we used the same value as spectrum and MSX as placeholder
42-
Thread::create(Constants::Colorburst::NTSC / 16, std::bind_front(&PSG::main, this));
41+
// The divider of 21 is a guess, but a good one. Pitch seems the same as real hardware.
42+
Thread::create(Constants::Colorburst::NTSC / 21, std::bind_front(&PSG::main, this));
4343

4444
for (uint level: range(16)) {
4545
volume[level] = 1.0 / pow(2, 1.0 / 2 * (15 - level));

0 commit comments

Comments
 (0)