Skip to content

Commit

Permalink
#1140: fixed sfx() reset
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox committed Aug 9, 2020
1 parent 3a1138f commit 5cd8e42
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/tic.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,25 +540,16 @@ static void setChannelData(tic_mem* memory, s32 index, s32 note, s32 octave, s32
resetSfxPos(channel);
}

static void resetChannelRegistersData(tic_mem* memory, s32 channel)
{
tic_machine* machine = (tic_machine*)memory;
memset(&machine->state.registers.left[channel], 0, sizeof(tic_sound_register_data));
memset(&machine->state.registers.right[channel], 0, sizeof(tic_sound_register_data));
}

static void setMusicChannelData(tic_mem* memory, s32 index, s32 note, s32 octave, s32 left, s32 right, s32 channel)
{
tic_machine* machine = (tic_machine*)memory;
setChannelData(memory, index, note, octave, -1, &machine->state.music.channels[channel], left, right, SFX_DEF_SPEED);
resetChannelRegistersData(memory, channel);
}

static void setSfxChannelData(tic_mem* memory, s32 index, s32 note, s32 octave, s32 duration, s32 channel, s32 left, s32 right, s32 speed)
{
tic_machine* machine = (tic_machine*)memory;
setChannelData(memory, index, note, octave, duration, &machine->state.sfx.channels[channel], left, right, speed);
resetChannelRegistersData(memory, channel);
}

static void resetMusicChannels(tic_mem* memory)
Expand Down

0 comments on commit 5cd8e42

Please sign in to comment.