From 530f31dbe9fe404d41fd21867c8ed9cec1addd96 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Wed, 30 Aug 2006 23:17:04 +0000 Subject: Add generation of .mi4 files - the generic PortalPlayer firmware format used by the iriver H10, Sansa E200 etc. Based on the documentation available at http://daniel.haxx.se/sansa/mi4.html and examination of files produced by mkmi4.sh git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10816 a1c6a512-1295-4272-9138-f99709370657 --- tools/scramble.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools/scramble.c') diff --git a/tools/scramble.c b/tools/scramble.c index c3eb178..d1e3d1d 100644 --- a/tools/scramble.c +++ b/tools/scramble.c @@ -22,6 +22,7 @@ #include #include #include "iriver.h" +#include "mi4.h" int iaudio_encode(char *iname, char *oname, char *idstring); int ipod_encode(char *iname, char *oname, int fw_ver, bool fake_rsrc); @@ -82,6 +83,8 @@ void usage(void) "\t-ipod3g ipod firmware partition format (3rd Gen)\n" "\t-ipod4g ipod firmware partition format (4th Gen, Mini, Nano, Photo/Color)\n" "\t-ipod5g ipod firmware partition format (5th Gen - aka Video)\n" + "\t-mi4v2 PortalPlayer .mi4 format (revision 010201)\n" + "\t-mi4v3 PortalPlayer .mi4 format (revision 010301)\n" "\t-add=X Rockbox generic \"add-up\" checksum format\n" "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd\n" "\t ip3g, ip4g, mini, x5, h10, h10_5gb)\n" @@ -241,6 +244,16 @@ int main (int argc, char** argv) oname = argv[3]; return ipod_encode(iname, oname, 3, true); /* Firmware image v3 */ } + else if(!strcmp(argv[1], "-mi4v2")) { + iname = argv[2]; + oname = argv[3]; + return mi4_encode(iname, oname, 0x00010201); + } + else if(!strcmp(argv[1], "-mi4v3")) { + iname = argv[2]; + oname = argv[3]; + return mi4_encode(iname, oname, 0x00010301); + } /* open file */ file = fopen(iname,"rb"); -- cgit v1.1