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

[NX] Added Nintendo Switch port. #1337

Merged
merged 7 commits into from Mar 9, 2018

Conversation

Projects
None yet
6 participants
@Rinnegatamante
Member

Rinnegatamante commented Feb 23, 2018

No description provided.

@@ -456,6 +456,8 @@ void FileFinder::InitRtpPaths(bool warn_no_rtp_found) {
#ifdef GEKKO
add_rtp_path("sd:/data/rtp/" + version_str + "/");
add_rtp_path("usb:/data/rtp/" + version_str + "/");
#elif defined(SWITCH)
add_rtp_path("./rtp/" + version_str + "/");

This comment has been minimized.

@Ghabry

Ghabry Feb 23, 2018

Member

could you also add

add_rtp_path("/switch/easyrpg-player/" + version_str + "/");

?

Just as a fallback in case somebody decides to use a different folder or directly ship a game with it.

#elif SWITCH
// Only wildmidi paths, no timidity because it was never used on Switch
config_file = "./wildmidi.cfg";
found = FileFinder::Exists(config_file);
#elif __ANDROID__

This comment has been minimized.

@Ghabry

Ghabry Feb 23, 2018

Member

Could you add after your check

	if (!found) {
		config_file = "/switch/easyrpg-player/wildmidi.cfg";
		found = FileFinder::Exists(config_file);
}

?

Just as a fallback in case somebody decides to use a different folder or directly ship a game with it.

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 23, 2018

Looks good to me, open issues:

  • Add switch buildsystem to buildscript repo
  • Decide about the logo
-DHAVE_WILDMIDI -DWANT_FMMIDI -DWANT_FASTWAV \
-I$(TOOLCHAIN_DIR)/include \
-I$(LIBLCF_DIR)/include/liblcf \
-I$(TOOLCHAIN_DIR)/include/pixman-1

This comment has been minimized.

@Ghabry

Ghabry Feb 23, 2018

Member

Please also add the other libs I provided:
HAVE_OPUS
HAVE_XMP
HAVE_FREETYPE

with appropriate deps (not sure if all filenames are correct)
-lxmplite -lopusfile -lopus -lfreetype

You can test if XMP (MOD/Tracker music) works e.g. with https://rpgmaker.net/games/4145/downloads/3594/ (Title music)

@MarianoGnu

This comment has been minimized.

Member

MarianoGnu commented Feb 23, 2018

Wow, aded an entire console platform port with just 10 files changed/added. Nice work

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 23, 2018

@MarianoGnu
Yeah by now the abstraction layer is good enough to allow porting with minimal changes :)

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 23, 2018

possible icons

logo1 svg
logo2 svg
logo3 svg
logo4 svg

threadWaitForExit(&audio_thread);
// Deleting thread
threadClose(&audio_thread);

This comment has been minimized.

@plutooo

plutooo Feb 23, 2018

Missing audoutExit() I think

#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffast-math -ffunction-sections \

This comment has been minimized.

@carstene1ns

carstene1ns Feb 24, 2018

Member

Can we get rid of -ffast-math? It is not helpful on most platforms and can lead to problems.

keys[Input::Keys::N5] = (input & KEY_SR);
keys[Input::Keys::F12] = (input & KEY_MINUS);
keys[Input::Keys::ESCAPE] = (input & KEY_PLUS);
}

This comment has been minimized.

@carstene1ns

carstene1ns Feb 24, 2018

Member

One general problem the latest ports (3ds, psvita, switch) have is that they (ab)use the keyboard interface.
We actually have a controller interface and can even define buttons for platforms individually.
But this could be changed later for all 3 ports, so is ok by me.

@Ghabry

This comment has been minimized.

Member

Ghabry commented Feb 27, 2018

Okay, testing of this is finished.

I will only finish the extra code to add a toggleable numpad Ui at the left and right side of the screen for the full input experience (could be ported to the Vita, btw).

touch_ui

@Ghabry

This comment has been minimized.

Member

Ghabry commented Mar 4, 2018

found some bugs in my code via ryujinx, fixing them tomorrow.
And touch needs a hardware test because it's not correctly emulated.

@Ghabry

This comment has been minimized.

Member

Ghabry commented Mar 5, 2018

@Rinnegatamante
Could you do a final hardware test with this nro file:
easyrpg-player.zip

Stuff to test:

  • A touch ui is now visible in the corners, could you test if the buttons work?
    Yume Nikki is the best test candidate for this, "9" is wakeup. The "EasyRPG Logo" button is mapped to Escape (opens the menu)
  • With "KEY_SL" (left shoulder button?) you can toggle between 3 rendering modes: Touch Ui + 4:3, 4:3 w/o Touch Ui, 16:9 stretched w/o Touch Ui. (the touch itself still works, is just cosmetic)

I already tested it in an emulator but a real test is better :D

@Ghabry

This comment has been minimized.

Member

Ghabry commented Mar 8, 2018

Got feedback from GBATemp, everything works fine 👍
Ready for merge.

And I agree with @carstene1ns that another PR should fix the bad button mapping solution that abuses desktop keys.

@carstene1ns carstene1ns merged commit 0220488 into EasyRPG:master Mar 9, 2018

7 checks passed

Android (armeabi-v7a) Build finished.
Details
GCW0 Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details
@carstene1ns

This comment has been minimized.

Member

carstene1ns commented Mar 9, 2018

Thank you!

@carstene1ns carstene1ns added this to the 0.5.4 milestone Mar 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment