Merge branch 'tildearrow:master' into SID3

This commit is contained in:
LTVA1 2024-08-17 08:19:36 +03:00 committed by GitHub
commit e35bcb3549
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 14 deletions

View file

@ -256,6 +256,8 @@ size | description
| - 0xe0: QSound - 19 channels
| - 0xe1: PS1 - 24 channels (UNAVAILABLE)
| - 0xe2: C64 (6581) with PCM - 4 channels (UNAVAILABLE)
| - 0xe3: Watara Supervision - 4 channels (UNAVAILABLE)
| - 0xe4: µPD1771C - 1 channel (UNAVAILABLE)
| - 0xf0: SID2 - 3 channels
| - 0xf1: 5E01 - 5 channels
| - 0xfc: Pong - 1 channel

View file

@ -1668,26 +1668,34 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
chan[i].panPos+=chan[i].panRate;
chan[i].panPos&=255;
// calculate...
// calculate inverted...
switch (chan[i].panPos&0xc0) {
case 0: // center -> right
chan[i].panL=0xff-((chan[i].panPos&0x3f)<<2);
chan[i].panR=0xff;
chan[i].panL=((chan[i].panPos&0x3f)<<2);
chan[i].panR=0;
break;
case 0x40: // right -> center
chan[i].panL=(chan[i].panPos&0x3f)<<2;
chan[i].panR=0xff;
chan[i].panL=0xff-((chan[i].panPos&0x3f)<<2);
chan[i].panR=0;
break;
case 0x80: // center -> left
chan[i].panL=0xff;
chan[i].panR=0xff-((chan[i].panPos&0x3f)<<2);
chan[i].panL=0;
chan[i].panR=((chan[i].panPos&0x3f)<<2);
break;
case 0xc0: // left -> center
chan[i].panL=0xff;
chan[i].panR=(chan[i].panPos&0x3f)<<2;
chan[i].panL=0;
chan[i].panR=0xff-((chan[i].panPos&0x3f)<<2);
break;
}
// multiply by depth
chan[i].panL=(chan[i].panL*chan[i].panDepth)/15;
chan[i].panR=(chan[i].panR*chan[i].panDepth)/15;
// then invert it to get final panning
chan[i].panL^=0xff;
chan[i].panR^=0xff;
dispatchCmd(DivCommand(DIV_CMD_PANNING,i,chan[i].panL,chan[i].panR));
}

View file

@ -26,6 +26,8 @@
#include "imgui.h"
#include "imgui_internal.h"
#include "../ta-utils.h"
struct FurnacePlotArrayGetterData
{
const float* Values;
@ -270,12 +272,13 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx),
float lineHeight=ImGui::GetTextLineHeight()/2.0;
for (int i=0; i<bits && overlay_text[i]; i++) {
ImGui::PushStyleColor(ImGuiCol_Text,ImVec4(0,0,0,1.0f));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x-1, frame_bb.Min.y-lineHeight-1), ImVec2(frame_bb.Max.x-1,frame_bb.Max.y+lineHeight-1), overlay_text[i], NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x-1, frame_bb.Min.y-lineHeight+1), ImVec2(frame_bb.Max.x-1,frame_bb.Max.y+lineHeight+1), overlay_text[i], NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x+1, frame_bb.Min.y-lineHeight-1), ImVec2(frame_bb.Max.x+1,frame_bb.Max.y+lineHeight-1), overlay_text[i], NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x+1, frame_bb.Min.y-lineHeight+1), ImVec2(frame_bb.Max.x+1,frame_bb.Max.y+lineHeight+1), overlay_text[i], NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
const char* text=_(overlay_text[i]);
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x-1, frame_bb.Min.y-lineHeight-1), ImVec2(frame_bb.Max.x-1,frame_bb.Max.y+lineHeight-1), text, NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x-1, frame_bb.Min.y-lineHeight+1), ImVec2(frame_bb.Max.x-1,frame_bb.Max.y+lineHeight+1), text, NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x+1, frame_bb.Min.y-lineHeight-1), ImVec2(frame_bb.Max.x+1,frame_bb.Max.y+lineHeight-1), text, NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x+1, frame_bb.Min.y-lineHeight+1), ImVec2(frame_bb.Max.x+1,frame_bb.Max.y+lineHeight+1), text, NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::PopStyleColor();
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y-lineHeight), ImVec2(frame_bb.Max.x,frame_bb.Max.y+lineHeight), overlay_text[i], NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
ImGui::RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y-lineHeight), ImVec2(frame_bb.Max.x,frame_bb.Max.y+lineHeight), text, NULL, NULL, ImVec2(0.0f, (0.5+double(bits-1-i))/double(bits)));
}
}