39
39
]
40
40
41
41
42
- TABLE = None # Table of bytes to tuple of binaries
42
+ TABLE : list [ list [ int ]] = [] # Table of bytes to tuple of binaries
43
43
44
44
45
- def to_bin (x : int ):
45
+ def to_bin (x : int ) -> list [ int ] :
46
46
result = []
47
47
48
48
for i in range (8 ):
@@ -52,7 +52,7 @@ def to_bin(x: int):
52
52
return result
53
53
54
54
55
- def get_attr (data : list [int ], offset ) -> int :
55
+ def get_attr (data : list [int ], offset : int ) -> int :
56
56
"""For a given offset in the drawing region, return the attribute.
57
57
This is a bit tricky for the speccy as the screen memory is not linear
58
58
"""
@@ -72,12 +72,11 @@ def get_xy_coord(offset: int) -> tuple[int, int]:
72
72
return x * SCALE , y * SCALE
73
73
74
74
75
- def plot_byte (screen , data : list [int ], offset : int ):
75
+ def plot_byte (screen : pygame . Surface , data : list [int ], offset : int ) -> None :
76
76
"""Draws a pixel at the given X, Y coordinate"""
77
77
global TABLE
78
78
79
- # FIXME
80
- byte_ = TABLE [data [offset ]] # type: ignore[index]
79
+ byte_ = TABLE [data [offset ]]
81
80
attr = get_attr (data , offset )
82
81
83
82
ink_ = attr & 0x7
@@ -94,7 +93,7 @@ def plot_byte(screen, data: list[int], offset: int):
94
93
screen .fill (palette [bit_ ], pygame .Rect (x0 + x * SCALE , y0 , SCALE , SCALE ))
95
94
96
95
97
- def paint (data : list [int ]):
96
+ def paint (data : list [int ]) -> None :
98
97
src .arch .z80 .optimizer .main .init ()
99
98
screen = pygame .display .set_mode ([WIDTH * SCALE , HEIGHT * SCALE ])
100
99
0 commit comments