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 

sceIoWrite MiltiLine Writing?

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



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Mon Sep 24, 2007 1:23 pm    Post subject: sceIoWrite MiltiLine Writing? Reply with quote

hmm i have started developing with C++ like 4 days ago and i need to write some text on multiple lines of a text file.

I have tried alot of ways,some one told me that sceioWrite doesn't accept \n
so i tried passing it from sprintf but when i checked the text file it writed the text but in the part where the \n was there was a small square but dint jump to the next line. >_<

Help will be greatly appreciated.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Sep 24, 2007 2:46 pm    Post subject: Re: sceIoWrite MiltiLine Writing? Reply with quote

AntiBNI wrote:
hmm i have started developing with C++ like 4 days ago and i need to write some text on multiple lines of a text file.

I have tried alot of ways,some one told me that sceioWrite doesn't accept \n
so i tried passing it from sprintf but when i checked the text file it writed the text but in the part where the \n was there was a small square but dint jump to the next line. >_<

Help will be greatly appreciated.


Are you in unix or windows? It makes a difference. If you have to ask how to do line feeds for unix vs windows, you aren't ready for this. Go take some classes, then try again.
Back to top
View user's profile Send private message AIM Address
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Mon Sep 24, 2007 8:34 pm    Post subject: Reply with quote

Im on Windows.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Sep 24, 2007 9:25 pm    Post subject: Reply with quote

AntiBNI wrote:
Im on Windows.


Write "\r\n" instead... or alternatively open the text file with a better thing that notepad. (worpad would do it).

I never understood why microsoft didn't make notepad to understand unix text files but they did with wordpad.... oh well, maybe they haven't touched the code of notepad in years :p
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Mon Sep 24, 2007 9:29 pm    Post subject: Reply with quote

on windows a newline should coupled with a carriage return, so use "\r\n". Anyway I recommend that you learn how to program on a normale PC. PSP is a bit complex and not easily debuggable.
Back to top
View user's profile Send private message
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Tue Sep 25, 2007 1:33 am    Post subject: Reply with quote

I tried that the first time but when i saw the text there was multiple lines but they where in the following order:

(X)
"1 blank space"(O)"small squarebox"
"4blank spaces"Trangle

I opened it on Notepad,im in university right now so i can't check it with wordpad or Notepad++.

So,if i put \r\n windows doesn't read it but the psp will,right?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Tue Sep 25, 2007 8:14 am    Post subject: Reply with quote

I checked with Notepad++ and Word pad and Word pad shows 2small square boxes (Null Spaces) at the beginning of the text.

Notepad++ shows 2 null spaces.

I guess sceIoRead should read them right.

**Out of topic**

I have another question.

i know that the psp has 480 x 272 in pixels but,when i put 240x136,the text doesn't appear because is WAAAY out of the screen.

but when i put 16x16 the text appears allmost at the center of the screen;i need to know the dimensions of the text on screen so i can calculate and put the text in the right place.

Thanks to every one for helping me ^_^
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Tue Sep 25, 2007 8:24 am    Post subject: Reply with quote

AntiBNI wrote:
i know that the psp has 480 x 272 in pixels but,when i put 240x136,the text doesn't appear because is WAAAY out of the screen.

but when i put 16x16 the text appears allmost at the center of the screen;i need to know the dimensions of the text on screen so i can calculate and put the text in the right place.
You haven't told us how you're displaying text. For example pspDebugScreenPrintf, GU, SDL, etc. If it's pspDebugScreenPrintf then the coordinates aren't in pixels, it's in characters, so 0,1 would be the second row.
_________________
(+[__]%)
Back to top
View user's profile Send private message
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Tue Sep 25, 2007 8:38 am    Post subject: Reply with quote

I'm using pspDebugScreenPrintf,how many rows are?if its not too much to ask ^_^
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue Sep 25, 2007 9:08 am    Post subject: Reply with quote

68 columns by 34 rows I think
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Sep 25, 2007 9:16 am    Post subject: Reply with quote

TyRaNiD wrote:
68 columns by 34 rows I think


Yes, that's the figure precisely. I measured that out months ago for stuff I was doing.
Back to top
View user's profile Send private message AIM Address
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Tue Sep 25, 2007 11:01 am    Post subject: Reply with quote

Thanks a bunch!^_^

Help is greatly appreciated.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
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