forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with sceIOwrite

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Sat Jun 30, 2007 9:15 am    Post subject: Problem with sceIOwrite Reply with quote

I need to write a wav header and Iīm using:

Code:
 
void GrabaWAV(char *name,int size){
  int sstg = sceIoOpen(name, PSP_O_WRONLY | PSP_O_CREAT , 0777);
  sceIoWrite(sstg, "RIFF",4*sizeof(char));
  sceIoWrite(sstg, size + 36,sizeof(int));  //This line has a problem
  sceIoWrite(sstg, "WAVE",4*sizeof(char));


The problem is: when the psp reaches the fourth line, it freezes and turns off. I canīt see the problem... :'(

Anybody can help me? Thanks ;)

Edit: Somebody could explain why it can write chars without any problems, but canīt write an integer?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Jun 30, 2007 10:23 am    Post subject: Reply with quote

Pay attention to the compiler warnings -- sceIoWrite doesn't take an integer as the second parameter, it takes a pointer. You probably wanted something like
Code:

int val = size + 36;
sceIoWrite(sstg, &val, sizeof(int));
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group