ScummVM API documentation
MADS::RexNebular::Channel Class Reference

#include <rsound.h>

Public Member Functions

void reset (byte *startPtr)
 
void enable (int flag)
 
void load (byte *pData)
 

Public Attributes

RSound_owner = nullptr
 
int _midiChannel = 0
 
int _activeCount = 0
 
int _pitchBendFadeStep = 0
 
int _volumeFadeStep = 0
 
int _panFadeStep = 0
 
int _note = 0
 
int _program = 0
 
int _velocity = 0
 
int _noteOffset = 0
 
int _keyOnDelay = 0
 
int _volumeFadeCounter = 0
 
int _pitchBendFadeCounter = 0
 
int _panFadeCounter = 0
 
int _volume = 0
 
int _pitchBend = 0
 
int _pan = 0
 
int _volumeFadeReload = 0
 
int _pitchBendFadeReload = 0
 
int _panFadeReload = 0
 
int _pitchBendFadeCount = 0
 
int _pendingStop = 0
 
byte * _loopStartPtr = nullptr
 
byte * _pSrc = nullptr
 
byte * _innerLoopPtr = nullptr
 
byte * _outerLoopPtr = nullptr
 
int _innerLoopCount = 0
 
int _outerLoopCount = 0
 
byte * _soundData = nullptr
 

Detailed Description

Represents the data for a channel on the Roland MT-32 / MPU-401 driver. Ported from the Channel struct identified in rsound.009's disassembly; field names/roles were derived by tracing Channel_pollActive() (the per-channel opcode interpreter) and cross-referencing against the equivalent AdlibChannel fields in asound.h.

Confirmed against the real DOS struct layout (IDA struct dump, sizeof=0x22): every field below from _activeCount through _soundData matches the original both in name and in byte offset/order exactly: 0x00 _activeCount 0x0C _volume 0x18 _innerLoopPtr 0x01 _pitchBendFadeStep 0x0D _pitchBend 0x1A _outerLoopPtr 0x02 _volumeFadeStep 0x0E _pan 0x1C _innerLoopCount 0x03 _panFadeStep 0x0F _volumeFadeReload 0x1E _outerLoopCount 0x04 _note 0x10 _pitchBendFadeReload 0x20 _soundData 0x05 _program 0x11 _panFadeReload 0x06 _velocity 0x12 _pitchBendFadeCount 0x07 _noteOffset 0x13 _pendingStop 0x08 _keyOnDelay 0x14 _loopStartPtr 0x09 _volumeFadeCounter 0x16 _pSrc 0x0A _pitchBendFadeCounter 0x0B _panFadeCounter _owner and _midiChannel below are NOT part of the original struct (it has no equivalent fields) - they're C++-side conveniences so Channel methods and callers don't need the MIDI channel number (array index+1) threaded through separately. Any future raw "[bx+N]" disassembly offset can be mapped directly via the table above.

Member Function Documentation

◆ reset()

void MADS::RexNebular::Channel::reset ( byte *  startPtr)

Partial reset used both when loading a new sound and when the loop-restart opcode fires. Deliberately does NOT touch volume, program, velocity, key-on state or active/duration - matches Channel_reset() in the original disassembly.

◆ enable()

void MADS::RexNebular::Channel::enable ( int  flag)

Marks the channel as pending-stop (fading toward silence).

◆ load()

void MADS::RexNebular::Channel::load ( byte *  pData)

Loads a brand new sound into the channel: resets it, marks it active, and resets pitch bend to center on the real device.


The documentation for this class was generated from the following file: