pspimpose_driver.h

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

pspimpose_driver.h

Post by adrahil »

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: Select all

/*
 * 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 &#40;c&#41; 2007 Iaroslav Gaponenko <[email protected]>
 *
 * $Id&#58; pspimpose_driver.h$
 */

#ifndef __IMPOSE_DRIVER_H__
#define __IMPOSE_DRIVER_H__

#ifdef __cplusplus
extern "C" &#123;
#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&#40;SceImposeParam param&#41;;

/**
 * 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&#40;SceImposeParam param, int value&#41;;

/**
 * Get the value of the backlight timer.
 *
 * @return backlight timer in seconds or < 0 on error
 *
 */
int sceImposeGetBacklightOffTime&#40;void&#41;; 

/**
 * Set the value of the backlight timer.
 *
 * @param value - The backlight timer. &#40;30 to a lot of seconds&#41;
 * @return < 0 on error
 *
 */
int sceImposeSetBacklightOffTime&#40;int value&#41;; 

/**
 * Get the language and button assignment parameters
 *
 * @return < 0 on error
 *
 */
int sceImposeGetLanguageMode&#40;int* lang, int* button&#41;; 

/**
 * Set the language and button assignment parameters
 *
 * /!\ parameter values not known.
 *
 * @param lang - Language
 * @param button - Button assignment
 * @return < 0 on error
 *
 */
int sceImposeSetLanguageMode&#40;int lang, int button&#41;; 

/**
 * Get the value of the UMD popup. 
 *
 * @return umd popup state or < 0 on error
 *
 */
int sceImposeGetUMDPopup&#40;void&#41;; 

/**
 * Set the value of the UMD popup. 
 *
 * @param value - The popup mode.
 * @return < 0 on error
 *
 */
int sceImposeSetUMDPopup&#40;int value&#41;; 


/**
 * Get the value of the Home popup. 
 *
 * @return home popup state or < 0 on error
 *
 */
int sceImposeGetHomePopup&#40;void&#41;; 

/**
 * Set the value of the Home popup. 
 *
 * @param value - The popup mode.
 * @return < 0 on error
 *
 */
int sceImposeSetHomePopup&#40;int value&#41;; 

/**
 * Check the video out. &#40;for psp slim?&#41;
 *
 * @param value - video out mode/status&#40;?&#41;
 * @return < 0 on error
 *
 */
int sceImposeCheckVideoOut&#40;int* value&#41;;

#ifdef __cplusplus
&#125;
#endif

#endif
sceImpose_driver.S

Code: Select all

	.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.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

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
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

here, modified...
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

what is sceImposeChanges ?
10011011 00101010 11010111 10001001 10111010
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

This has been added to the repository.

I've also modified Makefile.am so it will get built.
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

Thanks, ooPo :)

d_b: No idea, but I will check later on.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Thanks again adrahil, some nice goodies there :)
flatmush
Posts: 28
Joined: Tue Aug 07, 2007 9:15 am
Location: Here
Contact:

Post by flatmush »

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?
ahman
Posts: 22
Joined: Wed May 31, 2006 10:57 am

Post by ahman »

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
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

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.
flatmush
Posts: 28
Joined: Tue Aug 07, 2007 9:15 am
Location: Here
Contact:

Post by flatmush »

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.
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Re: pspimpose_driver.h

Post by sakya »

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
flatmush
Posts: 28
Joined: Tue Aug 07, 2007 9:15 am
Location: Here
Contact:

Post by flatmush »

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?
ahman
Posts: 22
Joined: Wed May 31, 2006 10:57 am

Post by ahman »

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.
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

Well, you can't do really much with the user lib...

sceImpose.S, for linking as sceImpose.o in Makefile:

Code: Select all

	.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
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Code: Select all

Sending        user/Makefile.am
Adding         user/sceImpose.S
Transmitting file data ..
Committed revision 2308.
Added.
Post Reply