Added printing signed integers

This commit is contained in:
Kyler 2024-02-24 23:45:03 -07:00
parent 8aaff235cd
commit 4ebf74a04d
1 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,12 @@ from .emulator import Device
class tty(Device):
def __setitem__(self, index: int, value: int):
if index & 0xf == 0xe:
if index & 0xf == 0xd:
if value & 0x800:
print(((~(value & 0x7FF)) + 1) * -1)
else:
print(value)
elif index & 0xf == 0xe:
print(value)
elif index & 0xf == 0xf:
print(chr(value), end='')