alfishe / priiloader

Automatically exported from code.google.com/p/priiloader
0 stars 0 forks source link

Add a selector of IOS at the start of the installer #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Like this ? => http://img338.imageshack.us/img338/8249/priiloaderselectios.png

int main(int argc, char **argv)
{
    s8 ios_patched = 0;
    s8 patches_applied = 0;
    u8 Cios_Detected = 0;
    u16 pDown;
    u16 GCpDown;

    CheckForGecko();
    VIDEO_Init();
    if(vmode == NULL)
        vmode = VIDEO_GetPreferredMode(NULL);
    xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode));
    if( CONF_GetAspectRatio() && (vmode->viTVMode == VI_NTSC || CONF_GetEuRGB60() || CONF_GetProgressiveScan()) )
    {
        gprintf("60hz 16:9 fix needed\n");
        console_init( xfb, 20, 20, vmode->fbWidth-8, vmode->xfbHeight, vmode->fbWidth*VI_DISPLAY_PIX_SZ );
    }
    else
        console_init( xfb, 20, 20, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth*VI_DISPLAY_PIX_SZ );
    VIDEO_Configure(vmode);
    VIDEO_SetNextFramebuffer(xfb);
    VIDEO_SetBlack(FALSE);
    VIDEO_Flush();
    VIDEO_WaitVSync();
    if (vmode->viTVMode&VI_NON_INTERLACE)
        VIDEO_WaitVSync();
    VIDEO_ClearFrameBuffer( vmode, xfb, COLOR_BLACK);
    VIDEO_WaitVSync();

    gprintf("resolution is %dx%d\n",vmode->viWidth,vmode->viHeight);
    printf("\x1b[2J");

        printf("\x1b[%u;%dm", 32, 1);
    printf("\n\n\n\n           \xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n");
    printf("           \xBA Priiloader ver 0.6b Preloader 0.30 Modification) \xBA\n");
    printf("           \xBA       Utilitaire d'installation/suppression      \xBA\n");
    printf("           \xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\n\n\n");
        printf("\x1b[%u;%dm", 37, 1);
    printf("      Veuillez choisir l'IOS \x85 utiliser pour l'installation du Priiloader:\n\n");
        printf("\x1b[%u;%dm", 33, 1);
    printf("                    IOS 36  (Par d\x82""faut)  : \x18 [HAUT]\n");
    printf("                    IOS 236               : \x19 [BAS]\n");
    printf("                    IOS 249 (Recommand\x82)  : \x1A [DROITE]\n");
    printf("                    IOS 250               : \x1B [GAUCHE]\n\n\n");

    WPAD_Init();
    PAD_Init();
    while(1)
    {
        WPAD_ScanPads();
        PAD_ScanPads();
        pDown = WPAD_ButtonsDown(0);
        GCpDown = PAD_ButtonsDown(0);
        if (pDown & WPAD_BUTTON_UP || GCpDown & PAD_BUTTON_UP)
        {
            WPAD_Shutdown();
            IOS_ReloadIOS(36);
            break;
        }
        if (pDown & WPAD_BUTTON_DOWN || GCpDown & PAD_BUTTON_DOWN)
        {
            WPAD_Shutdown();
            IOS_ReloadIOS(236);
            break;
        }
        if (pDown & WPAD_BUTTON_RIGHT || GCpDown & PAD_BUTTON_RIGHT)
        {
            WPAD_Shutdown();
            IOS_ReloadIOS(249);
            break;
        }
        if (pDown & WPAD_BUTTON_LEFT || GCpDown & PAD_BUTTON_LEFT)
        {
            WPAD_Shutdown();
            IOS_ReloadIOS(250);
            break;
        }
    }

    if (ISFS_Initialize() < 0)
    {
        abort("Echec de l'initailisation ISFS");
    }
    if (HaveNandPermissions())
    {
        ios_patched++;
    }
    else
    {
        printf("L'IOS %d n'est pas de patch ! Impossible d'obtenir les autorisations !\n",IOS_GetVersion());
        sleepx(5);
        exit(0);
    }

    printf("\x1b[2J");
    fflush(stdout);
    printf("\x1b[%u;%dm", 35, 1);
    printf("\n\n IOS %d rev %d\n\n",IOS_GetVersion(),IOS_GetRevision());
    printf("\x1b[%u;%dm", 32, 1);
    printf("           \xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n");
    printf("           \xBA Priiloader ver 0.6b Preloader 0.30 Modification) \xBA\n");
    printf("           \xBA       Utilitaire d'installation/suppression      \xBA\n");
    printf("           \xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\n\n\n");
    printf("\x1b[%u;%dm", 33, 1);
    printf("    [+] [LIRE ATTENTIVEMENT]:\n");
    printf("\x1b[%u;%dm", 37, 1);
    printf("        Ce programme est fourni sans aucune garantie !\n");
    printf("        Vous acceptez d'utiliser cet utilitaire \x85 vos propres risques.\n");
    printf("        Si vous n'\x88tes pas d'accord, \x82teignez votre wii.\n\n");
    printf("\x1b[%u;%dm", 33, 1);
    printf("    [+] [LISTE DES TOUCHES]:\n");
    printf("\x1b[%u;%dm", 37, 1);
    printf("        [+/A]                 : Installation du Priiloader rev %d\n", SVN_REV);
    printf("        [-/Y]                 : Suppression du Priiloader/Preloader\n");
    printf("        [HOME/Start]          : Quitter l'installeur\n\n");
    printf("\x1b[%u;%dm", 33, 1);
    printf("    [+] [CR\x90""DITS]:\n");
    printf("\x1b[%u;%dm", 37, 1);
    printf("        Code source d'origine                : Crediar\n");
    printf("        Ajout de fonctions                   : DacoTaco\n");
    printf("        Programmation de l'installeur        : phpgeek\n");
    printf("        Trad Allemande, Police du Priiloader : Black.Pearl & BoehserOnkel\n");
  printf("        Traduction Francaise                 : Safirion\n");

    WPAD_Init();
...

Original issue reported on code.google.com by gauthier...@gmail.com on 7 Jan 2011 at 9:24

GoogleCodeExporter commented 9 years ago
i dont see why that would be needed

the installer source in svn can be edited to use w/e ios to use (general ios 
that is always patched is 36 so thats what it uses)
the installer i officially use patches the ios on runtime so ye :/

Original comment by dac...@gmail.com on 7 Jan 2011 at 10:08

GoogleCodeExporter commented 9 years ago
I find it clearer for the selection of IOS because if IOS36 is the most 
patched, sometimes it is so only partially (only trucha) and we get the error: 
printf ("system menu Priiloader Ticket not found. \ n \ tTrying to read 
original ticket ... \ n "); (line 1223).
Moreover, if we maintain B for use an alternate IOS, it is still 36: 
"IOS_ReloadIOS (36);"(line 1688).

Original comment by gauthier...@gmail.com on 7 Jan 2011 at 11:01

GoogleCodeExporter commented 9 years ago
I believe ios selection would be an excellent addition to priiloader, either in 
the installer or from the meta.xml. Patching ios36 is becoming a dated relic, 
most softmods have abandoned ios36 in favor of ios236. Regardless, being able 
to install with an suitable ios of your choice would be a benefit to many.

Original comment by mauif...@gmail.com on 17 Mar 2011 at 12:02

GoogleCodeExporter commented 9 years ago
most softmods using ios 236 are by gbafail retards that believe in some 
retarded shit.
i dont.
i believe patching ios in general is outdated.
in its current state (0.7 BETA 1) no ios reload is needed and there seem to be 
no reports of it killing a wii, freezing, or anything for that matter. i still 
believe that IOS36 is to be the ios of choice since its the post patched, 
vanilla and existing ios to date. 249 is CIOS and that can go to hell (srry, 
but i have bad exp with cios and how it works). any other ios is either a made 
up one or not patched alot at all.

Original comment by dac...@gmail.com on 17 Mar 2011 at 3:59

GoogleCodeExporter commented 9 years ago

Original comment by dac...@gmail.com on 4 Apr 2011 at 7:14

GoogleCodeExporter commented 9 years ago
i decided not to do anything. my installer works fine and the open source one 
is just there for ppl looking for an installer to update channels, or install 
their own channel mods

Original comment by dac...@gmail.com on 23 Aug 2011 at 9:16