mirror of
https://github.com/jtauber/applepy.git
synced 2024-11-23 10:31:02 +00:00
in mixed mode, assume monitor is colour
This commit is contained in:
parent
38736cf243
commit
2f71ca9029
18
applepy.py
18
applepy.py
@ -103,18 +103,21 @@ class Display:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.screen = pygame.display.set_mode((560, 384))
|
self.screen = pygame.display.set_mode((560, 384))
|
||||||
pygame.display.set_caption("ApplePy")
|
pygame.display.set_caption("ApplePy")
|
||||||
|
self.mix = False
|
||||||
|
|
||||||
def txtclr(self):
|
def txtclr(self):
|
||||||
self.text = False
|
self.text = False
|
||||||
|
|
||||||
def txtset(self):
|
def txtset(self):
|
||||||
self.text = True
|
self.text = True
|
||||||
|
self.colour = False
|
||||||
|
|
||||||
def mixclr(self):
|
def mixclr(self):
|
||||||
self.mix = False
|
self.mix = False
|
||||||
|
|
||||||
def mixset(self):
|
def mixset(self):
|
||||||
self.mix = True
|
self.mix = True
|
||||||
|
self.colour = True
|
||||||
|
|
||||||
def lowscr(self):
|
def lowscr(self):
|
||||||
self.page = 1
|
self.page = 1
|
||||||
@ -150,15 +153,14 @@ class Display:
|
|||||||
if self.text or not self.mix or not row < 20:
|
if self.text or not self.mix or not row < 20:
|
||||||
mode, ch = divmod(value, 0x40)
|
mode, ch = divmod(value, 0x40)
|
||||||
|
|
||||||
if mode == 0: # inverse
|
if self.colour:
|
||||||
on = (0, 0, 0)
|
on = (255, 255, 255)
|
||||||
off = (0, 200, 0)
|
else:
|
||||||
elif mode == 1: # flash
|
|
||||||
on = (0, 0, 0)
|
|
||||||
off = (0, 200, 0)
|
|
||||||
else: # normal
|
|
||||||
on = (0, 200, 0)
|
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):
|
for line in range(8):
|
||||||
b = self.characters[ch][line] << 1
|
b = self.characters[ch][line] << 1
|
||||||
|
Loading…
Reference in New Issue
Block a user