MyQJ | QJ.NET | Apple | Mobile | Science | MMORPG | Nintendo DS | Wii | World of Warcraft | PlayStation 3 | PSP | XBOX 360 | Gadgets | PC Gaming | Age of Conan | DL.QJ | QJ.NET Forums
Home :: XML Feed :: Files :: Forums :: Bookmark site :: Terms of use :: Privacy policy :: Submit News :: Advertise :: Contact us


Go Back   QJ.NET Forums > All QJ Forums > Gaming Forums > QJ.NET Sony PSP Forums > PSP Development, Hacks, and Homebrew > PSP Development Forum
Register FAQ+ Become Premium Members List Mark Forums Read Log Out

Reply
 
Thread Tools
Hey Guest!
Not Registered? Join today!

Registration allows you too:

Post on our Forums.

Take part in games and registered user benefits!

Get rid of this ad....
Old 12-26-2007, 09:24 AM   #1
Mr305
Developer
 
Mr305's Avatar


Join Date: Nov 2006
Posts: 1,148
Arrow [RELEASE][3rd party sources included :D] LocoRoco Motion Plugin v0.99 = Next-Gen

Here's a major update from previous version.

This version almost all problems that existed in the previous 0.8 SWC "SomeWhatCrippled" version.

You can also try the LocoRoco demo's; you donot have to own the game to try this.


Requirements:
-------------


1) Neo Motion Kit
2) CFW atleast v3.71 - due to NID compatibility.

Changelog:
----------

1) Added audio Fix; Audio works perfectly along with motion for perfect LocoRoco game experience.
Thanks to ps2dev members.
2) Added a check, wherein the plugin self-terminates with a message, if Motion Kit is unplugged or not plugged in
before the game begins or due to failure in initialization; hence if anything fails, you can still
play the game unlike previous version which caused "unusably sluggish behaviour".
3) Added a Jump function but something isn't right. Tilt forward and then backward.
[This will most probably be removed in next version if I can't figure out the problem]
4) Substantially improved chances of succesfull initialization. Failure rate - 1 in 10 times.
5) Reduced CPU usage - removed unused stuff / Z axis reading / other calculations

Videos Illustrations:
------------------


Latest Video with audio & initialization failure / disconnection notification

Tutorial / How to use the plugin

Fast Paced action video

Additional Notes:
-----------------

1) After muting and disabling by using Note button, audio doesn't re-enable, Press Vol Up or Down.
2) You'll see a slight delay when you change the volume -- it's normal.

Any suggestions for improvement welcome. Enjoy.

Note: Put "REAL USER" in your post let me know you have actually tried this.


Download v0.99
Donate
Attached Files
File Type: zip LocoRocoMotionPlugin_v0.99.zip (8.5 KB, 49 views)

Last edited by Mr305; 02-28-2008 at 05:22 PM.
Mr305 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 10:43 AM   #2
Korlithiel
Elite
 
Korlithiel's Avatar


Join Date: Aug 2006
Posts: 433
   
Default

You know, you make it really hard not to spend all of my X-mas cash on buying that peripheral and game.
__________________
With love out of life and sleep out of mind, death approaches with me in mind.
Korlithiel no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 10:46 AM   #3
Mr305
Developer
 
Mr305's Avatar


Join Date: Nov 2006
Posts: 1,148
Default

Quote:
Originally Posted by Korlithiel
You know, you make it really hard not to spend all of my X-mas cash on buying that peripheral and game.
You can also try the demo.
Mr305 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 01:02 PM   #4
j3r3mie
Journeyman
 
j3r3mie's Avatar


Join Date: Sep 2007
Posts: 135
Default

This plugins is so cool Can i know where you buy your Black Motion kit ?
__________________
PSP Fat 3.90M33-2 + Kernel 1.50-2 + MS Patch
iPod Touch 1.1.2 Jailbreaké + iTunes 7.6
Mozilla FireFox + Windows XP SP2
Québécois
j3r3mie no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 01:08 PM   #5
Mr305
Developer
 
Mr305's Avatar


Join Date: Nov 2006
Posts: 1,148
Default

Quote:
Originally Posted by j3r3mie
This plugins is so cool Can i know where you buy your Black Motion kit ?
It's Neoflash Sponsored - Summer Compo '07 winner
Mr305 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 01:36 PM   #6
PS2MAN
Journeyman


Join Date: Sep 2005
Posts: 177
   
Default

I wish they would make a slim version
PS2MAN no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 03:57 PM   #7
adrahil
Developer


Join Date: Jun 2006
Posts: 142
Default

Pity you didn't include the code - especially since you stitched most of it up from various apps. I like the way you *reused* the SceCtrlData structure in conjunction with count to initialize your function Good job!


Here is a quick and dirty reverse of it. Not compilable as is, and contains a few volountary errors to make it QJ-proof.
Code:
#include <pspdebug.h>
#include "psplink/util.h"
#include "psplink/apihook.h"
#include "graphics.h"

int module_stop(){
  return 0;
}

int module_start(int argc, void* argv){
  pspDebugSioInit();
  pspDebugSioSetBaud(510416);

  th_id = sceKernelCreateThread("main_thread", main, 0x20, 0x10000, 0, 0);

  if (th_id >= 0){
    sceKernelStartThread(th_id, argc, argv);
  }
  return 0;
}

SceCtrlData old_pad;  //0x000020EC
SceCtrlData new_pad;  //0x0000210C
SceCtrlData fake_pad; //0x0000211C
int fake_buttons;
int old_btn;          //0x00002100
int initialized;      //0x000020BC
int last_peek_ret;    //0x000020C0
int *fake_btn_ptr;    //0x000020B8
int jmp_counter;      //0x000020B4
int jmp_state;        //0x000020B0
 
int sceCtrlReadBufferPositive_fake(SceCtrlData *pad_data, int count){
  int cnt; 

  if ((initialized != 1) && (count == 0x1FEA3F)){
    initialized = 1;
    fake_btn_ptr = pad_data.Buttons;
    g_counter = 0x3C;
    jmp_state = 0;
  }

  last_peek_ret = sceCtrl_driver_454455AC(pad_data, count);
  if (initialized != 1) return last_peek_ret;
  if (*fake_btn_ptr == 0x1F4){
    pad_data.Buttons |= PSP_CTRL_LTRIGGER;
  }
  if (*fake_btn_ptr == 0x1F5){
    pad_data.Buttons |= PSP_CTRL_RTRIGGER;
  }
  if (*fake_btn_ptr == 0x1F7){
    if (jmp_state == 0){
      jmp_state = 2;
      jmp_counter = 1;
      pad_data.Buttons |= (PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER);
      *fake_btn_ptr = 0;
      return last_peek_ret;
    }
  }

  if (jmp_state == 1){
    jmp_state = 2;
    jmp_counter = 1;
    pad_data.Buttons |= (PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER);
    *fake_btn_ptr = 0;
    return last_peek_ret;
  } else if (jmp_state == 2){
    cnt = g_counter;
    if (cnt < 0xB){
      cnt++;
      if (cnt < 0xB){
        jmp_counter = cnt;
        pad_data.Buttons |= (PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER);
        *fake_btn_ptr = 0;
        return last_peek_ret;
      }
    }
    if (cnt == 0xB){
      jmp_counter = 0x3C;
      jmp_state = 0;
    }
  }
  *fake_btn_ptr = 0;
  return last_peek_ret;
}

int main(int argc, void* argv){
  char c1;              //r16
  char c2;              //r17
  int modid;
  int tries;            //r20
  int deadthread;       //r19
  int unk;              //r18

  sceKernelDelayThread(3500000);
  fake_buttons = 0;
  modid = refer_module_by_name("sceController_Service", 0);
  apiHookByNid(modid, "sceCtrl", 0x1F803938, sceCtrlReadBufferPositive_fake);
  fake_pad.Buttons = &fake_buttons;

  sceCtrl_driver_454455AC(&fake_pad, 0x1FEA3F);
  sceCtrlReadBufferPositive_fake(&fake_pad, 0x1FEA3F);

  sceCodecOutputEnable(0, 1);
  tries = 0;
  unk = 0;
  deadthread = 0;



  while(1){
    sceCtrl_driver_C4AAD55F(&new_pad, 1);

    old_pad.TimeStamp = new_pad.TimeStamp;
    old_pad.Ly = new_pad.Ly;
    old_btn = old_pad.Buttons;
    old_pad.Buttons = new_pad.Buttons;
    old_pad.Lx = new_pad.Lx;

    if ((old_btn & ~new_pad.Buttons) & (PSP_CTRL_VOLDOWN|PSP_CTRL_VOLUP)){
      sceKernelDelayThread(50000);
      sceCodecOutputEnable(0, 1);
    }

    pspDebugSioPutchar(0x31);
    c1 = pspDebugSioWaitGetchar();
    pspDebugSioPutchar(0x32);
    c2 = pspDebugSioWaitGetchar();


    if ((c1 == 0x500) || (c2 == 0x500)){
      printTextScreen(0, 0, "Motion Kit not detected. Terminating...", 0, 0xFFFFFF);
      tries++;
      if (tries == 100){
        sceKernelExitDeleteThread(0);
      }
      deadthread = 0;
    }

    if (c1 < 0x73){
      fake_pad.TimeStamp = 0x1F5;
    }

    if (c1 < 0xC8){
      if (c1 < 0x92){
        fake_pad.TimeStamp = 0x1F4;
      }
    }

    if (c2 >= 0x96) && (unk != 0){
      if ((unk == 1) && (c2 >= 0xA7)){
        fake_pad.TimeStamp = 0x1F7;
        unk = 0;
      }
    }

    if (deadthread != 1){
      sceKernelDelayThread(0x3e8);
    } else {
      sceKernelDelayThread(1);
    }
}
__________________
Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
17:17 < InsertWittyName> Can't pin user error on a dev ;)
17:18 < InsertWittyName> Lesson learnt on both sides I would say.
17:18 < InsertWittyName> You learnt to treat the end-user as a retarded fish.
17:18 < InsertWittyName> They learnt to read readme's ;)

Spoiler for me:
Quote:
17:12 <+dot_blank> are you the long haired pimp ;)
adrahil no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 04:24 PM   #8
Mr305
Developer
 
Mr305's Avatar


Join Date: Nov 2006
Posts: 1,148
Default

Quote:
Originally Posted by adrahil
Pity you didn't include the code - especially since you stitched most of it up from various apps. I like the way you *reused* the SceCtrlData structure in conjunction with count to initialize your function Good job!


Here is a quick and dirty reverse of it. Not compilable as is, and contains a few volountary errors to make it QJ-proof.
Code:
#include <pspdebug.h>
#include "psplink/util.h"
#include "psplink/apihook.h"
#include "graphics.h"

int module_stop(){
  return 0;
}

int module_start(int argc, void* argv){
  pspDebugSioInit();
  pspDebugSioSetBaud(510416);

  th_id = sceKernelCreateThread("main_thread", main, 0x20, 0x10000, 0, 0);

  if (th_id >= 0){
    sceKernelStartThread(th_id, argc, argv);
  }
  return 0;
}

SceCtrlData old_pad;  //0x000020EC
SceCtrlData new_pad;  //0x0000210C
SceCtrlData fake_pad; //0x0000211C
int fake_buttons;
int old_btn;          //0x00002100
int initialized;      //0x000020BC
int last_peek_ret;    //0x000020C0
int *fake_btn_ptr;    //0x000020B8
int jmp_counter;      //0x000020B4
int jmp_state;        //0x000020B0
 
int sceCtrlReadBufferPositive_fake(SceCtrlData *pad_data, int count){
  int cnt; 

  if ((initialized != 1) && (count == 0x1FEA3F)){
    initialized = 1;
    fake_btn_ptr = pad_data.Buttons;
    g_counter = 0x3C;
    jmp_state = 0;
  }

  last_peek_ret = sceCtrl_driver_454455AC(pad_data, count);
  if (initialized != 1) return last_peek_ret;
  if (*fake_btn_ptr == 0x1F4){
    pad_data.Buttons |= PSP_CTRL_LTRIGGER;
  }
  if (*fake_btn_ptr == 0x1F5){
    pad_data.Buttons |= PSP_CTRL_RTRIGGER;
  }
  if (*fake_btn_ptr == 0x1F7){
    if (jmp_state == 0){
      jmp_state = 2;
      jmp_counter = 1;
      pad_data.Buttons |= (PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER);
      *fake_btn_ptr = 0;
      return last_peek_ret;
    }
  }

  if (jmp_state == 1){
    jmp_state = 2;
    jmp_counter = 1;
    pad_data.Buttons |= (PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER);
    *fake_btn_ptr = 0;
    return last_peek_ret;
  } else if (jmp_state == 2){
    cnt = g_counter;
    if (cnt < 0xB){
      cnt++;
      if (cnt < 0xB){
        jmp_counter = cnt;
        pad_data.Buttons |= (PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER);
        *fake_btn_ptr = 0;
        return last_peek_ret;
      }
    }
    if (cnt == 0xB){
      jmp_counter = 0x3C;
      jmp_state = 0;
    }
  }
  *fake_btn_ptr = 0;
  return last_peek_ret;
}

int main(int argc, void* argv){
  char c1;              //r16
  char c2;              //r17
  int modid;
  int tries;            //r20
  int deadthread;       //r19
  int unk;              //r18

  sceKernelDelayThread(3500000);
  fake_buttons = 0;
  modid = refer_module_by_name("sceController_Service", 0);
  apiHookByNid(modid, "sceCtrl", 0x1F803938, sceCtrlReadBufferPositive_fake);
  fake_pad.Buttons = &fake_buttons;

  sceCtrl_driver_454455AC(&fake_pad, 0x1FEA3F);
  sceCtrlReadBufferPositive_fake(&fake_pad, 0x1FEA3F);

  sceCodecOutputEnable(0, 1);
  tries = 0;
  unk = 0;
  deadthread = 0;



  while(1){
    sceCtrl_driver_C4AAD55F(&new_pad, 1);

    old_pad.TimeStamp = new_pad.TimeStamp;
    old_pad.Ly = new_pad.Ly;
    old_btn = old_pad.Buttons;
    old_pad.Buttons = new_pad.Buttons;
    old_pad.Lx = new_pad.Lx;

    if ((old_btn & ~new_pad.Buttons) & (PSP_CTRL_VOLDOWN|PSP_CTRL_VOLUP)){
      sceKernelDelayThread(50000);
      sceCodecOutputEnable(0, 1);
    }

    pspDebugSioPutchar(0x31);
    c1 = pspDebugSioWaitGetchar();
    pspDebugSioPutchar(0x32);
    c2 = pspDebugSioWaitGetchar();


    if ((c1 == 0x500) || (c2 == 0x500)){
      printTextScreen(0, 0, "Motion Kit not detected. Terminating...", 0, 0xFFFFFF);
      tries++;
      if (tries == 100){
        sceKernelExitDeleteThread(0);
      }
      deadthread = 0;
    }

    if (c1 < 0x73){
      fake_pad.TimeStamp = 0x1F5;
    }

    if (c1 < 0xC8){
      if (c1 < 0x92){
        fake_pad.TimeStamp = 0x1F4;
      }
    }

    if (c2 >= 0x96) && (unk != 0){
      if ((unk == 1) && (c2 >= 0xA7)){
        fake_pad.TimeStamp = 0x1F7;
        unk = 0;
      }
    }

    if (deadthread != 1){
      sceKernelDelayThread(0x3e8);
    } else {
      sceKernelDelayThread(1);
    }
}
Nice man.. I was 'bout to release source with next release.

Anyway, Great skill ya got

EDIT: Before you claim "Stitch", Ofcourse it uses Psplink's ApiHook sources & vshblit.c/h

Last edited by Mr305; 12-26-2007 at 04:35 PM.
Mr305 no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post
Old 12-26-2007, 05:31 PM   #9
Raphael
Developer
 
Raphael's Avatar


Join Date: Jan 2006
Location: Germany
Posts: 858
Default

The code is far less complex than I had imagined :P
@adrahil: Would like to know if you're able to reverse my motion kit driver too when I release it first :P Nah, don't want to waste your time, I know you could
PS: Not much left before the first release, only one minor bug and writing a readme
__________________
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
Raphael no ha iniciado sesión   Quote this post in a PM   Reply With Quote Text-Multi-Quote with this Post