diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index fda60cba5..ff8a4f9d8 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -3067,8 +3067,20 @@ DivSample* DivEngine::sampleFromFile(const char* path) { if (extS==".brr") { dataBuf=sample->dataBRR; if ((len%9)==2) { - // ignore loop position - fseek(f,2,SEEK_SET); + // read loop position + unsigned short loopPos=0; + logD("BRR file has loop position"); + if (fread(&loopPos,1,2,f)!=2) { + logW("could not read loop position! %s",strerror(errno)); + } else { +#ifdef TA_BIG_ENDIAN + loopPos=(loopPos>>8)|(loopPos<<8); +#endif + sample->loopStart=16*(loopPos/9); + sample->loopEnd=sample->samples; + sample->loop=true; + sample->loopMode=DIV_SAMPLE_LOOP_FORWARD; + } len-=2; if (len==0) { fclose(f); diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index c0664e987..f4d4d9dfa 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -369,6 +369,7 @@ void FurnaceGUI::drawPiano() { pianoOptions=!pianoOptions; } + // TODO: wave and sample preview // first check released keys for (int i=0; i<180; i++) { int note=i-60;