| View previous topic :: View next topic |
| Author |
Message |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Wed Aug 29, 2007 6:45 am Post subject: pspimpose_driver.h |
|
|
Could someone commit to SVN into pspsdk/src/kernel? Thanks.
(Not all params have been checked, but Brightness and Mute, for example, work good :)
There is a range checking on the params, of course. For example, brightness goes from 0 to 3 included.
pspimpose_driver.h
| Code: | /*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspimpose_driver.h - Prototypes for the sceImpose_driver library.
*
* Copyright (c) 2007 Iaroslav Gaponenko <adrahil@gmail.com>
*
* $Id: pspimpose_driver.h$
*/
#ifndef __IMPOSE_DRIVER_H__
#define __IMPOSE_DRIVER_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef int SceImposeParam;
/**
* These values have been found in the 3.52 kernel.
* Therefore, they might not be supported by previous ones.
*/
#define PSP_IMPOSE_MAIN_VOLUME 0x1
#define PSP_IMPOSE_BACKLIGHT_BRIGHTNESS 0x2
#define PSP_IMPOSE_EQUALIZER_MODE 0x4
#define PSP_IMPOSE_MUTE 0x8
#define PSP_IMPOSE_AVLS 0x10
#define PSP_IMPOSE_TIME_FORMAT 0x20
#define PSP_IMPOSE_DATE_FORMAT 0x40
#define PSP_IMPOSE_LANGUAGE 0x80
#define PSP_IMPOSE_BACKLIGHT_OFF_INTERVAL 0x200
#define PSP_IMPOSE_SOUND_REDUCTION 0x400
#define PSP_IMPOSE_UMD_POPUP_ENABLED 1
#define PSP_IMPOSE_UMD_POPUP_DISABLED 0
/**
* Fetch the value of an Impose parameter.
*
* @return value of the parameter on success, < 0 on error
*/
int sceImposeGetParam(SceImposeParam param);
/**
* Change the value of an Impose parameter.
*
* @param param - The parameter to change.
* @param value - The value to set the parameter to.
* @return < 0 on error
*
*/
int sceImposeSetParam(SceImposeParam param, int value);
/**
* Get the value of the backlight timer.
*
* @return backlight timer in seconds or < 0 on error
*
*/
int sceImposeGetBacklightOffTime(void);
/**
* Set the value of the backlight timer.
*
* @param value - The backlight timer. (30 to a lot of seconds)
* @return < 0 on error
*
*/
int sceImposeSetBacklightOffTime(int value);
/**
* Get the language and button assignment parameters
*
* @return < 0 on error
*
*/
int sceImposeGetLanguageMode(int* lang, int* button);
/**
* Set the language and button assignment parameters
*
* /!\ parameter values not known.
*
* @param lang - Language
* @param button - Button assignment
* @return < 0 on error
*
*/
int sceImposeSetLanguageMode(int lang, int button);
/**
* Get the value of the UMD popup.
*
* @return umd popup state or < 0 on error
*
*/
int sceImposeGetUMDPopup(void);
/**
* Set the value of the UMD popup.
*
* @param value - The popup mode.
* @return < 0 on error
*
*/
int sceImposeSetUMDPopup(int value);
/**
* Get the value of the Home popup.
*
* @return home popup state or < 0 on error
*
*/
int sceImposeGetHomePopup(void);
/**
* Set the value of the Home popup.
*
* @param value - The popup mode.
* @return < 0 on error
*
*/
int sceImposeSetHomePopup(int value);
/**
* Check the video out. (for psp slim?)
*
* @param value - video out mode/status(?)
* @return < 0 on error
*
*/
int sceImposeCheckVideoOut(int* value);
#ifdef __cplusplus
}
#endif
#endif |
sceImpose_driver.S
| Code: | .set noreorder
#include "pspstub.s"
STUB_START "sceImpose_driver",0x00010011,0x00170005
STUB_FUNC 0x0F341BE4,sceImposeGetHomePopup
STUB_FUNC 0x116CFF64,sceImposeCheckVideoOut
STUB_FUNC 0x116DDED6,sceImposeSetVideoOutMode
STUB_FUNC 0x1AEED8FE,sceImposeSuspend
STUB_FUNC 0x1B6E3400,sceImposeGetStatus
STUB_FUNC 0x24FD7BCF,sceImposeGetLanguageMode
STUB_FUNC 0x36AA6E91,sceImposeSetLanguageMode
STUB_FUNC 0x381BD9E7,sceImposeHomeButton
STUB_FUNC 0x531C9778,sceImposeGetParam
STUB_FUNC 0x5595A71A,sceImposeSetHomePopup
STUB_FUNC 0x7084E72C,sceImpose_driver_7084E72C
STUB_FUNC 0x72189C48,sceImposeSetUMDPopup
STUB_FUNC 0x810FB7FB,sceImposeSetParam
STUB_FUNC 0x86924032,sceImposeResume
STUB_FUNC 0x8C943191,sceImposeGetBatteryIconStatus
STUB_FUNC 0x8F6E3518,sceImposeGetBacklightOffTime
STUB_FUNC 0x967F6D4A,sceImposeSetBacklightOffTime
STUB_FUNC 0x9C8C6C81,sceImposeSetStatus
STUB_FUNC 0x9DBCE0C4,sceImpose_driver_9DBCE0C4
STUB_FUNC 0xB415FC59,sceImposeChanges
STUB_FUNC 0xBDBC42A6,sceImposeInit
STUB_FUNC 0xC7E36CC7,sceImposeEnd
STUB_FUNC 0xE0887BC8,sceImposeGetUMDPopup
STUB_END
|
Last edited by adrahil on Wed Aug 29, 2007 7:56 am; edited 3 times in total |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Wed Aug 29, 2007 7:35 am Post subject: |
|
|
Damn if you are gonna include a new library, use latest nids xD
sceImpose_driver_0F341BE4 = sceImposeGetHomePopup
sceImpose_driver_116CFF64 = sceImposeCheckVideoOut
sceImpose_driver_116DDED6 = sceImposeSetVideoOutMode
sceImpose_driver_5595A71A = sceImposeSetHomePopup
sceImpose_driver_8F6E3518 = sceImposeGetBacklightOffTime
sceImpose_driver_967F6D4A = sceImposeSetBacklightOffTime |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Wed Aug 29, 2007 7:39 am Post subject: |
|
|
| here, modified... |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Wed Aug 29, 2007 12:23 pm Post subject: |
|
|
what is sceImposeChanges ? _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed Aug 29, 2007 2:32 pm Post subject: |
|
|
This has been added to the repository.
I've also modified Makefile.am so it will get built. |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Wed Aug 29, 2007 7:46 pm Post subject: |
|
|
Thanks, ooPo :)
d_b: No idea, but I will check later on. |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Wed Aug 29, 2007 10:27 pm Post subject: |
|
|
| Thanks again adrahil, some nice goodies there :) |
|
| Back to top |
|
 |
flatmush
Joined: 07 Aug 2007 Posts: 28 Location: Here
|
Posted: Thu Aug 30, 2007 12:25 am Post subject: |
|
|
I just did an "svn update && ./toolchain.sh" but there doesn't seem to be a copy of pspimpose_driver.h anywhere.
Am I going about updating my toolchain the wrong way or is this a problem? |
|
| Back to top |
|
 |
ahman
Joined: 31 May 2006 Posts: 22
|
Posted: Thu Aug 30, 2007 2:05 am Post subject: |
|
|
| Nice work, adrahil! I just worked out the volume settings with sceImposeGetParam() & sceImposeSetParam() and then I see this thread. If I see this eariler, it would save me some work. lol |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Thu Aug 30, 2007 5:49 am Post subject: |
|
|
| flatmush wrote: | I just did an "svn update && ./toolchain.sh" but there doesn't seem to be a copy of pspimpose_driver.h anywhere.
Am I going about updating my toolchain the wrong way or is this a problem? |
Try deleting the 'psptoolchain/build' directory, and running: ./toolchain.sh 6
This will run the 6th script in 'psptoolchain/scripts', which is pspsdk. |
|
| Back to top |
|
 |
flatmush
Joined: 07 Aug 2007 Posts: 28 Location: Here
|
Posted: Thu Aug 30, 2007 6:53 am Post subject: |
|
|
| Thanks, I deleted the whole toolchain and redid the lot, I guess that way would have been a lot quicker, anyhoo I got the files I wanted now so all is good. |
|
| Back to top |
|
 |
sakya
Joined: 28 Apr 2006 Posts: 190
|
Posted: Thu Aug 30, 2007 8:17 am Post subject: Re: pspimpose_driver.h |
|
|
Hi! :)
| adrahil wrote: | | (Not all params have been checked, but Brightness and Mute, for example, work good :) |
Also PSP_IMPOSE_MAIN_VOLUME works fine.
Volume value must be between 0 and 30. :)
Many thanks. :)
Ciaooo
Sakya |
|
| Back to top |
|
 |
flatmush
Joined: 07 Aug 2007 Posts: 28 Location: Here
|
Posted: Thu Aug 30, 2007 8:40 am Post subject: |
|
|
I assume these functions require kernel mode to work, is there any way to use the user mode incarnations of these functions?
Or is it just some of them that need kernel mode? |
|
| Back to top |
|
 |
ahman
Joined: 31 May 2006 Posts: 22
|
Posted: Thu Aug 30, 2007 11:56 am Post subject: |
|
|
| flatmush wrote: | I assume these functions require kernel mode to work, is there any way to use the user mode incarnations of these functions?
Or is it just some of them that need kernel mode? |
Some of those functions works under both Kernel & User mode, some are Kernel mode only. You can see the details in Moonlight/SilverSpring's page below. Functions under sceImpose are User Mode and functions under sceImpose_driver are Kernel mode.
http://moonlight.lan.st/3.5x/kd/impose.html
The sceImpose_driver.S exports posted above is only for kernel mode access. You may need to make one for user mode if it's not already in the SDK. |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Thu Aug 30, 2007 3:39 pm Post subject: |
|
|
Well, you can't do really much with the user lib...
sceImpose.S, for linking as sceImpose.o in Makefile:
| Code: | .set noreorder
#include "pspstub.s"
STUB_START "sceImpose",0x40010011,0x000F0005
STUB_FUNC 0x0F341BE4,sceImposeGetHomePopup
STUB_FUNC 0x24FD7BCF,sceImposeGetLanguageMode
STUB_FUNC 0x36AA6E91,sceImposeSetLanguageMode
STUB_FUNC 0x381BD9E7,sceImposeHomeButton
STUB_FUNC 0x5595A71A,sceImposeSetHomePopup
STUB_FUNC 0x72189C48,sceImposeSetUMDPopup
STUB_FUNC 0x8C943191,sceImposeGetBatteryIconStatus
STUB_FUNC 0x8F6E3518,sceImposeGetBacklightOffTime
STUB_FUNC 0x967F6D4A,sceImposeSetBacklightOffTime
STUB_FUNC 0x9BA61B49,sceImpose_9BA61B49
STUB_FUNC 0xA9884B00,sceImpose_A9884B00
STUB_FUNC 0xBB3F5DEC,sceImpose_BB3F5DEC
STUB_FUNC 0xE0887BC8,sceImposeGetUMDPopup
STUB_FUNC 0xFCD44963,sceImpose_FCD44963
STUB_FUNC 0xFF1A2F07,sceImpose_FF1A2F07
STUB_END
|
|
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Thu Aug 30, 2007 6:43 pm Post subject: |
|
|
| Code: | Sending user/Makefile.am
Adding user/sceImpose.S
Transmitting file data ..
Committed revision 2308. |
Added. |
|
| Back to top |
|
 |
|