gosu 1.4.5.pre1 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dependencies/SDL/include/SDL.h +1 -0
- data/dependencies/SDL/include/SDL_assert.h +4 -2
- data/dependencies/SDL/include/SDL_atomic.h +20 -0
- data/dependencies/SDL/include/SDL_audio.h +40 -4
- data/dependencies/SDL/include/SDL_blendmode.h +4 -6
- data/dependencies/SDL/include/SDL_clipboard.h +47 -0
- data/dependencies/SDL/include/SDL_config.h +71 -45
- data/dependencies/SDL/include/SDL_cpuinfo.h +39 -4
- data/dependencies/SDL/include/SDL_egl.h +59 -9
- data/dependencies/SDL/include/SDL_endian.h +34 -3
- data/dependencies/SDL/include/SDL_events.h +32 -1
- data/dependencies/SDL/include/SDL_filesystem.h +5 -1
- data/dependencies/SDL/include/SDL_gamecontroller.h +78 -5
- data/dependencies/SDL/include/SDL_guid.h +100 -0
- data/dependencies/SDL/include/SDL_hints.h +645 -43
- data/dependencies/SDL/include/SDL_joystick.h +127 -7
- data/dependencies/SDL/include/SDL_keyboard.h +38 -1
- data/dependencies/SDL/include/SDL_keycode.h +6 -1
- data/dependencies/SDL/include/SDL_log.h +2 -2
- data/dependencies/SDL/include/SDL_main.h +42 -2
- data/dependencies/SDL/include/SDL_metal.h +2 -1
- data/dependencies/SDL/include/SDL_mouse.h +12 -1
- data/dependencies/SDL/include/SDL_opengl.h +0 -51
- data/dependencies/SDL/include/SDL_opengl_glext.h +2260 -231
- data/dependencies/SDL/include/SDL_opengles2_gl2.h +374 -339
- data/dependencies/SDL/include/SDL_opengles2_gl2ext.h +3479 -1496
- data/dependencies/SDL/include/SDL_opengles2_gl2platform.h +6 -9
- data/dependencies/SDL/include/SDL_opengles2_khrplatform.h +43 -14
- data/dependencies/SDL/include/SDL_platform.h +32 -6
- data/dependencies/SDL/include/SDL_rect.h +154 -2
- data/dependencies/SDL/include/SDL_render.h +46 -17
- data/dependencies/SDL/include/SDL_revision.h +6 -1
- data/dependencies/SDL/include/SDL_rwops.h +1 -15
- data/dependencies/SDL/include/SDL_scancode.h +46 -21
- data/dependencies/SDL/include/SDL_sensor.h +24 -3
- data/dependencies/SDL/include/SDL_stdinc.h +119 -8
- data/dependencies/SDL/include/SDL_surface.h +3 -1
- data/dependencies/SDL/include/SDL_system.h +66 -6
- data/dependencies/SDL/include/SDL_syswm.h +2 -0
- data/dependencies/SDL/include/SDL_test_common.h +1 -0
- data/dependencies/SDL/include/SDL_test_font.h +90 -3
- data/dependencies/SDL/include/SDL_thread.h +3 -3
- data/dependencies/SDL/include/SDL_touch.h +8 -0
- data/dependencies/SDL/include/SDL_version.h +19 -3
- data/dependencies/SDL/include/SDL_video.h +71 -9
- data/dependencies/SDL/include/begin_code.h +4 -4
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.c +210 -71
- data/dependencies/SDL_sound/SDL_sound.h +1 -1
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +111 -168
- data/dependencies/SDL_sound/SDL_sound_flac.c +0 -6
- data/dependencies/SDL_sound/SDL_sound_internal.h +27 -5
- data/dependencies/SDL_sound/SDL_sound_modplug.c +20 -8
- data/dependencies/SDL_sound/SDL_sound_mp3.c +11 -7
- data/dependencies/SDL_sound/SDL_sound_raw.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_shn.c +1 -5
- data/dependencies/SDL_sound/SDL_sound_voc.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +2 -4
- data/dependencies/SDL_sound/SDL_sound_wav.c +44 -20
- data/dependencies/SDL_sound/dr_flac.h +237 -95
- data/dependencies/SDL_sound/dr_mp3.h +46 -33
- data/dependencies/SDL_sound/libmodplug/fastmix.c +53 -39
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +0 -12
- data/dependencies/SDL_sound/libmodplug/load_669.c +37 -32
- data/dependencies/SDL_sound/libmodplug/load_amf.c +57 -44
- data/dependencies/SDL_sound/libmodplug/load_ams.c +127 -100
- data/dependencies/SDL_sound/libmodplug/load_dbm.c +40 -37
- data/dependencies/SDL_sound/libmodplug/load_dmf.c +61 -49
- data/dependencies/SDL_sound/libmodplug/load_dsm.c +18 -13
- data/dependencies/SDL_sound/libmodplug/load_far.c +31 -24
- data/dependencies/SDL_sound/libmodplug/load_gdm.c +27 -21
- data/dependencies/SDL_sound/libmodplug/load_it.c +106 -91
- data/dependencies/SDL_sound/libmodplug/load_mdl.c +43 -35
- data/dependencies/SDL_sound/libmodplug/load_med.c +66 -52
- data/dependencies/SDL_sound/libmodplug/load_mod.c +30 -26
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +61 -50
- data/dependencies/SDL_sound/libmodplug/load_mtm.c +23 -17
- data/dependencies/SDL_sound/libmodplug/load_okt.c +18 -16
- data/dependencies/SDL_sound/libmodplug/load_psm.c +44 -32
- data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -14
- data/dependencies/SDL_sound/libmodplug/load_s3m.c +59 -53
- data/dependencies/SDL_sound/libmodplug/load_stm.c +23 -18
- data/dependencies/SDL_sound/libmodplug/load_ult.c +33 -29
- data/dependencies/SDL_sound/libmodplug/load_xm.c +64 -57
- data/dependencies/SDL_sound/libmodplug/mmcmp.c +2 -1
- data/dependencies/SDL_sound/libmodplug/snd_dsp.c +30 -20
- data/dependencies/SDL_sound/libmodplug/snd_flt.c +6 -4
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +91 -65
- data/dependencies/SDL_sound/libmodplug/sndfile.c +91 -66
- data/dependencies/SDL_sound/libmodplug/sndmix.c +58 -35
- data/dependencies/SDL_sound/stb_vorbis.h +14 -9
- data/dependencies/mojoAL/mojoal.c +41 -24
- data/dependencies/utf8proc/utf8proc.c +1 -1
- data/dependencies/utf8proc/utf8proc.h +1 -1
- data/dependencies/utf8proc/utf8proc_data.h +3366 -3184
- data/lib/SDL2.dll +0 -0
- data/lib64/SDL2.dll +0 -0
- data/src/Window.cpp +3 -0
- metadata +5 -4
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
|
3
|
-
dr_mp3 - v0.6.
|
3
|
+
dr_mp3 - v0.6.34 - 2022-09-17
|
4
4
|
|
5
5
|
David Reid - mackron@gmail.com
|
6
6
|
|
@@ -95,7 +95,7 @@ extern "C" {
|
|
95
95
|
|
96
96
|
#define DRMP3_VERSION_MAJOR 0
|
97
97
|
#define DRMP3_VERSION_MINOR 6
|
98
|
-
#define DRMP3_VERSION_REVISION
|
98
|
+
#define DRMP3_VERSION_REVISION 34
|
99
99
|
#define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
|
100
100
|
|
101
101
|
#include <stddef.h> /* For size_t. */
|
@@ -235,9 +235,15 @@ typedef drmp3_int32 drmp3_result;
|
|
235
235
|
I am using "__inline__" only when we're compiling in strict ANSI mode.
|
236
236
|
*/
|
237
237
|
#if defined(__STRICT_ANSI__)
|
238
|
-
#define
|
238
|
+
#define DRMP3_GNUC_INLINE_HINT __inline__
|
239
239
|
#else
|
240
|
-
#define
|
240
|
+
#define DRMP3_GNUC_INLINE_HINT inline
|
241
|
+
#endif
|
242
|
+
|
243
|
+
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) || defined(__clang__)
|
244
|
+
#define DRMP3_INLINE DRMP3_GNUC_INLINE_HINT __attribute__((always_inline))
|
245
|
+
#else
|
246
|
+
#define DRMP3_INLINE DRMP3_GNUC_INLINE_HINT
|
241
247
|
#endif
|
242
248
|
#elif defined(__WATCOMC__)
|
243
249
|
#define DRMP3_INLINE __inline
|
@@ -340,7 +346,6 @@ typedef struct
|
|
340
346
|
typedef struct
|
341
347
|
{
|
342
348
|
drmp3dec decoder;
|
343
|
-
drmp3dec_frame_info frameInfo;
|
344
349
|
drmp3_uint32 channels;
|
345
350
|
drmp3_uint32 sampleRate;
|
346
351
|
drmp3_read_proc onRead;
|
@@ -595,7 +600,7 @@ DRMP3_API const char* drmp3_version_string(void)
|
|
595
600
|
#define DR_MP3_ONLY_SIMD
|
596
601
|
#endif
|
597
602
|
|
598
|
-
#if ((defined(_MSC_VER) && _MSC_VER >= 1400) && (defined(
|
603
|
+
#if ((defined(_MSC_VER) && _MSC_VER >= 1400) && defined(_M_X64)) || ((defined(__i386) || defined(_M_IX86) || defined(__i386__) || defined(__x86_64__)) && ((defined(_M_IX86_FP) && _M_IX86_FP == 2) || defined(__SSE2__)))
|
599
604
|
#if defined(_MSC_VER)
|
600
605
|
#include <intrin.h>
|
601
606
|
#endif
|
@@ -1296,7 +1301,7 @@ static void drmp3_L3_huffman(float *dst, drmp3_bs *bs, const drmp3_L3_gr_info *g
|
|
1296
1301
|
static const drmp3_int16 tabindex[2*16] = { 0,32,64,98,0,132,180,218,292,364,426,538,648,746,0,1126,1460,1460,1460,1460,1460,1460,1460,1460,1842,1842,1842,1842,1842,1842,1842,1842 };
|
1297
1302
|
static const drmp3_uint8 g_linbits[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,6,8,10,13,4,5,6,7,8,9,11,13 };
|
1298
1303
|
|
1299
|
-
#define DRMP3_PEEK_BITS(n) (bs_cache >> (32 - n))
|
1304
|
+
#define DRMP3_PEEK_BITS(n) (bs_cache >> (32 - (n)))
|
1300
1305
|
#define DRMP3_FLUSH_BITS(n) { bs_cache <<= (n); bs_sh += (n); }
|
1301
1306
|
#define DRMP3_CHECK_BITS while (bs_sh >= 0) { bs_cache |= (drmp3_uint32)*bs_next_ptr++ << bs_sh; bs_sh -= 8; }
|
1302
1307
|
#define DRMP3_BSPOS ((bs_next_ptr - bs->buf)*8 - 24 + bs_sh)
|
@@ -1864,7 +1869,7 @@ static void drmp3d_DCT_II(float *grbuf, int n)
|
|
1864
1869
|
#if DRMP3_HAVE_SSE
|
1865
1870
|
#define DRMP3_VSAVE2(i, v) _mm_storel_pi((__m64 *)(void*)&y[i*18], v)
|
1866
1871
|
#else
|
1867
|
-
#define DRMP3_VSAVE2(i, v) vst1_f32((float32_t *)&y[i*18], vget_low_f32(v))
|
1872
|
+
#define DRMP3_VSAVE2(i, v) vst1_f32((float32_t *)&y[(i)*18], vget_low_f32(v))
|
1868
1873
|
#endif
|
1869
1874
|
for (i = 0; i < 7; i++, y += 4*18)
|
1870
1875
|
{
|
@@ -1880,7 +1885,7 @@ static void drmp3d_DCT_II(float *grbuf, int n)
|
|
1880
1885
|
DRMP3_VSAVE2(3, t[3][7]);
|
1881
1886
|
} else
|
1882
1887
|
{
|
1883
|
-
#define DRMP3_VSAVE4(i, v) DRMP3_VSTORE(&y[i*18], v)
|
1888
|
+
#define DRMP3_VSAVE4(i, v) DRMP3_VSTORE(&y[(i)*18], v)
|
1884
1889
|
for (i = 0; i < 7; i++, y += 4*18)
|
1885
1890
|
{
|
1886
1891
|
drmp3_f4 s = DRMP3_VADD(t[3][i], t[3][i + 1]);
|
@@ -2103,7 +2108,11 @@ static void drmp3d_synth(float *xl, drmp3d_sample_t *dstl, int nch, float *lins)
|
|
2103
2108
|
vst1_lane_s16(dstl + (49 + i)*nch, pcmb, 2);
|
2104
2109
|
#endif
|
2105
2110
|
#else
|
2111
|
+
#if DRMP3_HAVE_SSE
|
2106
2112
|
static const drmp3_f4 g_scale = { 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f };
|
2113
|
+
#else
|
2114
|
+
const drmp3_f4 g_scale = vdupq_n_f32(1.0f/32768.0f);
|
2115
|
+
#endif
|
2107
2116
|
a = DRMP3_VMUL(a, g_scale);
|
2108
2117
|
b = DRMP3_VMUL(b, g_scale);
|
2109
2118
|
#if DRMP3_HAVE_SSE
|
@@ -2406,8 +2415,6 @@ DRMP3_API void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, size_t num
|
|
2406
2415
|
Main Public API
|
2407
2416
|
|
2408
2417
|
************************************************************************************************************************************************************/
|
2409
|
-
#include <math.h> /* For sin() and exp(). */
|
2410
|
-
|
2411
2418
|
#if defined(SIZE_MAX)
|
2412
2419
|
#define DRMP3_SIZE_MAX SIZE_MAX
|
2413
2420
|
#else
|
@@ -2427,7 +2434,7 @@ DRMP3_API void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, size_t num
|
|
2427
2434
|
|
2428
2435
|
/* The size in bytes of each chunk of data to read from the MP3 stream. minimp3 recommends at least 16K, but in an attempt to reduce data movement I'm making this slightly larger. */
|
2429
2436
|
#ifndef DRMP3_DATA_CHUNK_SIZE
|
2430
|
-
#define DRMP3_DATA_CHUNK_SIZE DRMP3_MIN_DATA_CHUNK_SIZE*4
|
2437
|
+
#define DRMP3_DATA_CHUNK_SIZE (DRMP3_MIN_DATA_CHUNK_SIZE*4)
|
2431
2438
|
#endif
|
2432
2439
|
|
2433
2440
|
|
@@ -2472,24 +2479,6 @@ static DRMP3_INLINE drmp3_uint32 drmp3_gcf_u32(drmp3_uint32 a, drmp3_uint32 b)
|
|
2472
2479
|
}
|
2473
2480
|
|
2474
2481
|
|
2475
|
-
static DRMP3_INLINE double drmp3_sin(double x)
|
2476
|
-
{
|
2477
|
-
/* TODO: Implement custom sin(x). */
|
2478
|
-
return sin(x);
|
2479
|
-
}
|
2480
|
-
|
2481
|
-
static DRMP3_INLINE double drmp3_exp(double x)
|
2482
|
-
{
|
2483
|
-
/* TODO: Implement custom exp(x). */
|
2484
|
-
return exp(x);
|
2485
|
-
}
|
2486
|
-
|
2487
|
-
static DRMP3_INLINE double drmp3_cos(double x)
|
2488
|
-
{
|
2489
|
-
return drmp3_sin((DRMP3_PI_D*0.5) - x);
|
2490
|
-
}
|
2491
|
-
|
2492
|
-
|
2493
2482
|
static void* drmp3__malloc_default(size_t sz, void* pUserData)
|
2494
2483
|
{
|
2495
2484
|
(void)pUserData;
|
@@ -3434,10 +3423,23 @@ static drmp3_result drmp3_wfopen(FILE** ppFile, const wchar_t* pFilePath, const
|
|
3434
3423
|
}
|
3435
3424
|
#else
|
3436
3425
|
/*
|
3437
|
-
Use fopen() on anything other than Windows. Requires a conversion. This is annoying because
|
3438
|
-
|
3439
|
-
|
3426
|
+
Use fopen() on anything other than Windows. Requires a conversion. This is annoying because
|
3427
|
+
fopen() is locale specific. The only real way I can think of to do this is with wcsrtombs(). Note
|
3428
|
+
that wcstombs() is apparently not thread-safe because it uses a static global mbstate_t object for
|
3429
|
+
maintaining state. I've checked this with -std=c89 and it works, but if somebody get's a compiler
|
3430
|
+
error I'll look into improving compatibility.
|
3440
3431
|
*/
|
3432
|
+
|
3433
|
+
/*
|
3434
|
+
Some compilers don't support wchar_t or wcsrtombs() which we're using below. In this case we just
|
3435
|
+
need to abort with an error. If you encounter a compiler lacking such support, add it to this list
|
3436
|
+
and submit a bug report and it'll be added to the library upstream.
|
3437
|
+
*/
|
3438
|
+
#if defined(__DJGPP__)
|
3439
|
+
{
|
3440
|
+
/* Nothing to do here. This will fall through to the error check below. */
|
3441
|
+
}
|
3442
|
+
#else
|
3441
3443
|
{
|
3442
3444
|
mbstate_t mbs;
|
3443
3445
|
size_t lenMB;
|
@@ -3479,6 +3481,7 @@ static drmp3_result drmp3_wfopen(FILE** ppFile, const wchar_t* pFilePath, const
|
|
3479
3481
|
|
3480
3482
|
drmp3__free_from_callbacks(pFilePathMB, pAllocationCallbacks);
|
3481
3483
|
}
|
3484
|
+
#endif
|
3482
3485
|
|
3483
3486
|
if (*ppFile == NULL) {
|
3484
3487
|
return DRMP3_ERROR;
|
@@ -4473,6 +4476,16 @@ counts rather than sample counts.
|
|
4473
4476
|
/*
|
4474
4477
|
REVISION HISTORY
|
4475
4478
|
================
|
4479
|
+
v0.6.34 - 2022-09-17
|
4480
|
+
- Fix compilation with DJGPP.
|
4481
|
+
- Fix compilation when compiling with x86 with no SSE2.
|
4482
|
+
- Remove an unnecessary variable from the drmp3 structure.
|
4483
|
+
|
4484
|
+
v0.6.33 - 2022-04-10
|
4485
|
+
- Fix compilation error with the MSVC ARM64 build.
|
4486
|
+
- Fix compilation error on older versions of GCC.
|
4487
|
+
- Remove some unused functions.
|
4488
|
+
|
4476
4489
|
v0.6.32 - 2021-12-11
|
4477
4490
|
- Fix a warning with Clang.
|
4478
4491
|
|
@@ -9,9 +9,7 @@
|
|
9
9
|
#include <math.h>
|
10
10
|
|
11
11
|
#include "SDL_stdinc.h"
|
12
|
-
#if !(defined(HAVE_LIBC) && defined(__WATCOMC__)) /* Watcom has issues... */
|
13
12
|
#define floor SDL_floor
|
14
|
-
#endif
|
15
13
|
|
16
14
|
/*
|
17
15
|
*-----------------------------------------------------------------------------
|
@@ -246,18 +244,18 @@ void init_modplug_filters(void)
|
|
246
244
|
// ----------------------------------------------------------------------------
|
247
245
|
#define SNDMIX_BEGINSAMPLELOOP8\
|
248
246
|
register MODCHANNEL * const pChn = pChannel;\
|
249
|
-
nPos = pChn->nPosLo;\
|
250
247
|
const signed char *p = (signed char *)(pChn->pCurrentSample+pChn->nPos);\
|
251
|
-
if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
|
252
248
|
int *pvol = pbuffer;\
|
249
|
+
nPos = pChn->nPosLo;\
|
250
|
+
if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
|
253
251
|
do {
|
254
252
|
|
255
253
|
#define SNDMIX_BEGINSAMPLELOOP16\
|
256
254
|
register MODCHANNEL * const pChn = pChannel;\
|
257
|
-
nPos = pChn->nPosLo;\
|
258
255
|
const signed short *p = (signed short *)(pChn->pCurrentSample+(pChn->nPos*2));\
|
259
|
-
if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
|
260
256
|
int *pvol = pbuffer;\
|
257
|
+
nPos = pChn->nPosLo;\
|
258
|
+
if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
|
261
259
|
do {
|
262
260
|
|
263
261
|
#define SNDMIX_ENDSAMPLELOOP\
|
@@ -338,15 +336,16 @@ void init_modplug_filters(void)
|
|
338
336
|
int poshi = nPos >> 16;\
|
339
337
|
int poslo = (nPos & 0xFFFF);\
|
340
338
|
int firidx = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
|
341
|
-
int vol1
|
339
|
+
int vol1, vol2, vol; \
|
340
|
+
vol1 = (CzWINDOWEDFIR_lut[firidx+0]*(int)p[poshi+1-4]); \
|
342
341
|
vol1 += (CzWINDOWEDFIR_lut[firidx+1]*(int)p[poshi+2-4]); \
|
343
342
|
vol1 += (CzWINDOWEDFIR_lut[firidx+2]*(int)p[poshi+3-4]); \
|
344
343
|
vol1 += (CzWINDOWEDFIR_lut[firidx+3]*(int)p[poshi+4-4]); \
|
345
|
-
|
344
|
+
vol2 = (CzWINDOWEDFIR_lut[firidx+4]*(int)p[poshi+5-4]); \
|
346
345
|
vol2 += (CzWINDOWEDFIR_lut[firidx+5]*(int)p[poshi+6-4]); \
|
347
346
|
vol2 += (CzWINDOWEDFIR_lut[firidx+6]*(int)p[poshi+7-4]); \
|
348
347
|
vol2 += (CzWINDOWEDFIR_lut[firidx+7]*(int)p[poshi+8-4]); \
|
349
|
-
|
348
|
+
vol = ((vol1>>1)+(vol2>>1)) >> (WFIR_16BITSHIFT-1);
|
350
349
|
|
351
350
|
/////////////////////////////////////////////////////////////////////////////
|
352
351
|
// Stereo
|
@@ -407,7 +406,8 @@ void init_modplug_filters(void)
|
|
407
406
|
int poshi = nPos >> 16;\
|
408
407
|
int poslo = (nPos & 0xFFFF);\
|
409
408
|
int firidx = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
|
410
|
-
int vol_l
|
409
|
+
int vol_l, vol_r; \
|
410
|
+
vol_l = (CzWINDOWEDFIR_lut[firidx+0]*(int)p[(poshi+1-4)*2 ]); \
|
411
411
|
vol_l += (CzWINDOWEDFIR_lut[firidx+1]*(int)p[(poshi+2-4)*2 ]); \
|
412
412
|
vol_l += (CzWINDOWEDFIR_lut[firidx+2]*(int)p[(poshi+3-4)*2 ]); \
|
413
413
|
vol_l += (CzWINDOWEDFIR_lut[firidx+3]*(int)p[(poshi+4-4)*2 ]); \
|
@@ -416,7 +416,7 @@ void init_modplug_filters(void)
|
|
416
416
|
vol_l += (CzWINDOWEDFIR_lut[firidx+6]*(int)p[(poshi+7-4)*2 ]); \
|
417
417
|
vol_l += (CzWINDOWEDFIR_lut[firidx+7]*(int)p[(poshi+8-4)*2 ]); \
|
418
418
|
vol_l >>= WFIR_8SHIFT; \
|
419
|
-
|
419
|
+
vol_r = (CzWINDOWEDFIR_lut[firidx+0]*(int)p[(poshi+1-4)*2+1]); \
|
420
420
|
vol_r += (CzWINDOWEDFIR_lut[firidx+1]*(int)p[(poshi+2-4)*2+1]); \
|
421
421
|
vol_r += (CzWINDOWEDFIR_lut[firidx+2]*(int)p[(poshi+3-4)*2+1]); \
|
422
422
|
vol_r += (CzWINDOWEDFIR_lut[firidx+3]*(int)p[(poshi+4-4)*2+1]); \
|
@@ -430,24 +430,25 @@ void init_modplug_filters(void)
|
|
430
430
|
int poshi = nPos >> 16;\
|
431
431
|
int poslo = (nPos & 0xFFFF);\
|
432
432
|
int firidx = ((poslo+WFIR_FRACHALVE)>>WFIR_FRACSHIFT) & WFIR_FRACMASK; \
|
433
|
-
int vol1_l
|
433
|
+
int vol1_l, vol2_l, vol_l, vol1_r, vol2_r, vol_r; \
|
434
|
+
vol1_l = (CzWINDOWEDFIR_lut[firidx+0]*(int)p[(poshi+1-4)*2 ]); \
|
434
435
|
vol1_l += (CzWINDOWEDFIR_lut[firidx+1]*(int)p[(poshi+2-4)*2 ]); \
|
435
436
|
vol1_l += (CzWINDOWEDFIR_lut[firidx+2]*(int)p[(poshi+3-4)*2 ]); \
|
436
437
|
vol1_l += (CzWINDOWEDFIR_lut[firidx+3]*(int)p[(poshi+4-4)*2 ]); \
|
437
|
-
|
438
|
+
vol2_l = (CzWINDOWEDFIR_lut[firidx+4]*(int)p[(poshi+5-4)*2 ]); \
|
438
439
|
vol2_l += (CzWINDOWEDFIR_lut[firidx+5]*(int)p[(poshi+6-4)*2 ]); \
|
439
440
|
vol2_l += (CzWINDOWEDFIR_lut[firidx+6]*(int)p[(poshi+7-4)*2 ]); \
|
440
441
|
vol2_l += (CzWINDOWEDFIR_lut[firidx+7]*(int)p[(poshi+8-4)*2 ]); \
|
441
|
-
|
442
|
-
|
442
|
+
vol_l = ((vol1_l>>1)+(vol2_l>>1)) >> (WFIR_16BITSHIFT-1); \
|
443
|
+
vol1_r = (CzWINDOWEDFIR_lut[firidx+0]*(int)p[(poshi+1-4)*2+1]); \
|
443
444
|
vol1_r += (CzWINDOWEDFIR_lut[firidx+1]*(int)p[(poshi+2-4)*2+1]); \
|
444
445
|
vol1_r += (CzWINDOWEDFIR_lut[firidx+2]*(int)p[(poshi+3-4)*2+1]); \
|
445
446
|
vol1_r += (CzWINDOWEDFIR_lut[firidx+3]*(int)p[(poshi+4-4)*2+1]); \
|
446
|
-
|
447
|
+
vol2_r = (CzWINDOWEDFIR_lut[firidx+4]*(int)p[(poshi+5-4)*2+1]); \
|
447
448
|
vol2_r += (CzWINDOWEDFIR_lut[firidx+5]*(int)p[(poshi+6-4)*2+1]); \
|
448
449
|
vol2_r += (CzWINDOWEDFIR_lut[firidx+6]*(int)p[(poshi+7-4)*2+1]); \
|
449
450
|
vol2_r += (CzWINDOWEDFIR_lut[firidx+7]*(int)p[(poshi+8-4)*2+1]); \
|
450
|
-
|
451
|
+
vol_r = ((vol1_r>>1)+(vol2_r>>1)) >> (WFIR_16BITSHIFT-1);
|
451
452
|
|
452
453
|
/////////////////////////////////////////////////////////////////////////////
|
453
454
|
|
@@ -462,10 +463,12 @@ void init_modplug_filters(void)
|
|
462
463
|
pvol += 2;
|
463
464
|
|
464
465
|
#define SNDMIX_STOREFASTMONOVOL\
|
466
|
+
do { \
|
465
467
|
int v = vol * pChn->nRightVol;\
|
466
468
|
pvol[0] += v;\
|
467
469
|
pvol[1] += v;\
|
468
|
-
pvol += 2;
|
470
|
+
pvol += 2; \
|
471
|
+
} while (0);
|
469
472
|
|
470
473
|
#define SNDMIX_RAMPMONOVOL\
|
471
474
|
nRampLeftVol += pChn->nLeftRamp;\
|
@@ -476,10 +479,12 @@ void init_modplug_filters(void)
|
|
476
479
|
|
477
480
|
#define SNDMIX_RAMPFASTMONOVOL\
|
478
481
|
nRampRightVol += pChn->nRightRamp;\
|
482
|
+
do { \
|
479
483
|
int fastvol = vol * (nRampRightVol >> VOLUMERAMPPRECISION);\
|
480
484
|
pvol[0] += fastvol;\
|
481
485
|
pvol[1] += fastvol;\
|
482
|
-
pvol += 2;
|
486
|
+
pvol += 2; \
|
487
|
+
} while (0);
|
483
488
|
|
484
489
|
#define SNDMIX_RAMPSTEREOVOL\
|
485
490
|
nRampLeftVol += pChn->nLeftRamp;\
|
@@ -1319,6 +1324,7 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
|
|
1319
1324
|
{
|
1320
1325
|
LONG nLoopStart = (pChn->dwFlags & CHN_LOOP) ? pChn->nLoopStart : 0;
|
1321
1326
|
LONG nInc = pChn->nInc;
|
1327
|
+
LONG nPos, nPosLo, nSmpCount;
|
1322
1328
|
|
1323
1329
|
if ((nSamples <= 0) || (!nInc) || (!pChn->nLength)) return 0;
|
1324
1330
|
// Under zero ?
|
@@ -1357,6 +1363,7 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
|
|
1357
1363
|
if (!(pChn->dwFlags & CHN_LOOP)) return 0; // not looping -> stop this channel
|
1358
1364
|
if (pChn->dwFlags & CHN_PINGPONGLOOP)
|
1359
1365
|
{
|
1366
|
+
LONG nDeltaHi, nDeltaLo;
|
1360
1367
|
// Invert loop
|
1361
1368
|
if (nInc > 0)
|
1362
1369
|
{
|
@@ -1365,8 +1372,8 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
|
|
1365
1372
|
}
|
1366
1373
|
pChn->dwFlags |= CHN_PINGPONGFLAG;
|
1367
1374
|
// adjust loop position
|
1368
|
-
|
1369
|
-
|
1375
|
+
nDeltaHi = (pChn->nPos - pChn->nLength);
|
1376
|
+
nDeltaLo = 0x10000 - (pChn->nPosLo & 0xffff);
|
1370
1377
|
pChn->nPos = pChn->nLength - nDeltaHi - (nDeltaLo>>16);
|
1371
1378
|
pChn->nPosLo = nDeltaLo & 0xffff;
|
1372
1379
|
if ((pChn->nPos <= pChn->nLoopStart) ||
|
@@ -1385,23 +1392,24 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
|
|
1385
1392
|
pChn->nPos = pChn->nLoopStart;
|
1386
1393
|
}
|
1387
1394
|
}
|
1388
|
-
|
1395
|
+
nPos = pChn->nPos;
|
1389
1396
|
// too big increment, and/or too small loop length
|
1390
1397
|
if (nPos < nLoopStart)
|
1391
1398
|
{
|
1392
1399
|
if ((nPos < 0) || (nInc < 0)) return 0;
|
1393
1400
|
}
|
1394
1401
|
if ((nPos < 0) || (nPos >= (LONG)pChn->nLength)) return 0;
|
1395
|
-
|
1402
|
+
nPosLo = (USHORT)pChn->nPosLo, nSmpCount = nSamples;
|
1396
1403
|
if (nInc < 0)
|
1397
1404
|
{
|
1398
1405
|
LONG nInv = -nInc;
|
1399
1406
|
LONG maxsamples = 16384 / ((nInv>>16)+1);
|
1407
|
+
LONG nDeltaHi, nDeltaLo, nPosDest;
|
1400
1408
|
if (maxsamples < 2) maxsamples = 2;
|
1401
1409
|
if (nSamples > maxsamples) nSamples = maxsamples;
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1410
|
+
nDeltaHi = (nInv>>16) * (nSamples - 1);
|
1411
|
+
nDeltaLo = (nInv&0xffff) * (nSamples - 1);
|
1412
|
+
nPosDest = nPos - nDeltaHi + ((nPosLo - nDeltaLo) >> 16);
|
1405
1413
|
if (nPosDest < nLoopStart)
|
1406
1414
|
{
|
1407
1415
|
nSmpCount = (ULONG)(((((LONGLONG)nPos - nLoopStart) << 16) + nPosLo - 1) / nInv) + 1;
|
@@ -1409,11 +1417,12 @@ static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
|
|
1409
1417
|
} else
|
1410
1418
|
{
|
1411
1419
|
LONG maxsamples = 16384 / ((nInc>>16)+1);
|
1420
|
+
LONG nDeltaHi, nDeltaLo, nPosDest;
|
1412
1421
|
if (maxsamples < 2) maxsamples = 2;
|
1413
1422
|
if (nSamples > maxsamples) nSamples = maxsamples;
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1423
|
+
nDeltaHi = (nInc>>16) * (nSamples - 1);
|
1424
|
+
nDeltaLo = (nInc&0xffff) * (nSamples - 1);
|
1425
|
+
nPosDest = nPos + nDeltaHi + ((nPosLo + nDeltaLo)>>16);
|
1417
1426
|
if (nPosDest >= (LONG)pChn->nLength)
|
1418
1427
|
{
|
1419
1428
|
nSmpCount = (ULONG)(((((LONGLONG)pChn->nLength - nPos) << 16) - nPosLo - 1) / nInc) + 1;
|
@@ -1430,12 +1439,12 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
|
|
1430
1439
|
{
|
1431
1440
|
LPLONG pOfsL, pOfsR;
|
1432
1441
|
DWORD nchused, nchmixed;
|
1433
|
-
UINT nrampsamples;
|
1442
|
+
UINT nrampsamples, nChn;
|
1434
1443
|
|
1435
1444
|
if (!count) return 0;
|
1436
1445
|
if (_this->gnChannels > 2) X86_InitMixBuffer(_this->MixRearBuffer, count*2);
|
1437
1446
|
nchused = nchmixed = 0;
|
1438
|
-
for (
|
1447
|
+
for (nChn=0; nChn<_this->m_nMixChannels; nChn++)
|
1439
1448
|
{
|
1440
1449
|
const LPMIXINTERFACE *pMixFuncTable;
|
1441
1450
|
MODCHANNEL * const pChannel = &_this->Chn[_this->ChnMix[nChn]];
|
@@ -1443,6 +1452,7 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
|
|
1443
1452
|
LONG nSmpCount;
|
1444
1453
|
int nsamples;
|
1445
1454
|
int *pbuffer;
|
1455
|
+
UINT naddmix;
|
1446
1456
|
|
1447
1457
|
if (!pChannel->pCurrentSample) continue;
|
1448
1458
|
//nMasterCh = (_this->ChnMix[nChn] < _this->m_nChannels) ? _this->ChnMix[nChn]+1 : pChannel->nMasterChn;
|
@@ -1510,7 +1520,6 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
|
|
1510
1520
|
continue;
|
1511
1521
|
}
|
1512
1522
|
// Should we mix this channel ?
|
1513
|
-
UINT naddmix;
|
1514
1523
|
if (((nchmixed >= _this->m_nMaxMixChannels) && (!(_this->gdwSoundSetup & SNDMIX_DIRECTTODISK)))
|
1515
1524
|
|| ((!pChannel->nRampLength) && (!(pChannel->nLeftVol|pChannel->nRightVol))))
|
1516
1525
|
{
|
@@ -1525,8 +1534,9 @@ UINT CSoundFile_CreateStereoMix(CSoundFile *_this, int count)
|
|
1525
1534
|
{
|
1526
1535
|
// Choose function for mixing
|
1527
1536
|
LPMIXINTERFACE pMixFunc;
|
1537
|
+
int *pbufmax;
|
1528
1538
|
pMixFunc = (pChannel->nRampLength) ? pMixFuncTable[nFlags|MIXNDX_RAMP] : pMixFuncTable[nFlags];
|
1529
|
-
|
1539
|
+
pbufmax = pbuffer + (nSmpCount*2);
|
1530
1540
|
pChannel->nROfs = - *(pbufmax-2);
|
1531
1541
|
pChannel->nLOfs = - *(pbufmax-1);
|
1532
1542
|
pMixFunc(pChannel, pbuffer, pbufmax);
|
@@ -1567,7 +1577,8 @@ DWORD MPPASMCALL X86_Convert32To8(LPVOID lp8, int *pBuffer, DWORD lSampleCount,
|
|
1567
1577
|
{
|
1568
1578
|
int vumin = *lpMin, vumax = *lpMax;
|
1569
1579
|
unsigned char *p = (unsigned char *)lp8;
|
1570
|
-
|
1580
|
+
UINT i;
|
1581
|
+
for (i=0; i<lSampleCount; i++)
|
1571
1582
|
{
|
1572
1583
|
int n = pBuffer[i];
|
1573
1584
|
if (n < MIXING_CLIPMIN)
|
@@ -1593,7 +1604,8 @@ DWORD MPPASMCALL X86_Convert32To16(LPVOID lp16, int *pBuffer, DWORD lSampleCount
|
|
1593
1604
|
{
|
1594
1605
|
int vumin = *lpMin, vumax = *lpMax;
|
1595
1606
|
signed short *p = (signed short *)lp16;
|
1596
|
-
|
1607
|
+
UINT i;
|
1608
|
+
for (i=0; i<lSampleCount; i++)
|
1597
1609
|
{
|
1598
1610
|
int n = pBuffer[i];
|
1599
1611
|
if (n < MIXING_CLIPMIN)
|
@@ -1689,8 +1701,8 @@ void MPPASMCALL X86_InterleaveFrontRear(int *pFrontBuf, int *pRearBuf, DWORD nSa
|
|
1689
1701
|
//---GCCFIX: Asm replaced with C function
|
1690
1702
|
VOID MPPASMCALL X86_MonoFromStereo(int *pMixBuf, UINT nSamples)
|
1691
1703
|
{
|
1692
|
-
UINT j;
|
1693
|
-
for(
|
1704
|
+
UINT i, j;
|
1705
|
+
for(i = 0; i < nSamples; i++)
|
1694
1706
|
{
|
1695
1707
|
j = i << 1;
|
1696
1708
|
pMixBuf[i] = (pMixBuf[j] + pMixBuf[j + 1]) >> 1;
|
@@ -1705,13 +1717,14 @@ void MPPASMCALL X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLON
|
|
1705
1717
|
{
|
1706
1718
|
int rofs = *lpROfs;
|
1707
1719
|
int lofs = *lpLOfs;
|
1720
|
+
UINT i;
|
1708
1721
|
|
1709
1722
|
if ((!rofs) && (!lofs))
|
1710
1723
|
{
|
1711
1724
|
X86_InitMixBuffer(pBuffer, nSamples*2);
|
1712
1725
|
return;
|
1713
1726
|
}
|
1714
|
-
for (
|
1727
|
+
for (i=0; i<nSamples; i++)
|
1715
1728
|
{
|
1716
1729
|
int x_r = (rofs + (((-rofs)>>31) & OFSDECAYMASK)) >> OFSDECAYSHIFT;
|
1717
1730
|
int x_l = (lofs + (((-lofs)>>31) & OFSDECAYMASK)) >> OFSDECAYSHIFT;
|
@@ -1730,9 +1743,10 @@ static void MPPASMCALL X86_EndChannelOfs(MODCHANNEL *pChannel, int *pBuffer, UIN
|
|
1730
1743
|
{
|
1731
1744
|
int rofs = pChannel->nROfs;
|
1732
1745
|
int lofs = pChannel->nLOfs;
|
1746
|
+
UINT i;
|
1733
1747
|
|
1734
1748
|
if ((!rofs) && (!lofs)) return;
|
1735
|
-
for (
|
1749
|
+
for (i=0; i<nSamples; i++)
|
1736
1750
|
{
|
1737
1751
|
int x_r = (rofs + (((-rofs)>>31) & OFSDECAYMASK)) >> OFSDECAYSHIFT;
|
1738
1752
|
int x_l = (lofs + (((-lofs)>>31) & OFSDECAYMASK)) >> OFSDECAYSHIFT;
|
@@ -12,16 +12,6 @@
|
|
12
12
|
#define __SDL_SOUND_INTERNAL__
|
13
13
|
#include "SDL_sound_internal.h"
|
14
14
|
|
15
|
-
#if defined(HAVE_LIBC) && defined(__WATCOMC__) /* Watcom has issues... */
|
16
|
-
#define SDL_cos cos
|
17
|
-
#define SDL_fabs fabs
|
18
|
-
#define SDL_log log
|
19
|
-
#define SDL_pow pow
|
20
|
-
#define SDL_sin sin
|
21
|
-
#define SDL_sinf sin
|
22
|
-
#define SDL_abs abs
|
23
|
-
#endif
|
24
|
-
|
25
15
|
#ifdef _WIN32
|
26
16
|
|
27
17
|
#ifdef _MSC_VER
|
@@ -58,8 +48,6 @@ typedef const char* LPCSTR;
|
|
58
48
|
typedef void* PVOID;
|
59
49
|
typedef void VOID;
|
60
50
|
|
61
|
-
#define LPCTSTR LPCSTR
|
62
|
-
|
63
51
|
#ifndef FALSE
|
64
52
|
#define FALSE 0
|
65
53
|
#endif
|
@@ -50,17 +50,19 @@ BOOL CSoundFile_Read669(CSoundFile *_this, const BYTE *lpStream, DWORD dwMemLeng
|
|
50
50
|
const FILEHEADER669 *pfh = (const FILEHEADER669 *)lpStream;
|
51
51
|
const SAMPLE669 *psmp = (const SAMPLE669 *)(lpStream + 0x1F1);
|
52
52
|
DWORD dwMemPos = 0;
|
53
|
+
DWORD donttouchme;
|
54
|
+
UINT i;
|
53
55
|
|
54
56
|
if ((!lpStream) || (dwMemLength < sizeof(FILEHEADER669))) return FALSE;
|
55
57
|
if ((bswapLE16(pfh->sig) != 0x6669) && (bswapLE16(pfh->sig) != 0x4E4A)) return FALSE;
|
56
58
|
// b669Ext = (bswapLE16(pfh->sig) == 0x4E4A) ? TRUE : FALSE;
|
57
59
|
if ((!pfh->samples) || (pfh->samples > 64) || (pfh->restartpos >= 128)
|
58
60
|
|| (!pfh->patterns) || (pfh->patterns > 128)) return FALSE;
|
59
|
-
|
61
|
+
donttouchme = 0x1F1 + pfh->samples * sizeof(SAMPLE669) + pfh->patterns * 0x600;
|
60
62
|
if (donttouchme > dwMemLength) return FALSE;
|
61
|
-
for (
|
63
|
+
for (i=0; i<pfh->samples; i++)
|
62
64
|
{
|
63
|
-
DWORD len = lengthArrayToDWORD(psmp[
|
65
|
+
DWORD len = lengthArrayToDWORD(psmp[i].length);
|
64
66
|
donttouchme += len;
|
65
67
|
}
|
66
68
|
if (donttouchme > dwMemLength) return FALSE;
|
@@ -73,7 +75,7 @@ BOOL CSoundFile_Read669(CSoundFile *_this, const BYTE *lpStream, DWORD dwMemLeng
|
|
73
75
|
_this->m_nDefaultSpeed = 6;
|
74
76
|
_this->m_nChannels = 8;
|
75
77
|
_this->m_nSamples = pfh->samples;
|
76
|
-
for (
|
78
|
+
for (i=1; i<=_this->m_nSamples; i++, psmp++)
|
77
79
|
{
|
78
80
|
DWORD len = lengthArrayToDWORD(psmp->length);
|
79
81
|
DWORD loopstart = lengthArrayToDWORD(psmp->loopstart);
|
@@ -82,45 +84,48 @@ BOOL CSoundFile_Read669(CSoundFile *_this, const BYTE *lpStream, DWORD dwMemLeng
|
|
82
84
|
if ((loopend > len) && (!loopstart)) loopend = 0;
|
83
85
|
if (loopend > len) loopend = len;
|
84
86
|
if (loopstart + 4 >= loopend) loopstart = loopend = 0;
|
85
|
-
_this->Ins[
|
86
|
-
_this->Ins[
|
87
|
-
_this->Ins[
|
88
|
-
if (loopend) _this->Ins[
|
89
|
-
_this->Ins[
|
90
|
-
_this->Ins[
|
91
|
-
_this->Ins[
|
87
|
+
_this->Ins[i].nLength = len;
|
88
|
+
_this->Ins[i].nLoopStart = loopstart;
|
89
|
+
_this->Ins[i].nLoopEnd = loopend;
|
90
|
+
if (loopend) _this->Ins[i].uFlags |= CHN_LOOP;
|
91
|
+
_this->Ins[i].nVolume = 256;
|
92
|
+
_this->Ins[i].nGlobalVol = 64;
|
93
|
+
_this->Ins[i].nPan = 128;
|
92
94
|
}
|
93
95
|
// Reading Orders
|
94
96
|
SDL_memcpy(_this->Order, pfh->orders, 128);
|
95
97
|
_this->m_nRestartPos = pfh->restartpos;
|
96
98
|
if (_this->Order[_this->m_nRestartPos] >= pfh->patterns) _this->m_nRestartPos = 0;
|
97
99
|
// Reading Pattern Break Locations
|
98
|
-
for (
|
100
|
+
for (i=0; i<8; i++)
|
99
101
|
{
|
100
|
-
_this->ChnSettings[
|
101
|
-
_this->ChnSettings[
|
102
|
+
_this->ChnSettings[i].nPan = (i & 1) ? 0x30 : 0xD0;
|
103
|
+
_this->ChnSettings[i].nVolume = 64;
|
102
104
|
}
|
103
105
|
// Reading Patterns
|
104
106
|
dwMemPos = 0x1F1 + pfh->samples * 25;
|
105
|
-
for (
|
107
|
+
for (i=0; i<pfh->patterns; i++)
|
106
108
|
{
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
109
|
+
MODCOMMAND *m;
|
110
|
+
const BYTE *p;
|
111
|
+
UINT row, j;
|
112
|
+
_this->Patterns[i] = CSoundFile_AllocatePattern(64, _this->m_nChannels);
|
113
|
+
if (!_this->Patterns[i]) break;
|
114
|
+
_this->PatternSize[i] = 64;
|
115
|
+
m = _this->Patterns[i];
|
116
|
+
p = lpStream + dwMemPos;
|
117
|
+
for (row=0; row<64; row++)
|
113
118
|
{
|
114
119
|
MODCOMMAND *mspeed = m;
|
115
|
-
if ((row == pfh->breaks[
|
120
|
+
if ((row == pfh->breaks[i]) && (row != 63))
|
116
121
|
{
|
117
|
-
for (
|
122
|
+
for (j=0; j<8; j++)
|
118
123
|
{
|
119
|
-
m[
|
120
|
-
m[
|
124
|
+
m[j].command = CMD_PATTERNBREAK;
|
125
|
+
m[j].param = 0;
|
121
126
|
}
|
122
127
|
}
|
123
|
-
for (
|
128
|
+
for (j=0; j<8; j++, m++, p+=3)
|
124
129
|
{
|
125
130
|
UINT note = p[0] >> 2;
|
126
131
|
UINT instr = ((p[0] & 0x03) << 4) | (p[1] >> 4);
|
@@ -163,10 +168,10 @@ BOOL CSoundFile_Read669(CSoundFile *_this, const BYTE *lpStream, DWORD dwMemLeng
|
|
163
168
|
}
|
164
169
|
if ((!row) && (mspeed))
|
165
170
|
{
|
166
|
-
for (
|
171
|
+
for (j=0; j<8; j++) if (!mspeed[j].command)
|
167
172
|
{
|
168
|
-
mspeed[
|
169
|
-
mspeed[
|
173
|
+
mspeed[j].command = CMD_SPEED;
|
174
|
+
mspeed[j].param = pfh->tempolist[j];
|
170
175
|
break;
|
171
176
|
}
|
172
177
|
}
|
@@ -174,11 +179,11 @@ BOOL CSoundFile_Read669(CSoundFile *_this, const BYTE *lpStream, DWORD dwMemLeng
|
|
174
179
|
dwMemPos += 0x600;
|
175
180
|
}
|
176
181
|
// Reading Samples
|
177
|
-
for (
|
182
|
+
for (i=1; i<=_this->m_nSamples; i++)
|
178
183
|
{
|
179
|
-
UINT len = _this->Ins[
|
184
|
+
UINT len = _this->Ins[i].nLength;
|
180
185
|
if (dwMemPos >= dwMemLength) break;
|
181
|
-
if (len > 4) CSoundFile_ReadSample(_this, &_this->Ins[
|
186
|
+
if (len > 4) CSoundFile_ReadSample(_this, &_this->Ins[i], RS_PCM8U, (LPSTR)(lpStream+dwMemPos), dwMemLength - dwMemPos);
|
182
187
|
dwMemPos += len;
|
183
188
|
}
|
184
189
|
return TRUE;
|