Skip to content

Commit

Permalink
Fix display when several keys are pressed simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
laqieer committed Jan 23, 2022
1 parent add2d0e commit eb757e7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/m4a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,8 +1858,6 @@ void ply_endtie(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *trac
{
struct SoundChannel *tempChan;

//remove_masks();

if (*track->cmdPtr < 0x80) {
track->key = *track->cmdPtr;
track->cmdPtr++;
Expand All @@ -1870,7 +1868,7 @@ void ply_endtie(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *trac
if ((((tempChan->statusFlags & (SOUND_CHANNEL_SF_START | SOUND_CHANNEL_SF_ENV)) != 0) && ((tempChan->statusFlags & SOUND_CHANNEL_SF_STOP) == 0)) && (tempChan->midiKey == track->key)) break;
tempChan = tempChan->nextChannelPointer;
}
tempChan->statusFlags |= 0x40;
tempChan->statusFlags |= SOUND_CHANNEL_SF_STOP;
}

void mask_key(u8 key)
Expand All @@ -1895,7 +1893,6 @@ void ply_note(u32 time, struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTra
struct ToneData *inst = &track->tone;
u8 instType = track->tone.type;
u8 instKey = track->key;
remove_masks();
mask_key(instKey);
if (instType & (TONEDATA_TYPE_RHY | TONEDATA_TYPE_SPL)) {
u32 instIndex = 12 * track->key;
Expand Down Expand Up @@ -2052,6 +2049,9 @@ void MPlayMain(struct MusicPlayerInfo *mplayInfo)
while(tempTrack->flags){
if(tempTrack->wait){
tempTrack->wait--;
if(!tempTrack->wait){
remove_masks();
}
if((tempTrack->lfoSpeed) && (tempTrack->mod)){
if(tempTrack->lfoDelayC){
tempTrack->lfoDelayC--;
Expand Down Expand Up @@ -2086,7 +2086,6 @@ void MPlayMain(struct MusicPlayerInfo *mplayInfo)
ply_note(cmd - 0xcf,mplayInfo,tempTrack);
}else if(cmd <= 0xb0){
tempTrack->wait = gClockTable[cmd - 0x80];
//remove_masks();
}else{
mplayInfo->cmd = (u8)(cmd - 0xb1);
void (*MPlayJumpTable)(struct MusicPlayerInfo*, struct MusicPlayerTrack*, u8*);
Expand Down

0 comments on commit eb757e7

Please sign in to comment.