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

Pandroid #340

Merged
merged 15 commits into from
Dec 13, 2023
Merged

Pandroid #340

merged 15 commits into from
Dec 13, 2023

Conversation

OFFTKP
Copy link
Collaborator

@OFFTKP OFFTKP commented Nov 14, 2023

Pull request for Android support.

Current steps to build the apk are a bit involved, but will be made easier in the future:

from root project directory:

cmake -B build -DBUILD_HYDRA_CORE=1 -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DBUILD_HYDRA_CORE=1 -DENABLE_VULKAN=0
cmake --build build -j12
# should output ./build/libAlber.so
mv ./build/libAlber.so ./src/pandroid/app/src/main/jniLibs/x86_64/

# repeat above steps and replace x86_64 with arm64-v8a (untested as of now)
# needs -DCMAKE_CXX_FLAGS=-march=armv8.1-a+crypto -DCMAKE_C_FLAGS=-march=armv8.1-a+crypto 

cd src/pandroid
./gradlew assembleDebug
# (use gradlew.bat in windows)
# now you have an apk in ./src/pandroid/app/build/outputs/apk/debug/app-debug.apk

The idea is that AlberDriver.java will load the correct libAlber based on your arch, and the various activities that need to interact with the emulator will use AlberDriver functions that are defined in jni_driver.cpp

Ongoing PR, not ready for merge yet

@OFFTKP OFFTKP marked this pull request as draft November 14, 2023 14:50
@wheremyfoodat
Copy link
Owner

lgtm

wheremyfoodat
wheremyfoodat previously approved these changes Nov 16, 2023
src/jni_driver.cpp Outdated Show resolved Hide resolved
@OFFTKP
Copy link
Collaborator Author

OFFTKP commented Nov 20, 2023

image
WE ARE BARACK

Needs a patch for various opengl stuff that doesnt work on GLES

@wheremyfoodat
Copy link
Owner

image WE ARE BARACK

Needs a patch for various opengl stuff that doesnt work on GLES

None of these words are in the bible

@GabrielBRDeveloper
Copy link
Contributor

GabrielBRDeveloper commented Nov 25, 2023

How I can build version for other ABIs (ARMv8)?

@wheremyfoodat
Copy link
Owner

Github duplicated some review comments
Thank you Microsoft


@Override
public void onDrawForeground(Canvas canvas) {
size_width = getWidth();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
size_width = getWidth();
sizeWidth = getWidth();

@Override
public void onDrawForeground(Canvas canvas) {
size_width = getWidth();
size_height = getHeight();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
size_height = getHeight();
sizeHeight = getHeight();


if (hasDownEvent && event.getAction() == TouchEvent.ACTION_UP) {
AlberDriver.TouchScreenUp();
me.setTag(R.id.TagEventHasDown, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
me.setTag(R.id.TagEventHasDown, false);
view.setTag(R.id.TagEventHasDown, false);

src/pandroid/app/src/main/AndroidManifest.xml Outdated Show resolved Hide resolved
public static final int N3DS_FULL_HEIGHT = 480;

public static final String EXTRA_PATH = "path";
public static final String LOG_TAG = "Alber";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final String LOG_TAG = "Alber";
public static final String LOG_TAG = "Pandroid";


public class PandaGlSurfaceView extends GLSurfaceView implements TouchScreenNodeImpl {
final PandaGlRenderer renderer;
private int size_width;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private int size_width;
private int sizeWidth = 0;

@NonNull
@Override
public Vector2 getSize() {
return new Vector2(size_width, size_height);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new Vector2(size_width, size_height);
return new Vector2(sizeWidth, sizeHeight);

Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
Repository owner deleted a comment from GabrielBRDeveloper Dec 8, 2023
@wheremyfoodat wheremyfoodat marked this pull request as ready for review December 13, 2023 21:19
@wheremyfoodat wheremyfoodat merged commit c3cd6ac into wheremyfoodat:master Dec 13, 2023
14 checks passed
@wheremyfoodat
Copy link
Owner

(Please avoid deleting hydra-emu:pandroid4 for a while)

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

Successfully merging this pull request may close these issues.

3 participants