port TIunA to export framework, part 4
index option
This commit is contained in:
parent
b7631542c6
commit
34517754ad
|
@ -183,16 +183,15 @@ static void writeCmd(std::vector<TiunaBytes>& cmds, TiunaCmd& cmd, unsigned char
|
||||||
|
|
||||||
void DivExportTiuna::run() {
|
void DivExportTiuna::run() {
|
||||||
int loopOrder, loopOrderRow, loopEnd;
|
int loopOrder, loopOrderRow, loopEnd;
|
||||||
int tiaIdx;
|
|
||||||
int tick=0;
|
int tick=0;
|
||||||
SafeWriter* w;
|
SafeWriter* w;
|
||||||
std::map<int,TiunaCmd> allCmds[2];
|
std::map<int,TiunaCmd> allCmds[2];
|
||||||
|
|
||||||
// config
|
// config
|
||||||
int* sysToExport=NULL;
|
|
||||||
String baseLabel=conf.getString("baseLabel","song");
|
String baseLabel=conf.getString("baseLabel","song");
|
||||||
int firstBankSize=conf.getInt("firstBankSize",3072);
|
int firstBankSize=conf.getInt("firstBankSize",3072);
|
||||||
int otherBankSize=conf.getInt("otherBankSize",4096-48);
|
int otherBankSize=conf.getInt("otherBankSize",4096-48);
|
||||||
|
int tiaIdx=conf.getInt("sysToExport",-1);
|
||||||
|
|
||||||
e->stop();
|
e->stop();
|
||||||
e->repeatPattern=false;
|
e->repeatPattern=false;
|
||||||
|
@ -210,13 +209,11 @@ void DivExportTiuna::run() {
|
||||||
w=new SafeWriter;
|
w=new SafeWriter;
|
||||||
w->init();
|
w->init();
|
||||||
|
|
||||||
|
if (tiaIdx<0 || tiaIdx>=e->song.systemLen) {
|
||||||
tiaIdx=-1;
|
tiaIdx=-1;
|
||||||
|
|
||||||
for (int i=0; i<e->song.systemLen; i++) {
|
for (int i=0; i<e->song.systemLen; i++) {
|
||||||
if (sysToExport!=NULL && !sysToExport[i]) continue;
|
|
||||||
if (e->song.system[i]==DIV_SYSTEM_TIA) {
|
if (e->song.system[i]==DIV_SYSTEM_TIA) {
|
||||||
tiaIdx=i;
|
tiaIdx=i;
|
||||||
e->disCont[i].dispatch->toggleRegisterDump(true);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,6 +223,14 @@ void DivExportTiuna::run() {
|
||||||
running=false;
|
running=false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if (e->song.system[tiaIdx]!=DIV_SYSTEM_TIA) {
|
||||||
|
logAppend("ERROR: selected chip is not a TIA!");
|
||||||
|
failed=true;
|
||||||
|
running=false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
e->disCont[tiaIdx].dispatch->toggleRegisterDump(true);
|
||||||
|
|
||||||
// write patterns
|
// write patterns
|
||||||
// bool writeLoop=false;
|
// bool writeLoop=false;
|
||||||
|
|
|
@ -281,6 +281,7 @@ void FurnaceGUI::drawExportROM(bool onWindow) {
|
||||||
String asmBaseLabel=romConfig.getString("baseLabel","song");
|
String asmBaseLabel=romConfig.getString("baseLabel","song");
|
||||||
int firstBankSize=romConfig.getInt("firstBankSize",3072);
|
int firstBankSize=romConfig.getInt("firstBankSize",3072);
|
||||||
int otherBankSize=romConfig.getInt("otherBankSize",4096-48);
|
int otherBankSize=romConfig.getInt("otherBankSize",4096-48);
|
||||||
|
int sysToExport=romConfig.getInt("sysToExport",-1);
|
||||||
|
|
||||||
// TODO; validate label
|
// TODO; validate label
|
||||||
if (ImGui::InputText(_("base song label name"),&asmBaseLabel)) {
|
if (ImGui::InputText(_("base song label name"),&asmBaseLabel)) {
|
||||||
|
@ -297,30 +298,22 @@ void FurnaceGUI::drawExportROM(bool onWindow) {
|
||||||
altered=true;
|
altered=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text(_("chips to export:"));
|
ImGui::Text(_("chip to export:"));
|
||||||
int selected=0;
|
|
||||||
for (int i=0; i<e->song.systemLen; i++) {
|
for (int i=0; i<e->song.systemLen; i++) {
|
||||||
DivSystem sys=e->song.system[i];
|
DivSystem sys=e->song.system[i];
|
||||||
bool isTIA=sys==DIV_SYSTEM_TIA;
|
bool isTIA=(sys==DIV_SYSTEM_TIA);
|
||||||
ImGui::BeginDisabled((!isTIA) || (selected>=1));
|
ImGui::BeginDisabled(!isTIA);
|
||||||
if (ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i])) {
|
if (ImGui::RadioButton(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),sysToExport==i)) {
|
||||||
|
sysToExport=i;
|
||||||
altered=true;
|
altered=true;
|
||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
|
|
||||||
if (!isTIA) {
|
|
||||||
ImGui::SetTooltip(_("this chip is not supported by the file format!"));
|
|
||||||
} else if (selected>=1) {
|
|
||||||
ImGui::SetTooltip(_("only one Atari TIA is supported!"));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (isTIA && willExport[i]) selected++;
|
|
||||||
|
|
||||||
if (altered) {
|
if (altered) {
|
||||||
romConfig.set("baseLabel",asmBaseLabel);
|
romConfig.set("baseLabel",asmBaseLabel);
|
||||||
romConfig.set("firstBankSize",firstBankSize);
|
romConfig.set("firstBankSize",firstBankSize);
|
||||||
romConfig.set("otherBankSize",otherBankSize);
|
romConfig.set("otherBankSize",otherBankSize);
|
||||||
}
|
romConfig.set("sysToExport",sysToExport);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue