Requiem4d and any other coder NEEDS to hear this: I know why the disk read error is happening. After a little less than one hour of staring at code I found out why. I need some help from the more expirienced coders to nail this problem though. So, I am going to post some sections of code and I will provide a description after that. Here:
while (1)
{
void* dst = 0;
int len = 0,offset = 0;
int res = app_main(&dst, &len, &offset);
if (!res){
break;
}
dvddone = 0;
ret = bwDVD_LowRead(dst,len,offset,__dvd_readidcb);
while(ret>=0 && dvddone==0);
DCFlushRange(dst, len);
dogamehooks(dst,len);
if(vipatchon){
vidolpatcher(dst,len);
}
langpatcher(dst,len);
}
This while loop essentially makes the 1:1 backups compatible, but it contains a suspicious line. ret = bwDVD_LowRead(dst,len,offset,__dvd_readidcb); contains a very curious argument that may be the key to why we get the disk read error on 1:1 backups.
s32 bwDVD_LowReset(dvdcallbacklow cb)
{
s32 ret;
struct dicontext *ctx;
struct dicommand *cmd;
// printf("DVD_LowReset()\n");
__dvd_reqinprogress = 1;
ctx = __dvd_getcontext(cb);
if(ctx==NULL) return IPC_ENOMEM;
cmd = ctx->cmd;
cmd->diReg[0] = (IOCTL_DI_RESETdiReg,sizeof(struct dicommand),NULL,0,__dvd_iostransactionCB,ctx);
// printf("DVD_LowReset(%d)\n",ret);
return ret;
}
I do not know what this does but I believe it has something to do with reseting the dvd drive. This function definition takes has one parameter dvdcallbacklow which is coincidentally passed an argument that the backup launcher uses to read backup games in another function. Hang with me for a second coders because I think that the problem lies here.
while (1)
{
void* dst = 0;
int len = 0,offset = 0;
int res = app_main(&dst, &len, &offset);
if (!res){
break;
}
offset = offset
while (1)
{
void* dst = 0;
int len = 0,offset = 0;
int res = app_main(&dst, &len, &offset);
if (!res){
break;
}
dvddone = 0;
ret = bwDVD_LowRead(dst,len,offset,__dvd_readidcb);
while(ret>=0 && dvddone==0);
DCFlushRange(dst, len);
dogamehooks(dst,len);
if(vipatchon){
vidolpatcher(dst,len);
}
langpatcher(dst,len);
}
This while loop essentially makes the 1:1 backups compatible, but it contains a suspicious line. ret = bwDVD_LowRead(dst,len,offset,__dvd_readidcb); contains a very curious argument that may be the key to why we get the disk read error on 1:1 backups.
s32 bwDVD_LowReset(dvdcallbacklow cb)
{
s32 ret;
struct dicontext *ctx;
struct dicommand *cmd;
// printf("DVD_LowReset()\n");
__dvd_reqinprogress = 1;
ctx = __dvd_getcontext(cb);
if(ctx==NULL) return IPC_ENOMEM;
cmd = ctx->cmd;
cmd->diReg[0] = (IOCTL_DI_RESETdiReg,sizeof(struct dicommand),NULL,0,__dvd_iostransactionCB,ctx);
// printf("DVD_LowReset(%d)\n",ret);
return ret;
}
I do not know what this does but I believe it has something to do with reseting the dvd drive. This function definition takes has one parameter dvdcallbacklow which is coincidentally passed an argument that the backup launcher uses to read backup games in another function. Hang with me for a second coders because I think that the problem lies here.
while (1)
{
void* dst = 0;
int len = 0,offset = 0;
int res = app_main(&dst, &len, &offset);
if (!res){
break;
}
offset = offset