Opened 20 years ago
Closed 12 years ago
Last modified 4 years ago
#7315 closed feature request
FMTOWNS: Missing opcodes
|Reported by:||SF/hibernatus||Owned by:||athrxx|
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)
Ticket imported from: #805691. Ticket imported from: feature-requests/131.
Change History (9)
comment:1 by , 20 years ago
|Status:||new → closed|
comment:2 by , 20 years ago
comment:3 by , 19 years ago
|Status:||closed → new|
comment:4 by , 19 years ago
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:5 by , 13 years ago
|Status:||new → pending|
comment:6 by , 13 years ago
Can this be closed? All the above opcodes have been implemented.
We still don't support volume or balance settings for "real" CD audio (only for mp3/ogg/flac tracks). But this would be a different feature request.
I set this item to pending.
comment:7 by , 12 years ago
|Status:||pending → closed|
comment:8 by , 12 years ago
This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
comment:9 by , 4 years ago
|Component:||→ Engine: SCUMM|
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!