summaryrefslogtreecommitdiffstats
path: root/utils/jz4740_tools
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-07-03 12:17:56 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-07-03 12:17:56 +0000
commit6fd40a57b81484a57f1c5a8ddbd48855a89e660f (patch)
tree59609082705b4b825ca472a4f65d0ce04bab2925 /utils/jz4740_tools
parentab498e547b9c96bc2ae662cdc4c5fdb5d2db1f35 (diff)
downloadrockbox-6fd40a57b81484a57f1c5a8ddbd48855a89e660f.tar.gz
rockbox-6fd40a57b81484a57f1c5a8ddbd48855a89e660f.tar.bz2
rockbox-6fd40a57b81484a57f1c5a8ddbd48855a89e660f.zip
Jz4740 Tools:
* update Makefile * add README * update svn properties * fix small mistakes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17926 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/jz4740_tools')
-rw-r--r--[-rwxr-xr-x]utils/jz4740_tools/HXFmerge.c42
-rw-r--r--[-rwxr-xr-x]utils/jz4740_tools/HXFreplace.c23
-rw-r--r--[-rwxr-xr-x]utils/jz4740_tools/HXFsplit.c25
-rw-r--r--[-rwxr-xr-x]utils/jz4740_tools/Makefile27
-rw-r--r--utils/jz4740_tools/README36
-rw-r--r--[-rwxr-xr-x]utils/jz4740_tools/jz4740.h0
-rw-r--r--[-rwxr-xr-x]utils/jz4740_tools/jz4740_usbtool.c2
7 files changed, 138 insertions, 17 deletions
diff --git a/utils/jz4740_tools/HXFmerge.c b/utils/jz4740_tools/HXFmerge.c
index f90d094fd9..fb5a0bf2f3 100755..100644
--- a/utils/jz4740_tools/HXFmerge.c
+++ b/utils/jz4740_tools/HXFmerge.c
@@ -1,6 +1,23 @@
-/*
-Made by Maurus Cuelenaere
-*/
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Maurus Cuelenaere
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
@@ -42,8 +59,8 @@ static unsigned int le2int(unsigned char* buf)
#define MIN(a, b) (a > b ? b : a)
static char* replace(char* str)
{
- char tmp[255];
- memcpy(tmp, str, MIN(strlen(str), 255);
+ static char tmp[255];
+ memcpy(tmp, str, MIN(strlen(str), 255));
char *ptr = tmp;
while(*ptr != 0)
{
@@ -156,19 +173,32 @@ static void merge_hxf(const char* indir, FILE* outfile, const char* add)
if(strlen(add)>0)
{
+#ifdef _DIRENT_HAVE_D_NAMLEN
WRITE(int2le(dirs->d_namlen+strlen(add)), 4);
+#else
+ WRITE(int2le(strlen(dirs->d_name)+strlen(add)), 4);
+#endif
#ifndef _WIN32
- WRITE(replace(add), strlen(add)-1);
+ WRITE(replace(&add), strlen(add)-1);
#else
WRITE(add, strlen(add)-1);
#endif
WRITE(PATH_SEPARATOR, 1);
+#ifdef _DIRENT_HAVE_D_NAMLEN
WRITE(dirs->d_name, dirs->d_namlen);
+#else
+ WRITE(dirs->d_name, strlen(dirs->d_name));
+#endif
}
else
{
+#ifdef _DIRENT_HAVE_D_NAMLEN
WRITE(int2le(dirs->d_namlen), 4);
WRITE(dirs->d_name, dirs->d_namlen);
+#else
+ WRITE(int2le(strlen(dirs->d_name)), 4);
+ WRITE(dirs->d_name, strlen(dirs->d_name));
+#endif
}
WRITE(int2le(filesize), 4);
if(filesize>0)
diff --git a/utils/jz4740_tools/HXFreplace.c b/utils/jz4740_tools/HXFreplace.c
index fc97a3c1e8..154bc13071 100755..100644
--- a/utils/jz4740_tools/HXFreplace.c
+++ b/utils/jz4740_tools/HXFreplace.c
@@ -1,6 +1,23 @@
-/*
-Made by Maurus Cuelenaere
-*/
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Maurus Cuelenaere
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
diff --git a/utils/jz4740_tools/HXFsplit.c b/utils/jz4740_tools/HXFsplit.c
index ede22170e4..d5e578625b 100755..100644
--- a/utils/jz4740_tools/HXFsplit.c
+++ b/utils/jz4740_tools/HXFsplit.c
@@ -1,6 +1,23 @@
-/*
-Made by Maurus Cuelenaere
-*/
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2008 by Maurus Cuelenaere
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
@@ -43,7 +60,7 @@ static char* basepath(char* path)
#else
*ptr2 = 0x2F;
#endif
- *ptr2++;
+ ptr2++;
*ptr2 = 0;
return (char*)tmp;
}
diff --git a/utils/jz4740_tools/Makefile b/utils/jz4740_tools/Makefile
index e61b837d99..6ebf0c8fb3 100755..100644
--- a/utils/jz4740_tools/Makefile
+++ b/utils/jz4740_tools/Makefile
@@ -1,9 +1,30 @@
-WIN_DRIVERS_LIBUSB_DIR = D:\Program Files\LibUSB-Win32
+WIN_DRIVERS_LIBUSB_DIR = C:\Program Files\LibUSB-Win32
WIN_LIBUSB_INCLUDE_DIR = "$(WIN_DRIVERS_LIBUSB_DIR)\include"
WIN_LIBUSB_LIB_DIR = "$(WIN_DRIVERS_LIBUSB_DIR)\lib\gcc"
+linux: usbtool HXFmerge HXFreplace HXFsplit
+win: usbtool_win HXFmerge_win HXFsplit_win HXFreplace_win
+
usbtool:
gcc -Wall -o usbtool jz4740_usbtool.c -lusb
+usbtool_win:
+ gcc -Wall -o usbtool.exe jz4740_usbtool.c -lusb -I $(WIN_LIBUSB_INCLUDE_DIR) -L $(WIN_LIBUSB_LIB_DIR)
+
+HXFmerge:
+ gcc -Wall -o HXFmerge HXFmerge.c
+HXFreplace:
+ gcc -Wall -o HXFreplace HXFreplace.c
+HXFsplit:
+ gcc -Wall -o HXFsplit HXFsplit.c
+
+HXFmerge_win:
+ gcc -Wall -o HXFmerge.exe HXFmerge.c
+HXFreplace_win:
+ gcc -Wall -o HXFreplace.exe HXFreplace.c
+HXFsplit_win:
+ gcc -Wall -o HXFsplit.exe HXFsplit.c
-usbtoolwin:
- gcc -Wall -o usbtool.exe jz4740_usbtool.c -lusb -I $(WIN_LIBUSB_INCLUDE_DIR) -L $(WIN_LIBUSB_LIB_DIR) \ No newline at end of file
+clean-linux:
+ rm HXFmerge HXFreplace HXFsplit usbtool
+clean-win:
+ del HXFmerge.exe HXFreplace.exe HXFsplit.exe usbtool.exe
diff --git a/utils/jz4740_tools/README b/utils/jz4740_tools/README
new file mode 100644
index 0000000000..b75f36aa51
--- /dev/null
+++ b/utils/jz4740_tools/README
@@ -0,0 +1,36 @@
+*******************************************************************************
+ Jz4740 USB tools
+
+ Made by Maurus Cuelenaere for Rockbox
+ Copyright (C) 2008
+*******************************************************************************
+
+When you're on Linux, just type "make linux" to compile all the utilities (make
+sure you have libusb-dev installed).
+For cleaning: "make clean-linux"
+
+When you're on Windows, install MingW32 and LibUSB-Win32 and edit "Makefile" to
+make sure "WIN_DRIVERS_LIBUSB_DIR" is set correctly.
+For cleaning: "make clean-win"
+
+That's all!
+
+
+ ***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************
diff --git a/utils/jz4740_tools/jz4740.h b/utils/jz4740_tools/jz4740.h
index 87b400e3b9..87b400e3b9 100755..100644
--- a/utils/jz4740_tools/jz4740.h
+++ b/utils/jz4740_tools/jz4740.h
diff --git a/utils/jz4740_tools/jz4740_usbtool.c b/utils/jz4740_tools/jz4740_usbtool.c
index 6d670254e4..165aafb19d 100755..100644
--- a/utils/jz4740_tools/jz4740_usbtool.c
+++ b/utils/jz4740_tools/jz4740_usbtool.c
@@ -199,7 +199,7 @@ int upload_app(usb_dev_handle* dh, int address, unsigned char* p, int len, bool
free(tmp_buf);
fprintf(stderr, "[INFO] Booting device [STAGE%d]...", (stage2 ? 2 : 1));
- SEND_COMMAND((stage2 ? VR_PROGRAM_START2 : VR_PROGRAM_START1), (address+(stage2 ? 8 : 0)) );
+ SEND_COMMAND((stage2 ? VR_PROGRAM_START2 : VR_PROGRAM_START1), address );
fprintf(stderr, " Done!\n");
return 0;