they can be used for ANYTHING cant they?
Printable View
they can be used for ANYTHING cant they?
Yeah, they can be, but it's not always practical to input your literals as hex...
Is there ever really a time when using an octal is better than dinary/hex?
Also, when I type in Dev-CPP, I noticed that if I type the letter l followed by some numbers, it highlights the same as typing numbers (like hex and octal), is this another form of digits? If so what base would it be worked in?
-Aura
These are the 3 different types i could find in Dev-CPP:Zitat:
Zitat von Auraomega
I know the f means float, what does u and l mean? Unsigned and Long?? Just a guessCode:100u
100.0f
100l
Correct, unsigned and long.
1 is an int
1.0 is a double
1.0f is a float
1U is an unsigned int
1L is a long
1LL is a long long (i.e., 64-bit integer type)
It's an easy way for casting literals.
I never new the u or the l after, but what I noticed was actually that if you type l8 then it highlights like a digit.Zitat:
Zitat von JaSo PsP
-Aura
Apparently, 1.0l is a "long float", which is presumably a double, but I'm not sure.
didnt work when i put it before 0.oZitat:
Zitat von Auraomega
Nope, you're right, I must have got confused :ROFL:Zitat:
Zitat von JaSo PsP
-Aura
rofl indeed :ROFL:Zitat:
Zitat von Auraomega
Oops Double Post -oops
I need the argumetns for assign "disc0:/"
what's dev2 and dev3 for disc0:/???Code:/**
* Assigns one IO device to another (I guess)
* @param dev1 - The device name to assign.
* @param dev2 - The block device to assign from.
* @param dev3 - The filesystem device to mape the block device to dev1
* @param mode - Read/Write mode. One of IoAssignPerms.
* @param unk1 - Unknown, set to NULL.
* @param unk2 - Unknown, set to 0.
* @return < 0 on error.
*
* @par Example: Reassign flash0 in read/write mode.
* @code
* sceIoUnassign("flash0");
* sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
* @endcode
*
*/
int sceIoAssign(const char *dev1, const char *dev2, const char *dev3, int mode, void* unk1, long unk2);
What do you need to re-assign it to?Zitat:
Zitat von hallo007
no I need dev2 and dev3 to creat a driver with
do it the same way as flash0? i dunno, ive never used this function before.
"disk0", "ldisk0:0,0", "diskfat0"... jus a guess :P
First of all, it's disc and not disk. Second of all, the disc isn't a fat filesystem, it's probably ISO-9660. Third of all...these things don't always have patterns that work so well.
dev2 : umd0:
ok and whats dev3? :)
Like i said, just a guess, and a pretty retarded guess... :pZitat:
Zitat von Archaemic
i dont know yet I found dev2 after a while googling because most of the time it is mounted to memory stick or whateverZitat:
Zitat von myschoo
What are the functions to:
1. get access point name
2. get signal strength %
3. detect what the encryption is (wep, wpa, etc.)
And which #include <something.h> thing will I need? Do I need to install a certain library?
For 1 and 3, you needZitat:
Zitat von taco111
in "psputility_netparam. h" (best to look on that to find the params used).Zitat:
int sceUtilityGetNetParam(int conf, int param, netData *data);
I'm not sure about 2, I've checked through all the headers, and nothing sticks out as helpful.
As for the libs needed I guess its going to be one of the libpspnet ones, but theres to many to list, just use each one until you find which one is needed.
-Aura
Thanks for the reply.Zitat:
Zitat von Auraomega
I'm not really experienced in psp C coding, so can you explain what the (int conf, int param, netData *data) part means? What do I place inside the ( ) for the access point name, and what for the encryption? What does conf and param mean?
And where can I get the libraries that I need?
'int conf' is the network configuration you want to get the information for, the 'int param' can be filled with any of these #defines in the psputility_netparam.h file:
and the netData union is defines like this:Code:#define PSP_NETPARAM_NAME 0 // string
#define PSP_NETPARAM_SSID 1 // string
#define PSP_NETPARAM_SECURE 2 // int
#define PSP_NETPARAM_WEPKEY 3 // string
#define PSP_NETPARAM_IS_STATIC_IP 4 // int
#define PSP_NETPARAM_IP 5 // string
#define PSP_NETPARAM_NETMASK 6 // string
#define PSP_NETPARAM_ROUTE 7 // string
#define PSP_NETPARAM_MANUAL_DNS 8 // int
#define PSP_NETPARAM_PRIMARYDNS 9 // string
#define PSP_NETPARAM_SECONDARYDNS 10 // string
#define PSP_NETPARAM_PROXY_USER 11 // string
#define PSP_NETPARAM_PROXY_PASS 12 // string
#define PSP_NETPARAM_USE_PROXY 13 // int
#define PSP_NETPARAM_PROXY_SERVER 14 // string
#define PSP_NETPARAM_PROXY_PORT 15 // int
#define PSP_NETPARAM_UNKNOWN1 16 // int
#define PSP_NETPARAM_UNKNOWN2 17 // int
declare a netData variable in your code and place it in the function for the information to be filled. Because it's a union, each element of the union shares the same memory, meaning only one can be filled at once. Make sure you know if your trying to retrieve a string or a number when accessing the variable. The defines above tell you weather you should be searching for an int or a string.Code:typedef union {
u32 asUint;
char asString[128];
} netData;
Hey guys,
I am struggling to read png files in my code. I Have tried a number of different sources, as well as cribbing some code from libpngs example.c file. The same thing happens everytime, when I get to the point where I create the image data using memalign during execution of the application, I get no data :(
For reference, I am using the Gimp to create the test png file and this line of code seems to be causing me problems:
image->data = (Color*) memalign(16, image->textureWidth * image->textureHeight * sizeof(Color));
Which I have seen in several graphics libraries for the psp so I know it should be working. The odd thing is, by this point in my code, I have created the png image struct and can read the height and width of the image itself, but when I try to execute the code above to get the image data, all I get is null.
This is really frustrating me and I have searched through the forum to find a similar problem but haven't found anything to help.
Any help at all would be good. Cheers.
Well, the PSP is already 16-bit aligned, so you really should just use malloc. Try running it through PSPLink and see if there is an exception before that. Also what is the size of the image?
anyone knows how to install psplink? copy/pasting eboot is uber slow...
short guide or something would be useful. thx
Hmmm, to be honest I was a little confused by the whole memalign thing myself. It has been a while since I did any serious C development and my skills have gone to rusty to nonexistent :(Zitat:
Zitat von _dysfunctional
I have downloaded PSPLink and will give it a look a bit later on.
The images that I have been using to date have been of an arbitrary size, anything from 10x10 to 60x60, but certainly nothing bigger than that.
Thanks for the help.
Anyone?Zitat:
Zitat von Auraomega
Also, is there an easier way of muting the systems sound, other than setting all 8 channels to 0 volume in both left and right... its very slow but I havn't noticed any other way in the includes.
-Aura
Maybe it would be a good idea to check out the PNG loader in the 'graphics.h' library, you might be able to see your problem if you compare you code to it.
Thanks for the suggestion, which I tried out this evening.Zitat:
Zitat von psp_jono
I have the same problem when using the graphics.h and graphics.c files, which is that when I try to load a PNG image, the PSP just hangs.
After some debugging, I have found that the section of code in loadImage that reads rows from the file is causing the problem.
If I add a debug statement to the for loop, all I get on screen is 'Reading row 0' then the PSP hangs.
If I add another line of debug, just after the png_read_row function call, the bloody thing works and I get debug output for each row that is read and the image is returned from the function.Code:for (y = 0; y < height; y++) {
pspDebugScreenPrintf("Reading row %d.\n\n", y);
png_read_row(png_ptr, (u8*) line, png_bytep_NULL);
for (x = 0; x < width; x++) {
u32 color = line[x];
image->data[x + y * image->textureWidth] = color;
}
}
What could possibly make it do that?Code:for (y = 0; y < height; y++) {
pspDebugScreenPrintf("Reading row %d.\n\n", y);
png_read_row(png_ptr, (u8*) line, png_bytep_NULL);
pspDebugScreenPrintf("Read row %d.\n\n", y);
for (x = 0; x < width; x++) {
u32 color = line[x];
image->data[x + y * image->textureWidth] = color;
}
}
Any help would be much appreciated.
I was just reading something ab out integer pointers and I did write something , but I want to know this is 100% correct
Code:void fixToScreen( int *x , int *y )
{
if( *x > 63 )
*x = 0;
else if( *x < 0 )
*x = 63;
if( *y > 36 )
*y = 0;
else if( *y < 0 )
*y = 36;
}
int something()
{
int x = 0 , y = 0;
...
some changes to the x and y integer
...
fixToScreen( &x , &y );
Yep, that's fine. At least the pointers are.
With pointers, ALWAYS initialise them with a valid address or NULL and ALWAYS check for NULL before you use them.Zitat:
Zitat von hallo007
Code:void fixToScreen( int *x , int *y )
{
if( x != NULL )
{
if( *x > 63 )
*x = 0;
else if( *x < 0 )
*x = 63;
}
if( y != NULL )
{
if( *y > 36 )
*y = 0;
else if( *y < 0 )
*y = 36;
}
}
thnx , i wont forget that:)
Does anyone know what I need to do in order to load the XMB without seeing the SCE logo? I'm renaming vshmain.prx to vshmain_real.prx, and using a new vshmain.prx to load the real, but everytime I exit a game, I always see the SCE logo, I found a post on ps2dev.org that showed some arguments that were needed to be passed, but it doesn't appear to be working for me.
The method described in this post only appears to work with loadexec calls, which don't appear to work before the vsh has been loaded. Currently the only way I've been able to load vshmain.prx is by using
No other way I've tried has worked, and it doesn't seem the arguments work when passed in this function.Code:SceUID mod = vshKernelLoadModuleVSH(PATH, 0, NULL);
...
sceKernelStartModule(mod, args, argp, NULL, NULL);
I've tried looking at the OE source codes, to see if I could find whats changed in the recovery to avoid doing this, but I've made no progress.
I just need a push in the right direction, if anyone can deliver it?
-Aura
Hi ,
I'm totally new to the psp scene , 2 days ago I bought me a psp-1000 and readed the history in the psp hacking scene.Yesterday I installed the toolchain. Now I want some information about some SDK functions. And if anyone has an idea for a small aplication , please share :)
That's it for now , I think I can play with this for a while :)
Thanx in advance
Hi
thank you , also are there some "active" groups in this scene , wich I mayby could join? (I hate coding on my own:))
Try making a name for yourself first, no one knows how good you are yet.Zitat:
Zitat von ropost