mirror of
https://github.com/jtauber/applepy.git
synced 2024-11-22 19:30:54 +00:00
in mixed mode, assume monitor is colour
This commit is contained in:
parent
38736cf243
commit
2f71ca9029
16
applepy.py
16
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,16 +153,15 @@ 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)
|
||||
|
||||
if mode == 0 or mode == 1:
|
||||
on, off = off, on
|
||||
|
||||
for line in range(8):
|
||||
b = self.characters[ch][line] << 1
|
||||
for i in range(7):
|
||||
|
Loading…
Reference in New Issue
Block a user