whats the function to compress/decompress gzip. i know its in the sdk but i just cant recall it
Printable View
whats the function to compress/decompress gzip. i know its in the sdk but i just cant recall it
i finelly fixed the idstorage problem and i have already another one
this crashes my psp
Code:int dumpMemory()
{
SceUID memory = sceIoOpen("ms0:/memory.bin", PSP_O_CREAT | PSP_O_TRUNC | PSP_O_WRONLY, 0777);
if(memory < 0) return -1;
sceIoWrite(memory, (void *) 0x8400000, 28*1024*1024);
sceIoClose(memory);
return 0;
}
:dry:
Maybe, just maybe, it's a bus error (data)?
Seriously.... stop fooling around with such stuff if you don't understand it.Zitat:
Zitat von hallo007
could u explain , because I understand every single line of that code
(yes I know that 0x8400000 is a memory adress:/ , and that 28*1024*1024 is 28 mb , so please hold your comment for yourself
So now what? Explain it or shut up? I'm tempted to do the last.Zitat:
Zitat von hallo007
dude you dont understand anything
I said explain this statement : stop fooling around with such stuff if you don't understand it.
because it isnt correct
That's only because you are wording badly. Talking out of context and assuming people just understand it... sorry I'm not telepathic by any means.Zitat:
dude you dont understand anything
It is correct, because else you'd easily spot the obvious error you do. Knowing that 0x8400000 is a memory address and that 28*1024*1024 is 28MB isn't enough. I can do int temp = (int*)(0x8400000 + 28*1024*1024) too with knowing the above, but the problem is knowing what it actually does.Zitat:
I said explain this statement : stop fooling around with such stuff if you don't understand it.
because it isnt correct
It writes memory data to a file , the data is the complete memory wich start at that adress and its going to write 28mb of data
And it's probably accessing data that it doesn't have access to, which is causing the crash.
You could have found that easily if you'd listened to us for one of the hundred times we've said to use PSPLink.
E] I just realized, 0x8400000 + 28MB is way (4MB) out of bounds. It's trying to access an illegal block of memory.
Bleh... spoiling the fun of having him clueless about the **** he's doing :PZitat:
Zitat von Archaemic
i listened to you and i installed psplink yesterday , but i currently dont have acces to that computer , and tommorow I format this one , so it would be a bit to stupid to install it too on this computer ;)
thnx anyway
Oops, sorry, force of habit :pZitat:
Zitat von Raphael
I got the adress from the sdk samples
I say , wtf?Code:
void dump_memory(void)
{
int fd;
printf("Dumping 28Megs from 0x8400000\n");
fd = sceIoOpen("ms0:/MEMORY.BIN", PSP_O_CREAT | PSP_O_TRUNC | PSP_O_WRONLY, 0777);
if(fd >= 0)
{
sceIoWrite(fd, (void *) 0x8400000, 28*1024*1024);
sceIoClose(fd);
}
}
Looking back over the docs again, I was wrong. 0x8400000 isn't even a valid address in the first place, AFAIK. It appears to be one byte after the end of kernel memory.
( http://wiki.ps2dev.org/psp:memory_map )
E] Oh wait, nevermind, I'm confused. Kernel memory is 8MB, not 4.
I just readed "the naked psp"
so I changed everthing to this:
that dumps the complete main RAM , I had already dumped the kernel oneCode:int dumpMemory()
{
SceUID memory = sceIoOpen("ms0:/memory.bin", PSP_O_CREAT | PSP_O_TRUNC | PSP_O_WRONLY, 0777);
if(memory < 0) return -1;
sceIoWrite(memory, (void *) 0x08800000, 24*1024*1024);
sceIoClose(memory);
return 0;
}
But the document doesnt give much info about the 4MB volatile memory , can anyone give some info about it? for what the psp it use , ...
thnx in advance;)
-= Double Post =-
"32MiB main RAM split into 4MiB kernel only, 4MiB volatile memory,Zitat:
Zitat von Archaemic
24MiB user space" quote from the naked psp
-= Double Post =-
99% sure
0x08800000 -> user
0x88000000->kernel
I hexed it , the module info of a kernel app was in the kernel memroy , butt the app itself was loaded in the user part
If you're formatting it tomorrow, why not install it? Use it while you can. Even still, wifi is still available and only requires telnet. If you are going to be serious about developing for the PSP correctly (not asking for help on just about every snipper you copy/paste and modify), quit making up excuses. Also it helps to do research.Zitat:
Zitat von hallo007
@Archaemic
AFAIK?
hi everybody,
does anybody know the new syscall for scePower stubs on firmware version 3.xx and above? i poured into all forums looking for it because moonlight and tuw reboot code does not work anymore on 3.10 and 3.40 OE.
i wanted to write a reboot, close and suspend program that has customized key support to rival test30 fastpower. all of his codes are stolen and he wouldnt even release source code so we could improve it with customized key support. i mean his latest release is completely different with the earlier version - there is no consistency on it - whats going on? its like he got it from somebody and just didnt bother to improve it.
i already have the file reading - key support, shutdown and suspend codes working, the only thing that is missing is reboot capability. i would definitely release the code and special thanks to any who would help!
cheers!
As Far As I Know.Zitat:
Zitat von slicer4ever
o...i need to rly brush up on all the quick typing stuff
It's called acronym.
AHA! Thanks Raphael! You're tops on my book. Cheers!
whats the best way to print text (maybe draw) when making prx??
debugscreen makes black background
the DSX library (i guess that is the name) by pspjunkie
lol i just downloaded dsx library today, but i thought i would ask, because JoySens isnt using DSX and i was looking for smaller font
http://psp.novinky.org/pspnews/phprs...s/joysens1.jpg
You can use dsx to set up the drawing and use pgeFont to draw text. All I think you have to do is enable alpha blending in dsx's system start function.
ok, maybe i will look into that,,, until then i ll use dsx
JoySens uses the standard debug font, just that it doesn't draw the black background - if you know how the text print function works it's not hard to modify, you can use graphics.c's print function as an example. That and it doesn't flicker like normal plugins, because it actually draws on top of everything once before the buffers are swapped.Zitat:
Zitat von myschoo
Is there any way I can check the PSPs Mac code and print it on screen?
Thanks.
-Aura
I'm making a menu code, but when I press down, to go to the next option, it goes down, then goes straight back up.
What am I missing:
"
if (pad.Buttons & PSP_CTRL_UP)
{
FrameCounter --;
if (FrameCounter < 0)
FrameCounter = 0;
}
if (pad.Buttons & PSP_CTRL_DOWN)
{
FrameCounter ++;
if (FrameCounter > 5)
FrameCounter = 5;
}
"
I don't think that part of the code is wrong but what would help is if u had a check to make sure the last button wasn't the same as the current one.Zitat:
Zitat von MrChaos
You might have to post all ur code.
I haven't seen code in like a month or two(I've been busy and fallin in love lol) so I could be wrong
Zitat:
Zitat von pspballer07
Code:#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <stdio.h> //ADDITION FOR SPRINTF
#include </usr/include/sys/stat.h> //ADDITION FOR TIME
#include "graphics.h"
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
static int GetRandomNum(int lo, int hi)
{
SceKernelUtilsMt19937Context ctx;
sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
rand_val = lo + rand_val % hi;
return (int)rand_val;
}
void Game()
{
SceCtrlData pad;
Color White = RGB(255, 255, 255);
Image* MenuImages[5];
MenuImages[0] = loadImage("./Images/Ps360Menu/Ps360Menu1.png");
MenuImages[1] = loadImage("./Images/Ps360Menu/Ps360Menu2.png");
MenuImages[2] = loadImage("./Images/Ps360Menu/Ps360Menu3.png");
MenuImages[3] = loadImage("./Images/Ps360Menu/Ps360Menu4.png");
MenuImages[4] = loadImage("./Images/Ps360Menu/Ps360Menu5.png");
int FrameCounter = 0;
extern int PressedCrossButton;
int MenuOne = 0;
while(1)
{
sceCtrlReadBufferPositive(&pad, 1);
FrameCounter = 0;
if (pad.Buttons & PSP_CTRL_UP)
{
FrameCounter --;
if (FrameCounter < 0)
FrameCounter = 0;
}
if (pad.Buttons & PSP_CTRL_DOWN)
{
FrameCounter ++;
if (FrameCounter > 5)
FrameCounter = 5;
}
}
fillScreenRect(White, 0, 0, 480, 272);
blitAlphaImageToScreen(0, 0, 480, 272, MenuImages[FrameCounter], 0, 0);
sceDisplayWaitVblankStart();
flipScreen();
}
int i;
for (i = 0;i < 5;i++)
freeImage(MenuImages[i]);
}
o i see, ur reseting ur framecounter var to 0 everytime the loop goes thru.Zitat:
Zitat von MrChaos
I commented where it needed to be gone
OH! Thanks, it works now (Lol, execpt I erased the part of the code where it blits images to the screen...)Zitat:
Zitat von pspballer07
:tup:Zitat:
Zitat von MrChaos
Problem again, When I press down, go to down one Frame, it skips 4 frames, goes to Frame 5, and crashes:Zitat:
Zitat von pspballer07
Code:#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <stdio.h> //ADDITION FOR SPRINTF
#include </usr/include/sys/stat.h> //ADDITION FOR TIME
#include "graphics.h"
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
static int GetRandomNum(int lo, int hi)
{
SceKernelUtilsMt19937Context ctx;
sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
rand_val = lo + rand_val % hi;
return (int)rand_val;
}
void Game()
{
SceCtrlData pad;
Color White = RGB(255, 255, 255);
Image* MenuImages[5];
MenuImages[0] = loadImage("./Images/Ps360Menu/Ps360Menu1.png");
MenuImages[1] = loadImage("./Images/Ps360Menu/Ps360Menu2.png");
MenuImages[2] = loadImage("./Images/Ps360Menu/Ps360Menu3.png");
MenuImages[3] = loadImage("./Images/Ps360Menu/Ps360Menu4.png");
MenuImages[4] = loadImage("./Images/Ps360Menu/Ps360Menu5.png");
int FrameCounter = 0;
extern int PressedCrossButton;
int MenuOne = 0;
while(1)
{
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_UP)
{
FrameCounter --;
if (FrameCounter < 0)
FrameCounter = 0;
}
if (pad.Buttons & PSP_CTRL_DOWN)
{
FrameCounter ++;
if (FrameCounter > 5)
FrameCounter = 5;
}
fillScreenRect(White, 0, 0, 480, 272);
blitAlphaImageToScreen(0, 0, 480, 272, MenuImages[FrameCounter], 0, 0);
sceDisplayWaitVblankStart();
flipScreen();
}
}
Since your code will loop many times a second, FrameCounter will be incremented way too fast if you hold down too long. Try searching for examples that compare the button state to the one before so that this repeating behavior doesn't happen.Zitat:
Zitat von MrChaos
Secondly, your MenuImages array contains only 5 images, meaning that MenuImages[5] (this is the 6th, since arrays start counting from 0) will be out of bounds. To fix this, just limit FrameCounter to 4.
Fixed the FrameCounter.Zitat:
Zitat von nataku92
What would be a keyword to search for to prevent that problem?