Detect if running on PSP-3000? (User Mode)

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Detect if running on PSP-3000? (User Mode)

Post by Torch »

Is there a simple way to detect if running on a 3000? Is there a user mode way to do it because Sony mentioned new games having optimized textures for the 3000 LCD (if they can autodetect that is).

Otherwise any other method is fine.

EDIT: Never mind I forgot that sceKernelGetModel starts from 0. I thought it was returning the same for the 2000 and 3000. So kernel mode detection is no prob.
Last edited by Torch on Sat Jul 04, 2009 12:09 am, edited 4 times in total.
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Can the 5.03 HEN access kernel functions? If it can, you can try to check the nand.

Also, I believe that the psp checks for the 3k modules, that could also trigger that "auto" detections.
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Those are unprofessional methods. I want something clean.

The games cannot read flash0 to detect anything.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Torch wrote:Those are unprofessional methods. I want something clean.

The games cannot read flash0 to detect anything.
I believe Chilly Willy or Davee are the people to ask here :-)

Perhaps pop J.F a PM if he hasn't spotted this thread yet.

Although I'm sure you could set both the PSP 1000 and 2000 as per normal but then you could have an else scenario.

Probably not the best solution but it most probably would work.
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Could it be a default module that's loaded when umd, or Sony games are running that determine what model the psp is? In 5.00 umdman.prx, sceIdStorage_driver_6FE062D1 is being use. I dont know if thats any help to you or not.

When I get some more spare time, ill look into it.
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Wally wrote:Although I'm sure you could set both the PSP 1000 and 2000 as per normal but then you could have an else scenario.
I dunno how you would do that from user mode either. (Without using kubridge)
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

some month ago i have made a pspident clone here is the code of the prx kernel module and the user program

kinfo.c

Code: Select all

#include <pspsdk.h>
#include <pspkernel.h>
#include <pspidstorage.h>
#include <pspsysreg.h>
#include <string.h> 



#include <stdio.h>

#include <stdlib.h>

#include <string.h>



PSP_MODULE_INFO&#40;"kinfo", 0x1006, 2, 0&#41;;


//Get Fuse Id
u64 sceSysreg_driver_4F46EEDE&#40;&#41;;
int sceSyscon_driver_7EC5A957&#40;u32 *baryon&#41;;
u32 sceSyscon_driver_E7E87741&#40;u32 *pommel&#41;; 
u32 sceSysreg_driver_E2A5D1EE&#40;void&#41;;


int ReadKey&#40;int key, char *buffer&#41;
&#123;
        int err;
        u32 k1;

        k1 = pspSdkSetK1&#40;0&#41;;

        memset&#40;buffer, 0, 512&#41;;
        err = sceIdStorageReadLeaf&#40;key, buffer&#41;;

        pspSdkSetK1&#40;k1&#41;;

        return err;
&#125;

int WriteKey&#40;int key, char *buffer&#41;
&#123;
        int err;
        u32 k1;

        k1 = pspSdkSetK1&#40;0&#41;;

        err = sceIdStorageWriteLeaf&#40;key, buffer&#41;;
        sceIdStorageFlush&#40;&#41;;

        pspSdkSetK1&#40;k1&#41;;

        return err;
&#125;



void GetMoboInfo&#40;int* baryon, int* tachyon,int *pommel&#41;
&#123;
  u32 by, ty, po;
  int k;

  k = pspSdkSetK1&#40;0&#41;;
  ty = sceSysreg_driver_E2A5D1EE&#40;&#41;;
  sceSyscon_driver_E7E87741&#40;&po&#41;; 
  sceSyscon_driver_7EC5A957&#40;&by&#41;;  
  pspSdkSetK1&#40;k&#41;;
  &#40;*baryon&#41; = by;
  &#40;*tachyon&#41; = ty;
  &#40;*pommel&#41; = po;
&#125;

u64 GetFuseId&#40;&#41;
&#123;
   u64 fuseId = sceSysreg_driver_4F46EEDE&#40;&#41;;
    return fuseId;
&#125;

u32 pspGetKirkVersion&#40;void&#41; 
&#123;
   int k1 = pspSdkSetK1&#40;0&#41;;
   int ver, i = 0, val = *&#40;u32 *&#41;0xBDE00004;
   sceSysregKirkBusClockEnable&#40;&#41;;
   do &#123;
       i++;
       sceKernelDelayThread&#40;1000&#41;;
       ver = *&#40;u32 *&#41;0xBDE00004;
   &#125; while &#40;&#40;ver == val&#41; && &#40;i < 10&#41;&#41;;
   pspSdkSetK1&#40;k1&#41;;
   return ver;
&#125; 

u32 pspGetSpockVersion&#40;void&#41; 
&#123;
   int k1 = pspSdkSetK1&#40;0&#41;;
   int ver, i = 0, val = *&#40;u32 *&#41;0xBDF00004;
   sceSysregAtaBusClockEnable&#40;&#41;; 
   do &#123;
       i++;
       sceKernelDelayThread&#40;1000&#41;;
       ver = *&#40;u32 *&#41;0xBDF00004;
   &#125; while &#40;&#40;ver == val&#41; && &#40;i < 10&#41;&#41;;
   pspSdkSetK1&#40;k1&#41;;
   return ver;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;
  return 0;
&#125;

int module_stop&#40;&#41;
&#123;
  return 0;
&#125; 
pspinfo.c

Code: Select all

#include <pspsdk.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspmoduleinfo.h>
#include <kubridge.h>
#include "kinfo.h"

// #include "kernel.h"

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO&#40;"info", 0, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;PSP_THREAD_ATTR_USER&#41;;
PSP_HEAP_SIZE_KB&#40;-64&#41;;



extern   int ReadKey&#40;int key, char *buffer&#41;;
extern        int WriteKey&#40;int key, char *buffer&#41;;
extern        void GetMoboInfo&#40;int* baryon, int* tachyon, int *pommel&#41;;
extern        u64 GetFuseId&#40;&#41;;

int get_psp_info&#40;int pbar,int ptac,int ppom&#41;
&#123;
  int i = 0;
  while &#40;p_info&#91;i&#93;.bar != 0&#41;
  &#123; 
    if &#40;p_info&#91;i&#93;.bar == pbar && p_info&#91;i&#93;.tac == ptac && p_info&#91;i&#93;.pom == ppom&#41;
       return i;
    i++;
  &#125;
  return -1;
&#125;
int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
  int i;
   pspDebugScreenInit&#40;&#41;;
   
   int r = kuKernelLoadModule&#40;"kinfo.prx",0,NULL&#41;;
   if &#40;r < 0&#41;
   &#123;
      printf&#40; "Error 0x%08X loading/starting kinfo.prx.\n", r&#41;;
      sceKernelDelayThread&#40;7000000&#41;;
   &#125;
   sceKernelStartModule&#40;r, 0, NULL, 0, NULL&#41;;

   printf&#40;"===================================================================="&#41;;
   printf&#40;"PSPINFO made by sauron_le_noir &#40;based on samples made by jas0nuk&#41;\n"&#41;;
   printf&#40;"====================================================================\n\n"&#41;;
   int bar,tac,pom,index;
   GetMoboInfo&#40;&bar,&tac,&pom&#41;;
   printf&#40;"baryon     &#58; %x \n",bar&#41;;
   printf&#40;"Tachyon    &#58; %x\n",tac&#41;;
   printf&#40;"Pommel     &#58; %x\n",pom&#41;;
   index = get_psp_info&#40;bar,tac,pom&#41;;
   if &#40;index != -1&#41;
   &#123;
     printf&#40;"Type psp   &#58; %s\n",p_info&#91;index&#93;.psp_type&#41;;
     printf&#40;"Motherboard&#58; %s\n",p_info&#91;index&#93;.type_board&#41;;
   &#125;
   else printf&#40;"unkown psp\n"&#41;;
   
   printf&#40;"Fuseid     &#58; %#llx\n",GetFuseId&#40;&#41;&#41;;
   
   char wifi_module_mac&#91;512&#93;;
   ReadKey&#40;0x44, wifi_module_mac&#41;;
   printf&#40;"Mac        &#58; "&#41;;
   for&#40;i=0;i<6;i++&#41;
      printf&#40;"%02X&#58;",wifi_module_mac&#91;i&#93;&#41;;
   printf&#40;"\n"&#41;;
   unsigned char *kirk;
   unsigned char *spock;
   unsigned int kirk_int;
   unsigned int spock_int;

   kirk_int  = pspGetKirkVersion&#40;&#41;;
   spock_int = pspGetSpockVersion&#40;&#41;;
   kirk      = &#40;unsigned char *&#41;&kirk_int;   
   spock     = &#40;unsigned char *&#41;&spock_int;

   printf&#40;"Kirk       &#58; %c%c%c%c\n", kirk&#91;3&#93;, kirk&#91;2&#93;, kirk&#91;1&#93;, kirk&#91;0&#93;&#41;;
   printf&#40;"Spock      &#58; %c%c%c%c\n", spock&#91;3&#93;, spock&#91;2&#93;, spock&#91;1&#93;, spock&#91;0&#93;&#41;;
   printf&#40;"\n"&#41;;
   printf&#40;"Press X to quit\n\n"&#41;;
   printf&#40;"===================================================================="&#41;;  

   SceCtrlData pad;
   sceCtrlSetSamplingCycle&#40;0&#41;;
   sceCtrlSetSamplingMode&#40;PSP_CTRL_MODE_ANALOG&#41;;
   for&#40;;;&#41;
   &#123;
     sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
     if &#40;pad.Buttons != 0&#41;
     &#123;
       if &#40;pad.Buttons & PSP_CTRL_CROSS&#41;
         sceKernelExitGame&#40;&#41;;
     &#125;
   &#125;
   return 0;
&#125; 
interpretation of baryon,tachyon and pommel

PSP-100x
========
TA-079v1 Tachyon: 0x00140000, Baryon: 0x00030600, Pommel: 0x00000103
TA-079v2 Tachyon: 0x00200000, Baryon: 0x00030600, Pommel: 0x00000103
TA-079v3 Tachyon: 0x00200000, Baryon: 0x00040600, Pommel: 0x00000103
TA-081 Tachyon: 0x00300000, Baryon: 0x00040600, Pommel: 0x00000103/0x00000104
TA-082 Tachyon: 0x00400000, Baryon: 0x00114000, Pommel: 0x00000112
TA-086 Tachyon: 0x00400000, Baryon: 0x00121000, Pommel: 0x00000112

PSP-200x
========
TA-085 Tachyon: 0x00500000, Baryon: 0x0022B200, Pommel: 0x00000123
TA-085v2 Tachyon: 0x00500000, Baryon: 0x00234000, Pommel: 0x00000123
TA-088v1 Tachyon: 0x00500000, Baryon: 0x00243000, Pommel: 0x00000123
TA-088v2 Tachyon: 0x00500000, Baryon: 0x00243000, Pommel: 0x00000123
TA-088v3 Tachyon: 0x00600000, Baryon: 0x00243000, Pommel: 0x00000123
TA-090v1 Tachyon: 0x00500000, Baryon: 0x00263100, Pommel: 0x00000132

PSP-300x
========
TA-090v2 Tachyon: 0x00600000, Baryon: 0x00263100, Pommel: 0x00000132

so based of the tachyon baryon and pommel you can determine if you are running
with a psp 3000 and execute specific code for it
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Thats useful code, but I'm wondering if there is a pure user mode way to detect.

I just need basic phat/slim/3k detection. sceKernelGetModel works fine for kernel mode.
Davee
Posts: 43
Joined: Mon Jun 22, 2009 3:58 am

Post by Davee »

Torch wrote:Thats useful code, but I'm wondering if there is a pure user mode way to detect.

I just need basic phat/slim/3k detection. sceKernelGetModel works fine for kernel mode.
kuKernelGetModel should work. It's something supported by all 3000.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Davee wrote:
Torch wrote:Thats useful code, but I'm wondering if there is a pure user mode way to detect.

I just need basic phat/slim/3k detection. sceKernelGetModel works fine for kernel mode.
kuKernelGetModel should work. It's something supported by all 3000.
I know, I wanted to know if it was possible without kubridge from purely user mode. Since they mentioned new games taking advantage of the 3000 wide color range. If it was automatically enabled then there should be a way. Otherwise it would just be a manual setting we need to change in the game.
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

is sceDisplayGetBrightness a user mode function ? if yes than you've find yourself howto detect psp3000 in user mode ;)

on my Slim PSP the values for the 4 brightness levels are 36,44,56,68.
The values for 3000 are 44,60,72,84 in case anyone wondered.
Post Reply