There will probably be a corresponding GetPixelImage(Image, x, y) function in whatever library you're using.
Printable View
There will probably be a corresponding GetPixelImage(Image, x, y) function in whatever library you're using.
It usually happens to me depending on how long the snippet is. If you edit it, there is no gap.Zitat:
Zitat von AdjutantReflex
http://www.sendspace.com/file/ze0ilj
compiles but doesnt work :p
Anyone help me out ?
Either host it up through QJ or paste it. (Code Tags or http://rafb.net/paste)
if you expect anyone to look through the whole of that source and try and fix what you called - it doesn't work, then your highly mistaken.Zitat:
Zitat von eldiablov
(Largish Source BTW)
How do I free up buffer space? I want to free the space taken by my image buffers, but keep the images in tact, I'm using graphics.h, and I can't use freeImage because I need the image again... I was just wondering if I freed the original buffer would I lose the image (as the image appears to be a pointer)? Or would I still have the image, and the free space from the original buffers?
Basicly, if I can free up the original space, how would I do it?
Thanks.
-Aura
If you 'free' the memory when data is stored, you lose the data.Zitat:
Zitat von Auraomega
I'm fully aware of that, but that would only occur if it WAS a pointer, which I'm not 100% sure about... the other option would be that the image stores the content of the buffer itself, in which case the buffer would become a dead weight, taking up the valuable space...Zitat:
Zitat von yaustar
I just want to know how to clear the buffer, to free up its space, if my images don't load after that (or the program crashes suddenly) I will know this is the cause, but if the image just stores the buffer content then I'm basicly working with half the space I could be working with.
-Aura
If you are talking about the "buffer" from the tutorials on psp-programming.com, just don't use them. They may only take a couple of bytes of memory, but they are completely unnecessary. Instead of using:
just do away with the buffer altogether:Code:Image *image1, *image2;
char buffer[50];
sprintf(buffer, "image1.png");
image1 = loadImage(buffer);
sprintf(buffer, "image2.png");
image2 = loadImage(buffer);
The buffer doesn't hold any image data, just the text of the path to the image and it gets overwritten with every sprintf anyway.Code:Image *image1 = loadImage("image1.png");
Image *image2 = loadImage("image2.png");
Well that certainly explains a lot!Zitat:
Zitat von jsharrad
Cheers :tup:
-Aura
Oh, 'that' buffer...
Yes, the evil "why did I ever get published in a tutorial, I'm a waste of space and can cause more problems than I'm worth" buffer :P
I was going to go for the misleading-buffer, but yours works too :o
How will you load a UMD and be able to play it?
?Code:int i;
i = sceUmdCheckMedium(0);
if(i == 0)
{
sceUmdWaitDriveStat(UMD_WAITFORDISC);
}
sceUmdActivate(1, "disc0:");
sceUmdWaitDriveStat(UMD_WAITFORINIT);
sceKernelLoadExecVSHDisc(PATH, NULL);
Why not give it a try? Or look at OSS (i believe it does it) for how. If you're asking what PATH must be, I believe it's
disc0:/PSP_GAME/sysdir/EBOOT.bin
I think those are the right names (PSP_GAME folder? sysdir?). You chose whether to launch the EBOOT.bin or BOOT.bin, I'm not sure which one is preferred over the other
I'm trying to make a sort of autoboot for the PSP as a side project (I know theres a lot out there already, but I want to make one all the same), but I'm having some problems, namely I can't get the XMB to load, and I have next to no knowledge of plugins for the CFW, if someone can tell me anything I specifically need to know, or what I actually need to load to get the XMB to boot, I would be greatful... also, if someone has some old source code lying around for a plugin, it would be helpful.
Thanks for any help/advice/source in advance.
-Aura
whats max limit for the no. of variables?
There's no variable limit, but the PSP has limited memory (obviously). Not sure how much that is though.
32MB of RAM total. 8MB reserved for kernel, leaving 24MB of RAM for you to play with.
If you want an exact number, you need to be much more specific. what kind of 'variable' (i hate that word, use data type). Integer, float, long, char, etc? Once you know that, do the math. For example, how many char's (signed/unsigned, doesnt matter) can fit in 24 mb?
24,000,000 bytes * 1 byte p/(signed/unsigned) char = 24,000,000
There you have it. You can have at most 24 million signed/unsigned chars in 24 megabytes of memory.
P.S. I believe un/signed chars are only one byte, if not please correct me. Thanks.
But remember, some of that is in the stack, and most of that is in the heap.
You're right.Zitat:
Zitat von AdjutantReflex
As for them being on the stack/heap. He wouldn't know the difference, so I think he will be okay.
Hi, i have a problem when trying to compile LuaPlayer, i already installed all the libs in trunk, donno what im missing.
Here's the error:
Thanks.Zitat:
src/lua3d.cpp: In function 'void lua3D_init(lua_State*)':
src/lua3d.cpp:355: error: 'GU_COLOR_RES1' was not declared in this scope
src/lua3d.cpp:356: error: 'GU_COLOR_RES2' was not declared in this scope
src/lua3d.cpp:357: error: 'GU_COLOR_RES3' was not declared in this scope
make: *** [src/lua3d.o] Error 1
So... fix it?
Humm, but, it's using the original LuaPlayer source code, isn't that error because of a missing lib?
I don't know. Why don't you open up the code and take a look?
Delete those lines listed for the error from lua3d.cpp.
They're no longer in the SDK and have no use.
Sorry, to intrude, but I'd like to learn C. :o
PSP-Programming, after you've used the main tutorials, go to the forums and look at the rest of them on there :tup:Zitat:
Zitat von Hiratai
Anyway...
I'm having a problem reading from flash1... I've never done it before, so bare with me.
I'm running in 0x800 mode (VSH?) but once I reach this part, my code crashes suddenly, the file exsists, so I think its the reading part.Code:FILE *lock;
lock = fopen("flash1:/lock.lock","r");
if(!lock){
printf("Password file does not exsist!\n");
_sw(0, 0);
}
Anyway, thanks in advance for any help.
-Aura
I can't remember, but you either need to run in kernel mode (0x1000) or you have to use the sceIo* functions.