1.1 --- a/ula.py Thu Dec 08 23:51:47 2011 +0100
1.2 +++ b/ula.py Sat Dec 10 20:23:37 2011 +0100
1.3 @@ -56,7 +56,7 @@
1.4
1.5 # Internal state.
1.6
1.7 - self.buffer = [0] * 8
1.8 + self.buffer = [(0, 0, 0)] * 8
1.9
1.10 def set_mode(self, mode):
1.11
1.12 @@ -75,7 +75,7 @@
1.13 * number of entries in the pixel buffer
1.14 """
1.15
1.16 - self.width, self.depth, rows = self.modes[mode]
1.17 + self.width, self.depth, rows = ULA.modes[mode]
1.18
1.19 row_size = (self.width * self.depth * LINES_PER_ROW) / 8 # bits per row -> bytes per row
1.20
1.21 @@ -206,7 +206,7 @@
1.22
1.23 i = 0
1.24 for colour in decode(byte_value, self.depth):
1.25 - self.buffer[i] = get_physical_colour(self.palette[colour])
1.26 + self.buffer[i] = get_physical_colour(ULA.palette[colour])
1.27 i += 1
1.28
1.29 # Advance to the next column.
1.30 @@ -283,8 +283,8 @@
1.31 if __name__ == "__main__":
1.32 memory = get_memory()
1.33 ula = ULA(memory)
1.34 - ula.set_mode(2)
1.35 - fill(memory, 0x5800 - 320, 0x8000, encode((2, 7), 4))
1.36 + ula.set_mode(6)
1.37 + fill(memory, 0x6000, 0x8000, encode((1, 0, 1, 0, 1, 0, 1, 0), 1))
1.38
1.39 # Make a simple two-dimensional array of tuples (three-dimensional in pygame
1.40 # terminology).