*Fixed Estimation GameSize before Install BUG

*Some small fixes and MP3 Crash fix (STILL BUGGY WHILE PLAYING, DON'T USE IT)
This commit is contained in:
dimok321 2009-05-13 20:55:33 +00:00
parent e843d9a3be
commit a97cfd3431
15 changed files with 46 additions and 49 deletions

View File

@ -1,8 +1,6 @@
#ifndef _DISC_H_ #ifndef _DISC_H_
#define _DISC_H_ #define _DISC_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -22,7 +22,17 @@
#ifndef __FST_H__ #ifndef __FST_H__
#define __FST_H__ #define __FST_H__
//u32 do_fst(u32 fstlocation); #ifdef __cplusplus
u32 do_sd_code(char *filename); extern "C"
{
#endif
//u32 do_fst(u32 fstlocation);
u32 do_sd_code(char *filename);
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -553,7 +553,8 @@ error:
} }
u32 wbfs_extract_file(wbfs_disc_t*d, char *path); u32 wbfs_extract_file(wbfs_disc_t*d, char *path);
u32 wbfs_estimate_disc( float wbfs_estimate_disc
(
wbfs_t *p, read_wiidisc_callback_t read_src_wii_disc, wbfs_t *p, read_wiidisc_callback_t read_src_wii_disc,
void *callback_data, void *callback_data,
partition_selector_t sel) partition_selector_t sel)
@ -588,7 +589,7 @@ u32 wbfs_estimate_disc(
b = (u8 *)info; b = (u8 *)info;
read_src_wii_disc(callback_data, 0, 0x100, info->disc_header_copy); read_src_wii_disc(callback_data, 0, 0x100, info->disc_header_copy);
fprintf(stderr, "estimating %c%c%c%c%c%c %s...\n",b[0], b[1], b[2], b[3], b[4], b[5], b + 0x20); //fprintf(stderr, "estimating %c%c%c%c%c%c %s...\n",b[0], b[1], b[2], b[3], b[4], b[5], b + 0x20);
for (i = 0; i < p->n_wbfs_sec_per_disc; i++) for (i = 0; i < p->n_wbfs_sec_per_disc; i++)
{ {
@ -597,6 +598,7 @@ u32 wbfs_estimate_disc(
tot++; tot++;
} }
} }
//memcpy(header, b,0x100);
error: error:
if (d) if (d)
@ -608,5 +610,5 @@ error:
if (info) if (info)
wbfs_iofree(info); wbfs_iofree(info);
return tot * ((p->wbfs_sec_sz / p->hd_sec_sz) * 512); return tot * (((p->wbfs_sec_sz*1.0) / p->hd_sec_sz) * 512);
} }

View File

@ -211,7 +211,7 @@ u32 wbfs_extract_file(wbfs_disc_t*d, char *path);
// remove some sanity checks // remove some sanity checks
void wbfs_set_force_mode(int force); void wbfs_set_force_mode(int force);
u32 wbfs_estimate_disc( float wbfs_estimate_disc(
wbfs_t *p, read_wiidisc_callback_t read_src_wii_disc, wbfs_t *p, read_wiidisc_callback_t read_src_wii_disc,
void *callback_data, void *callback_data,
partition_selector_t sel); partition_selector_t sel);

View File

@ -2145,8 +2145,8 @@ static int MenuInstall()
f32 freespace, used; f32 freespace, used;
WBFS_DiskSpace(&used, &freespace); WBFS_DiskSpace(&used, &freespace);
u32 estimation = wbfs_estimate_disc(hdd, __WBFS_ReadDVD, NULL, ONLY_GAME_PARTITION); float estimation = wbfs_estimate_disc(hdd, __WBFS_ReadDVD, NULL, ONLY_GAME_PARTITION);
gamesize = ((f32) estimation)/1073741824; gamesize = estimation/1073741824;
char gametxt[50]; char gametxt[50];
sprintf(gametxt, "%s : %.2fGB", name, gamesize); sprintf(gametxt, "%s : %.2fGB", name, gamesize);
@ -4528,7 +4528,7 @@ int MenuMp3()
customOptionList options2(500); customOptionList options2(500);
char mp3path[30] = "SD:/mp3/"; char mp3path[30] = "SD:/mp3/";
char fullpath[100]; char fullpath[110];
int countmp3 = GetFiles(mp3path); int countmp3 = GetFiles(mp3path);
for (cnt = 0; cnt < countmp3; cnt++) { for (cnt = 0; cnt < countmp3; cnt++) {

View File

@ -134,7 +134,7 @@ if (dir == NULL) //If empty
} }
} }
qsort(mp3files, countmp3, sizeof(char[30]), filenamescmp); qsort(mp3files, countmp3, sizeof(char[80]), filenamescmp);
return countmp3; return countmp3;
} }

View File

@ -6,7 +6,7 @@ extern "C"
{ {
#endif #endif
char mp3files[500][30]; char mp3files[500][80];
void StopMp3(); void StopMp3();
void SetMp3Volume(u32 vol); void SetMp3Volume(u32 vol);

View File

@ -1,8 +1,6 @@
#ifndef _PARTITION_H_ #ifndef _PARTITION_H_
#define _PARTITION_H_ #define _PARTITION_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -1,6 +1,5 @@
#ifndef _SYS_H_ #ifndef _SYS_H_
#define _SYS_H_ #define _SYS_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"

View File

@ -1,8 +1,6 @@
#ifndef _USBSTORAGE_H_ #ifndef _USBSTORAGE_H_
#define _USBSTORAGE_H_ #define _USBSTORAGE_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -1,8 +1,6 @@
#ifndef _VIDEO2_H_ #ifndef _VIDEO2_H_
#define _VIDEO2_H_ #define _VIDEO2_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -1,8 +1,6 @@
#ifndef _WBFS_H_ #ifndef _WBFS_H_
#define _WBFS_H_ #define _WBFS_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -1,8 +1,6 @@
#ifndef _WDVD_H_ #ifndef _WDVD_H_
#define _WDVD_H_ #define _WDVD_H_
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {

View File

@ -3,8 +3,6 @@
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#include <asndlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {