MusMod 2 QTM v0.05 available

Discuss SoundTrackers, shims to QTM, 32bitting and ARMv7 compatibility
Post Reply
JonAbbott
Posts: 1737
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

MusMod 2 QTM v0.05 available

Post by JonAbbott » Fri Sep 27, 2013 9:19 am

Source and MusMod2 module on the dev site.


Changes from 0.04:

- *MusSongpos now works correctly (partially fixes Lemmings 2)
- Mus_ScaleSamp implemented (partially fixes Lemmings 2)
- *Mus2QTM_SWI_Alternative added, to switch Mus_Instruments to Mus_ScaleSamp and Mus_FXOnly to Mus_repeffect
- Mus_Run changed to match original module behaviour (fixes Lemmings, Nebulus and Oh, No! More Lemmings)
- Stub added for Mus_Instruments, returning 0 in R0-R3 until we can extent QTM to support it
- Added TeqMus file type support to the service handler


Working

Battle Chess
BlowPipe
Chuck Rock
Heimdall
Hero Quest
James Pond
Lemmings
Mad Professor Mariarti
Manchester United Europe
Nebulus
Oh, No! More Lemmings
Populous


Known issues

Battle Chess - !Battle.NOTHING won't play (worked around I believe by changing the !Run script)
Jahangir Khan World Championship Squash - sound effects sound wrong, could be linear samples (fixed in 0.06)
Manchester United - !!MUFC!!.ZilchMus won't play, so the music doesn't stop when you start a game
Lemmings 2 - hangs during loading
Omar Sharif's Bridge - no sound effects (requires Mus_Repeffect)


Outstanding development

Mus_Patch - Requires QTM extending to support this (entry R0=songpos, R1=songpos). When songpos hits value in R1, jump to songpos in R0
Mus_Sector - Possibly protection related
Mus_Effectcontrol
Mus_Instruments - Requires QTM extending to support this (no entry values, exits R0-R3 containing the instrument no. currently playing in channels 1-4)
Mus_FXonly
Mus_Repeffect
Mus_Mus_Routines (in v0.06)

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

Re: MusMod 2 QTM v0.05 available

Post by JonAbbott » Fri Sep 27, 2013 11:52 am

I've now added *Mus2QTM_Linear_Effects, which forces Mus_Effect to convert effect samples from linear to log before playing them.

To save creating tables to track which samples have already been converted, it simply sets the last aligned word of the sample to -1 once converted and decreases the sample length accordingly. As samples generally fade to silence the missing bytes wont be noticed.

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

Re: MusMod 2 QTM v0.05 available

Post by JonAbbott » Fri Sep 27, 2013 2:58 pm

I've added Mus_Routines it returns the pointer to the SWI jump table.

Mus_Repeffect takes R0-R4:
R0 - pitch ?
R1 - sample address
R2 - sample length
R3 - ?

Its called multiple times with the same sample - no idea why, consequently it sounds pretty bad at the minute.

I've extended *Mus2QTM_LinearEffects to take a parameter. If present it switches the sample offset to 0 instead of &80 - this fixes the samples in Omar Sharif.

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

Re: MusMod 2 QTM v0.05 available

Post by JonAbbott » Sat Sep 28, 2013 12:50 am

Mus_Repeffect changes between MusMod 3 and 4:

MusMod3 (Battle Chess, Omar Sharif)

R0 is either 0, 4, 8, C, 10, or 14 and a different routine is called for each

0 - Calls repeffect_0C 4 times with R1=pointer to blank sample, R2=&80, R3=&CD57 (entry: no parameters) then shutdown the sound system at a guess
4 - Initialises the sound system (entry: no parameters)
8 - Stores R1 as a byte to memory (entry: R1)
C - Looks for a silent channel and then plays a sample (entry: R1 - sample address, R2 - sample length, R3 - pitch ?)
10 - Converts a linear sample to log (entry: R1 - sample address, R2 - sample length)
14 - Loops until all channels have stopped playing


MusMod4 (filename is MUSMOD5 rather confusingly) (Lemmings 2)
MusMod7 (Lemmings [RPC] / Oh, No! More Lemmings [RPC])


R0-R4 are used to call Mus_Effect

Post Reply