[ scummvm-Feature Requests-805691 ] FMTOWNS: Missing opcodes

SourceForge.net noreply at sourceforge.net
Tue Oct 7 05:58:50 CEST 2003


Feature Requests item #805691, was opened at 2003-09-14 03:29
Message generated for change (Comment added) made by khalek
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418823&aid=805691&group_id=37116

Category: None
Group: None
Status: Open
Resolution: Remind
Priority: 5
Submitted By: Thomas Combeleran (hibernatus)
Assigned to: Nobody/Anonymous (nobody)
Summary: FMTOWNS: Missing opcodes

Initial Comment:
Hi, here are what the missing FM Towns opcodes are 
supposed to do:

in resourceRoutines:
- case 0x20: Does nothing. Never used.

- case 0x21: Does nothing. Never used.

- case 0x23: Sets the CD loudness (just a guess, not 
confirmed by UNZ).
Used in Loom (CD loudness divided by 2 while a pattern 
is played).
Not implemented in Indy3 (it reads getVarOrDirectByte
(0x20) and breaks).
Takes 2 bytes (resid and foo in the current code). Must 
be for stereo, but then left == right everywhere.

- case 0x24: Sets the loudness of a sound resource.
Used in Indy3 and Zak.
My guess is that foo is left loudness and bar is right 
loudness, but UNZ doesn't play stereo :)
If foo + bar == 0 (which includes FF + 01 for example), 
the default loudness will be used.
The default loudness is at 0x0E and 0x0F in the sound 
resource.

- case 0x25: Sets the pitch of a sound resource.
Used in Indy3 and Loom.
If foo == 0, the sound is played normally.
pitch = foo - center semitones.
"center" is at 0x32 in the sfx resource (always 0x3C in 
zak256, but sometimes different in Indy3).


in startMusic:
- case 0xFF: Gets the CD loudness.
Used in Loom (when the CD loudness is divided by 2 with 
resourceRoutines)
It returns (left + right + 1) / 2.


About the loudness and pitch:
In the original engine there's an array which contains the 
loudness and the pitch of each sound.
After a sound is played (startSound), the pitch and 
loudness are reset.
So if you set a pitch +1 and then play the sound twice 
you'll hear +1 then +0.
At least that's how it worked with Indy3.

(for ender: i had already added a struct in the 
disassembly, now you can replace field0 by count, field1 
by left, field2 by right and field3 by pitch)


----------------------------------------------------------------------

>Comment By: Jonathan Gray (khalek)
Date: 2003-10-07 13:58

Message:
Logged In: YES 
user_id=59347

just to update those not on irc etc,
loom towns does set the cd volume lower when doing things
like playing notes.

Hibernatus requested this be moved to feature requests and
opened

----------------------------------------------------------------------

Comment By: Max Horn (fingolfin)
Date: 2003-09-14 23:42

Message:
Logged In: YES 
user_id=12935

This isn't a bug. However the very useful information in here has 
been added in form of TODO comments to the source code, 
including a pointer to this tracker item. Thanks!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418823&aid=805691&group_id=37116




More information about the Scummvm-tracker mailing list