Skip to content

Commit cd92586

Browse files
jquastvxgmichel
authored andcommitted
use 0x0 / zeros as redraw sentinel
1 parent f082034 commit cd92586

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

gambaterm/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def run(
132132
maybe_clear_seq = b"\033[H\033[2J"
133133
height, width = new_size
134134
refx, refy = get_ref(width, height, console)
135-
last_frame = ~video
135+
last_frame.fill(0)
136136
else:
137137
maybe_clear_seq = b""
138138
# Render frame with synchronized output mode (DEC 2026) to prevent flickering

termblit_ext/termblit.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ cdef char* _blit(
154154

155155
cdef int current_x = refx
156156
cdef int current_y = refy
157-
# Use values that can never match a real pixel (high byte is always
158-
# 0xFF in GB pixel format)
159-
cdef uint32_t current_fg = 0x00DEAD00
160-
cdef uint32_t current_bg = 0x00BEEF00
157+
# Use 0x0 as "undrawn" sentinel: real GB pixels always have 0xFF
158+
# in the high byte, so 0x0 can never match
159+
cdef uint32_t current_fg = 0x0
160+
cdef uint32_t current_bg = 0x0
161161
cdef int row_index, column_index
162162
cdef uint32_t color1, color2
163163
cdef int new_x, new_y

0 commit comments

Comments
 (0)