diff --git a/HBC/META.XML b/HBC/META.XML index f63706f1..a34e55c9 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r870 - 200912192045 + 1.0 r871 + 200912192124 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller. diff --git a/source/bannersound.cpp b/source/bannersound.cpp index baa94f30..3abe5f0f 100644 --- a/source/bannersound.cpp +++ b/source/bannersound.cpp @@ -132,13 +132,13 @@ const u8 *LoadBannerSound(const u8 *discid, u32 *size) wbfs_disc_t *disc = WBFS_OpenDisc((u8 *) discid); if(!disc) { - WindowPrompt(tr("Can't find disc"), 0, tr("OK")); + // WindowPrompt(tr("Can't find disc"), 0, tr("OK")); return NULL; } wiidisc_t *wdisc = wd_open_disc((int (*)(void *, u32, u32, void *))wbfs_disc_read, disc); if(!wdisc) { - WindowPrompt(tr("Could not open Disc"), 0, tr("OK")); + //WindowPrompt(tr("Could not open Disc"), 0, tr("OK")); return NULL; } u8 * opening_bnr = wd_extract_file(wdisc, ALL_PARTITIONS, (char *) "opening.bnr"); @@ -156,7 +156,7 @@ const u8 *LoadBannerSound(const u8 *discid, u32 *size) const IMETHeader *imetHdr = (IMETHeader *)opening_bnr; if ( imetHdr->fcc != 0x494D4554 /*"IMET"*/ ) { - WindowPrompt(tr("IMET Header wrong."), 0, tr("OK")); + // WindowPrompt(tr("IMET Header wrong."), 0, tr("OK")); free(opening_bnr); return NULL; } @@ -177,7 +177,7 @@ const u8 *LoadBannerSound(const u8 *discid, u32 *size) const u8 *sound_bin = ((const u8 *)bnrArcHdr) + fst[i].fileOffset; if ( ((IMD5Header *)sound_bin)->fcc != 0x494D4435 /*"IMD5"*/ ) { - WindowPrompt(tr("IMD5 Header not right."), 0, tr("OK")); + // WindowPrompt(tr("IMD5 Header not right."), 0, tr("OK")); free(opening_bnr); return NULL; } @@ -190,7 +190,7 @@ const u8 *LoadBannerSound(const u8 *discid, u32 *size) u8 * uncompressed_data = uncompressLZ77(soundChunk, soundChunkSize, uncSize); if (!uncompressed_data) { - WindowPrompt(tr("Can't decompress LZ77"), 0, tr("OK")); + // WindowPrompt(tr("Can't decompress LZ77"), 0, tr("OK")); free(opening_bnr); return NULL; } diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index e07df37b..c99c04bb 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -32,7 +32,7 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co pagesize = THEME.pagesize; scrollbaron = (gameCnt > pagesize) ? 1 : 0; selectable = true; - listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset; + listOffset = MAX(0,MIN(offset,(gameCnt-pagesize))); selectedItem = selected - offset; focus = 1; // allow focus char imgPath[100]; @@ -158,7 +158,7 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co game[i]->SetSoundClick(btnSoundClick); gameIndex[i] = i; - } + } UpdateListEntries(); } @@ -258,7 +258,7 @@ int GuiGameBrowser::GetClickedOption() } int GuiGameBrowser::GetSelectedOption() -{ +{ int found = -1; for(int i=0; iUpdateEffects(); } - + void GuiGameBrowser::UpdateListEntries() { int next = listOffset; @@ -528,7 +528,7 @@ void GuiGameBrowser::Update(GuiTrigger * t) } if(scrollbarBoxBtn->GetState() == STATE_HELD && scrollbarBoxBtn->GetStateChan() == t->chan && t->wpad.ir.valid && gameCnt > pagesize) - { + { // allow dragging of scrollbar box scrollbarBoxBtn->SetPosition(width/2-18+7,0); int position = t->wpad.ir.y - 32 - scrollbarBoxBtn->GetTop(); @@ -615,7 +615,7 @@ void GuiGameBrowser::Update(GuiTrigger * t) } } } - + if(old_listOffset != listOffset) UpdateListEntries(); diff --git a/source/main.cpp b/source/main.cpp index a7dd4fc5..ec8c1905 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -16,7 +16,6 @@ #include #include #include - //#include extern "C" { extern void __exception_setreload(int t); @@ -185,16 +184,16 @@ main(int argc, char *argv[]) { // DEBUG_Init(GDBSTUB_DEVICE_USB, 1); //_break(); -// __exception_setreload(5);//auto reset code dump nobody gives us codedump info anyways. + __exception_setreload(5);//auto reset code dump nobody gives us codedump info anyways. gprintf("\n\n------------------"); gprintf("\nUSB Loader GX rev%s",GetRev()); gprintf("\nmain(%d", argc); for (int i=0;i"); - gprintf(")"); - - // This part is added, because we need a identify patched ios + gprintf(")"); + + // This part is added, because we need a identify patched ios printf("\n\tReloading into ios 236"); if (IOS_ReloadIOSsafe(236) < 0) { printf("\n\tIOS 236 not found, reloading into 36"); diff --git a/source/menu.cpp b/source/menu.cpp index 8ea8bd33..09aecc6f 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -291,6 +291,7 @@ int MainMenu(int menu) { switch (currentMenu) { case MENU_CHECK: + currentMenu = MenuCheck(); break; case MENU_FORMAT: diff --git a/source/menu/menu_disclist.cpp b/source/menu/menu_disclist.cpp index 66c02e15..74a89f96 100644 --- a/source/menu/menu_disclist.cpp +++ b/source/menu/menu_disclist.cpp @@ -17,7 +17,7 @@ #include "libwiigui/gui_searchbar.h" #define MAX_CHARACTERS 38 - +extern u8 * gameScreenTex; extern struct discHdr *dvdheader; extern u8 mountMethod; extern int load_from_fs; @@ -49,10 +49,11 @@ static u32 startat = 0; int MenuDiscList() { gprintf("\nMenuDiscList()"); + //TakeScreenshot("SD:/screenshot1.png"); __Menu_GetEntries(); int offset = MIN(startat,gameCnt-1); startat = offset; - gprintf("\n\tstartat:%d offset:%d",startat,offset); + //gprintf("\n\tstartat:%d offset:%d",startat,offset); int datag = 0; int datagB =0; int dataed = -1; @@ -182,11 +183,17 @@ int MenuDiscList() { GuiTrigger trigA; trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); GuiTrigger trigHome; - trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0); + trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, PAD_BUTTON_START); GuiTrigger trig2; trig2.SetButtonOnlyTrigger(-1, WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_X, 0); GuiTrigger trig1; trig1.SetButtonOnlyTrigger(-1, WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_Y, 0); + GuiTrigger trigZ; + trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z); + + GuiButton screenShotBtn(0,0); + screenShotBtn.SetPosition(0,0); + screenShotBtn.SetTrigger(&trigZ); char spaceinfo[30]; if (load_from_fs != PART_FS_WBFS) { @@ -576,6 +583,8 @@ int MenuDiscList() { w.Append(&settingsBtn); w.Append(&DownloadBtn); w.Append(&idBtn); + w.Append(&screenShotBtn); + // Begin Toolbar w.Append(&favoriteBtn); @@ -690,7 +699,8 @@ int MenuDiscList() { } } - if ((datagB<1)&&(Settings.cios==1)&&(Settings.video == ntsc)&&(Settings.hddinfo == hr12)&&(Settings.qboot==1)&&(Settings.wsprompt==0)&&(Settings.language==ger)&&(Settings.tooltips==0)){dataed=1;dataef=1;}if (dataef==1){if (cosa>7){cosa=1;}datag++;if (sina==3){wiiBtn.SetAlignment(ALIGN_LEFT,ALIGN_BOTTOM);wiiBtnImg.SetAngle(0);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),((datag*2)-130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==2){wiiBtn.SetAlignment(ALIGN_RIGHT,ALIGN_TOP);wiiBtnImg.SetAngle(270);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((-2*(datag)+130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((2*(datag)-120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==1){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(180);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(2*(datag)-120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==0){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(90);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((2*(datag)-130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((-2*(datag)+120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}} + + if ((datagB<1)&&(Settings.cios==1)&&(Settings.video == ntsc)&&(Settings.hddinfo == hr12)&&(Settings.qboot==1)&&(Settings.wsprompt==0)&&(Settings.language==ger)&&(Settings.tooltips==0)){dataed=1;dataef=1;}if (dataef==1){if (cosa>7){cosa=1;}datag++;if (sina==3){wiiBtn.SetAlignment(ALIGN_LEFT,ALIGN_BOTTOM);wiiBtnImg.SetAngle(0);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),((datag*2)-130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==2){wiiBtn.SetAlignment(ALIGN_RIGHT,ALIGN_TOP);wiiBtnImg.SetAngle(270);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((-2*(datag)+130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((2*(datag)-120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==1){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(180);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(2*(datag)-120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==0){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(90);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((2*(datag)-130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((-2*(datag)+120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}} // respond to button presses if (shutdown == 1) { gprintf("\n\tshutdown"); @@ -733,9 +743,9 @@ int MenuDiscList() { } } - } else if (gamecntBtn.GetState() == STATE_CLICKED && mountMethod!=3) { + } else if (gamecntBtn.GetState() == STATE_CLICKED && mountMethod!=3) { gprintf("\n\tgameCntBtn clicked"); - gamecntBtn.ResetState(); + gamecntBtn.ResetState(); char linebuf[150]; snprintf(linebuf, sizeof(linebuf), "%s %sGameList ?",tr("Save Game List to"), Settings.update_path); choice = WindowPrompt(0,linebuf,"TXT","CSV",tr("Back")); @@ -748,7 +758,15 @@ int MenuDiscList() { menu = MENU_DISCLIST; break; - } else if (homeBtn.GetState() == STATE_CLICKED) { + } + else if (screenShotBtn.GetState() == STATE_CLICKED) { + gprintf("\n\tscreenShotBtn clicked"); + screenShotBtn.ResetState(); + ScreenShot(); + gprintf("...It's easy, mmmmmmKay"); + + + }else if (homeBtn.GetState() == STATE_CLICKED) { gprintf("\n\thomeBtn clicked"); bgMusic->Pause(); choice = WindowExitPrompt(); @@ -1279,6 +1297,7 @@ int MenuDiscList() { idBtn.ResetState(); } + startat=gameBrowser->GetOffset(), offset=startat; } if (((gameSelected >= 0) && (gameSelected < (s32)gameCnt)) @@ -1540,8 +1559,8 @@ int MenuDiscList() { /*if (menu == MENU_EXIT) { SDCard_deInit(); }*/ - startat=selectImg1, offset=selectImg1;//save the variables in case we are refreshing the list - gprintf("\n\tstartat:%d offset:%d",startat,offset); + //if (Settings.gameDisplay==list) {startat=gameBrowser->GetOffset(), offset=startat;}//save the variables in case we are refreshing the list + //gprintf("\n\tstartat:%d offset:%d",startat,offset); HaltGui(); mainWindow->RemoveAll(); mainWindow->Append(bgImg); diff --git a/source/patches/fst.c b/source/patches/fst.c index f66c4c30..9fb4ce30 100644 --- a/source/patches/fst.c +++ b/source/patches/fst.c @@ -75,7 +75,7 @@ gprintf("\ndo_sd_code(%s)",filename); fseek(fp, 0, SEEK_END); filesize = ftell(fp); - if(filesize <= 16){ + if(filesize <= 16 || filesize>MAX_GCT_SIZE){ fclose(fp); sleep(2); USBDevice_deInit(); diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index fa837d9e..c5f10df8 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -696,9 +696,17 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, } + GuiTrigger trigZ; + trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z); + + GuiButton screenShotBtn(0,0); + screenShotBtn.SetPosition(0,0); + screenShotBtn.SetTrigger(&trigZ); + promptWindow.Append(&dialogBoxImg); promptWindow.Append(&titleTxt); promptWindow.Append(&msgTxt); + promptWindow.Append(&screenShotBtn); if (btn1Label) promptWindow.Append(&btn1); @@ -738,7 +746,12 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, choice = 3; } else if (btn4.GetState() == STATE_CLICKED) { choice = 0; - } + } else if (screenShotBtn.GetState() == STATE_CLICKED) { + gprintf("\n\tscreenShotBtn clicked"); + screenShotBtn.ResetState(); + ScreenShot(); + gprintf("...It's easy, mmmmmmKay"); + } if (count>0)count--; if (count==0) choice = 1; } @@ -1125,6 +1138,12 @@ int GameWindowPrompt() { trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0); GuiTrigger trigMinus; trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0); + GuiTrigger trigZ; + trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z); + + GuiButton screenShotBtn(0,0); + screenShotBtn.SetPosition(0,0); + screenShotBtn.SetTrigger(&trigZ); if (CFG.widescreen) snprintf(imgPath, sizeof(imgPath), "%swdialogue_box_startgame.png", CFG.theme_path); @@ -1255,6 +1274,7 @@ int GameWindowPrompt() { promptWindow.Append(&dialogBoxImg); promptWindow.Append(&nameBtn); promptWindow.Append(&playcntTxt); + promptWindow.Append(&screenShotBtn); promptWindow.Append(&btn2); if (!mountMethod)//stuff we don't show if it is a DVD mounted { @@ -1524,6 +1544,12 @@ int GameWindowPrompt() { } btnFavorite5.ResetState(); } + else if (screenShotBtn.GetState() == STATE_CLICKED) { + gprintf("\n\tscreenShotBtn clicked"); + screenShotBtn.ResetState(); + ScreenShot(); + gprintf("...It's easy, mmmmmmKay"); + } // this next part is long because nobody could agree on what the left/right buttons should do else if ((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)) {//next game promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50); @@ -3540,6 +3566,14 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version, btn2.SetAlignment(ALIGN_RIGHT, ALIGN_BOTTOM); btn2.SetPosition(-40, 2); + GuiTrigger trigZ; + trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z); + + GuiButton screenShotBtn(0,0); + screenShotBtn.SetPosition(0,0); + screenShotBtn.SetTrigger(&trigZ); + promptWindow.Append(&screenShotBtn); + promptWindow.Append(&dialogBoxImg); if (strcmp(long_description,""))promptWindow.Append(&whiteBoxImg); if (strcmp(long_description,""))promptWindow.Append(&scrollbarImg); @@ -3576,7 +3610,14 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version, choice = 1; } else if (btn2.GetState() == STATE_CLICKED) { choice = 0; - } else if ((arrowUpBtn.GetState()==STATE_CLICKED||arrowUpBtn.GetState()==STATE_HELD) ) { + } + else if (screenShotBtn.GetState() == STATE_CLICKED) { + gprintf("\n\tscreenShotBtn clicked"); + screenShotBtn.ResetState(); + ScreenShot(); + gprintf("...It's easy, mmmmmmKay"); + } + else if ((arrowUpBtn.GetState()==STATE_CLICKED||arrowUpBtn.GetState()==STATE_HELD) ) { if (long_descriptionTxt.GetFirstLine()>1) long_descriptionTxt.SetFirstLine(long_descriptionTxt.GetFirstLine()-1); usleep(60000); diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index 9bc18aaf..e4245c7c 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -26,6 +26,7 @@ #include "../wad/title.h" #include "../usbloader/getentries.h" #include "../usbloader/utils.h" +#include "../gecko.h" #define typei 0x00010001 @@ -294,8 +295,16 @@ int TitleBrowser(u32 type) { wifiBtn.SetAlpha(80); wifiBtn.SetTrigger(&trigA); + GuiTrigger trigZ; + trigZ.SetButtonOnlyTrigger(-1, WPAD_NUNCHUK_BUTTON_Z | WPAD_CLASSIC_BUTTON_ZL, PAD_TRIGGER_Z); + + GuiButton screenShotBtn(0,0); + screenShotBtn.SetPosition(0,0); + screenShotBtn.SetTrigger(&trigZ); + HaltGui(); GuiWindow w(screenwidth, screenheight); + w.Append(&screenShotBtn); w.Append(&settingsbackgroundbtn); w.Append(&titleTxt); w.Append(&cancelBtn); @@ -538,6 +547,12 @@ int TitleBrowser(u32 type) { exit = true; ret = -10; } + else if (screenShotBtn.GetState() == STATE_CLICKED) { + gprintf("\n\tscreenShotBtn clicked"); + screenShotBtn.ResetState(); + ScreenShot(); + gprintf("...It's easy, mmmmmmKay"); + } } CloseConnection(); diff --git a/source/sys.cpp b/source/sys.cpp index 93db1aab..b76e5e66 100644 --- a/source/sys.cpp +++ b/source/sys.cpp @@ -263,3 +263,20 @@ s32 IOS_ReloadIOSsafe(int ios) return r; } +#include + +void ScreenShot() +{ + time_t rawtime; + struct tm * timeinfo; + char buffer [80]; + char buffer2 [80]; + + time ( &rawtime ); + timeinfo = localtime ( &rawtime ); + //USBLoader_GX_ScreenShot-Month_Day_Hour_Minute_Second_Year.png + strftime (buffer,80,"USBLoader_GX_ScreenShot-%b%d%H%M%S%y.png",timeinfo); + sprintf(buffer2, "%s/config/%s", bootDevice, buffer); + + TakeScreenshot(buffer2); +} diff --git a/source/sys.h b/source/sys.h index c8f46954..2ee89d1b 100644 --- a/source/sys.h +++ b/source/sys.h @@ -1,7 +1,7 @@ #ifndef _SYS_H_ #define _SYS_H_ -void wiilight(int enable); +void wiilight(int enable); /* Prototypes */ void Sys_Init(void); @@ -10,17 +10,18 @@ void Sys_Shutdown(void); void Sys_ShutdownToIdel(void); void Sys_ShutdownToStandby(void); void Sys_LoadMenu(void); -void Sys_BackToLoader(void); +void Sys_BackToLoader(void); int Sys_ChangeIos(int ios); int Sys_IosReload(int IOS); bool Sys_IsHermes(); s32 IOS_ReloadIOSsafe(int ios); +void ScreenShot(); void ShowMemInfo(); extern s32 ios222rev; extern s32 ios223rev; extern s32 ios249rev; extern s32 ios250rev; - + #endif diff --git a/source/usbloader/apploader.c b/source/usbloader/apploader.c index 06f23b0b..76debeb8 100644 --- a/source/usbloader/apploader.c +++ b/source/usbloader/apploader.c @@ -346,9 +346,9 @@ void gamepatches(void * dst, int len, u8 videoSelected, u8 patchcountrystring, u NewSuperMarioBrosPatch(dst, len); - gprintf("\nLoading WIP Patch..."); + //gprintf("\nLoading WIP Patch..."); u32 ret = do_wip_code((u8 *)0x80000000); - gprintf("done\n", ret); + //gprintf("done\n", ret); //if(Settings.anti002fix == on) diff --git a/source/usbloader/disc.c b/source/usbloader/disc.c index b6ce364e..30a8c7b3 100644 --- a/source/usbloader/disc.c +++ b/source/usbloader/disc.c @@ -25,7 +25,7 @@ static u32 *buffer = (u32 *)0x93000000; static u8 *diskid = (u8 *)Disc_ID; void __Disc_SetLowMem(void) { - + *Sys_Magic = 0x0D15EA5E; // Standard Boot Code *Version = 0x00000001; // Version *Arena_L = 0x00000000; // Arena Low @@ -40,11 +40,11 @@ void __Disc_SetLowMem(void) { *Simulated_Mem = 0x01800000; // Simulated Memory Size //If the game is sam & max: season 1 put this shit in - char gameid[8]; - memset(gameid, 0, 8); - memcpy(gameid, (char*)Disc_ID, 6); - - if ((strcmp(gameid,"R3XE6U")==0) || (strcmp(gameid,"R3XP6V")==0)) + char gameid[8]; + memset(gameid, 0, 8); + memcpy(gameid, (char*)Disc_ID, 6); + + if ((strcmp(gameid,"R3XE6U")==0) || (strcmp(gameid,"R3XP6V")==0)) { *GameID_Address = 0x80000000; // Game ID Address } diff --git a/source/video.cpp b/source/video.cpp index 0b184363..743e82ae 100644 --- a/source/video.cpp +++ b/source/video.cpp @@ -15,6 +15,7 @@ #include #include "input.h" +#include "gecko.h" #include "libwiigui/gui.h" #include "settings/cfg.h" @@ -29,6 +30,9 @@ int screenheight; int screenwidth; u32 frameCount = 0; +u8 * gameScreenTex = NULL; // a GX texture screen capture of the game +u8 * gameScreenTex2 = NULL; // a GX texture screen capture of the game (copy) + /**************************************************************************** * UpdatePadsCB * @@ -457,3 +461,18 @@ void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexO GX_SetTevOp (GX_TEVSTAGE0, GX_PASSCLR); GX_SetVtxDesc (GX_VA_TEX0, GX_NONE); } +/**************************************************************************** + * TakeScreenshot + * + * Copies the current screen into a file "path" + ***************************************************************************/ +s32 TakeScreenshot(const char *path) +{ + gprintf("\nTakeScreenshot(%s)", path); + IMGCTX ctx = PNGU_SelectImageFromDevice (path); + s32 ret = PNGU_EncodeFromYCbYCr(ctx,vmode->fbWidth, vmode->efbHeight,xfb[whichfb],0); + PNGU_ReleaseImageContext (ctx); + gprintf(":%d", ret); + return 1; +} + diff --git a/source/video.h b/source/video.h index 040387da..bf2cca9d 100644 --- a/source/video.h +++ b/source/video.h @@ -20,6 +20,7 @@ void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[] void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexObj *texObj, f32 degrees, f32 scaleX, f32 scaleY, u8 alpha, int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX4, int YY4); void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled); +s32 TakeScreenshot(const char *path); extern int screenheight; extern int screenwidth;