# Written by Steve Palm - n9yty@n9yty.com # If this breaks your V-Accordion, I am not responsible. I have used # it only on my FR-4xb and have not had a chance to test it with any # other accordion. I think the basic principles here could apply to # the FR-8x as well, but I have no way to test that. # # Use with care Comparing individual user program to user program bank, the binary portion is the same up to 26037 (0x65B5) in the "bank" UPG file which was the end of the single UPG file. So in other words, the UPA has the full UPG binary data, followed by the next and so on. So, it looks like you can simply concatenate the binary sections together from individual UPG files to build up the binary portion of the "bank" UPG file. Likewise, the UPA file binary data is identical for the length of the bank UPG file. So you can just concatenate the multiple UPG BANK file DATA to make a UPA file. The header has to be changed, it is the same except the last byte. All formats have "ef bb bf 00 00 03". The last byte is: SINGLE=28, BANK=29, ALL=5e. The text block offsets are essentially the same, although the number="" differs, as it is 1 for a single, 14 for a bank and 98 the ALL file. The ALL file also has a "" appended to it... That offset is 0x26EFAC. From 2552608 to the end is all 0xFF. That 131072 doesn't divide every by 98 programs or 7 banks... The single UPG file is 26853 bytes long Header: ef bb bf 00 00 03 28 Then a text XML block:
Binary data starts at 0x0000330 = 816 bytes I extracted the data portion like so: $ dd skip=815 bs=1 if=001_001_UPG.UPG of=001_001_DATA.UPG UPB file is 365348 bytes long Header: ef bb bf 00 00 03 29 Then a Text XML Block:
Binary data starts at 0x0000330 = 816 bytes I extracted that data portion like so: $ dd skip=815 bs=1 if=001_001_UPG.UPG of=001_001_DATA.UPG UPA File is 2683665 bytes long Header: ef bb bf 00 00 03 5e Then a Text XML Block:
Binary data stars at 0x0365 = 869 bytes I extracted the data portion like this: $ dd skip=869 bs=1 if=UPG_ALL.UPA of=UPG_DATA.UPA The UPLIST section is all 0xFF bytes, but this is on an FR-4x which doesn't have these settings as far as I know, this is an FR-8x feature but the file contains the placeholder for it even on the FR-4x. SET FILES Individual set: Binary header: EF BB BF 00 00 03 28 Text header:
Data begins at 815 (0x032F) I extracted the data portion like this: $ dd skip=815 bs=1 if=SET_070.ST4 of=SET_070_DATA.ST4 ALL Set file: Binary header: EF BB BF 00 00 08 2F Text header:
FR4X000100000000000000000000000000000000000000000000000000000000@ The "FR4X...." Line I assume is part of the VR dump, so I will include that in the data portion. Data offset is at 2102 (0x836). I extracted that like this: $ dd skip=2102 bs=1 if=SET_ALL.FR4 of=SET_ALL_DATA.ST4 To extract the individual sections from the "ALL SET" data dump (keeping VTW together, inside of it is an upper and lower section though). $ dd skip=0 count=64 bs=1 if=SET_ALL_DATA.ST4 of=SET_ALL_VR.DATA $ dd skip=64 count=3572 bs=1 if=SET_ALL_DATA.ST4 of=SET_ALL_NEGP.DATA $ dd skip=3636 count=282 bs=1 if=SET_ALL_DATA.ST4 of=SET_ALL_EGP.DATA $ dd skip=3918 count=4064 bs=1 if=SET_ALL_DATA.ST4 of=SET_ALL_VTW.DATA $ dd skip=8302 count=26038 bs=1 if=SET_ALL_DATA.ST4 of=SET_ALL_SET.DATA Note in the text portion, this is different than the user program stuff. It is not just similar binary blobs. The ALL SET dump includes some additional sections in it (VR, NEGP, EGP and VTW_PRESET) that are not in the single set file. At least not the ones that I worked with. However, the SET portion has an offset listed. For the single SET export that is 0, but for the ALL SET export it is 8302 (0x206E). That points to a binary block that is then identical. The binary section has a header that is the same for the bulk set and an individual set, and it recurs at the top of each individual set data inside the ALL SET dump. 8D 49 6B 78 D4 9B D8 60 C1 83 14 08 10 20 The "all set' data portion (from the offset for the SET piece) is 2631388 bytes long, dividing by 26038 bytes gives 101 SET locations. The FR-4x can hold sets 00-99, and there is the WA (working area). Numbering from 001, I get to 101 and a 102 that is not a complete size, but I didn't work through it enough to know what is contained in it.