add option to swap bytes in raw smp import
This commit is contained in:
parent
8231e3beba
commit
a3d8c81e9d
|
@ -464,6 +464,13 @@ DivSample* DivEngine::sampleFromFileRaw(const char* path, DivSampleDepth depth,
|
|||
accum/=channels;
|
||||
sample->data8[i]=accum;
|
||||
}
|
||||
if (bigEndian) {
|
||||
for (unsigned int i=0; (i+1)<samples; i+=2) {
|
||||
sample->data8[i]^=sample->data8[i^1];
|
||||
sample->data8[i^1]^=sample->data8[i];
|
||||
sample->data8[i]^=sample->data8[i^1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
memcpy(sample->getCurBuf(),buf,len);
|
||||
}
|
||||
|
|
|
@ -5874,8 +5874,6 @@ bool FurnaceGUI::loop() {
|
|||
|
||||
if (pendingRawSampleDepth!=DIV_SAMPLE_DEPTH_8BIT && pendingRawSampleDepth!=DIV_SAMPLE_DEPTH_16BIT) {
|
||||
pendingRawSampleChannels=1;
|
||||
}
|
||||
if (pendingRawSampleDepth!=DIV_SAMPLE_DEPTH_16BIT) {
|
||||
pendingRawSampleBigEndian=false;
|
||||
}
|
||||
|
||||
|
@ -5902,6 +5900,10 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::Checkbox("Swap nibbles",&pendingRawSampleSwapNibbles);
|
||||
}
|
||||
|
||||
if (pendingRawSampleDepth==DIV_SAMPLE_DEPTH_8BIT) {
|
||||
ImGui::Checkbox("Swap words",&pendingRawSampleBigEndian);
|
||||
}
|
||||
|
||||
if (pendingRawSampleDepth==DIV_SAMPLE_DEPTH_MULAW) {
|
||||
ImGui::Text("Encoding:");
|
||||
ImGui::Indent();
|
||||
|
|
Loading…
Reference in a new issue