Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#131 FMTOWNS: Missing opcodes

closed-remind
athrxx
None
5
2010-09-29
2003-09-13
No

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)

Discussion

  • Max Horn
    Max Horn
    2003-09-14

    • assigned_to: nobody --> fingolfin
    • status: open --> closed-remind
     
  • Max Horn
    Max Horn
    2003-09-14

    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!

     
  • kirben
    kirben
    2003-10-07

    • assigned_to: fingolfin --> nobody
    • status: closed-remind --> open-remind
     
  • Jonathan Gray
    Jonathan Gray
    2003-10-07

    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

     
  • athrxx
    athrxx
    2010-09-04

    • assigned_to: nobody --> athrxx
    • status: open-remind --> pending-remind
     
  • athrxx
    athrxx
    2010-09-04

    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.

     
    • status: pending-remind --> closed-remind
     
  • 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).