From ad2eb5c1825742f38ffae43b692466f2f248d449 Mon Sep 17 00:00:00 2001
From: dimok321 <15055714+dimok789@users.noreply.github.com>
Date: Wed, 10 Jun 2009 08:58:35 +0000
Subject: [PATCH] *Fixed USB ReInit *Moved SD Card Button a bit to the left.
---
gui.pnproj | 2 +-
source/cfg.c | 2 +-
source/fatmounter.c | 11 +++++++++--
source/fatmounter.h | 1 +
source/menu.cpp | 2 +-
5 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/gui.pnproj b/gui.pnproj
index c3ed6c5c..524278b7 100644
--- a/gui.pnproj
+++ b/gui.pnproj
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/source/cfg.c b/source/cfg.c
index 18834450..fdeda11f 100644
--- a/source/cfg.c
+++ b/source/cfg.c
@@ -306,7 +306,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
THEME.clock_x = 0;
THEME.clock_y = 335;//330;
THEME.clockAlign = CFG_ALIGN_CENTRE;
- THEME.sdcard_x = 160;
+ THEME.sdcard_x = 150;
THEME.sdcard_y = 390;
THEME.gameText_r = 0;
THEME.gameText_g = 0;
diff --git a/source/fatmounter.c b/source/fatmounter.c
index d432d9b1..cd99c887 100644
--- a/source/fatmounter.c
+++ b/source/fatmounter.c
@@ -74,7 +74,7 @@ static bool _FAT_partition_isFAT(const DISC_INTERFACE* disc, sec_t startSector)
}
// Now verify that this is indeed a FAT partition
- if (memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) &&
+ if (memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) &&
memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG)))
{
return false;
@@ -97,7 +97,7 @@ sec_t GetFATPartition(const DISC_INTERFACE* disc)
int i;
uint8_t sectorBuffer[BYTES_PER_READ] = {0};
sec_t startSector = 0;
-
+
if(!disc->startup())
return 0;
@@ -159,6 +159,13 @@ int USBDevice_Init()
}
return -1;
}
+void USBDevice_ReInit()
+{
+ __io_usbstorage.shutdown();
+ __io_wiiums.shutdown();
+ if(__io_usbstorage.startup()) return;
+ else __io_wiiums.startup();
+}
void USBDevice_deInit()
{
diff --git a/source/fatmounter.h b/source/fatmounter.h
index 90154b6d..ea844117 100644
--- a/source/fatmounter.h
+++ b/source/fatmounter.h
@@ -8,6 +8,7 @@ extern "C"
int USBDevice_Init();
void USBDevice_deInit();
+void USBDevice_ReInit();
int isSdInserted();
int isInserted(const char *path);
int SDCard_Init();
diff --git a/source/menu.cpp b/source/menu.cpp
index 7c052cbd..b5ef7775 100644
--- a/source/menu.cpp
+++ b/source/menu.cpp
@@ -677,7 +677,7 @@ static int MenuDiscList()
else if(sdcardBtn.GetState() == STATE_CLICKED)
{
- USBDevice_Init()
+ USBDevice_ReInit();
SDCard_deInit();
SDCard_Init();
if (Settings.gameDisplay==list){