working dos vga writes!

This commit is contained in:
veclavtlica committed 2026-10-29 22:12:47 +03:00
1 parent 5789cafd4e
commit 55ac075e4d
25 files changed
+454 -149

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
# Generator for sin/cos fixed point LUT tables.
import math
def generate_pi():
print(f"#define COM_FIXED_PI (com_fixed_t){int(math.pi * (1 << 16))}\n")
# Idea is to generate only one quadrant, as the values repeat later with different sign and order.
def generate_sin_table(n_entries=128):
r = []
for n in range(n_entries):
r += [math.sin(math.pi*n/(n_entries*2))]
# r[n_entries-1]=1 # Make it converge to unit precisely
print(f"static const uint16_t com_fixed_sin_lut[{n_entries}] =", "{", ",\n".join((str(int(a * (1 << 16))) for a in r)), "};\n")
generate_pi()
generate_sin_table()