Path: chuka.playstation.co.uk!news From: Craig Graham Newsgroups: scee.yaroze.programming.codewarrior Subject: Re: Help with MWwrite() function Date: Fri, 09 Oct 1998 10:27:14 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 42 Message-ID: <361DD6F2.19EADE6C@hinge.mistral.co.uk> References: <361D1236.2107@manc.u-net.com> NNTP-Posting-Host: d2-s4-98-telehouse.mistral.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) James Shaughnessy wrote: > I would really appreciate help with this someone. Please! > I have posted some of the relevant code below, in case it's > obvious and to save you dloading the file and all that malarky. > > Anyhoo, the problem is that it currently saves 74000 bytes, as > opposed to the required 73728 (ie. exactly 72Kb == 0x12000), even > though the functions are being called with 0x12000 as data size. > The file it creates is MYPAL.DAT if you select "Save PAL replays" > and it's this that should be exactly 73728 bytes. Same for NTSC. > > http://www.netyaroze-europe.com/~shaughnj/ftp/help.zip > > // snippet from the cw_dsave program > // Saves PAL-demo memory block to host in MetroWerks CodeWarrior > void SaveRecordToHost() > { > int fd, bytes; > char *filename1 = "mypal.dat"; > void *data; > > data = (void *)(0x80196000); > fd = MWopen(filename1, FCREAT); Should be fd = MWopen(filename1, O_WRONLY|O_CREAT); > bytes = MWwrite(fd, data, 0x12000); // 0x12000 = 73728 bytes > MWclose(fd); > } > > I appreciate any help with this, Get an AR ;) > Jim Craig.