First post, by NewRisingSun
The low notes in Zak McKracken's intro still sound wrong in all emulators when compared to a recording of its output on a real Tandy machine. The reason is that the game writes a period of zero, which does not mean zero, but 1024, similar to the 8254 PIT's period of zero meaning 65536. Current tandy_sound.cpp tries to account for that but does it incorrectly. Attached patch does it correctly, fixing Zak McKracken's intro, as well as one flubbled note in Maniac Mansion Enhanced.
--- tandy_sound.cpp.old 2013-01-15 12:10:04 +0000
+++ tandy_sound.cpp 2014-01-09 22:41:13 +0000
@@ -124,7 +124,7 @@
case 2: /* tone 1 : frequency */
case 4: /* tone 2 : frequency */
R->Period[c] = R->UpdateStep * R->Register[r];
- if (R->Period[c] == 0) R->Period[c] = 0x3fe;
+ if (R->Period[c] == 0) R->Period[c] = R->UpdateStep * 0x400;
if (r == 4)
{
/* update noise shift frequency */
@@ -165,7 +165,7 @@
case 4: /* tone 2 : frequency */
R->Register[r] = (R->Register[r] & 0x0f) | ((data & 0x3f) << 4);
R->Period[c] = R->UpdateStep * R->Register[r];
- if (R->Period[c] == 0) R->Period[c] = 0x3fe;
+ if (R->Period[c] == 0) R->Period[c] = R->UpdateStep * 0x400;
if (r == 4)
{
/* update noise shift frequency */