If you want to read any kernel mode PSP button within a user mode application, I suggest to write a kernel module which overrides the kernel button mask set by Sony.
If I remember it correctly, the check you want to overwrite is this one:
https://github.com/uofw/uofw/blob/maste ... rl.c#L2026
Code: Select all
if (pspK1IsUserMode())
buttons &= g_ctrl.userModeButtons;
As you can see, kernel mode buttons are ignored if the application obtaining them is a user mode application. Therefore, I suggest to skip the bitwise AND operation above.
For the PSP kernel version 6.60, this particular code is located at the following addresses within the PSP's controller module:
Code: Select all
0x00001FE8: 0x8D050004 '....' - lw $a1, 4($t0)
0x00001FEC: 0x11600003 '..`.' - beqz $t3, loc_00001FFC
0x00001FF0: 0xACD30000 '....' - sw $s3, 0($a2)
0x00001FF4: 0x8DF90298 '....' - lw $t9, 664($t7)
0x00001FF8: 0x00B92824 '$(..' - and $a1, $a1, $t9 <-- kernel buttons are ignored here
Overwrite the value at address 0x00001FF8 with a NOP instruction (0x00000000) and you should be able to read kernel mode buttons within your user mode applications.
If you need help patching the controller module to achieve this, I'm sure Codestation and the other guys here in this thread can give you some help.
EDIT: Another interesting solution would be to compile your own custom version of the controller module (uofw's controller module compiles and works, so just add your changes to it) and to replace SONY's original ctrl module with it.