![]() |
| 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; ? menu.c:88: warning: 'input.Buttons' is used uninitialized in this function SceCtrlData input; What the heck? All of a sudden I'm ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#91 |
![]() ![]() ...in a dream...
|
?
menu.c:88: warning: 'input.Buttons' is used uninitialized in this function SceCtrlData input; What the heck? All of a sudden I'm getting this. It is used for controling buttons, insteaed of pad.buttons, its input. That is what I get. Any help?
__________________
...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) |
|
|
|
|
|
#92 |
![]() |
okay, two problems.
One the "sleep(250);" doesn't seem to do anything. 2) sceKerenelSleepThread(250 0 00); is a kernel mode thing, right, and can't be used through the photo exploit? 3) im actually am doing the whole array+animation technique and it seems to change right, but when it gets to the last frame it displays a trail of all the other images. im looking at a frames[5] if right{ clear screen blit(yadayada frames[current]....) current++ if current is 4 go back to 1 4) i can't count can anyone explain the trail problem and tell me another way to measure parts of a second? |
|
|
|
|
|
#93 | ||
![]() ![]() ...in a dream...
|
Quote:
Code:
for(x=0; x<10; x++) {
sceDisplayWaitVblankStart();
}
3.) Quote:
Code:
#define RGBA(r, g, b, a) ((r)|((g)<<8)|((b)<<16)|((a)>> 24 & 0xFF)//Alpha
frames[5];
int current = 0
while(1) {
blit(yada yada frame[current]);
flipScreen();
if(SceCtrlData.Buttons & PSP_CTRL_RIGHT) {
current++;
clearImage(RGBA(0, 0, 0, 255), Image* anim[current - 1]); /*Its close to that, switch the color and image if not */}
}
This is just what I think would work, it hasnt been tested.
__________________
...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) Last edited by SG57; 02-20-2006 at 04:51 PM.. |
||
|
|
|
|
|
#94 |
![]() |
thanks, the vblank thing is definitley what I'm looking for. as for #2, i was saying that because kernel wasn't working for me. Your solution to number three looks good and I'll have to try it later. But for now, im researching big box companies. i have to prove that walmart helps communities! any ideas?
|
|
|
|
|
|
#95 |
![]() ![]() ...in a dream...
|
I dunno, but I found a better way to get hte alpha color, either blit some image, or load a small 1x1 image that isnt even a byte big, and call:
Code:
//Load the small image with transparency and stuff alphacolor = getPixelImage(1, 1, smallImage); Code:
clearScreen(alphacolor, animation image[current - 1]); Anyway, Yeldarb, think you could tell me what this does? sceCtrlPeekBufferNegative (SceCtrlData *pad_data, int count); ? OK, SMERITY, INEED YOUR HELP! Rotation is being a pain. I can not get it to work. I have tried both of your ways, I am going to make the one code you posted here, not a link, into a protoype and see what happens, but in the meantime, I need to know ow to rotate an image! Im trying to test a sample program where there is a pciture thing, just a blob thing, right in the middle of the screen. I wnat the analog stick to control where it is pointing, so pointing down, woul mean the main point of the blob, is pointing down, and analog stick left, means point left: <- Lx = blob point left -> Lx = blob point right ^ Ly = blob point up DOWN Ly = blob point down Please help?!
__________________
...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) Last edited by SG57; 02-20-2006 at 06:33 PM.. |
|
|
|
|
|
#96 |
![]() ![]() Developer
|
SG57 -
Rotating an image Sorry to say, if you need to rotate an image, and you want to program that anew, you're going to have to scratch up on your maths. Mainly the use of trigonometry, specifically sine and cosine. See http://freespace.virgin.net/hugo.eli...nes/rotate.htm and http://mathworld.wolfram.com/Trigonometry.html Ie, first issue, look back at my previous post for most of the details on rotating an image. Onto the function you want, in graphics.c they have the blitting image function atm, and it could be modified into what is needed for rotation... Code:
void blitAlphaImageToScreen(int sx, int sy, int width, int height, Image* source, int dx, int dy)
{
if (!initialized) return;
sceKernelDcacheWritebackInvalidateAll();
guStart();
sceGuTexImage(0, source->textureWidth, source->textureHeight, source->textureWidth, (void*) source->data);
float u = 1.0f / ((float)source->textureWidth);
float v = 1.0f / ((float)source->textureHeight);
sceGuTexScale(u, v);
int j = 0;
while (j < width) {
Vertex* vertices = (Vertex*) sceGuGetMemory(2 * sizeof(Vertex));
int sliceWidth = 64;
if (j + sliceWidth > width) sliceWidth = width - j;
vertices[0].u = sx + j;
vertices[0].v = sy;
vertices[0].x = dx + j;
vertices[0].y = dy;
vertices[0].z = 0;
vertices[1].u = sx + j + sliceWidth;
vertices[1].v = sy + height;
vertices[1].x = dx + j + sliceWidth;
vertices[1].y = dy + height;
vertices[1].z = 0;
sceGuDrawArray(GU_SPRITES, GU_TEXTURE_16BIT | GU_VERTEX_16BIT | GU_TRANSFORM_2D, 2, 0, vertices);
j += sliceWidth;
}
sceGuFinish();
sceGuSync(0, 0);
}
Finding the Angle of Rotation Guess what? MORE MATH! You'll once again need to know trig. See here if you still haven't read it... http://mathworld.wolfram.com/Trigonometry.html Basically, there are three points in a triangle you'll be using. First point is your cannon, the image that needs to be rotated Second point is your cursor (or place you'll be aiming) Third point is your cursor, but with the same y value as your cannon Given these three points, a right angled triangle will be produced, which we can use trig on. SOH CAH TOA Sine = Opposite/Hypotenuse, Cosine= Adjacent/Hypotenuse, Tangent = Opposite/Adjacent To find the angle you need to rotate the cannon, you'll end up using one of those to find the angle based on side length. Read up on it, or ask your math teacher, over here in Australia trig's in the syllabus, so the teacher should be able to help, just explain what you're trying to do.
__________________
Developer of Airstrike |
|
|
|
|
|
#97 | |
![]() ![]() ...in a dream...
|
Quote:
MATH TIME: Sine and Cosine and Tangent, my homework is it matter of fact. ^ ---------------------'A' |~\ ----------------- hypotneus |__\ ------------------'C' ^'B' Now, the sine of this (opposite) is (when ~ is the angle thing) BC right? Now, the Cosine of this (adjacent) is AB right? Now, the tangent (sine/cosine ?) is if BC = 2 and AB = 3, 2/3? This is just an example, to get a hang of sine, cosine, and tangent. Smerity, you know alot (chingwyn also helped me and answerd my questions), could you tell me if my math was wrong so I can correct it and understand that rotating function of yours? Thanks Smerity (or anyone else if they help)
__________________
...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) Last edited by SG57; 02-21-2006 at 08:04 PM.. |
|
|
|
|
|
|
#98 |
![]() ![]() Developer
|
SG57 -
I'm only just in Year 11 myself. When I started getting really into programming, I wasn't ready for the math side of it, and thus I had to learn a lot... It's really good to learn stuff like this by yourself. It also gives you a huge leg up over other kids in the class. For example, when I was interested in raytracing, I had to learn about quadratics (ax^2+bx+c), circles (x^2+y^2=r^2) and spheres (x^2+y^2+z^2=r^3) and so on. By the time school finally started on that, I had the easiest time in the world. So it does help you out... Anyway, back to the problem. Until you have a solid understanding of trigonometry, spec. sine and cosine, it will be quite hard for you to get a lot of this. Once again, study up mate. Nonetheless, I'll try to program something for you tonight on using trig to aim a little target thing at a cursor. Please note that it WILL NOT ROTATE AN IMAGE. I haven't worked that out fully yet myself. It will however allow you to work out the whole angle side of it et al.
__________________
Developer of Airstrike |
|
|
|
|
|
#99 | |
![]() ![]() ...in a dream...
|
Quote:
__________________
...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) |
|
|
|
|
|
|
#100 |
![]() ![]() Developer
|
![]() That's a screenshot of the working code... All mine, other than the smilie by IchigoKurosaki =) I had to use that smilie SOMEWHERE! Screenshot = O Other than that, just use the analog stick and it shows the variables interactively... Full source (Makefile, C files et al) = http://www.smerity.com/psp/rotate.zip Code:
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include "./graphics/graphics.h"
#include "screenshot.c"
#include <psppower.h>
#include <math.h>
#include "callback.h"
#define RGB(r, g, b) ((b << 16) | (g << 8) | r)
#define BLUE RGB(0, 0, 255)
#define RED RGB(255, 0, 0)
#define GREEN RGB(0, 255, 0)
#define BLACK RGB(0, 0, 0)
#define WHITE RGB(255, 255, 255)
#define pi 3.14159265358979
#define printf pspDebugScreenPrintf
PSP_MODULE_INFO("Trig", 0, 1, 1);
int main() {
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
SceCtrlData pad;
char buffer[200];
char filler[100];
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
int exit = 0; //cx, cy, xi, yi;
float adj = 0.0f, adjpos = 0.0f, hyp = 0.0f, opp = 0.0f;
float opppos = 0.0f, cos = 0.0f, angle = 0.0f, angler = 0.0f;
Image* cursor;
sprintf(buffer, "img/cursor.png");
cursor = loadImage(buffer);
Image* smile;
sprintf(buffer, "img/smile.png");
smile = loadImage(buffer);
Image* circle;
sprintf(buffer, "img/circ.png");
circle = loadImage(buffer);
int cursorx = 240, cursory = 136;
while (!exit)
{
clearScreen(BLACK);
sceCtrlReadBufferPositive(&pad, 1);
sprintf(filler, "Angle = %i", (int)angle);
printTextScreen(12, 12, filler, RGB(55, 55, 55 ));
printTextScreen(10, 10, filler, RGB(200, 200, 200 ));
sprintf(filler, "Adjacent = %i", (int)adjpos);
printTextScreen(12, 22, filler, RGB(55, 55, 55 ));
printTextScreen(10, 22, filler, RGB(200, 200, 200 ));
sprintf(filler, "Opposite = %i", (int)opppos);
printTextScreen(12, 32, filler, RGB(55, 55, 55 ));
printTextScreen(10, 32, filler, RGB(200, 200, 200 ));
float cx = ((pad.Lx - 125)/16);
float cy = ((pad.Ly - 125)/16);
cursorx = cursorx + (int)cx;
cursory = cursory + (int)cy;
if ( cursorx > 480 ) cursorx = 470;
if ( cursory > 272 ) cursory = 267;
if ( cursorx < 0 ) cursorx = 0;
if ( cursory < 0 ) cursory = 0;
// third point of triangle is x = cursorx, y = center's y (so to create right angled triangle)
drawLineScreen(240, 135, (int)cursorx, (int)cursory, RGB(150, 10, 10)); // center to cursor
drawLineScreen((int)cursorx, 135, (int)cursorx, (int)cursory, RGB(10, 10, 155)); // right angle to cursor
drawLineScreen((int)cursorx, 135, 240, 135, RGB(10, 150, 10)); // right angle to cursor
//find side length of adj and other side (opp)
adj = (int)cursorx - 240; // only have to do x as y doesn't change
opp = (int)cursory - 135; // only have to do y as x doesn't change
adjpos = adj; // this is to save the info on + and -
opppos = -1*opp; // this is to save the info on + and -
if (adj < 0) adj = adj*-1;
// hyp = a2 + b2 = c2 (Pythagoras)
hyp = adj*adj + opp*opp; // hyp will always be + as any square is positive
hyp = sqrt(hyp);
//cos = adjacent / hyptoenuse
cos = adj/hyp;
angler = acosf(cos);
// we now have the angle, but it's in radian form
angle = angler * (180.0f/pi);
// now we have to get it to recognise quadrants
//-x, +y is good, no change needed
//+x, +y is not good, need to - angle from 180
//+x, -y is not good, need to + angle from 180
//-x, -y is not good, need to - angle from 360
if ( adjpos >= 0 && opppos >= 0 ) angle = 180 - angle;
else if ( adjpos >= 0 && opppos <= 0 ) angle = 180 + angle;
else if ( adjpos <= 0 && opppos <= 0 ) angle = 360 - angle;
blitAlphaImageToScreen( 0, 0, 32, 32, smile, 240-16, 135-16); // center
blitAlphaImageToScreen( 0, 0, 24, 24, cursor, (int)cursorx-12, (int)cursory-12);
// original coordinates for the lil bobbly circle
int sx = 0, sy = 24;
int xi = sx, yi = sy;
angler = (angle+90) / 180.0f * pi;
sx = xi*cosf(angler) - yi*sinf(angler) + 240;
sy = xi*sinf(angler) + yi*cosf(angler) + 135;
blitAlphaImageToScreen( 0, 0, 12, 12, circle, (int)sx-6, (int)sy-6);
flipScreen();
sceKernelDelayThread(10000);
if (pad.Buttons & PSP_CTRL_CIRCLE)
screenshot("screen.png");
} // while(!exit) */
clearScreen(BLACK);
sceKernelExitGame();
return 0;
} // main
__________________
Developer of Airstrike |
|
|
|
|
|
#101 |
![]() ![]() ...in a dream...
|
Hey thanks, that helps me with homework too. I guess that will do for cos and sine and tanget for now while coding. But let me know if you get rotation right and working please thanks Smerity, you have helped alot.
__________________
...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) |
|
|
|
|
|
#102 | |
![]() |
Ok, I have a question. It doesn't really relate to the PSP, but here goes:
I'm currently learning C++ from a book I got at Borders, but I don't understand one thing: in the book it says to add these two lines of code before return 0 in a program to keep it from closing a split second after it opens. These two lines are: Quote:
Edit: Nvm, it turns out all I had to do was change it to +2 instead of +1. |
|
|
|
|
|
|
#103 |
![]() ![]() ...in a dream...
|
well, cout is baically printf/pspDebugScreenPrintf is C for PSP, and std (not sexually transmitted disease) is a
lib, did you include stdlib and stderror? My question. Say i have a huge text string that will go off screen from the left to right. is this something i could do about that? Code:
if(char string here > 480 / 5 characters over) {
char string("\n");
}
Second. How could i do soemthing like only print the 10th character starting from the beginning of the string? for example: Code:
printf("123456789abcdefghijklmnopqrstuvwxyz");
__________________
...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) Last edited by SG57; 02-24-2006 at 03:58 PM.. |
|
|
|
|
|
#104 |
![]() |
Um, you could do a for loop, and make it something like:
Code:
for(i=0;i < strlen(text); i= i+10)
{ printf("%c", text[i]);
}
edit: for your first question, you could simply find out the number of characters that can be held on a line using the debug printf, then, use the loop I showed you above ^ and somehow incorporate that every, say, 200 characters a \n is injected, I htink you could do it in inside the loop, like have an additional variable, j, and start it at zero. Every time you do the printf, before the actual printf, you add one to j. Then do a simple if statement, Code:
if(j==200)
{printf("%c\n", text[i]); // adds a carriage return or whatever
j = 0;
}
else { printf("%c", text[i]); //prints letter normally because its not at the end of the line
j++;
}
Last edited by soccerPMN; 02-27-2006 at 02:20 PM.. |
|
|
|
|
|
#105 |
![]() ![]() ...in a dream...
|
ya, thanks, i was looking for something of the sort. thanks.
Smerity - I have been looking fr a rotating 'function' on thenet, and so far, its basically telling me examples of whats going on, nothing too specific towards rotating something to a specific degree. I dont mean to badger, but I was wondering fi you have found something yet? That geometry type shooter has kind of what im looking for, maybe ill pm the developer for how he did it?
__________________
...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) |
|
|
|
|
|
#106 |
![]() |
Okay, I'm having a problem
My code is working great, except for one thing right now. When I use the graphics.c/h code being printTextScreen() it draws the text at the coordinates I gave it, but reads the \n as a square with a circle in it. Is there another character group used for new lines
|
|
|
|
|
|
#107 |
![]() |
Since you give printtextscreen co-ords there is no need for the newline code, so I don't think it interprets it right...
if your first line is at 10,10 then just make your second line 10,20 and so on....
__________________
PSN: Shatterdome |
|
|
|
|
|
#108 |
![]() |
Can anyone tell me what exactly "." & ".." mean when reading directories because sprintf(directory,"./%s/,start.item[#]);
doesn't work i thought "." meant ms0:/currentdirectory so I added and "/" then the next name and since it was a directory I finished with an "/" but this and a few other ideas didn't work I know the string I put in though has no "/" at its end
Last edited by Devun_06; 03-07-2006 at 12:19 PM.. |
|
|
|
|
|
#110 |
![]() ![]() ...in a dream...
|
there is an elf2pbp, pbpExplorer, and if you have cygwin installed, along with SDL, you can use pbp-unpack and pbp-pack.
__________________
...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) |
|
|
|
|
|
#111 |
![]() |
Alright, I've got a bit of a question about image display.
Let's say I've got code that looks kind of like this: Code:
while(1)
{
DisplayBackground();
DisplayItem1();
DisplayItem2();
flipscreen();
}
What if we change the code a bit to look like this: Code:
DisplayBackground();
while(1)
{
MoveItem1();
DisplayItem1();
MoveItem2();
DisplayItem2();
flipScreen();
}
My issue is, since the "old" images are still getting displayed, they're obviously still stored in memory, and they're staying there. This means that whether you have a refreshing background or not, if you keep redrawing images to create animation, you're going to eventually run out of memory, it's gonna overflow, and the system will likely crash. How do I avoid this? I'm running into a system crash with my current game that pops up every time after you've played it for a bit, and I think this is what's happening. What can I do to clear the junk out of there? Last edited by Andorien; 03-09-2006 at 11:19 PM.. |
|
|
|
|
|
#112 |
![]() ![]() Developer
|
After I have made the psp to show my image on the screen (using the same way as in the 4th tutorial) but now can't I draw text to the screen anylonger by using the printf() command... Do I need to disable the graphics in (if so, how?) or is there an other command used to draw text on an image??
Thanks in Advance! |
|
|
|
|
|
#113 |
![]() ![]() ...in a dream...
|
#include "graphics.h"
printTextScreen(xCo-ordinate, yCo-ordinate, "whatever", Color);
__________________
...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) |
|
|
|
|
|
#114 |
![]() |
I know this is crazy, but why does the following lines of code mess up my program? I'm sure these are the only lines invloved because when I temporarily comment them out the whole program works again.
Code:
int extention_fallback=strlen(start.item[dircount]);// only for checking if .***\0 exists for use in this function ONLY! :0
if(start.item[dircount][(extention_fallback-4)]=='.')
{start.type[dircount]=1;/*it's a file*/}else {start.type[dircount]=0;/*it's a folder*/}
|
|
|
|
|
|
#115 |
![]() ![]() Developer
|
Thanks for your reply sg57 but I still can't see the text. Here is the code:
Code:
// INCLUDES
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.h"
// Using RGB-Color-Mode
#define RGB(r, g, b) ((b << 16) | (g << 8) | r)
// Using lazy printf
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
// MODULE INITIALISATION
PSP_MODULE_INFO("ECTTT", 0, 1, 1);
//Home button function
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
// Int main and choose buffer size
int main() {
char buffer[200];
Image* backpic;
// Prepares the psp to display graphics
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
//
sprintf(buffer, "backpic.png");
backpic = loadImage(buffer);
// If Something should go wrong:
if (!backpic) {
printf("Something went wrong! Check that you have all the files needed on your memory stick.\n");
} else {
// If it boots as it should (setup for image Display) and activate use of home button:
int x = 0;
int y = 0;
sceDisplayWaitVblankStart();
// Activate fullscreen Res pic viewing (480x272)
while (x < 480) {
while (y < 272) {
// Blit (display) the background (In the Memory) :
blitAlphaImageToScreen(0 ,0 ,480 , 272, backpic, x, y);
y += 272;
}
// Add the incrementation for the x:
x += 480;
y = 0;
}
// Display the Background on the screen:
flipScreen();
}
printTextScreen(10, 10, "whatever", RGB(255, 0, 0));
// Let the kernel sleep:
sceKernelSleepThread();
return 0;
return 0;
}
|
|
|
|
|
|
#116 | |
![]() |
Quote:
Therefore, change your last bit of code to look like this: Code:
}
// Display everything
printTextScreen(10, 10, "whatever", RGB(255, 0, 0));
flipScreen();
Last edited by Andorien; 03-11-2006 at 05:12 AM.. |
|
|
|
|
|
|
#118 |
![]() ![]() Developer
|
Sorry eveyone for the dubble post but now I got another problem:
I have some code that is supposed to launch the inserted umd, but when I try to compile cygwin gives me these errors: Code:
main.o: In function 'main': main.c: (.text+0x1fc): undefined reference to 'sceUmdCheckMedium' main.c: (.text+0x210): undefined reference to 'sceUmdActivate' main.c: (.text+0x234): undefined reference to 'sceUmdDriveStat' main.c: (.text+0x5c8): undefined reference to 'sceUmdCheckMedium' collect2: Id returned 1 exit status make *** [hello.elf] Error 1 Code:
#include <pspiofilemgr.h> #include <pspumd.h> #include <pspdisplay.h> #include <pspctrl.h> #include <pspkernel.h> #include <pspdebug.h> #include <pspgu.h> #include <png.h> #include <stdio.h> #include "graphics.h" #include <stdlib.h> #include <string.h> Code:
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CIRCLE) {
break;
}
i = sceUmdCheckMedium(0);
if (i == 0) { printTextScreen(10, 10, "Insert UMD", RGB(0, 0, 0));
flipScreen(); }
while (i == 0) {
i = sceUmdCheckMedium(0);
}
i = sceUmdActivate(1, "disc0:");
printTextScreen(10, 10, "Starting UMD, Please Wait", RGB(0, 0, 0));
flipScreen();
i = sceUmdWaitDriveStat(UMD_WAITFORINIT);
fd = sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777);
if(fd >= 0)
{
char game_id[11];
sceIoRead(fd, game_id, 10);
sceIoClose(fd);
game_id[10] = 0;
}
sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/BOOT.BIN",0);
}
|
|
|
|
|
|
#119 |
![]() |
Seems a little strange. You may have missed some libraries in your Makefile. Other than that, the only thing that comes to mind would be that you might need to do a clean compile (IE, delete all previous object, elf, and SFO files before compiling).
|
|
|
|
|
|
#120 |
![]() ![]() Developer
|
I tryed to delete every old files but no go.
my makefile looks like this: Code:
TARGET = hello OBJS = main.o graphics.o framebuffer.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LIBS = -lpspgu -lpng -lz -lm LDFLAGS = EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = WorkInProgress PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak |
|
|
|
![]() |
| Tags |
| c or c , c++ , c/c++ , code , coding , c_language , programming , psp , psp programming , thread |
| Thread Tools | |
|
|