Hacking USB Loader GX

  • Thread starter Thread starter blackb0x
  • Start date Start date
  • Views Views 8,066,428
  • Replies Replies 30,226
  • Likes Likes 74
OuahOuah said:
Ok, I was thinking that I could have a diff to patch only modified/updated file from SVN, without retrieving the entire file
frown.gif

I havent done it but I thought with the SVN update thing you can choose to download the WHOLE revision or just CHANGES... Then you could see what you have to re-edit.

QUOTE(priapism @ May 5 2009, 03:47 PM) does anybody have the default coordinates for the SD button, power button, and install button? i am using one of the later revs like around 265 (if that matters).
SD = x160 y390
power button = x576 y355
install button = x16 y355
 
would it ever be possible to replace the disc images with Opening.bnr files? That would be the best thing ever.
 
swarmster said:
Sazzles said:
Does anyone mind being kind enough to link me to the correct IOS222 (apparently older version) I need to use with this? Does this also fix the hdd spindown or not? (I srsly do not feel like breaking my hdd with hdparm)
QUOTE(Sazzles @ May 5 2009, 07:47 PM) Thanks dimok, just tested it and that is indeed the one. ^^

Does it fix your spindown issue? Just want to make things clear for people who are having the problem.

doesn't seem to fix it for me anyway. Still have to reset the drive after playing for a while :/ Very annoying!
 
dimok said:
I think this one is the right one:

http://www.megaupload.com/?d=B6FKSXFW

It was posted by M-A-F-I-A. But i dont know for sure and cant garantee for no damage to your system.

I myself dont use this and never have. The loader works great with waninkokos cIOS36 Rev10 for me.
thanks dimok that's very nice of you bro
wink.gif
 
BlindDude said:
Anyway to get the scrollbar on the left side of the game window?

Agreed, it's seldom you get scroll bar on the left. Nice for us lefties, I wished that from the beginning but since someone else said something, someone please?
 
anybody know of a disc-based nes / snes emulator ?

that would be a good solution for all the kiddies that are begging for channel launchers on their USB loader .
 
For switching the scrollbar to the left, here's what you need. Copy The code below over your old gamebrowser.cpp, you also need to flip the image for scrollbar.png and shrink the image for bg_options_entry.png by probably 6px. The text is aligned at 0 on the right, so it could probably be moved to -10 or something. Also in menu.cpp, the whole game browser could be moved right about 15px. The video is just with the following code and no other changes.
<a href="http://www.youtube.com/watch?v=tm_GkekDfv8" target="_blank">http://www.youtube.com/watch?v=tm_GkekDfv8</a>
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
/****************************************************************************
* libwiigui
*
* gui_gamebrowser.cpp
*
* GUI class definitions
***************************************************************************/

#include "gui.h"
#include "../wpad.h"

#include <unistd.h>
#include "gui_gamebrowser.h"
#include "../cfg.h"
#include "main.h"

#define GAMESELECTSIZE 30
extern const int vol;
/**
* Constructor for the GuiGameBrowser class.
*/
GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, const char *themePath, const u8 *imagebg, int selected, int offset)
{
width = w;
height = h;
this->gameCnt = gameCnt;
gameList = l;
pagesize = (gameCnt > PAGESIZE) ? PAGESIZE : gameCnt;
scrollbaron = (gameCnt > PAGESIZE) ? 1 : 0;
selectable = true;
listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset;
selectedItem = selected - offset;
focus = 1; // allow focus
char imgPath[100];

trigA = new GuiTrigger;
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigHeldA = new GuiTrigger;
trigHeldA->SetHeldTrigger(-1, WPAD_BUTTON_A, PAD_BUTTON_A);
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol);

snprintf(imgPath, sizeof(imgPath), "%sbg_options.png", themePath);
bgGames = new GuiImageData(imgPath, imagebg);

bgGameImg = new GuiImage(bgGames);
bgGameImg->SetParent(this);
bgGameImg->SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);

snprintf(imgPath, sizeof(imgPath), "%sbg_options_entry.png", themePath);
bgGamesEntry = new GuiImageData(imgPath, bg_options_entry_png);
if (scrollbaron == 1) {
snprintf(imgPath, sizeof(imgPath), "%sscrollbar.png", themePath);
scrollbar = new GuiImageData(imgPath, scrollbar_png);
scrollbarImg = new GuiImage(scrollbar);
scrollbarImg->SetParent(this);
scrollbarImg->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
scrollbarImg->SetPosition(0,4);//(-15, 4);

snprintf(imgPath, sizeof(imgPath), "%sscrollbar_arrowdown.png", themePath);
arrowDown = new GuiImageData(imgPath, scrollbar_arrowdown_png);
arrowDownImg = new GuiImage(arrowDown);
arrowDownOver = new GuiImageData(imgPath, scrollbar_arrowdown_png);
arrowDownOverImg = new GuiImage(arrowDownOver);
snprintf(imgPath, sizeof(imgPath), "%sscrollbar_arrowup.png", themePath);
arrowUp = new GuiImageData(imgPath, scrollbar_arrowup_png);
arrowUpImg = new GuiImage(arrowUp);
arrowUpOver = new GuiImageData(imgPath, scrollbar_arrowup_png);
arrowUpOverImg = new GuiImage(arrowUpOver);
snprintf(imgPath, sizeof(imgPath), "%sscrollbar_box.png", themePath);
scrollbarBox = new GuiImageData(imgPath, scrollbar_box_png);
scrollbarBoxImg = new GuiImage(scrollbarBox);
scrollbarBoxOver = new GuiImageData(imgPath, scrollbar_box_png);
scrollbarBoxOverImg = new GuiImage(scrollbarBoxOver);

arrowUpBtn = new GuiButton(arrowUpImg->GetWidth(), arrowUpImg->GetHeight());
arrowUpBtn->SetParent(this);
arrowUpBtn->SetImage(arrowUpImg);
arrowUpBtn->SetImageOver(arrowUpOverImg);
arrowUpBtn->SetImageHold(arrowUpOverImg);
arrowUpBtn->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
arrowUpBtn->SetPosition(-(width/2-18+7),-18);//(-10,-18);//(width/2+18-7,-18);
arrowUpBtn->SetSelectable(false);
arrowUpBtn->SetTrigger(trigA);
arrowUpBtn->SetEffectOnOver(EFFECT_SCALE, 50, 130);
arrowUpBtn->SetSoundClick(btnSoundClick);

snprintf(imgPath, sizeof(imgPath), "%stooltip.png", themePath);
ttarrow = new GuiImageData(imgPath, tooltip_png);
ttarrowUpImg = new GuiImage(ttarrow);

ttarrowUpTxt = new GuiText("Scroll up", 20, (GXColor){0, 0, 0, 255});

if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0){
arrowUpBtn->SetToolTip(ttarrowUpImg,ttarrowUpTxt, -45, 0);
}

arrowDownBtn = new GuiButton(arrowDownImg->GetWidth(), arrowDownImg->GetHeight());
arrowDownBtn->SetParent(this);
arrowDownBtn->SetImage(arrowDownImg);
arrowDownBtn->SetImageOver(arrowDownOverImg);
arrowDownBtn->SetImageHold(arrowDownOverImg);
arrowDownBtn->SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
arrowDownBtn->SetPosition(-(width/2-18+7),18);
arrowDownBtn->SetSelectable(false);
arrowDownBtn->SetTrigger(trigA);
arrowDownBtn->SetEffectOnOver(EFFECT_SCALE, 50, 130);
arrowDownBtn->SetSoundClick(btnSoundClick);

ttarrowDownImg = new GuiImage(ttarrow);
ttarrowDownTxt = new GuiText("Scroll down", 20, (GXColor){0, 0, 0, 255});

if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0){
arrowDownBtn->SetToolTip(ttarrowDownImg,ttarrowDownTxt, -5,-35);
}

scrollbarBoxBtn = new GuiButton(scrollbarBoxImg->GetWidth(), scrollbarBoxImg->GetHeight());///////////////
scrollbarBoxBtn->SetParent(this);
scrollbarBoxBtn->SetImage(scrollbarBoxImg);
scrollbarBoxBtn->SetImageOver(scrollbarBoxOverImg);
scrollbarBoxBtn->SetImageHold(scrollbarBoxOverImg);
scrollbarBoxBtn->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
scrollbarBoxBtn->SetSelectable(false);
scrollbarBoxBtn->SetEffectOnOver(EFFECT_SCALE, 50, 120);
scrollbarBoxBtn->SetMinY(0);
scrollbarBoxBtn->SetMaxY(height-30);
scrollbarBoxBtn->SetHoldable(true);
scrollbarBoxBtn->SetTrigger(trigHeldA);
}

gameIndex = new int[pagesize];
game = new GuiButton * [pagesize];
gameTxt = new GuiText * [pagesize];
gameBg = new GuiImage * [pagesize];

char buffer[CFG.maxcharacters + 4];

for(int i=0; i < pagesize; i++)
{
if (strlen(get_title(&gameList)) < (u32)(CFG.maxcharacters + 3))
{
sprintf(buffer, "%s", get_title(&gameList));
}
else
{
sprintf(buffer, get_title(&gameList), CFG.maxcharacters);
buffer[CFG.maxcharacters] = '';
strncat(buffer, "...", 3);
}

gameTxt = new GuiText(buffer, 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff});
gameTxt->SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
gameTxt->SetPosition(0,0);//(24,0);

gameBg = new GuiImage(bgGamesEntry);

game = new GuiButton(width-28,GAMESELECTSIZE);
game->SetParent(this);
game->SetLabel(gameTxt);
game->SetImageOver(gameBg);
game->SetPosition(25,GAMESELECTSIZE*i+4);
game->SetRumble(false);
game->SetTrigger(trigA);
game->SetSoundClick(btnSoundClick);
}
}

/**
* Destructor for the GuiGameBrowser class.
*/
GuiGameBrowser::~GuiGameBrowser()
{
if (scrollbaron == 1) {
delete arrowUpBtn;
delete arrowDownBtn;
delete scrollbarBoxBtn;
delete scrollbarImg;
delete arrowDownImg;
delete arrowDownOverImg;
delete arrowUpImg;
delete arrowUpOverImg;
delete scrollbarBoxImg;
delete scrollbarBoxOverImg;
delete scrollbar;
delete arrowDown;
delete arrowDownOver;
delete arrowUp;
delete arrowUpOver;
delete scrollbarBox;
delete scrollbarBoxOver;
}
delete bgGameImg;
delete bgGames;
delete bgGamesEntry;
delete ttarrow;
delete ttarrowUpImg;
delete ttarrowDownImg;
delete ttarrowDownTxt;
delete ttarrowUpTxt;

delete trigA;
delete btnSoundClick;

// delete optionBg;
for(int i=0; i<pagesize; i++)
{
delete gameTxt;
delete gameBg;
delete game;
}
delete [] gameIndex;
delete [] game;
delete [] gameTxt;
delete [] gameBg;
}

void GuiGameBrowser::SetFocus(int f)
{
focus = f;

for(int i=0; i<pagesize; i++)
game->ResetState();

if(f == 1)
game[selectedItem]->SetState(STATE_SELECTED);
}

void GuiGameBrowser::ResetState()
{
if(state != STATE_DISABLED)
{
state = STATE_DEFAULT;
stateChan = -1;
}

for(int i=0; i<pagesize; i++)
{
game->ResetState();
}
}

int GuiGameBrowser::GetOffset()
{
return listOffset;
}
int GuiGameBrowser::GetClickedOption()
{
int found = -1;
for(int i=0; i<pagesize; i++)
{
if(game->GetState() == STATE_CLICKED)
{
game->SetState(STATE_SELECTED);
found = gameIndex;
break;
}
}
return found;
}

int GuiGameBrowser::GetSelectedOption()
{
int found = -1;
for(int i=0; i<pagesize; i++)
{
if(game->GetState() == STATE_SELECTED)
{
game->SetState(STATE_SELECTED);
found = gameIndex;
break;
}
}
return found;
}

/****************************************************************************
* FindMenuItem
*
* Help function to find the next visible menu item on the list
***************************************************************************/

int GuiGameBrowser::FindMenuItem(int currentItem, int direction)
{
int nextItem = currentItem + direction;

if(nextItem < 0 || nextItem >= gameCnt)
return -1;

if(strlen(get_title(&gameList[nextItem])) > 0)
return nextItem;
else
return FindMenuItem(nextItem, direction);
}

/**
* Draw the button on screen
*/
void GuiGameBrowser::Draw()
{
if(!this->IsVisible())
return;

bgGameImg->Draw();

int next = listOffset;

for(int i=0; i<pagesize; i++)
{
if(next >= 0)
{
game->Draw();
game->DrawTooltip();
next = this->FindMenuItem(next, 1);
}
else
break;
}

if(scrollbaron == 1) {
scrollbarImg->Draw();
arrowUpBtn->Draw();
arrowDownBtn->Draw();
scrollbarBoxBtn->Draw();
arrowUpBtn->DrawTooltip();
arrowDownBtn->DrawTooltip();
scrollbarBoxBtn->DrawTooltip();
}
this->UpdateEffects();
}

void GuiGameBrowser::Update(GuiTrigger * t)
{
if(state == STATE_DISABLED || !t)
return;

int next, prev;
static int position2;
// scrolldelay affects how fast the list scrolls
// when the arrows are clicked
float scrolldelay = 3.5;


if (scrollbaron == 1) {
// update the location of the scroll box based on the position in the option list
arrowUpBtn->Update(t);
arrowDownBtn->Update(t);
scrollbarBoxBtn->Update(t);
}

next = listOffset;
char buffer[CFG.maxcharacters + 4];

for(int i=0; i<pagesize; i++)
{
if(next >= 0)
{
if(game->GetState() == STATE_DISABLED)
{
game->SetVisible(true);
game->SetState(STATE_DEFAULT);
}

if (strlen(get_title(&gameList[next])) < (u32)(CFG.maxcharacters + 3))
{
sprintf(buffer, "%s", get_title(&gameList[next]));
}
else
{
sprintf(buffer, get_title(&gameList[next]), CFG.maxcharacters);
buffer[CFG.maxcharacters] = '';
strncat(buffer, "...", 3);
}

gameTxt->SetText(buffer);
gameIndex = next;
next = this->FindMenuItem(next, 1);
}
else
{
game->SetVisible(false);
game->SetState(STATE_DISABLED);
}

if(focus)
{
if(i != selectedItem && game->GetState() == STATE_SELECTED)
game->ResetState();
else if(i == selectedItem && game->GetState() == STATE_DEFAULT)
game[selectedItem]->SetState(STATE_SELECTED, t->chan);
}

game->Update(t);

if(game->GetState() == STATE_SELECTED)
{
selectedItem = i;
}
}

// pad/joystick navigation
if(!focus)
return; // skip navigation

if (scrollbaron == 1) {

if (t->Down() ||
arrowDownBtn->GetState() == STATE_CLICKED || ////////////////////////////////////////////down
arrowDownBtn->GetState() == STATE_HELD)
{


next = this->FindMenuItem(gameIndex[selectedItem], 1);

if(next >= 0)
{
if(selectedItem == pagesize-1)
{
// move list down by 1
listOffset = this->FindMenuItem(listOffset, 1);
}
else if(game[selectedItem+1]->IsVisible())
{
game[selectedItem]->ResetState();
game[selectedItem+1]->SetState(STATE_SELECTED, t->chan);
selectedItem++;
}
scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);


}WPAD_ScanPads();
u8 cnt, buttons = NULL;
/* Get pressed buttons */
for (cnt = 0; cnt < 4; cnt++)
buttons |= WPAD_ButtonsHeld(cnt);
if (buttons == WPAD_BUTTON_A) {

} else {
arrowDownBtn->ResetState();

}

}
else if(t->Up() ||
arrowUpBtn->GetState() == STATE_CLICKED || ////////////////////////////////////////////up
arrowUpBtn->GetState() == STATE_HELD)
{
prev = this->FindMenuItem(gameIndex[selectedItem], -1);

if(prev >= 0)
{
if(selectedItem == 0)
{
// move list up by 1
listOffset = prev;
}
else
{
game[selectedItem]->ResetState();
game[selectedItem-1]->SetState(STATE_SELECTED, t->chan);
selectedItem--;
}
scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);


}

WPAD_ScanPads();
u8 cnt, buttons = NULL;
/* Get pressed buttons */
for (cnt = 0; cnt < 4; cnt++)
buttons |= WPAD_ButtonsHeld(cnt);
if (buttons == WPAD_BUTTON_A) {

} else {
arrowUpBtn->ResetState();

}
}

WPAD_ScanPads();
u8 cnt, buttons = NULL;/////////////////////////////////////////////////////scroll by holding B and tilt wiimote
int position1 = 0;


position1 = t->wpad.ir.y;

if (position2 == 0 && position1 > 0) {
position2 = position1;
}

for (cnt = 0; cnt < 4; cnt++)
buttons |= WPAD_ButtonsHeld(cnt);

if (buttons == WPAD_BUTTON_B && position1 > 0) {
scrollbarBoxBtn->ScrollIsOn(1);
if (position2 > position1) {

prev = this->FindMenuItem(gameIndex[selectedItem], -1);

if(prev >= 0)
{
if(selectedItem == 0)
{
// move list up by 1
listOffset = prev;
}
else
{
game[selectedItem]->ResetState();
game[selectedItem-1]->SetState(STATE_SELECTED, t->chan);
selectedItem--;
}
scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);


}

} else if (position2 < position1) {


next = this->FindMenuItem(gameIndex[selectedItem], 1);

if(next >= 0)
{
if(selectedItem == pagesize-1)
{
// move list down by 1
listOffset = this->FindMenuItem(listOffset, 1);
}
else if(game[selectedItem+1]->IsVisible())
{
game[selectedItem]->ResetState();
game[selectedItem+1]->SetState(STATE_SELECTED, t->chan);
selectedItem++;
}
scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);


}
}

} else if (!buttons) {
scrollbarBoxBtn->ScrollIsOn(0);
position2 = 0;
}

if(scrollbarBoxBtn->GetState() == STATE_HELD &&/////////////////////allow dragging of scrollbar box
scrollbarBoxBtn->GetStateChan() == t->chan &&
t->wpad.ir.valid && gameCnt > pagesize)
{
scrollbarBoxBtn->SetPosition(-(width/2-18+7),0);
int position = t->wpad.ir.y - 50 - scrollbarBoxBtn->GetTop();

listOffset = (position * gameCnt)/180 - selectedItem;

if(listOffset <= 0)
{
listOffset = 0;
selectedItem = 0;
}
else if(listOffset+pagesize >= gameCnt)
{
listOffset = gameCnt - pagesize;
selectedItem = pagesize-1;
}

}
int positionbar = 237*(listOffset + selectedItem) / gameCnt;

if(positionbar > 216)
positionbar = 216;
scrollbarBoxBtn->SetPosition(-(width/2-18+7), positionbar+8);


if(t->Right())/////////////////////////////////////////////////////skip pagesize # of games if right is pressed
{
if(listOffset < gameCnt && gameCnt > pagesize)
{
listOffset =listOffset+ pagesize;
if(listOffset+pagesize >= gameCnt)
listOffset = gameCnt-pagesize;
}
}
else if(t->Left())
{
if(listOffset > 0)
{
listOffset =listOffset- pagesize;
if(listOffset < 0)
listOffset = 0;
}
}

} else {


if(t->Down())/////////////////////////////////////////////////////if there isn't a scrollbar and down is pressed
{
next = this->FindMenuItem(gameIndex[selectedItem], 1);

if(next >= 0)
{
if(selectedItem == pagesize-1)
{
// move list down by 1
listOffset = this->FindMenuItem(listOffset, 1);
}
else if(game[selectedItem+1]->IsVisible())
{
game[selectedItem]->ResetState();
game[selectedItem+1]->SetState(STATE_SELECTED, t->chan);
selectedItem++;
}
}
}
else if(t->Up())///////////////////////////////////////////////////up
{
prev = this->FindMenuItem(gameIndex[selectedItem], -1);

if(prev >= 0)
{
if(selectedItem == 0)
{
// move list up by 1
listOffset = prev;
}
else
{
game[selectedItem]->ResetState();
game[selectedItem-1]->SetState(STATE_SELECTED, t->chan);
selectedItem--;
}
}
}
}

if(updateCB)
updateCB(this);
}
</div>


<b>This most likely won't be added as on option in the application due to the extra images involved, so don't ask.</b>
 
this loader code dumps whenever i access option menu with my classic controller.
i don't like wiimote so i always try to use my classic controller.
i can browse games fine, then browse thru option/about/install/settings (by pressing + on the classic controller), then when i go into the setting menu and try out some settings (again, with the classic controller) i get a code dump every time.
i guess it's not ready for a classic controller... yet..
 
dlxowhd said:
this loader code dumps whenever i access option menu with my classic controller.
i don't like wiimote so i always try to use my classic controller.
i can browse games fine, then browse thru option/about/install/settings (by pressing + on the classic controller), then when i go into the setting menu and try out some settings (again, with the classic controller) i get a code dump every time.
i guess it's not ready for a classic controller... yet..


There shouldnt be a problem. Please post this as an Issue and describe exactly what you do and what option you click on when it code dumps.
 
tagteam3283 said:
morning all,

where is the page size option?

what is flip x?

nice 1

Does anyone know how i can find the wad for the usbloader new video he made i can find it in all this writing on the first page

and how do i put cover on were do i put the covers and disc covers
 
HomebrewHackers said:
Does anyone know how i can find the wad for the usbloader new video he made i can find it in all this writing on the first page

and how do i put cover on were do i put the covers and disc covers

You're best off using a forwarding channel - that way you can update the loader on the SD card without messing about with wads.

The best way to make covers happen is to go in to options, then unlock - enter the default password - ab121b (you can change it once it has been unlocked). Then return to the main screen and click on the box - it will automatically download covers and disc art for you.
 
I'd like to request support for Guitar Hero guitars, for controlling. I can't get to the options menu without removing the wii remote, which gets a bit tedious, since I have to change the video options.
 
Hideous said:
I'd like to request support for Guitar Hero guitars, for controlling. I can't get to the options menu without removing the wii remote, which gets a bit tedious, since I have to change the video options.
That would be really nice indeed.

But you also could just save the setting for each game before starting it so you wouldn`t have to go into the options at all for games you already saved settings for
wink.gif
 

Site & Scene News

Popular threads in this forum