foxygit / fake-08-xbox360 Log in
commit 4dd14918e484070f79bf12d2b33000c74d1f45d0
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Fri Jan 2 19:44:14 2026 -0700
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Fri Jan 2 19:44:14 2026 -0700

    Fix flickering in some carts by adding specific draw flag
---
 source/p8GlobalLuaFunctions.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source/p8GlobalLuaFunctions.h b/source/p8GlobalLuaFunctions.h
index 884801f..25fcf93 100644
--- a/source/p8GlobalLuaFunctions.h
+++ b/source/p8GlobalLuaFunctions.h
@@ -535,19 +535,23 @@ function __z8_run_cart(cart_code)
         if _update or _update60 or _draw then
             local do_frame = true
             while true do
+                local should_draw = false
                 if _update60 then
                     _update_buttons()
                     _update60()
+                    should_draw = true
                 elseif _update then
                     if (do_frame) then
                         _update_buttons()
                         _update()
+                        should_draw = true
                     end
                     do_frame = not do_frame
                 else
                     _update_buttons()
+                    should_draw = true
                 end
-                if (_draw and do_frame) _draw()
+                if (_draw and should_draw) _draw()
                 yield()
             end
         end