CleanRip v1.0.4

Release threads for homebrew & utilities only
User avatar
emu_kidid
Site Admin
Posts: 4927
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

CleanRip v1.0.4

Post by emu_kidid » Sat Sep 25, 2010 8:52 am

CleanRip
Author: emu_kidid
(taken from http://code.google.com/p/cleanrip/)

Create 1:1 backups of your GC/Wii discs for archival purposes without any requirements for custom IOS (cIOS).

Whatsnew in 1.0.4:
* Added redump.org DAT file downloading
* Added more info to the dumpinfo.txt
* Fixed rip completion time not showing up
* Fixed NTFS issues (failed to create file/etc)

Features:
* FAT32 / NTFS file system support
* USB 2.0 support
* Front SD Support
* Gamecube / Wii / Wii Dual layer disc dumping
* BCA ripping to disk
* File Splitting (1,2,3GB (or Maximum file size - only on NTFS))
* MD5/SHA-1/CRC32 sums saved to disk
* Redump.org in-program verification for known rips

Example of dump information provided as of 1.0.4:

Code: Select all

--File Generated by CleanRip v1.0.4--

Filename: GMSP01
Internal Name: Super Mario Sunshine
MD5: 72C4860D8555D5E790628E348ABC244D
SHA-1: 26798080DE5E5C0F154915324C5C7DD6AA36056A
CRC32: 4C1D3641
Version: 1.00
Verified: Yes
FAQ:
Q. How do I use the redump.org verification to see if my rips are good?
A. Go to http://www.redump.org, click on downloads and then download the
"Nintendo GameCube datfile" and the "Nintendo Wii datfile". Extract the .dat from the
zip archives and place them on the root of the device you will be dumping to.
They must be named gc.dat (Gamecube) and wii.dat (Wii), otherwise they will not be found.
Until I implement http fetching of the file from within CleanRip, please make sure
you update the DAT files on your disk regularly.

Q. CleanRip tells me that my dump is not verified, is this a bad rip?
A. It might be. To be sure, go to redump.org and have a look at the game you're trying to rip.
If it doesn't exist on redump.org, then feel free to sign up to the forum and submit
your rip checksum. If it does exist, then make sure you've turned off any Gamecube/Wii
region patching from your modchip and also that the disc is as clean as can be. It might
help to try ripping it on another wii if possible.

Q. What is "New Device per chunk" I see when entering my Wii settings?
This is useful to set to "No" when you're ripping a large game (>4GB) to a large enough
FAT32 formatted device. This way, it'll automatically split your file based on the chunk
size and will not prompt you to insert the next storage device for the next piece.

Image
Web site:
http://code.google.com/p/cleanrip/

Cleanrip current version - Download
http://code.google.com/p/cleanrip/downloads/list
Image
ksadex
Posts: 3
Joined: Sat Sep 18, 2010 10:08 pm

Re: CleanRip v1.0.4

Post by ksadex » Sat Sep 25, 2010 1:54 pm

Just tested NTFS saving, works fine again, thanks a lot!
Sintendo
Posts: 60
Joined: Tue Sep 14, 2010 1:39 pm
Location: Belgium

Re: CleanRip v1.0.4

Post by Sintendo » Mon Sep 27, 2010 3:46 pm

Still haven't been able to rip a single Wii game successfully. I'm starting to suspect the libogc FAT32 library is just incredibly buggy/picky about what media you use. I've tried again using the front SD slot with a 4GB Micro SD card, but no luck. I gave up when I saw the speeds drop to 250KB/s.
User avatar
Cubelover
Posts: 313
Joined: Wed Apr 07, 2010 1:22 am

Re: CleanRip v1.0.4

Post by Cubelover » Mon Sep 27, 2010 5:10 pm

Sintendo wrote:Still haven't been able to rip a single Wii game successfully. I'm starting to suspect the libogc FAT32 library is just incredibly buggy/picky about what media you use. I've tried again using the front SD slot with a 4GB Micro SD card, but no luck. I gave up when I saw the speeds drop to 250KB/s.
Do you experience these issues with SuperDump or other dumpers too?
Sintendo
Posts: 60
Joined: Tue Sep 14, 2010 1:39 pm
Location: Belgium

Re: CleanRip v1.0.4

Post by Sintendo » Mon Sep 27, 2010 5:21 pm

Cubelover wrote:
Sintendo wrote:Still haven't been able to rip a single Wii game successfully. I'm starting to suspect the libogc FAT32 library is just incredibly buggy/picky about what media you use. I've tried again using the front SD slot with a 4GB Micro SD card, but no luck. I gave up when I saw the speeds drop to 250KB/s.
Do you experience these issues with SuperDump or other dumpers too?
I haven't used SuperDump, so I don't know. Besides, I'm not going to install any cIOS on my Wii.
User avatar
Cubelover
Posts: 313
Joined: Wed Apr 07, 2010 1:22 am

Re: CleanRip v1.0.4

Post by Cubelover » Mon Sep 27, 2010 7:04 pm

Sintendo wrote:I haven't used SuperDump, so I don't know. Besides, I'm not going to install any cIOS on my Wii.
Well, it's your choice :) there's technically no big difference betwenn IOS and cIOS and both are fully uninstallable with the only difference, that uninstalling cIOS cant brick your Wii ;)
IMaNOOB
Posts: 13
Joined: Mon Sep 20, 2010 8:05 pm

Re: CleanRip v1.0.4

Post by IMaNOOB » Tue Sep 28, 2010 7:35 pm

i cant burn games to my 8gb flash drive, and my sd card is too small (and has all the HB apps on it)

any ideas
droptic
Posts: 1
Joined: Wed Sep 29, 2010 1:36 am

Re: CleanRip v1.0.4

Post by droptic » Wed Sep 29, 2010 1:39 am

Hi

Clean rip support Hard Drive usb with WBFS?
User avatar
Cubelover
Posts: 313
Joined: Wed Apr 07, 2010 1:22 am

Re: CleanRip v1.0.4

Post by Cubelover » Wed Sep 29, 2010 9:56 am

droptic wrote:Hi

Clean rip support Hard Drive usb with WBFS?
No, use an USB loader of your choice if you wish to dump to WBFS partitions.
GrEvilKin
Posts: 11
Joined: Wed Sep 15, 2010 5:01 pm

Re: CleanRip v1.0.4

Post by GrEvilKin » Wed Sep 29, 2010 4:14 pm

Ok, I've has many problems with corrupt partitions, both NTFS and FAT32 in the past and still now but mainly NTFS.

Is there a way I can use libNTFS writing support even if I "Quick Remove" the hard drive in Windows? I kinda always forget to Safely Remove it cause I don't have to normally. I use FAT32 because of this and then merge the parts afterwards on my PC. Is there any way to solve this on your part?
epoch
Posts: 54
Joined: Thu Apr 01, 2010 2:23 pm

Re: CleanRip v1.0.4

Post by epoch » Sat Oct 02, 2010 6:23 am

Emu_kidid,

Does the DVD_LowRead64 function return data if you read past the disc end? what happens then?
could this be a way to identify the type of disc, and the size of the disc to dump it properly?

for example, trying to dump one block beyond the 4.5GB would mean DL Wii disc if it works, reading past 1.4GB would mean Wii disc and otherwise, a NGC disc...

also, is there a way to save the settings to the SD card and reuse them, instead of re-asking all the time the same settings even if i turn off and restart the wii?

if i can get my updated libOGC compiled this weekend, i'll check out what happens with the read function for dual layer discs/single layer disc and offer a patch if it works...
User avatar
emu_kidid
Site Admin
Posts: 4927
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: CleanRip v1.0.4

Post by emu_kidid » Sat Oct 02, 2010 1:24 pm

epoch,

My Dual Layer DVD Detection idea was to read past the single layer end of disc and check the error code returned from the drive. This worked ok on some drives, but others (modchipped in particular) wouldn't throw any error and would return empty data.
Image
WiiPower
Posts: 127
Joined: Sun May 23, 2010 5:57 pm

Re: CleanRip v1.0.4

Post by WiiPower » Sat Oct 02, 2010 5:28 pm

emu_kidid wrote:epoch,

My Dual Layer DVD Detection idea was to read past the single layer end of disc and check the error code returned from the drive. This worked ok on some drives, but others (modchipped in particular) wouldn't throw any error and would return empty data.
This should only happen with modchips that don't prevent 001 error correctly, as that's exactly what the 001 error check does.

What do these chips return if you try to read after the 2nd layer? If there's still no errror code, you should prompt the user for the sisze in that specific case.
User avatar
emu_kidid
Site Admin
Posts: 4927
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: CleanRip v1.0.4

Post by emu_kidid » Sun Oct 03, 2010 3:03 am

Yeah, good points, I just didn't have the time to code a proper solution up, nor will I for a while as I've been quite busy.
Image
IMaNOOB
Posts: 13
Joined: Mon Sep 20, 2010 8:05 pm

Re: CleanRip v1.0.4

Post by IMaNOOB » Sun Oct 03, 2010 2:51 pm

emu,
when you update cleanrip, do you know if the "Write fail" error will be fixed.

i tried burning 2 different games (both single layer, one im not sure of one, but its COD4 MWR) and i got a write error.
do you know what's up.

P.S. i used a fat32 formatted flash drive (8gb), its the only thing big enough i have that i can use
User avatar
Cubelover
Posts: 313
Joined: Wed Apr 07, 2010 1:22 am

Re: CleanRip v1.0.4

Post by Cubelover » Sun Oct 03, 2010 4:40 pm

IMaNOOB wrote:emu,
when you update cleanrip, do you know if the "Write fail" error will be fixed.

i tried burning 2 different games (both single layer, one im not sure of one, but its COD4 MWR) and i got a write error.
do you know what's up.

P.S. i used a fat32 formatted flash drive (8gb), its the only thing big enough i have that i can use
By saying "burning 2 different games" you mean actually putting an ISO to a writable Disc or just dumping an Image to an external device?
IMaNOOB
Posts: 13
Joined: Mon Sep 20, 2010 8:05 pm

Re: CleanRip v1.0.4

Post by IMaNOOB » Sun Oct 03, 2010 7:27 pm

Cubelover wrote:
IMaNOOB wrote:emu,
when you update cleanrip, do you know if the "Write fail" error will be fixed.

i tried burning 2 different games (both single layer, one im not sure of one, but its COD4 MWR) and i got a write error.
do you know what's up.

P.S. i used a fat32 formatted flash drive (8gb), its the only thing big enough i have that i can use
By saying "burning 2 different games" you mean actually putting an ISO to a writable Disc or just dumping an Image to an external device?
dumping the game to my usb flash drive
User avatar
emu_kidid
Site Admin
Posts: 4927
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: CleanRip v1.0.4

Post by emu_kidid » Sun Oct 03, 2010 11:58 pm

IMaNOOB wrote:emu,
when you update cleanrip, do you know if the "Write fail" error will be fixed.

i tried burning 2 different games (both single layer, one im not sure of one, but its COD4 MWR) and i got a write error.
do you know what's up.

P.S. i used a fat32 formatted flash drive (8gb), its the only thing big enough i have that i can use
What chunk size did you use?
Image
IMaNOOB
Posts: 13
Joined: Mon Sep 20, 2010 8:05 pm

Re: CleanRip v1.0.4

Post by IMaNOOB » Mon Oct 04, 2010 7:26 pm

emu_kidid wrote:
IMaNOOB wrote:emu,
when you update cleanrip, do you know if the "Write fail" error will be fixed.

i tried burning 2 different games (both single layer, one im not sure of one, but its COD4 MWR) and i got a write error.
do you know what's up.

P.S. i used a fat32 formatted flash drive (8gb), its the only thing big enough i have that i can use
What chunk size did you use?
i used max and 3gb (i only used 3gb once)

and the total amount of times i've tried dumping disks is like 4 or 5 and ever time failed
GrEvilKin
Posts: 11
Joined: Wed Sep 15, 2010 5:01 pm

Re: CleanRip v1.0.4

Post by GrEvilKin » Thu Oct 07, 2010 1:15 pm

emu_kidid wrote:Yeah, good points, I just didn't have the time to code a proper solution up, nor will I for a while as I've been quite busy.
I did some testing, I have a d2pro and the second layer returns what you last read, or if you didn't read anything yet it returns the first sector (GAMEID). I don't have a DL disc handy to test with one, but my guess is the first sector of the second layer does not contain the GAMEID, so just check that sector.

I plan on renting a DL game this afternoon, I'll send you my source when I get it working.
GrEvilKin
Posts: 11
Joined: Wed Sep 15, 2010 5:01 pm

Re: CleanRip v1.0.4

Post by GrEvilKin » Thu Oct 07, 2010 6:13 pm

Here's my code, I stripped down a lot of things that I didn't need, but the part you're after is between the DL detection comments in get_settings().

For regular users, this code includes:

- Only Wii games dumping
- DL detection on d2pro chips, possibility to change the DL if it's not right on some games (should work though)
- Dumping only on USB drive with enough space to hold the whole dump (expect errors otherwise)
- .bat file to import games on PC hard drive and auto delete files on the drive, change the directories in the code
- Dumping only on FAT drives
- All other original features have been stripped, including the UI, now in console mode

Use it all you want, I did this for myself only, so use it at your own risks, I won't update it beyond this point, so don't ask me.

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <gccore.h>
#include <errno.h>
#include <math.h>
#include <unistd.h>
#include <di/di.h>
#include <ogc/lwp_watchdog.h>
#include <ogc/usbstorage.h>
#include <sdcard/wiisd_io.h>
#include <wiiuse/wpad.h>
#include <ntfs.h>
#include <fat.h>
#include "gc_dvd.h"
#include "main.h"

static GXRModeObj *rmode = NULL;
static void *xfb = NULL;
static char gameName[32];
static char mountPath[512];
static char wpadNeedScan = 0;
static char padNeedScan = 0;
u32 iosversion = -1;
const DISC_INTERFACE* usb = &__io_usbstorage;
char txtbuffer[2048];
bool discIsDL = false;

u32 get_buttons_pressed() {
	WPADData *wiiPad;
	u32 buttons = 0;

	if (padNeedScan) {
		PAD_ScanPads();
		padNeedScan = 0;
	}
	if (wpadNeedScan) {
		WPAD_ScanPads();
		wpadNeedScan = 0;
	}

	u16 gcPad = PAD_ButtonsDown(0);
	wiiPad = WPAD_Data(0);

	if ((gcPad & PAD_BUTTON_B) || (wiiPad->btns_h & WPAD_BUTTON_B)) {
		buttons |= PAD_BUTTON_B;
	}
	if ((gcPad & PAD_BUTTON_A) || (wiiPad->btns_h & WPAD_BUTTON_A)) {
		buttons |= PAD_BUTTON_A;
	}
	if ((gcPad & PAD_BUTTON_LEFT) || (wiiPad->btns_h & WPAD_BUTTON_LEFT)) {
		buttons |= PAD_BUTTON_LEFT;
	}
	if ((gcPad & PAD_BUTTON_RIGHT) || (wiiPad->btns_h & WPAD_BUTTON_RIGHT)) {
		buttons |= PAD_BUTTON_RIGHT;
	}
	if ((gcPad & PAD_BUTTON_UP) || (wiiPad->btns_h & WPAD_BUTTON_UP)) {
		buttons |= PAD_BUTTON_UP;
	}
	if ((gcPad & PAD_BUTTON_DOWN) || (wiiPad->btns_h & WPAD_BUTTON_DOWN)) {
		buttons |= PAD_BUTTON_DOWN;
	}
	if ((gcPad & PAD_TRIGGER_Z) || (wiiPad->btns_h & WPAD_BUTTON_HOME)) {
		DI_Close();
		void (*rld)() = (void(*)()) 0x80001800;
		rld();
	}
	
	return buttons;
}

void wait_press_A() {
	printf("Press A to continue\r");
	while ((get_buttons_pressed() & PAD_BUTTON_A));
	while (!(get_buttons_pressed() & PAD_BUTTON_A));
	printf("                   \r");
}

static void InvalidatePADS() {
	padNeedScan = wpadNeedScan = 1;
}

static int have_hw_access() {
	if ((*(volatile unsigned int*) HW_ARMIRQMASK)
			&& (*(volatile unsigned int*) HW_ARMIRQFLAG)) {
		return 1;
	}
	return 0;
}

void ShutdownWii() {
	SYS_ResetSystem(SYS_POWEROFF, 0, 0);
}

static void Initialise() {
	VIDEO_Init();
	PAD_Init();
	CONF_Init();
	WPAD_Init();
	
	WPAD_SetIdleTimeout(120);
	WPAD_SetPowerButtonCallback((WPADShutdownCallback) ShutdownWii);
	SYS_SetPowerCallback(ShutdownWii);

	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_SetPostRetraceCallback(InvalidatePADS);
	VIDEO_SetBlack(FALSE);
	VIDEO_Flush();
	VIDEO_WaitVSync();
	if (rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync();
	
	// The console understands VT terminal escape codes
	// This positions the cursor on row 2, column 0
	printf("\x1b[%d;%dH", 2, 0);
}

/* FindIOS - borrwed from Tantric */
static int FindIOS(u32 ios) {
	s32 ret;
	u32 n;

	u64 *titles = NULL;
	u32 num_titles = 0;

	ret = ES_GetNumTitles(&num_titles);
	if (ret < 0)
		return 0;

	if (num_titles < 1)
		return 0;

	titles = (u64 *) memalign(32, num_titles * sizeof(u64) + 32);
	if (!titles)
		return 0;

	ret = ES_GetTitles(titles, num_titles);
	if (ret < 0) {
		free(titles);
		return 0;
	}

	for (n = 0; n < num_titles; n++) {
		if ((titles[n] & 0xFFFFFFFF) == ios) {
			free(titles);
			return 1;
		}
	}
	free(titles);
	return 0;
}

static void hardware_checks() {
	int ios58exists = FindIOS(58);
	
	if (!have_hw_access()) {
		printf("AHBPROT check failed!\r\n");
		printf("Please install the latest HBC!\r\n");
		wait_press_A();
	}
	if (ios58exists && iosversion != 58) {
		printf("IOS version check failed!\r\n");
		printf("IOS 58 exists but is not in use!\r\n");
		wait_press_A();
	}
	if (!ios58exists) {
		printf("IOS version check failed!\r\n");
		printf("Please install IOS58!\r\n");
		wait_press_A();
	}
}

static int initialise_dvd() {
	printf("Insert a Wii disc\r\n");
	wait_press_A();
	printf("Initialising disc ... ");
	
	int ret = init_dvd();

	if (ret == NO_DISC) {
		printf("no disc detected!\r\n");
	} else {
		printf("\r                      \r");
	}
	
	return ret;
}

static int initialise_device() {
	int ret = fatMountSimple("fat", usb);
	sprintf(&mountPath[0], "fat:/");
	
	if (ret != 1) {
		printf("Error mounting device [%08X]!\r\n", ret);
		wait_press_A();
	}

	return ret;
}

static void identify_disc() {
	char *readbuf = (char*)READ_BUFFER;
	
	DVD_LowRead64(readbuf, 2048, 0ULL);
	if (readbuf[0]) {
		strncpy(&gameName[0], readbuf, 6);
		printf("Game: %s\r\n", &gameName[0]);
	} else {
		printf("HUH??? Shouln'd happen, problem with game name!!!\r\n");
		wait_press_A();
	}
}

static void get_settings() {
	while ((get_buttons_pressed() & PAD_BUTTON_A));
	
	// DL detection start
	u32 endLBA = WII_D5_SIZE;
	char *readbuf = (char*)READ_BUFFER;
	DVD_LowRead64(readbuf, 2048, (u64) (((u64) endLBA) << 11));
	//printf("DL data: %s\r\n", readbuf);
	discIsDL = !(strcmp(&gameName[0], readbuf) == 0);
	// DL detection end
	
	while (1) {
		printf("Dual Layer: %s (press A to continue, L/R to change)\r", (discIsDL ? "Yes" : "No "));

		while (!(get_buttons_pressed() & (PAD_BUTTON_RIGHT | PAD_BUTTON_LEFT | PAD_BUTTON_A)));
		u32 btns = get_buttons_pressed();
		if(btns & PAD_BUTTON_RIGHT) {
			discIsDL = true;
		}
		if(btns & PAD_BUTTON_LEFT) {
			discIsDL = false;
		}
		if(btns & PAD_BUTTON_A) {
			break;
		}
		while (get_buttons_pressed() & (PAD_BUTTON_RIGHT | PAD_BUTTON_LEFT | PAD_BUTTON_A));
	}
	printf("\n");
	while(get_buttons_pressed() & PAD_BUTTON_B);
}

void prompt_new_file(FILE *fp, int chunk) {
	fclose(fp);
	fp = NULL;
	sprintf(txtbuffer, "%s%s_%i.bin", &mountPath[0], &gameName[0], chunk);
	remove(&txtbuffer[0]);
	fp = fopen(&txtbuffer[0], "wb");
	if (fp == NULL) {
		printf("Failed to create file %s!\r\n", txtbuffer);
		wait_press_A();
	}
}

void dump_info() {
	char infoLine[1024];
	memset(infoLine, 0, 1024);
	
	if (!discIsDL) {
		sprintf(infoLine, "@ECHO OFF\r\n"
						  "ECHO Transfering game %s...\r\n"
						  "copy /B %s_0.bin+%s_1.bin D:\\Data\\Roms\\WII\\%s.iso > NUL\r\n"
						  "DEL %s_0.bin\r\n"
						  "DEL %s_1.bin\r\n"
						  "DEL %s.bat\r\n", 
				&gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0]);
	} else {
		sprintf(infoLine, "@ECHO OFF\r\n"
						  "ECHO Transfering game %s...\r\n"
						  "copy /B %s_0.bin+%s_1.bin+%s_2.bin D:\\Data\\Roms\\WII\\%s.iso > NUL\r\n"
						  "DEL %s_0.bin\r\n"
						  "DEL %s_1.bin\r\n"
						  "DEL %s_2.bin\r\n"
						  "DEL %s.bat\r\n", 
				&gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0], &gameName[0]);
	}
	
	sprintf(txtbuffer, "%s%s.bat", &mountPath[0], &gameName[0]);
	remove(&txtbuffer[0]);
	FILE *fp = fopen(txtbuffer, "wb");
	if (fp) {
		fwrite(infoLine, 1, strlen(&infoLine[0]), fp);
		fclose(fp);
	}
}

void dump_game() {
	int opt_read_size = ONE_MEGABYTE;
	u32 previousLBA = 0;
	u32 startLBA = 0;
	u32 endLBA = (discIsDL ? WII_D9_SIZE : WII_D5_SIZE);
	u32 opt_chunk_size = 3 * ONE_GIGABYTE;
	char *buffer = (char*) READ_BUFFER;
	int ret = 0;
	int chunk = 1;

	sprintf(txtbuffer, "%s%s_0.bin", &mountPath[0], &gameName[0]);
	remove(&txtbuffer[0]);
	FILE *fp = fopen(&txtbuffer[0], "wb");
	if (fp == NULL) {
		printf("Failed to create file %s!\r\n", txtbuffer);
		wait_press_A();
	}

	long long copyTime = gettime();
	long long startTime = gettime();

	while (!ret && (startLBA + opt_read_size) < endLBA) {
		if (startLBA > (opt_chunk_size * chunk)) {
			prompt_new_file(fp, chunk);
			chunk++;
		}

		ret = DVD_LowRead64(buffer, (u32) (opt_read_size << 11), (u64) (((u64) startLBA) << 11));

		int bytes_written = fwrite(buffer, 1, (u32) (opt_read_size << 11), fp);
		if (bytes_written != (u32) (opt_read_size << 11)) {
			fclose(fp);
			printf("Write error!\r\n");
			wait_press_A();
		}

		if (get_buttons_pressed() & PAD_BUTTON_B) {
			ret = -61;
		}
		
		startLBA+=opt_read_size;
		
		int timePassed = diff_msec(copyTime, gettime());
		if (timePassed >= 1000) {
			copyTime = gettime();
			int msecPerRead = (((startLBA - previousLBA) << 11) / timePassed);
			u64 remainder = (endLBA - startLBA);
			u32 etaTime = (remainder / msecPerRead) * timePassed;
			printf("%i%% %dMb %4.0fkb/s - ETA %02d:%02d:%02d\r",
				(int)((float)((float)startLBA/(float)endLBA)*100),
				(int) (((u64) ((u64) startLBA << 11)) / (1024 * 1024)), 
  		        (float)(msecPerRead),
  		        (int)(((etaTime/1000)/60/60)%60),(int)(((etaTime/1000)/60)%60),(int)((etaTime/1000)%60));
  			previousLBA = startLBA;
		}
	}
	
	// Remainder of data ???
	if(!ret && startLBA < endLBA) {
		ret = DVD_LowRead64(buffer, (u32)((endLBA-startLBA)<<11), (u64)((u64)startLBA<<11));
		int bytes_written = fwrite(buffer, 1, (u32)((endLBA-startLBA)<<11), fp);
		if(bytes_written != (u32)((endLBA-startLBA)<<11)) {
			fclose(fp);
			printf("Write error!\r\n");
			wait_press_A();
		}
	}
	
	fflush(fp);
	fclose(fp);
	dvd_motor_off();
	
	if(ret != -61 && ret) {
	printf("\n");
		printf("Error: %s\r\n",dvd_error_str());
		wait_press_A();
	}
	else if (ret == -61) {
		printf("                                   \r");
		printf("Copy cancelled!\r\n");
		wait_press_A();
	}
	else {
		printf("                                   \r");
		printf("Copy completed in %d mins\r\n",diff_sec(startTime, gettime())/60);
		dump_info();
		wait_press_A();
	}
}

int main(int argc, char **argv) {
	int ret = 0;
	
	Initialise();
	iosversion = IOS_GetVersion();
	printf("CleanRip 1.0.4 by GrEvilKin based on emu_kidid's\r\n");
	hardware_checks();

	while (1) {
		ret = -1;
		while (ret != 1) {
			ret = initialise_device();
		}
		
		ret = NO_DISC;
		while (ret == NO_DISC) {
			ret = initialise_dvd();
		}
		
		identify_disc();
		get_settings();
		dump_game();
	}

	return 0;
}
Sintendo
Posts: 60
Joined: Tue Sep 14, 2010 1:39 pm
Location: Belgium

Re: CleanRip v1.0.4

Post by Sintendo » Sat Oct 09, 2010 2:56 pm

Just tried ripping Okami for a change using only my 2GB flash drive, but still zero successful rips so far. I used 1GB chunks and the first chunk seemed to be okay. After moving the files off the drive, I reinserted it for the second chunk. After the second chunk was done, the files I deleted from the flash drive had mysteriously reappeared. Since my 2GB flash drive can't fit two 1GB chunks, I couldn't copy the second chunk from the drive. Hex Workshop crashed when I tried viewing the second chunk and scrolled the end of the file (probably because it tried to go past the boundaries of my flash drive).

I tried this twice and the exact same thing happened every single time. I think something is really messed up in the FAT32 library.
IMaNOOB
Posts: 13
Joined: Mon Sep 20, 2010 8:05 pm

Re: CleanRip v1.0.4

Post by IMaNOOB » Sat Oct 09, 2010 8:49 pm

im going to try to rip to a ntfs partitioned pen drive
IMaNOOB
Posts: 13
Joined: Mon Sep 20, 2010 8:05 pm

Re: CleanRip v1.0.4

Post by IMaNOOB » Sun Oct 10, 2010 12:38 am

ok so i riped it to a ntfs and it worked but the MD5 or something didnt verify with redump.org, is it ok?

that game was COD4, and how do i run it without burning to a disk.
User avatar
emu_kidid
Site Admin
Posts: 4927
Joined: Mon Mar 29, 2010 10:06 am
Location: Australia
Contact:

Re: CleanRip v1.0.4

Post by emu_kidid » Sun Oct 10, 2010 3:23 am

IMaNOOB, no discussion about how to play backups illegally, thanks.

Sintendo, you must be doing something wrong, how does it work for everyone else? what OS are you using on the PC?
Image
Post Reply