1.1 --- a/ula.py Wed Dec 07 00:38:52 2011 +0100
1.2 +++ b/ula.py Thu Dec 08 23:37:29 2011 +0100
1.3 @@ -4,10 +4,6 @@
1.4 Acorn Electron ULA simulation.
1.5 """
1.6
1.7 -import pygame
1.8 -import array
1.9 -import itertools
1.10 -
1.11 WIDTH = 640
1.12 HEIGHT = 512
1.13 INTENSITY = 255
1.14 @@ -275,46 +271,4 @@
1.15 for i in xrange(start, end):
1.16 memory[i] = value
1.17
1.18 -def mainloop():
1.19 - while 1:
1.20 - pygame.display.flip()
1.21 - event = pygame.event.wait()
1.22 - if event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
1.23 - break
1.24 -
1.25 -if __name__ == "__main__":
1.26 - pygame.init()
1.27 - screen = pygame.display.set_mode((WIDTH, HEIGHT), 0)
1.28 -
1.29 - memory = array.array("B", itertools.repeat(0, MAX_MEMORY))
1.30 - a = pygame.surfarray.pixels3d(screen)
1.31 -
1.32 - ula = ULA(memory)
1.33 -
1.34 - # Test MODE 2.
1.35 -
1.36 - ula.set_mode(2)
1.37 -
1.38 - fill(memory, 0x3000, 0x5800 - 320, encode((1, 6), 4))
1.39 - fill(memory, 0x5800 - 320, 0x8000, encode((2, 7), 4))
1.40 - update(a, ula)
1.41 - mainloop()
1.42 -
1.43 - ula.screen_start = 0x3000 + 2
1.44 - update(a, ula)
1.45 - mainloop()
1.46 -
1.47 - # Test MODE 6.
1.48 -
1.49 - ula.set_mode(6)
1.50 -
1.51 - fill(memory, 0x6000, 0x6f00 + 160, encode((1, 0, 1, 1, 0, 0, 1, 1), 1))
1.52 - fill(memory, 0x6f00 + 160, 0x7f40, encode((1, 0, 1, 0, 1, 0, 1, 0), 1))
1.53 - update(a, ula)
1.54 - mainloop()
1.55 -
1.56 - ula.screen_start = 0x6f00 + 160
1.57 - update(a, ula)
1.58 - mainloop()
1.59 -
1.60 # vim: tabstop=4 expandtab shiftwidth=4