by antto » Tue Dec 04, 2012 4:51 am
all this mojo with the MSG_OS_VER has the purpose to make it easier for a firmware to be distinguishable, if needed
currently, c0nb0x "detects" the pattern size on connect, it simply asks for [Bank1, Slot1] and uses the message size
all current firmwares would return a pattern of size 16, except n0nx0x which returns 21 bytes (that's how it distinguishes it)
if you want to put additional information in each pattern, storing it "after" the 2kB would mean:
1) your patterns would still be consistent between stock firmware and sokkos
2) you will have to use "Export EEPROM" to make full backups
that's assuming you don't change the pattern size message (keep it 16)
you can do it like n0nx0x, put all data into a single area, and change the pattern size respectively
1) your patterns won't be consistent with the stock firmware
2) "Export Patterns" will be enough to make a backup of the patterns
3) a small convertion will be needed when going from stock firmware to your firmware and back
yet another option is to put the additional data after the 2048 bytes, and put the convertion code in the actual firmware:
1) your patterns will be consistent with stock firmware
2) when c0nb0x requests a pattern, you will return (for example) the first 16 bytes of the normal pattern plus the additional N bytes after it (which are located somewhere at the back of the eeprom) into one packet
3) as far as c0nb0x is concerned, your pattern would be 16+N bytes long
4) when c0nb0x gives you a pattern (which would be 16+N bytes big) you will take the first 16bytes and put them in the respective slot, and then put the remaining N bytes in their respective location at the back of the eeprom
so the 3rd variant would require slightly more code i guess
in all 3 cases, you are not required to implement MSG_OS_VER or anything, c0nb0x will automatically detect the pattern size and if it's not 16 bytes, it will show your firmware as "(auto) Unknown FW" (unless if it's 21 bytes where it will think it's "(auto) n0nx0x beta" )
i'd personally go for variant 3 in your case
i went for variant 2 in n0nx0x, because the actual pattern format was totally different from the stock one anyway
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: viewtopic.php?f=12&t=24759 (do it the EASY way)