From 440fb57990922ddc4a7700c0144e4911be43ed3d Mon Sep 17 00:00:00 2001 From: Ross Wilson Date: Thu, 21 Jan 2016 20:55:55 +0700 Subject: [PATCH] Working towards a runnable Imlac --- pymlac/Display.py | 32 ++--- pymlac/Imlac.py | 289 ++++++++++++++++++++++++++++++++++++++++------ pymlac/MainCPU.py | 5 + pymlac/Memory.py | 46 +++++--- 4 files changed, 304 insertions(+), 68 deletions(-) diff --git a/pymlac/Display.py b/pymlac/Display.py index 89f52a1..f07502e 100644 --- a/pymlac/Display.py +++ b/pymlac/Display.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python # -*- coding: utf-8 -*- """ @@ -39,11 +39,11 @@ class _BufferedCanvas(wx.Panel): # The backing buffer buffer = None - # max coordinates of scaled display - ScaleMaxX = 2048 - ScaleMaxY = 2048 -# ScaleMaxX = 512 -# ScaleMaxY = 512 + # max coordinates of scaled display + ScaleMaxX = 2048 + ScaleMaxY = 2048 +# ScaleMaxX = 512 +# ScaleMaxY = 512 def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_FULL_REPAINT_ON_RESIZE): @@ -133,18 +133,18 @@ class Display(_BufferedCanvas): SYNC_HZ = 40 SYNC_40HZ_CYCLE_COUNT = int(CYCLES_PER_SECOND / SYNC_HZ) - # max coordinates of pymlac display -# ScaleMaxX = 2048 -# ScaleMaxY = 2048 - ScaleMaxX = 1024 - ScaleMaxY = 1024 + # max coordinates of pymlac display +# ScaleMaxX = 2048 +# ScaleMaxY = 2048 + ScaleMaxX = 1024 + ScaleMaxY = 1024 def __init__(self, parent, **kwargs): - # create and initialise the base panel - _BufferedCanvas.__init__(self, parent=parent, **kwargs) - self.SetBackgroundColour(self.BackgroundColour) - + # create and initialise the base panel + _BufferedCanvas.__init__(self, parent=parent, **kwargs) + self.SetBackgroundColour(self.BackgroundColour) + # set internal state self.running = 0 self.cycle_count = 0 @@ -187,7 +187,7 @@ class Display(_BufferedCanvas): pen.SetStyle(wx.DOT) pen.SetWidth(2) dc.SetPen(pen) - + dc.DrawLine(x1, self.ScaleMaxY - y1, x2, self.ScaleMaxY - y2) diff --git a/pymlac/Imlac.py b/pymlac/Imlac.py index e7ee268..0c8d243 100644 --- a/pymlac/Imlac.py +++ b/pymlac/Imlac.py @@ -1,24 +1,54 @@ -#!/usr/bin/python +#!/usr/bin/env python +# -*- coding: utf-8 -*- """ -The Imlac emulation object. +A simulator for an Imlac PDS-1 or PDS-4. + +Usage: pymlac [