From: <ny...@us...> - 2007-01-10 15:49:27
|
Revision: 257 http://svn.sourceforge.net/pmplib/?rev=257&view=rev Author: nyaochi Date: 2007-01-10 07:49:27 -0800 (Wed, 10 Jan 2007) Log Message: ----------- - Update some comments for PortalPlayer firmware images. - Implement the automatic model detection for MSI MEGA PLAYER 540. Modified Paths: -------------- trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c Modified: trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-01-10 15:21:11 UTC (rev 256) +++ trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-01-10 15:49:27 UTC (rev 257) @@ -181,6 +181,8 @@ int iriver_h10_parse_model(const ucs2char_t* firmware, pp1model_t* model) { /* + iriver H10 5GB (UMS) 2.53 + ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF ------------------------------------------------------------------------------ 00000200 DD 03 00 EA CA 03 00 EA 0E F0 B0 E1 CE 03 00 EA ................ Modified: trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2007-01-10 15:21:11 UTC (rev 256) +++ trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2007-01-10 15:49:27 UTC (rev 257) @@ -161,6 +161,28 @@ int medion_mdjuke220_parse_model(const ucs2char_t* firmware, pp1model_t* model) { + /* + Medion MDJUKE 220 1.4.2 + + ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF + ------------------------------------------------------------------------------ + 00000200 88 05 00 EA 75 05 00 EA 0E F0 B0 E1 79 05 00 EA ....u.......y... + 00000210 7E 05 00 EA FE FF FF EA 66 05 00 EA 5C 05 00 EA ~.......f...\... + 00000220 70 6F 72 74 61 6C 70 6C 61 79 65 72 00 30 2E 30 portalplayer.0.0 + 00000230 C0 00 22 59 4C 00 CA 43 00 00 00 00 00 00 00 00 .."YL..C........ + 00000240 50 50 35 30 32 30 41 46 2D 30 35 2E 31 31 2D 50 PP5020AF-05.11-P + 00000250 50 30 37 2D 30 35 2E 31 31 2D 4D 47 30 31 2D 30 P07-05.11-MG01-0 + 00000260 31 2E 30 30 2D 44 54 00 4D 44 4A 55 4B 45 32 31 1.00-DT.MDJUKE21 + 00000270 35 2F 32 32 30 00 00 00 31 2E 34 2E 32 00 00 00 5/220...1.4.2... + 00000280 44 69 67 69 74 61 6C 20 4D 65 64 69 61 20 50 6C Digital Media Pl + 00000290 61 74 66 6F 72 6D 00 00 43 6F 70 79 72 69 67 68 atform..Copyrigh + 000002A0 74 28 63 29 20 31 39 39 39 20 2D 20 32 30 30 33 t(c) 1999 - 2003 + 000002B0 20 50 6F 72 74 61 6C 50 6C 61 79 65 72 2C 20 49 PortalPlayer, I + 000002C0 6E 63 2E 20 20 41 6C 6C 20 72 69 67 68 74 73 20 nc. All rights + 000002D0 72 65 73 65 72 76 65 64 2E 00 00 00 00 00 00 00 reserved........ + 000002E0 00 01 00 00 EC 00 00 00 4C 59 22 00 80 10 A0 E1 ........LY"..... + 000002F0 80 04 A0 E1 A0 08 B0 E1 7D 20 E0 E3 21 2C 82 E0 ........} ..!,.. + */ FILE *fp = ucs2fopen(firmware, "rb"); if (fp) { char line[0x81], *p = NULL, *q = NULL, *e = line + 0x80; Modified: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-01-10 15:21:11 UTC (rev 256) +++ trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-01-10 15:49:27 UTC (rev 257) @@ -155,6 +155,8 @@ int megaplayer_parse_model(const ucs2char_t* firmware, pp1model_t* model) { /* + MSI MEGA PLAYER 540 01.00.16 + ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF ------------------------------------------------------------------------------ 00000200 27 04 00 EA 14 04 00 EA 0E F0 B0 E1 18 04 00 EA '............... @@ -176,17 +178,17 @@ */ FILE *fp = ucs2fopen(firmware, "rb"); if (fp) { - char line[33], *p = NULL, *q = NULL; - memset(line, 0, sizeof(line)); + char buff[129], *p = NULL, *q = NULL; + memset(buff, 0, sizeof(buff)); // Seek to the firmware information. - if (fseek(fp, 0x0220, SEEK_SET) != 0) { + if (fseek(fp, 0x0240, SEEK_SET) != 0) { fclose(fp); return 0; } // Read the firmware information. - if (fread(line, sizeof(char), 32, fp) != 32) { + if (fread(buff, sizeof(char), 128, fp) != 128) { fclose(fp); return 0; } @@ -194,30 +196,16 @@ // Close the firmware. fclose(fp); - // Obtain the model name. - strcpy(model->name, "Samsung "); - strcat(model->name, line); - p = line + strlen(line) + 1; - - // Obtain firmware version. - q = strchr(p, ' '); - if (q) { - *q = 0; - } else { + // Match the identifier string. + if (strncmp(buff, "PP5020AF-05.22-PP07-05.22-MN05-", 31) != 0) { return 0; } - strcpy(model->version, p); - p = q+1; - - // Obtain the country code? - q = strchr(p, 0xC0); - if (q) { - *q = 0; - } else { - return 0; - } - strcpy(model->language, p); + // Obtain the model name. + strcpy(model->name, "MSI MEGA PLAYER 540"); + memset(model->version, 0, sizeof(model->version)); + strncpy(model->version, buff+0x1F, 8); + strcpy(model->language, ""); strcpy(model->mode, "UM"); return 1; Modified: trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c 2007-01-10 15:21:11 UTC (rev 256) +++ trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c 2007-01-10 15:49:27 UTC (rev 257) @@ -166,6 +166,28 @@ int samsung_parse_model(const ucs2char_t* firmware, pp1model_t* model) { + /* + Samsung YH-925 1.61 + + ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF + ------------------------------------------------------------------------------ + 00000200 EB 03 00 EA D8 03 00 EA 0E F0 B0 E1 DC 03 00 EA ................ + 00000210 E1 03 00 EA FE FF FF EA C9 03 00 EA BF 03 00 EA ................ + 00000220 59 48 2D 39 32 35 00 31 2E 36 31 20 43 41 C0 00 YH-925.1.61 CA.. + 00000230 00 00 32 2C C4 00 07 BA 00 00 00 00 00 00 00 00 ..2,............ + 00000240 50 50 35 30 32 30 41 46 2D 30 35 2E 31 31 2D 53 PP5020AF-05.11-S + 00000250 4D 30 35 2D 30 32 2E 31 33 2D 47 53 30 31 2D 30 M05-02.13-GS01-0 + 00000260 31 2E 30 30 2D 44 54 00 32 30 30 34 2E 31 31 2E 1.00-DT.2004.11. + 00000270 32 32 00 00 28 42 75 69 6C 64 20 33 38 29 00 00 22..(Build 38).. + 00000280 44 69 67 69 74 61 6C 20 4D 65 64 69 61 20 50 6C Digital Media Pl + 00000290 61 74 66 6F 72 6D 00 00 43 6F 70 79 72 69 67 68 atform..Copyrigh + 000002A0 74 28 63 29 20 31 39 39 39 20 2D 20 32 30 30 33 t(c) 1999 - 2003 + 000002B0 20 50 6F 72 74 61 6C 50 6C 61 79 65 72 2C 20 49 PortalPlayer, I + 000002C0 6E 63 2E 20 20 41 6C 6C 20 72 69 67 68 74 73 20 nc. All rights + 000002D0 72 65 73 65 72 76 65 64 2E 00 00 00 00 00 00 00 reserved........ + 000002E0 00 01 00 00 EC 00 00 00 C4 2C 32 00 00 10 A0 E1 .........,2..... + 000002F0 40 25 A0 E3 00 20 81 E5 01 00 A0 E3 0E F0 A0 E1 @%... .......... + */ FILE *fp = ucs2fopen(firmware, "rb"); if (fp) { char line[33], *p = NULL, *q = NULL; @@ -209,7 +231,6 @@ return 0; } strcpy(model->language, p); - strcpy(model->mode, "UM"); return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |