Closed rdmueller closed 2 years ago
Hi @rdmueller,
Thank you for trying out McAirpos and I really appreciate your thorough troubleshooting and the documentation you provide with your initial issue here!
As a sidenote, I am also really happy to get the chance to figure out and test together with you what I hope will be a working solution for both the Picade and the RetroFlag GPi case, which I know are popular retro games devices, which I don't own myself and I have not yet been able to test, and for a while have been looking for help with: https://forum.makecode.com/t/gamepi20-joy-bonnet-picade-collaboration/9211
Sadly, I don't immideately see what the problem might be and I hope that we, with some patience, can methodically figure it out together. Please bear with me if my follow-up questions to come seem rather basic. ;-)
From what I can gather from the information you provided above, your picade controller interface is gpio on /dev/event0 and with only EV_KEY type inputs, which makes it seem to be the right approach to save processing power and run the games without uinput-mapper using the nomap
option and by manual configuration of the /sd/arcade.cfg.
evtest /dev/input/event0
, you also verified from inside evtest, that you got keypress confirmation on the screen(you are absolutely sure that the picade controller input is (always) on /dev/input/event0)?uname -a
), what RetroPie/Recalbox version?Please also send me the (zipped) arcade-Brick-Breaker2.elf and link to its MCA source code, that I can try from my side, if possible.
Hope to hear back from you again soon!
...your picade controller interface is gpio on /dev/event0
/dev/input/event0
evtest
arcade-RUN.elf
. It runs and shows a box "TEST1", but it does not react on keyboard events in my configurationpi@retropie:~ $ uname -a
Linux retropie 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
warn: ioctl KDSETMODE failed: Inappropriate ioctl for device
warn: ioctl KDSETMODE failed: Inappropriate ioctl for device
.data
gets written:
pi@retropie:~/RetroPie/roms/makecode $ ls arcade-RUN.elf.data/
_23run _23scope
the brick-breaker source can be found here: https://github.com/rdmueller/brick-breaker nothing special. I guess we should stay with arcade-RUN for our tests.
I just had a little success: I plugged in my dongle for an external keyboard to check if the game will handle those events. I plugged it in while running and to my surprise, the joystick started to work (I guess /dev/input/event0 = joystick, /dev/input/event[1/2] = external keyboard)
I then rebooted the system. The external keyboard then gets mapped to /dev/input/event[0/1] and the joystick to /dev/input/event2. Now, the external keyboard is accepted as input and the joystick is dead again.
I started my experiments with a connected external keyboard, but noticed that the joystick will be mapped to event2 and the config always falls back to event0 (why?). So I removed the keyboard for further tests.
don't ask me what happened. It seems that it now runs quite well. Maybe step two (removal of second controller from cfg) was the right move. It also seems that the first key-event gets lost, but then everything is fine. I will test some more games
don't ask me what happened. It seems that it now runs quite well.
Hehe, certainly don't ask me!... ;-) But I am glad to hear that it seems to work now and thanks for the feedback!
Maybe step two (removal of second controller from cfg) was the right move.
From what you wrote earlier, my suspects would be either:
Sometimes, deleting a game's .data folder fixes different things for me, but that is on per game basis, not systemwide.
It also seems that the first key-event gets lost, but then everything is fine.
Hmm, I haven't noticed, but I will check it out. Hard to imagine that this is something I can fix in the source code, since the game more or less runs directly when running with the nomap
option. Then again, I might have kludged with the two threads in my code. Have you tried running a game directly without launCharc(exit with some combinations of CTRL+\, CTRL+d and CTRL+c) and checked if you experience the same first button press delay?
I will test some more games
Great! Looking forward to hearing back from you with your results, and don't hesitate to get in touch again if something isn't working. I would also appreciate seeing a similar issue with a working solution shared for the Retroflag GPi.
Am I correct to assume that your working /sd/arcade.cfg for the Picade now looks like this?:
SCAN_CODES=/dev/input/event0
BTN_LEFT=105
BTN_RIGHT=106
BTN_UP=103
BTN_DOWN=108
BTN_A=29
BTN_B=56
BTN_RESET=28
BTN_EXIT=1
BTN_MENU=23
yes, this /sd/arcade.cfg
is the one I currently use.
I will send a PR to document these settings in you readme - hope this is ok
I just checked the issue with the first keyboard event. Even if I launch games without your launcher, the first event will not be processed.
Over all, I am quite happy with this solution. I only found one game where the .lef file results in a segmentation fault, but this is due to the game and not the launcher.
I tried to document the knowledge from this issue in PR #23 . So I will close this issue now and try to setup my Retroflag GPi.
I just checked the issue with the first keyboard event. Even if I launch games without your launcher, the first event will not be processed.
Thanks for checking and concluding that this is a MakeCode Arcade isssue.
Over all, I am quite happy with this solution.
👍
I only found one game where the .elf file results in a segmentation fault, but this is due to the game and not the launcher.
There exists a few incompatibilities in MakeCode Arcade between the web simulator and the variuos compilations to different hardware, e.g.: -https://github.com/Vegz78/McAirpos/issues/12 -https://github.com/Vegz78/McAirpos/issues/14 -https://forum.makecode.com/t/raspberry-pi-gpio-output/2492 -etc.
I tried to document the knowledge from this issue in PR #23 . So I will close this issue now and try to setup my Retroflag GPi.
Great summary, but for consistency I would prefer if you could add your summary here to the end of this issue, according to earlier practice, instead of adding more text to the main readme.md.
Looking forward to seeing how it worked with your Retroflag GPi!
The standard setup for Picade is RetroPie.
So, if you follow the setup for RetroPie on your Picade, you will be able to launch the makecode games.
To also play them, you still have to fix the button mapping:
copy the following content to your /sd/arcade.cfg
SCAN_CODES=/dev/input/event0
BTN_LEFT=105
BTN_RIGHT=106
BTN_UP=103
BTN_DOWN=108
BTN_A=29
BTN_B=56
BTN_RESET=28
BTN_EXIT=1
BTN_MENU=23
This should work fine as long as no other keyboard is attached to the system.
If an additional keyboard is attached, /dev/input/event0/
might change to another /dev/input/eventX
.
To activate this config, we have to tell the launcher not to use the uiinput-mapper and fall back to this config instead.
Open /etc/emulationstation/es_systems.cfg
and replace the line
<command>/home/pi/McAirpos/McAirpos/launCharc/launCharc %ROM%</command>
with
<command>/home/pi/McAirpos/McAirpos/launCharc/launCharc nomap %ROM%</command>
You are now able to run and play makecode games with McAirpos on your Retropie. Hint: for some reasons, the first keyboard event will not be processed.
In adittion, I have added the arcade.cfg file for the Picade here: https://github.com/Vegz78/McAirpos/blob/master/McAirpos/MakeCode/sd/tested_ok/arcade.cfg_Picade
Conclusion
... You are now able to run and play makecode games with McAirpos on your Retropie.
Thanks again, @rdmueller! https://forum.makecode.com/t/gamepi20-joy-bonnet-picade-collaboration/9211/4
thanx for this great tool! I try to get my games up and running on a picade and retroflag GPi case.
So far, I go with the picade, since I get the games at least up and running. I see the start screen with animations and hear sound.
But my input will not work. Not a single button.
What I've done so far:
used evtest to find out which scan codes I need:
configures my
/sd/arcade.cfg
according to this map:use the
nomap
option to start the games. Still, nothing happends. Any Idea?and here are the logs (
/tmp/McAirpos.log
):