VOGONS


Reply 21 of 35, by realnc

User metadata
Rank Member
Rank
Member

I've hit this issue with PCem too (with SoftMPU loaded through SB16 emulation, since PCem lacks proper MPU-401 emulation.) Exactly the same bug there. Is PCem using the same code as DOSBox for this? Otherwise, it's strange that both DOSBox and PCem exhibit the exact same bug.

LEGMPU.COM isn't working on PCem, since there's no way use IRQ 2.

Reply 22 of 35, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Coming late to this thread - Ripsaw8080, was this eventually patched into the baseline dosbox (assuming that's the right place to permanently fi, it), or is the TSR still the suggested fix for slow midi/mt-32 tempo?

Reply 23 of 35, by realnc

User metadata
Rank Member
Rank
Member
krcroft wrote:

Coming late to this thread - Ripsaw8080, was this eventually patched into the baseline dosbox (assuming that's the right place to permanently fi, it), or is the TSR still the suggested fix for slow midi/mt-32 tempo?

The TSR is still needed.

Reply 25 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I believe that SoftMPU does use the MPU code from DOSBox, which certainly could account for it having the same issue.

Games that use intelligent mode generally fulfil a data request immediately in the MPU IRQ handler, but the Legend games are unusual in that they register a data request in the MPU IRQ handler and only fulfil it later in the timer IRQ handler. I think an event queue would help to better tolerate the delay because data could be requested in advance. It might be just an active and pending event, so a queue depth of two events, but it's not a trivial change in the code.

The TSR calls the timer IRQ handler immediately after an MPU IRQ, thus eliminating the problematic delay, but the workaround is not something that can be "patched into" DOSBox.

Reply 26 of 35, by realnc

User metadata
Rank Member
Rank
Member
ripsaw8080 wrote:

The TSR calls the timer IRQ handler immediately after an MPU IRQ, thus eliminating the problematic delay, but the workaround is not something that can be "patched into" DOSBox.

Do you still have the source for the TSR around? I'd like to see if I can get it working for a different IRQ, for the Sound Blaster + SoftMPU use-case, which is usually IRQ 5 or 7. (You can't use IRQ 2 on a Sound Blaster, but the Legend games allow you to configure the IRQ so they can be played with SoftMPU.)

Reply 27 of 35, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

Interesting details Ripsaw, thanks for the explanation.
Definitely sounds like a development bug in these Legend games. So if there's any gap between the MPU and timer IRQs, then midi playback will be delayed by the gap (over and over again, giving the feeling of slower music).

Maybe Legend developers had machines where these two IRQs fired at the same time, or maybe they had some overlapping/conflicting IRQs that effectively did the same?

I suppose if the game doesn't otherwise use the timer IRQ for anything important, then having it fire sooner than its usual 55ms tempo won't affect anything in the gameplay. Nice.

I'm curious to give this a go with proper midi audio; thanks again for the very nice work!

Reply 28 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I didn't mention it before, but the Legend games do reprogram the timer interrupt to be quite a bit faster than the normal ~18.2 times per second. That is why it's only fast/short events, like the timpani rolls in the Gateway 2 title music, that have a problem because of the delay.

I doubt the Legend games were developed or tested on non-standard hardware or BIOS. I think a real MPU-401 tolerates a small amount of delay in fulfilling data requests by using an event queue like I described in my previous comment. It makes sense because the MPU-401 was probably designed to work without issue on a 4.77 MHz PC using software that might not be efficiently coded.

Reply 29 of 35, by Horizon

User metadata
Rank Newbie
Rank
Newbie

I just found this topic when I notice the same problem with the Legend games. I am wondering if anyone can help me with LEGMPU.COM. I have it in the game's folder and when I run it with DOSBOX nothing happens. The game doesn't load and the command prompt shows again. I used ripsaw8080's GATEFIX.COM for Gateway before without a problem.

Here is what happens:

C:\gateway>legmpu.com

C:\gateway>_

If anyone can point me in the right direction I would really appreciate!

Reply 30 of 35, by realnc

User metadata
Rank Member
Rank
Member

Yeah, that's normal. It doesn't print anything, it just loads itself into memory and stays there.

Also, do you actually need gatefix.com? The starting room ("Your Quarters") music plays fine for me after the intro with current SVN dosbox.

Reply 31 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

LEGMPU is a TSR, and it does not automatically launch a game because it applies to more than one Legend game.

GATEFIX is a loader, and it launches Gateway because it is specifically for that game. However, LEGMPU does a better job of fixing the issue addressed by GATEFIX, so you don't need to use both.

Reply 33 of 35, by krcroft

User metadata
Rank Oldbie
Rank
Oldbie

For future reference, here are Legend Entertainment's games courtesy Moby Games:

https://www.mobygames.com/company/legend-ente … ainment-company.

Edit: and the subset that benefit from ripsaw's midi timer TSR (thank you ripsaw!):

  • Lost Adventures of Legend, The (1996, compilation)
  • Superhero League of Hoboken (1994)
  • Gateway II: Homeworld (1993)
  • Eric the Unready (1993)
  • Companions of Xanth (1993)
  • Spellcasting: Party Pak (1993, compilation)
  • Steve Meretzky's Spellcasting 301: Spring Break (1992)
  • Frederik Pohl's Gateway (1992)
  • Timequest (1991)
  • Spellcasting 201: The Sorcerer's Appliance (1991)
  • Spellcasting 101: Sorcerers get all the Girls (1990)
Last edited by krcroft on 2019-12-16, 03:34. Edited 4 times in total.

Reply 34 of 35, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

AFAIK, Superhero League of Hoboken is the last game release affected by the issue described in this thread. The exception is "The Lost Adventures" which is a compilation of earlier games.