*Changed back to old install function. This one never freezes or codedumps (i hope so).

This commit is contained in:
dimok321 2009-05-12 21:19:51 +00:00
parent 4093776c3b
commit 5fabf08980

View File

@ -431,7 +431,7 @@ u32 wbfs_add_disc(wbfs_t*p,read_wiidisc_callback_t read_src_wii_disc,
info = wbfs_ioalloc(p->disc_info_sz); info = wbfs_ioalloc(p->disc_info_sz);
read_src_wii_disc(callback_data,0,0x100,info->disc_header_copy); read_src_wii_disc(callback_data,0,0x100,info->disc_header_copy);
copy_buffer = wbfs_ioalloc(p->wii_sec_sz); copy_buffer = wbfs_ioalloc(p->wbfs_sec_sz);
if(!copy_buffer) if(!copy_buffer)
ERROR("alloc memory"); ERROR("alloc memory");
tot=0; tot=0;
@ -439,32 +439,27 @@ u32 wbfs_add_disc(wbfs_t*p,read_wiidisc_callback_t read_src_wii_disc,
if(spinner){ if(spinner){
// count total number to write for spinner // count total number to write for spinner
for(i=0; i<p->n_wbfs_sec_per_disc;i++) for(i=0; i<p->n_wbfs_sec_per_disc;i++)
if(copy_1_1 || block_used(used,i,wii_sec_per_wbfs_sect)) tot += wii_sec_per_wbfs_sect; if(copy_1_1 || block_used(used,i,wii_sec_per_wbfs_sect)) tot++;
spinner(0,tot); spinner(0,tot);
} }
for(i=0; i<p->n_wbfs_sec_per_disc;i++){ for(i=0; i<p->n_wbfs_sec_per_disc;i++){
u16 bl = 0; u16 bl = 0;
if(copy_1_1 || block_used(used,i,wii_sec_per_wbfs_sect)) { if(copy_1_1 || block_used(used,i,wii_sec_per_wbfs_sect)) {
u16 j;
bl = alloc_block(p); bl = alloc_block(p);
if (bl==0xffff) if (bl==0xffff)
ERROR("no space left on device (disc full)"); ERROR("no space left on device (disc full)");
for(j=0; j<wii_sec_per_wbfs_sect;j++) { read_src_wii_disc(callback_data,i*(p->wbfs_sec_sz>>2),p->wbfs_sec_sz,copy_buffer);
u32 offset = (i*(p->wbfs_sec_sz>>2)) + (j*(p->wii_sec_sz>>2));
read_src_wii_disc(callback_data,offset,p->wii_sec_sz,copy_buffer); //fix the partition table.
if(i==(0x40000>>p->wbfs_sec_sz_s))
wd_fix_partition_table(d, sel, copy_buffer+(0x40000&(p->wbfs_sec_sz-1)));
//fix the partition table p->write_hdsector(p->callback_data,p->part_lba+bl*(p->wbfs_sec_sz/p->hd_sec_sz),
if(offset == (0x40000>>2)) p->wbfs_sec_sz/p->hd_sec_sz,copy_buffer);
wd_fix_partition_table(d, sel, copy_buffer);
p->write_hdsector(p->callback_data,p->part_lba+bl*(p->wbfs_sec_sz/p->hd_sec_sz)+j*(p->wii_sec_sz/p->hd_sec_sz),
p->wii_sec_sz/p->hd_sec_sz,copy_buffer);
cur++; cur++;
if(spinner) if(spinner)
spinner(cur,tot); spinner(cur,tot);
} }
}
info->wlba_table[i] = wbfs_htons(bl); info->wlba_table[i] = wbfs_htons(bl);
} }
// write disc info // write disc info
@ -564,7 +559,6 @@ u32 wbfs_estimate_disc(
partition_selector_t sel) partition_selector_t sel)
{ {
u8 *b; u8 *b;
int disc_info_sz_lba;
int i; int i;
u32 tot; u32 tot;
u32 wii_sec_per_wbfs_sect = 1 << (p->wbfs_sec_sz_s-p->wii_sec_sz_s); u32 wii_sec_per_wbfs_sect = 1 << (p->wbfs_sec_sz_s-p->wii_sec_sz_s);