Homebrew RELEASE Solarus Engine v1.6.4 - gui 0.4 -- now with luaJIT

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
425
Country
United States
https://github.com/capsterx/solarus/releases/tag/v0.4.3-luajit

This is basically the same as my previous release, the gui and engine remain unchanged. The only difference is instead of lua 5.1 it's now luajit 2.1.0-beta3 modified to work on the switch (with JIT!)

Is this better? I hope so, technically it should be faster, but I cannot guarantee that. Let me know!

There is one scene in return of the hylian in the fire cave where the fire shots caused a huge slowdown, I prob wont have time to check on that soon, but if you do, let me know which version works better!.

Technical details:
I used some basic info from melonDS as some of the kernel calls are not heavily documented.
The big issue is that luaJIT relies on the ability to change the permission of code pages from RW (read and write) to RX (read and execute) to RW. The switch lets RW -> RX but RX -> RW is not allowed. Optimally it would do something like melonDS does and allocate a RX and RW block and not switch modes with kernel calls.
However after a long time going over the luaJIT code, I could not figure out where it actually executes code and there are a lot of c-style pointers and it did not seem trivial to split write and execute to separate pointers.
So my hacky solution is that if going from RX -> RW just unmap the whole range, remap it then set the permission on it.

Please, if I'm missing something let me know. It took me forever just to even get the svc calls to do anything useful (thank you melonDS, as google on the nintendo switch kernel was not much help).
 
Last edited by capsterx,

angelhp

Well-Known Member
Member
Joined
Nov 30, 2014
Messages
500
Trophies
0
XP
1,511
Country
United States
Thanks you , for the new update

I have found a problem with the game "Tunics!"
the controls do not work correctly.
*Link can use the sword , but he can't move
 
Last edited by angelhp,

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
425
Country
United States
Thanks you , for the new update

I have found a problem with the game "Tunics!"
the controls do not work correctly.
*Link can use the sword , but he can't move

I'll take a look at it, I have not played that game yet. Thanks!

Is this related to jus this version or include the previous versions?
 
Last edited by capsterx,

angelhp

Well-Known Member
Member
Joined
Nov 30, 2014
Messages
500
Trophies
0
XP
1,511
Country
United States
I just checked and it seems that in the previous version and the first version
the game did not work, the screen remains black
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
666
Trophies
0
Age
43
XP
873
Country
Colombia
Hi I am very happy with the solarus engine, is great.

I am trying to compile but my programming skills are no so good.

I am using:
Windows 10
MSYS2-x86_64-20210215.exe

Inside the recently installed MSYS I did execute the next commands:

Code:
pacman -Syu
(some Ming packages get updated)

Add some base packages:

Code:
pacman -S --needed --noconfirm base-devel git make mercurial python3 subversion

pacman -S --needed --noconfirm mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-glew mingw-w64-x86_64-SDL2 mingw-w64-x86_64-toolchain

pacman -S --needed --noconfirm mingw-w64-i686-cmake mingw-w64-i686-gcc mingw-w64-i686-glew mingw-w64-i686-SDL2 mingw-w64-i686-toolchain

pacman -Syuu


on c:\msys64\etc\pacman.conf I did add the next lines at end of file

Code:
[dkp-libs]
Server = https://downloads.devkitpro.org/packages

[dkp-windows]
Server = https://downloads.devkitpro.org/packages/windows

[dkp-win32]
Server = https://downloads.devkitpro.org/packages/win32

then add the DevKitPro keys

Code:
pacman-key --recv BC26F752D25B92CE272E0F44F7FD5492264BB9D0 --keyserver keyserver.ubuntu.com
pacman-key --lsign BC26F752D25B92CE272E0F44F7FD5492264BB9D0

pacman -Sy
pacman -Syu

update the DevKitPro Keyring
Code:
pacman -U https://downloads.devkitpro.org/devkitpro-keyring.pkg.tar.xz

pacman -Sy
pacman -Syu

and update DevKitPro
Code:
pacman -S --needed --noconfirm switch-dev devkitpro-pkgbuild-helpers libnx switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2

pacman -Syu


then I did install the packages you listed on the github page:

Code:
pacman -S --needed --noconfirm deko3d devkitA64 devkitA64-gdb devkita64-rules devkitpro-keyring general-tools libnx switch-bzip2 switch-examples switch-flac switch-freetype switch-glad switch-glm switch-libconfig switch-libdrm_nouveau switch-libjpeg-turbo switch-libmodplug switch-libogg switch-libopus switch-libpng switch-libvorbis switch-libvorbisidec switch-libwebp switch-mesa switch-mpg123 switch-opusfile switch-physfs switch-pkg-config switch-sdl2 switch-sdl2_gfx switch-sdl2_image switch-sdl2_mixer switch-sdl2_ttf switch-tools switch-zlib uam

clone the repository and try make:

Code:
git clone https://github.com/capsterx/solarus solarus

make SWITCH_GUI=1

but the process end in error:

Code:
<command-line>: warning: missing terminating " character
In file included from C:/msys64/solarus/include/solarus/lua/LuaContext.h:39,
                 from C:/msys64/solarus/src/entities/Block.cpp:29:
C:/msys64/solarus/include/solarus/lua/LuaTools.h:27:10: fatal error: lua.hpp: No such file or directory
   27 | #include <lua.hpp>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [/solarus/Makefile:247: Block.o] Error 1
make: *** [Makefile:207: build] Error 2

What I am missing? thanks a lot.
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
425
Country
United States
Can you show the compile line where it fails to find lua.hpp? And can you check that you are on git branch release-1.6.4?
 

1NOOB

Well-Known Member
Member
Joined
Sep 9, 2006
Messages
602
Trophies
0
Age
31
Location
Inside My Head...
XP
1,531
Country
Canada
loool i never looked at that but really , its the same zelda solarus thingy i played in high school ?! hahahahah wow im impressed it lasted that long .
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
666
Trophies
0
Age
43
XP
873
Country
Colombia
Can you show the compile line where it fails to find lua.hpp? And can you check that you are on git branch release-1.6.4?
Hi, thanks for your quick response, I am attaching a complete result of the git clone and make.

I did start from scratch with a new MSYS2 installation, installed DevKitPro and all needed packages then clone the git an try to make then, I did get the attached errors.

Regards from Colombia.
 

Attachments

  • ErrorDeCompilación.txt
    8.7 KB · Views: 34

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
425
Country
United States
Hi, thanks for your quick response, I am attaching a complete result of the git clone and make.

I did start from scratch with a new MSYS2 installation, installed DevKitPro and all needed packages then clone the git an try to make then, I did get the attached errors.

Regards from Colombia.

Looks like there is a bug in the Makefile when not using luajit. Try this
make SWITCH_GUI=1 LUAJIT=1
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
666
Trophies
0
Age
43
XP
873
Country
Colombia
Hi, nope, just a similar error:

upload_2021-2-21_13-12-9.png


there is any variable I am missing? or any package? need to clone something besides https://github.com/capsterx/solarus?

Thanks for the super speed answer :D

BTW my variables are:

Code:
[email protected] MINGW64 ~/solarus
# export
declare -x ACLOCAL_PATH="/mingw64/share/aclocal:/usr/share/aclocal"
declare -x ALLUSERSPROFILE="C:\\ProgramData"
declare -x APPDATA="C:\\Users\\Impeeza\\AppData\\Roaming"
declare -x COMMANDER_DRIVE="C:"
declare -x COMMANDER_EXE="C:\\totalcmd\\TOTALCMD64.EXE"
declare -x COMMANDER_INI="C:\\totalcmd\\wincmd.ini"
declare -x COMMANDER_INSTANCE="1"
declare -x COMMANDER_PATH="C:\\totalcmd"
declare -x COMMONPROGRAMFILES="C:\\Program Files\\Common Files"
declare -x COMPUTERNAME="TITAN"
declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
declare -x CONFIG_SITE="/mingw64/etc/config.site"
declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
declare -x DEVKITARM="/opt/devkitpro/devkitARM"
declare -x DEVKITPPC="/opt/devkitpro/devkitPPC"
declare -x DEVKITPRO="/opt/devkitpro"
declare -x DriverData="C:\\Windows\\System32\\Drivers\\DriverData"
declare -x FPS_BROWSER_APP_PROFILE_STRING="Internet Explorer"
declare -x FPS_BROWSER_USER_PROFILE_STRING="Default"
declare -x HG="/usr/bin/hg"
declare -x HOME="/home/Impeeza"
declare -x HOMEDRIVE="C:"
declare -x HOMEPATH="\\Users\\Impeeza"
declare -x HOSTNAME="Titan"
declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:/share/info"
declare -x LC_CTYPE="en_US.UTF-8"
declare -x LOCALAPPDATA="C:\\Users\\Impeeza\\AppData\\Local"
declare -x LOGONSERVER="\\\\TITAN"
declare -x MANPATH="/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man"
declare -x MINGW_CHOST="x86_64-w64-mingw32"
declare -x MINGW_PACKAGE_PREFIX="mingw-w64-x86_64"
declare -x MINGW_PREFIX="/mingw64"
declare -x MSYSCON="mintty.exe"
declare -x MSYSTEM="MINGW64"
declare -x MSYSTEM_CARCH="x86_64"
declare -x MSYSTEM_CHOST="x86_64-w64-mingw32"
declare -x MSYSTEM_PREFIX="/mingw64"
declare -x NUMBER_OF_PROCESSORS="4"
declare -x OLDPWD="/home/Impeeza"
declare -x ORIGINAL_PATH="/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/"
declare -x ORIGINAL_TEMP="/c/Users/Impeeza/AppData/Local/Temp"
declare -x ORIGINAL_TMP="/c/Users/Impeeza/AppData/Local/Temp"
declare -x OS="Windows_NT"
declare -x OneDrive="C:\\Users\\Impeeza\\OneDrive"
declare -x PATH="/opt/devkitpro/tools/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"
declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
declare -x PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig"
declare -x PRINTER="Samsung ML-1740"
declare -x PROCESSOR_ARCHITECTURE="AMD64"
declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 94 Stepping 3, GenuineIntel"
declare -x PROCESSOR_LEVEL="6"
declare -x PROCESSOR_REVISION="5e03"
declare -x PROGRAMFILES="C:\\Program Files"
declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\[email protected]\\h \\[\\e[35m\\]\$MSYSTEM\\[\\e[0m\\] \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\[\\e[1m\\]#\\[\\e[0m\\] "
declare -x PSModulePath="C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules"
declare -x PUBLIC="C:\\Users\\Public"
declare -x PWD="/home/Impeeza/solarus"
declare -x ProgramData="C:\\ProgramData"
declare -x ProgramW6432="C:\\Program Files"
declare -x SHELL="/usr/bin/bash"
declare -x SHLVL="1"
declare -x SYSTEMDRIVE="C:"
declare -x SYSTEMROOT="C:\\Windows"
declare -x TEMP="/tmp"
declare -x TERM="xterm"
declare -x TERM_PROGRAM="mintty"
declare -x TERM_PROGRAM_VERSION="3.4.5"
declare -x TMP="/tmp"
declare -x TZ="America/Bogota"
declare -x USER="Impeeza"
declare -x USERDOMAIN="TITAN"
declare -x USERDOMAIN_ROAMINGPROFILE="TITAN"
declare -x USERNAME="Impeeza"
declare -x USERPROFILE="C:\\Users\\Impeeza"
declare -x WINDIR="C:\\Windows"
declare -x temp="C:\\Users\\Impeeza\\AppData\\Local\\Temp"
declare -x tmp="C:\\Users\\Impeeza\\AppData\\Local\\Temp"

[email protected] MINGW64 ~/solarus
 
Last edited by impeeza,

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
666
Trophies
0
Age
43
XP
873
Country
Colombia
No, I just happen to have lua installed where it can pick up the header. I pushed a change, update git and see if you can compile now.
Thanks a lot for all your help, this time almost done, the lua part past without problem, but some minutes later get the next error:

upload_2021-2-21_13-57-46.png
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
666
Trophies
0
Age
43
XP
873
Country
Colombia
yes something about different DevKitPro version and another set of include .h files, again thanks for your help.
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
39
XP
425
Country
United States
General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: Hmm didn't know they made more Dusk Till Dawn movies watched part one on Pluto TV and they have...