3.80 and Pandora
Well it looks like SCE have finally learned and have now removed the functions to read/write to the battery eeprom in 3.80 (they also took out the sceSysconBatteryAuth function too). So you can’t make a magic battery with 3.80, but nevermind, the hardware to do so is still there.
Here’s a compatible replacement:
C:
-
int write_eeprom(u8 addr, u16 data)
-
{
-
int res;
-
u8 param[0×60];
-
-
if (addr>0x7F)
-
return(0×80000102);
-
-
param[0x0C] = 0×73; // write battery eeprom command
-
param[0x0D] = 5; // tx packet length
-
-
// tx data
-
param[0x0E] = addr;
-
param[0x0F] = data;
-
param[0×10] = data>>8;
-
-
res = sceSysconCmdExec(param, 0);
-
-
if (res<0)
-
return(res);
-
-
return 0;
-
}
-
-
int read_eeprom(u8 addr)
-
{
-
int res;
-
u8 param[0×60];
-
-
if (addr>0x7F)
-
return(0×80000102);
-
-
param[0x0C] = 0×74; // read battery eeprom command
-
param[0x0D] = 3; // tx packet length
-
-
// tx data
-
param[0x0E] = addr;
-
-
res = sceSysconCmdExec(param, 0);
-
-
if (res<0)
-
return(res);
-
-
// rx data
-
return((param[0×21]<<8) | param[0×20]);
-
}
EDIT:
Finally cracked the real names:
0x68ef0bef sceSysconBatteryReadNVM
0x1165c864 sceSysconBatteryWriteNVM
December 22nd, 2007 at 3:26 pm
Hi!
Might I ask for permission to use this code snippet in my “Pandora Installer for 3.xx Kernels”?
I’d like to have that working on 3.80 as well
Propper credits would be given, of course!
January 15th, 2008 at 5:40 am
Thanks SilverSpring, got the chance to use the code today with the release of 3.80M33 and it works like a charm.
-
u32 sceSysconCmdExec(void* param, int unk);
-
Was all I needed to create to make ‘im go.
January 17th, 2008 at 6:07 am
lol guys i wanna know how you work this out please help me… sorry for being a noob heheheh an a pain in the butt ^_^ sowwy Well hope i can get help
January 18th, 2008 at 10:16 pm
On maxconsole i have posted a thread about i think something to do with:
u32 sceSysconCmdExec(void* param, int unk);
The tools from hellcat/cory1492 won’t work with my newest psp. And they use your work in there tools?
http://forums.maxconsole.net/showthread.php?t=97428
If you don’t like this link posting to maxconsole on your blog. please remove.
greetz from the netherlands
bagheera
May 8th, 2008 at 11:01 am
Hi Silverspring,
Nice job and thank you for sharing.
I have notice in the code of read_eeprom, may be a strange behavior if sceSysconCmdExec returns an error, the caller may not notice. I would suggest to do something like:
int read_eeprom(u8 addr, u16 * value)
{
int res;
u8 param[0x60];
if (addr>0x7F) return(0×80000102);
param[0x0C] = 0×74; // read battery eeprom command
param[0x0D] = 3; // tx packet length
// tx data
param[0x0E] = addr;
res = sceSysconCmdExec(param, 0);
if (res
May 8th, 2008 at 6:01 pm
What do you mean might not notice? If read_eeprom returns a negative number (which it would if sceSysconCmdExec failed) it means it failed. Any other value would mean it succeeded (and would have the correct value for the eeprom read).
Anyway, it was meant to be a direct replacement for the sceSysconBatteryReadNVM/sceSysconBatteryWriteNVM functions which were taken out of the firmware starting from 3.80. Refer to http://forums.ps2dev.org/viewtopic.php?p=57634#57634 where nem posted the prototypes (the function names werent known when that post was made so they’re labelled sceSyscon_driver_68EF0BEF/sceSyscon_driver_1165C864).
This code was meant for apps using the above functions to be able to work in 3.80+. Ie. pandora apps from cory1492, hellcat, et al. So I would have to make sure the prototypes stayed the same as the original functions and that the code functioned exactly the same as the originals.