Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix libxmp GDM fine effects continue bug
- Loading branch information
Showing
3 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
contrib/patches/libxmp/16-libxmp-4.4.1-fix-gdm-fine-effects.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
diff --git a/src/loaders/gdm_load.c b/src/loaders/gdm_load.c | ||
index a326c9fc..30907f63 100644 | ||
--- a/src/loaders/gdm_load.c | ||
+++ b/src/loaders/gdm_load.c | ||
@@ -60,6 +60,7 @@ static int gdm_test(HIO_HANDLE *f, char *t, const int start) | ||
|
||
void fix_effect(uint8 *fxt, uint8 *fxp) | ||
{ | ||
+ int h, l; | ||
switch (*fxt) { | ||
case 0x00: /* no effect */ | ||
*fxp = 0; | ||
@@ -80,9 +81,49 @@ void fix_effect(uint8 *fxt, uint8 *fxp) | ||
case 0x0b: | ||
case 0x0c: | ||
case 0x0d: | ||
- case 0x0e: | ||
case 0x0f: /* same as protracker */ | ||
break; | ||
+ case 0x0e: | ||
+ /* Convert some extended effects to their S3M equivalents. This is | ||
+ * necessary because the continue effects were left as the original | ||
+ * effect (e.g. FX_VOLSLIDE for the fine volume slides) by 2GDM! | ||
+ * Otherwise, these should be the same as protracker. | ||
+ */ | ||
+ h = MSN(*fxp); | ||
+ l = LSN(*fxp); | ||
+ switch(h) { | ||
+ case EX_F_PORTA_UP: | ||
+ *fxt = FX_PORTA_UP; | ||
+ *fxp = l | 0xF0; | ||
+ break; | ||
+ case EX_F_PORTA_DN: | ||
+ *fxt = FX_PORTA_DN; | ||
+ *fxp = l | 0xF0; | ||
+ break; | ||
+ case 0x8: /* extra fine portamento up */ | ||
+ *fxt = FX_PORTA_UP; | ||
+ *fxp = l | 0xE0; | ||
+ break; | ||
+ case 0x9: /* extra fine portamento down */ | ||
+ *fxt = FX_PORTA_DN; | ||
+ *fxp = l | 0xE0; | ||
+ break; | ||
+ case EX_F_VSLIDE_UP: | ||
+ /* Don't convert 0 as it would turn into volume slide down... */ | ||
+ if (l) { | ||
+ *fxt = FX_VOLSLIDE; | ||
+ *fxp = (l << 4) | 0xF; | ||
+ } | ||
+ break; | ||
+ case EX_F_VSLIDE_DN: | ||
+ /* Don't convert 0 as it would turn into volume slide up... */ | ||
+ if (l) { | ||
+ *fxt = FX_VOLSLIDE; | ||
+ *fxp = l | 0xF0; | ||
+ } | ||
+ break; | ||
+ } | ||
+ break; | ||
case 0x10: /* arpeggio */ | ||
*fxt = FX_S3M_ARPEGGIO; | ||
break; | ||
@@ -367,7 +408,7 @@ static int gdm_load(struct module_data *m, HIO_HANDLE *f, const int start) | ||
return -1; | ||
} | ||
|
||
- m->quirk |= QUIRK_ARPMEM; | ||
+ m->quirk |= QUIRK_ARPMEM | QUIRK_FINEFX; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters