sync WIP
This commit is contained in:
parent
7dbbeecc41
commit
418a12a93e
@ -5,7 +5,9 @@ import struct
|
|||||||
import errno
|
import errno
|
||||||
import sys
|
import sys
|
||||||
charmap = {}
|
charmap = {}
|
||||||
|
hichar = None
|
||||||
def updateCharMap(screen):
|
def updateCharMap(screen):
|
||||||
|
global hichar
|
||||||
ttyno = '4'
|
ttyno = '4'
|
||||||
tty = open('/dev/tty' + screen, 'rb')
|
tty = open('/dev/tty' + screen, 'rb')
|
||||||
GIO_UNIMAP = 0x4B66
|
GIO_UNIMAP = 0x4B66
|
||||||
@ -33,7 +35,7 @@ def updateCharMap(screen):
|
|||||||
charmap[b] = chr(u)
|
charmap[b] = chr(u)
|
||||||
|
|
||||||
|
|
||||||
def autoDecodeVCSA(allData):
|
def autoDecodeVCSA(allData, rows, cols):
|
||||||
allText = []
|
allText = []
|
||||||
allAttrib = []
|
allAttrib = []
|
||||||
for y in range(rows):
|
for y in range(rows):
|
||||||
@ -61,8 +63,8 @@ def autoDecodeVCSA(allData):
|
|||||||
paper = (attr>>4) & 0x0F
|
paper = (attr>>4) & 0x0F
|
||||||
#if (ink != 7) or (paper != 0):
|
#if (ink != 7) or (paper != 0):
|
||||||
# print(ink,paper)
|
# print(ink,paper)
|
||||||
if sh & hichar:
|
#if sh & hichar:
|
||||||
ch |= 0x100
|
# ch |= 0x100
|
||||||
try:
|
try:
|
||||||
lineText += charmap[ch]
|
lineText += charmap[ch]
|
||||||
except:
|
except:
|
||||||
@ -79,6 +81,6 @@ def m():
|
|||||||
head = vcsa.read(4)
|
head = vcsa.read(4)
|
||||||
rows = int(head[0])
|
rows = int(head[0])
|
||||||
cols = int(head[1])
|
cols = int(head[1])
|
||||||
text, attrib = autoDecodeVCSA(vcsa.read())
|
text, attrib = autoDecodeVCSA(vcsa.read(), rows, cols)
|
||||||
print(time.time() -s )
|
print(time.time() -s )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user