A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Added H300 to the fwpatcher utility


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7969 a1c6a512-1295-4272-9138-f99709370657

+40 -11
+1 -1
tools/fwpatcher/Makefile
··· 44 44 $(TARGETU): $(OBJSU) 45 45 $(CC) $(LDFLAGS) $(OBJSU) -o $@ 46 46 47 - resource.o: resource.rc bootloader-h100.bin bootloader-h120.bin rockbox.ico 47 + resource.o: resource.rc bootloader-h100.bin bootloader-h120.bin bootloader-h300.bin rockbox.ico 48 48 $(WINDRES) -v $< $@ 49 49 50 50 iriveru.o: iriver.c iriver.h
+5
tools/fwpatcher/h300sums.h
··· 1 + /* Checksums of firmwares for ihp_300 */ 2 + /* order: unpatched, patched */ 3 + 4 + /* 1.28eu */ 5 + {"0b2083d37f24899b82d21a14d2b38060", "937c0a745227281da62e41da78efcfe8"},
+32 -10
tools/fwpatcher/main.c
··· 56 56 #include "h120sums.h" 57 57 }; 58 58 59 + /* precalculated checksums for H320/H340 */ 60 + static struct sumpairs h300pairs[] = { 61 + #include "h300sums.h" 62 + }; 63 + 59 64 HICON rbicon; 60 65 HFONT deffont; 61 66 HWND controls[CTL_NUM]; 62 67 63 68 /* begin mkboot.c excerpt */ 64 69 65 - unsigned char image[0x200000 + 0x220 + 0x200000/0x200]; 70 + unsigned char image[0x400000 + 0x220 + 0x400000/0x200]; 66 71 67 - int mkboot(TCHAR *infile, TCHAR *outfile, unsigned char *bldata, int bllen) 72 + int mkboot(TCHAR *infile, TCHAR *outfile, unsigned char *bldata, int bllen, 73 + int origin) 68 74 { 69 75 FILE *f; 70 76 int i; ··· 101 107 102 108 fclose(f); 103 109 104 - memcpy(image + 0x220 + 0x1f0000, bldata, bllen); 110 + memcpy(image + 0x220 + origin, bldata, bllen); 105 111 106 112 f = _tfopen(outfile, TEXT("wb")); 107 113 if(!f) { ··· 110 116 } 111 117 112 118 /* Patch the reset vector to start the boot loader */ 113 - image[0x220 + 4] = image[0x1f0000 + 0x220 + 4]; 114 - image[0x220 + 5] = image[0x1f0000 + 0x220 + 5]; 115 - image[0x220 + 6] = image[0x1f0000 + 0x220 + 6]; 116 - image[0x220 + 7] = image[0x1f0000 + 0x220 + 7]; 119 + image[0x220 + 4] = image[origin + 0x220 + 4]; 120 + image[0x220 + 5] = image[origin + 0x220 + 5]; 121 + image[0x220 + 6] = image[origin + 0x220 + 6]; 122 + image[0x220 + 7] = image[origin + 0x220 + 7]; 117 123 118 124 /* This is the actual length of the binary, excluding all headers */ 119 - actual_length = 0x1f0000 + bllen; 125 + actual_length = origin + bllen; 120 126 121 127 /* Patch the ESTFBINR header */ 122 128 image[0x20c] = (actual_length >> 24) & 0xff; ··· 216 222 DWORD blsize; 217 223 int i; 218 224 struct sumpairs *sums; 225 + int origin; 219 226 220 227 /* get pointer to the correct bootloader.bin */ 221 228 switch(series) { 222 229 case 100: 223 230 res = FindResource(NULL, MAKEINTRESOURCE(IDI_BOOTLOADERH100), TEXT("BIN")); 224 231 sums = &h100pairs[0]; 232 + origin = 0x1f0000; 225 233 break; 226 234 case 120: 227 235 res = FindResource(NULL, MAKEINTRESOURCE(IDI_BOOTLOADERH120), TEXT("BIN")); 228 236 sums = &h120pairs[0]; 237 + origin = 0x1f0000; 238 + break; 239 + case 300: 240 + res = FindResource(NULL, MAKEINTRESOURCE(IDI_BOOTLOADERH300), TEXT("BIN")); 241 + sums = &h300pairs[0]; 242 + origin = 0x3f0000; 229 243 break; 230 244 } 231 245 resload = LoadResource(NULL, res); ··· 246 260 TEXT("Error"), MB_ICONERROR); 247 261 goto error; 248 262 } 249 - if (!mkboot(name1, name2, bootloader, blsize)) { 263 + if (!mkboot(name1, name2, bootloader, blsize, origin)) { 250 264 MessageBox(NULL, TEXT("Error in patching"), 251 265 TEXT("Error"), MB_ICONERROR); 252 266 goto error; ··· 380 394 else { 381 395 table_entry = intable(md5sum_str, &h100pairs[0], 382 396 sizeof(h100pairs)/sizeof(struct sumpairs)); 383 - if (table_entry >= 0) 397 + if (table_entry >= 0) { 384 398 series = 100; 399 + } 400 + else { 401 + table_entry = 402 + intable(md5sum_str, &h300pairs[0], 403 + sizeof(h300pairs)/sizeof(struct sumpairs)); 404 + if (table_entry >= 0) 405 + series = 300; 406 + } 385 407 } 386 408 if (series == 0) { 387 409 MessageBox(NULL, TEXT("Unrecognised firmware"), TEXT("Fail"), MB_OK);
+1
tools/fwpatcher/resource.h
··· 1 1 #define IDI_RBICON 101 2 2 #define IDI_BOOTLOADERH100 102 3 3 #define IDI_BOOTLOADERH120 103 4 + #define IDI_BOOTLOADERH300 104 4 5
+1
tools/fwpatcher/resource.rc
··· 3 3 IDI_RBICON ICON "rockbox.ico" 4 4 IDI_BOOTLOADERH100 BIN "bootloader-h100.bin" 5 5 IDI_BOOTLOADERH120 BIN "bootloader-h120.bin" 6 + IDI_BOOTLOADERH300 BIN "bootloader-h300.bin"