![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
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; Maybe by the library for handling png files. I was testing it with a custom background that somebody made for ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#241 |
![]() ![]() Bush Programmer
|
Maybe by the library for handling png files.
I was testing it with a custom background that somebody made for my last program. http://tn3-2.deviantart.com/fs10/300...by_innercy.png that's about as complicated as a 480x272 png file can get. There isn't a hardware limitation that prevents the file from working because it can be used as an icon background. maybe it's the png.h library... Last edited by Art; 05-12-2006 at 09:11 PM.. |
|
|
|
|
|
#242 |
![]() |
I believe when I was testing the PNG limitations I was able to load a PNG into memory about 2x the size of the screen and then scroll it around. But any bigger than that would crash. Plus, if you use libpng and try to draw off the viewable area it will crash. So you have to use it to only draw the part of the image that is currently viewable on the 480x272 you have in front of you.
Don't know if that helps you at all, but it may. To find out what pspgu.h does, just open it and read it =) unix command: Code:
nano -w /usr/local/pspdev/psp/sdk/include/pspgu.h Happy Coding!
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#243 |
![]() ![]() ...in a dream...
|
yay... rotation is in there also, its just the whole GU library functionality is a little weird like how you have to intiate it, use all those special arguments, etc.
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#244 |
![]() ![]() Developer
|
Ok guys,
Im trying to compile my code, and Cygwin tells me this: Code:
make: *** No rule to make target 'graphics.o', needed by 'Question.elf'. Stop. Code:
TARGET = Question OBJS = main.o graphics.o framebuffer.o callback.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LIBS = -lpspgu -lpsppower -lpng -lz -lm LDFLAGS = EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Question PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak |
|
|
|
|
|
#246 |
![]() ![]() Developer
|
Cheers! It works
|
|
|
|
|
|
#247 |
![]() ![]() Developer
|
Ok sorry for the double post, I have this code:
Code:
if(paddata.Buttons & PSP_CTRL_START) {
break;
}
|
|
|
|
|
|
#249 |
![]() ![]() Developer
|
Code:
//Question
/*
Question game?
Created by kozine
*/
#include <pspdebug.h>
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include "callback.c"
#include "graphics.h"
PSP_MODULE_INFO("PSP Question", 0, 1, 1);
//Define pspDebugScreenPrintf to printf
#define printf pspDebugScreenPrintf
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
int main() {
//Set controller variable
SceCtrlData paddata;
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
Color red = RGB(255, 0, 0);
Color blue = RGB(0, 0, 255);
for(;;) {
//Read control input
sceCtrlReadBufferPositive(&paddata, 1);
printTextScreen(10, 20, "Hey F34R! How old am I?", red);
printTextScreen(10, 50, "Cross: 10", blue);
printTextScreen(10, 60, "Circle: 20", blue);
printTextScreen(10, 70, "Triangle: 13", blue);
printTextScreen(10, 80, "Square: 16", blue);
printTextScreen(10, 200, "Press the button responding to your answer", red);
printTextScreen(10, 210, "and see if you are wrong or right!", red);
flipScreen();
if(paddata.Buttons & PSP_CTRL_CROSS) {
printTextScreen(10, 125, "Wrong! The answer is 13! Press R to exit!", red);
}
if(paddata.Buttons & PSP_CTRL_CIRCLE) {
printTextScreen(10, 125, "Wrong! The answer is 13! Press R to exit!", red);
}
if(paddata.Buttons & PSP_CTRL_TRIANGLE) {
printTextScreen(10, 125, "Correct! Well done, you know my age! Press R to exit", red);
}
if(paddata.Buttons & PSP_CTRL_SQUARE) {
printTextScreen(10, 125, "Wrong! The answer is 13! Press R to exit!", red);
}
if(paddata.Buttons & PSP_CTRL_START) {
break;
}
}
sceKernelSleepThread();
return 0;
}
|
|
|
|
|
|
#251 |
![]() ![]() Developer
|
still doesnt work :S Its weird.
|
|
|
|
|
|
#253 |
![]() ![]() Developer
|
Yea all the other buttons work fine.
|
|
|
|
|
|
#255 |
![]() ![]() Developer
|
Im running 2.6 firmware.
|
|
|
|
|
|
#256 | |
|
Guest
Posts: n/a
|
Quote:
|
|
|
|
|
#257 |
![]() ![]() ...in a dream...
|
Also, just thought id add... if you plan on making a question game...its best to have either an array of questions that u can keep track of better and have it easier tell whether they guessed right or wrong (via a bool ex: if Q3guess != answer3 then WRONG! } else { CORRECT } )
Ask around for how to exit out of a 2.6 type program... but why would the KernelSleepThread work while the KernelExitGame wouldnt... unless it didnt work and just returned to nothing...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#258 |
![]() ![]() Developer
|
Thanks for the info
![]() Its not a question game its just a mate told me to do it to proove I know at least some C. lol. |
|
|
|
|
|
#259 | ||
![]() ![]() Developer
|
Quote:
What version of Eloader are you using? The same function worked fine in 2.0 from the Tiff exploit, but I haven't used that since version .08 or so and I haven't kept up with 2.0+ programming. It's possible that you'll need to exit differently under 2.6. |
||
|
|
|
|
|
#260 |
![]() ![]() Developer
|
Im using the newsest Eload.
|
|
|
|
|
|
#261 |
![]() ![]() Developer
|
Ok sorry I can't find any information about 2.6 requiring a different exit method. Yuo could try using sceKernelExitThread() instead of sceKernelExitGame(). Others you might experiment with:
sceKernelExitDeleteThread () _sceKernelExitThread() // note the preceding underscore Hopefully one of those will work. Or try removing that line entirely and see if that changes anything. |
|
|
|
|
|
#262 |
![]() ![]() ...in a dream...
|
yes... try just 'breaking' the loop, then returning 0 of the main porgram... it should quit on its own...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#263 |
![]() ![]() ...in a dream...
|
Hey... I need a favor for someone to throw together for im busy... I need a basic I/O FileBrowser... I could make one with enough time... but this application im making takes a tad long... This app will make those LUA users who want to hide there LUA Scripts very easy... I am putting Danzeffs OSK in right now... I still have some bugs to work out, that is why im asking for a very very basic I/O Debug Text Filebrowser... Simple /\ = back, X = Execute (action) I will do the rest after that... So basically im asking for a function that will print out a Filebrowser via a function.. that way i wont have to copy and pate the whole thing into my code... just call teh function...
Thx and as i said... i could do it, and itd be good for me info wise, but im working on getting all the bugs worked out of this first, and if i could get the Filebrowser (basic I/O debug printing) id be very happy and get this LUA coders dream out there... Please someone take the time to through this together fori have not the time... Atleast not enough to finish my app up quickly and this... Thx a ton and ill add u to the credits... And ill fill u in on the info about the app via PM... ill even let you see the source if you wish... Thx a ton u guyz (community)
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#264 |
![]() |
Search these forums for 'stripped file browser' or if that doesn't work 'stripped filebrowser' it should be a thread in the development forum, with no replies, although I downloaded what that guy posted.
__________________
[URL="http://www.newlilwayne.com"]www.NewLilWayne.com[/URL] |
|
|
|
|
|
#265 |
![]() ![]() ...in a dream...
|
I know I serached but he took his download down =(
Do you have it Soccer? If you do I'll be very happy =) P.S. Soccer, want to try it out after im done? So far so good... I have basic input for the filename via 'Enter the Filename Path' and if its in the smae directory then you enter the name... if not then you enter ms0:/ and junk =(
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#267 |
![]() ![]() Developer
|
I suggest going to www.psp-programming.com and going to the tuts section. Its where I am learning it from and its a great help
|
|
|
|
|
|
#268 |
![]() |
A good way to quit a game in any version is inside your controller function, call quit();.
then write a quit(); function that does what you need.. it's easier to keep track of things, At least for me...
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#270 |
![]() ![]() Developer
|
Is there a way to cut images in the "graphics.h library" (or whatever you should call it...). Cause that would make things easier when you animate stuff ( then you could have just 1 image that you could split instead of haveing 6 separate images).
Thanks in advance! |
|
|
|
![]() |
| Tags |
| c or c , c++ , c/c++ , code , coding , c_language , programming , psp , psp programming , thread |
| Thread Tools | |
|
|