From 67824478db7965bb98072ca28d9ffaf347b4f6ab Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Thu, 9 Jun 2016 01:49:40 +0300 Subject: Another experiment with OP3-files (old IBK with modded bank has been replaced with better OP3 file) --- fm_banks/op3_files/2x2patch/bytecmp.c | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 fm_banks/op3_files/2x2patch/bytecmp.c (limited to 'fm_banks/op3_files/2x2patch/bytecmp.c') diff --git a/fm_banks/op3_files/2x2patch/bytecmp.c b/fm_banks/op3_files/2x2patch/bytecmp.c new file mode 100644 index 0000000..eb24e21 --- /dev/null +++ b/fm_banks/op3_files/2x2patch/bytecmp.c @@ -0,0 +1,47 @@ +#include + +int main() +{ + FILE* f1 = fopen("../fat4.op3", "rb"); + FILE* f2 = fopen("../fat4_probe.op3", "rb"); + + unsigned char byte1=0, byte2=0; + int count=0; + int insCount=0; + int dataPos = 32+(2*4); + int valid1 = 1; + int valid2 = 1; + int drumMode = 0; + while( valid1 && valid2 ) + { + valid1 = (fread(&byte1, 1, 1, f1)!=0); + valid2 = (fread(&byte2, 1, 1, f2)!=0); + + if(!valid1 && !valid2) + break; + if(count==32) + { + printf("Header\n"); + } + if(count==32+(2*4)) + { + printf("Header END\n"); + } + if(count>=dataPos) + { + if((count-dataPos)%24==0) + { + if(drumMode) + printf("DRUM!!! %d\n", (insCount++)-128); + else + printf("INSTRUMENT!!! %d\n", insCount++); + if(insCount==128) + drumMode = 1; + } + } + printf("%03X: {0x%02x == 0x%02x}%s\n", count, byte1, byte2, (byte1==byte2)?"":" <- NOT SAME!!!"); + count++; + } + + +} -- cgit v1.2.3