Skip to content

Commit

Permalink
Add SysEx checksum calculation formulas for Roland
Browse files Browse the repository at this point in the history
  • Loading branch information
viti95 committed Dec 9, 2024
1 parent 5fa1e6d commit dcc6405
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions FASTDOOM/dmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ int MUS_RegisterSong(void *data)
return 0;
}

int MUS_Checksum(unsigned char* bytes, int length) {
int i;
int sum = 0;
for (i = 0; i < length; ++i) {
sum += bytes[i];
}
return sum % 0x80;
}

int MUS_ChecksumRoland(unsigned char* bytes, int length) {
int checkSum = MUS_Checksum(bytes, length);
return (0x80 - checkSum) % 0x80;
}

char mt32file[13] = "MT32GM.MID";

int MUS_LoadMT32(void)
Expand Down

0 comments on commit dcc6405

Please sign in to comment.