AUDIO - Tandy sound: Zak McKracken/Maniac Mansion low note issue

Here you can discuss the development of patches.

AUDIO - Tandy sound: Zak McKracken/Maniac Mansion low note issue

Postby NewRisingSun » 2014-1-09 @ 22:45

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.

Code: Select all
--- 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 */

Last edited by NewRisingSun on 2014-1-15 @ 21:45, edited 1 time in total.
NewRisingSun
Oldbie
 
Posts: 798
Joined: 2005-9-02 @ 02:26

Re: Tandy sound: Zak McKracken/Maniac Mansion low note issue

Postby Great Hierophant » 2014-1-15 @ 20:36

I added this code to my personal, ever evolving DOSBox SVN and compiled binary certainly sounds different in Zak.
http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog
User avatar
Great Hierophant
l33t
 
Posts: 2374
Joined: 2003-4-27 @ 08:20

Re: Tandy sound: Zak McKracken/Maniac Mansion low note issue

Postby Dominus » 2014-1-15 @ 21:52

Moved to DOSBox patches forum
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg


Return to DOSBox Patches

Who is online

Users browsing this forum: krcroft and 1 guest