Hacking External USB DVD drive

  • Thread starter Thread starter octalsys
  • Start date Start date
  • Views Views 1,706
  • Replies Replies 3

octalsys

New Member
Newbie
Joined
Jan 20, 2009
Messages
2
Reaction score
0
Trophies
1
XP
151
Country
Hi, just wondering if anyone restricted with new Wii's DVD drive not being able to play DVD-R would be interested in a loader which instead of loading from External HDD would allow to load from External DVD drive. These drives are cheap and would allow you to still use DVD discs.

Don't know if any of the existing loaders plan to include this but maybe if there is enough interest they would consider it?
 
uLoader+Hermes cIOS.

Please use the Search next time, thank you.

(Btw: Why would you want this? Better switch to USB-Loading instead...I mean: DVD Drive+DVDs cost more than a simple HD...and you'll get better GUIs, faster loading times, no burning, etc..)
 
Nice one....should have known someone out there had already done it....

I'm an old-timer. Like using disc's

Cheers..
 
I found the code for External DVD for Wii, but it came from WiiMC forum. It don't have no .h file on it.

usbdvd_test.7z
usbdvd_test.c

And I found this, but this might help:

Code:
#include <gccore.h>
#include <wiiuse/wpad.h>

#include <fat.h>
#include <iso9660.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>


static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
const DISC_INTERFACE* usb = &__io_usbstorage;

int wait_button()
{
    u32 pressed = 0;
    while(1)
    { 
        WPAD_ScanPads();
        pressed = WPAD_ButtonsDown(0);
        if (pressed) break;
        VIDEO_WaitVSync();
    }
    return pressed;
}

static void initialise_video()
{
    VIDEO_Init();
    rmode = VIDEO_GetPreferredMode(NULL);
    xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
    console_init(xfb, 20, 20, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth * VI_DISPLAY_PIX_SZ);
    VIDEO_Configure(rmode);
    VIDEO_SetNextFramebuffer(xfb);
    VIDEO_SetBlack(FALSE);
    VIDEO_Flush();
    VIDEO_WaitVSync();
    if (rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync();
    printf("\x1b[2;0H");
    VIDEO_WaitVSync();
}

#define BUFFER_SIZE            0x8000
static u8 read_buffer[BUFFER_SIZE] __attribute__((aligned(32)));

//---------------------------------------------------------------------------------
int main(int argc, char **argv) {
//---------------------------------------------------------------------------------

    int i;
    u8 sector;

    initialise_video(); 
    WPAD_Init();
 
    printf("Press A when ready...\n");
    wait_button();

    while (1) {
     
        void USBStorage_Deinitialize();
        printf("USBStorage_Deinitialize...\n");
        USBStorage_Deinitialize();
        printf("Done\n");

        printf("startup...\n");
        usb->startup();
        printf("Done\n");
 
        usleep(1000000);
     
        printf("isInserted...\n");
        if(usb->isInserted())
        {
            printf("TRUE\n");
        } else {
            printf("FALSE... exiting\n");
            goto error;
        }
     
        sector = 16;
        if (!usb->readSectors(sector, 1, read_buffer)) {
            printf("readSectors failure reading sector %d\n", sector);
        }
     
        for(i=0; i<5; i++) {
            if (!ISO9660_Mount()) {
                printf("ISO9660_Mount failure... retry %d\n",i);
            } else break;
            usleep(1000000);
        }
        if (i==10) {
            printf("ISO9660_Mount failure... exiting\n");
            goto error;
        }
     
        DIR_ITER *pdir = NULL;
        struct stat statbuf;
        char filename[MAXPATHLEN];
 
        pdir = diropen("dvd:/VIDEO_TS");
        if (!pdir){
            printf ("ERROR: diropen() failure; terminating\n");
            goto error;
        }
 
        while (dirnext(pdir, filename, &statbuf)==0) {
            if(statbuf.st_mode & _IFDIR) {
                printf("%-8s  %s\n", "<dir>", filename);
            } else {
                printf("%8lld  %s\n", statbuf.st_size, filename);
            }
        }
        dirclose(pdir);
 
error:
        printf("Press A to retry, B to exit\n");
        if (wait_button()==WPAD_BUTTON_B)
            break;

    }
    return 0;
}
 
Last edited by knm,

Site & Scene News

Popular threads in this forum