This is a patch to apply on the ucl-1.03 tarball to get the modified uclpack for Rockbox (see http://www.rockbox.org/twiki/bin/view/Main/RomBox) Get the original tarball here: http://www.oberhumer.com/opensource/ucl/download/ --- ucl-1.03/examples/uclpack.c.orig 2004-07-20 01:01:47.000000000 +0200 +++ ucl-1.03/examples/uclpack.c 2004-12-09 18:18:11.043974400 +0100 @@ -184,9 +184,11 @@ static ucl_bool set_method_name(int method, int level) { method_name[0] = 0; - if (level < 1 || level > 10) + if (level < 0 || level > 10) return 0; - if (method == 0x2b) + if (method == 0) + sprintf(method_name,"uncompressed/%d", level); + else if (method == 0x2b) sprintf(method_name,"NRV2B-99/%d", level); else if (method == 0x2d) sprintf(method_name,"NRV2D-99/%d", level); @@ -262,7 +264,12 @@ /* compress block */ r = UCL_E_ERROR; out_len = 0; - if (method == 0x2b) + if (level == 0) + { + out_len = in_len; /* uncompressed */ + r = UCL_E_OK; + } + else if (method == 0x2b) r = ucl_nrv2b_99_compress(in,in_len,out,&out_len,0,level,NULL,NULL); else if (method == 0x2d) r = ucl_nrv2d_99_compress(in,in_len,out,&out_len,0,level,NULL,NULL); @@ -562,7 +569,8 @@ printf(" %s -t -D1000 compressed-file... (test decompression speed)\n", progname); #endif printf("\ncompression options:\n"); - printf(" -1...-9, --10 set compression level [default is `-7']\n"); + printf(" -0...-9, --10 set compression level [default is `-7']\n"); + printf(" --none uncompressed method\n"); printf(" --nrv2b use NRV2B compression method\n"); printf(" --nrv2d use NRV2D compression method [default]\n"); printf(" --nrv2e use NRV2E compression method\n"); @@ -720,12 +728,14 @@ opt_method = 0x2e; else if (strcmp(argv[i],"--nrv2e") == 0) opt_method = 0x2e; - else if ((argv[i][1] >= '1' && argv[i][1] <= '9') && !argv[i][2]) + else if ((argv[i][1] >= '0' && argv[i][1] <= '9') && !argv[i][2]) opt_level = argv[i][1] - '0'; else if (strcmp(argv[i],"--10") == 0) opt_level = 10; else if (strcmp(argv[i],"--best") == 0) opt_level = 10; + else if (strcmp(argv[i],"--none") == 0) + opt_level = 0; else if (argv[i][1] == 'b' && argv[i][2]) { long x = atol(&argv[i][2]);