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

PTR bootloader error: 0107 AND+DAC bad

This commit is contained in:
Ross Wilson
2015-07-19 19:56:48 +07:00
parent 0c76335047
commit 5413bb3afd
4 changed files with 24 additions and 21 deletions

View File

@@ -60,6 +60,7 @@ class DisplayCPU(object):
return result
def doDEIMByte(self, byte):
print('doDEIMByte')
if byte & 0x80: # increment?
prevDX = self.DX
prevDY = self.DY

View File

@@ -83,6 +83,7 @@ class Ptr(object):
def read(self):
"""Read papertape value."""
print('Ptr: value=%04o' % self.value)
return self.value
def eof(self):

View File

@@ -6,8 +6,8 @@ Emulate the Input TTY device (TTYIN).
from Globals import *
import log
log = log.Log('test_TTYIN.log', log.Log.DEBUG)
#import log
#log = log.Log('test_TTYIN.log', log.Log.DEBUG)
class TtyIn(object):
@@ -22,7 +22,7 @@ class TtyIn(object):
def __init__(self):
"""Initialize the TTYIN device."""
log('TTYIN: Initializing device')
# log('TTYIN: Initializing device')
self.filename = None
self.open_file = None
@@ -31,12 +31,12 @@ class TtyIn(object):
self.cycle_count = 0
self.status = self.DEVICE_NOT_READY
log('TTYIN: DEVICE_READY_CYCLES=%d' % self.DEVICE_READY_CYCLES)
# log('TTYIN: DEVICE_READY_CYCLES=%d' % self.DEVICE_READY_CYCLES)
def mount(self, fname):
"""Mount a file on the TTYIN device."""
log('TTYIN: Mounting file %s on device' % fname)
# log('TTYIN: Mounting file %s on device' % fname)
self.filename = fname
self.open_file = open(fname, 'r')
@@ -49,13 +49,13 @@ class TtyIn(object):
self.atEOF = True
self.cycle_count = 0
self.value = 0
log('TTYIN: EOF set on device (file %s)' % self.fname)
# log('TTYIN: EOF set on device (file %s)' % self.fname)
self.value = ord(self.value)
def dismount(self):
"""Dismount the file on the TTYIN device."""
log('TTYIN: Dismounting file %s' % self.filename)
# log('TTYIN: Dismounting file %s' % self.filename)
if self.open_file:
self.open_file.close()
@@ -68,21 +68,21 @@ class TtyIn(object):
def read(self):
"""Return the current device value."""
log('TTYIN: Reading device, value is %03o' % self.value)
# log('TTYIN: Reading device, value is %03o' % self.value)
return self.value
def ready(self):
"""Return device status."""
log("TTYIN: Device 'ready' status is %s" % str(self.status == self.DEVICE_READY))
# log("TTYIN: Device 'ready' status is %s" % str(self.status == self.DEVICE_READY))
return (self.status == self.DEVICE_READY)
def clear(self):
"""Clear the device 'ready' status."""
log("TTYIN: Clearing device 'ready' status")
# log("TTYIN: Clearing device 'ready' status")
self.status = self.DEVICE_NOT_READY
@@ -90,8 +90,8 @@ class TtyIn(object):
"""Advance the device state by 'cycles' number of CPU cycles."""
if not self.atEOF:
log("TTYIN: Doing 'tick' cycle=%d, .atEOF=%s, .cycle_count=%d"
% (cycles, str(self.atEOF), self.cycle_count))
# log("TTYIN: Doing 'tick' cycle=%d, .atEOF=%s, .cycle_count=%d"
# % (cycles, str(self.atEOF), self.cycle_count))
self.cycle_count -= cycles
if self.cycle_count <= 0:
self.cycle_count += self.DEVICE_READY_CYCLES
@@ -103,8 +103,8 @@ class TtyIn(object):
self.value = chr(0)
self.cycle_count = 0
self.status = self.DEVICE_NOT_READY
log('TTYIN: EOF set on device (file %s)' % self.filename)
else:
log('TTYIN: .cycle_count expired, new character is %s (%03o)'
% (self.value, ord(self.value[0])))
# log('TTYIN: EOF set on device (file %s)' % self.filename)
# else:
# log('TTYIN: .cycle_count expired, new character is %s (%03o)'
# % (self.value, ord(self.value[0])))
self.value = ord(self.value)

View File

@@ -14,6 +14,8 @@ from Globals import *
import Memory
import Ptr
import Ptp
import TtyIn
import TtyOut
import Kbd
import MainCPU
import Display
@@ -326,8 +328,8 @@ class PymlacFrame(wx.Frame):
# consruct the Imlac machine
self.ptr = Ptr.Ptr()
self.ptp = Ptp.Ptp()
self.ttyin = None
self.ttyout = None
self.ttyin = TtyIn.TtyIn()
self.ttyout = TtyOut.TtyOut()
self.kbd = Kbd.Kbd()
self.memory = Memory.Memory()
self.display = Display.Display(self.panel)
@@ -350,9 +352,6 @@ class PymlacFrame(wx.Frame):
self.Refresh()
self.display.draw(0, 0, 2047, 2047)
self.display.draw(2047, 0, 0, 2047, dotted=True)
# start running
self.run_machine()
@@ -460,6 +459,8 @@ class PymlacFrame(wx.Frame):
else:
abort('Invalid internal operation: %s' % operation)
self.memory.savecore('after_%s.core' % operation)
# Imlac.close(CORE_FILENAME)