snes-disassembler
Version:
A Super Nintendo (SNES) ROM disassembler for 65816 assembly
106 lines • 3.91 kB
JavaScript
;
/**
* SNES Audio Type Definitions
*
* This file contains TypeScript interfaces and types for SNES audio-related
* data structures including BRR samples, SPC files, DSP registers, and
* voice configurations used in audio processing and conversion.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DSP_REGISTERS = void 0;
// /**
// * SPC playback state
// */
// interface SPCState {
// /** Current PC (Program Counter) */
// pc: number;
// /** Current CPU registers */
// registers: {
// a: number;
// x: number;
// y: number;
// sp: number;
// psw: number;
// };
// /** Current DSP register values */
// dspState: DSPState;
// /** Playback time in samples */
// playbackTime: number;
// }
// =============================================================================
// DSP (Digital Signal Processor) Structures
// =============================================================================
/**
* DSP register constants for the Sony SPC700 DSP
*/
exports.DSP_REGISTERS = {
// Voice-specific registers (8 voices, each using 16 bytes)
VOICE_LEFT_VOL: 0x00, // VxVOLL - Left volume
VOICE_RIGHT_VOL: 0x01, // VxVOLR - Right volume
VOICE_PITCH_LOW: 0x02, // VxPITCHL - Pitch (low byte)
VOICE_PITCH_HIGH: 0x03, // VxPITCHH - Pitch (high byte)
VOICE_SRC_NUM: 0x04, // VxSRCN - Source number
VOICE_ADSR1: 0x05, // VxADSR1 - ADSR settings (attack/decay)
VOICE_ADSR2: 0x06, // VxADSR2 - ADSR settings (sustain/release)
VOICE_GAIN: 0x07, // VxGAIN - Gain
VOICE_ENV_VAL: 0x08, // VxENVX - Current envelope value
VOICE_OUT_VAL: 0x09, // VxOUTX - Current sample value
// Global registers
MAIN_LEFT_VOL: 0x0C, // MVOLL - Main volume left
MAIN_RIGHT_VOL: 0x1C, // MVOLR - Main volume right
ECHO_LEFT_VOL: 0x2C, // EVOLL - Echo volume left
ECHO_RIGHT_VOL: 0x3C, // EVOLR - Echo volume right
KEY_ON: 0x4C, // KON - Key on
KEY_OFF: 0x5C, // KOFF - Key off
FLAGS: 0x6C, // FLG - Reset, mute, echo-write flags
ENDX: 0x7C, // ENDX - End flag for each voice
// Echo registers
ECHO_FEEDBACK: 0x0D, // EFB - Echo feedback
PITCH_MOD: 0x2D, // PMON - Pitch modulation
NOISE_ON: 0x3D, // NON - Noise enable
ECHO_ON: 0x4D, // EON - Echo enable
SOURCE_DIR: 0x5D, // DIR - Source directory
ECHO_START: 0x6D, // ESA - Echo buffer start address
ECHO_DELAY: 0x7D, // EDL - Echo delay
// FIR filter coefficients
FIR_C0: 0x0F, FIR_C1: 0x1F, FIR_C2: 0x2F, FIR_C3: 0x3F,
FIR_C4: 0x4F, FIR_C5: 0x5F, FIR_C6: 0x6F, FIR_C7: 0x7F
};
// Removed unused SampleMetadata interface
// /**
// * Sample metadata for organizing and managing samples
// */
// interface SampleMetadata {
// /** Unique identifier for the sample */
// id: string;
// /** Human-readable name */
// name: string;
// /** Sample directory index */
// directoryIndex: number;
// /** Start address in SPC RAM */
// startAddress: number;
// /** Loop start address */
// loopAddress: number;
// /** Estimated base pitch (C4 = 8192) */
// basePitch: number;
// /** Root key for pitch calculations */
// rootKey: number;
// /** Fine tuning offset */
// fineTune: number;
// /** Sample length in BRR blocks */
// lengthInBlocks: number;
// /** Whether sample loops */
// loops: boolean;
// /** Sample category/group */
// category?: string;
// /** Additional notes or description */
// notes?: string;
// }
// Removed unused SampleBank interface
// =============================================================================
// Audio Processing and Conversion Types
// =============================================================================
// Removed unused AudioConversionOptions interface
// Removed unused PlaybackConfig interface
// Removed unused AudioAnalysis interface
//# sourceMappingURL=audio-types.js.map