seleuco / MAME4droid-2024

MAME4droid 2024 is developed by David Valdeita (Seleuco) as a port of the latest MAME emulator by MAMEDev and contributors. It emulates arcade games and systems like ZX Spectrum, Amstrad CPC, MSX etc. This version of MAME support over 40000 different ROMs.
GNU General Public License v2.0
103 stars 17 forks source link

Big problem with MAME4droid2024 version 1.8: can't open the menu! #27

Closed Barkuti closed 4 months ago

Barkuti commented 8 months ago

Hello,

I've been sparingly testing MAME4droid2024 during the last weeks: an odd 1.4 version I found in Apkpure and the 1.7.4 and 1.8 versions from here, running them in a rooted, fixed and customized Android 11 RK3566 TV box. One of the oddities of the firmware in the single board computer or Android box is that, for some reason, it is impossible to disable the onscreen keyboard; there's a switch meant for that in the popup menu which appears when choosing the default software keyboard with a keyboard switcher app but it doesn't works, so the solution for such a peskyness is to install good ol' Null Keyboard -com.wparam.nullkeyboard- one and/or External Keyboard Helper -com.apedroid.hwkeyboardhelper-. The reason I say this is because the system, instead of referencing the Generic.kcm key character map file when using an external keyboard, it instead uses the Virtual.kcm one. I also had to fix the Generic.kl file, as the retarded ones who are making these boxes have been shipping them with an Enter key bug literally for many many years already. The error is in the line listing key 28 as DPAD_CENTER instead of ENTER; you can check this related article: https://www.novisign.com/blog/tech/x96-tv-box-issue-how-to-fix-it-when-enter-key-interprets-as-q/ (whoever wrote the article didn't realize that the reason it often works as “q” is because it is the default selected key in the Android onscreen keyboard, but this changes as soon as you press or select another key in the onscreen keyboard). This may be a hair off topic, but I had to say it.

Onto the problems report, for the sake of making things clear first I must say that the firmware or operating system of the Android box lacks both the upper drop down menu and notification area so common in smartphones and tablets, just in case this is of importance to understand what I am going to report (it also lacks the recents task switcher, for fuck's sake). Now here's the meat:

With version 1.4 I didn't understand properly how it worked (I came to understand it well more recently), and I was thinking that MAME4droid had issues with input devices because I couldn't remap the gamepad or joystick controls using the graphical user interface menus. I also noticed there was an underlying menu, which I disregarded at first thinking I could do with the graphical user interface menus which must come from some PC version, doesn't it? I don't use MAME since lots of years a go, bear in mind. I had difficulties accessing the underlying menu with a bluetooth keyboard, as MAME4droid didn't respond to the Ctrl + Esc key combination or shortcut which should make it appear, and I couldn't map joystick or gamepad controls with the graphical UI menus because the app wasn't listening and responding to whatever button presses, so all I was getting were the fallback functions (defined in the corresponding kcm file) handled by the system: menu, back, space, delete and etcetera.

I decided I had to customize my keyboard files to solve the above problem, and also went onto the upgrade to version 1.7.4. This version I like it much for having a lot more resolutions to choose including the native one; this improves performance quite a bit, a much needed thing considering the (relatively) low performance of the Android box. With this version I tested the keyboard combos or shortcuts with Shift, Alt or Ctrl; and yes, they work (with a game running I tested Shift + F7 working, LShift + LCtrl + F12 too, and etcetera). However, I still couldn't use the Ctrl + Esc key combo to invoke the menu; I guess this is because MAME4droid is handling Ctrl key combinations by itself, and so the Ctrl + Esc fallback action doesn't works. If you could make this work at least optionally it would be nice, as I don't think MAME has anything mapped to Ctrl + Esc (or does it?). Furthermore I finally discovered that I had to use the underlying app menu of the graphical UI to map the bluetooth mini joystick I am testing it with; thus, I could finally test some games. It seems clear to me that this underlying app menu and related code is the software layer which you are actively developing, isn't it? 😃

Version 1.8 was briefly tested and I promptly “downgraded” back to the 1.7.4 one after noticing THE BUG: it is impossible to invoke the underlying app menu with input devices. When I press my keyboard remapped button which opens the app menu (with scan code directly mapped to MENU), or the menu button in the remote or the button in the joystick which in version 1.7.4 makes the menu appear, all which happens is a back and forth bouncing of focus between the UI window zones. So, this makes the 1.8 version of the app unusable. Check these images:

Screenshot_20240215-071939 Screenshot_20240215-072001 The above two images are the back and forth bouncing of focus between the UI window zones which I describe, for version 1.8, when pressing MENU; obviously, a major issue as I say.

Screenshot_20240215-072321 For comparison purposes, this is what happens in versions 1.7.4 and 1.4 when I press the menu button: the menu appears, and it is possible to configure the emulator.

Having said the above, please fix the reported problems and keep up with this wonderful work you are doing if you will (improvements when mapping joystick or gamepad devices would be very nice).

Best regards, Salvador

P.S.: It's hard not to be judgmental with the lack of performance of the current MAME versions, when 2D arcades from the 90s overall run well but taking most of the available performance of the 1.8 GHz Rockchip 64 bit SoC. 1.8 GHz!!! It may be low power and all of that, but it's a relatively new CPU or SoC and much earlier versions of MAME would run the aforementioned games more fluently with microprocessors 20 years older (Pentium III, Pentium 4, Athlon and Athlon XP). Twenty years older!!! This is not your fault I guess, but I had to say.

ghost commented 8 months ago

That SoC is from 2020 and was designed for AIoT systems as well as e-ink tablets. It is barely more powerful than the SoC in basic (not smart) flip phones.

https://www.notebookcheck.net/Rockchip-RK3566-Processor-Benchmarks-and-Specs.741611.0.html

With the exception of the Shield TV Pro, I have yet to see an Android box that is comparable to modern smartphones. And not even the Shield TV devices are as powerful as PCs (not even as powerful as basic NUC systems or Surface Tablets).

As for the input issue, are you using a cheap, generic bt keyboard or one from a company with better Android support?

seleuco commented 7 months ago

sorry for the delay...

I have already realized the bug you were commenting on. It will be fixed in the next update.

Barkuti commented 7 months ago

StLouisCPhT, I saw your comment earlier. Yes, I notice that the RK3566 is even way less powerful than the Snapdragon 821 in my still daily driver smartphone; but heck, even my retired Core 2 Duo T5500 64 bit laptop microprocessor released ≈18 years ago would blow the fuck out the RK3566, and even older processors. The MAME versions used were also much older, though, yet in my honest opinion I think MAME is slow. This lack of performance makes the hardware requirements much higher than needed, although the actual reasons for this I know enlighteningly well. I use a cheap generic wireless (with both dongle and bluetooh) keyboard, and it works perfectly well. Cheap does not mean bad, and expensive does not mean good. I learned to get the best value for my money, so I know this well.

The only thing to blame is the awful default operating system configuration in the Android box, although I already sorted out all of the problems which I am capable of, including the lack of recents or task switcher (which I could solve with a task manager app and a keyboard shortcut to it). Some things remain, like the lack of a notification area, the right mouse click or secondary mouse button mapped to back (a kernel thing? 🤔), and an Android operating system build which in my honest opinion is barely acceptable.

The problems which I speak of affect most if not all Android TV boxes, and they stem from whoever builds their operating systems: a bunch of retarded, ignorant bunglers. Take a look at this: X96 TV box issue – how to fix it when Enter key interprets as “q”? @ NoviSign. To start off it's not “q”, it is DPAD_CENTER and the reason they say “q” is because when the machine receives the DPAD_CENTER key code, the default selected key in the onscreen keyboard is pressed; but this changes as soon as you select another key, or you resort to install Null Keyboard (com.wparam.nullkeyboard), as there is no other way 🤦 to hide the onscreen keyboard (there is a menu option to hide it, but it doesn't works). If you want to read more about, check my post #26 @ RK3566 / RK3568 TV boxes: rooting, TWRP? and etcetera.

Thanks seleuco, this is very much needed. 🙏 Blessings to everyone!

seleuco commented 7 months ago

lastest update is out there. Tell me if it is fixed yout issue to close it. :)

ghost commented 7 months ago

While waiting for Barkuti to reply, I have a quick question associated with the new update. Did you mean to move all of the installation files from Android/Data to Android/Media?

seleuco commented 7 months ago

Only for AndroidTV unless i have made a mistake.

On AndroidTV devices, the permissions granted by scoped storage do not usually work because many devices do not have the native file browser (but ShieldTV). Also there is no way to access the data folder because of google and its damn scoped storage :)

Luckily for now there is access to the media directory 👍

Barkuti commented 7 months ago

Only for AndroidTV unless i have made a mistake.

On AndroidTV devices, the permissions granted by scoped storage do not usually work because many devices do not have the native file browser (but ShieldTV). Also there is no way to access the data folder because of google and its damn scoped storage :)

Luckily for now there is access to the media directory 👍

…because of google and its damn scoped storage :) Yeeah baby, fuck scoped storage and overall fuck all newer (10+) Android versions because of mandatory scoped storage and other reasons. I am very displeased with Android at this point, suffice to say. Googl€ seems to have gone binge drinking too much or got laid too much with CrApple. 😒 I think that Android still needs improvements in many areas (better handling of external input devices plus a device driver model, for example), although I don't expect this to necessarily happen soon. I don't give a damn about Android at this point, as I think Google has turned it into its own damned whorehouse for the sole purpose of milking its users. It's a shame that Android is such a piece of shite, it could have been an oportunity to make even more affordable small home computers; after all, Android TVs are single board computers, if only with terrible operating system software.

Concerning the box, I was honestly tuning it for a friend, so I'll have to wait until I see him again to check if the problem got solved.

ghost commented 7 months ago

Only for AndroidTV unless i have made a mistake.

On AndroidTV devices, the permissions granted by scoped storage do not usually work because many devices do not have the native file browser (but ShieldTV). Also there is no way to access the data folder because of google and its damn scoped storage :)

Luckily for now there is access to the media directory 👍

Yeah, other than the native file browser there is only one file manager app on Android that seems to be able to get access to the data folder and that is X-Plore. And without the native browser, it'd probably be difficult to give it the access on non-Shield TV devices.

I keep all my games and the following Mame folders (artwork, cfg, nvram, samples, software, and UI) on an external NVME drive instead of on my Shield's internal memory which allows me to reduce the risk of data loss and just restore my custom mame.ini & ui.ini files as needed; so I was thrown off by the change.

Maybe setting things up like Retroarch does would also be an idea?

A) Android/Data/com.retroarch.aarch64/files is where they put the RA cfg file

B) Android/Retroarch is the default location for all folders needed by the emulator and does not get deleted if the software is uninstalled

seleuco commented 6 months ago

B) Android/Retroarch is the default location for all folders needed by the emulator and does not get deleted if the software is uninstalled

The difference between retroarch and this application is that they use an old sdk to which Google scoped storege restrictions do not apply and they can install the application wherever they want. On the other hand, their application cannot be available on Google Play for modern devices. It's all related to the limitations imposed by Google's scoped storage, sadly.

And on top of that, in Android TV, many things necessary for the scoped storage to work correctly do not work, such as there is no mechanism (native file browser) that allows the user to select the directory to grant permissions except for some device exceptions such as Shield TV... :(

That's why by default MAME4droid is installed in media folder on AndrioidTv devices which is a directory that has escaped to Google?? scoped storage resctrictions.... for now.

ghost commented 6 months ago

It was worth a shot :)

Btw, I ran into a bug late last night on my ShieldTV Pro involving textures & running out of memory. I have posted an issue regarding it, and will now stop stealing this one. :D