Some stupid newbish questions :D

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Pseudo ANIMALISTIC
Posts: 8
Joined: Sat May 14, 2005 7:32 am

Some stupid newbish questions :D

Post by Pseudo ANIMALISTIC »

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. :)
MikeDX
Posts: 30
Joined: Wed Oct 19, 2005 9:24 am

Post by MikeDX »

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?
InflamedSpirit
Posts: 14
Joined: Mon Oct 03, 2005 6:51 am

Post by InflamedSpirit »

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-a ... ethod.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 :)
User avatar
ReKleSS
Posts: 73
Joined: Sat Jun 18, 2005 12:57 pm
Location: Melbourne, Australia

Post by ReKleSS »

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
InflamedSpirit
Posts: 14
Joined: Mon Oct 03, 2005 6:51 am

Post by InflamedSpirit »

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 :)
Pseudo ANIMALISTIC
Posts: 8
Joined: Sat May 14, 2005 7:32 am

Post by Pseudo ANIMALISTIC »

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.
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-a ... ethod.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.
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
orphan frequently
Posts: 9
Joined: Thu Aug 11, 2005 1:52 pm

Post by orphan frequently »

#define printf pspDebugScreenPrintf

printf("dothemacarena");

pspDebugScreenClear();
Mike3285: wtf is a palindrome
MaroonSand: no its not dude
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

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.
Post Reply