MusMod 2 QTM v0.01 available

Discuss SoundTrackers, shims to QTM, 32bitting and ARMv7 compatibility
steve3000
Posts: 198
Joined: Thu May 02, 2013 9:25 pm

MusMod 2 QTM v0.01 available

Post by steve3000 » Mon May 06, 2013 7:51 pm

Just emailed the following (please place comments here):

In between enjoying the sun and spending some time digging up the garden - I managed to get a first attempt version of Mus2QTM done today - to translate Krisalis' MusMod to QTM.

Take a look at the readme files (which I wrote as I went along).

Most time was spent on and off over the past week trying to decypher MusMod's SWIs... then finding they differ for each game (grrr!) but I have a solution now.

I also discovered a new bug in QTM v1.41 and 1.42 - again because of the 32bit conversion, which is a real pain - as it affects the SWI I need to use for Mus2QTM - so please load QTM v1.40 (included here) for best performance (26bit only though!).

You'll see I've compiled three Mus2QTM modules, that's because of the different module names used by MusMod, but I'm sure we can get round this in future too...(already have some ideas).

So far sound effects won't work on most games, just the music - only one sound effects method works, which is used by ManUnited Europe.

Enjoy!
Steve

JonAbbott
Posts: 1736
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: MusMod 2 QTM v0.01 available

Post by JonAbbott » Mon May 06, 2013 8:14 pm

I'm just reading through your notes. If you check the catalogue on the dev site, I documented all the versions being used, I think I found 7 versions in all.

Initial thoughts:

Reserving memory via * command sounds sensible, as it differs from game to game. Is there an easy way to tell how much memory they all need?

Each game will need a boot script, so you could merge them all into one with a parameter to switch between varieties if required. Or, we just have a 1:1 match. I don't think it matters how many shims we bundle with ADFFS, the key thing is working towards 32bit compatibility.

Is the bug in QTM easily fixable?

EDIT: *Mus2QTM_Immortalise - it's not necessary. ADFFS has the option to do this via *ADFProtectModules. Just put your module names in "adffs.constants", in the ".Essential_Modules" section.

steve3000
Posts: 198
Joined: Thu May 02, 2013 9:25 pm

Re: MusMod 2 QTM v0.01 available

Post by steve3000 » Mon May 06, 2013 8:26 pm

Actually I was thinking about how to tell the amount of memory needed - the game handles all the loading and the music file can be compressed or scrambled in some cases - so there is no way to just 'read' the size required. I was thinking we might have to resort to a table of all Krisalis games and how much each needed...but actually it *might* be possible to read it from the original MusMod file.

In the MusMod's I have, the size required is always stored in the first word after the header - where the 32bit flag pointer would be. So maybe we can just interrogate the MusMod file on loading? Or add a *command to do that?

I haven't had a chance to look into the QTM bug yet, the music file loads correctly but seems not to set the 'song loaded' flag. I expect a subroutine is corrupting flags somewhere. Probably not difficult to fix, just time finding where it is...

Steve

steve3000
Posts: 198
Joined: Thu May 02, 2013 9:25 pm

Re: MusMod 2 QTM v0.01 available

Post by steve3000 » Mon May 06, 2013 8:27 pm

Oh yes - the immortalise command was just to make things easy for testing, it'll be much better for ADFFS to handle that in future.

Steve

JonAbbott
Posts: 1736
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: MusMod 2 QTM v0.01 available

Post by JonAbbott » Mon May 06, 2013 9:01 pm

steve3000 wrote:it'll be much better for ADFFS to handle that in future.
If you let me know the module names you want to use, I'll update the current source as I'm playing with DA's at the minute.

I've read though all your notes now, although will go back and re-read as there's a lot to take in, I also need to look through the source. Looks like you've done some sterling work there, although it looks like there's a lot more to it that we originally thought and some potential stumbling blocks where there are unknowns.

Once I've fixed this DA issue, I'll assist wherever I can.

steve3000
Posts: 198
Joined: Thu May 02, 2013 9:25 pm

Re: MusMod 2 QTM v0.01 available

Post by steve3000 » Mon May 06, 2013 9:23 pm

Jon, I haven't had a chance to look at the dev area yet to pull out what you'd mentioned about the different versions of MusMods. All I need are the titles of each module from *Modules (the title string, not the help string ie. "MusicModule", "MusicModule2", "MusicModc2000"...).

One thought I had was for me to call the core module 'MusMod2QTM' - this will host the SWIs and *Commands, then have 7 x 64-byte 'empty' modules to cover the 7 different names, which could all be loaded up but still take very little RMA. All 8 modules would need protecting, but that will allow any Krisalis game to load, avoiding loading it's own MusMod - and only using MusMod2QTM.

Steve

JonAbbott
Posts: 1736
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: MusMod 2 QTM v0.01 available

Post by JonAbbott » Mon May 06, 2013 9:42 pm

The Module names are in this thread

Having a dummy module is how I implemented MemAlloc, it seems like the sensible route to go down short of taking over the relevant OS_Module SWI and fooling the app into thinking its loaded. I may have to do this at a later date, as I've noticed some games load MemAlloc regardless which then takes over. For the time being, lets stick with dummy modules.

We'll also need to protect QTM itself.

JonAbbott
Posts: 1736
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: MusMod 2 QTM v0.01 available

Post by JonAbbott » Thu Jul 04, 2013 9:16 pm

This shim seems to work for Lotus Turbo Challenge 2 on RO3.71, can we remove the "Not public release" message and bundle it with ADFFS? What sort of state is it in?

steve3000
Posts: 198
Joined: Thu May 02, 2013 9:25 pm

Re: MusMod 2 QTM v0.01 available

Post by steve3000 » Thu Jul 18, 2013 10:49 pm

JonAbbott wrote:This shim seems to work for Lotus Turbo Challenge 2 on RO3.71, can we remove the "Not public release" message and bundle it with ADFFS? What sort of state is it in?
Oh, that sounds promising. I'll get hold of Lotus TC 2 and try :) - always enjoyed that one...

Mus2QTM is pretty experimental. I'd need to go back through and check what's in there, as well as make sure memory handling, errors and exit points are all handled correctly - but after that, then yes if it's stable, then we could do a first beta release along with ADFFS.

JonAbbott
Posts: 1736
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: MusMod 2 QTM v0.01 available

Post by JonAbbott » Fri Aug 23, 2013 12:02 pm

JonAbbott wrote:This shim seems to work for Lotus Turbo Challenge 2 on RO3.71
Having compared the audio on RO3.5 vs RO3.71, the stereo positioning is wrong on RO3.71. Not sure if that's down to QTM, the shim or RO, I'd guess RO - probably a change to SWI behaviour.

Post Reply