foxygit / fake-08-xbox360 Log in
commit 5fe999b2de97a0618b1fa5bdef7183e4fe5b654c
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Tue Mar 4 19:46:57 2025 -0700
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Tue Mar 4 19:46:57 2025 -0700

    fix failing vm tests (input)
---
 test/vmtests.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/vmtests.cpp b/test/vmtests.cpp
index 5b45019..880e5a3 100644
--- a/test/vmtests.cpp
+++ b/test/vmtests.cpp
@@ -426,8 +426,11 @@ TEST_CASE("Vm memory functions") {
     }
     SUBCASE("pico driller style input"){
         vm->LoadCart("drillerinputtest.p8");
+        vm->vm_run();
+        //30 fps game loop requires 1 step to update and update buttons, and another to draw

         SUBCASE("no buttons gives 0"){
+            vm->Step();
             vm->Step();
             bool btnbits = vm->ExecuteLua(
                 "function btnbitstest0()\n"
@@ -440,6 +443,7 @@ TEST_CASE("Vm memory functions") {
         SUBCASE("left pushed returns 1"){
             stubHost->stubInput(1, 1);
             vm->Step();
+            vm->Step();
             bool btnbits = vm->ExecuteLua(
                 "function btnbitstest1()\n"
                 " return btnbits == 1\n"
@@ -451,6 +455,7 @@ TEST_CASE("Vm memory functions") {
         SUBCASE("right pushed returns 2"){
             stubHost->stubInput(2, 2);
             vm->Step();
+            vm->Step();
             bool btnbits = vm->ExecuteLua(
                 "function btnbitstest2()\n"
                 " return btnbits == 2\n"
@@ -462,6 +467,7 @@ TEST_CASE("Vm memory functions") {
         SUBCASE("right pushed detected by band op"){
             stubHost->stubInput(2, 2);
             vm->Step();
+            vm->Step();
             bool btnbits = vm->ExecuteLua(
                 "function rightbandtest()\n"
                 " return rightband == 2\n"