[Scummvm-devel] ScummVM on MacOS - some code patches

Max Horn max at quendi.de
Thu Apr 25 16:29:03 CEST 2002


Hi there,

in the last couple of days I played with ScummVM on my Mac OS X box. 
What bugged me a lot was that I got no sound output for any of my 
games. I discovered that apparently you guys are in the process of 
rewriting your sound system, and therefore the mac midi driver wasn't 
enabled. So I went ahead and rewrote the quicktime driver for the new 
system. Are you interested in a patch for this, or are you already 
working on a converted player yourselves? I also took the CoreAudio 
code I found on your patch tracker (though it was rather incomplete 
there) and turned it into a similiar player.

The next thing was to enable support for the Midi data in the data 
files of the MacOS variants of various games (like FoA). They use a 
sub-type 'MAC ' of 'SOU ' resource, (just like there are 'GMD ' and 
'ROL ') which contains midi chunks. Enabling is hence trivial, though 
it's possible that an instrument mapping table has to be added (the 
music uses wrong instruments, but I have yet to check whether this is 
caused by the midi data, or the midi driver). Maybe I can get hold of 
a copy of DOTT for PC, according to a comment in your sources this is 
supposed to have GM music - if I had this I could make sure that GM 
music is played correctly, i.e. verify the CoreAudio/QuickTime 
backends are playing correctly. Given the fact that they use 
different instruments for the same midi data, at least one of them 
must be wrong :-)


For Monkey Island 1 (Mac version) there are also two new sound 
resource types (i.e. parallel to 'SOU ', not sub data of 'SOU ' like 
'ROL ' is). There ids are 'Mac1' and 'Mac0'. I have figured out some 
things about them, and I can fully decode "Mac1" (used for SFX, e.g. 
the sea gull outside the kitchen in MI1), but I have no clue where 
I'd put a decoder for this into ScummVM. Any hints how I would go 
about this? Basically it's 8bit sampled data.

Sadly, I have currently no clue about how to play the Mac0 format. 
Basically, it contains several CHAN subchunks, each of these contains 
(so far at least, i.e. all I encountered) exactly two chunks: first a 
chunk which seems to contain music data, followed by either an empty 
"Done" chunk or an empty "Loop" chunk. The first subchunk of CHAN can 
have different types, so far I have seen: ORGA, SHAK, BASS, MARI, 
VIBE, WHIS - sounds like instrument names? But I am not understanding 
how I should interpret the data contain in the CHANs. Some typical 
data:


00000000  53 4f 55 4e 00 00 1a 2d  4d 61 63 30 00 00 1a 40  |SOUN...-Mac0...@|
00000010  01 64 01 00 00 01 00 00  00 00 00 00 00 00 00 24  |.d.............$|
00000020  00 00 07 14 00 00 0c f8  00 00 00 00 43 68 61 6e  |............Chan|
00000030  00 00 06 f0 4f 52 47 41  54 60 28 30 16 80 2b 28  |....ORGAT`(0..+(|
00000040  16 80 2d 20 16 80 2b 28  0b 40 2a 24 0b 3f 26 38  |..- ..+(.@*$.?&8|
00000050  01 65 28 52 01 67 00 40  00 b3 28 49 00 b4 00 40  |.e(R.g. at ..(I...@|
00000060  01 67 28 3c 08 6a 00 40  00 b3 26 49 00 b4 00 40  |.g(<.j. at ..&I...@|
00000070  01 67 26 40 01 67 28 49  01 67 00 40 00 b3 28 49  |.g&@.g(I.g. at ..(I|
00000080  00 b4 00 40 01 67 28 49  05 9c 00 40 01 67 26 5b  |... at .g(I... at .g&[|
00000090  01 67 00 40 00 b3 26 49  00 b4 00 40 01 67 26 49  |.g. at ..&I... at .g&I|
000000a0  00 b3 1c 49 00 b4 00 40  01 67 1c 52 0b 36 00 40  |...I... at .g.R.6.@|
000000b0  00 b3 26 5b 00 b4 00 40  01 67 26 49 01 67 24 49  |..&[... at .g&I.g$I|
000000c0  01 67 00 40 00 b3 24 52  00 b4 00 40 01 67 24 49  |.g. at ..$R... at .g$I|
000000d0  01 67 1f 49 01 67 00 40  00 b3 1f 5b 00 b4 00 40  |.g.I.g. at ...[...@|
000000e0  01 67 1f 52 08 6a 00 40  00 b3 21 5b 00 b4 00 40  |.g.R.j. at ..![...@|
000000f0  00 b3 21 49 00 b4 00 40  01 67 28 52 01 67 00 40  |..!I... at .g(R.g.@|
[...]
000006e0  00 b4 00 40 01 67 26 52  01 66 00 40 00 b3 26 5b  |... at .g&R.f. at ..&[|
000006f0  00 b4 00 40 02 19 24 52  00 b4 00 40 00 b3 26 52  |... at ..$R... at ..&R|
00000700  00 b4 00 40 00 b3 26 5b  00 b3 00 40 05 9b 28 52  |... at ..&[... at ..(R|
00000710  00 00 00 00 44 6f 6e 65  00 00 00 00 43 68 61 6e  |....Done....Chan|
00000720  00 00 05 e4 53 48 41 4b  00 f0 34 24 00 f0 3b 20  |....SHAK..4$..; |
00000730  00 f0 40 1b 7e 90 42 1e  10 e0 43 10 10 e0 47 10  |.. at .~.B...C...G.|
00000740  0a f4 4a 10 00 58 00 40  00 28 53 40 00 19 4f 40  |..J..X. at .(S at ..O@|
00000750  00 25 4c 49 00 20 47 40  00 1e 43 3c 00 3c 40 64  |.%LI. G at ..C<.<@d|
00000760  0f 15 00 40 00 3c 47 49  00 09 00 40 00 3c 4c 3c  |... at .<GI... at .<L<|
[...]

If it helps, I can send anybody interested three dumps of Mac0's, all 
only a couple KB, maybe somebody knows how to read them?


Cheers,

Max
-- 
-----------------------------------------------
Max Horn
Software Developer

email: <mailto:max at quendi.de>
phone: (+49) 6151-494890




More information about the Scummvm-devel mailing list