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).
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,