VOGONS


First post, by KainXVIII

User metadata
Rank Member
Rank
Member

Superhero League of Hoboken with LEGMPU works like a charm, but there is a strange problem - when i enter Jersey City Marketplace (just south-east from main headquarters) - there is no music at all in this location. This is with GoG version + latest Munt.
PS - when i switched from roland to adlib music appears on this location, is it like this on real hardware or its some kind of bug in emulation?

slh_000.png
Filename
slh_000.png
File size
59.46 KiB
Views
3455 views
File license
Public domain

Reply 1 of 21, by realnc

User metadata
Rank Oldbie
Rank
Oldbie
KainXVIII wrote on 2022-07-06, 09:09:

Superhero League of Hoboken with LEGMPU works like a charm, but there is a strange problem - when i enter Jersey City Marketplace (just south-east from main headquarters) - there is no music at all in this location.

You mean there is music without LEGMPU but not with it loaded?

Reply 2 of 21, by KainXVIII

User metadata
Rank Member
Rank
Member
realnc wrote on 2022-07-06, 09:39:
KainXVIII wrote on 2022-07-06, 09:09:

Superhero League of Hoboken with LEGMPU works like a charm, but there is a strange problem - when i enter Jersey City Marketplace (just south-east from main headquarters) - there is no music at all in this location.

You mean there is music without LEGMPU but not with it loaded?

Ah, sorry for misunderstanding, LEGMPU does not affect this..Maybe original game just does not include this location music for MT-32?

Reply 3 of 21, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It's a bug in the floppy and CD-ROM versions of Superhero League of Hoboken. The game chooses not to play some of the MT-32 MID files stored in the MUS file because they have too many tracks. There are three MID files affected: two are easy to fix with a simple hack, but fixing the third is complicated.

Reply 4 of 21, by KainXVIII

User metadata
Rank Member
Rank
Member
ripsaw8080 wrote on 2022-07-06, 10:09:

It's a bug in the floppy and CD-ROM versions of Superhero League of Hoboken. The game chooses not to play some of the MT-32 MID files stored in the MUS file because they have too many tracks. There are three MID files affected: two are easy to fix with a simple hack, but fixing the third is complicated.

Can you post this simple hack for CD-version? 👀

Reply 5 of 21, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The size of the MUS file, and therefore the offsets where changes are to be made, vary from one version to another. So, instead of mentioning specific offsets, I will describe how to locate the offsets using a hex editor. But first, some description of what the hacking actually does.

The three affected MID files are named "Fight 1", "Fight 2", and "Fight 3". The first two have 12 tracks, the third has 13 tracks. There are four tracks of copyrite (sic) message at the end of the MID files which can be effectively discarded by reducing the track count in the MID file header by four. Reducing the first two MID files to 8 tracks brings them just under the limit of what the game will play. However, the third MID file with 9 tracks will still have one track too many, and if you go ahead and reduce the track count to 8 then the percussion track will not be played. In order to fully fix the third MID file, it would be necessary to merge at least two of its tracks together, which does not appear to be a trivial hack.

To perform the hack, search for the word "Fight" in the .MUS file, for which only three instances should be found. If you go backward 15 bytes from the "F" you will find an 0Ch byte (0Dh for "Fight 3") that you can change to 08h in order to fix that MID file; but as I mentioned above, fixing "Fight 3" in the described manner will lose the drum track.

Reply 6 of 21, by KainXVIII

User metadata
Rank Member
Rank
Member
ripsaw8080 wrote on 2022-07-06, 11:17:

The size of the MUS file, and therefore the offsets where changes are to be made, vary from one version to another. So, instead of mentioning specific offsets, I will describe how to locate the offsets using a hex editor. But first, some description of what the hacking actually does.

The three affected MID files are named "Fight 1", "Fight 2", and "Fight 3". The first two have 12 tracks, the third has 13 tracks. There are four tracks of copyrite (sic) message at the end of the MID files which can be effectively discarded by reducing the track count in the MID file header by four. Reducing the first two MID files to 8 tracks brings them just under the limit of what the game will play. However, the third MID file with 9 tracks will still have one track too many, and if you go ahead and reduce the track count to 8 then the percussion track will not be played. In order to fully fix the third MID file, it would be necessary to merge at least two of its tracks together, which does not appear to be a trivial hack.

To perform the hack, search for the word "Fight" in the .MUS file, for which only three instances should be found. If you go backward 15 bytes from the "F" you will find an 0Ch byte (0Dh for "Fight 3") that you can change to 08h in order to fix that MID file; but as I mentioned above, fixing "Fight 3" in the described manner will lose the drum track.

Thank you, it works like you described!

Reply 7 of 21, by realnc

User metadata
Rank Oldbie
Rank
Oldbie
KainXVIII wrote on 2022-07-06, 14:47:

Thank you, it works like you described!

Do you have a save file in the game that is supposed to play the "Fight 3" music? I wanna try something to fix it before I start my playthrough.

Reply 8 of 21, by KainXVIII

User metadata
Rank Member
Rank
Member
realnc wrote on 2022-07-07, 07:52:
KainXVIII wrote on 2022-07-06, 14:47:

Thank you, it works like you described!

Do you have a save file in the game that is supposed to play the "Fight 3" music? I wanna try something to fix it before I start my playthrough.

I don't think i have, i'm only in the beginning of the game..

Reply 9 of 21, by realnc

User metadata
Rank Oldbie
Rank
Oldbie
KainXVIII wrote on 2022-07-07, 07:58:

I don't think i have, i'm only in the beginning of the game..

OK, I think I fixed it. I'll find out if it works once I get to a place that plays the "Fight 3" music 😜

I attached the fixed version of HOBO_01.MUS (zipped.) It's based on the eXoDOS version of the game and the unmodified file's MD5 sum is 0adb8b1627e336a17b9f0928bff683dd.

It has the edits ripsaw suggested. Also, I deleted the extra tracks of the Fight3 midi, as well as the first track which doesn't contain any notes. It contains the title ("Fight 3") and a tempo change, which is not needed since I've set the global tempo of the midi to match it as close as possible. The file has now 8 tracks and should play.

The original midi file is 19835 bytes. After the changes, it got smaller, so I padded it out with null bytes at the end.

Hopefully this works... If you get there in the game before I do, it's this music that should be playing:

https://www.youtube.com/watch?v=klUOv23baXY

Last edited by DosFreak on 2022-07-07, 18:58. Edited 1 time in total.

Reply 11 of 21, by KainXVIII

User metadata
Rank Member
Rank
Member
realnc wrote on 2022-07-07, 13:16:
KainXVIII wrote on 2022-07-07, 07:58:

I don't think i have, i'm only in the beginning of the game..

t's based on the eXoDOS version of the game and the unmodified file's MD5 sum is 0adb8b1627e336a17b9f0928bff683dd.

eXoDOS version corresponds to cd-rom talkie version?

Reply 14 of 21, by realnc

User metadata
Rank Oldbie
Rank
Oldbie
DosFreak wrote on 2022-07-07, 18:58:

This forum isn't for discussing exodos. Discuss it elsewhere.
Attachment deleted

So instead of removing the mentions of exodos, you instead delete a fan patch. There is no logic whatsoever here.

Reply 15 of 21, by KainXVIII

User metadata
Rank Member
Rank
Member
realnc wrote on 2022-07-07, 19:26:
DosFreak wrote on 2022-07-07, 18:58:

This forum isn't for discussing exodos. Discuss it elsewhere.
Attachment deleted

So instead of removing the mentions of exodos, you instead delete a fan patch. There is no logic whatsoever here.

I'm lucky that I was able to download it 😅

Reply 16 of 21, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

There is logic you just fail to see it. Write an exe to patch the file instead of distributing the file itself.
If you want to take the lazy approach then distribute the modified file elswhere (perhaps from where you got the original) just don't mention it here , don't mention exodos here and don't use exodos as the basis for anything here.
None of this should be news to you considering how old your account is here.

How To Ask Questions The Smart Way
Make your games work offline

Reply 17 of 21, by realnc

User metadata
Rank Oldbie
Rank
Oldbie
DosFreak wrote on 2022-07-07, 21:11:

There is logic you just fail to see it. Write an exe to patch the file instead of distributing the file itself.
If you want to take the lazy approach then distribute the modified file elswhere (perhaps from where you got the original) just don't mention it here , don't mention exodos here and don't use exodos as the basis for anything here.
None of this should be news to you considering how old your account is here.

Well, it is news to me and also I had no idea that fan patches aren't allowed.

Anyway, if someone wants to modify the file themselves:

Update: This turns out it doesn't work. The game hangs when trying to play that MIDI file. I fixed it using a different method. See next post.

Old, non-working instructions:

  • Get the ripped MIDI files of the game or rip them yourself.
  • Import the ripped MIDI file in qtractor as a MIDI track. Track->Import Tracks->MIDI. The correct MIDI file to import is the one that contains the string "Fight 3" somewhere in it.
  • To be able to correctly export it again, you must save the qtractor project. Ctrl+S or File->Save.
  • Now you can go to File-Properties, and in the Properties tab change Ticks/Beat from 960 to 96.
  • Ctrl+S to save the qtractor project again.
  • Export the track as MIDI with a new filename (like "fixed.mid".) You do that with Track->Export Tracks->MIDI, choose "Type 1" as file format, and select "Master" then "OK".
  • Open fixed.mid it in a hex editor that can delete bytes from files (I used bvi.)
  • Change the byte at position 0x0d from 60 to 70.
  • Change the byte at position 0x0b from 09 to 08.
  • Find the first occurrence of "MTrk" and delete it and everything else until the next occurrence of "MTrk".
  • Increase the size of the mid file to 19835 with "truncate -s 19835 fixed.mid". If you've done things correctly prior to that, the size should be smaller than that so the truncate command should increase its size by adding null bytes at the end.
  • Overwrite the relevant part of HOBO_01.MUS with the contents of fixed.mid with "dd conv=notrunc bs=1 if=fixed.mid of=HOBO_01.MUS seek=377543". If the offset of the MIDI file inside HOBO_01.MUS is something other than 377543 (decimal), you need to adapt that value, otherwise you're overwriting the wrong part of the file.

This is all in Linux. I don't know how one would do this in Windows.

Reply 18 of 21, by realnc

User metadata
Rank Oldbie
Rank
Oldbie

OK, so the above method doesn't work. The game hangs when trying to play that MIDI file.

The way I fixed it is by merging the MIDI events from track 8, which contains only 3 notes and 16 events, into track 6, which didn't play any notes at the time the other track did. So track 6 now switches the instrument to what track 8 wanted, plays the note, then switches back to the instrument track 6 normally plays. I then deleted track 8. I kept the copyright tracks intact instead of removing them and simply hex edited the track count to 8 so they get ignored.

But the resulting midi file was too large, because I had to use another MIDI editor to do it instead of QTractor, because it can't cope with the instrument switching of track 6:

https://github.com/markusschwenk/midieditor

What you need to do in that editor, is hide all tracks except Track 7 ("Timp"), then select that track and select all events (ctrl+a), copy them (ctrl+c), then select Track 5 ("Xylo"), made it visible, and then paste the events with ctrl+v at the exact same position they are in Track 7. After pasting, if they are not at the correct position, you can grab one of the notes with the mouse and drag them to the correct position. They will all be draged together since are all selected due to having pasted them. Now delete Track 7. Do not delete the copyright tracks. Save the file.

But that editor generates MIDI data that is too large. It doesn't optimize the MIDI data. So I had to find and download an old DOS utility called MIDCOMPR.EXE (it's shareware,) and run it in dosbox on the MIDI file.

https://www.softpedia.com/get/Multimedia/Audi … /MIDCOMPR.shtml

This will reduce the size so it fits into the HOBO_01.MUS file. It's smaller than the required size, so you need to run "truncate -s 19835" on it. Then open it in a hex editor and change the 12th byte (that's position 0x0b) from 0C to 08. Now put it in HOBO_01.MUS with "dd conv=notrunc bs=1 if=fixed.mid of=HOBO_01.MUS seek=377543" (if that is the correct decimal offset of the "Fight 3" MIDI file inside HOBO_01.MUS of your version of the game. If not, adapt as needed.)

The music now correctly plays in-game and sounds exactly the same as when playing the original, unmodified MIDI file in Munt's MIDI player.