Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Miscellany
Wednesday, March 14th, 2007 at 12:07:34pm UTC 

  1. Index: tools/mi4.h
  2. ===================================================================
  3. --- tools/mi4.h (revision 12755)
  4. +++ tools/mi4.h (working copy)
  5. @@ -23,6 +23,7 @@
  6.  #define MI4_MAGIC_DEFAULT 0xec
  7.  #define MI4_MAGIC_R       0xfc
  8.  
  9. -int mi4_encode(char *iname, char *oname, int version, int magic);
  10. +int mi4_encode(char *iname, char *oname, int version, int magic,
  11. +                int model, char *type);
  12.  
  13.  #endif
  14. Index: tools/configure
  15. ===================================================================
  16. --- tools/configure     (revision 12755)
  17. +++ tools/configure     (working copy)
  18. @@ -1164,16 +1164,16 @@
  19.      target="-DIRIVER_H10"
  20.      memory=32 # always
  21.      arm7tdmicc
  22. -    tool="$rootdir/tools/scramble -add=h10"
  23. +    tool="$rootdir/tools/scramble -mi4v3 -model=13 -type=RBOS"
  24.      bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  25.      bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
  26. -    output="rockbox.h10"
  27. +    output="rockbox.mi4"
  28.      appextra="recorder:gui"
  29.      archosrom=""
  30.      flash=""
  31.      plugins="yes"
  32.      codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a  libspeex"
  33. -    boottool="$rootdir/tools/scramble -mi4v3"
  34. +    boottool="$rootdir/tools/scramble -mi4v3 -model=13 -type=RBBL"
  35.      bootoutput="H10_20GC.mi4"
  36.      # toolset is the tools within the tools directory that we build for
  37.      # this particular target.
  38. @@ -1184,22 +1184,48 @@
  39.      t_model="h10"
  40.      ;;
  41.  
  42. +   15|h10_5gb)
  43. +    target_id=24
  44. +    archos="h10_5gb"
  45. +    target="-DIRIVER_H10_5GB"
  46. +    memory=32 # always
  47. +    arm7tdmicc
  48. +    tool="$rootdir/tools/scramble -mi4v2 -model=14 -type=RBOS"
  49. +    bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  50. +    bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
  51. +    output="rockbox.mi4"
  52. +    appextra="recorder:gui"
  53. +    archosrom=""
  54. +    flash=""
  55. +    plugins="yes"
  56. +    codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a  libspeex"
  57. +    boottool="$rootdir/tools/scramble -mi4v2 -model=14 -type=RBBL"
  58. +    bootoutput="H10.mi4"
  59. +    # toolset is the tools within the tools directory that we build for
  60. +    # this particular target.
  61. +    toolset="$genericbitmaptools scramble"
  62. +    # architecture, manufacturer and model for the target-tree build
  63. +    t_cpu="arm"
  64. +    t_manufacturer="iriver"
  65. +    t_model="h10"
  66. +    ;;
  67. +
  68.     50|e200)
  69.      target_id=23
  70.      archos="e200"
  71.      target="-DSANSA_E200"
  72.      memory=32 # supposedly
  73.      arm7tdmicc
  74. -    tool="$rootdir/tools/scramble -add=e200"
  75. +    tool="$rootdir/tools/scramble -mi4v3 -model=16 -type=RBOS"
  76.      bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  77.      bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
  78. -    output="rockbox.e200"
  79. +    output="rockbox.mi4"
  80.      appextra="recorder:gui"
  81.      archosrom=""
  82.      flash=""
  83.      plugins="yes"
  84.      codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a  libspeex"
  85. -    boottool="$rootdir/tools/scramble -mi4v3"
  86. +    boottool="$rootdir/tools/scramble -mi4v3 -model=16 -type=RBBL"
  87.      bootoutput="PP5022.mi4"
  88.      # toolset is the tools within the tools directory that we build for
  89.      # this particular target.
  90. @@ -1219,16 +1245,16 @@
  91.      target="-DSANSA_E200"
  92.      memory=32 # supposedly
  93.      arm7tdmicc
  94. -    tool="$rootdir/tools/scramble -add=e200"
  95. +    tool="$rootdir/tools/scramble -mi4v3 -model=16 -type=RBOS"
  96.      bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  97.      bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
  98. -    output="rockbox.e200"
  99. +    output="rockbox.mi4"
  100.      appextra="recorder:gui"
  101.      archosrom=""
  102.      flash=""
  103.      plugins="yes"
  104.      codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a  libspeex"
  105. -    boottool="$rootdir/tools/scramble -mi4r"
  106. +    boottool="$rootdir/tools/scramble -mi4r -model=16 -type=RBBL"
  107.      bootoutput="pp5022.mi4"
  108.      # toolset is the tools within the tools directory that we build for
  109.      # this particular target.
  110. @@ -1239,32 +1265,6 @@
  111.      t_model="sansa-e200"
  112.      ;;
  113.  
  114. -   15|h10_5gb)
  115. -    target_id=24
  116. -    archos="h10_5gb"
  117. -    target="-DIRIVER_H10_5GB"
  118. -    memory=32 # always
  119. -    arm7tdmicc
  120. -    tool="$rootdir/tools/scramble -add=h10_5gb"
  121. -    bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  122. -    bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
  123. -    output="rockbox.h10"
  124. -    appextra="recorder:gui"
  125. -    archosrom=""
  126. -    flash=""
  127. -    plugins="yes"
  128. -    codecs="libmad liba52 libffmpegFLAC libTremor libwavpack libmusepack libalac libfaad libm4a  libspeex"
  129. -    boottool="$rootdir/tools/scramble -mi4v2"
  130. -    bootoutput="H10.mi4"
  131. -    # toolset is the tools within the tools directory that we build for
  132. -    # this particular target.
  133. -    toolset="$genericbitmaptools scramble"
  134. -    # architecture, manufacturer and model for the target-tree build
  135. -    t_cpu="arm"
  136. -    t_manufacturer="iriver"
  137. -    t_model="h10"
  138. -    ;;
  139. -
  140.     60|tpj1022)
  141.      target_id=25
  142.      archos="tpj1022"
  143. Index: tools/scramble.c
  144. ===================================================================
  145. --- tools/scramble.c    (revision 12755)
  146. +++ tools/scramble.c    (working copy)
  147. @@ -89,6 +89,10 @@
  148.             "\t-mi4v2  PortalPlayer .mi4 format (revision 010201)\n"
  149.             "\t-mi4v3  PortalPlayer .mi4 format (revision 010301)\n"
  150.             "\t-mi4r   Sandisk Rhapsody .mi4 format\n"
  151. +           "\t        All mi4 options take two optional arguments:\n"
  152. +           "\t        -model=XX     where XX is the model number\n"
  153. +           "\t        -type=XXXX    where XXXX is a string indicating the \n"
  154. +           "\t                      type of binary, eg. RBOS, RBBL\n"
  155.             "\t-add=X  Rockbox generic \"add-up\" checksum format\n"
  156.             "\t        (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n"
  157.             "\t                   ip3g, ip4g, mini, iax5, h10, h10_5gb, tpj2, e200)\n"
  158. @@ -266,21 +270,46 @@
  159.          oname = argv[3];
  160.          return ipod_encode(iname, oname, 3, true);  /* Firmware image v3 */
  161.      }
  162. -    else if(!strcmp(argv[1], "-mi4v2")) {
  163. +    else if(!strncmp(argv[1], "-mi4", 4)) {
  164. +        int mi4magic;
  165. +        int version;
  166. +        int model = 0;
  167. +        char type[4] = "";
  168. +       
  169. +        if(!strcmp(&argv[1][4], "v2")) {
  170. +            mi4magic = MI4_MAGIC_DEFAULT;
  171. +            version = 0x00010201;
  172. +        }
  173. +        else if(!strcmp(&argv[1][4], "v3")) {
  174. +            mi4magic = MI4_MAGIC_DEFAULT;
  175. +            version = 0x00010301;
  176. +        }
  177. +        else if(!strcmp(&argv[1][4], "r")) {
  178. +            mi4magic = MI4_MAGIC_R;
  179. +            version = 0x00010301;
  180. +        }
  181. +        else {
  182. +            printf( "Invalid mi4 version: %s\n", &argv[1][4]);
  183. +            return -1;
  184. +        }
  185. +
  186.          iname = argv[2];
  187.          oname = argv[3];
  188. -        return mi4_encode(iname, oname, 0x00010201, MI4_MAGIC_DEFAULT);
  189. +       
  190. +        if(!strncmp(argv[2], "-model=", 7)) {
  191. +            iname = argv[3];
  192. +            oname = argv[4];
  193. +            model = atoi(&argv[2][7]);
  194. +           
  195. +            if(!strncmp(argv[3], "-type=", 6)) {
  196. +                iname = argv[4];
  197. +                oname = argv[5];
  198. +                strncpy(type, &argv[3][6], 4);
  199. +            }
  200. +        }
  201. +
  202. +        return mi4_encode(iname, oname, version, mi4magic, model, type);
  203.      }
  204. -    else if(!strcmp(argv[1], "-mi4v3")) {
  205. -        iname = argv[2];
  206. -        oname = argv[3];
  207. -        return mi4_encode(iname, oname, 0x00010301, MI4_MAGIC_DEFAULT);
  208. -    }
  209. -    else if(!strcmp(argv[1], "-mi4r")) {
  210. -        iname = argv[2];
  211. -        oname = argv[3];
  212. -        return mi4_encode(iname, oname, 0x00010301, MI4_MAGIC_R);
  213. -    }
  214.      
  215.      /* open file */
  216.      file = fopen(iname,"rb");
  217. Index: tools/mi4.c
  218. ===================================================================
  219. --- tools/mi4.c (revision 12755)
  220. +++ tools/mi4.c (working copy)
  221. @@ -102,7 +102,8 @@
  222.      addr[3] = (val >> 24) & 0xff;
  223.  }
  224.  
  225. -int mi4_encode(char *iname, char *oname, int version, int magic)
  226. +int mi4_encode(char *iname, char *oname, int version, int magic,
  227. +                char model, char *type)
  228.  {
  229.      size_t len;
  230.      int length;
  231. @@ -150,6 +151,9 @@
  232.      int2le(length+4,     &outbuf[0x2e8]);   /* length plus 0xaa55aa55 */
  233.  
  234.      int2le(0xaa55aa55,   &outbuf[0x200+length]);  /* More Magic */
  235. +   
  236. +    strncpy((char *)outbuf+0x1f8, type, 4);    /* type of binary - RBBL, RBOS, ... */
  237. +    outbuf[0x1fc] = model;              /* model - used by Rockbox */
  238.  
  239.      /* Calculate CRC32 checksum */
  240.      chksum_crc32gentab ();

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right