Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 139 additions & 139 deletions src/commands.cpp

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void printstatus()
{
for (int c = 0; c < maxChns; c++)
{
int currentSonglen = song.len[esnum][c];
int currentSonglen = song.order[esnum][c].len;
int newpos = chn[c].pattptr / 4;
if (chn[c].advance) epnum[c] = chn[c].pattnum;

Expand Down Expand Up @@ -301,8 +301,8 @@ void printstatus()
for (int d = 0; d < visibleOrderlist; d++)
{
int p = esview[c]+d;
unsigned char currentSongorder = song.order[esnum][c][p];
int currentSonglen = song.len[esnum][c];
unsigned char currentSongorder = song.order[esnum][c].data[p];
int currentSonglen = song.order[esnum][c].len;
int color = colors.cnormal();
if (isplaying())
{
Expand Down Expand Up @@ -430,22 +430,22 @@ void printstatus()
switch (c)
{
case WTBL:
if (song.ltable[c][p] >= WAVECMD) color = colors.ccommand();
if (song.fxtable[c][p].l >= WAVECMD) color = colors.ccommand();
break;

case PTBL:
if (song.ltable[c][p] >= 0x80) color = colors.ccommand();
if (song.fxtable[c][p].l >= 0x80) color = colors.ccommand();
break;

case FTBL:
if ((song.ltable[c][p] >= 0x80) || ((!song.ltable[c][p]) && (song.rtable[c][p]))) color = colors.ccommand();
if ((song.fxtable[c][p].l >= 0x80) || ((!song.fxtable[c][p].l) && (song.fxtable[c][p].r))) color = colors.ccommand();
break;
}
if ((p == tables.pos()) && (tables.num() == c)) color = colors.cedit();
std::snprintf(textbuffer, MAX_PATHNAME, "%02X:%02X %02X", p+1, song.ltable[c][p], song.rtable[c][p]);
std::snprintf(textbuffer, MAX_PATHNAME, "%02X:%02X %02X", p+1, song.fxtable[c][p].l, song.fxtable[c][p].r);
if (config.patterndispmode & 2)
{
if (!song.ltable[c][p] && !song.rtable[c][p] && !song.ltable[c][p+1] && !song.rtable[c][p+1])
if (!song.fxtable[c][p].l && !song.fxtable[c][p].r && !song.fxtable[c][p+1].l && !song.fxtable[c][p+1].r)
{
std::memset(&textbuffer[3], '.', 2);
std::memset(&textbuffer[6], '.', 2);
Expand Down
18 changes: 9 additions & 9 deletions src/loadtrk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void mousecommands()
{
int maxChns = config.getMaxChannels();

int currentSonglen = song.len[esnum][eschn];
int currentSonglen = song.order[esnum][eschn].len;

if (input.wheel)
{
Expand Down Expand Up @@ -650,7 +650,7 @@ void mousecommands()
}
else if (input.wheel < 0)
{
if ((song.len[esnum][newchn]-esview[newchn]) > config.getVisibleOrderlist()-1)
if ((song.order[esnum][newchn].len-esview[newchn]) > config.getVisibleOrderlist()-1)
{
esview[newchn]++;
if (newchn == eschn) eseditpos++;
Expand Down Expand Up @@ -1090,7 +1090,7 @@ void generalcommands()
case ':':
for (int c = 0; c < maxChns; c++)
{
currentSonglen = song.len[esnum][c];
currentSonglen = song.order[esnum][c].len;
if (espos[c] < (currentSonglen-1))
espos[c]++;
if ((espos[c] - esview[c]) >= visibleOrderlist)
Expand Down Expand Up @@ -1729,16 +1729,16 @@ void findduplicatepatterns()
{
for (int f = 0; f < MAX_SONGS; f++)
{
if ((song.len[f][0]) &&
(song.len[f][1]) &&
(song.len[f][2]))
if ((song.order[f][0].len) &&
(song.order[f][1].len) &&
(song.order[f][2].len))
{
for (int g = 0; g < maxChns; g++)
{
for (int h = 0; h < song.len[f][g]; h++)
for (int h = 0; h < song.order[f][g].len; h++)
{
if (song.order[f][g][h] == d)
song.order[f][g][h] = c;
if (song.order[f][g].data[h] == d)
song.order[f][g].data[h] = c;
}
}
}
Expand Down
54 changes: 27 additions & 27 deletions src/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,35 @@ Selection esmark;

void insertorder(unsigned char byte)
{
int sl = song.len[esnum][eschn];
int sl = song.order[esnum][eschn].len;
if ((sl - eseditpos)-1 >= 0)
{
if (sl < MAX_SONGLEN)
{
int len = sl+1;
song.order[esnum][eschn][len+1] = song.order[esnum][eschn][len];
song.order[esnum][eschn][len] = LOOPSONG;
if (len) song.order[esnum][eschn][len-1] = byte;
song.order[esnum][eschn].data[len+1] = song.order[esnum][eschn].data[len];
song.order[esnum][eschn].data[len] = LOOPSONG;
if (len) song.order[esnum][eschn].data[len-1] = byte;
countthispattern();
}
std::memmove(&song.order[esnum][eschn][eseditpos+1],
&song.order[esnum][eschn][eseditpos],
std::memmove(&song.order[esnum][eschn].data[eseditpos+1],
&song.order[esnum][eschn].data[eseditpos],
(sl - eseditpos)-1);
song.order[esnum][eschn][eseditpos] = byte;
song.order[esnum][eschn].data[eseditpos] = byte;
int len = sl+1;
if ((song.order[esnum][eschn][len] > eseditpos) &&
(song.order[esnum][eschn][len] < (len-2)))
song.order[esnum][eschn][len]++;
if ((song.order[esnum][eschn].data[len] > eseditpos) &&
(song.order[esnum][eschn].data[len] < (len-2)))
song.order[esnum][eschn].data[len]++;
}
else
{
if (eseditpos > sl)
{
if (sl < MAX_SONGLEN)
{
song.order[esnum][eschn][eseditpos+1] = song.order[esnum][eschn][eseditpos];
song.order[esnum][eschn][eseditpos] = LOOPSONG;
if (eseditpos) song.order[esnum][eschn][eseditpos-1] = byte;
song.order[esnum][eschn].data[eseditpos+1] = song.order[esnum][eschn].data[eseditpos];
song.order[esnum][eschn].data[eseditpos] = LOOPSONG;
if (eseditpos) song.order[esnum][eschn].data[eseditpos-1] = byte;
countthispattern();
eseditpos = sl+1;
}
Expand All @@ -86,33 +86,33 @@ void insertorder(unsigned char byte)

void deleteorder()
{
int sl = song.len[esnum][eschn];
int sl = song.order[esnum][eschn].len;
if ((sl - eseditpos)-1 >= 0)
{
std::memmove(&song.order[esnum][eschn][eseditpos],
&song.order[esnum][eschn][eseditpos+1],
std::memmove(&song.order[esnum][eschn].data[eseditpos],
&song.order[esnum][eschn].data[eseditpos+1],
(sl - eseditpos)-1);
song.order[esnum][eschn][sl-1] = 0x00;
song.order[esnum][eschn].data[sl-1] = 0x00;
if (sl > 0)
{
song.order[esnum][eschn][sl-1] = song.order[esnum][eschn][sl];
song.order[esnum][eschn][sl] = song.order[esnum][eschn][sl+1];
song.order[esnum][eschn].data[sl-1] = song.order[esnum][eschn].data[sl];
song.order[esnum][eschn].data[sl] = song.order[esnum][eschn].data[sl+1];
countthispattern();
}
if (eseditpos == sl) eseditpos++;
int len = sl+1;
if ((song.order[esnum][eschn][len] > eseditpos) &&
(song.order[esnum][eschn][len] > 0))
song.order[esnum][eschn][len]--;
if ((song.order[esnum][eschn].data[len] > eseditpos) &&
(song.order[esnum][eschn].data[len] > 0))
song.order[esnum][eschn].data[len]--;
}
else
{
if (eseditpos > sl)
{
if (sl > 0)
{
song.order[esnum][eschn][sl-1] = song.order[esnum][eschn][sl];
song.order[esnum][eschn][sl] = song.order[esnum][eschn][sl+1];
song.order[esnum][eschn].data[sl-1] = song.order[esnum][eschn].data[sl];
song.order[esnum][eschn].data[sl] = song.order[esnum][eschn].data[sl+1];
countthispattern();
eseditpos = sl+1;
}
Expand All @@ -138,7 +138,7 @@ void songchange()
{
int maxChns = config.getMaxChannels();

int currentSonglen = song.len[esnum][eschn];
int currentSonglen = song.order[esnum][eschn].len;

for (int c = 0; c < maxChns; c++)
{
Expand Down Expand Up @@ -167,10 +167,10 @@ void updateviewtopos()

for (int c = 0; c < maxChns; c++)
{
int currentSonglen = song.len[esnum][c];
int currentSonglen = song.order[esnum][c].len;
for (int d = espos[c]; d < currentSonglen; d++)
{
int currentSongorder = song.order[esnum][c][d];
int currentSongorder = song.order[esnum][c].data[d];
if (currentSongorder < MAX_PATT)
{
epnum[c] = currentSongorder;
Expand Down
16 changes: 8 additions & 8 deletions src/pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ void splitpattern()
{
for (eschn = 0; eschn < maxChns; eschn++)
{
for (eseditpos = 0; eseditpos < song.len[esnum][eschn]; eseditpos++)
for (eseditpos = 0; eseditpos < song.order[esnum][eschn].len; eseditpos++)
{
if (song.order[esnum][eschn][eseditpos] == c)
if (song.order[esnum][eschn].data[eseditpos] == c)
{
song.order[esnum][eschn][eseditpos] = c+1;
song.order[esnum][eschn].data[eseditpos] = c+1;
insertorder(c);
}
}
Expand All @@ -253,9 +253,9 @@ void joinpattern()
int maxChns = config.getMaxChannels();

if (eschn != epchn) return;
if (song.order[esnum][epchn][eseditpos] != c) return;
if (song.order[esnum][epchn].data[eseditpos] != c) return;

int d = song.order[esnum][epchn][eseditpos + 1];
int d = song.order[esnum][epchn].data[eseditpos + 1];
if (d >= MAX_PATT) return;
if (getPattlen(c) + getPattlen(d) > MAX_PATTROWS) return;

Expand Down Expand Up @@ -293,12 +293,12 @@ void joinpattern()
{
for (eschn = 0; eschn < maxChns; eschn++)
{
for (eseditpos = 0; eseditpos < song.len[esnum][eschn]; eseditpos++)
for (eseditpos = 0; eseditpos < song.order[esnum][eschn].len; eseditpos++)
{
if ((song.order[esnum][eschn][eseditpos] == c) && (song.order[esnum][eschn][eseditpos+1] == d))
if ((song.order[esnum][eschn].data[eseditpos] == c) && (song.order[esnum][eschn].data[eseditpos+1] == d))
{
deleteorder();
song.order[esnum][eschn][eseditpos] = c+1;
song.order[esnum][eschn].data[eseditpos] = c+1;
}
}
}
Expand Down
Loading
Loading