From 2f71ca90294bbf904d8f723c74031481a5062b6d Mon Sep 17 00:00:00 2001 From: James Tauber Date: Sat, 13 Aug 2011 07:22:10 -0400 Subject: [PATCH] in mixed mode, assume monitor is colour --- applepy.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/applepy.py b/applepy.py index ff57ee8..24a207b 100644 --- a/applepy.py +++ b/applepy.py @@ -103,18 +103,21 @@ class Display: def __init__(self): self.screen = pygame.display.set_mode((560, 384)) pygame.display.set_caption("ApplePy") + self.mix = False def txtclr(self): self.text = False def txtset(self): self.text = True + self.colour = False def mixclr(self): self.mix = False def mixset(self): self.mix = True + self.colour = True def lowscr(self): self.page = 1 @@ -150,15 +153,14 @@ class Display: if self.text or not self.mix or not row < 20: mode, ch = divmod(value, 0x40) - if mode == 0: # inverse - on = (0, 0, 0) - off = (0, 200, 0) - elif mode == 1: # flash - on = (0, 0, 0) - off = (0, 200, 0) - else: # normal + if self.colour: + on = (255, 255, 255) + else: on = (0, 200, 0) - off = (0, 0, 0) + off = (0, 0, 0) + + if mode == 0 or mode == 1: + on, off = off, on for line in range(8): b = self.characters[ch][line] << 1