Zeige Ergebnis 5.251 bis 5.280 von 10174
C/C++ Programming Help Thread
This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Wouldnt draw.c have to be functions and then call them in main.c...
-
06-30-2007, 12:05 AM #5251QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
Wouldnt draw.c have to be functions and then call them in main.c
-
06-30-2007, 12:44 AM #5252Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
never do that !!!!!!!!!!!!
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
-
06-30-2007, 02:43 AM #5253QJ Gamer Bronze

- Registriert seit
- Jun 2006
- Beiträge
- 144
- Points
- 7.047
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Lawl.
Doing so is not incorrect, but is not very elegant :) Just *avoid* doing it...Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
Spoiler for me:
-
06-30-2007, 06:34 AM #5254Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
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 }
-
06-30-2007, 06:51 AM #5255
yeah
Zitat von hallo007
-
06-30-2007, 08:41 AM #5256Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
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 prxCode: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
-
06-30-2007, 08:45 AM #5257QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
There is a reason I released DSX...
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 von hallo007
Geändert von PSPJunkie_ (06-30-2007 um 08:55 AM Uhr) Grund: Automerged Doublepost
-
06-30-2007, 08:58 AM #5258Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I learning gnu myself , thats why i dont use it ;)
-
06-30-2007, 09:03 AM #5259QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
it's GU, not GNU. If you really want to learn, you should first take a step away from PRXes.
Zitat von hallo007
And as FistPimp said, that's not the fastest method.Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
-
06-30-2007, 09:05 AM #5260QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
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 von hallo007
-
06-30-2007, 09:15 AM #5261Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
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 }
-
06-30-2007, 09:24 AM #5262
:ROFL::Jump:
Zitat von Raphael
-
06-30-2007, 09:48 AM #5263QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Did I say FistPimp? I wanted to say FastPimp
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
-
06-30-2007, 09:51 AM #5264Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Your posts are becoming more annoying everyday
Zitat von Mr305
-
06-30-2007, 10:02 AM #5265
U declared urself immature in the sig.whatelse do i say?
Zitat von eldiablov
-
06-30-2007, 10:05 AM #5266QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
You spell like a dyslexic 2 year old. What else do I have to say?
Zitat von Mr305
-
06-30-2007, 10:07 AM #5267Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
you class what else as one word. What else do i say?
Zitat von Mr305
-
06-30-2007, 10:37 AM #5268
U cant even comprehend what's written in one's sig. Stop spammin'.
Zitat von eldiablov
-
06-30-2007, 10:50 AM #5269Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
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 ?
-
06-30-2007, 10:51 AM #5270Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
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
-
06-30-2007, 11:06 AM #5271
damn! im typin 4m psp hence its so concise,
Zitat von eldiablov
and its in my sig. and thats what i said be4. I aint wastin any more posts.
-
06-30-2007, 02:56 PM #5272QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
@hallo07 i think you need to save the variables that got u to a black screen otherwise your basically taking a screen shot
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
06-30-2007, 09:06 PM #5273
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.
Free Prizes at Prizerebel Join us!
I already got 11 Gifts. Ask me for details or proof.
-
06-30-2007, 10:01 PM #5274words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
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)?
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
06-30-2007, 10:40 PM #5275Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
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?
-
07-01-2007, 08:59 AM #5276QJ Gamer Bronze

- Registriert seit
- Jun 2006
- Beiträge
- 144
- Points
- 7.047
- Level
- 55
- Downloads
- 0
- Uploads
- 0
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.Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
Spoiler for me:
-
07-01-2007, 07:32 PM #5277QJ Gamer Green

- Registriert seit
- Oct 2006
- Ort
- Cd. Juarez Mexico -
- Beiträge
- 341
- Points
- 8.244
- Level
- 61
- Downloads
- 0
- Uploads
- 0
(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!
-
07-01-2007, 08:31 PM #5278words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
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);

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
07-01-2007, 08:47 PM #5279QJ Gamer Green

- Registriert seit
- Oct 2006
- Ort
- Cd. Juarez Mexico -
- Beiträge
- 341
- Points
- 8.244
- Level
- 61
- Downloads
- 0
- Uploads
- 0
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 von AdjutantReflex
Will it launch it? hehe
-
07-01-2007, 10:22 PM #5280words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
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.
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here


LinkBack URL
About LinkBacks
Mit Zitat antworten


Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum