For lack of a better place to put it I am starting this thread so that known library imports can be documented. These should be legally (if that is possible) extracted, basically DO NOT copy&paste from the SDK or similar. Of course this is really going to be a grey area but I don't think there is alot we can do about it as without these imports the psp will be kinda useless :P
Oh and try and at least work out what the functions are, we can all just read numbers in a hex editor :)
So I will start the ball rolling, these are in nem format (thx nem ;)) so if you have checked out the helloworld source it should be fairly obvious.
-= imports =-
STUB_START "sceCtrl",0x40010000,0x00030005
STUB_FUNC 0x6a2774f3,CtrlInit
STUB_FUNC 0x1f4011e6,CtrlSetAnalogMode
STUB_FUNC 0x1f803938,CtrlRead
STUB_END
/* Not 100% sure on this, init with 0 */
void CtrlInit(int unknown);
/* Pass 1 to enable analogue mode */
void CtrlSetAnalogMode(int on);
/* Read in the controller data. Unknown should be set to 1 */
void CtrlRead(ctrl_data_t* paddata, int unknown);
Please, let's not go through this again .. leave the "sce" on the function name, as there's no point in stripping it. You are calling into sceCtrlInit(), not providing an open source clone called CtrlInit(). This is no different than Win32 programming, say in WINE or mingw32.
Marcus, there was no symbols where I got it from, I do not even know the _proper_ name for it. I suppose I could brute force it :P What would be the point of calling it sceCtrlInit if it wasn't actually called that, and doing a hash on all 3 of those names indicates that they are definetly _not_ called what I named them :)
Of course if you want me to just tag all functions with sce which come from the kernel I guess it makes some sense :P
Last edited by TyRaNiD on Sun May 08, 2005 1:35 am, edited 1 time in total.
I apologize, I had assumed you got them from wherever folks are getting symbols these days :). nem had posted some lists elsewhere with the sce prefix on the sceCtrl imports. ooPo, is it alright to copy those into here so we don't duplicate work?
-= Imports =-
STUB_START "IoFileMgrForUser",0x40010000,0x00050005
STUB_FUNC 0x6a638d83,sceIoRead
STUB_FUNC 0x42ec03ac,sceIoWrite
STUB_FUNC 0x27eb27b8,sceIoLseek
STUB_FUNC 0x810c4bc3,sceIoClose
STUB_FUNC 0x109f50bc,sceIoOpen
STUB_FUNC 0xF27A9C51,sceIoRemove
STUB_FUNC 0x6A70004,sceIoMkdir
STUB_FUNC 0x1117C65F,sceIoRmdir
STUB_FUNC 0x54F5FB11,sceIoDevctl
STUB_FUNC 0x779103A0,sceIoRename
-= Function Definitions =-
#define O_RDONLY 0x0001
#define O_WRONLY 0x0002
#define O_RDWR 0x0003
#define O_NBLOCK 0x0010
#define O_APPEND 0x0100
#define O_CREAT 0x0200
#define O_TRUNC 0x0400
#define O_NOWAIT 0x8000
int sceIoOpen(const char* file, int mode);
void sceIoClose(int fd);
int sceIoRead(int fd, void *data, int size);
int sceIoWrite(int fd, void *data, int size);
int sceIoLseek(int fd, int offset, int whence);
int sceIoRemove(const char *file);
int sceIoMkdir(const char *dir, int mode);
int sceIoRmdir(const char *dir);
int sceIoRename(const char *oldname, const char *newname);
int sceIoDevctl(const char *name int cmd, void *arg, size_t arglen, void *buf, size_t *buflen);
BIG NOTE:
I cannot as of yet work out how to create new files on the memstick, almost seems like it is locked unless you call something to unlock it. This means you cannot create new files although you can create an empty one from the PC and then open and truncate and then write to it. Very strange. This affects the mkdir/rmdir/rename etc as well.
Please, let's not go through this again .. leave the "sce" on the function name, as there's no point in stripping it. You are calling into sceCtrlInit(), not providing an open source clone called CtrlInit(). This is no different than Win32 programming, say in WINE or mingw32.
Have to second that, lets not make the same mistake we did with ps2sdk, keep the sce prefix. its just a name, but a useful one :)
yes, please leave the "sce" on the function name...
The reasoning and general acceptance of using sce prefixes.
STUB_START "sceSuspendForUser",0x40000000,0x00020005
STUB_FUNC 0xEADB1BD7,"DisableSuspend"
STUB_FUNC 0x3AEE7261,"EnableSuspend"
STUB_END
/* Parameters unknown for these functions, set to 0 */
/* Disable the suspend facility */
void DisableSuspend(int param);
/* Enable the suspend facility, if someone tried to suspend it during the disable period it will immediately suspend */
void EnableSuspend(int param);
TyRaNiD wrote:I cannot as of yet work out how to create new files on the memstick, almost seems like it is locked unless you call something to unlock it. This means you cannot create new files although you can create an empty one from the PC and then open and truncate and then write to it. Very strange. This affects the mkdir/rmdir/rename etc as well.