add TIA instrument type

This commit is contained in:
tildearrow 2022-01-14 15:21:57 -05:00
parent 3afb0f815d
commit c23ba3b532
3 changed files with 17 additions and 5 deletions

View file

@ -10,7 +10,8 @@ enum DivInstrumentType {
DIV_INS_AMIGA=4,
DIV_INS_PCE=5,
DIV_INS_AY=6,
DIV_INS_AY8930=7
DIV_INS_AY8930=7,
DIV_INS_TIA=8
};
struct DivInstrumentFM {

View file

@ -32,6 +32,7 @@ const int _ZERO=0;
const int _ONE=1;
const int _THREE=3;
const int _SEVEN=7;
const int _EIGHT=8;
const int _TEN=10;
const int _FIFTEEN=15;
const int _THIRTY_ONE=31;
@ -562,6 +563,10 @@ void FurnaceGUI::drawInsList() {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_AY8930]);
name=fmt::sprintf(ICON_FA_BAR_CHART " %.2x: %s##_INS%d\n",i,ins->name,i);
break;
case DIV_INS_TIA:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_TIA]);
name=fmt::sprintf(ICON_FA_BAR_CHART " %.2x: %s##_INS%d\n",i,ins->name,i);
break;
default:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_UNKNOWN]);
name=fmt::sprintf(ICON_FA_QUESTION " %.2x: %s##_INS%d\n",i,ins->name,i);
@ -586,8 +591,8 @@ int detuneTable[8]={
0, 1, 2, 3, 0, -3, -2, -1
};
const char* insTypes[8]={
"Standard", "FM", "Game Boy", "C64", "Amiga", "PC Engine", "AY-3-8910/SSG", "AY8930"
const char* insTypes[9]={
"Standard", "FM", "Game Boy", "C64", "Amiga", "PC Engine", "AY-3-8910/SSG", "AY8930", "TIA"
};
const char* ssgEnvTypes[8]={
@ -602,8 +607,8 @@ void FurnaceGUI::drawInsEdit() {
} else {
DivInstrument* ins=e->song.ins[curIns];
ImGui::InputText("Name",&ins->name);
if (ins->type<0 || ins->type>7) ins->type=DIV_INS_FM;
if (ImGui::SliderScalar("Type",ImGuiDataType_U8,&ins->type,&_ZERO,&_SEVEN,insTypes[ins->type])) {
if (ins->type<0 || ins->type>8) ins->type=DIV_INS_FM;
if (ImGui::SliderScalar("Type",ImGuiDataType_U8,&ins->type,&_ZERO,&_EIGHT,insTypes[ins->type])) {
ins->mode=(ins->type==DIV_INS_FM);
}
@ -869,6 +874,9 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_AY8930) {
dutyMax=255;
}
if (ins->type==DIV_INS_TIA) {
dutyMax=0;
}
if (dutyMax>0) {
ImGui::Separator();
if (ins->type==DIV_INS_C64) {
@ -919,6 +927,7 @@ void FurnaceGUI::drawInsEdit() {
// wave macro
int waveMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?7:63;
if (ins->type==DIV_INS_TIA) waveMax=15;
if (ins->type==DIV_INS_C64) waveMax=8;
if (waveMax>0) {
ImGui::Separator();
@ -3377,6 +3386,7 @@ FurnaceGUI::FurnaceGUI():
uiColors[GUI_COLOR_INSTR_PCE]=ImVec4(1.0f,0.8f,0.5f,1.0f);
uiColors[GUI_COLOR_INSTR_AY]=ImVec4(1.0f,0.5f,1.0f,1.0f);
uiColors[GUI_COLOR_INSTR_AY8930]=ImVec4(0.7f,0.5f,1.0f,1.0f);
uiColors[GUI_COLOR_INSTR_TIA]=ImVec4(1.0f,0.6f,0.4f,1.0f);
uiColors[GUI_COLOR_INSTR_UNKNOWN]=ImVec4(0.3f,0.3f,0.3f,1.0f);
uiColors[GUI_COLOR_CHANNEL_FM]=ImVec4(0.2f,0.8f,1.0f,1.0f);
uiColors[GUI_COLOR_CHANNEL_PULSE]=ImVec4(0.4f,1.0f,0.2f,1.0f);

View file

@ -21,6 +21,7 @@ enum FurnaceGUIColors {
GUI_COLOR_INSTR_PCE,
GUI_COLOR_INSTR_AY,
GUI_COLOR_INSTR_AY8930,
GUI_COLOR_INSTR_TIA,
GUI_COLOR_INSTR_UNKNOWN,
GUI_COLOR_CHANNEL_FM,
GUI_COLOR_CHANNEL_PULSE,