diff --git a/others/planck.py b/others/planck.py index 7c79973..5c03404 100644 --- a/others/planck.py +++ b/others/planck.py @@ -6,9 +6,9 @@ import os import sys import operator -import array import ctypes import platform +from struct import pack, unpack RUNTIME_NAME = "Python {}".format(platform.python_version()) COPYRIGHT = "Copyright (c) 2021 Koichi Nakamura " @@ -38,11 +38,14 @@ def aligned(n): def align(): write(HERE_CELL, aligned(read(HERE_CELL))) -def read(addr, signed=False): - return int.from_bytes(memory[addr:addr+CELL], 'little', signed=signed) +def readi(addr): + return unpack('