jquesnelle / nds4droid

nds4droid is a free and open source Nintendo DS emulator for Android smartphones
GNU General Public License v3.0
168 stars 40 forks source link

Cannot compile nds4droid #8

Closed tangalbert919 closed 1 year ago

tangalbert919 commented 7 years ago

This might not sound like a concern to you, but I cannot compile this project. And before you ask, I DID use Android Studio for this. Most of these errors involve JIT, which means lots of C++ errors. I did use some fixes from another developer called Tsunamical, which fixed the math-neon problem, and didn't make more problems. I can send the errors when I have the time. What am I supposed to do? I used Android Studio 2.2.3, Gradle 2.14.3 (I think), and Build Tools 25.0.2 using Android API 18 (Jelly Bean) as the target API. I honestly wish I could do this on Eclipse.

jquesnelle commented 7 years ago

I use version R10e of the Android NDK to compile the shared libraries -- it's possible it doesn't work on later versions (for one I believe they switched to Clang in version 12)

tangalbert919 commented 7 years ago

Whoa! I did not think you would reply so quickly! I did link the C++ module, and I did install the NDK bundle. I'm not sure which one. I have absolutely no idea how to fix this, but something tells me I need to downgrade. EDIT: It turns out I used version r13b of the Android NDK.

jquesnelle commented 7 years ago

Just happened to catch my eye in the e-mails ;). Here is a link to the specific one I use: https://dl.google.com/android/repository/android-ndk-r10e-windows-x86.zip

tangalbert919 commented 7 years ago

Sounds like I made an issue at the right time then. I got lucky there, because usually, I don't get a reply until a few hours later or more. I'm guessing you used GCC to compile the project. I'll have to figure out how to switch to GCC from Clang. Maybe I can also figure out how to use this project in Eclipse, because I'm not a huge fan of Android Studio (mostly because of the speed).

tangalbert919 commented 7 years ago

I updated my fork and fixed a LOT of errors (but sadly, can't get this working on Eclipse). Here is the error I'm facing: I'm still using GCC or G++ for this (version 4.9), and I did not switch to clang. There's just one problem: Every error I've gotten has EVERYTHING to do with lightning JIT. Here's an error from the core-common.h file: "jit_prepare_i" was not declared in this scope. The line of code: #define jit_prepare(nint) jit_prepare_i((nint)) Here's another error: "LOCALREG" was not declared in this scope. The code:

case ABIOp::GUSETREG:
                {
                    u32 reg = MapReg(REGID(Op.regdata));
                    Lock(reg);

                    jit_pusharg_ui(LOCALREG(reg));

                    Unlock(reg);
                }
                break;

This is how you know I have almost zero C++ knowledge, and I still figured out how to fix the "INLINE" problem by changing it to "FORCEINLINE". The errors I am sharing are WAY beyond what I know so far (and so far, I only know how to do "Hello World" in C and C++).

NotTsunami commented 7 years ago

Don't use my fork either, there's a lot I still need to work on before any real benefits are actually seen.

However, these two commits and line change are necessary to build through Android Studio: https://github.com/Tsunamical/nds4droid/commit/2dbab94393f9f9eef7487212361c7cc18e872482 https://github.com/Tsunamical/nds4droid/commit/71b942aa2065ab4b6774ebf0c400329fec311a40

https://github.com/Tsunamical/nds4droid/commit/02849c32a7923fdb28be0c1ef80fb425d2f52b5d#diff-c4987ace33db6b3c577ee86911f133a7R19

I am not sure about any other errors, I'll look at my setup later and continue my work. I do have work and school as well, so this isn't my #1 focus at the moment.

tangalbert919 commented 7 years ago

Don't worry. Your commits are also in my fork. So far, I figured out how to fix the ones that don't have a type, even though they do because of the headers they include. I also have school, so I only do this if I have time. And I don't have any friends, so I have a LOT of time.

tangalbert919 commented 7 years ago

I've been working on upgrading DeSmuME to 0.9.11, but that would eliminate the threaded interpreter and lightning JIT that I keep finding in every DS emulator made for iOS or Android. I do not know how "ArmThreadedInterpreter.cpp", "ArmLJit.cpp", and "ArmCJit.cpp" ended up in there with the DeSmuME copyright at the top. Is it made when you run "./configure" on it, or is it something else? I can't figure it out. Also, most of the errors come from JIT. Android Studio can sync just fine, but building gives JIT errors. I am using GCC version 4.9 (which is in the NDK), but that's about it. Any suggestions?

tangalbert919 commented 7 years ago

I managed to upgrade the whole DeSmuME engine to a 0.9.12 nightly build (and yes, 0.9.12 is an actual milestone). No more lightning JIT because DeSmuME already uses its own, but the threaded interpreter is gone too. I looked at the code used for iNDS 2.0. It's no longer needed, but I set the CPUMode for nds4droid to "0" to avoid any...errors. I'm still working on this. I mostly get errors about missing files, but I'll find and add them to the project. I just need the time.

tangalbert919 commented 7 years ago

Will development on this emulator continue? I'm going to experiment with DeSmuMe 0.9.12 soon.

NotTsunami commented 7 years ago

I believe at one point that Jeffery (on his blog) said emulation through DeSmuME had reached a limit - though this is as of a few years back, and this was probably his stopping point. I've kinda stopped fiddling with it for time being. I'm sure he would be willing to accept PRs given they are functional and tested working, however.

tangalbert919 commented 7 years ago

DeSmuME is still being worked on, but I think it moved from Subversion to Git. The code is here on GitHub.

NotTsunami commented 7 years ago

I mean, emulation on mobile using LightningJIT and that specific DeSmuME version - my bad.

tangalbert919 commented 7 years ago

I don't think we need Lightning JIT for emulation anymore. DeSmuME has it's own JUST engine for ARM now.

tangalbert919 commented 7 years ago

Stupid autocorrect. I meant JIT, not JUST.

NotTsunami commented 7 years ago

Right, but I haven't seen any mobile emulator using it, let alone getting it working. It's definitely something to revisit.

If I had more time in the world, I'd like to (in order): -better optimize the flags (simplify and add armv8, maybe) -upgrade the UI to material -upgrade tinyxml to tinyxml2 (this is relatively simple - only need to cover the type changes) -import latest release (or even master branch, if it could work)

tangalbert919 commented 7 years ago

I already upgraded TinyXML to TinyXML2 in my fork. I plan on experimenting with DeSmuME 0.9.12 later, and since I now have a 64-bit Android device (it's fast), I should have a better time testing this.

NotTsunami commented 7 years ago

I have a Nexus 6P, will probably upgrade to a Pixel 2 when it comes out. I might start working on this again. It's mostly a lack of knowledge of OpenGL and DS internals that kept me from continuing.

tangalbert919 commented 7 years ago

The whole OpenGL and DS internals are usually handled by the DeSmuME developers. All of the DS emulators I've tried on the Google Play Store both aren't fast (even on the OnePlus 3T, which is really fast), and the only problem I can come up with is an outdated DeSmuME core in each and every one of them (no matter how many times I ramp up the Lightnng JIT block to 100). I could be wrong on this, but in this case, since I like performance and graphics, and hate crashing, let's find out.

jquesnelle commented 7 years ago

Just chiming in -- I have a lot of other projects and haven't been able to give nds4droid attention (obviously) but like @Tsunamical said I'll accept any PRs and release new versions if we make some progress

NotTsunami commented 7 years ago

I've got the next few days off if you sync your 0.9.12 branch I'll fork it and try working on it.

tangalbert919 commented 7 years ago

The whole project won't sync or build, and I'm using the normal branch. This didn't happen the last time I was working on this.

NotTsunami commented 7 years ago

@tangalbert919 Do you have Hangouts or Telegram?

tangalbert919 commented 7 years ago

I'll start with Hangouts, but I will not do any video calling. Or audio calling.

NotTsunami commented 7 years ago

Yeah, I don't care about audio/video calling either, just somewhere to discuss development rather than on an issue considering every message gives anyone following a notification.

tangalbert919 commented 7 years ago

Ok. I just got Hangouts, so how should I add you?

NotTsunami commented 7 years ago

Start a conversation with my email: ireallylikeshrek@gmail.com

Ignore the email name.