mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-12-19 08:21:54 +01:00
*Changed back to old install function. This one never freezes or codedumps (i hope so).
This commit is contained in:
parent
4093776c3b
commit
5fabf08980
@ -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);
|
||||
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)
|
||||
ERROR("alloc memory");
|
||||
tot=0;
|
||||
@ -439,31 +439,26 @@ u32 wbfs_add_disc(wbfs_t*p,read_wiidisc_callback_t read_src_wii_disc,
|
||||
if(spinner){
|
||||
// count total number to write for spinner
|
||||
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);
|
||||
}
|
||||
for(i=0; i<p->n_wbfs_sec_per_disc;i++){
|
||||
u16 bl = 0;
|
||||
if(copy_1_1 || block_used(used,i,wii_sec_per_wbfs_sect)) {
|
||||
u16 j;
|
||||
|
||||
bl = alloc_block(p);
|
||||
if (bl==0xffff)
|
||||
ERROR("no space left on device (disc full)");
|
||||
for(j=0; j<wii_sec_per_wbfs_sect;j++) {
|
||||
u32 offset = (i*(p->wbfs_sec_sz>>2)) + (j*(p->wii_sec_sz>>2));
|
||||
read_src_wii_disc(callback_data,i*(p->wbfs_sec_sz>>2),p->wbfs_sec_sz,copy_buffer);
|
||||
|
||||
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
|
||||
if(offset == (0x40000>>2))
|
||||
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++;
|
||||
if(spinner)
|
||||
spinner(cur,tot);
|
||||
}
|
||||
p->write_hdsector(p->callback_data,p->part_lba+bl*(p->wbfs_sec_sz/p->hd_sec_sz),
|
||||
p->wbfs_sec_sz/p->hd_sec_sz,copy_buffer);
|
||||
cur++;
|
||||
if(spinner)
|
||||
spinner(cur,tot);
|
||||
}
|
||||
info->wlba_table[i] = wbfs_htons(bl);
|
||||
}
|
||||
@ -564,7 +559,6 @@ u32 wbfs_estimate_disc(
|
||||
partition_selector_t sel)
|
||||
{
|
||||
u8 *b;
|
||||
int disc_info_sz_lba;
|
||||
int i;
|
||||
u32 tot;
|
||||
u32 wii_sec_per_wbfs_sect = 1 << (p->wbfs_sec_sz_s-p->wii_sec_sz_s);
|
||||
|
Loading…
Reference in New Issue
Block a user