Path: chuka.playstation.co.uk!news From: "Peter Armstrong" Newsgroups: scee.yaroze.freetalk.english Subject: Re: loading an exe and using Exec() Date: Mon, 16 Apr 2001 13:33:58 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 71 Message-ID: <9bep1d$30s3@www.netyaroze-europe.com> References: <9bbp7u$t451@www.netyaroze-europe.com> NNTP-Posting-Host: host213-122-129-122.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 "Matt Verran" wrote in message news:9bbp7u$t451@www.netyaroze-europe.com... > Hi All > > I spent the whole of yesterday puzzling over this yaroze problem. I'm trying > to load and execute an exe file from disk, which would allow yarozers the > ability to play update disks (gta london, beatmania 2, 3, 4, 5, etc) without > the original disk. > > I used the following code to (I think) successfully load the yaroze boot > disk app and execute it: > > if( CdSearchFile(0, "\\DTL_S30.35;1") == 0 ) > { > printf("\n not found \n"); > } > else > { > printf("\n found \n"); > > exec_struct = CdReadExec( "\\DTL_S30.35;1" ); > > result = CdReadSync(0, 0); > > printf("\n loaded, result: %d \n\n", result); > > if (result==0) > { > printf("\n executing \n"); > EnterCriticalSection(); > Exec(exec_struct, 0, 0); > ExitCriticalSection(); > } > } > > But all the other disks I tried, FF8, OPM coverdisks, beatmania 2, first had > trouble with the CdSearchFile() function, they didn't find the file 100% of > the time. Then always failed at the CdReadExec/CdReadSync statements, I just > got timeouts. > > I though it might be that the CdReadExec is trying to overwrite the current > code that is executing, but if I quit after the timeout and reexecute the > proggy it works fine. I also wondered if the filesystem has to be reset > somehow if the disk is changed? I would have said CdReadExec overwriting data is the problem. The yaroze boot exe loads in at 80090000, as long as your own program is located higher in memory it won't cause any problems. Most commercial game exe's load in below 80090000, over yaroze system data, and may well be overwriting data and functions still associated with your program. For example CdReadExec could load an exe over the position of CdReadSync, and as this is the next call in your program it would fail. You say you're getting timeouts rather than lock-ups though, which is what I've been getting, so perhaps there's another reason. You may be able to get some exe's to run, as long as they don't overwrite anything vital. You could try using the Load() function instead of CdReadExec, if you can get it to work, I've had nothing but lock-ups with it and LoadTest(). Peter