From cadf40a085339982f2098799ded261e90c96d1fe Mon Sep 17 00:00:00 2001 From: AliceLR Date: Sun, 24 May 2020 02:36:55 -0600 Subject: [PATCH] Fix libxmp xmp_set_position pattern jump/break bug --- contrib/libxmp/src/control.c | 3 +++ ...08-libxmp-4.4.1-fix-xmp-set-position-jump.patch | 14 ++++++++++++++ contrib/patches/libxmp/README | 3 +++ docs/changelog.txt | 3 +++ 4 files changed, 23 insertions(+) create mode 100644 contrib/patches/libxmp/08-libxmp-4.4.1-fix-xmp-set-position-jump.patch diff --git a/contrib/libxmp/src/control.c b/contrib/libxmp/src/control.c index 3bffa87cf..c38bcc38f 100644 --- a/contrib/libxmp/src/control.c +++ b/contrib/libxmp/src/control.c @@ -121,6 +121,9 @@ static void set_position(struct context_data *ctx, int pos, int dir) } else { p->pos = pos; } + f->jumpline = 0; + f->jump = -1; + f->pbreak = 0; } } } diff --git a/contrib/patches/libxmp/08-libxmp-4.4.1-fix-xmp-set-position-jump.patch b/contrib/patches/libxmp/08-libxmp-4.4.1-fix-xmp-set-position-jump.patch new file mode 100644 index 000000000..a535521c9 --- /dev/null +++ b/contrib/patches/libxmp/08-libxmp-4.4.1-fix-xmp-set-position-jump.patch @@ -0,0 +1,14 @@ +diff --git a/src/control.c b/src/control.c +index 3bffa87c..c38bcc38 100644 +--- a/src/control.c ++++ b/src/control.c +@@ -121,6 +121,9 @@ static void set_position(struct context_data *ctx, int pos, int dir) + } else { + p->pos = pos; + } ++ f->jumpline = 0; ++ f->jump = -1; ++ f->pbreak = 0; + } + } + } diff --git a/contrib/patches/libxmp/README b/contrib/patches/libxmp/README index 13f315150..93016b7b5 100644 --- a/contrib/patches/libxmp/README +++ b/contrib/patches/libxmp/README @@ -76,6 +76,9 @@ Patch summary 06: Fixes bugs in the MOD loader caused by the depacker removal patch. This should eventually be merged into patch 02. 07: Removes a non-portable call to fdopen in xmp_load_module_from_file. + Upstream bug report: https://github.com/cmatsuoka/libxmp/issues/167. +08: Makes xmp_set_position clear the pattern break/jump variables consistently. + Penting merge upstream: https://github.com/cmatsuoka/libxmp/pull/169. 10: Fixes https://github.com/cmatsuoka/libxmp/issues/97. This has been merged upstream in PR https://github.com/cmatsuoka/libxmp/pull/98. diff --git a/docs/changelog.txt b/docs/changelog.txt index 2a9f1cf43..2d5e73247 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -18,6 +18,9 @@ USERS directive would ignore editor settings. Also added a recursion limit for includes and fixed a bug where the "include=file" format would not work on some platforms. ++ Fixed a libxmp bug where pattern jump/break could take effect + after using JUMP MOD ORDER or setting MOD_ORDER/MOD_POSITION. + This fixes a bug at the end of the Inmaportal scene in Cans 3. DEVELOPERS