Skip to content

Commit

Permalink
sol now works, but the controllers are erratic
Browse files Browse the repository at this point in the history
  • Loading branch information
hamhub7 committed May 23, 2021
1 parent 39dd7db commit 700fabf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/sol/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ the build system, or the command line options of your compiler.
*/

#include <limits>

// end of sol/config.hpp

#endif // SOL_SINGLE_CONFIG_HPP
4 changes: 2 additions & 2 deletions lua/boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ rootpath = "sdmc:/script/" --DO NOT EDIT THIS LINE

logpath = rootpath .. "tas-script.log" --Edit this to change the log file's name and/or directory

package.path = rootpath .. "?.lua;" .. package.path --DO NOT EDIT THIS LINE

SetupLog(logpath) --DO NOT EDIT THIS LINE

package.path = rootpath .. "?.lua;" .. package.path --DO NOT EDIT THIS LINE

dofile(rootpath .. "main.lua") --Edit this to change which file is executed after bootup
2 changes: 1 addition & 1 deletion source/lua_hiddbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Controller lua_hiddbg_AttachController(u32 bodyColor, u32 buttonsColor, u32 grip
rc = hiddbgSetHdlsState(controller.handle, &controller.state);
if(R_FAILED(rc))
{
throw string_format("Error setting controller state: %#x", rc);;
throw string_format("Error setting controller state: %#x", rc);
}

return controller;
Expand Down
8 changes: 5 additions & 3 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ void __attribute__((weak)) __appExit(void)
smExit();
}

std::string logpath = "sdmc:/test.log";
std::string filepath = "sdmc:/test.log";

// Outputs to sdmc/test.log
void logToSd(std::string message)
{
std::ofstream ofs;
ofs.open(logpath, std::ofstream::out | std::ofstream::app);
ofs.open(filepath, std::ofstream::out | std::ofstream::app);
if(ofs.is_open())
{
ofs << message << std::endl;
Expand All @@ -144,6 +144,8 @@ void logToSd(std::string message)
void lua_SetupLog(std::string logpath)
{
std::ofstream ofs;

filepath = logpath;
ofs.open(logpath, std::ofstream::out | std::ofstream::trunc);
ofs.close();

Expand All @@ -168,7 +170,7 @@ void registerUtility(sol::state& lua)
int main(int argc, char* argv[])
{
sol::state lua;
lua.open_libraries(sol::lib::base);
lua.open_libraries(sol::lib::base, sol::lib::package, sol::lib::table);

// Register Lua functions
registerUtility(lua);
Expand Down

0 comments on commit 700fabf

Please sign in to comment.