12-27-2019, 08:12 AM
(This post was last modified: 12-27-2019, 09:41 AM by ceratophyllum.)
(12-27-2019, 04:01 AM)Jabberwock Wrote: Unfortunately, the creator of retroleap has not been active for a long time, as I understand, his free time is rather limited.
Last time I heard from him, he suggested trying out the scancodes in Linux with some kind of a diagnostic program.
The D-pad and Home do not generate any keyboard events. If you cat /dev/input/event0 and press Home and D-pad buttons, nothing happens at all. I think this means they're not mapped to the right GPIOs.
With the original firmware, pressing any of these buttons causes junk to appear on the screen.
What "diagnostic program?" I'm pretty sure the problem is at a lower level: the kernel needs to know the board revision so it knows where the GPIOs map to and 0x310 is not on the list.
Below is optional reading if you want more detail on why I think the problem is at a lower level than just reassigning keys.
Curiously, OpenLFConnect still works on the latest Manjaro Linux and can be used to enable developer mode (having first restored the leappad back to stock).
You don't have to solder anything to a cartridge; you can get telnet access to your stock leappad by following the simple steps here:
https://elinux.org/LeapFrog_NXP3200_Platform:_dev_mode
(Basically, just mkdir developer in /flags.)
Anyway, when you boot the stock kernel, there is this in the sys filesystem:
/sys/devices/platform/gpio-keys/keys
>cat /sys/devices/platform/gpio-keys/keys
1,103,105-106,108,114-115
These numbers represent the keys up, down, left, right, etc. listed in input.h in the kernel source code.
>cat /dev/input/event0
After you press each button on the Leappad, a little jibberish will appear on the screen. This is good.
If I boot the retroleap kernel and do:
>cat /sys/devices/platform/gpio-keys/keys
1,22,32,103,105-106,108
Looks fine: u, d and the direction keys are all there.
Monitoring (as done above) /dev/input/event0 shows nothing at all when I press any key other than volume up (22) and volume down (23).
EDIT: The "diagnostic program" is probably evtest?
You can build it in retroleap. It's in the config menu under hardware.
The results are prettier than just cat, but still noting happens except with KEY_U and KEY_D (vol+, vol-):
Here's what happens when you run it having booted the retrolep kernel:
>evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 22 (KEY_U)
Event code 32 (KEY_D)
Event code 103 (KEY_UP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 108 (KEY_DOWN)
Properties:
Testing ... (interrupt to exit)
Event: time -909804547.321421, type 1 (EV_KEY), code 32 (KEY_D), value 1
Event: time -909804547.321432, -------------- SYN_REPORT ------------
Event: time -909804547.481428, type 1 (EV_KEY), code 32 (KEY_D), value 0
Event: time -909804547.481437, -------------- SYN_REPORT ------------
Event: time -909804541.691979, type 1 (EV_KEY), code 22 (KEY_U), value 1
Event: time -909804541.691990, -------------- SYN_REPORT ------------
Event: time -909804541.831978, type 1 (EV_KEY), code 22 (KEY_U), value 0
Event: time -909804541.831987, -------------- SYN_REPORT ------------