Thanx to giantpune for the crash course ...vexing said:Remfin said:Until you realize the lookup table for a disc stored in 8k chunks is 4 megs (4 bytes per entry, which may not be feasible).
you could have a two layer table, maybe 4700 entries stored in memory, each entry would cover a 1mb area, then the second lookup table could be stored in the 1mb area because the hard disk is going to be reading that area and caching it anyway.
This was my first thought too. See my post above (near bottom).
Surprise (after ~70 min of work)WiiPower said:Also i'm asking because i have a new .iso tool for GC games in mind, and that would require defrag code. Would you be interested in writing tools for GC games?
CODE# wit d pool/gc/mkdd.iso --show all
Dump of file pool/gc/mkdd.iso
ÂÂReal path:ÂÂÂÂÂÂ /disk/ide1/m740av/work/pool/gc/mkdd.iso
ÂÂFile size:ÂÂÂÂÂÂÂÂ57058000/hex = 1459978240 = 1392 MiB
ÂÂDisc type:ÂÂÂÂÂÂ GameCube
ÂÂID & file type:ÂÂGM4P01, GC-ISO
ÂÂDisc name:ÂÂÂÂÂÂ Mario Kart Double Dash!
ÂÂDB title:ÂÂÂÂÂÂÂÂMario Kart: Double Dash!!
ÂÂRegion:ÂÂÂÂÂÂÂÂÂÂPAL [PAL ]
ÂÂRegion setting:ÂÂ0 / 00 00 00 00ÂÂ00 00 00 00
ÂÂDirectories:ÂÂÂÂÂÂÂÂ 35
ÂÂFiles:ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ334
ÂÂUsed ISO blocks:ÂÂ18540 * 32 KiB = 579 MiB
ÂÂ35 directories with 334 files, disk usage 579 MiB:
ÂÂÂÂÂÂ offsetÂÂÂÂ sizeÂÂÂÂ size
ÂÂÂÂÂÂÂÂÂÂhexÂÂÂÂÂÂhexÂÂÂÂÂÂdecÂÂpath + file
ÂÂÂÂ-------------------------------------------------------------------------------
ÂÂÂÂÂÂÂÂÂÂÂÂ-ÂÂÂÂÂÂÂÂ- N=5ÂÂÂÂÂÂ DATA/sys/
ÂÂÂÂÂÂÂÂÂÂÂÂ0+ÂÂÂÂ 440ÂÂÂÂ 1088ÂÂDATA/sys/boot.bin
ÂÂÂÂÂÂÂÂÂÂ440+ÂÂÂÂ2000ÂÂÂÂ 8192ÂÂDATA/sys/bi2.bin
ÂÂÂÂÂÂÂÂ 2440+ÂÂÂÂÂÂ20ÂÂÂÂÂÂ 32ÂÂDATA/sys/apploader.img
ÂÂÂÂÂÂÂÂ7dc00+ÂÂ372200ÂÂ3613184ÂÂDATA/sys/main.dol
ÂÂÂÂÂÂ e46400+ÂÂÂÂ920cÂÂÂÂ37388ÂÂDATA/sys/fst.bin
ÂÂÂÂÂÂÂÂÂÂÂÂ-ÂÂÂÂÂÂÂÂ- N=354ÂÂÂÂ DATA/files/
ÂÂÂÂ155df2480+ÂÂ55d460ÂÂ5624928ÂÂDATA/files/ARAM.arc
ÂÂÂÂÂÂÂÂÂÂÂÂ-ÂÂÂÂÂÂÂÂ- N=54ÂÂÂÂÂÂDATA/files/AudioRes/
ÂÂÂÂ cc23e0d0+ÂÂ 5ab00ÂÂ 371456ÂÂDATA/files/AudioRes/GCKart.baa
ÂÂÂÂ cc3a8cd0+ÂÂÂÂ 700ÂÂÂÂ 1792ÂÂDATA/files/AudioRes/GCKart.bsft
ÂÂÂÂ cc3aa8d0+ÂÂÂÂ94c0ÂÂÂÂ38080ÂÂDATA/files/AudioRes/GCKart.bstn
ÂÂÂÂ cc3cfbd0+ÂÂÂÂ e6dÂÂÂÂ 3693ÂÂDATA/files/AudioRes/GCKart.daa
....
ÂÂÂÂ cf6f2840+ÂÂÂÂ8bb8ÂÂÂÂ35768ÂÂDATA/files/StaffGhosts/Wario.ght
ÂÂÂÂ cf715720+ÂÂÂÂ8bb8ÂÂÂÂ35768ÂÂDATA/files/StaffGhosts/Yoshi.ght
ÂÂISO Usage Map:
ÂÂÂÂÂÂÂÂÂÂÂÂ0: A..AAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
ÂÂÂÂÂÂ 200000: AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAA............
ÂÂÂÂÂÂ 400000: ................ ................ ................ ................ *ÂÂ406
ÂÂÂÂ 33000000: ................ .AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
ÂÂÂÂ 33200000: AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA *ÂÂ287
ÂÂÂÂ 57000000: AAAAAAAAAAA