1.1 --- a/main.py Sun Dec 18 18:55:01 2011 +0100
1.2 +++ b/main.py Sun Dec 18 19:29:20 2011 +0100
1.3 @@ -19,15 +19,16 @@
1.4 """
1.5
1.6 surface = pygame.Surface((MAX_WIDTH, MAX_HEIGHT), 0, screen)
1.7 - a = pygame.surfarray.pixels3d(surface)
1.8 + sa = pygame.surfarray.pixels3d(surface)
1.9 + a = sa.transpose(1, 0, 2)
1.10
1.11 # Copy the array to a surface and apply a pixel intensity.
1.12
1.13 try:
1.14 - a[:] = screen_array
1.15 + a.flat[:] = screen_array
1.16 a *= INTENSITY
1.17 finally:
1.18 - del a
1.19 + del a, sa
1.20
1.21 # Scale the surface to the dimensions of the host's screen and copy the
1.22 # result to the host's screen.
1.23 @@ -46,7 +47,6 @@
1.24 screen = pygame.display.set_mode((WIDTH, HEIGHT), 0)
1.25
1.26 ula = get_ula()
1.27 - ula_screen = get_screen()
1.28
1.29 # Test MODE 2.
1.30
1.31 @@ -54,12 +54,12 @@
1.32
1.33 ula.fill(0x3000, 0x5800 - 320, encode((1, 6), 4))
1.34 ula.fill(0x5800 - 320, 0x8000, encode((2, 7), 4))
1.35 - update(ula_screen, ula)
1.36 + ula_screen = update(ula)
1.37 update_screen(screen, ula_screen)
1.38 mainloop()
1.39
1.40 ula.screen_start = 0x3000 + 2
1.41 - update(ula_screen, ula)
1.42 + ula_screen = update(ula)
1.43 update_screen(screen, ula_screen)
1.44 mainloop()
1.45
1.46 @@ -69,12 +69,12 @@
1.47
1.48 ula.fill(0x6000, 0x6f00 + 160, encode((1, 0, 1, 1, 0, 0, 1, 1), 1))
1.49 ula.fill(0x6f00 + 160, 0x7f40, encode((1, 0, 1, 0, 1, 0, 1, 0), 1))
1.50 - update(ula_screen, ula)
1.51 + ula_screen = update(ula)
1.52 update_screen(screen, ula_screen)
1.53 mainloop()
1.54
1.55 ula.screen_start = 0x6f00 + 160
1.56 - update(ula_screen, ula)
1.57 + ula_screen = update(ula)
1.58 update_screen(screen, ula_screen)
1.59 mainloop()
1.60