diff options
author | Dave Chapman <dave@dchapman.com> | 2005-11-07 22:20:55 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2005-11-07 22:20:55 +0000 |
commit | 33cc6deb9eb9fa0328c39f16e881d97ff7df0576 (patch) | |
tree | ad8f25ed2c2b99ba54b18a729ee51ae93415516c | |
parent | 65c174666378b361e6eac3d6f79879f71c7efe89 (diff) |
Rename irivermodel and irivernum variables to the more generic modelname and modelnum and add two new targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7779 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | tools/scramble.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/tools/scramble.c b/tools/scramble.c index ffbfa2df93..ecb198b0f4 100644 --- a/tools/scramble.c +++ b/tools/scramble.c @@ -67,8 +67,8 @@ void usage(void) "\t-neo SSI Neo format\n" "\t-mm=X Archos Multimedia format (X values: A=JBMM, B=AV1xx, C=AV3xx)\n" "\t-iriver iRiver format\n" - "\t-add=X Rockbox iRiver \"add-up\" checksum format\n" - "\t (X values: h100, h120, h140, h300)\n" + "\t-add=X Rockbox generic \"add-up\" checksum format\n" + "\t (X values: h100, h120, h140, h300, ipco, nano)\n" "\nNo option results in Archos standard player/recorder format.\n"); exit(1); @@ -87,8 +87,8 @@ int main (int argc, char** argv) int headerlen = 6; FILE* file; int version; - unsigned long irivernum; - char irivermodel[5]; + unsigned long modelnum; + char modelname[5]; int model_id; enum { none, scramble, xor, add } method = scramble; @@ -155,20 +155,24 @@ int main (int argc, char** argv) method = add; if(!strcmp(&argv[1][5], "h120")) - irivernum = 0; + modelnum = 0; else if(!strcmp(&argv[1][5], "h140")) - irivernum = 0; /* the same as the h120 */ + modelnum = 0; /* the same as the h120 */ else if(!strcmp(&argv[1][5], "h100")) - irivernum = 1; + modelnum = 1; else if(!strcmp(&argv[1][5], "h300")) - irivernum = 2; + modelnum = 2; + else if(!strcmp(&argv[1][5], "ipco")) + modelnum = 3; + else if(!strcmp(&argv[1][5], "nano")) + modelnum = 4; else { fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); return 2; } /* we store a 4-letter model name too, for humans */ - strcpy(irivermodel, &argv[1][5]); - chksum = irivernum; /* start checksum calcs with this */ + strcpy(modelname, &argv[1][5]); + chksum = modelnum; /* start checksum calcs with this */ } else if(!strcmp(argv[1], "-iriver")) { @@ -264,7 +268,7 @@ int main (int argc, char** argv) case add: { int2be(chksum, header); /* checksum, big-endian */ - memcpy(&header[4], irivermodel, 4); /* 4 bytes model name */ + memcpy(&header[4], modelname, 4); /* 4 bytes model name */ memcpy(outbuf, inbuf, length); /* the input buffer to output*/ headerlen = 8; } |