932 Commits

Author SHA1 Message Date
AliceLR
cb02c7212f Fix OXM failed loads caused by zero length samples preceding OGGs. 2022-04-11 05:21:25 -06:00
AliceLR
6e8a4e9385 Fix another LHA negative file length bug. 2022-03-29 23:28:44 -06:00
AliceLR
37e33b7886 Fix bugs related to module repeat and markers.
* When markers are enabled for a module with 256 orders, libxmp
  could attempt to index past the end of the orders array to find
  an end marker.
* When repeating from the end of a module or an end marker into an
  FE marker, libxmp would apply a junk global volume value from the
  marker's scan position instead of from the first actual pattern.
2022-03-18 17:46:52 -06:00
AliceLR
2811ed40fb Fix player volume overflow from bad envelope interpolation. 2022-03-16 03:04:48 -06:00
AliceLR
91b47ef8e5 Fix LHA hang caused by reading unsigned sizes as signed. 2022-03-15 19:12:58 -06:00
AliceLR
4bc9d5fe67 Fix UMRs caused by missing UMX hio_read return value check. 2022-03-15 18:55:58 -06:00
AliceLR
a8f7cce363 Fix mixer crashes caused by combined reverse + offset effects. 2022-03-01 18:29:29 -07:00
AliceLR
08bab7844e Fix crashes caused by sloppy !Tracker loader bounds check. 2022-02-28 20:23:55 -07:00
AliceLR
b062c86249 Don't allow note delay to carry into NNA channels. 2022-02-26 04:26:12 -07:00
AliceLR
b0d2f08795 Fix IT playback bug where invalid instruments broke note cut/off/fade. 2022-02-26 03:11:09 -07:00
AliceLR
fbf8c9af5e Fix bounding for MED synth arpeggios. 2022-02-25 15:35:05 -07:00
AliceLR
70a27d73dd Fix mixer out-of-bounds read caused by reversing stopped samples. 2022-02-25 15:35:04 -07:00
AliceLR
159374a165 Fix multiple bidirectional loop/sustain bugs in the mixer.
* Positions <0 are now clamped at the start of rendering a tick.
  These could cause crashes and mostly only occur in situations
  where negative positions aren't useful.
* When a loop playing in reverse reaches the start of the loop
  at the end of rendering a tick, the loop is repositioned now.
  This prevents the aforementioned clamp from altering the
  playback rate of samples with reversed loops.
* The loop is no longer repositioned when the position is after
  the end of the loop when playing in reverse.
2022-02-25 15:35:04 -07:00
AliceLR
d3c79ed997 Fix more slow loads/high RAM usage caused by invalid DEFLATE streams.
Temporary fix for upstream issue 229, part 2.
2022-02-25 15:35:04 -07:00
AliceLR
2725dce78b Add IT MIDI macro filter effects support.
* Adds IT MIDI macro configuration handling to the IT loader.
* Adds a player parser for IT MIDI macros and support for several
  MIDI macro variables supported by Impulse Tracker.
* Adds support for the IT set parameterized macro, MIDI macro,
  and smooth MIDI macro (OpenMPT extension) effects.
* Adds six missing OpenMPT IT MIDI macro tests and updates the
  OpenMPT IT readme. Also adds a new test for smooth MIDI macros.
2022-02-23 20:15:59 -07:00
AliceLR
542f21ed15 Fix Digital Symphony effects and pattern loading issues.
* Digital Symphony stores patterns in blocks of 2000.
  libxmp previously did not handle this quirk.

* Implemented !Tracker effect 16 Line Jump, which is also used
  by Digital Symphony. This effect acts like Pattern Break, except
  it jumps into the current pattern instead of the next pattern.
  It can also be used in conjunction with Position Jump and Pattern
  Break to change their target row. This effect required minor flow
  hacks to work without clobbering running time.

* Fixed a scan bug related to FX_S3M_TEMPO where tempo values under
  32 would be ignored despite them being higher than the minimum
  allowed tempo.

* Fixed a memory leak in the Digital Symphony loader.

* Digital Symphony effects added:
  - Implemented 1F Invert Loop. This required a new quirk as invert
    loop is implemented in a way that assumes QUIRK_PROTRACK may be
    changed by xmp_set_player.
  - Implemented 2A Volume Slide + Fine Slide Down.
  - Implemented 2B Line Jump (same as !Tracker Line Jump).
  - Implemented 30 Set Stereo.
  - Implemented 32 Unset Sample Repeat. This required switching
    Digital Symphony modules to IT sustain loops instead of regular
    loops. This also required adding support for sustain loops to
    invert loop.

* Digital Symphony effects fixed:
  - Portamento effects 01 02 21 and 22 were incorrectly using
    effect memory.
  - Fine portamento effects 11 12 1a and 1b were being converted
    to Exx instead of their equivalent full byte parameter effects.
  - Vibrato and tremolo effects 04 06 07 now update on tick 0.
  - The highest 3 bits of 09 Set Sample Offset are now translated
    to FX_HIOFFSET instead of being ignored.
  - 0B Position Jump uses a hex parameter in Digital Symphony, but
    libxmp was treating it as decimal.
  - 0F Set Speed now ignores parameter 0 and clamps values >255.
  - 2F Set Tempo now only ignores parameter 0, and clamps other
    valid tempos instead of ignoring them.
  - Extended effects 16 1c 1d and 1e (which libxmp currently does
    not have dedicated effects for) are now bounded with a clamp
    instead of a modulo, which makes them slightly less wrong.
2022-02-23 07:53:52 -07:00
Ozkan Sezer
02949c6628 Merge pull request #571 from AliceLR/fix-filter-cutoff-newnote
Fix for IT filter cutoff 127 on new note behavior.
2022-02-17 00:20:02 +03:00
AliceLR
536f3a50a3 Fix test-dev dependency tracking and Clang parallel make crashes. 2022-02-15 23:44:55 -07:00
AliceLR
3ce1be4e53 Fix for IT filter cutoff 127 on new note behavior.
The IT filter should be disabled if the channel filter cutoff is
currently 127 and the channel filter resonance is currently 0. This
combination of settings should only be applied when a new note is
encountered that does not use portamento; otherwise, the previous
settings should be used. libxmp was instead always resetting the
cutoff to 127 on a new note.
2022-02-15 19:19:03 -07:00
Ozkan Sezer
c574b23121 Merge pull request #570 from AliceLR/fuzz-patch-20220212
Add missing IT filter output clamp and fix misc. sanitizer bugs.
2022-02-15 17:11:02 +03:00
AliceLR
685fab5b39 Fix slow loads/high RAM usage caused by some invalid DEFLATE streams.
Temporary fix for upstream issue 229.
2022-02-15 03:24:37 -07:00
AliceLR
dd8b82bb9b Fix BZ2 slow loads by resizing the output buffer by powers of 2. 2022-02-15 01:34:11 -07:00
AliceLR
aa09cf5eb2 Fix bunzip2 out-of-bounds array subscript in Huffman decoding. 2022-02-15 01:33:34 -07:00
AliceLR
97028b9105 Add missing IT filter clamp to mixer loops.
Adds a clamp to the IT filter mixer loops to prevent filtered output
samples from going above the expected level. The clamp was determined
by comparing against OpenMPT test modules that contain an IT WAV
writer output sample. This fixes numerous playback bugs in test
modules (and probably real modules) that use filters, and also stops
integer overflows in some rare situations with garbage samples.
2022-02-14 22:53:38 -07:00
AliceLR
6c9eeaace9 Fix mixer undefined behavior caused by unloaded samples with loops. 2022-02-14 22:22:26 -07:00