Vegz78 / McAirpos

MakeCode Arcade games in RetroPie, Recalbox 7/8 and Batocera, running natively as ELF executables on Raspberry Pi OS/Linux ARM with 1-2 gamepads
https://Vegz78.github.io/McAirpos
MIT License
82 stars 10 forks source link

Is it possible to transport this project to some popular open source handheld based on rk3566 (ARM64-A53) with Jeos or arkos ? #54

Open whmzsu opened 10 months ago

whmzsu commented 10 months ago

Is it possible to transport the project to some popular open source handheld based on rk3566 (ARM64-A53) or rk3326(ARM32-a35?) with Jeos or arkos ?

These retro game consoles based on Rk3566 (ARM64-A53) or rk3326(ARM32-a35?) with Jeos or Arkos handheld are veay popular, have many models and shapes style , high performance and low cost(below 100$). So if it can transport to these platform, it will be a big superise for the kids who are interesting in makecode arcade.

Vegz78 commented 4 months ago

Hi @whmzsu,

Thanks for your interest in McAirpos and nice ideas for other popular and handheld systems to be supported! Sorry also for my late reply.

In general, McAirpos, which is only a launcher with some help for setting up controllers, could be compiled to any system, since the source files are here and e.g. the uinput-mapper module runs in Python.

The compatibility for different systems, lies in the MakeCode Arcade executable .elf game file itself, which has these properties: arcade-jumpy-platformer.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.26, BuildID[sha1]=1345002c7e1eb0f7585105314513524afbaf24dd, stripped

This means that these MakeCode Arcade .elf game files in theory should run on any ARM 32-bit Linux system/distribution(Also on 64-bit systems, if you include the 32-bit runtime, which I do for the Batocera installation, which is 64-bit).

One important and known requirement is that Alsa sound is included and positioned as the first available audio device, position 0:0.

If not ARM or Linux based, you have to check out other options for support: https://arcade.makecode.com/hardware

PS: It would be nice to hear back from you about what you have found out about this subject!

whmzsu commented 2 months ago

Hi @Vegz78 ,Yestoday I finally have some time to try installing the project on my small handheld game console by following the "Manual installation for RetroPie/RPi OS", and the result of course is "Failed". But I got some progress: 1 I only can start the game under remote ssh console like "sudo ~/McAirpos/McAirpos/launCharc/launCharc no map ~/RetroPie/roms/makecode/gamefile.elf" with "nomap" parameter, I think maybe it's relative to the "[uinput-mapper]" because there no install steps about this in the "Manual installation ". 2 I confige the key map by edit the /sd/arcade.cfg file by getting the key code with evtest. 3 I only can start the game with "sudo" command like above or got error. 4 After start the game by the remote console command , the games appeared run OK but with flicker screen because the emulationstation UI is still there, controller working on both UI and the game at same time. 5 The manual keymap seems worded , and the sound seems worked too. 6 Launch the game from the emulationstation not work with the same cmd line in the "es_system.cfg" file . Black screen or back to Emulationstation wait about 15 sec.

So I will try the install process on this weekend and log the error messages to post on this subject.

whmzsu commented 2 months ago

I got a quick log of the test process 。The game can launch without root privilege on the remote ssh console.

  1. The game console OS info.

uname -a Linux rgb30 4.19.172 #1 SMP Tue Sep 5 23:45:43 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

  1. Console emulationstation config:

`

MakeCode
<fullname>MakeCode Arcade</fullname>
<path>/roms2/makecode</path>
<extension>.elf .ELF</extension>
<command>/home/ark/McAirpos/McAirpos/launCharc/launCharc_arm64  nomap verbose  %ROM%</command>
<platform>makecode</platform>
<theme>makecode</theme>

`

  1. emulationstation game launch kernel crash log:

[ 641.184054] Unable to handle kernel paging request at virtual address ffffff800b73d000 [ 641.185506] Mem abort info: [ 641.186107] ESR = 0x96000007 [ 641.186672] Exception class = DABT (current EL), IL = 32 bits [ 641.187738] SET = 0, FnV = 0 [ 641.188295] EA = 0, S1PTW = 0 [ 641.188857] Data abort info: [ 641.189430] ISV = 0, ISS = 0x00000007 [ 641.190150] CM = 0, WnR = 0 [ 641.190719] swapper pgtable: 4k pages, 39-bit VAs, pgdp = 0000000014cefed9 [ 641.191954] [ffffff800b73d000] pgd=000000003effe003, pud=000000003effe003, pmd=00000000391ba003, pte=0000000000000000 [ 641.193897] Internal error: Oops: 96000007 [#1] SMP [ 641.194787] Modules linked in: exfat 8821cs [ 641.195559] Process arcade-DinoZoo. (pid: 31420, stack limit = 0x000000009b39c2be) [ 641.196924] CPU: 1 PID: 31420 Comm: arcade-DinoZoo. Not tainted 4.19.172 #1 [ 641.198172] Hardware name: Powkiddy RGB30 aka wonderfully weird unit (DT) [ 641.199392] pstate: 60400009 (nZCv daif +PAN -UAO) [ 641.200284] pc : rockchip_drm_gem_object_mmap+0xb0/0x1a0 [ 641.201241] lr : rockchip_gem_mmap_buf+0x3c/0x48 [ 641.202070] sp : ffffff800d3f3ba0 [ 641.202675] x29: ffffff800d3f3ba0 x28: 00000000f6e44000 [ 641.203632] x27: ffffffc03876a530 x26: 0000000000000000 [ 641.204587] x25: ffffff800b73d000 x24: 0000000000000000 [ 641.205538] x23: 00000000000001fb x22: ffffffc03876aca8 [ 641.206489] x21: ffffff8009863098 x20: 0000000000000000 [ 641.207444] x19: 00000000f6e44000 x18: 0000000000000000 [ 641.208397] x17: 0000000000000000 x16: 0000000000000000 [ 641.209352] x15: 0000000000000000 x14: 0000000000000000 [ 641.210306] x13: 0000000000000000 x12: 0000000000000000 [ 641.211263] x11: 0000000000000000 x10: 0000000000100000 [ 641.212216] x9 : 0000000000000070 x8 : 00000000f703f000 [ 641.213168] x7 : ffffffc03876ae58 x6 : 000000000005a54f [ 641.214128] x5 : 000000003663b601 x4 : 000000003663b600 [ 641.215084] x3 : ffffffc03663bc00 x2 : 0000000000000000 [ 641.216039] x1 : 00000000f6e44000 x0 : ffffffc03876aca8

  1. emulationstation logs:

ark@rgb30:~/.emulationstation$ tail -f es_log.txt 2024-07-30 20:46:25 INFO CollectionSystemManager::addEnabledCollectionsToDisplayedSystems() - Collection threaded loading 2024-07-30 20:46:25 INFO CollectionSystemManager::addEnabledCollectionsToDisplayedSystems() - Collection threaded loading 2024-07-30 20:46:25 WARNING requested mismatched theme type for [menu.menutextsmall] - expected "menuTextSmall", got "menuText" 2024-07-30 20:46:25 WARNING ImageIO::loadImageSize Unknown file type 2024-07-30 20:46:25 WARNING ImageIO::loadImageSize Unknown file type 2024-07-30 20:46:25 WARNING ImageIO::loadImageSize Unknown file type 2024-07-30 20:46:25 WARNING ImageIO::loadImageSize Unknown file type 2024-07-30 20:46:26 INFO SDL AUDIO Initialized 2024-07-30 20:46:26 INFO DisplayPanelControl::DisplayPanelControl() - Initialized, command '/usr/bin/brightnessctl' exist: true 2024-07-30 20:46:26 INFO DisplayPanelControl::DisplayPanelControl() - Initialized, command '/usr/local/bin/panel_drm_tool' exist: true 2024-07-30 20:46:42 INFO req sound [basic.launch] 2024-07-30 20:46:42 INFO (missing)

  1. remote ssh console launch: ark@rgb30$: /home/ark/McAirpos/McAirpos/launCharc/launCharc_arm64 nomap verbose /roms2/makecode/arcade-DinoZoo.elf nomap argument detected, launCharc starting /roms2/makecode/arcade-DinoZoo.elf with no automatic gamepad mappings... Warn: ioctl KBGKBMODE failed... Unable to get your keyboard mode. Warn: ioctl KDSETMODE failed... Are you on a terminal emulator(X-Windows) instead of the Linux console? [61923697] GC block 16376b @ 0x20000000 [ 0] runtime starting, pid=3274... [ 9] FB: at 720x720 720x720 bpp=32 [ 14] FB: at 720x720 720x720 bpp=32 2880 [ 22] init keys [ 25] read config: /sd/arcade.cfg [ 32] SCAN_CODES=/dev/input/event3 [ 37] BTN_LEFT=546 [ 42] BTN_RIGHT=547 [ 45] BTN_UP=544 [ 48] BTN_DOWN=545

launCharc: Found running game process "arcade-DinoZoo." on PID=3274

[ 51] BTN_A=305 [ 54] BTN_B=304 [ 56] BTN_LEFT2=105 [ 58] BTN_RIGHT2=106 [ 61] BTN_UP2=103 [ 63] BTN_DOWN2=108 [ 65] BTN_A2=307 [ 68] BTN_B2=308 [ 71] BTN_RESET=318 [ 74] BTN_EXIT=317 [ 76] BTN_MENU=315 [ 79] config done [ 82] sx=4 sy=4 ox=40 oy=120 32=1 [ 84] fbuf=0xf6f8d000 sz:2073600 [ 87] loop [ 339] GC block 16376b @ 0x20004000 [ 1254] PCM name: 'default' [ 1257] PCM state: PREPARED

  1. Screen shot of the game launched from remote ssh console a-2