|
From: <sag...@us...> - 2013-01-19 16:40:21
|
Revision: 1502
http://sourceforge.net/p/modplug/code/1502
Author: saga-games
Date: 2013-01-19 16:40:12 +0000 (Sat, 19 Jan 2013)
Log Message:
-----------
[Fix] Rearranging instruments didn't delete old samples properly, so they could be made visible again after adding a new sample.
[Ref] Removed some more old asm stuff.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Mmx_mix.cpp
trunk/OpenMPT/soundlib/ModChannel.h
trunk/OpenMPT/soundlib/SampleFormats.cpp
Modified: trunk/OpenMPT/soundlib/Mmx_mix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Mmx_mix.cpp 2013-01-19 15:14:38 UTC (rev 1501)
+++ trunk/OpenMPT/soundlib/Mmx_mix.cpp 2013-01-19 16:40:12 UTC (rev 1502)
@@ -35,60 +35,6 @@
#define PROCSUPPORT_3DNOW 0x08
#define PROCSUPPORT_SSE 0x10
-// Byte offsets into the ModChannel structure
-#define CHNOFS_PCURRENTSAMPLE ModChannel.pCurrentSample // 0
-#define CHNOFS_NPOS ModChannel.nPos // 4
-#define CHNOFS_NPOSLO ModChannel.nPosLo // 8
-#define CHNOFS_NINC ModChannel.nInc // 12
-#define CHNOFS_NRIGHTVOL ModChannel.nRightVol // 16
-#define CHNOFS_NLEFTVOL ModChannel.nLeftVol // 20
-#define CHNOFS_NRIGHTRAMP ModChannel.nRightRamp // 24
-#define CHNOFS_NLEFTRAMP ModChannel.nLeftRamp // 28
-
-
-#ifdef ENABLE_MMX
-
-#define MMX_PARAM1 20[esp]
-#define MMX_PARAM2 24[esp]
-#define MMX_PARAM3 28[esp]
-#define MMX_PARAM4 32[esp]
-#define MMX_PARAM5 36[esp]
-
-#define MMX_PCHANNEL MMX_PARAM1
-#define MMX_PBUFFER MMX_PARAM2
-#define MMX_PBUFMAX MMX_PARAM3
-
-#define MMX_ENTER \
- __asm push ebx \
- __asm push esi \
- __asm push edi \
- __asm push ebp
-
-
-#define MMX_LEAVE \
- __asm pop ebp \
- __asm pop edi \
- __asm pop esi \
- __asm pop ebx \
- __asm ret
-
-
-#endif
-
-#pragma warning (disable:4100)
-#pragma warning (disable:4799) // function has no EMMS instruction
-
-
-// -> CODE#0024 UPDATE#04
-// -> DESC="wav export update"
-//const float _f2ic = (float)(1 << 28);
-//const float _i2fc = (float)(1.0 / (1 << 28));
-//const float _f2ic = (float)0x7fffffff;
-//const float _i2fc = (float)(1.0 / 0x7fffffff);
-//const float _f2ic = (float)MIXING_CLIPMAX;
-//const float _i2fc = (float)(1.0/MIXING_CLIPMAX);
-// -! NEW_FEATURE#0024
-
static unsigned int QueryProcessorExtensions()
{
static unsigned int fProcessorExtensions = 0;
Modified: trunk/OpenMPT/soundlib/ModChannel.h
===================================================================
--- trunk/OpenMPT/soundlib/ModChannel.h 2013-01-19 15:14:38 UTC (rev 1501)
+++ trunk/OpenMPT/soundlib/ModChannel.h 2013-01-19 16:40:12 UTC (rev 1502)
@@ -30,9 +30,6 @@
// Mix Channel Struct
typedef struct __declspec(align(32)) ModChannel_
{
- // First 32-bytes: Most used mixing information: don't change it
- // These fields are accessed directly by the MMX mixing code (look out for CHNOFS_PCURRENTSAMPLE).
- // In the meantime, MMX mixing has been removed because it interfered with the new resonant filter code, and the byte offsets are also no longer hardcoded...
LPSTR pCurrentSample; // Currently playing sample (nullptr if no sample is playing)
uint32 nPos;
uint32 nPosLo; // actually 16-bit (fractional part)
@@ -41,7 +38,7 @@
int32 nLeftVol;
int32 nRightRamp;
int32 nLeftRamp;
- // 2nd cache line
+
SmpLength nLength;
SmpLength nLoopStart;
SmpLength nLoopEnd;
Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp
===================================================================
--- trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-01-19 15:14:38 UTC (rev 1501)
+++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-01-19 16:40:12 UTC (rev 1502)
@@ -119,8 +119,7 @@
bool CSoundFile::DestroyInstrument(INSTRUMENTINDEX nInstr, deleteInstrumentSamples removeSamples)
//-----------------------------------------------------------------------------------------------
{
- if ((!nInstr) || (nInstr > m_nInstruments)) return false;
- if (!Instruments[nInstr]) return true;
+ if(nInstr == 0 || nInstr >= MAX_INSTRUMENTS || !Instruments[nInstr]) return true;
#ifdef MODPLUG_TRACKER
if(removeSamples == askDeleteAssociatedSamples)
@@ -475,7 +474,7 @@
fwrite(&padding, 1, 1, f);
}
fwrite(&smpl, 1, smpl.wsiHdr.smpl_len + 8, f);
-
+
// "LIST" field
list.list_id = LittleEndian(IFFID_LIST);
list.list_len = LittleEndian(sizeof(list) - 8 // LIST
@@ -685,7 +684,7 @@
sample.nVibDepth = psh->vibrato_depth;
sample.nVibRate = psh->vibrato_rate/4;
sample.FrequencyToTranspose();
- sample.RelativeTone += static_cast<uint8>(84 - PatchFreqToNote(psh->root_freq));
+ sample.RelativeTone += static_cast<int8>(84 - PatchFreqToNote(psh->root_freq));
if(psh->scale_factor)
{
sample.RelativeTone = static_cast<uint8>(sample.RelativeTone - (psh->scale_frequency - 60));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|