Opened 19 years ago

Closed 19 years ago

Last modified 6 years ago

#8460 closed patch

Kyra 1 Sound Patch

Reported by: lordhoto Owned by: cyxx
Priority: normal Component: Engine: Kyra
Version: Keywords:
Cc: Game: Kyrandia 1



this patch adds basic sound support to Kyrandia. The music now works with Adlib emulation nearly correct, except some times. The sound effects are nearly everytime wrong, but the right sound is played, maybe a wrong instrument is used. Also the music is sometimes played to fast or to slow (to fast in the first scene, in the malcolm tree and in the malcolm kallak scene to slow) Btw. you have to specify Adlib emulation for Adlib sound, because nativ MIDI is preferred. Should work ok with MT-32 emulation, but NOT testet well.

TODO: - check the XMIDI Parser "Hack" - get music synced correctly - get effects to work correctly - test it with the CD version (only tested with german floppy) - check for other bugs

Hope it will work OK.

Ticket imported from: #1281714. Ticket imported from: patches/565.

Attachments (2)

kyra_sound_v1.patch (13.4 KB ) - added by lordhoto 19 years ago.
patch against todays cvs
kyra_sound_v2.patch (14.3 KB ) - added by lordhoto 19 years ago.
patch against todays cvs

Download all attachments as: .zip

Change History (8)

by lordhoto, 19 years ago

Attachment: kyra_sound_v1.patch added

patch against todays cvs

comment:1 by cyxx, 19 years ago

Owner: set to cyxx

comment:2 by cyxx, 19 years ago

Tested it, seems to work quite well. Good work.

Some minor remarks, though : - read the code conventions, switch/break indentation is wrong - constants definitions should be consistent within an engine, you used kConst style whereas I used CONST style - you have some debug() calls left in your code - it would have been nice to match the disassembly in particular for opcode 25, sound seems to be only started if param != 0 and != 1

And some more important remarks (which prevent the patch to be committed) : - in loadSoundEffectFile(), you load some data, where is it free()'d ? - you modified some common sound code (ie. midiparser_xmidi.cpp) ; it would be better to know what event 7 is supposed to do instead of skipping it.

Concerning the CD version, I just checked, the bytecode used in it is different (they added new opcodes and shifted the existing ones) ; so no need to waste time on it now.

by lordhoto, 19 years ago

Attachment: kyra_sound_v2.patch added

patch against todays cvs

comment:3 by lordhoto, 19 years ago

new version, fixes the XMIDIParser Hack, also the memory leak is 'fixed' and the swtich parts should now be indeted correctly.

comment:4 by cyxx, 19 years ago

Committed with minor modifications. Thanks.

comment:5 by cyxx, 19 years ago

Status: newclosed

comment:6 by digitall, 6 years ago

Component: Engine: Kyra
Game: Kyrandia 1
Note: See TracTickets for help on using tickets.