 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Fri Jul 03, 2009 9:46 pm Post subject: Detect if running on PSP-3000? (User Mode) |
|
|
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 |
|
| Back to top |
|
 |
Dariusc123456
Joined: 12 Aug 2008 Posts: 394
|
Posted: Fri Jul 03, 2009 10:34 pm Post subject: |
|
|
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 - ? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Fri Jul 03, 2009 10:43 pm Post subject: |
|
|
Those are unprofessional methods. I want something clean.
The games cannot read flash0 to detect anything. |
|
| Back to top |
|
 |
Wally

Joined: 26 Sep 2005 Posts: 672
|
Posted: Fri Jul 03, 2009 10:56 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Dariusc123456
Joined: 12 Aug 2008 Posts: 394
|
Posted: Fri Jul 03, 2009 10:57 pm Post subject: |
|
|
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 - ? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Jul 04, 2009 12:00 am Post subject: |
|
|
| 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) |
|
| Back to top |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Sat Jul 04, 2009 12:03 am Post subject: |
|
|
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: |
#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("kinfo", 0x1006, 2, 0);
//Get Fuse Id
u64 sceSysreg_driver_4F46EEDE();
int sceSyscon_driver_7EC5A957(u32 *baryon);
u32 sceSyscon_driver_E7E87741(u32 *pommel);
u32 sceSysreg_driver_E2A5D1EE(void);
int ReadKey(int key, char *buffer)
{
int err;
u32 k1;
k1 = pspSdkSetK1(0);
memset(buffer, 0, 512);
err = sceIdStorageReadLeaf(key, buffer);
pspSdkSetK1(k1);
return err;
}
int WriteKey(int key, char *buffer)
{
int err;
u32 k1;
k1 = pspSdkSetK1(0);
err = sceIdStorageWriteLeaf(key, buffer);
sceIdStorageFlush();
pspSdkSetK1(k1);
return err;
}
void GetMoboInfo(int* baryon, int* tachyon,int *pommel)
{
u32 by, ty, po;
int k;
k = pspSdkSetK1(0);
ty = sceSysreg_driver_E2A5D1EE();
sceSyscon_driver_E7E87741(&po);
sceSyscon_driver_7EC5A957(&by);
pspSdkSetK1(k);
(*baryon) = by;
(*tachyon) = ty;
(*pommel) = po;
}
u64 GetFuseId()
{
u64 fuseId = sceSysreg_driver_4F46EEDE();
return fuseId;
}
u32 pspGetKirkVersion(void)
{
int k1 = pspSdkSetK1(0);
int ver, i = 0, val = *(u32 *)0xBDE00004;
sceSysregKirkBusClockEnable();
do {
i++;
sceKernelDelayThread(1000);
ver = *(u32 *)0xBDE00004;
} while ((ver == val) && (i < 10));
pspSdkSetK1(k1);
return ver;
}
u32 pspGetSpockVersion(void)
{
int k1 = pspSdkSetK1(0);
int ver, i = 0, val = *(u32 *)0xBDF00004;
sceSysregAtaBusClockEnable();
do {
i++;
sceKernelDelayThread(1000);
ver = *(u32 *)0xBDF00004;
} while ((ver == val) && (i < 10));
pspSdkSetK1(k1);
return ver;
}
int module_start(SceSize args, void *argp)
{
return 0;
}
int module_stop()
{
return 0;
} |
pspinfo.c
| Code: |
#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("info", 0, 1, 0);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
PSP_HEAP_SIZE_KB(-64);
extern int ReadKey(int key, char *buffer);
extern int WriteKey(int key, char *buffer);
extern void GetMoboInfo(int* baryon, int* tachyon, int *pommel);
extern u64 GetFuseId();
int get_psp_info(int pbar,int ptac,int ppom)
{
int i = 0;
while (p_info[i].bar != 0)
{
if (p_info[i].bar == pbar && p_info[i].tac == ptac && p_info[i].pom == ppom)
return i;
i++;
}
return -1;
}
int main(int argc, char *argv[])
{
int i;
pspDebugScreenInit();
int r = kuKernelLoadModule("kinfo.prx",0,NULL);
if (r < 0)
{
printf( "Error 0x%08X loading/starting kinfo.prx.\n", r);
sceKernelDelayThread(7000000);
}
sceKernelStartModule(r, 0, NULL, 0, NULL);
printf("====================================================================");
printf("PSPINFO made by sauron_le_noir (based on samples made by jas0nuk)\n");
printf("====================================================================\n\n");
int bar,tac,pom,index;
GetMoboInfo(&bar,&tac,&pom);
printf("baryon : %x \n",bar);
printf("Tachyon : %x\n",tac);
printf("Pommel : %x\n",pom);
index = get_psp_info(bar,tac,pom);
if (index != -1)
{
printf("Type psp : %s\n",p_info[index].psp_type);
printf("Motherboard: %s\n",p_info[index].type_board);
}
else printf("unkown psp\n");
printf("Fuseid : %#llx\n",GetFuseId());
char wifi_module_mac[512];
ReadKey(0x44, wifi_module_mac);
printf("Mac : ");
for(i=0;i<6;i++)
printf("%02X:",wifi_module_mac[i]);
printf("\n");
unsigned char *kirk;
unsigned char *spock;
unsigned int kirk_int;
unsigned int spock_int;
kirk_int = pspGetKirkVersion();
spock_int = pspGetSpockVersion();
kirk = (unsigned char *)&kirk_int;
spock = (unsigned char *)&spock_int;
printf("Kirk : %c%c%c%c\n", kirk[3], kirk[2], kirk[1], kirk[0]);
printf("Spock : %c%c%c%c\n", spock[3], spock[2], spock[1], spock[0]);
printf("\n");
printf("Press X to quit\n\n");
printf("====================================================================");
SceCtrlData pad;
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
for(;;)
{
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons != 0)
{
if (pad.Buttons & PSP_CTRL_CROSS)
sceKernelExitGame();
}
}
return 0;
}
|
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 |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Jul 04, 2009 12:06 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Davee
Joined: 22 Jun 2009 Posts: 59
|
Posted: Sat Jul 04, 2009 3:27 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Jul 04, 2009 5:13 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Sat Jul 04, 2009 6:17 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|
|
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
|