Permalink
Browse files

0.4

  • Loading branch information...
1 parent b2f3301 commit 11155d3f95543795eb156862dc68a60dc52d8d7c @wargio committed Jan 18, 2013
Showing with 25 additions and 73 deletions.
  1. +8 −10 README.md
  2. +0 −56 libmove/README.md
  3. +2 −1 libmove/libmove.cpp
  4. +1 −1 libmove/libmove/moveutil.h
  5. +10 −5 libmove/moveutil.cpp
  6. +4 −0 sample/libmove-NoRSX/source/main.cpp
View
@@ -11,20 +11,18 @@ Authors
Changelog:
----------
+* 0.4
+<pre>Fixed set_move_led_color
+Fixed various bugs</pre>
* 0.3
-
- Now is possible to choose the move controller to use.
- Added move_set_rumble/move_get_rumble function
- Added set_move_led_color to force the ball color of the PS Move
-
+<pre>Now is possible to choose the move controller to use.
+Added move_set_rumble/move_get_rumble function
+Added set_move_led_color to force the ball color of the PS Move</pre>
* 0.2
-
- fixed gyro axis
-
+ <pre>fixed gyro axis</pre>
* 0.1
+ <pre>initial release</pre>
- initial release
-
Linking
-------
View
@@ -1,56 +0,0 @@
-libmove for PSL1GHT V2
-======================
-
-This lib will be installed inside the PORTLIBS
-
-Authors
--------
-* deroad - libmove.cpp/.h movebuttons.h
-* José Ramos Márquez (bigboss) - moveutil.cpp/.h spursutil.cpp/.h
-* Youness Alaoui (KaKaRoTo) - moveutil.cpp/.h spursutil.cpp/.h
-
-Changelog:
-----------
-* 0.3
-
- Now is possible to choose the move controller to use.
- Added move_set_rumble/move_get_rumble function
- Added set_move_led_color to force the ball color of the PS Move
-
-* 0.2
-
- fixed gyro axis
-
-* 0.1
-
- initial release
-
-Linking
--------
-
-Add these libs on your makefile to compile your homebrew.
- -lmove -lgem -lcamera -lspurs
-
-License
--------
-
-This lib is released under BSD License.
-
-Example
--------
-
- #include <libmove/libmove.h>
- int main(s32 argc, const char* argv[]){
- movePadData data;
- init_move();
- while(1){
- getMovePadData(PLAYSTATION_MOVE_PAD_0 , &data);
- if(data.BTN_ACTION)
- calibrate_move(PLAYSTATION_MOVE_PAD_0);
- }else if(data.BTN_T){
- goto end;
- }
- }
- end:
- end_move();
- }
View
@@ -79,7 +79,8 @@ void getMovePadData(int pad_number, movePadData *data){
}
void set_move_led_color(int pad_number, f32 red, f32 green, f32 blue){
- gemForceRGB(pad_number, red, green, blue);
+ gemReset(pad_number);
+ processMove(move_context, pad_number, red, green, blue);
}
int move_reset(int pad_number){
@@ -36,7 +36,7 @@ static inline float vec_array(vec_float4 vec, unsigned int idx)
*/
moveContext *initMove();
void endMove(moveContext *context);
-int processMove(moveContext *context);
+int processMove(moveContext *context, int pad_number, f32 red, f32 green, f32 blue);
int processMove(moveContext *context, int pad_number);
void moveGet3DPosition(moveContext *context, float *x, float *y, float *z);
View
@@ -15,6 +15,8 @@ u16 oldGemPad = 0;
u16 newGemPad = 0;
u16 newGemAnalogT = 0;
+static f32 _red = 0.5, _green = 0.5, _blue = 0.5;
+
static void endCamera(moveContext *context)
{
cameraStop (0);
@@ -210,7 +212,7 @@ int processMove(moveContext *context, int pad_number)
ret = gemGetState (pad_number, STATE_LATEST_IMAGE_TIME, 0, &context->state);
switch (ret) {
case 2:
- gemForceRGB (pad_number, 0.5, 0.5, 0.5);
+ gemForceRGB (pad_number, _red, _green, _blue);
break;
case 5:
@@ -227,8 +229,11 @@ int processMove(moveContext *context, int pad_number)
return ret;
}
-int processMove(moveContext *context)
-{
+int processMove(moveContext *context, int pad_number, f32 red, f32 green, f32 blue){
+ _red = red;
+ _green = green;
+ _blue = blue;
+
const unsigned int hues[] = { 4 << 24, 4 << 24, 4 << 24, 4 << 24 };
int ret = -1;
@@ -242,10 +247,10 @@ int processMove(moveContext *context)
//printf ("Return from gemUpdateFinish %X\n", ret);
if (ret == 0)
{
- ret = gemGetState (0, STATE_LATEST_IMAGE_TIME, 0, &context->state);
+ ret = gemGetState (pad_number, STATE_LATEST_IMAGE_TIME, 0, &context->state);
switch (ret) {
case 2:
- gemForceRGB (0, 0.5, 0.5, 0.5);
+ gemForceRGB(pad_number, red, green, blue);
break;
case 5:
@@ -33,6 +33,8 @@ s32 main(s32 argc, const char* argv[])
init_move();
+ set_move_led_color(PLAYSTATION_MOVE_PAD_0, 0.5, 0, 0);
+
NoRSX *GFX = new NoRSX(RESOLUTION_1920x1080); //set defined screen resolution You can change it to:
//RESOLUTION_720x480 | RESOLUTION_720x576 | RESOLUTION_1280x720 | RESOLUTION_1920x1080
Image IMG(GFX);
@@ -63,6 +65,7 @@ s32 main(s32 argc, const char* argv[])
y=GFX->height*0.5-y1;
z=-z1;
+
while(GFX->GetAppStatus()){
static time_t starttime = 0;
double fps = 0;
@@ -82,6 +85,7 @@ s32 main(s32 argc, const char* argv[])
if(data.BTN_ACTION){
calibrate_move(PLAYSTATION_MOVE_PAD_0);
+ set_move_led_color(PLAYSTATION_MOVE_PAD_0, 0.5, 0, 0);
get_gyro_position(PLAYSTATION_MOVE_PAD_0, &x1, &y1, &z1);
x=GFX->width*0.5-x1;
y=GFX->height*0.5-y1;

0 comments on commit 11155d3

Please sign in to comment.