Opened 10 years ago

Closed 10 years ago

Last modified 11 months ago

#9100 closed patch

FBEAR: Fix for MIDI piano notes (DOS version)

Reported by: eriktorbjorn Owned by: Kirben
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: Fatty Bear's Birthday Surprise

Description

English DOS version of Fatty Bear's Birthday Surprise
Current ScummVM SVN (trunk)

This patch is just proof-of-concept. It's not meant to be final.

In the DOS version of Fatty Bear's Birthday Surprise, when you play the piano it will either use a digitized sound, which is handled correctly, or a MIDI sound, which always plays the same note. This patch attempts to fix that.

Based on observation, before playing a note the game will set variable 173. For the lowest note, it sets it to 431. The next is 432, etc. I don't know the significance of these values. They don't seem to bear any relation to MIDI note values, but I've adjusted the note so that the sound when selecting the piano instrument is the same as the sound when hitting the middle key, just like the other instruments.

The variable is reset to 0 immediately afterwards. I'm speculating that we somehow need to transfer the value of this variable to the IMuse player, and adjust each "note on" event accordingly. That's pretty much what this patch does, but the actual method could probably be a bit nicer.

The Windows version of the game seems to use digitazed sounds throughout, so that version works fine already as far as I know.

Ticket imported from: #2876221. Ticket imported from: patches/1205.

Attachments (2)

fbear-dos-piano.diff (4.4 KB ) - added by eriktorbjorn 10 years ago.
Patch against current SVN (trunk)
fbear-dos-piano2.diff (4.2 KB ) - added by eriktorbjorn 10 years ago.
New improved patch against current SVN (trunk)

Download all attachments as: .zip

Change History (9)

by eriktorbjorn, 10 years ago

Attachment: fbear-dos-piano.diff added

Patch against current SVN (trunk)

comment:1 by eriktorbjorn, 10 years ago

After looking some more, I'm now thinking that my guess that variable 173 indicates the note may have been wrong. It could be the object (i.e. the piano key) instead.

One problem is that I'm not sure what (if any) parameter to descumm is the correct one to disassemble this game's scripts.

comment:2 by SF/mthreepwood, 10 years ago

I believe the note is the offset read in o6_startSound() (and the frequency for digitized sounds is case 224 of o60_soundOps()).

comment:3 by eriktorbjorn, 10 years ago

That makes sense. I had forgotten about the comment in o6_startSound(). I've updated the patch accordingly. This is more like how I imagine a finished patch would be. With the first one, I got stuck on trying to add a new function to IMuseInternal, so I ended up with a slightly awkward property() call instead. This time, I figured it out.

by eriktorbjorn, 10 years ago

Attachment: fbear-dos-piano2.diff added

New improved patch against current SVN (trunk)

comment:4 by fingolfin, 10 years ago

Owner: set to Kirben

comment:5 by Kirben, 10 years ago

The patch works well, and looks fine. So I committed to ScummVM SVN, with minor change.

comment:6 by Kirben, 10 years ago

Status: newclosed

comment:7 by digitall, 11 months ago

Component: Engine: SCUMM
Game: Fatty Bear's Birthday Surprise
Note: See TracTickets for help on using tickets.