Hacking Disk Read Error Fix

knowitall599

Banned!
OP
Banned
Joined
Oct 1, 2008
Messages
213
Trophies
0
XP
36
Country
United States
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
 

digitydogs

404 Error: Member Not Found
Member
Joined
Oct 19, 2008
Messages
1,387
Trophies
1
Location
Md,US
Website
Visit site
XP
95
Country
United States
waninkoko said:
Finally I finished my optimized read code. Now games work a bit faster
wink.gif


Also, thanks to WiiGator, now the read error is fixed and compatibility has increased.

Many games load perfectly from disc channel.

As you can see its already fixed just wait for the gamma. No need beating a dead horse.
 

Cyberxion

Well-Known Member
Newcomer
Joined
Sep 21, 2008
Messages
69
Trophies
0
XP
55
Country
United States
mihakase said:
Saying something without saying anything. Fucking with people again.
Looks to me like he's pointing out a potential problem in hopes that it'll help those with a bit more knowledge.
wink.gif


EDIT: And it also looks like those people already worked it out.
tongue.gif
 

mihakase

Member
Newcomer
Joined
Oct 23, 2008
Messages
13
Trophies
0
XP
2
Country
United States
Yeah and if you've seen his prior thread where he "fixed" some bug, you'll find that he worded things in nearly the same way.

"lol I found something wrong and changed something which fixed it, DL!!"

The result?
-People experienced placebos
-Even people who actually knew what they were doing didn't understand *why* his change/changes worked
-One (or a few) concluded that he was touching code that was irrelevant to the backup loading process to begin with
-Two people called him out for just fucking with people

The only difference here is this:
"lol I found something but I think this could help! dunno why so have at it programmers!"

Besides, I thought it had already been established that the disk read error problem isn't within the loaders themselves.
 

luccax

Well-Known Member
Newcomer
Joined
Sep 19, 2007
Messages
96
Trophies
0
XP
87
Country
Brazil
knowitall599 said:
Ahh...I see now thanks luccax, but what is the difference?
That happens when loading the game, Game's disk error will happen when the game's running. Everything's fine with DVD read error, if it was not, it would give that error.
 

roy_hu

Active Member
Newcomer
Joined
Oct 21, 2008
Messages
29
Trophies
0
XP
28
Country
United States
mihakase said:
Yeah and if you've seen his prior thread where he "fixed" some bug, you'll find that he worded things in nearly the same way.

"lol I found something wrong and changed something which fixed it, DL!!"

The result?
-People experienced placebos
-Even people who actually knew what they were doing didn't understand *why* his change/changes worked
-One (or a few) concluded that he was touching code that was irrelevant to the backup loading process to begin with
-Two people called him out for just fucking with people

The only difference here is this:
"lol I found something but I think this could help! dunno why so have at it programmers!"

Besides, I thought it had already been established that the disk read error problem isn't within the loaders themselves.
It was me that concluded his fix was nothing. He's fucking with people again this time. I don't even want to explain why the code he pointed out had no bug.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: With uremum