mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2025-02-22 15:29:06 +00:00
Rename opcode
This commit is contained in:
parent
36fc34d26d
commit
7deed24ac4
@ -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)
|
||||
|
@ -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):
|
||||
|
4
video.py
4
video.py
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user