get sure decode doesnt break

This commit is contained in:
Chrys 2019-11-04 22:52:38 +01:00
parent 6761b6267c
commit f04d8584d9

View File

@ -287,29 +287,37 @@ class driver(screenDriver):
lineAttrib.append(charAttrib) lineAttrib.append(charAttrib)
lineText += ' ' lineText += ' '
continue continue
(sh,) = unpack("=H", data)
attr = (sh >> 8) & 0xFF
ch = sh & 0xFF
if self.hichar == 0x100:
attr >>= 1
ink = attr & 0x0F
paper = (attr>>4) & 0x0F
blink = 0
if attr & 1:
blink = 1
# blink seems to be set always, ignore for now
blink = 0 blink = 0
bold = 0 bold = 0
if attr & 16: ink = 7
bold = 1 paper = 0
#if (ink != 7) or (paper != 0): ch = 32
# print(ink,paper) try:
if sh & self.hichar: (sh,) = unpack("=H", data)
ch |= 0x100 attr = (sh >> 8) & 0xFF
ch = sh & 0xFF
if self.hichar == 0x100:
attr >>= 1
ink = attr & 0x0F
paper = (attr>>4) & 0x0F
if attr & 1:
blink = 1
# blink seems to be set always, ignore for now
blink = 0
bold = 0
if attr & 16:
bold = 1
#if (ink != 7) or (paper != 0):
# print(ink,paper)
if sh & self.hichar:
ch |= 0x100
except:
pass
try: try:
lineText += self.charmap[ch] lineText += self.charmap[ch]
except KeyError: except KeyError:
lineText += '?' lineText += '?'
charAttrib = [ charAttrib = [
self.fgColorValues[ink], self.fgColorValues[ink],
self.bgColorValues[paper], self.bgColorValues[paper],