Академический Документы
Профессиональный Документы
Культура Документы
NELSON G. LOMBARDO
Resumen. Este trabajo tiene la finalidad de poder documentar el plug-in SMBII para PsP. Intenta dejar información
sobre el plug-in como así ciertos tips técnicos y demás.
1. Motivación
Luego de revisar, encontré muchos plugins que hacen lo mismo, pero todos utilizaban configuraciones por pantalla
y combinaciones de teclas que no me agradaban. Decidí entonces, construir una versión ligera del afamado SMB1. Este
contiene en su primer release, un concepto asociado sencillo:
Sin configuración.
Sin información por pantalla.
Captura de las teclas no agobiantes.
No apaga la PsP.
3. Teoría de funcionamiento
3.1. Idea. Bueno la figura 3.1 nos representa la idea, el concepto por el que me guíe.
Profundizando un poco más sobre el funcionamiento del bucle, podemos observar el diagrama de flujo del mismo
en la figura 3.2.
3.2. El dilema en la lectura de los botones. Bueno, como el principio de funcionamiento del plug-in es no
interceder en el funcionamiento sino sólo en el ahorro de energía, es fundamental que la revisión del uso de los botones
sea de manera transparente.
En busca de hacer la captura transparente y de una forma reutilizable, pude por suerte la misma duda en los foros
de QJ, y uno de los grandes maestros de la scene la contesta. En las referencias pueden encontrar al información.
En este caso aumente el tiempo en que el bucle se ejecuta y utilice la función “sceCtrlPeekBufferPositive”.
3.3. Modo de depuración. El plug-in se puede compilar para que aporte alguna información del funcionamiento
y así depurarlo en caso de hacer modificaciones. Para acceder a esto, se cambia el valor de debugmode al principio por
1 y se compila con el “modo” depuración, con 0 compilas normalmente.
/∗ SMBII 0 . 0 . 0 _06012011 ( s u p e r a l p h a v e r s i o n )
∗
∗ L i c e n s e d under GPL v2 .
∗ Author : n e l s o n . lombardo@gmail . com
∗ Blog : h t t p : / / e t e c h −n e l s o n . b l o g s p o t . com/
∗ Tag : SMBII
∗
∗ Info :
∗ This i s a l i g h t v e r s i o n o f t h e SMB p l u g i n .
∗ This p l u g i n was c r e a t e d f o r use when you t r a v e l i n g .
∗ Maximize t h e use o f b a t t e r y i s e s s e n c i a l !
∗ You don ’ t g e t a s c r e e n i n f o r m a t i o n , don ’ t can c o n f i g u r e them w i t h t h e b u t t o n s , n o t h i n g .
∗ A c t i v e t h e p l u g i n and make y o u r s e l f t o p l a y your f a v o r i t e games or homebrews .
∗ Him make t h e r e s t . . . ; )
∗/
#d e f i n e debugmode 0
#include < s t d l i b . h>
#include <t i m e . h>
Date: 06/01/2011.
1
http://hakuryu188-dev.blogspot.com/
i
Figura 3.1. Capa superior del diagrama de flujo.
ii
Figura 3.2. Conceptualizando el bucle principal.
while ( 1 )
{
#i f ( debugmode==1)
pspDebugScreenSetXY ( 0 , 0 ) ;
p s p D e b u g S c r e e n P r i n t f ( " SMBII r u n n i n g . . . %d %d %d " , maxtime , t i m e s , t ) ;
#e n d i f
ret = 0;
s c e C t r l P e e k B u f f e r P o s i t i v e (&pad , 1 ) ;
i f ( ( pad . Ly < (HALFZONE−DEATHZONE) ) | | ( pad . Ly > (HALFZONE+DEATHZONE) ) ) { r e t ++;}
i f ( ( pad . Lx < (HALFZONE−DEATHZONE) ) | | ( pad . Lx > (HALFZONE+DEATHZONE) ) ) { r e t ++;}
// Check a l l b u t t o n s . . .
i f ( ( pad . B u t t o n s & PSP_CTRL_VOLDOWN && ! ( o l d p a d . B u t t o n s & PSP_CTRL_VOLDOWN) ) | |
( ( pad . B u t t o n s & PSP_CTRL_VOLUP) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_VOLUP) ) | |
( ( pad . B u t t o n s & PSP_CTRL_HOME) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_HOME) ) | |
( ( pad . B u t t o n s & PSP_CTRL_START) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_START) ) | |
( ( pad . B u t t o n s & PSP_CTRL_SELECT) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_SELECT) ) | |
( ( pad . B u t t o n s & PSP_CTRL_SCREEN) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_SCREEN) ) | |
( ( pad . B u t t o n s & PSP_CTRL_NOTE) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_NOTE) ) | |
( ( pad . B u t t o n s & PSP_CTRL_RTRIGGER) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_RTRIGGER) ) ||
( ( pad . B u t t o n s & PSP_CTRL_LTRIGGER) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_LTRIGGER) ) ||
( ( pad . B u t t o n s & PSP_CTRL_CROSS) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_CROSS) ) | |
iii
( ( pad . B u t t o n s & PSP_CTRL_CIRCLE) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_CIRCLE) ) | |
( ( pad . B u t t o n s & PSP_CTRL_TRIANGLE) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_TRIANGLE) ) | |
( ( pad . B u t t o n s & PSP_CTRL_SQUARE) && ! ( pad . B u t t o n s & PSP_CTRL_SQUARE) ) | |
( ( pad . B u t t o n s & PSP_CTRL_UP) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_UP) ) | |
( ( pad . B u t t o n s & PSP_CTRL_DOWN) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_DOWN) ) | |
( ( pad . B u t t o n s & PSP_CTRL_LEFT) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_LEFT) ) | |
( ( pad . B u t t o n s & PSP_CTRL_RIGHT) && ! ( o l d p a d . B u t t o n s & PSP_CTRL_RIGHT) ) ) { r e t ++;}
if ( r e t >0)
{
times = t ;
maxtime = 0 ;
SettingCpuClock ( times ) ; // CPU c l o c k l o w e r
sceDisplaySetBrightness (25 , 0) ;
}
if ( maxtime == SECS)
{
s c e P o w e r T i c k (PSP_POWER_TICK_DISPLAY) ;
i f ( s c e P o w e r G e t B a t t e r y L i f e P e r c e n t ( ) <30) { SettingLEDs (OFF) ; }
e l s e { SettingLEDs (ON) ; }
t i m e s ++;
i f ( times > 8) { times = 8 ; }
SettingCpuClock ( times ) ; // CPU c l o c k l o w e r
s c e D i s p l a y S e t B r i g h t n e s s ( 1 6 / t i m e s −2 ,0) ;
maxtime = 0 ;
}
e l s e { maxtime++; }
// End o f Trend B a t t e r y //
s c e K e r n e l D e l a y T h r e a d (DELTA) ; // 100 uSeconds
o l d p a d = pad ;
}
return 0 ;
}
// Part o f code
i n t m o d u l e _ s t a r t ( S c e S i z e a r g s , void ∗ a r g p )
{
i n t t h i d = s c e K e r n e l C r e a t e T h r e a d ( "PRX" , main_thread , 0 x30 , 0 x1000 , 0 , NULL) ;
i f ( t h i d >= 0 ) s c e K e r n e l S t a r t T h r e a d ( t h i d , a r g s , a r g p ) ;
return 0 ;
}
void S e t t i n g C p u C l o c k ( unsigned char t i m e s )
{
switch ( t i m e s )
{
case 1 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU8, CPU8, CPU8/ 2 ) ;
break ;
case 2 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU7, CPU7, CPU7/ 2 ) ;
break ;
case 3 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU6, CPU6, CPU6/ 2 ) ;
break ;
case 4 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU5, CPU5, CPU5/ 2 ) ;
break ;
case 5 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU4, CPU4, CPU4/ 2 ) ;
break ;
case 6 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU3, CPU3, CPU3/ 2 ) ;
break ;
case 7 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU2, CPU2, CPU2/ 2 ) ;
break ;
case 8 :
s c e P o w e r S e t C l o c k F r e q u e n c y (CPU1, CPU1, CPU1/ 2 ) ;
break ;
}
}
iv
5. Instalación
Para la instalación tomas el archivo SMBII.prx y lo copias dentro de:
ms0 : / SEPLUGINS/
Luego dentro de esta carpeta existen 3 archivos (de no existir lo creas), llamados:
GAME. t x t
GAME150 . t x t
VHS. t x t
POPS . t x t
Y según sea el archivo donde lo agregas, será donde se ejecutara el plug-in. O sea, si lo agregas a VHS.txt, cuando
entres al XMB se ejecutará. Para deshabilitar lo cambias por:
ms0 : / SEPLUGINS/SMBII . prx 0
6. Difusión
2
Los chicos de TPS me están ayudando con la difusión del plug-in. Son una nueva comunidad de homebrew para la
PsP y están intentando trabajar de forma diferente a otras comunidades.
7. Licencia
Este texto y el plug-in esta bajo la GPL3 v3 o superior según sea el caso. Siempre manteniendo mi libertad y la
suya como pilar fundamental para la transmición del conocimiento.
8. Versión
0.0.0_06012011
Referencias
[1] http://forums.qj.net/zx-81s-homebrew-releases/146232-development-question.html
[2] http://psp.jim.sh/pspsdk-doc/group__Ctrl.html
2
http://totalpspscene.ucoz.com/
3
http://www.gnu.org/licenses/gpl.html