From: <sv...@op...> - 2024-09-19 16:51:54
|
Author: sagamusix Date: Thu Sep 19 18:51:42 2024 New Revision: 21642 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21642 Log: [Imp] MOD: Add simple workaround for Groo's "The Ultimate Beeper". It's not 100% accurate (EFx shouldn't do anything without the instrument number next to it, but with our approach it does) but good enough for making this module work and hopefully not break any other. Modified: trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/ModChannel.cpp Modified: trunk/OpenMPT/soundlib/Load_mod.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp Thu Sep 19 17:34:44 2024 (r21641) +++ trunk/OpenMPT/soundlib/Load_mod.cpp Thu Sep 19 18:51:42 2024 (r21642) @@ -829,6 +829,18 @@ } } + // For "the ultimate beeper.mod" + { + ModSample &sample = Samples[0]; + sample.Initialize(MOD_TYPE_MOD); + sample.nLength = 2; + sample.nLoopStart = 0; + sample.nLoopEnd = 2; + sample.nVolume = 0; + sample.uFlags.set(CHN_LOOP); + sample.AllocateSample(); + } + // Fix VBlank MODs. Arbitrary threshold: 8 minutes (enough for "frame of mind" by Dascon...). // Basically, this just converts all tempo commands into speed commands // for MODs which are supposed to have VBlank timing (instead of CIA timing). Modified: trunk/OpenMPT/soundlib/ModChannel.cpp ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.cpp Thu Sep 19 17:34:44 2024 (r21641) +++ trunk/OpenMPT/soundlib/ModChannel.cpp Thu Sep 19 18:51:42 2024 (r21642) @@ -18,6 +18,8 @@ void ModChannel::Reset(ResetFlags resetMask, const CSoundFile &sndFile, CHANNELINDEX sourceChannel, ChannelFlags muteFlag) { + // For "the ultimate beeper.mod" + const ModSample *defaultSample = (sndFile.GetType() == MOD_TYPE_MOD && sndFile.GetSample(0).HasSampleData()) ? &sndFile.GetSample(0) : nullptr; if(resetMask & resetSetPosBasic) { // IT compatibility: Initial "last note memory" of channel is C-0 (so a lonely instrument number without note will play that note). @@ -25,7 +27,7 @@ nNote = nNewNote = (sndFile.m_playBehaviour[kITInitialNoteMemory] ? NOTE_MIN : NOTE_NONE); nArpeggioLastNote = lastMidiNoteWithoutArp = NOTE_NONE; nNewIns = nOldIns = 0; - pModSample = nullptr; + pModSample = defaultSample; pModInstrument = nullptr; nPortamentoDest = 0; nCommand = CMD_NONE; @@ -35,6 +37,7 @@ dwFlags.set(CHN_KEYOFF | CHN_NOTEFADE); dwOldFlags.reset(); autoSlide.Reset(); + nInsVol = 64; nnaGeneration = 0; //IT compatibility 15. Retrigger if(sndFile.m_playBehaviour[kITRetrigger]) @@ -65,7 +68,7 @@ nLoopStart = 0; nLoopEnd = 0; nROfs = nLOfs = 0; - pModSample = nullptr; + pModSample = defaultSample; pModInstrument = nullptr; nCutOff = 0x7F; nResonance = 0; |