Skip to content

Commit

Permalink
Fixed VGM looping
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane-D committed Aug 19, 2019
1 parent fe15ad0 commit 907a334
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Binary file modified bin/xgmtool.exe
Binary file not shown.
9 changes: 9 additions & 0 deletions tools/xgmtool/src/vgm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,16 @@ void VGM_cleanCommands(VGM* vgm)

// keep data block, stream commands and other misc commands
if (VGMCommand_isDataBlock(command) || VGMCommand_isStream(command) || VGMCommand_isLoopStart(command) || VGMCommand_isLoopEnd(command))
{
optimizedCommands = insertAfterLList(optimizedCommands, command);
// loop start ? -->
if (VGMCommand_isLoopStart(command))
{
// need to reset YM and PSG previous state
ymOldState = YM2612_create();
psgOldState = PSG_create();
}
}
else if (VGMCommand_isPSGWrite(command))
PSG_write(psgState, VGMCommand_getPSGValue(command));
else if (VGMCommand_isYM2612Write(command))
Expand Down

0 comments on commit 907a334

Please sign in to comment.