From: <ny...@us...> - 2006-08-02 17:59:44
|
Revision: 177 Author: nyaochi Date: 2006-08-02 10:59:32 -0700 (Wed, 02 Aug 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=177&view=rev Log Message: ----------- Initial attempt to support Philips HDD6320 player. Modified Paths: -------------- trunk/pmplib/lib/pmp_portalplayer1/Makefile.am trunk/pmplib/lib/pmp_portalplayer1/field_descriptor.c trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj Added Paths: ----------- trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c Modified: trunk/pmplib/lib/pmp_portalplayer1/Makefile.am =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/Makefile.am 2006-08-01 07:13:03 UTC (rev 176) +++ trunk/pmplib/lib/pmp_portalplayer1/Makefile.am 2006-08-02 17:59:32 UTC (rev 177) @@ -25,6 +25,7 @@ model_medion_mdjuke440.c \ model_sirius_s50.c \ model_samsung.c \ + model_philips_hdd6320.c \ pmp_portalplayer1.c portalplayer1_la_LDFLAGS = \ Modified: trunk/pmplib/lib/pmp_portalplayer1/field_descriptor.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/field_descriptor.c 2006-08-01 07:13:03 UTC (rev 176) +++ trunk/pmplib/lib/pmp_portalplayer1/field_descriptor.c 2006-08-02 17:59:32 UTC (rev 177) @@ -73,7 +73,7 @@ fprintf(fp, "%d, ", fd->has_index); fprintf(fp, "%d, ", fd->unknown6); fprintf(fp, "%d, ", fd->unknown7); - fprints(fp, "L\"%s\"", fd->index_pathname); + fprints(fp, "\"%s\"", fd->index_pathname); fprintf(fp, "}"); } Modified: trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h 2006-08-01 07:13:03 UTC (rev 176) +++ trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h 2006-08-02 17:59:32 UTC (rev 177) @@ -70,9 +70,11 @@ int hdr_init_samsung_yh920(hdr_t* hdr); int hdr_init_samsung_yh925(hdr_t* hdr); int hdr_init_sirius_s50(hdr_t* hdr); +int hdr_init_philips_hdd6320(hdr_t* hdr); int iriver_h10_parse_model(const ucs2char_t* firmware, pp1model_t* model); int medion_mdjuke220_parse_model(const ucs2char_t* firmware, pp1model_t* model); int samsung_parse_model(const ucs2char_t* firmware, pp1model_t* model); +int philips_hdd6320_parse_model(const ucs2char_t* firmware, pp1model_t* model); #endif/*__HDR_TEMPLATE_H__*/ Added: trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c (rev 0) +++ trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c 2006-08-02 17:59:32 UTC (rev 177) @@ -0,0 +1,254 @@ +/* + * Philips HDD6320 specific routines and header templates. + * + * Copyright (c) 2005-2006 Nyaochi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ + +#include <os.h> +#include <stdio.h> +#include <stdlib.h> +#include <ucs2char.h> +#include <filepath.h> + +#include "serialize.h" +#include "util.h" +#include "pp1db.h" +#include "hdr_template.h" + +enum { + PP1DB_DATFIELD_UNKNOWN2 = 0,// @0: (INT) + PP1DB_DATFIELD_PATHNAME, // @1: (STR) + PP1DB_DATFIELD_FILENAME, // @2: (STR) + PP1DB_DATFIELD_FORMAT, // @3: (INT) + PP1DB_DATFIELD_ARTIST, // @4: (STR) + PP1DB_DATFIELD_ALBUM, // @5: (STR) + PP1DB_DATFIELD_GENRE, // @6: (STR) + PP1DB_DATFIELD_TITLE, // @7: (STR) + PP1DB_DATFIELD_TRACKNUMBER, // @8: (INT) + PP1DB_DATFIELD_COMPOSER, // @9: (STR) + PP1DB_DATFIELD_UNKNOWN3, // @10: (INT) + PP1DB_DATFIELD_UNKNOWN4, // @11: (STR) + PP1DB_DATFIELD_UNKNOWN5, // @12: (STR) + PP1DB_DATFIELD_UNKNOWN6, // @13: (STR) + PP1DB_DATFIELD_UNKNOWN7, // @14: (INT) + PP1DB_DATFIELD_UNKNOWN8, // @15: (STR) + PP1DB_DATFIELD_UNKNOWN9, // @16: (STR) +}; + +static void philips_hdd6320_dat_repr(const dat_t* record, FILE *fp) +{ + fprintf(fp, " inactive: %d\n", record->status); + fprintf(fp, " unknown1: %d\n", record->unknown1); + fprintf(fp, " unknown2: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN2].value.dword); + fprints(fp, " file_path: %s\n", record->fields[PP1DB_DATFIELD_PATHNAME].value.str); + fprints(fp, " file_name: %s\n", record->fields[PP1DB_DATFIELD_FILENAME].value.str); + fprintf(fp, " media_type: %d\n", record->fields[PP1DB_DATFIELD_FORMAT].value.dword); + fprints(fp, " artist: %s\n", record->fields[PP1DB_DATFIELD_ARTIST].value.str); + fprints(fp, " album: %s\n", record->fields[PP1DB_DATFIELD_ALBUM].value.str); + fprints(fp, " genre: %s\n", record->fields[PP1DB_DATFIELD_GENRE].value.str); + fprints(fp, " title: %s\n", record->fields[PP1DB_DATFIELD_TITLE].value.str); + fprintf(fp, " number: %d\n", record->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword); + fprints(fp, " composer: %s\n", record->fields[PP1DB_DATFIELD_COMPOSER].value.str); + fprintf(fp, " unknown3: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN3].value.dword); + fprintf(fp, " unknown4: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN4].value.dword); + fprintf(fp, " unknown5: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN5].value.dword); + fprintf(fp, " unknown6: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword); + fprintf(fp, " unknown7: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN7].value.dword); + fprintf(fp, " unknown8: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN8].value.dword); + fprintf(fp, " unknown9: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN9].value.dword); +} + +static int philips_hdd6320_dat_set(dat_t* dst, const pmp_record_t* src, const ucs2char_t* path_to_root) +{ + static const ucs2char_t ucs2cs_unknown[] = {0}; + static const ucs2char_t ucs2cs_empty[] = {0}; + + // Set fields. + dst->status = 0; + dst->unknown1 = 0; + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; + dst->fields[PP1DB_DATFIELD_COMPOSER].value.str = ucs2dup(src->composer ? src->composer : ucs2cs_unknown); + + dst->fields[PP1DB_DATFIELD_UNKNOWN3].value.dword = 0; + dst->fields[PP1DB_DATFIELD_UNKNOWN4].value.dword = 0; + dst->fields[PP1DB_DATFIELD_UNKNOWN5].value.dword = 0; + dst->fields[PP1DB_DATFIELD_UNKNOWN6].value.dword = 0; + dst->fields[PP1DB_DATFIELD_UNKNOWN7].value.dword = 0; + dst->fields[PP1DB_DATFIELD_UNKNOWN8].value.dword = 0; + dst->fields[PP1DB_DATFIELD_UNKNOWN9].value.dword = 0; + return 0; +} + +static int philips_hdd6320_dat_get(pmp_record_t* dst, const dat_t* src, const ucs2char_t* path_to_root) +{ + static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; + static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; + static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + size_t length = 0; + + memset(dst, 0, sizeof(*dst)); + + length = ucs2len(path_to_root); + length += ucs2len(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); + length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); + length += 3; + + dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); + if (dst->filename) { + filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_addslash(dst->filename); + ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + } + + dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); + dst->album = ucs2dup(src->fields[PP1DB_DATFIELD_ALBUM].value.str); + dst->genre = ucs2dup(src->fields[PP1DB_DATFIELD_GENRE].value.str); + dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); + dst->track_number = src->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword; + dst->composer = ucs2dup(src->fields[PP1DB_DATFIELD_COMPOSER].value.str); + + // Set codec information according to the file extensions. + if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + dst->codec = PMPCODEC_MPEGLAYER3; + } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + dst->codec = PMPCODEC_WMA; + } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + dst->codec = PMPCODEC_WAV; + } + + return 0; +} + +int philips_hdd6320_parse_model(const ucs2char_t* firmware, pp1model_t* model) +{ + /* + Firmware dump (FWImage.DMP) + ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF + ------------------------------------------------------------------------------ + 00000200 58 05 00 EA 45 05 00 EA 0E F0 B0 E1 49 05 00 EA X...E.......I... + 00000210 4E 05 00 EA FE FF FF EA 36 05 00 EA 2C 05 00 EA N.......6...,... + 00000220 70 6F 72 74 61 6C 70 6C 61 79 65 72 00 30 2E 30 portalplayer.0.0 + 00000230 C0 00 65 D0 94 00 5E F6 00 00 00 00 00 00 00 00 ..e...^......... + 00000240 50 50 35 30 32 32 41 46 2D 30 35 2E 34 30 2D 50 PP5022AF-05.40-P + 00000250 50 30 37 2D 30 35 2E 34 30 2D 4D 47 30 32 2D 30 P07-05.40-MG02-0 + 00000260 30 2E 30 31 2D 44 54 00 41 52 49 5A 4F 4E 41 00 0.01-DT.ARIZONA. + 00000270 32 2E 31 00 44 69 67 69 74 61 6C 20 4D 65 64 69 2.1.Digital Medi + 00000280 61 20 50 6C 61 74 66 6F 72 6D 00 00 43 6F 70 79 a Platform..Copy + 00000290 72 69 67 68 74 28 63 29 20 31 39 39 39 20 2D 20 right(c) 1999 - + 000002A0 32 30 30 33 20 50 6F 72 74 61 6C 50 6C 61 79 65 2003 PortalPlaye + 000002B0 72 2C 20 49 6E 63 2E 20 20 41 6C 6C 20 72 69 67 r, Inc. All rig + 000002C0 68 74 73 20 72 65 73 65 72 76 65 64 2E 00 00 00 hts reserved.... + 000002D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002E0 00 01 00 00 EC 00 00 00 94 D0 65 00 00 10 A0 E1 ..........e..... + 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[65], *p = NULL, *q = NULL; + memset(line, 0, sizeof(line)); + + // Seek to the firmware information. + if (fseek(fp, 0x0240, SEEK_SET) != 0) { + fclose(fp); + return 0; + } + + // Read the firmware information. + if (fread(line, sizeof(char), 64, fp) != 64) { + fclose(fp); + return 0; + } + + // Close the firmware. + fclose(fp); + + // Obtain the model name. + strcpy(model->name, "Philips HDD6320"); + strcpy(model->version, "05.40"); + strcpy(model->mode, "UM"); + return 1; + } else { + return 0; + } +} + + + + +static fd_template_t hdrtmpl_fd_philips_hdd6320[] = { + {0x0000F001, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP...@DE...X"}, + {0x0000F002, 1, 256, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_FPTH.IDX"}, + {0x0000F003, 1, 256, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_FNAM.IDX"}, + {0x0000F00A, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_FRMT.IDX"}, + {0x10B9003C, 1, 256, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_TPE1.IDX"}, + {0x2054001C, 1, 256, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_TALB.IDX"}, + {0x320A001F, 1, 256, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_TCON.IDX"}, + {0x0000002E, 1, 256, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_TIT2.IDX"}, + {0x00750043, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_TRCK.IDX"}, + {0x0000001E, 1, 64, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_TCOM.IDX"}, + {0x54430011, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_PCNT.IDX"}, + {0x061A005D, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_.IDX"}, + {0x0000008D, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_BUYF.IDX"}, + {0x0000008E, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP5000_MODF.IDX"}, + {0x8000008F, 2, 4, 0, 0, 0, 0, 0, ""}, + {0x0000E000, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP...@DU...X"}, + {0x0004E001, 2, 4, 0, 0, 1, 0, 0, "SYSTEM\\DATA\\PP...@DU...X"}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, +}; + +static uint32_t hdrtmpl_max_dat_field_size_philips_hdd6320[] = + {8, 12, 524, 1036, 1040, 1552, 2064, 2576, 3088, 3092, 3220, 3224, 3228, 3232, 3236, 3240, 3244, 0, 0, 0, 0, 0}; + + +/********** Philips HDD6320 firmware x.xx **********/ +static hdr_template_t hdrtmpl_philips_hdd6320 = { + 0, 0, "System\\DATA\\PP5000.DAT", 1, "System\\DATA\\PP5000.HDR", 0x00000CB0, 0, 0, 17, + hdrtmpl_fd_philips_hdd6320, + hdrtmpl_max_dat_field_size_philips_hdd6320, + 0, 1, + {589120, 22, 12000, 0, 1, philips_hdd6320_dat_repr, philips_hdd6320_dat_set, philips_hdd6320_dat_get}, +}; + +int hdr_init_philips_hdd6320(hdr_t* hdr) +{ + return apply_template(hdr, &hdrtmpl_philips_hdd6320); +} Property changes on: trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-08-01 07:13:03 UTC (rev 176) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-08-02 17:59:32 UTC (rev 177) @@ -167,6 +167,14 @@ ".plp", hdr_init_samsung_yh925, samsung_parse_model }, + { + "philips_hdd6320", "Philips HDD6320", + 20, "UM", + "5.40", "5.40", + "SYSTEM\\FWImage.ebn", "System\\DATA\\PP5000.HDR", "Music\\", "Playlists\\", + ".pla", + hdr_init_philips_hdd6320, philips_hdd6320_parse_model + }, #if 0 { "sirius_s50", "Sirius S50", Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj 2006-08-01 07:13:03 UTC (rev 176) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj 2006-08-02 17:59:32 UTC (rev 177) @@ -144,6 +144,9 @@ RelativePath=".\model_medion_mdjuke440.c"> </File> <File + RelativePath=".\model_philips_hdd6320.c"> + </File> + <File RelativePath=".\model_samsung.c"> </File> <File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-01-10 15:10:03
|
Revision: 253 http://svn.sourceforge.net/pmplib/?rev=253&view=rev Author: nyaochi Date: 2007-01-10 07:09:58 -0800 (Wed, 10 Jan 2007) Log Message: ----------- MSI Mega Player 540 support. Modified Paths: -------------- trunk/pmplib/lib/pmp_portalplayer1/hdr.c trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj Added Paths: ----------- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c Modified: trunk/pmplib/lib/pmp_portalplayer1/hdr.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/hdr.c 2007-01-08 09:01:37 UTC (rev 252) +++ trunk/pmplib/lib/pmp_portalplayer1/hdr.c 2007-01-10 15:09:58 UTC (rev 253) @@ -65,7 +65,6 @@ for (i = 0;i < hdr->param.max_fields;i++) { p += field_descriptor_serialize(p, &hdr->fd[i], is_storing); } - for (i = 0;i < hdr->param.padding_size;i++) { uint8_t c = 0; p += serialize_uint8(p, &c, is_storing); Modified: trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h 2007-01-08 09:01:37 UTC (rev 252) +++ trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h 2007-01-10 15:09:58 UTC (rev 253) @@ -71,10 +71,12 @@ int hdr_init_samsung_yh925(hdr_t* hdr); int hdr_init_sirius_s50(hdr_t* hdr); int hdr_init_philips_hdd6320(hdr_t* hdr); +int hdr_init_msi_megaplayer540(hdr_t* hdr); int iriver_h10_parse_model(const ucs2char_t* firmware, pp1model_t* model); int medion_mdjuke220_parse_model(const ucs2char_t* firmware, pp1model_t* model); int samsung_parse_model(const ucs2char_t* firmware, pp1model_t* model); int philips_hdd6320_parse_model(const ucs2char_t* firmware, pp1model_t* model); +int megaplayer_parse_model(const ucs2char_t* firmware, pp1model_t* model); #endif/*__HDR_TEMPLATE_H__*/ Added: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c (rev 0) +++ trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-01-10 15:09:58 UTC (rev 253) @@ -0,0 +1,251 @@ +/* + * MSI Megaplayer specific routines and header templates. + * + * Copyright (c) 2005-2007 Nyaochi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ + +#include <os.h> +#include <stdio.h> +#include <stdlib.h> +#include <ucs2char.h> +#include <filepath.h> + +#include "serialize.h" +#include "util.h" +#include "pp1db.h" +#include "hdr_template.h" + +enum { + PP1DB_DATFIELD_UNKNOWN2 = 0,// @0: (INT) + PP1DB_DATFIELD_PATHNAME, // @1: (STR) + PP1DB_DATFIELD_FILENAME, // @2: (STR) + PP1DB_DATFIELD_FORMAT, // @3: (INT) + PP1DB_DATFIELD_BITRATE, // @4: (INT) + PP1DB_DATFIELD_SAMPLERATE, // @5: (INT) + PP1DB_DATFIELD_DURATION, // @6: (INT) + PP1DB_DATFIELD_ARTIST, // @7: (STR) + PP1DB_DATFIELD_ALBUM, // @8: (STR) + PP1DB_DATFIELD_GENRE, // @9: (STR) + PP1DB_DATFIELD_TITLE, // @10: (STR) + PP1DB_DATFIELD_TRACKNUMBER, // @11: (INT) + PP1DB_DATFIELD_YEAR, // @12: (INT) + PP1DB_DATFIELD_FILESIZE, // @13: (INT) +}; + +static void dat_repr(const dat_t* record, FILE *fp) +{ + fprintf(fp, " inactive: %d\n", record->status); + fprintf(fp, " unknown1: %d\n", record->unknown1); + fprintf(fp, " unknown2: %d\n", record->fields[PP1DB_DATFIELD_UNKNOWN2].value.dword); + fprints(fp, " file_path: %s\n", record->fields[PP1DB_DATFIELD_PATHNAME].value.str); + fprints(fp, " file_name: %s\n", record->fields[PP1DB_DATFIELD_FILENAME].value.str); + fprintf(fp, " media_type: %d\n", record->fields[PP1DB_DATFIELD_FORMAT].value.dword); + fprintf(fp, " bitrate: %d\n", record->fields[PP1DB_DATFIELD_BITRATE].value.dword); + fprintf(fp, " samplerate: %d\n", record->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword); + fprintf(fp, " duration: %d\n", record->fields[PP1DB_DATFIELD_DURATION].value.dword); + fprints(fp, " artist: %s\n", record->fields[PP1DB_DATFIELD_ARTIST].value.str); + fprints(fp, " album: %s\n", record->fields[PP1DB_DATFIELD_ALBUM].value.str); + fprints(fp, " genre: %s\n", record->fields[PP1DB_DATFIELD_GENRE].value.str); + fprints(fp, " title: %s\n", record->fields[PP1DB_DATFIELD_TITLE].value.str); + fprintf(fp, " number: %d\n", record->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword); + fprintf(fp, " year: %d\n", record->fields[PP1DB_DATFIELD_YEAR].value.dword); + fprintf(fp, " filesize: %d\n", record->fields[PP1DB_DATFIELD_FILESIZE].value.dword); +} + +static int dat_set(dat_t* dst, const pmp_music_record_t* src, const ucs2char_t* path_to_root) +{ + static const ucs2char_t ucs2cs_unknown[] = {0}; + static const ucs2char_t ucs2cs_empty[] = {0}; + + // Set fields. + dst->status = 0; + dst->unknown1 = 0; + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; + dst->fields[PP1DB_DATFIELD_BITRATE].value.dword = src->bitrate; + dst->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword = src->sample_rate; + dst->fields[PP1DB_DATFIELD_DURATION].value.dword = src->duration; + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; + if (src->date) { + dst->fields[PP1DB_DATFIELD_YEAR].value.dword = ucs2toi(src->date); + } + dst->fields[PP1DB_DATFIELD_FILESIZE].value.dword = src->filesize; + return 0; +} + +static int dat_get(pmp_music_record_t* dst, const dat_t* src, const ucs2char_t* path_to_root) +{ + static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; + static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; + static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + ucs2char_t tmp[128]; + size_t length = 0; + + length = ucs2len(path_to_root); + length += ucs2len(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); + length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); + length += 3; + + dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); + if (dst->filename) { + filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_addslash(dst->filename); + ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + } + + dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; + dst->sample_rate = src->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword; + dst->duration = src->fields[PP1DB_DATFIELD_DURATION].value.dword; + + dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); + dst->album = ucs2dup(src->fields[PP1DB_DATFIELD_ALBUM].value.str); + dst->genre = ucs2dup(src->fields[PP1DB_DATFIELD_GENRE].value.str); + dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); + + // Set codec information according to the file extensions. + if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + dst->codec = PMPCODEC_MPEGLAYER3; + } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + dst->codec = PMPCODEC_WMA; + } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + dst->codec = PMPCODEC_WAV; + } + + dst->track_number = src->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword; + itoucs2(src->fields[PP1DB_DATFIELD_YEAR].value.dword, tmp, 10); + dst->date = ucs2dup(tmp); + dst->filesize = src->fields[PP1DB_DATFIELD_FILESIZE].value.dword; + //dst->ts_update = src->fields[PP1DB_DATFIELD_UNKNOWN4].value.dword; + + return 0; +} + +int megaplayer_parse_model(const ucs2char_t* firmware, pp1model_t* model) +{ + FILE *fp = ucs2fopen(firmware, "rb"); + if (fp) { + char line[33], *p = NULL, *q = NULL; + memset(line, 0, sizeof(line)); + + // Seek to the firmware information. + if (fseek(fp, 0x0220, SEEK_SET) != 0) { + fclose(fp); + return 0; + } + + // Read the firmware information. + if (fread(line, sizeof(char), 32, fp) != 32) { + fclose(fp); + return 0; + } + + // 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 { + 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); + + strcpy(model->mode, "UM"); + + return 1; + } else { + return 0; + } +} + + + + +static fd_template_t hdrtmpl_fd_megaplayer540[] = { + {0x0000F001, 2, 4, 0, 0, 1, 0, 0, "System\\DATA\\PP...@DE...x"}, + {0x0000F002, 1, 128, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_FPTH.idx"}, + {0x0000F003, 1, 128, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_FNAM.idx"}, + {0x0000F00A, 2, 4, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_FRMT.idx"}, + {0x0000F005, 2, 4, 0, 0, 0, 0, 0, ""}, + {0x0000F006, 2, 4, 0, 0, 0, 0, 0, ""}, + {0x0000F007, 1, 4, 0, 0, 0, 0, 0, ""}, + {0x0000003C, 1, 256, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_TPE1.idx"}, + {0x0000001C, 1, 256, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_TALB.idx"}, + {0x0000001F, 1, 256, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_TCON.idx"}, + {0x0000002E, 1, 256, 0, 0, 1, 0, 0, "System\\DATA\\PP5000_TIT2.idx"}, + {0x00000043, 2, 4, 0, 0, 0, 0, 0, ""}, + {0x0000004E, 2, 4, 0, 0, 0, 0, 0, ""}, + {0x0000F009, 2, 4, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, + {0x00000000, 0, 0, 0, 0, 0, 0, 0, ""}, +}; + +static uint32_t hdrtmpl_max_dat_field_size_megaplayer540[] = + {8, 12, 268, 524, 528, 532, 536, 544, 1056, 1568, 2080, 2592, 2596, 2600, 0, 0, 0, 0, 0, 0}; + + +/********** MSI Megaplayer 540 **********/ +static hdr_template_t hdrtmpl_megaplayer540 = { + 0, 0, "System\\DATA\\PP5000.DAT", 0, "System\\DATA\\PP5000.HDR", 0x00000A2C, 0, 0, 14, + hdrtmpl_fd_megaplayer540, + hdrtmpl_max_dat_field_size_megaplayer540, + 0, 0, + {100020, 20, 2000, 0, 0, dat_repr, dat_set, dat_get}, +}; + +int hdr_init_msi_megaplayer540(hdr_t* hdr) +{ + return apply_template(hdr, &hdrtmpl_megaplayer540); +} Property changes on: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-08 09:01:37 UTC (rev 252) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-10 15:09:58 UTC (rev 253) @@ -174,6 +174,14 @@ ".pla", hdr_init_philips_hdd6320, philips_hdd6320_parse_model }, + { + "msi_megaplayer540", "MSI Megaplayer 540", + 8, "UM", + "5.40", "5.40", + "SYSTEM\\PP5020.mi4", "System\\DATA\\PP5000.HDR", "Music\\", "Playlists\\", + ".pla", + hdr_init_msi_megaplayer540, megaplayer_parse_model + }, #if 0 { "sirius_s50", "Sirius S50", Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj 2007-01-08 09:01:37 UTC (rev 252) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.vcproj 2007-01-10 15:09:58 UTC (rev 253) @@ -218,6 +218,10 @@ > </File> <File + RelativePath=".\model_msi_megaplayer.c" + > + </File> + <File RelativePath=".\model_philips_hdd6320.c" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-01-10 15:18:01
|
Revision: 254 http://svn.sourceforge.net/pmplib/?rev=254&view=rev Author: nyaochi Date: 2007-01-10 07:17:58 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Fixed some spellings. Modified Paths: -------------- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c Modified: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-01-10 15:09:58 UTC (rev 253) +++ trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-01-10 15:17:58 UTC (rev 254) @@ -1,5 +1,5 @@ /* - * MSI Megaplayer specific routines and header templates. + * MSI MEGA PLAYER specific routines and header templates. * * Copyright (c) 2005-2007 Nyaochi * @@ -236,7 +236,7 @@ {8, 12, 268, 524, 528, 532, 536, 544, 1056, 1568, 2080, 2592, 2596, 2600, 0, 0, 0, 0, 0, 0}; -/********** MSI Megaplayer 540 **********/ +/********** MSI MEGA PLAYER 540 **********/ static hdr_template_t hdrtmpl_megaplayer540 = { 0, 0, "System\\DATA\\PP5000.DAT", 0, "System\\DATA\\PP5000.HDR", 0x00000A2C, 0, 0, 14, hdrtmpl_fd_megaplayer540, Modified: trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-10 15:09:58 UTC (rev 253) +++ trunk/pmplib/lib/pmp_portalplayer1/pmp_portalplayer1.c 2007-01-10 15:17:58 UTC (rev 254) @@ -175,10 +175,10 @@ hdr_init_philips_hdd6320, philips_hdd6320_parse_model }, { - "msi_megaplayer540", "MSI Megaplayer 540", + "msi_megaplayer540", "MSI MEGA PLAYER 540", 8, "UM", - "5.40", "5.40", - "SYSTEM\\PP5020.mi4", "System\\DATA\\PP5000.HDR", "Music\\", "Playlists\\", + "01.00.16", "01.00.16", + "SYSTEM\\PP5020.mi4", "System\\DATA\\PP5000.HDR", "MUSIC\\", "Playlists\\", ".pla", hdr_init_msi_megaplayer540, megaplayer_parse_model }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ny...@us...> - 2007-01-27 09:10:54
|
Revision: 291 http://svn.sourceforge.net/pmplib/?rev=291&view=rev Author: nyaochi Date: 2007-01-27 01:10:52 -0800 (Sat, 27 Jan 2007) Log Message: ----------- Removed redundant compare_version() function in pmp_portalplayer1: http://nyaochi.sakura.ne.jp/pmplib/index.php?topic=210.msg910#msg910 Modified Paths: -------------- trunk/pmplib/lib/pmp_portalplayer1/hdr_template.c trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h Modified: trunk/pmplib/lib/pmp_portalplayer1/hdr_template.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/hdr_template.c 2007-01-27 09:03:05 UTC (rev 290) +++ trunk/pmplib/lib/pmp_portalplayer1/hdr_template.c 2007-01-27 09:10:52 UTC (rev 291) @@ -90,24 +90,3 @@ memset(hdr, 0, sizeof(*hdr)); return -1; } - -#define COMP(a, b) ((a)>(b))-((a)<(b)) - -int compare_version(const char *x, const char *y) -{ - char *p = NULL, *q = NULL; - - for (;;) { - long a = strtol(x, &p, 10); - long b = strtol(y, &q, 10); - int value = COMP(a, b); - if (value != 0) { - return value; - } - if (!*p || !*q || *p != *q) { - return COMP(*p, *q); - } - x = p+1; - y = q+1; - } -} Modified: trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h 2007-01-27 09:03:05 UTC (rev 290) +++ trunk/pmplib/lib/pmp_portalplayer1/hdr_template.h 2007-01-27 09:10:52 UTC (rev 291) @@ -57,7 +57,6 @@ } hdr_template_t; int apply_template(hdr_t* hdr, const hdr_template_t* tmpl); -int compare_version(const char *x, const char *y); int hdr_init_h10_5gb_ums_0205_0253(hdr_t* hdr); int hdr_init_h10_5gb_mtp_0203_0210(hdr_t* hdr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2007-02-11 18:11:47
|
Revision: 342 http://svn.sourceforge.net/pmplib/?rev=342&view=rev Author: nyaochi Date: 2007-02-11 10:11:43 -0800 (Sun, 11 Feb 2007) Log Message: ----------- Fixed a bug that EasyPMP always obtains the media information in PortalPlayer-based players even with -u option 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_medion_mdjuke440.c trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c Modified: trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_iriver_h10.c 2007-02-11 18:11:43 UTC (rev 342) @@ -145,8 +145,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2007-02-11 18:11:43 UTC (rev 342) @@ -128,8 +128,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; Modified: trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2007-02-11 18:11:43 UTC (rev 342) @@ -106,8 +106,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; Modified: trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_msi_megaplayer.c 2007-02-11 18:11:43 UTC (rev 342) @@ -123,8 +123,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; Modified: trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_philips_hdd6320.c 2007-02-11 18:11:43 UTC (rev 342) @@ -130,8 +130,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); Modified: trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_samsung.c 2007-02-11 18:11:43 UTC (rev 342) @@ -133,8 +133,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; Modified: trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c =================================================================== --- trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c 2007-02-11 17:51:07 UTC (rev 341) +++ trunk/pmplib/lib/pmp_portalplayer1/model_sirius_s50.c 2007-02-11 18:11:43 UTC (rev 342) @@ -151,8 +151,8 @@ dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); if (dst->filename) { filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); - filepath_addslash(dst->filename); ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + filepath_decode(dst->filename); } dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |