aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--configure.in2
-rw-r--r--libmpio/src/directory.c79
3 files changed, 44 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index d4745ea..c87cf3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-06-14 Markus Germeier <mager@tzi.de>
+ * libmpio/src/directory.c (mpio_dentry_filename_write):
+ added/fixed vfat 8.3 checksum to make "real" vfat
+ drivers happy
+ * configure.in: increased version to 0.7.0RC1 for upcoming
+ release
+
2003-06-12 Markus Germeier <mager@tzi.de>
* libmpio/src/id3.c (mpio_id3_do): fixed debug output
* libmpio/src/ecc.c: fixed debug output
diff --git a/configure.in b/configure.in
index 62a9418..7c1a700 100644
--- a/configure.in
+++ b/configure.in
@@ -10,7 +10,7 @@ dnl AM_CONFIG_HEADER(src/config.h)
AC_CANONICAL_SYSTEM()
AC_MSG_RESULT(Building for a ${host} host.)
-AM_INIT_AUTOMAKE(mpio, 0.6.0)
+AM_INIT_AUTOMAKE(mpio, 0.7.0RC1)
dnl Checks for programs.
diff --git a/libmpio/src/directory.c b/libmpio/src/directory.c
index 3fc7496..200d1e9 100644
--- a/libmpio/src/directory.c
+++ b/libmpio/src/directory.c
@@ -1,5 +1,5 @@
/*
- * $Id: directory.c,v 1.4 2003/06/12 08:32:32 germeier Exp $
+ * $Id: directory.c,v 1.5 2003/06/16 10:25:03 germeier Exp $
*
* libmpio - a library for accessing Digit@lways MPIO players
* Copyright (C) 2002, 2003 Markus Germeier
@@ -439,6 +439,7 @@ mpio_dentry_filename_write(mpio_t *m, mpio_mem_t mem, BYTE *p,
int count = 0;
BYTE index;
BYTE f_8_3[13];
+ BYTE alias_check;
mpio_dir_slot_t *slot;
mpio_dir_entry_t *dentry;
DWORD i, j;
@@ -467,32 +468,6 @@ mpio_dentry_filename_write(mpio_t *m, mpio_mem_t mem, BYTE *p,
if (filename_size % 13)
count++;
- slot = (mpio_dir_slot_t *)p;
-
- index = 0x40 + count;
- while (count > 0) {
- mpio_dentry_copy_to_slot(back + ((count - 1) * 26), slot);
- hexdump((char *)back + ((count - 1) * 26), 0x20);
- slot->id = index;
- slot->attr = 0x0f;
- slot->reserved = 0x00;
- slot->start[0] = 0x00;
- slot->start[1] = 0x00;
- /* FIXME: */
- slot->alias_checksum = 0x00; // checksum for 8.3 alias
-
- hexdump((char *)slot, 0x20);
-
- slot++;
- count--;
- index = count;
- }
-
-/* memcpy(p, m->internal.dir+0x220, 0x20); */
-
-/* p+=0x20; */
- dentry = (mpio_dir_entry_t *)slot;
-
/* find uniq 8.3 filename */
memset(f_8_3, 0x20, 12);
f_8_3[8]='.';
@@ -544,31 +519,49 @@ mpio_dentry_filename_write(mpio_t *m, mpio_mem_t mem, BYTE *p,
j++;
}
- /* This seems like a special case to me! */
- if (strcmp(MPIO_MPIO_RECORD, filename)==0)
- {
- f_8_3[6]='~';
- f_8_3[7]='0';
- }
-
- if (mpio_dentry_find_name_8_3(m, mem, f_8_3))
- {
- f_8_3[6]='~';
- f_8_3[7]='1';
- }
+ f_8_3[6]='~';
+ f_8_3[7]='0';
while(mpio_dentry_find_name_8_3(m, mem, f_8_3))
f_8_3[7]++;
-
-/* memcpy(dentry->name,"AAAAAAAA",8); */
-/* memcpy(dentry->ext,"MP3",3); */
+ hexdumpn(5, f_8_3, 13);
+
+ /* calculate checksum for 8.3 alias */
+ alias_check = 0;
+ for (i = 0; i < 12; i++) {
+ if (i!=8) /* yuck */
+ alias_check = (((alias_check & 0x01)<<7)|
+ ((alias_check & 0xfe)>>1)) + f_8_3[i];
+ }
+
+ slot = (mpio_dir_slot_t *)p;
+
+ index = 0x40 + count;
+ while (count > 0) {
+ mpio_dentry_copy_to_slot(back + ((count - 1) * 26), slot);
+ hexdump((char *)back + ((count - 1) * 26), 0x20);
+ slot->id = index;
+ slot->attr = 0x0f;
+ slot->reserved = 0x00;
+ slot->start[0] = 0x00;
+ slot->start[1] = 0x00;
+ slot->alias_checksum = alias_check; // checksum for 8.3 alias
+
+ hexdumpn(5, (char *)slot, 0x20);
+
+ slot++;
+ count--;
+ index = count;
+ }
-/* hexdumpn(0, f_8_3, 13); */
+ dentry = (mpio_dir_entry_t *)slot;
memcpy(dentry->name, f_8_3, 8);
memcpy(dentry->ext, f_8_3+9, 3);
+ hexdumpn(5, (char *)dentry, 0x20);
+
free(unicode);
free(fname);