KAZIK/tools/tests/check_alpha_math.py
Artvasil09 3ad5bf4c9d Develop assembly-only casino scenes and native games
Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
2026-10-08 22:39:19 +03:00

6 lines
344 B
Python

"""Exhaustive bounds proof for the MASM sprite compositor's /255 substitutions."""
for value in range(65026):
assert value // 255 == (value + 1 + (value >> 8)) >> 8
rounded = value + 128
assert (value + 127) // 255 == (rounded + (rounded >> 8)) >> 8
print("PASS: exact floor/rounded alpha math for all 65026 possible channel sums")