3 typedef unsigned char uint8
;
5 typedef unsigned short uint16
;
7 typedef unsigned int uint32
;
8 typedef double float64
;
16 #define MAX_CHANNELS 16
18 #define Period2Freq(period) ((3546897.f * 65536.f) / (period))
22 int16 aFrames
, aVolume
;
23 int16 dFrames
, dVolume
;
25 int16 rFrames
, rVolume
;
42 struct hvl_plsentry
*pls_Entries
;
50 uint8 ins_FilterLowerLimit
;
51 uint8 ins_FilterUpperLimit
;
52 uint8 ins_FilterSpeed
;
53 uint8 ins_SquareLowerLimit
;
54 uint8 ins_SquareUpperLimit
;
55 uint8 ins_SquareSpeed
;
56 uint8 ins_VibratoDelay
;
57 uint8 ins_VibratoSpeed
;
58 uint8 ins_VibratoDepth
;
59 uint8 ins_HardCutRelease
;
60 uint8 ins_HardCutReleaseFrames
;
61 struct hvl_envelope ins_Envelope
;
62 struct hvl_plist ins_PList
;
67 uint8 pos_Track
[MAX_CHANNELS
];
68 int8 pos_Transpose
[MAX_CHANNELS
];
86 int16 vc_NextTranspose
;
87 int16 vc_OverrideTranspose
; // 1.5
89 struct hvl_envelope vc_ADSR
;
90 struct hvl_instrument
*vc_Instrument
;
93 uint16 vc_InstrPeriod
;
94 uint16 vc_TrackPeriod
;
95 uint16 vc_VibratoPeriod
;
97 int16 vc_NoteMaxVolume
;
98 uint16 vc_PerfSubVolume
;
101 uint8 vc_PlantPeriod
;
102 uint8 vc_VoiceVolume
;
103 uint8 vc_PlantSquare
;
104 uint8 vc_IgnoreSquare
;
106 int16 vc_VolumeSlideUp
;
107 int16 vc_VolumeSlideDown
;
109 uint8 vc_HardCutRelease
;
110 int16 vc_HardCutReleaseF
;
111 uint8 vc_PeriodSlideOn
;
112 int16 vc_PeriodSlideSpeed
;
113 int16 vc_PeriodSlidePeriod
;
114 int16 vc_PeriodSlideLimit
;
115 int16 vc_PeriodSlideWithLimit
;
116 int16 vc_PeriodPerfSlideSpeed
;
117 int16 vc_PeriodPerfSlidePeriod
;
118 uint8 vc_PeriodPerfSlideOn
;
119 int16 vc_VibratoDelay
;
120 int16 vc_VibratoSpeed
;
121 int16 vc_VibratoCurrent
;
122 int16 vc_VibratoDepth
;
126 int16 vc_SquareLowerLimit
;
127 int16 vc_SquareUpperLimit
;
130 int16 vc_SquareSlidingIn
;
131 int16 vc_SquareReverse
;
135 int16 vc_FilterSpeed
;
136 int16 vc_FilterUpperLimit
;
137 int16 vc_FilterLowerLimit
;
140 int16 vc_FilterSlidingIn
;
141 int16 vc_IgnoreFilter
;
142 int16 vc_PerfCurrent
;
145 struct hvl_plist
*vc_PerfList
;
146 int8
*vc_AudioPointer
;
147 int8
*vc_AudioSource
;
148 uint8 vc_NoteDelayOn
;
150 int16 vc_NoteDelayWait
;
151 int16 vc_NoteCutWait
;
152 int16 vc_AudioPeriod
;
153 int16 vc_AudioVolume
;
156 int8 vc_SquareTempBuffer
[0x80];
157 int8 vc_VoiceBuffer
[0x282*4];
159 uint8 vc_TrackMasterVolume
;
161 int16 vc_VoicePeriod
;
163 uint32 vc_SetPan
; // New for 1.4
164 uint32 vc_PanMultLeft
;
165 uint32 vc_PanMultRight
;
166 uint32 vc_RingSamplePos
;
168 int8
*vc_RingMixSource
;
169 uint8 vc_RingPlantPeriod
;
170 int16 vc_RingInstrPeriod
;
171 int16 vc_RingBasePeriod
;
172 int16 vc_RingAudioPeriod
;
173 int8
*vc_RingAudioSource
;
174 uint8 vc_RingNewWaveform
;
175 uint8 vc_RingWaveform
;
176 uint8 vc_RingFixedPeriod
;
177 int8 vc_RingVoiceBuffer
[0x282*4];
186 int8
*ht_WaveformTab
[MAX_CHANNELS
];
188 uint16 ht_PositionNr
;
189 uint8 ht_SpeedMultiplier
;
190 uint8 ht_TrackLength
;
192 uint8 ht_InstrumentNr
;
195 uint32 ht_PlayingTime
;
198 int16 ht_StepWaitFrames
;
200 uint16 ht_PosJumpNote
;
201 uint8 ht_GetNewPosition
;
202 uint8 ht_PatternBreak
;
203 uint8 ht_SongEndReached
;
207 struct hvl_position
*ht_Positions
;
208 struct hvl_step ht_Tracks
[256][64];
209 struct hvl_instrument
*ht_Instruments
;
210 struct hvl_voice ht_Voices
[MAX_CHANNELS
];
213 int32 ht_defpanright
;
216 //added for pineappletracker
221 void hvl_DecodeFrame( struct hvl_tune
*ht
, int8
*buf1
, int8
*buf2
, int32 bufmod
);
222 void hvl_InitReplayer( void );
223 BOOL
hvl_InitSubsong( struct hvl_tune
*ht
, uint32 nr
);
224 struct hvl_tune
*hvl_LoadTune( TEXT
*name
, uint32 freq
, uint32 defstereo
);
225 void hvl_FreeTune( struct hvl_tune
*ht
);
227 void hvl_process_step( struct hvl_tune
*ht
, struct hvl_voice
*voice
);
228 void hvl_process_frame( struct hvl_tune
*ht
, struct hvl_voice
*voice
);
229 void hvl_set_audio( struct hvl_voice
*voice
, float64 freqf
);
230 void hvl_playNote(struct hvl_tune
*ht
, int8
*buf1
, int8
*buf2
, int32 bufmod
, struct hvl_voice
*voice
);
232 struct hvl_tune
*tune
;