Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backporting armv8 drc backend from mame0274? #1933

Open
wn2000 opened this issue Feb 2, 2025 · 13 comments
Open

Backporting armv8 drc backend from mame0274? #1933

wn2000 opened this issue Feb 2, 2025 · 13 comments

Comments

@wn2000
Copy link

wn2000 commented Feb 2, 2025

MAME finally has an aarch64 drc backend now. Might be a super long shot but any chance to port it over?

@mahoneyt944
Copy link
Collaborator

I would assume that the commit would be vastly different from this core. Plus it may be more feasible to implement this in retroarch / the frontend first.

mamedev/mame@aa5cd15

@wn2000
Copy link
Author

wn2000 commented Feb 2, 2025

Agree it'll be vastly different. But why it has anything to do with retroarch? Do you mean lr-mame?

@grant2258
Copy link
Contributor

@wn2000 i think its only mips ,sh2, sh4 and ppc dont think we have many of these games. Is there a game in particular you had in mind. The asmjit is certainly usable license wise.

@mahoneyt944
Copy link
Collaborator

Agree it'll be vastly different. But why it has anything to do with retroarch? Do you mean lr-mame?

Yes sorry. Port wise it's 1 to 1 and will likely be pulled in an update if it hasn't already soon.

@grant2258
Copy link
Contributor

@mahoneyt944 the DRC is disabled on lr-mame due to some games having issues in the past. Them bugs seem to be fixed but its still disabled in the mame274 release perhaps an oversight.

@mahoneyt944
Copy link
Collaborator

Not sure might be worth an issue ticket in their repo though to see.

@wn2000
Copy link
Author

wn2000 commented Feb 3, 2025

@wn2000 i think its only mips ,sh2, sh4 and ppc dont think we have many of these games. Is there a game in particular you had in mind. The asmjit is certainly usable license wise.

KI!

@wn2000
Copy link
Author

wn2000 commented Feb 3, 2025

@mahoneyt944 the DRC is disabled on lr-mame due to some games having issues in the past. Them bugs seem to be fixed but its still disabled in the mame274 release perhaps an oversight.

Is there a lr-mame0274 release? I'm still waiting for it.

@mahoneyt944
Copy link
Collaborator

They haven't pulled the changes yet but I'm sure they will. Not sure when though

@grant2258
Copy link
Contributor

forgot is Feb my bad I looked at the commit date. Hopefully they fix it at some point. I dont use the libretro port as there is no linux arm64 bins. There are a few issues as well mainly the hi scores have a bug and corrupt the standalone ones. Im sure there are people that would appreciate the using the libretro port. I think its a startup issue because the savestates come in too late as well for rewind/netplay and runahead. It used to work at one point Probably something simple but will be a ball ache to find where the runloops running short.

@wn2000
Copy link
Author

wn2000 commented Feb 5, 2025

I tried lr-mame 274 on a RK3399, which is comparable to a rpi4. KI runs at 60 fps.
Tried it on a RK3328 (comparable to a rpi3), got about 26-30fps.
So I still hope the DRC could be ported to this core.
Looks like the cpu/mips folder already has an x86 drc. But it is directly generating x86 instructions, rather than using the fe->uml->be architechture.

@grant2258
Copy link
Contributor

grant2258 commented Feb 6, 2025

hi @wn2000 lr-mame still has all drc backends completely disabled see https://github.com/libretro/mame/blob/d087eb20c521943155612420c900b501f302194b/Makefile.libretro#L281-L283.

The x86/x64 bugs have been fixed it really should be enabled for them and the android (64bit) platforms at the very least(There have been improvements since the release so you would be better compiling current master.).

If your compiling this yourself on an arm device be sure PLATFORM=arm64 is being set in the makefile.libretro passes these parameters to the main makefile and if its not set X86 drc will be selected, also make sure NOASM is not being set. Since libretro does not include an arm64 linux build might be worth creating one in makefile.libretro. If you need any help with this let me know.

this is the of conditions to met for the drc.

https://github.com/libretro/mame/blob/aa5cd150b3e159d342b7bb0778f7517fe5c4ed1a/scripts/genie.lua#L710-L735

kind regards

@wn2000
Copy link
Author

wn2000 commented Feb 6, 2025

hi @wn2000 lr-mame still has all drc backends completely disabled see https://github.com/libretro/mame/blob/d087eb20c521943155612420c900b501f302194b/Makefile.libretro#L281-L283.

The x86/x64 bugs have been fixed it really should be enabled for them and the android (64bit) platforms at the very least(There have been improvements since the release so you would be better compiling current master.).

If your compiling this yourself on an arm device be sure PLATFORM=arm64 is being set in the makefile.libretro passes these parameters to the main makefile and if its not set X86 drc will be selected, also make sure NOASM is not being set. Since libretro does not include an arm64 linux build might be worth creating one in makefile.libretro. If you need any help with this let me know.

this is the of conditions to met for the drc.

https://github.com/libretro/mame/blob/aa5cd150b3e159d342b7bb0778f7517fe5c4ed1a/scripts/genie.lua#L710-L735

kind regards

Yep I compiled myself. Made sure platform was set to arm64 and removed DRC_C_BACKEND.
My verbose make printout had -DNATIVE_DRC=drcbe_arm64 in it.
And from the RK3399 test, it should be using the DRC.
Thanks for the lookout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants