| View previous topic :: View next topic |
| Author |
Message |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Wed Jul 09, 2008 2:02 am Post subject: Random issues preventing KIRK/SPOCK version from being read? |
|
|
This is a problem and a curiosity I've been meaning to post about for a while.
In my application, PSPident, which determines the motherboard version by reading the tachyon & baryon number, I also have functions to read the KIRK and SPOCK versions from their respective registers. However, on some PSPs, one or both of them randomly returns no data, or just corrupt data (appears as a smiley face)
This does not seem to be affected by the environment in which the app is running; Pandora, 1.50 kernel and 3.XX/4.XX kernel seems to be the same, and Slim/Fat doesn't make any difference. It looks more like it's specific to certain units, but I'm not sure why. Is it a timing issue?
Some examples - some of them are posts, since the images are now down. Should've posted about this ages ago...
http://forums.maxconsole.net/showpost.php?p=945647&postcount=92
No spock version
http://forums.maxconsole.net/showpost.php?p=868716&postcount=65
No kirk version (smiley face)
http://forums.maxconsole.net/showpost.php?p=926340&postcount=73
No kirk version (smiley face)
http://www.isarapix.org/pix51/1215532728.jpg
No kirk version (smiley face)
http://www.isarapix.org/pix80/1215532795.jpg
No spock version
Here are the functions used:
| Code: | u32 pspGetKirkVersion(void) {
int k1 = pspSdkSetK1(0);
sceSysregKirkBusClockEnable();
sceKernelDelayThread(1000);
int err = *(u32 *)0xBDE00004;
pspSdkSetK1(k1);
return err;
}
u32 pspGetSpockVersion(void) {
int k1 = pspSdkSetK1(0);
sceSysregAtaBusClockEnable();
sceKernelDelayThread(1000);
int err = *(u32 *)0xBDF00004;
pspSdkSetK1(k1);
return err;
} |
In the main app they are being printed like:
| Code: | printf("Kirk: %c%c%c%c\n", kirk[3], kirk[2], kirk[1], kirk[0]);
printf("Spock: %c%c%c%c\n\n", spock[3], spock[2], spock[1], spock[0]); |
If anyone wants to run PSPident to see what happens on their PSP, it's here xD
http://www.sendspace.com/file/qbru1x |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Wed Jul 09, 2008 4:19 am Post subject: |
|
|
4.0.1 M33-2 PSP FAT
Tachyon: 0x00300000
Baryon: 0x00040600
Pommel: 0x00000104
Kirk: 0010
Spock: 0050
TA-081 v2.0 (01g)
3.90 m33-3 PSP FAT - 1.50 kernel enabled
Tachyon: 0x00300000
Baryon: 0x00040600
Pommel: 0x00000103
Kirk: 0010
Spock: 0050
TA-081 v2.0 (01g)
Both seem fine then :)
In those pics, it must return a value O.o, the smile must be a value which means a "smile".
Right?
Try using %d instead of %c to know the integer value ? _________________
Upgrade your PSP |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Wed Jul 09, 2008 4:24 am Post subject: |
|
|
| %08X would be better :) Don't expect sony to keep nice versions in ASCII format... |
|
| Back to top |
|
 |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Wed Jul 09, 2008 4:26 am Post subject: |
|
|
| But the version is actually stored as ASCII, even in the latest versions of Slim hardware. :p |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Wed Jul 09, 2008 4:35 am Post subject: |
|
|
I thought of writing %08X but as I don't know how the values work with the kirk and spock I wrote %d :P
@jas0nuk but by getting the %08X(:P) value you can know the ascii right? and it can be a problem with somethign but not the kirk or spock _________________
Upgrade your PSP |
|
| Back to top |
|
 |
crazyc
Joined: 17 Jun 2005 Posts: 410
|
Posted: Wed Jul 09, 2008 4:38 am Post subject: |
|
|
| Quote: | | No kirk version (smiley face) | The smiley face is 0x01 as ascii, which is what I get if I read 0xBDE00004 while kirk is disabled. |
|
| Back to top |
|
 |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Wed Jul 09, 2008 4:39 am Post subject: |
|
|
Ah.. so if kirk is disabled its 0x0 0x0 0x0 0x1, and if spock is disabled it's 0x0 0x0 0x0 0x0
I wonder why spock/kirk are sometimes disabled in these PSPs? |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Wed Jul 09, 2008 4:44 am Post subject: |
|
|
how can I know if it is disabled or not? _________________
Upgrade your PSP |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Wed Jul 09, 2008 4:46 am Post subject: |
|
|
| jas0nuk wrote: | Ah.. so if kirk is disabled its 0x0 0x0 0x0 0x1, and if spock is disabled it's 0x0 0x0 0x0 0x0
I wonder why spock/kirk are sometimes disabled in these PSPs? |
do you protect this reading against interrupts or things like that ? |
|
| Back to top |
|
 |
crazyc
Joined: 17 Jun 2005 Posts: 410
|
Posted: Wed Jul 09, 2008 5:07 am Post subject: |
|
|
Some psps may just need a longer timeout. Try this.
| Code: | 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;
} |
|
|
| Back to top |
|
 |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Wed Jul 09, 2008 5:23 am Post subject: |
|
|
| Thanks, I'll put it in the next update. |
|
| Back to top |
|
 |
|