1.1 --- a/ula.py Sat Dec 10 20:24:20 2011 +0100
1.2 +++ b/ula.py Sat Dec 10 20:58:56 2011 +0100
1.3 @@ -218,6 +218,11 @@
1.4 if self.address >= SCREEN_LIMIT:
1.5 self.address -= self.screen_size
1.6
1.7 + # Convenience methods.
1.8 +
1.9 + def fill(self, start, end, value):
1.10 + fill(self.memory, start, end, value)
1.11 +
1.12 def get_physical_colour(value):
1.13
1.14 """
1.15 @@ -270,6 +275,12 @@
1.16
1.17 return result
1.18
1.19 +def get_ula():
1.20 +
1.21 + "Return a ULA initialised with a memory array."
1.22 +
1.23 + return ULA(get_memory())
1.24 +
1.25 def get_memory():
1.26
1.27 "Return an array representing the computer's memory."
1.28 @@ -300,10 +311,9 @@
1.29 # NOTE: Running this will actually cause an IndexError.
1.30
1.31 if __name__ == "__main__":
1.32 - memory = get_memory()
1.33 - ula = ULA(memory)
1.34 + ula = get_ula()
1.35 ula.set_mode(6)
1.36 - fill(memory, 0x6000, 0x8000, encode((1, 0, 1, 0, 1, 0, 1, 0), 1))
1.37 + ula.fill(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).