From 3c4afa4a20dfbb59caf0bd5de6496344fcd886e9 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 18 Mar 2008 20:58:52 +0000 Subject: [PATCH] Make scramble add the flash logo when encoding for iAudio. It's only shown on M3 with the cowon loader versions I've seen, but the space is reserved in all coldfire iaudio flash files (was just zeroed before). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16697 a1c6a512-1295-4272-9138-f99709370657 --- tools/Makefile | 7 +++++-- tools/iaudio_bl_flash.bmp | Bin 0 -> 5240 bytes tools/scramble.c | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tools/iaudio_bl_flash.bmp diff --git a/tools/Makefile b/tools/Makefile index 17887b2d48..6351e5bec4 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -18,16 +18,19 @@ CLEANALL := scramble descramble iriver sh2d bmp2rb rdf2binary convbdf \ all: @echo "Run make in your build directory!" -scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o +scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o iaudio_bl_flash.o descramble: descramble.o iriver.o gigabeat.o -scramble.o: scramble.c iriver.h mi4.h gigabeat.h telechips.h +scramble.o: scramble.c iriver.h mi4.h gigabeat.h telechips.h iaudio_bl_flash.h descramble.o: descramble.c iriver.h gigabeat.h iriver.o: iriver.c iriver.h gigabeat.o: gigabeat.c gigabeat.h gigabeats.o: gigabeats.c gigabeats.h mi4.o: mi4.c mi4.h telechips.o: telechips.c telechips.h +iaudio_bl_flash.o: iaudio_bl_flash.c iaudio_bl_flash.h +iaudio_bl_flash.c iaudio_bl_flash.h: iaudio_bl_flash.bmp bmp2rb + $(SILENT)./bmp2rb -f 7 -h . $< >iaudio_bl_flash.c sh2d: sh2d.c diff --git a/tools/iaudio_bl_flash.bmp b/tools/iaudio_bl_flash.bmp new file mode 100644 index 0000000000000000000000000000000000000000..093fe1481d2a94aecbef5c4e51c6a2003015b90a GIT binary patch literal 5240 zcmeH~J5t>+6o!>dDyPtp$qJ~_vx5w6X40?)mJm{=WD9hz?-tksTVM-}ci{ZreDbqyY6@CgPtk9*ZilCaeJUV&d$!#`T2Re zxVT7{mzU}4>MC7dU#FX!n{<17o9^!J(r&j)_xJbd;o%`YK0c8W}Gxz`Y_e3D2 zJWut`#Sv$pyc2}KAv&K}VYN5iC#^yOsyWObcd$f6+o2a~d!~|Y9nTtANBV}aR z?etT!XZy9vA;cO7k($`@lhtBz7Hp&Fh*SRe_(^3IepLNOc&QOj_}F97zwnyr+Mm+| z9pST^3W!{&`ptLZ7b$DJoQBs&v6L~PQb#W}4G$KO)p6NL2}xI%pdH|&env5)^BFsk zKxcfhUtjeeU(+qND&{??zvAPF>GQRQ!TtS_WO7FR35KY zTYL8V{DK*Y7J~iAd02R5OK^{8Ez$J`qbtJoMCB=9IPsh(7j{NQkCKd&CD*sg&9e%> z&}y~pFFSFt!Sf@Y-r=TCHh7l8$Nn$pQD|e1@%Hwxa*guc{0Wbj2Y8o1&g<^_zv1Kj zl1K3?t?&x@QS&vSRdM9-f@Nem|B!oh=qIhddH6tJT&yeW6fZ_?DGl=+$A#}&U+M@e zwVYN@l)`JYt3T>+%~Mit)~`o50ClmH1f>!#l6lFm<5jvUVp`?94ix?9(0be#UnJts zXfFW4#|kZtgBQpF4Zi1qR&1J;EsvP(@z~rVG!1GX8mfiqzBnYFctB=cqBr8ckkks@so O4gM{ARQ_Lor}P`aPuP|K literal 0 HcmV?d00001 diff --git a/tools/scramble.c b/tools/scramble.c index 0a5230068c..b49bde10a2 100644 --- a/tools/scramble.c +++ b/tools/scramble.c @@ -26,6 +26,7 @@ #include "gigabeats.h" #include "mi4.h" #include "telechips.h" +#include "iaudio_bl_flash.h" int iaudio_encode(char *iname, char *oname, char *idstring); int ipod_encode(char *iname, char *oname, int fw_ver, bool fake_rsrc); @@ -77,6 +78,12 @@ void int2be(unsigned int val, unsigned char* addr) addr[3] = val & 0xFF; } +void short2be(unsigned short val, unsigned char* addr) +{ + addr[0] = (val >> 8) & 0xff; + addr[1] = val & 0xFF; +} + void usage(void) { printf("usage: scramble [options] [xor string]\n"); @@ -586,6 +593,11 @@ int iaudio_encode(char *iname, char *oname, char *idstring) memset(outbuf, 0, 0x1030); strcpy((char *)outbuf, idstring); + memcpy(outbuf+0x20, iaudio_bl_flash, + BMPWIDTH_iaudio_bl_flash * (BMPHEIGHT_iaudio_bl_flash/8) * 2); + short2be(BMPWIDTH_iaudio_bl_flash, &outbuf[0x10]); + short2be((BMPHEIGHT_iaudio_bl_flash/8), &outbuf[0x12]); + outbuf[0x19] = 2; for(i = 0; i < length;i++) sum += outbuf[0x1030 + i];