1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Working on getting display running

This commit is contained in:
Ross Wilson
2015-06-18 16:15:10 +07:00
parent bf23cc2af9
commit fd10322acc
3 changed files with 15 additions and 9 deletions

View File

@@ -148,15 +148,21 @@ class Display(_BufferedCanvas):
self.OnSize()
def draw(self, sd, x1, y1, x2, y2):
def draw(self, x1, y1, x2, y2, dotted=False):
"""Draw a line on the screen.
sd True if solid line, False if dotted
x1, y1 start coordinates
x2, y2 end coordinates
dotted True if dotted line, else False
"""
self.drawlist.append((sd, x1, y1, x2, y2))
self.drawlist.append((x1, y1, x2, y2, dotted))
self.Update()
def clear(self):
"""Clear the display."""
self.drawlist = []
self.Update()
def Draw(self, dc):
@@ -167,8 +173,8 @@ class Display(_BufferedCanvas):
pen = wx.Pen(self.DrawColour)
for (sd, x1, y1, x2, y2) in self.drawlist:
if sd:
for (x1, y1, x2, y2, dotted) in self.drawlist:
if not dotted:
pen.SetStyle(wx.SOLID)
pen.SetWidth(2)
else:

View File

@@ -72,7 +72,7 @@ def doDEIMByte(byte):
else:
DY += (byte & 0x03)
if byte & 0x40:
display.draw(0, prevDX, prevDY, DX, DY)
display.draw(prevDX, prevDY, DX, DY)
else: # micro instructions
if byte & 0x40:
Mode = MODE_NORMAL
@@ -250,7 +250,7 @@ def i_DLVH(word1):
else:
DY += N
display.draw(dotted, prevDX, prevDY, DX, DY)
display.draw(prevDX, prevDY, DX, DY, dotted)
Trace.dtrace('DLVH')
return 3

View File

@@ -55,8 +55,8 @@ class TestFrame(wx.Frame):
self.Refresh()
self.display.draw(True, 0, 0, 2047, 2047)
self.display.draw(False, 2047, 0, 0, 2047)
self.display.draw(0, 0, 2047, 2047)
self.display.draw(2047, 0, 0, 2047, dotted=True)
def OnSize(self, event):
"""Maintain square window."""