diff --git a/source/vm.cpp b/source/vm.cpp index 1ba417a..fc0e90b 100644 --- a/source/vm.cpp +++ b/source/vm.cpp @@ -299,11 +299,6 @@ Vm::~Vm(){ CloseCart(); if (_luaState != nullptr) { - Logger_Write("printing stack before close\n"); - printLuaStack(_luaState); - - printLuaStack(_luaState); - Logger_Write("closing lua state\n"); lua_close(_luaState); @@ -558,6 +553,7 @@ void Vm::deserializeCartDataToMemory(std::string cartDataStr) { } bool Vm::Step(){ + _picoFrameCount++; bool ret = false; lua_getglobal(_luaState, "__z8_tick"); int status = lua_pcall(_luaState, 0, 1, 0); diff --git a/test/endtoendtests.cpp b/test/endtoendtests.cpp index a4ec9d4..834e200 100644 --- a/test/endtoendtests.cpp +++ b/test/endtoendtests.cpp @@ -131,8 +131,10 @@ TEST_CASE("Loading and running carts") { } */ + SUBCASE("Load simple cart"){ vm->LoadCart("cartparsetest.p8", false); + vm->vm_run(); SUBCASE("No error reported"){ CHECK(vm->GetBiosError() == ""); @@ -145,6 +147,7 @@ TEST_CASE("Loading and running carts") { CHECK(vm->GetFrameCount() == 3); } SUBCASE("check lua state"){ + //need to pass this func to the sandbox, not the global state bool globalVarLoaded = vm->ExecuteLua( "function globalVarTest()\n" " return a == 1\n"