improvements to sysDef and UX changes

- "no undo" in clear option
- only display instrument types depending on current systems
This commit is contained in:
tildearrow 2022-04-27 04:48:56 -05:00
parent 24d60507e7
commit 78bdd98e0b
11 changed files with 518 additions and 4 deletions

View file

@ -1036,8 +1036,10 @@ const char** DivEngine::getRegisterSheet(int sys) {
}
void DivEngine::recalcChans() {
bool isInsTypePossible[DIV_INS_MAX];
chans=0;
int chanIndex=0;
memset(isInsTypePossible,0,DIV_INS_MAX*sizeof(bool));
for (int i=0; i<song.systemLen; i++) {
int chanCount=getChannelCount(song.system[i]);
chans+=chanCount;
@ -1046,8 +1048,24 @@ void DivEngine::recalcChans() {
dispatchOfChan[chanIndex]=i;
dispatchChanOfChan[chanIndex]=j;
chanIndex++;
if (sysDefs[song.system[i]]!=NULL) {
if (sysDefs[song.system[i]]->chanInsType[j][0]!=DIV_INS_NULL) {
isInsTypePossible[sysDefs[song.system[i]]->chanInsType[j][0]]=true;
logV("Marking");
}
if (sysDefs[song.system[i]]->chanInsType[j][1]!=DIV_INS_NULL) {
isInsTypePossible[sysDefs[song.system[i]]->chanInsType[j][1]]=true;
}
}
}
}
possibleInsTypes.clear();
for (int i=0; i<DIV_INS_MAX; i++) {
if (isInsTypePossible[i]) possibleInsTypes.push_back((DivInstrumentType)i);
}
}
void DivEngine::reset() {