Skip to content

Commit

Permalink
[xgmtool] Recognize and don't skip RF4C68 commands
Browse files Browse the repository at this point in the history
  • Loading branch information
viciious committed Jun 10, 2024
1 parent 1655e92 commit f701a0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tools/xgmtool/inc/vgmcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define VGM_LOOP_START 0x30
#define VGM_LOOP_END 0x31

#define VGM_WRITE_RF5C68 0xB0

typedef struct
{
Expand Down Expand Up @@ -92,6 +93,7 @@ int VGMCommand_getStreamFrenquency(VGMCommand* source);
int VGMCommand_getStreamSampleAddress(VGMCommand* source);
int VGMCommand_getStreamSampleSize(VGMCommand* source);
bool VGMCommand_isSame(VGMCommand* source, VGMCommand* com);
bool VGMCommand_isRF5C68Control(VGMCommand* source);

bool VGMCommand_contains(LList* commands, VGMCommand* command);
VGMCommand* VGMCommand_getKeyOnCommand(LList* commands, int channel);
Expand Down
2 changes: 1 addition & 1 deletion tools/xgmtool/src/vgm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ void VGM_cleanCommands(VGM* vgm)
command = com->element;

// keep data block, stream commands and other misc commands
if (VGMCommand_isDataBlock(command) || VGMCommand_isStream(command) || VGMCommand_isLoopStart(command) || VGMCommand_isLoopEnd(command))
if (VGMCommand_isDataBlock(command) || VGMCommand_isStream(command) || VGMCommand_isLoopStart(command) || VGMCommand_isLoopEnd(command) || VGMCommand_isRF5C68Control(command))
{
optimizedCommands = insertAfterLList(optimizedCommands, command);
// loop start ? -->
Expand Down
5 changes: 5 additions & 0 deletions tools/xgmtool/src/vgmcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ bool VGMCommand_isSame(VGMCommand* source, VGMCommand* com)
return !memcmp(&(source->data[source->offset]), &(com->data[com->offset]), source->size);
}

bool VGMCommand_isRF5C68Control(VGMCommand* source)
{
return source->command == VGM_WRITE_RF5C68;
}

bool VGMCommand_contains(LList* commands, VGMCommand* command)
{
LList* l = commands;
Expand Down

0 comments on commit f701a0e

Please sign in to comment.