 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
phobox
Joined: 24 Mar 2008 Posts: 140
|
Posted: Tue Jun 16, 2009 4:59 am Post subject: pspLed library |
|
|
I decided to reverse the simple led.prx module.
Since the current sdk doesn't have prototypes for that library, i prepared the header file.
I would have made a patch but i don't know how to insert a new library... i think that the whole makefile has to be changes, so... i don't know.
here is the header http://www.megaupload.com/?d=8VDYUYIJ
I want also to say that in this topic
http://forums.ps2dev.org/viewtopic.php?t=9485
the param structure is defined as a 4 int elements structure, but is is five elements structure and the first element may be an array of four chars, i have to investigate it.
the main function, sceLedSetMode has the second arg called mode. modes available are 4 (0, 1, 2, 3) but i discovered how to use mode 2 (modes 0 and 1 were already known), but i'm working on mode 3 (called in the other thread DELAY).
mode 3 use is difficult to find out because it's not used in any of sce modules!.. (afaik)
hope to have been useful!
bye _________________ Ciao! from Italy |
|
| Back to top |
|
 |
shepherd
Joined: 02 Sep 2008 Posts: 2
|
Posted: Wed Sep 02, 2009 12:29 am Post subject: Nice |
|
|
| I cann't open the header. Could you paste it again? Please |
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Wed Sep 02, 2009 1:49 am Post subject: |
|
|
I can downlaod it so you can do it too.
| Code: | /*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspled.h - Prototypes for the sceLed_driver library.
*
* Copyright (c) 2009 Phobox
*/
#ifndef __LED_H
#define __LED_H
#ifdef __cplusplus
extern "C" {
#endif
#define SCE_LED_MS 0
#define SCE_LED_WLAN 1
#define SCE_LED_MODE_OFF 0
#define SCE_LED_MODE_ON 1
#define SCE_LED_MODE_BLINK 2
#define SCE_LED_MODE_UNK 3
typedef struct{
/** Unknown, used only in SCE_LED_MODE_UNK */
int param_unk0;
/** Used in SCE_LED_MODE_BLINK. The time for the led to stay ON during the blink */
int onTime;
/** Used in SCE_LED_MODE_BLINK. The time for the led to stay OFF during the blink */
int offTime;
/** Used in SCE_LED_MODE_BLINK. The time the blink has to last. After this time the led is set in the status specified in statusAfterBlink. Set -1 for an inifite time */
int blinkTime;
/** Used in SCE_LED_MODE_BLINK. The status (1 = on, 0 = off) of the led after the blink */
int statusAfterBlink;
} SceLedParam;
/**
* Sets the mode of a led.
* @param led - the led id.
* @param mode - one of SCE_LED_MODE_*
* @param param - used only with modes 2 and 3
*
* @ return 0 on success
* 0x80000102 if "led" argument was not correct (< 0 or >= 2)
* 0x80000107 if "mode" argument was not correct
*/
int sceLedSetMode(int led, int mode, SceLedParam *param);
/**
* Turns off both leds and saves their state.
* The state can be restored using sceLedResume
*/
void sceLedSuspend();
/**
* Resumes the status of leds as it was before sceLedSuspend was called
*/
void sceLedResume();
/**
* Inits the sceLed library
* This is the same as calling module_start, so it is called when the module is started
*/
void sceLedInit();
/**
* Terms the sceLed library
* This is the same as calling module_reboot_before, so is called when there is a kernel reset
*/
void sceLedEnd();
#ifdef __cplusplus
}
#endif
#endif
|
_________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|