Rename opcode

This commit is contained in:
kris 2019-01-05 23:51:21 +00:00
parent 36fc34d26d
commit 7deed24ac4
3 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ class State:
class OpcodeCommand(enum.Enum):
OFFSET = 0x00
STORE = 0x00
SET_CONTENT = 0xfb # set new data byte to write
SET_PAGE = 0xfc
RLE = 0xfd
@ -68,8 +68,8 @@ class Opcode:
pass
class Offset(Opcode):
COMMAND = OpcodeCommand.OFFSET
class Store(Opcode):
COMMAND = OpcodeCommand.STORE
_CYCLES = 36
def __init__(self, offset: int):
@ -181,7 +181,7 @@ class Decoder:
op = Terminate()
terminate = True
else:
op = Offset(b)
op = Store(b)
num_content_stores += 1
op.apply(self.state)

View File

@ -33,7 +33,7 @@ class HeuristicPageFirstScheduler(OpcodeScheduler):
# offset, run_length))
yield opcodes.RLE(offset, run_length)
else:
yield opcodes.Offset(offset)
yield opcodes.Store(offset)
#
# def _tsp_opcode_scheduler(self, changes):

View File

@ -70,7 +70,7 @@ class Video:
# Estimate number of opcodes that will end up fitting in the cycle
# budget.
byte_cycles = opcodes.Offset(0).cycles
byte_cycles = opcodes.Store(0).cycles
est_opcodes = int(cycle_budget / fullness / byte_cycles)
# Sort by highest xor weight and take the estimated number of change
@ -110,7 +110,7 @@ class Video:
memmap[page][offset] = (bits_different, src_content, target_content)
it.iternext()
byte_cycles = opcodes.Offset(0).cycles
byte_cycles = opcodes.Store(0).cycles
for page, offsets in memmap.items():
cur_content = None