Rockbox.org home
releases
current build
extras FAQ
manual
wiki
docs index mailing lists
IRC
forums bugs
patches



Rockbox mail archive

Subject: Fix a very nasty bug for DIGROM.TGZ
From: alankorr (alankorr_at_subdimension.com)
Date: 2002-01-18


Ok, new version to fix a very nasty bug :

  be_long_cluster =
(swabHI(le_short_fat[x+1])<<16)|swabHI(le_short_fat[x+0]);

the trouble is swabHI waits for a int parameter so we get an
undesirable signed extension.

to fix it use explicit unsigned extension :

  be_long_cluster =
(swabHI(le_short_fat[x+1])<<16)|((unsigned
short)swabHI(le_short_fat[x+0]));

I hope it is the only possible cause of problem of "invalid
FAT".

NOTE : le = little endian,
       be = big endian;
       swab = swap byte;
       SI = single integer (32-bit, gcc convention)
       HI = half integer (16-bit, gcc convention)
       QI = quarter integer (8-bit, gcc convention)

That's all, folks !



  • application/x-gzip-compressed attachment: digrom2.tgz
_____________________________________________________________________
// free anonymous email || forums \\ subZINE || anonymous browsing
            subDIMENSION -- http://www.subdimension.com



Page was last modified "Mar 9 2008" The Rockbox Crew