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 

Some stupid newbish questions :D

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



Joined: 14 May 2005
Posts: 8

PostPosted: Sat Nov 12, 2005 12:22 am    Post subject: Some stupid newbish questions :D Reply with quote

Hey.
I'm interested in writing some small simple apps for the PSP making use of only text input and output.
I was looking for answers to the following questions:

1) What are the possible functions to use for:
a) "Printing" (wrong choice of word, I know :() a pixel at any one point of the screen. (In C or assembler.... or perhaps a possible routine that is writable that can perform such an action)
b) Clearing the screen.

2) What methods of text input (I've seen something about these around) are already available? Which is most "easy" to use?

I hope someone can point me somewhere where I can find answers to these questions, or give me a tip or two.
Thanks a lot for any responses, and sorry if these are the dumbest questions that have been asked on here. :)
Back to top
View user's profile Send private message
MikeDX



Joined: 19 Oct 2005
Posts: 30

PostPosted: Sat Nov 12, 2005 1:28 pm    Post subject: Reply with quote

using devkitpro/pspsdk and the samples you would very quickly be able to write a function to plot pixels in any colour you wish, clearing the screen is also very easy.

its just a case of setting up a buffer in memory, plotting pixels to it, and dumping it into a framebuffer from the gu*() commands.

do you have devkitpro setup?
Back to top
View user's profile Send private message
InflamedSpirit



Joined: 03 Oct 2005
Posts: 14

PostPosted: Sat Nov 12, 2005 1:37 pm    Post subject: Reply with quote

I was in the same boat a few weeks ago so I'll help if I can.

Well, from what I've heard, the Lua player is good for making small apps but I personally haven't tried it because I didn't really want to learn a whole new programming language. Fortunatly there are many text input functions that people have created for it if you want to just use a premade one. Heres one that I found on pspupdates that seems relativly easy to use: http://pspupdates.qj.net/2005/11/fast-analog-circular-text-entry-method.html

For some really basic graphics functions try http://www.freewebs.com/jason867/. I started by just examining his graphics.h file. It shows how to plot a single pixel through a pointer directly to the VRAM. A word of warning though, I never was able to get it to stop flickering when clearing, so you might also have difficulties.

For more advanced graphics I think your supposed to learn and understand all the Gu functions but I'm still working on that and wouldn't be a big help.

Hope that helps :)
Back to top
View user's profile Send private message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Sat Nov 12, 2005 1:44 pm    Post subject: Reply with quote

This is all over the forums already, but flickering is usually due to cache issues. Either write to uncached memory (see the wiki for the address to OR your addresses against) or flush the cache before you flip buffers (sceKernelDcacheWriteBackAll). Regarding the what MikeDX said, the sceGu functions aren't actually required - you can use the framebuffer alone, you only need system calls to turn on the screen and tell the hardware where to find the framebuffer. Learning to use the GU will lead to much better performance, however. Anyway, look around the samples for more details.
-ReK
Back to top
View user's profile Send private message
InflamedSpirit



Joined: 03 Oct 2005
Posts: 14

PostPosted: Sat Nov 12, 2005 1:58 pm    Post subject: Reply with quote

Quote:
This is all over the forums already

Really? I only saw one thread about it and in the end there was no definative answer except to switch over to the gu functions. Thanks though :)
Back to top
View user's profile Send private message
Pseudo ANIMALISTIC



Joined: 14 May 2005
Posts: 8

PostPosted: Sat Nov 12, 2005 2:12 pm    Post subject: Reply with quote

MikeDX wrote:
using devkitpro/pspsdk and the samples you would very quickly be able to write a function to plot pixels in any colour you wish, clearing the screen is also very easy.

its just a case of setting up a buffer in memory, plotting pixels to it, and dumping it into a framebuffer from the gu*() commands.

do you have devkitpro setup?

Nope... I just have the bare minimum-- all the binaries included in pspsdk plus the headers and libs.

Quote:
I was in the same boat a few weeks ago so I'll help if I can.

Well, from what I've heard, the Lua player is good for making small apps but I personally haven't tried it because I didn't really want to learn a whole new programming language. Fortunatly there are many text input functions that people have created for it if you want to just use a premade one. Heres one that I found on pspupdates that seems relativly easy to use: http://pspupdates.qj.net/2005/11/fast-analog-circular-text-entry-method.html

For some really basic graphics functions try http://www.freewebs.com/jason867/. I started by just examining his graphics.h file. It shows how to plot a single pixel through a pointer directly to the VRAM. A word of warning though, I never was able to get it to stop flickering when clearing, so you might also have difficulties.

For more advanced graphics I think your supposed to learn and understand all the Gu functions but I'm still working on that and wouldn't be a big help.


Thanks for the advice... but I don't think I could bare with Lua; I don't think I really have the time to get the hang of a new language. (Especially one almost totally different from C/C++/Java/Pike.... which is why I steer cleer of Python, Ruby and co. :D)
However, thanks for the link.. I'll be sure to look at it.

Quote:
This is all over the forums already, but flickering is usually due to cache issues. Either write to uncached memory (see the wiki for the address to OR your addresses against) or flush the cache before you flip buffers (sceKernelDcacheWriteBackAll). Regarding the what MikeDX said, the sceGu functions aren't actually required - you can use the framebuffer alone, you only need system calls to turn on the screen and tell the hardware where to find the framebuffer. Learning to use the GU will lead to much better performance, however. Anyway, look around the samples for more details.
-ReK

Thanks, I'll take a look at those functions and see what I can come out with. :D
Back to top
View user's profile Send private message
orphan frequently



Joined: 11 Aug 2005
Posts: 9

PostPosted: Sat Nov 12, 2005 5:54 pm    Post subject: Reply with quote

#define printf pspDebugScreenPrintf

printf("dothemacarena");

pspDebugScreenClear();
_________________
Mike3285: wtf is a palindrome
MaroonSand: no its not dude
Back to top
View user's profile Send private message
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Sat Nov 12, 2005 7:21 pm    Post subject: Reply with quote

Check out the p-sprint example included with the source, it uses direct pixel drawing to draw some lines, demonstrates printing text to the screen and it provides quite awesome text input :)

Danzel.
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