Wouldnt draw.c have to be functions and then call them in main.c
Printable View
Wouldnt draw.c have to be functions and then call them in main.c
never do that !!!!!!!!!!!!Zitat:
Zitat von slicer4ever
make an header and call one of the functions , lua isnt c , c are all functions wich you need to call , it isnt a structure of dofile from lua
Lawl.
Doing so is not incorrect, but is not very elegant :) Just *avoid* doing it...
is this the fastest way to clear the screen (in a color)?Code:void faClearScreen( const int color )
{
sceGuStart( GU_DIRECT, guList );
sceGuClearColor(color);// set current buffer coller
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);// clear the screen with the buffer color
sceGuFinish();
sceGuSync(0,0); //wait untill finished
}
yeahZitat:
Zitat von hallo007
Code:#include "main.h"
#include <pspctrl.h>
PSP_MODULE_INFO("ieeeeeep", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
void *guList; // display List, used by sceGUStart
void *fbp0; // frame buffer
int fps = 0; // for calculating the frames per second
char fpsDisplay[100];
u32 tickResolution;
u64 fpsTickNow;
u64 fpsTickLast;
int screensaver = 0;
void faClearScreen( const int color )
{
sceGuStart( GU_DIRECT, guList );
sceGuClearColor(color);// set current buffer coller
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);// clear the screen with the buffer color
sceGuFinish();
sceGuSync(0,0); //wait untill finished
}
void InitGU( void )
{
// Init GU
sceGuInit();
sceGuStart( GU_DIRECT, guList );
// Set Buffers
sceGuDrawBuffer( GU_PSM_8888, fbp0, BUF_WIDTH );
sceGuDispBuffer( SCR_WIDTH, SCR_HEIGHT, (void*)0x88000, BUF_WIDTH);
sceGuDepthBuffer( (void*)0x110000, BUF_WIDTH);
sceGuOffset(2048 - (SCR_WIDTH/2) , 2048 - (SCR_HEIGHT/2));
sceGuViewport( 2048, 2048, SCR_WIDTH, SCR_HEIGHT);
sceGuDepthRange( 65535, 0);
// Set Render States
sceGuScissor( 0, 0, SCR_WIDTH, SCR_HEIGHT);
sceGuEnable( GU_SCISSOR_TEST );
sceGuDepthFunc( GU_GEQUAL );
sceGuEnable( GU_DEPTH_TEST );
sceGuFrontFace( GU_CW );
sceGuShadeModel( GU_SMOOTH );
sceGuEnable( GU_CULL_FACE );
sceGuEnable( GU_CLIP_PLANES );
sceGuFinish();
sceGuSync(0,0);
sceDisplayWaitVblankStart();
sceGuDisplay(GU_TRUE);
// finish
}
int buttonpressed(SceSize argc, void* argv)
{
SceCtrlData pad;
while( 1 )
{
sceCtrlReadBufferPositive(&pad , 1);
if(pad.Buttons != 0)
{
screensaver = 0;
}
}
return 0;
}
int main_thread(SceSize argc, void* argv)
{
sceKernelDelayThread(6000000);
guList = memalign( 16, 640 );
fbp0 = 0;
int z =0;
InitGU();
SceCtrlData pad;
int color[5] = { 0x00FF0000 , 0x0000FF00 , 0x000000FF};
SceUID temp = sceKernelCreateThread("ScreenSaver",buttonpressed, 0x18, 0x10000, 0, 0);
if(temp >= 0)
{
sceKernelStartThread(temp, 0, 0);
}
while( 1 )
{
screensaver++;
sceKernelDelayThread(1000000);
while( screensaver > 40 )
{
faClearScreen(color[z]);
sceDisplayWaitVblankStart();
fbp0 = sceGuSwapBuffers();
(z == 2) ? z = 0 : z++;
}
}
sceGuTerm(); // Terminating the Graphics System
// Free Memory
free( guList );
free( fbp0 );
return 0;
}
int module_start(SceSize args, void *argp) {
int thid;
/* Create a high priority thread */
thid = sceKernelCreateThread("vshBlit", main_thread, 0x18, 0x1000, 0, NULL);
if(thid >= 0) sceKernelStartThread(thid, args, argp);
return 0;
}
It wont work , as eboot it works , but it dont work as prx :(Code:TARGET = screensaver
OBJS = main.o
BUILD_PRX = 1
PRX_EXPORTS = exports.exp
#USE_PSPSDK_LIBC = 1
INCDIR =
LIBDIR =
LIBS = -lpspgum -lpspgu -lpsprtc -lstdc++ -lm
LDFLAGS =
CFLAGS = -Os -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
PSPSDK = $(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak
exports:
psp-build-exports -s exports.exp
There is a reason I released DSX...Zitat:
Zitat von hallo007
-= Double Post =-
No, why do you call sceGuStart, sceGuFinish, or sceGuSync? Take those out and use DSX. It sets everything up for you which is really the point.Zitat:
Zitat von hallo007
I learning gnu myself , thats why i dont use it ;)
it's GU, not GNU. If you really want to learn, you should first take a step away from PRXes.Zitat:
Zitat von hallo007
And as FistPimp said, that's not the fastest method.
My point is that a GU setup for the XMB is not the same as in a game. You can use all of the GU calls you want with DSX, the important part is that it sets it up the right way.Zitat:
Zitat von hallo007
went back to game
whats faster?Code:void faClearScreen( const int color )
{
sceGuClearColor(color);// set current buffer coller
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);// clear the screen with the buffer color
}
:ROFL::Jump:Zitat:
Zitat von Raphael
Did I say FistPimp? I wanted to say FastPimp
Your posts are becoming more annoying everyday :down:Zitat:
Zitat von Mr305
U declared urself immature in the sig.whatelse do i say?Zitat:
Zitat von eldiablov
You spell like a dyslexic 2 year old. What else do I have to say?Zitat:
Zitat von Mr305
you class what else as one word. What else do i say?Zitat:
Zitat von Mr305
U cant even comprehend what's written in one's sig. Stop spammin'.Zitat:
Zitat von eldiablov
What i said huh ? too:
"Proof of Concept" is rather a big word --- should only be used with exploits and such big things and only when contradicting things....
Your sig:
"Proof of Concept" is rather a big word --- should only be used to contradict what has been stated before.
Bit of a difference don't you think ?
oke something else , i want to save the whole screen to a buffer a load it back again some time later
for example
screen is black , get saved to buffer
it becume white , now i want it back as first and load the buffer to screen
, does that work the same as taking a screenshot? if yes , i know how-to
damn! im typin 4m psp hence its so concise,Zitat:
Zitat von eldiablov
and its in my sig. and thats what i said be4. I aint wastin any more posts.
@hallo07 i think you need to save the variables that got u to a black screen otherwise your basically taking a screen shot
I have been trying to make a game but the problem is collision.Normal Width and height collision is to prehistoric and inefficient.I look around and could find any place that would how to Perfect Pixel Collision if somone has a source where i could find that inforplease post thanks.
Pixel perfect takes alot longer to calculate then bounding boxes, obviously, making even an inefficient bounding box collision detection faster. I highly dissuade you from using pixel perfect collision as it's not always faster then say 4 subdivided collision regions. I doubt what you're making won't look as good if, say you divided the image up into 3 small squares, resulting in more accurate collision response without sacrificing as many fps to calculate it.
But if you're still willing to try pixel pefect collision, some things need to be known. What will be 'not part of the image' space? black, white, pink, transparent? Will both objects be tried for pixel perfect collision (bounding box -> pixel perfect or pixel perfect -> pixel perfect)?
Last queston for two weeks:
can you after making a new thread , delete the main thread ( i know the function , but will the programm exit after the stop of the main thread?) , and whats the name of the main thread?
Lawl. No, app won't exit unless no other thread is running :) Check crt0.c/crt0_prx.c from pspsdk svn to see what the thread looks like. I'd recommend you don't mess with this in EBOOTS, only in PRXs (for obvious reasons...).
About that screen saving thing, it is TOTALLY pointless ^^ A "memory f a g", that's the category your code would fall under :) You got 333 Mhz to play around, if it's not enough it means you're writing bad and unoptimized code. Remember, MEMORY IS LIMITED.
(sorry for the double post but i assume here more people have the toolchain installed)
Can someone compile this for me, it's a modified version of Lua Player to run eboots.
http://luizlizard.pspsc.com/downloads/luasystem.cpp
just use the regular lua player .20 and replace the included luasystem.cpp with mine.
(I don't know if it will work, not very experienced with c++)
Thanks!
I see that's the source I used in my personal Lua Player w/ IR support (and flasing and directory dumping functions) I made 4 months or so ago (eww it's all sloppy...). How'd that get out? I think i gave it to one person... not sure... either way, you just gotta ask yourself whether this code will launch an eboot:
If so, then yes :)Code:sceKernelLoadExec(path,NULL);
Yes it was me, i asked you for it in May i think. I don't know to much of C++ in PSP but i assume that will launch it since i tested it in a simple eboot i made (i got PSPDEV so it can build simple eboots, but i dont know how to install the required libs for luaplayer).Zitat:
Zitat von AdjutantReflex
Will it launch it? hehe
I don't have a PSP at the moment to try anything. Coincidently enough, I too need a test. I've done a rough port of a neat 3d app but I don't have a PSP to try it :(
I can't guarantee it'll work like it should, or even run at all :P, but that's why i need a tester. If it doesn't work, I'll live. If someone could PM me I'll send them a link to the file :o thank you.