Minor text changes and cleanup

This commit is contained in:
suloku 2021-11-20 10:24:45 +01:00
parent d49b84203b
commit 95c737c2af
4 changed files with 283 additions and 452 deletions

View File

@ -2,17 +2,18 @@
<app version="1">
<name>GCMM</name>
<coder>Suloku</coder>
<version>1.5.1</version>
<release_date>20211010000000</release_date>
<version>1.5.2</version>
<release_date>20211119000000</release_date>
<short_description>Memory Card Manager</short_description>
<long_description>A memory card manager for Wii/GC.
Updated to latest libraries by PabloACZ
Libogc compatibility update by PabloACZ
Batch gci backup by Pikachu025
Banner and Icon support by dronesplitter
F-Zero and Phantasy Star Online support by Ralf
Folder and sorting support by dragonbane0
Thanks to original mcbackup example code, Askot, dsbomb and justb.
Special thanks to Costis, Masken, Tantric, tueidj, DacoTaco.</long_description>
Special thanks to Costis, Masken, Tantric, tueidj, DacoTaco, Extrems.
Beta testing: f3bandit</long_description>
</app>

View File

@ -30,7 +30,7 @@ I (suloku) have updated the code to newest libraries to port it to the Wii syste
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· UPDATE HISTORY ·oø×O0|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
[What's New 1.5.2 - November 03, 2021 - By suloku]
[What's New 1.5.2 - November 19, 2021 - By suloku]
* Fixed exit/reboot secuence (finally)
* Several card fixes thanks to Extrems and libogc2!
* SD2SP2 fix
@ -40,7 +40,7 @@ I (suloku) have updated the code to newest libraries to port it to the Wii syste
* Devices can be swapped without rebooting GCMM now. When running device selector follow on screen instructions to know when you can safely insert/remove a device.
* SDGecko support for Wii mode.
* GCLoader support for Gamecube mode.
* Show current device (wiisd/wiiusb/sdgecko/sd2sp2/gcloader/no device) under version string
* Show current device (wiisd/wiiusb/sdgecko/sd2sp2/gcloader/no device) in main screen.
* Support for command line paramenters in both wii and gamecube (use Swiis cli files for gamecube). Read more in cli_readme.txt. Pre-made cli files are included.
* WII/GC: added Dark mode theme (as a separate dol file).
* Background is changed depending on fat device being used (gamecube)
@ -191,7 +191,7 @@ Accepted PlabloACZ and Picachu025 modifications, with the following changes:
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· TO DO ·oø×O0|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
* Add hotswapping (memory cards can be swapped, SD Gecko/SD/USB can't be swapped)
* SAMBA support for network mangement of savegames
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· ABOUT SAVEGAMES AND RAW IMAGES ·oø×O0|
@ -239,8 +239,8 @@ MCI format (createad by softdev's sdmc) is a raw image of the card, preceded by
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
Users:
* If you extract a device (USB, internal SD, USB gecko), it won't work againt. If you did so, reboot the GCMM. On the contrary
* Memory cards can be extracted/inserted at will at the main menu screen. It is not recommended to change the card in any other screen.
* If you extract a device (USB, internal SD, USB gecko), it won't work again. Run device selector again to remount the device or exit and restart GCMM.
* Memory cards can be extracted/inserted at will at the main menu screen. It is not recommended to remove the card in any other screen.
* Dolphin (wii/gc computer emulator) has a nice memory card manager, check it out!
About usb devices:
@ -249,7 +249,7 @@ About usb devices:
Developers:
* LibOGC card functions works with time functions that use Epoch (seconds since jan 1, 1970) as reference, while GameCube works with seconds since jan 1, 2000). The difference is 946684800 seconds
* GCMM now uses libogc 1.8.11 git (2012-07-25) card.c, card.h and system.h with tueidj's patches for proper memory card unlocking. It would be wise to update those files in GCMM if changes are made to libogc concerning other functions. Note that even if libogc asumes the changes, as GCMM now uses some static functions from libogc, it needs card.c and card.h, but if libogc updates the sramex structure (system.h) and fixes the checksums in card.c, system.h will no longer be needed. --> as of 1.5 system.h is no longer needed. Still using custom card.c and card.h (for raw management and fixing PSO and FZERO savegames), card.c is updated to latest one in libogc at time of release. Libogc card unlocking has been adopted.
* GCMM is compatible with libogc thanks to DacoTaco, but currently uses libogc2 with custom card.c (essentially libogc2's card.c with some modifications) due to libogc2 having support for sd2sp2 and gcloader, as well as many bugfixes. If changes are applied to libogc GCMM will be able to properly use it again.
* Very good sources of documentation are libogc and dolphin's source code.
* Card_Init() shall be called only once. Any subsequent call will be pointless; to change the company and gamecode one should use Card_setgamecode() and Card_setcompany libogc functions.
@ -259,23 +259,31 @@ Developers:
Unzip the archive. You will find the following folders inside:
apps Contains Homebrew Channel ready files
(see Homebrew Channel instructions below)
apps Contains Homebrew Channel ready files, both for normal and dark themed GCMM
(see Homebrew Channel instructions below)
gamecube Contains GameCube DOL file (not required for Wii)
gamecube Contains GameCube DOL file, both normal and dark themed (not required for Wii)
gamecube/cli files Contains a set of cli files to use with swiss in gamecube mode. Read cli_readme.txt for mor information.
After boot, GCMM will check which devices are available. If only one device is available, GCMM will use it as default. If more than a single device is available GCMM will boot into the device selector screen. You may skip device selector screen at boot using command line arguments (check cli files for gamecube mode).
Available devices in order shown by GCMM. Please don't connect more than one USB device in Wii mode.
Wii
----------
On the Wii, the savegames will be read from and written to the front SD slot or FAT32 USB device.
The user will be prompted at startup for which device to use.
If the selected device isn't available, GCMM will try to use the other device (i.e: user selects usb device but there's none connected, so GCMM will try to use the internal SD).
Memory card can be in either slot.
Wii SD
Wii USB
Slot A SD Gecko
Slot B SD Gecko
Gamecube
------------
On the GameCube you will need a Gecko SD adapter in the slot A and place the memory card on slot B.
SD2SP2
Slot A SD Gecko
Slot B SD Gecko
GC Loader
------------------------------
Loading / Running the app:
@ -290,15 +298,14 @@ http://hbc.hackmii.com/
Gamecube:
---------
You can load gcmm via sdload and an SD card in slot A, or by streaming
it to your Gamecube, or by booting a bootable DVD with gcmm on it.
You can load gcmm via sdload and an SD card in slot A, or by streaming it to your Gamecube, or by booting a bootable DVD with gcmm on it.
This document doesn't cover how to do any of that. A good source for information on these topics is at http://www.gc-forever.com/wiki/index.php?title=Booting_Homebrew
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· CONTROLS ·oø×O0|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
They are shown at the screen.
They are shown at the main screen.
Raw mode controls: hold L (gamecube pad) or B (wiimote) then press the corresponding button
* Raw Backup Mode: GC_pad L+Y , Wiimote B+Minus
@ -311,11 +318,11 @@ Raw mode controls: hold L (gamecube pad) or B (wiimote) then press the correspon
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
Currently gcmm uses:
* DevkitPPC r26: http://sourceforge.net/projects/devkitpro/files/devkitPPC/
* libOGC 1.8.11 git (2012-07-25): http://sourceforge.net/projects/devkitpro/files/libogc
note: it compiles and runs fine with 1.8.11 release
* libfat 1.0.11: http://sourceforge.net/projects/devkitpro/files/libfat/
* libFreeType 2.4.2 port: http://sourceforge.net/projects/devkitpro/files/portlibs/ppc/
* DevkitPPC as installed by devkitPro Updater 3.0.3 as of November 19th 2021: https://github.com/devkitPro/installer/releases
* libOGC2 (updated libogc by Extrems) as of November 19th 2021: https://github.com/extremscorner/libogc2/commit/6bce86690ca2b45557f14460122bc7d43c5ac547
* libfat updated by Extrems as of November 19th 2021: http://sourceforge.net/projects/devkitpro/files/libfat/
* libFreeType 2.4.2 port, currently installed via pacman and devkitpro toolchain: https://github.com/devkitPro/pacman-packages
- Read more about installing portlibs: https://devkitpro.org/wiki/devkitPro_pacman
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· CREDITS ·oø×O0|
@ -329,9 +336,12 @@ Currently gcmm uses:
* Tantric for pointing out that official memory cards won't work on wii mode, which encouraged me to continue gcmm as all my previous efforts where in vane due to using an official card for the testing.
* tueidj, for his patches and very useful information and support. Official memory cards work due to his work.
* dronesplitter for banner and icon implementation
* PlabloACZ and Picachu025 for updating the source.
* PlabloACZ and Picachu025 for updating the source on 2011 after I forgot about GCMM.
* Nano(Excelsiior), for inspiring me to finally working again on GCMM
* bm123456 and themanuel for beta testing and support
* DacoTaco for libogc compatibility changes
* Extrems for many libogc bugfixes, gcloader and sd2sp2 support in libogc, libfat updates and improvements
* f3bandit for beta testing, specially gcloader support
×—–­—–­—–­—–­ –­—–­—–­—–­—–­—–­—–­—–­—–­—–­— ­—–­—–­—–­—–­—–­—–­—–­—-­—–­-–•¬
|0O×øo· ·oø×O0|

View File

@ -358,34 +358,44 @@ int SelectMode ()
// DrawText(495,305,"choose your mode");
setfontsize(10);
setfontcolour(COL_FONT_STATUS);
DrawText(595,87,appversion);
//DrawText(595,97,"Device");
switch(CUR_DEVICE)
{
case DEV_ND:
DrawText(595,97, "!Device");
DrawText(171,240, "!Device");
break;
case DEV_GCSDA:
DrawText(595,97, "GeckoA");
DrawText(171,240, "Gecko A");
break;
case DEV_GCSDB:
DrawText(595,97, "GeckoB");
DrawText(171,240, "Gecko B");
break;
case DEV_GCSDC:
DrawText(595,97, "SD2SP2");
DrawText(175,240, "SD2SP2"); //X coordinate is 175 to center it (has one less character than other strings)
break;
case DEV_GCODE:
DrawText(595,97, "GCLoader");
DrawText(171,240, "GCLoadr");
break;
case DEV_WIISD:
DrawText(595,97, "Wii SD");
DrawText(175,240, "Wii SD"); //X coordinate is 175 to center it (has one less character than other strings)
break;
case DEV_WIIUSB:
DrawText(595,97, "Wii USB");
DrawText(171,240, "Wii USB");
break;
default:
break;
}
/*
"GCLoadr"
" Wii SD"
"Wii USB"
"Gecko A"
"!Device"
"SD2SP2"
*/
setfontsize (FONT_SIZE);
writeStatusBar("Choose your mode","");

View File

@ -49,7 +49,7 @@
#define WIIUSB_PATH "usb"
char fatpath[4];
const char appversion[] = "v1.5.1b2";
const char appversion[] = "v1.5.2";
int mode;
int cancel;
int doall;
@ -174,7 +174,7 @@ static bool initFAT(int device)
}
if (!fatMountSimple (SDGECKOA_PATH, &__io_gcsda))
{
WaitPrompt("Error Mounting SD fat!");
WaitPrompt("Error Mounting slot A SD fat!");
return false;
}
DEVICES[DEV_GCSDA] = DEV_MOUNTED;
@ -190,7 +190,7 @@ static bool initFAT(int device)
}
if (!fatMountSimple (SDGECKOB_PATH, &__io_gcsdb))
{
WaitPrompt("Error Mounting SD fat!");
WaitPrompt("Error Mounting slot B SD fat!");
return false;
}
DEVICES[DEV_GCSDB] = DEV_MOUNTED;
@ -206,7 +206,7 @@ static bool initFAT(int device)
}
if (!fatMountSimple (SD2SP2_PATH, &__io_gcsd2))
{
WaitPrompt("Error Mounting SD fat!");
WaitPrompt("Error Mounting SD2SP2 SD fat!");
return false;
}
DEVICES[DEV_GCSDC] = DEV_MOUNTED;
@ -222,7 +222,7 @@ static bool initFAT(int device)
}
if (!fatMountSimple (GCLOADER_PATH, &__io_gcode))
{
WaitPrompt("Error Mounting SD fat!");
WaitPrompt("Error Mounting GCLoader SD fat!");
return false;
}
DEVICES[DEV_GCODE] = DEV_MOUNTED;
@ -233,12 +233,12 @@ static bool initFAT(int device)
__io_wiisd.startup();
if (!__io_wiisd.isInserted())
{
WaitPrompt("No SD card inserted!");
WaitPrompt("No SD card inserted in front SD slot!");
return false;
}
if (!fatMountSimple (WIISD_PATH, &__io_wiisd))
{
WaitPrompt("Error Mounting SD fat!");
WaitPrompt("Error Mounting Wii SD fat!");
return false;
}
DEVICES[DEV_WIISD] = DEV_MOUNTED;
@ -249,12 +249,12 @@ static bool initFAT(int device)
__io_usbstorage.startup();
if (!__io_usbstorage.isInserted())
{
WaitPrompt("No usb device inserted!");
WaitPrompt("No USB device inserted!");
return false;
}
if (!fatMountSimple (WIIUSB_PATH, &__io_usbstorage))
{
WaitPrompt("Error Mounting SD fat!");
WaitPrompt("Error Mounting USB fat!");
return false;
}
DEVICES[DEV_WIIUSB] = DEV_MOUNTED;
@ -271,107 +271,6 @@ static bool initFAT(int device)
return true;
}
/*
// 1 for Internal SD, 0 for fat32 usb
static int initFAT2(int device)
{
SD2SP2 = 0;
ShowAction("Mounting device...");
#ifdef HW_RVL
if (device){//try SD card first
__io_wiisd.startup();
if (!__io_wiisd.isInserted())
{
ShowAction ("No SD card inserted! Trying USB storage.");
sleep(2);
__io_usbstorage.startup();
if (!__io_usbstorage.isInserted())
{
WaitPrompt ("No USB device inserted either!");
return 0;
}
else if (!fatMountSimple ("fat", &__io_usbstorage)){
WaitPrompt("Error Mounting USB fat!");
return 0;
}
return 1;//usb mounted
}
if (!fatMountSimple ("fat", &__io_wiisd))
{
WaitPrompt("Error Mounting SD fat!");
return 0;
}
}else if (!device)//try USB first
{
__io_usbstorage.startup();
if (!__io_usbstorage.isInserted())
{
ShowAction ("No usb device inserted! Trying internal SD.");
sleep(2);
__io_wiisd.startup();
if (!__io_wiisd.isInserted())
{
WaitPrompt ("No SD card inserted either!");
return 0;
}
else if (!fatMountSimple ("fat", &__io_wiisd)){
WaitPrompt("Error Mounting SD fat!");
return 0;
}
return 1;//SD mounted
}
if (!fatMountSimple ("fat", &__io_usbstorage))
{
WaitPrompt("Error Mounting USB fat!");
return 0;
}
}
#else
int i =0;
s32 ret;
if (device)
{//Memcard in SLOT B, SD gecko in SLOT A
//This will ensure SD gecko is recognized if inserted or changed to another slot after GCMM is executed
for(i=0;i<10;i++){
ret = CARD_Probe(CARD_SLOTA);
if (ret == CARD_ERROR_WRONGDEVICE)
break;
}
__io_gcsda.startup();
if (!__io_gcsda.isInserted())
{
WaitPrompt ("No SD Gecko inserted! Insert it in slot A and restart");
return 0;
}
if (!fatMountSimple ("fat", &__io_gcsda))
{
WaitPrompt("Error Mounting SD fat!");
return 0;
}
}else //Memcard in SLOT A, SD gecko in SLOT B
{
//This will ensure SD gecko is recognized if inserted or changed to another slot after GCMM is executed
for(i=0;i<10;i++){
ret = CARD_Probe(CARD_SLOTB);
if (ret == CARD_ERROR_WRONGDEVICE)
break;
}
__io_gcsdb.startup();
if (!__io_gcsdb.isInserted())
{
WaitPrompt ("No SD Gecko inserted! Insert it in slot B and restart");
return 0;
}
if (!fatMountSimple ("fat", &__io_gcsdb))
{
WaitPrompt("Error Mounting SD fat!");
return 0;
}
}
#endif
return 1;
}
*/
void deinitFAT()
{
//First unmount all the devs...
@ -409,30 +308,226 @@ void deinitFAT()
}
#endif
}
/*
void deinitFAT2()
u8 skip_selector = 1;
int device_select()
{
//First unmount all the devs...
fatUnmount ("fat");
//...and then shutdown em!
#ifdef HW_RVL
__io_wiisd.shutdown();
__io_usbstorage.shutdown();
#else
if (SD2SP2)
{
__io_gcsd2.shutdown();
}
else
{
if(MEM_CARD)
__io_gcsda.shutdown();
if(!MEM_CARD)
__io_gcsdb.shutdown();
}
u32 p, ph;
#ifdef HW_RVL
u32 wp, wph;
#endif
int x = 170;
int y = 280;
int x_text = x+15;
int y_text = y+20;
int selected = 0;
u8 draw = 1;
setfontsize(14);
setfontcolour(COL_FONT);
int i = 0;
u8 selected2device[4] = {0, 0, 0, 0};
//If there are no fat devices skip
if (!DEVICES[DEV_NUM]){
WaitPrompt (NOFAT_MSG);
return 0;
}else if (DEVICES[DEV_NUM] == 1 && skip_selector ){ //Only one device was detected, so mount it, but only on first boot
skip_selector = 0;
for (i=1;i<=DEV_TOTAL;i++)
{
if (DEVICES[i])
return i;
}
}else{
skip_selector = 0;
//Selector screen
while(1)
{
//Draw device selector
if (draw){
writeStatusBar("Press A to select","");
draw = 0;
DrawBoxFilled(x, y, x+290, y+90, COL_BG1);
y_text= y+20;
x_text = x+15;
DrawText(x_text, y_text, "Please select your device:");
y_text+=20;
x_text += 24;
#ifdef HW_RVL
if(DEVICES[DEV_WIISD]){
DrawText(x_text, y_text, "Wii Front SD slot");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_WIISD;
break;
}
}
}
if(DEVICES[DEV_WIIUSB]){
DrawText(x_text, y_text, "USB storage device");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_WIIUSB;
break;
}
}
}
if(DEVICES[DEV_GCSDA]){
DrawText(x_text, y_text, "Slot A SD Gecko");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDA;
break;
}
}
}
if(DEVICES[DEV_GCSDB]){
DrawText(x_text, y_text, "Slot B SD Gecko");
y_text=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDB;
break;
}
}
}
#else
if(DEVICES[DEV_GCSDC]){
DrawText(x_text, y_text, "SD2SP2");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDC;
break;
}
}
}
if(DEVICES[DEV_GCSDA]){
DrawText(x_text, y_text, "Slot A SD Gecko");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDA;
break;
}
}
}
if(DEVICES[DEV_GCSDB]){
DrawText(x_text, y_text, "Slot B SD Gecko");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDB;
break;
}
}
}
if(DEVICES[DEV_GCODE]){
DrawText(x_text, y_text, "GC Loader");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCODE;
break;
}
}
}
#endif
//Draw cursor
y_text= y+40;
x_text = x+20;
switch (selected)
{
case 0:
DrawText(x_text, y_text, ">>");
break;
case 1:
DrawText(x_text, y_text+15, ">>");
break;
case 2:
DrawText(x_text, y_text+15+15, ">>");
break;
case 3:
DrawText(x_text, y_text+15+15+15, ">>");
break;
default:
break;
}
}//end if (draw)
p = PAD_ButtonsDown (0);
#ifdef HW_RVL
wp = WPAD_ButtonsDown (0);
#endif
if (p & PAD_BUTTON_A
#ifdef HW_RVL
|| wp & WPAD_BUTTON_A
#endif
)
{
//Do something
return selected2device[selected];
}
if (p & PAD_BUTTON_DOWN
#ifdef HW_RVL
|| wp & WPAD_BUTTON_DOWN
#endif
)
{
selected +=1;
if (selected >= DEVICES[DEV_NUM]) selected = 0;
draw = 1;
}
if (p & PAD_BUTTON_UP
#ifdef HW_RVL
|| wp & WPAD_BUTTON_UP
#endif
)
{
selected -=1;
if (selected < 0) selected = DEVICES[DEV_NUM]-1;
draw = 1;
}
//char msg[256];
//sprintf(msg, "Selected device: %d Total %d DN%d SDA%d SDB%d SDC%d GL%d WSD%d WU%d", selected, DEVICES[DEV_NUM], DEVICES[1],DEVICES[2],DEVICES[3],DEVICES[4],DEVICES[5],DEVICES[6] );
/*
#define DEV_NUM 0
#define DEV_GCSDA 1
#define DEV_GCSDB 2
#define DEV_GCSDC 3
#define DEV_GCODE 4
#define DEV_WIISD 5
#define DEV_WIIUSB 6
*/
//writeStatusBar(msg, "");
ShowScreen();
}//end while(1)
}
return 0;
}
*/
/****************************************************************************
* Initialise Video
*
@ -1033,225 +1128,6 @@ void SD_RawRestoreMode ()
return;
}
u8 skip_selector = 1;
int device_select()
{
u32 p, ph;
#ifdef HW_RVL
u32 wp, wph;
#endif
int x = 170;
int y = 280;
int x_text = x+15;
int y_text = y+20;
int selected = 0;
u8 draw = 1;
setfontsize(14);
setfontcolour(COL_FONT);
int i = 0;
u8 selected2device[4] = {0, 0, 0, 0};
//If there are no fat devices skip
if (!DEVICES[DEV_NUM]){
WaitPrompt (NOFAT_MSG);
return 0;
}else if (DEVICES[DEV_NUM] == 1 && skip_selector ){ //Only one device was detected, so mount it, but only on first boot
skip_selector = 0;
for (i=1;i<=DEV_TOTAL;i++)
{
if (DEVICES[i])
return i;
}
}else{
skip_selector = 0;
//Selector screen
while(1)
{
//Draw device selector
if (draw){
writeStatusBar("Press A to select","");
draw = 0;
DrawBoxFilled(x, y, x+290, y+90, COL_BG1);
y_text= y+20;
x_text = x+15;
DrawText(x_text, y_text, "Please select your device:");
y_text+=20;
x_text += 24;
#ifdef HW_RVL
if(DEVICES[DEV_WIISD]){
DrawText(x_text, y_text, "Wii Front SD slot");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_WIISD;
break;
}
}
}
if(DEVICES[DEV_WIIUSB]){
DrawText(x_text, y_text, "USB storage device");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_WIIUSB;
break;
}
}
}
if(DEVICES[DEV_GCSDA]){
DrawText(x_text, y_text, "Slot A SD Gecko");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDA;
break;
}
}
}
if(DEVICES[DEV_GCSDB]){
DrawText(x_text, y_text, "Slot B SD Gecko");
y_text=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDB;
break;
}
}
}
#else
if(DEVICES[DEV_GCSDC]){
DrawText(x_text, y_text, "SD2SP2");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDC;
break;
}
}
}
if(DEVICES[DEV_GCSDA]){
DrawText(x_text, y_text, "Slot A SD Gecko");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDA;
break;
}
}
}
if(DEVICES[DEV_GCSDB]){
DrawText(x_text, y_text, "Slot B SD Gecko");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCSDB;
break;
}
}
}
if(DEVICES[DEV_GCODE]){
DrawText(x_text, y_text, "GC Loader");
y_text+=15;
for (i=0;i<4;i++)
{
if (!selected2device[i])
{
selected2device[i]=DEV_GCODE;
break;
}
}
}
#endif
//Draw cursor
y_text= y+40;
x_text = x+20;
switch (selected)
{
case 0:
DrawText(x_text, y_text, ">>");
break;
case 1:
DrawText(x_text, y_text+15, ">>");
break;
case 2:
DrawText(x_text, y_text+15+15, ">>");
break;
case 3:
DrawText(x_text, y_text+15+15+15, ">>");
break;
default:
break;
}
}//end if (draw)
p = PAD_ButtonsDown (0);
#ifdef HW_RVL
wp = WPAD_ButtonsDown (0);
#endif
if (p & PAD_BUTTON_A
#ifdef HW_RVL
|| wp & WPAD_BUTTON_A
#endif
)
{
//Do something
return selected2device[selected];
}
if (p & PAD_BUTTON_DOWN
#ifdef HW_RVL
|| wp & WPAD_BUTTON_DOWN
#endif
)
{
selected +=1;
if (selected >= DEVICES[DEV_NUM]) selected = 0;
draw = 1;
}
if (p & PAD_BUTTON_UP
#ifdef HW_RVL
|| wp & WPAD_BUTTON_UP
#endif
)
{
selected -=1;
if (selected < 0) selected = DEVICES[DEV_NUM]-1;
draw = 1;
}
//char msg[256];
//sprintf(msg, "Selected device: %d Total %d DN%d SDA%d SDB%d SDC%d GL%d WSD%d WU%d", selected, DEVICES[DEV_NUM], DEVICES[1],DEVICES[2],DEVICES[3],DEVICES[4],DEVICES[5],DEVICES[6] );
/*
#define DEV_NUM 0
#define DEV_GCSDA 1
#define DEV_GCSDB 2
#define DEV_GCSDC 3
#define DEV_GCODE 4
#define DEV_WIISD 5
#define DEV_WIIUSB 6
*/
//writeStatusBar(msg, "");
ShowScreen();
}//end while(1)
}
return 0;
}
/****************************************************************************
* Main
****************************************************************************/
@ -1271,10 +1147,10 @@ int main (int argc, char *argv[])
#ifdef HW_RVL
initialise_power();
//have_sd = initFAT(WaitPromptChoice ("Use internal SD or FAT32 USB device?", "USB", "SD"));
#endif
detect_devices();
//Check for command line
if (argc > 1)
{
@ -1376,77 +1252,11 @@ int main (int argc, char *argv[])
}
if (CUR_DEVICE) have_sd = initFAT(CUR_DEVICE);
//Set correct memory card slot when SD gecko is selected device
if (CUR_DEVICE == DEV_GCSDB) MEM_CARD = 0;
else if (CUR_DEVICE == DEV_GCSDA) MEM_CARD = 1;
/*
u32 p = PAD_ButtonsHeld(0);
//First try for a SD2SP2 device
SD2SP2 = 1;
u8 ask_device = 0;
if (argc > 1)
{
if (!strcmp(argv[1], "ask"))
{
ask_device = 1;
}
else if (!strcmp(argv[1], "sdgecko"))
{
SD2SP2 = 0;
ask_device = 2;
}
}
//If Z trigger or A button is held in startup, ask for device to use, regardless of bootup
if ( p & PAD_BUTTON_A || p & PAD_TRIGGER_Z)
{
SD2SP2 = 1;
ask_device = 1;
}
if (SD2SP2)
{
__io_gcsd2.startup();
if (__io_gcsd2.isInserted() && ask_device != 2)
{
if (ask_device == 1 )
{
writeStatusBar("Use SD2SP2 or SD Gecko?", "B = SD Gecko : A = SD2SP2");
WaitRelease();
SD2SP2 = WaitPromptChoice ("Use SD2SP2 or SD Gecko?", "SD Gecko", "SD2SP2");
}
if(SD2SP2)
{
if (!fatMountSimple ("fat", &__io_gcsd2))
{
WaitPrompt("SD2SP2 detected, but Error mounting fat! Trying SD Gecko");
SD2SP2 = 0;
}else
{
writeStatusBar("SD2SP2 mounted!", ""); //Also refreshes screen and makes version string appear
//WaitPrompt("SD2SP2 mounted!");
have_sd = 1;
}
}
}
else
{
//WaitPrompt("SD2SP2 not detected!");
SD2SP2 = 0;
}
}
if (!SD2SP2) //Ask where SD gecko is located if no SD2SP2 is detected
{
//Returns 1 (memory card in slot B, sd gecko in slot A) if A button was pressed and 0 if B button was pressed
MEM_CARD = WaitPromptChoice ("Please select the slot where SD Gecko is inserted", "SLOT B", "SLOT A");
have_sd = initFAT(MEM_CARD);
}
#endif
*/
selector_flag = 0;
skip_selector = 0;
for (;;)