Changes between Version 2 and Version 3 of Ticket #13354, comment 7


Ignore:
Timestamp:
04/22/22 22:42:54 (2 years ago)
Author:
AndywinXp

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13354, comment 7

    v2 v3  
    66
    77Right now I have taken these notes from my own disasms:
    8 - MANIAC **v0** sets the PIT only when playing sound, and when it's not doing that the divisor is defaulted to 0, which means 65536; this would yield a game frequency of about 18.21Hz, which is very slow, but the reality is that ''SCUMM works with quarter frames'' and ''the game processes three game frames for each engine frame'', so we have to multiply 18.21 by 4 * 3, finally obtaining about **218.48Hz** which matches the original speed (this was compared on DosBox);
    9 - **v1-4** games all appear to run on PIT in which the divisor is 0x13B1 (5041), yielding about **236.6955Hz**; this is true also for the shake effects, but be aware that the game timer and the shake timer ''are different entities'' and are not interchangeable (unlike UrQuan did on his implementation); I was able to match DosBox time very accurately when drowning Guybrush in MI1 EGA and VGA.
     8- MANIAC **v1** sets the PIT only when playing sound, and when it's not doing that the divisor is defaulted to 0, which means 65536; this would yield a game frequency of about 18.21Hz, which is very slow, but the reality is that ''SCUMM works with quarter frames'' and ''the game processes three game frames for each engine frame'', so we have to multiply 18.21 by 4 * 3, finally obtaining about **218.48Hz** which matches the original speed (this was compared on DosBox);
     9- **v2-4** games all appear to run on PIT in which the divisor is 0x13B1 (5041), yielding about **236.6955Hz**; this is true also for the shake effects, but be aware that the game timer and the shake timer ''are different entities'' and are not interchangeable (unlike UrQuan did on his implementation); I was able to match DosBox time very accurately when drowning Guybrush in MI1 EGA and VGA.
    1010- Starting from **v5**, the interpreters set up some kind of timer orchestrator which handles several "sub-timers"; the base timer seems to be the iMUSE timer (divisor: 0x1000 or 4096 in decimal, yielding about 291.3042 Hz) ''which is used as the shake timer as well''. The game timer was a bit tricky to obtain, here's the algorithm for reference:
    1111
     
    2121----
    2222
    23 * Given what happens above, I found the frequency to be calculated like this: **(1193182.0 / 4096) * (3433 / 4166) == 240.049Hz**; testing the drowning scene in MI1 CD yields accurate-to-frame timings with respect to DosBox. ''Remember, the shake time is regulated only by the 4096 iMUSE divisor set in the IMS driver'';
     23* Given what happens above, I found the frequency to be calculated like this: **(1193182.0 / 4096) * (3433 / 4166) == 239.992Hz**; testing the drowning scene in MI1 CD yields accurate-to-frame timings with respect to DosBox. ''Remember, the shake time is regulated only by the 4096 iMUSE divisor set in the IMS driver'';
    2424
    2525- **v6** games appear to do the same thing, only with 4167 in place of 4166 (at least this is what the Sam&Max disasm tells me). I still have to do some heavy testing to see if this is accurate. I recall, for some reason, DOTT and S&M to be slower than the other games (about 236Hz) but I have no evidence for this right now, but I do have evidence for the fact that the shake timer is still regulated by the 4096 divisor;