Skip to content

Commit c5f9853

Browse files
committed
MACOSXPPC: Still no Fluidlite support in 2.9.0 because of issues on big-endian
When playing Blazing Dragons, I get a wrongly byte-swapped 'size' chunk values, and bogus audio, unless I remove some byte-swapping code from Fluidlite itself. Since I can't say whether the issue is in Fluidlite itself or in ScummVM or in the dragons engine, I chose not to enable the Fluidlite feature for the official 2.9.0 build. I've spend a couple of days on trying to understand this better, but I'll need help.
1 parent f54ed6c commit c5f9853

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

config.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ LDFLAGS='-Wl,-macosx_version_min,10.4 -Wl,-headerpad_max_install_names -L/static
3737
--disable-sparkle \
3838
--disable-tts \
3939
--disable-updates \
40+
--disable-fluidlite \
41+
--disable-fluidsynth \
4042
--enable-taskbar
4143

4244
#perl -pi -e 's/-O2 /-O0 /g' config.mk
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
XXX, UNSURE
2+
3+
on big-endian chars, the 'size' field of chunks, and the sample data are
4+
byte-swapped. But this produces wrong values on OSXPPC.
5+
6+
I can't say if nobody tested this code path on a big-endian machine for
7+
years in FluidSynth/FluidLite, or if the bug lies elsewhere (e.g. in
8+
ScummVM itself or just in the dragons engine?)
9+
10+
XXX: needs more testing before I enable fluidlite in the builds, then
11+
12+
--- a/src/fluid_defsfont.c
13+
+++ b/src/fluid_defsfont.c
14+
@@ -544,7 +544,6 @@
15+
fluid_defsfont_load_sampledata(fluid_defsfont_t* sfont, fluid_fileapi_t* fapi)
16+
{
17+
fluid_file fd;
18+
- unsigned short endian;
19+
fd = fapi->fopen(fapi, sfont->filename);
20+
if (fd == NULL) {
21+
FLUID_LOG(FLUID_ERR, "Can't open soundfont file");
22+
@@ -566,11 +565,9 @@
23+
}
24+
fapi->fclose(fd);
25+
26+
- /* I'm not sure this endian test is waterproof... */
27+
- endian = 0x0100;
28+
-
29+
/* If this machine is big endian, the sample have to byte swapped */
30+
- if (((char *) &endian)[0]) {
31+
+#if defined(WORDS_BIGENDIAN) && 0 /* XXX */
32+
+ {
33+
unsigned char* cbuf;
34+
unsigned char hi, lo;
35+
unsigned int i, j;
36+
@@ -583,6 +580,7 @@
37+
sfont->sampledata[i] = s;
38+
}
39+
}
40+
+#endif
41+
return FLUID_OK;
42+
}
43+
44+
@@ -1892,7 +1890,7 @@
45+
#define READCHUNK(var,fd,fapi) G_STMT_START { \
46+
if (fapi->fread(var, 8, fd) == FLUID_FAILED) \
47+
return(FAIL); \
48+
- ((SFChunk *)(var))->size = GUINT32_FROM_BE(((SFChunk *)(var))->size); \
49+
+ /*((SFChunk *)(var))->size = GUINT32_FROM_BE(((SFChunk *)(var))->size);*/ \
50+
} G_STMT_END
51+
#else
52+
#define READCHUNK(var,fd,fapi) G_STMT_START { \

toolchains/macosx-ppc/packages/order.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ a52dec
2222
libmpcdec
2323
libvpx
2424

25-
fluidlite
25+
# NOT READY YET
26+
# issues e.g. with Blazing Dragons and big-endian soundfount compat
27+
#fluidlite
28+
2629
freetype
2730
fribidi
2831

0 commit comments

Comments
 (0)