Cleanup GenerateNextTrackEvent

This commit is contained in:
Luke Street 2023-06-29 19:16:20 -04:00
parent f60291726a
commit 76f0d17291
1 changed files with 9 additions and 5 deletions

View File

@ -943,7 +943,9 @@ static SEQ_EVENT* GenerateNextTrackEvent(u8 trackId) {
if (track->addr->pattern == 0xffff) { if (track->addr->pattern == 0xffff) {
track->addr = NULL; track->addr = NULL;
return NULL; return NULL;
} else if (track->addr->pattern == 0xfffe) { }
if (track->addr->pattern == 0xfffe) {
if (cseq->trackSectionTab == NULL) { if (cseq->trackSectionTab == NULL) {
if (cseq->section[0].loopDisable) { if (cseq->section[0].loopDisable) {
track->addr = NULL; track->addr = NULL;
@ -956,6 +958,7 @@ static SEQ_EVENT* GenerateNextTrackEvent(u8 trackId) {
ev->type = 3; ev->type = 3;
ev->time = track->addr->time; ev->time = track->addr->time;
// TODO what is this?
track->addr = &track->base[*((u16*)&track->addr->transpose)]; track->addr = &track->base[*((u16*)&track->addr->transpose)];
return ev; return ev;
} }
@ -1005,12 +1008,13 @@ static SEQ_EVENT* GenerateNextTrackEvent(u8 trackId) {
if (pitchTime < modTime) { if (pitchTime < modTime) {
ev->time = pitchTime + pattern->baseTime; ev->time = pitchTime + pattern->baseTime;
ev->type = 2; ev->type = 2;
} else { goto end;
use_mod_time:
ev->time = modTime + pattern->baseTime;
ev->type = 1;
} }
use_mod_time:
ev->time = modTime + pattern->baseTime;
ev->type = 1;
end: end:
return ev; return ev;
} }