added some more stuff to supervision support

This commit is contained in:
AArt1256 2024-08-09 09:57:35 +03:00
parent 3e774ddb6f
commit 5532965925
7 changed files with 26 additions and 8 deletions

View file

@ -478,14 +478,14 @@ void DivPlatformSupervision::renderSamples(int sysID) {
sampleOff[i]=0;
continue;
}
unsigned int paddedLen=((s->length8>>1)+63)&(~0x3f);
unsigned int paddedLen=((s->length8>>1)+31)&(~0x1f);
logV("%d padded length: %d",i,paddedLen);
if ((memPos&(~0x3fff))!=((memPos+paddedLen)&(~0x3fff))) {
memPos=(memPos+0x3fff)&(~0x3fff);
}
if (paddedLen>=4096) {
paddedLen=4096;
}
if ((memPos&(~0x3fff))!=((memPos+paddedLen)&(~0x3fff))) {
memPos=(memPos+0x3fff)&(~0x3fff);
}
if (memPos>=getSampleMemCapacity(0)) {
logW("out of memory for sample %d!",i);
break;
@ -493,7 +493,7 @@ void DivPlatformSupervision::renderSamples(int sysID) {
if (memPos+paddedLen>=getSampleMemCapacity(0)) {
sampleLen[i] = (getSampleMemCapacity(0)-memPos)>>1;
for (size_t i=0; i<(getSampleMemCapacity(0)-memPos)>>1; i++) {
sampleMem[memPos+i] = (((s->data8[i*2+0]+128)>>4)<<4&0xf0)|(((s->data8[i*2+1]+128)>>4)&0xf);
sampleMem[memPos+i]=(((s->data8[i*2+0]+128)>>4)<<4&0xf0)|(((s->data8[i*2+1]+128)>>4)&0xf);
}
logW("out of memory for sample %d!",i);
} else {

View file

@ -351,6 +351,7 @@ enum FurnaceGUIColors {
GUI_COLOR_INSTR_GBA_MINMOD,
GUI_COLOR_INSTR_BIFURCATOR,
GUI_COLOR_INSTR_SID2,
GUI_COLOR_INSTR_SUPERVISION,
GUI_COLOR_INSTR_UNKNOWN,
GUI_COLOR_CHANNEL_BG,

View file

@ -1016,6 +1016,7 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={
D(GUI_COLOR_INSTR_GBA_MINMOD,"",ImVec4(0.5f,0.45f,0.7f,1.0f)),
D(GUI_COLOR_INSTR_BIFURCATOR,"",ImVec4(0.8925f,0.8925f,0.8925f,1.0f)),
D(GUI_COLOR_INSTR_SID2,"",ImVec4(0.6f,0.75f,1.0f,1.0f)),
D(GUI_COLOR_INSTR_SUPERVISION,"",ImVec4(0.52f,1.0f,0.6f,1.0f)),
D(GUI_COLOR_INSTR_UNKNOWN,"",ImVec4(0.3f,0.3f,0.3f,1.0f)),
D(GUI_COLOR_CHANNEL_BG,"",ImVec4(0.4f,0.6f,0.8f,1.0f)),

View file

@ -2667,7 +2667,8 @@ void FurnaceGUI::insTabSample(DivInstrument* ins) {
ins->type==DIV_INS_AY8930 ||
ins->type==DIV_INS_VRC6 ||
ins->type==DIV_INS_SU ||
ins->type==DIV_INS_NDS) {
ins->type==DIV_INS_NDS ||
ins->type==DIV_INS_SUPERVISION) {
P(ImGui::Checkbox(_("Use sample"),&ins->amiga.useSample));
if (ins->type==DIV_INS_X1_010) {
if (ImGui::InputInt(_("Sample bank slot##BANKSLOT"),&ins->x1_010.bankSlot,1,4)) { PARAMETER
@ -6251,7 +6252,8 @@ void FurnaceGUI::drawInsEdit() {
ins->type==DIV_INS_C219 ||
ins->type==DIV_INS_NDS ||
ins->type==DIV_INS_GBA_DMA ||
ins->type==DIV_INS_GBA_MINMOD) {
ins->type==DIV_INS_GBA_MINMOD ||
ins->type==DIV_INS_SUPERVISION) {
insTabSample(ins);
}
if (ins->type==DIV_INS_N163) if (ImGui::BeginTabItem("Namco 163")) {

View file

@ -402,6 +402,19 @@ void FurnaceGUI::drawSampleEdit() {
SAMPLE_WARN(warnLength,_("GBA DMA: sample length will be padded to multiple of 16"));
}
break;
case DIV_SYSTEM_SUPERVISION:
if (sample->loop) {
if (sample->loopStart!=0 || sample->loopEnd!=(int)(sample->samples)) {
SAMPLE_WARN(warnLoopPos,_("Supervision: loop point ignored on sample channel"));
}
}
if (sample->samples&31) {
SAMPLE_WARN(warnLength,_("Supervision: sample length will be padded to multiple of 32"));
}
if (sample->samples>8192) {
SAMPLE_WARN(warnLength,_("Supervision: maximum sample length is 8192"));
}
break;
default:
break;
}

View file

@ -4113,6 +4113,7 @@ void FurnaceGUI::drawSettings() {
UI_COLOR_CONFIG(GUI_COLOR_INSTR_GBA_MINMOD,_("GBA MinMod"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_BIFURCATOR,_("Bifurcator"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID2,_("SID2"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SUPERVISION,_("Supervision"));
UI_COLOR_CONFIG(GUI_COLOR_INSTR_UNKNOWN,_("Other/Unknown"));
ImGui::TreePop();
}

View file

@ -75,7 +75,7 @@
#define ICON_FUR_INS_GBA_MINMOD u8"\ue15f"
#define ICON_FUR_INS_BIFURCATOR u8"\ue160"
#define ICON_FUR_INS_SID2 u8"\ue161"
#define ICON_FUR_INS_SUPERVISION u8"\ue160"
#define ICON_FUR_INS_SUPERVISION u8"\ue162"
// sample editor
#define ICON_FUR_SAMPLE_APPLY_SILENCE u8"\ue136"