forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pspimpose_driver.h

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Wed Aug 29, 2007 6:45 am    Post subject: pspimpose_driver.h Reply with quote

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
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Wed Aug 29, 2007 7:35 am    Post subject: Reply with quote

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
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Wed Aug 29, 2007 7:39 am    Post subject: Reply with quote

here, modified...
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Wed Aug 29, 2007 12:23 pm    Post subject: Reply with quote

what is sceImposeChanges ?
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Aug 29, 2007 2:32 pm    Post subject: Reply with quote

This has been added to the repository.

I've also modified Makefile.am so it will get built.
Back to top
View user's profile Send private message Visit poster's website
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Wed Aug 29, 2007 7:46 pm    Post subject: Reply with quote

Thanks, ooPo :)

d_b: No idea, but I will check later on.
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Aug 29, 2007 10:27 pm    Post subject: Reply with quote

Thanks again adrahil, some nice goodies there :)
Back to top
View user's profile Send private message
flatmush



Joined: 07 Aug 2007
Posts: 28
Location: Here

PostPosted: Thu Aug 30, 2007 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
ahman



Joined: 31 May 2006
Posts: 22

PostPosted: Thu Aug 30, 2007 2:05 am    Post subject: Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Aug 30, 2007 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
flatmush



Joined: 07 Aug 2007
Posts: 28
Location: Here

PostPosted: Thu Aug 30, 2007 6:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Thu Aug 30, 2007 8:17 am    Post subject: Re: pspimpose_driver.h Reply with quote

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
View user's profile Send private message Visit poster's website
flatmush



Joined: 07 Aug 2007
Posts: 28
Location: Here

PostPosted: Thu Aug 30, 2007 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
ahman



Joined: 31 May 2006
Posts: 22

PostPosted: Thu Aug 30, 2007 11:56 am    Post subject: Reply with quote

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
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Thu Aug 30, 2007 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Aug 30, 2007 6:43 pm    Post subject: Reply with quote

Code:
Sending        user/Makefile.am
Adding         user/sceImpose.S
Transmitting file data ..
Committed revision 2308.

Added.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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