fix 4 bit pcm

This commit is contained in:
Eknous-P 2025-06-04 14:37:01 +04:00
parent bcf4f5f508
commit 000c85b4cb
4 changed files with 38 additions and 11 deletions

View file

@ -7010,6 +7010,7 @@ bool FurnaceGUI::loop() {
ImGui::SameLine();
ImGui::SetNextItemWidth(120.0f*dpiScale);
if (ImGui::InputInt("##RSChans",&pendingRawSampleChannels,1,2)) {
CLAMP_VAR(pendingRawSampleChannels, 1, 16)
}
ImGui::Text(_("(will be mixed down to mono)"));
ImGui::Checkbox(_("Unsigned"),&pendingRawSampleUnsigned);
@ -7023,7 +7024,8 @@ bool FurnaceGUI::loop() {
pendingRawSampleDepth==DIV_SAMPLE_DEPTH_QSOUND_ADPCM ||
pendingRawSampleDepth==DIV_SAMPLE_DEPTH_ADPCM_A ||
pendingRawSampleDepth==DIV_SAMPLE_DEPTH_ADPCM_B ||
pendingRawSampleDepth==DIV_SAMPLE_DEPTH_VOX) {
pendingRawSampleDepth==DIV_SAMPLE_DEPTH_VOX ||
pendingRawSampleDepth==DIV_SAMPLE_DEPTH_4BIT) {
ImGui::Checkbox(_("Swap nibbles"),&pendingRawSampleSwapNibbles);
}

View file

@ -1917,7 +1917,18 @@ void FurnaceGUI::drawSampleEdit() {
posX=samplePos+pos.x*sampleZoom;
if (posX>(int)sample->samples) posX=-1;
}
posY=(0.5-pos.y/rectSize.y)*((sample->depth==DIV_SAMPLE_DEPTH_8BIT)?255:65535);
switch (sample->depth) {
case DIV_SAMPLE_DEPTH_8BIT:
posY=(0.5-pos.y/rectSize.y)*255;
break;
case DIV_SAMPLE_DEPTH_4BIT:
posY=(1-pos.y/rectSize.y)*15;
break;
default:
posY=(0.5-pos.y/rectSize.y)*65535;
break;
}
if (posX>=0) {
statusBar2=fmt::sprintf("(%d, %d)",posX,posY);
}