commit e21e2079a5d6383d316543a780c6b9732ddfbbd4
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Thu Mar 10 18:20:49 2022 -0700
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Thu Mar 10 18:20:49 2022 -0700
Revert "Honor length limit for sfx"
This reverts commit 449db7454e30e614fe7bfac89867b8e0f387a97b.
---
source/Audio.cpp | 10 ++--------
source/PicoRam.h | 1 -
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/source/Audio.cpp b/source/Audio.cpp
index 84ea520..3d943fe 100644
--- a/source/Audio.cpp
+++ b/source/Audio.cpp
@@ -105,12 +105,6 @@ void Audio::api_sfx(int sfx, int channel, int offset){
_audioState._sfxChannels[channel].phi = 0.f;
_audioState._sfxChannels[channel].can_loop = true;
_audioState._sfxChannels[channel].is_music = false;
- _audioState._sfxChannels[channel].length = 32;
-
- auto &sfxObj = _memory->sfx[sfx];
- if(sfxObj.loopRangeStart != 0 && sfxObj.loopRangeEnd == 0){
- _audioState._sfxChannels[channel].length = std::min(_audioState._sfxChannels[channel].length , sfxObj.loopRangeStart);
- }
// Playing an instrument starting with the note C-2 and the
// slide effect causes no noticeable pitch variation in PICO-8,
// so I assume this is the default value for “previous key”.
@@ -366,7 +360,7 @@ int16_t Audio::getSampleForChannel(int channel){
//volume all the way off. return silence, but make sure to set stuff
_audioState._sfxChannels[channel].offset = next_offset;
- if (next_offset >= _audioState._sfxChannels[channel].length) {
+ if (next_offset >= 32.f){
_audioState._sfxChannels[channel].sfxId = -1;
}
else if (next_note_idx != note_idx){
@@ -449,7 +443,7 @@ int16_t Audio::getSampleForChannel(int channel){
_audioState._sfxChannels[channel].offset = next_offset;
- if (next_offset >= _audioState._sfxChannels[channel].length){
+ if (next_offset >= 32.f){
_audioState._sfxChannels[channel].sfxId = -1;
}
else if (next_note_idx != note_idx){
diff --git a/source/PicoRam.h b/source/PicoRam.h
index 0291edc..a5d2eb3 100644
--- a/source/PicoRam.h
+++ b/source/PicoRam.h
@@ -138,7 +138,6 @@ struct sfxChannel {
bool is_music = false;
int8_t prev_key = 0;
float prev_vol = 0;
- uint8_t length = 0;
};
struct audioState {