1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-06-10 02:29:29 +00:00

Add workaround for encoding errors in $F001 handler. Closes #29

This commit is contained in:
Mike Naberezny 2015-02-09 23:09:05 -08:00
parent a88b2d8b24
commit 993d542cbf
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,9 @@
0.23-dev (Next Release)
- Added a workaround to $F001 output to catch encoding errors and
display a "?" instead of crashing. This condition can occur if
the 6502 program sends bytes to $F001 that aren't compatible with
the terminal's character encoding.
0.22 (2015-02-09)

View File

@ -202,7 +202,10 @@ class Monitor(cmd.Cmd):
def _install_mpu_observers(self):
def putc(address, value):
self.stdout.write(chr(value))
try:
self.stdout.write(chr(value))
except UnicodeEncodeError: # Python 3
self.stdout.write("?")
self.stdout.flush()
def getc(address):