Skip to content

Commit

Permalink
Remove debug call and add frame counting
Browse files Browse the repository at this point in the history
  • Loading branch information
jtothebell committed Mar 3, 2024
1 parent 7ffa909 commit c738e69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 1 addition & 5 deletions source/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions test/endtoendtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() == "");
Expand All @@ -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"
Expand Down

0 comments on commit c738e69

Please sign in to comment.