1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-06-06 20:29:34 +00:00
py65/py65/utils/devices.py
Mike Naberezny 8f284a8e58 PEP8
2012-11-19 14:37:37 -08:00

14 lines
469 B
Python

def make_instruction_decorator(instruct, disasm, allcycles, allextras):
def instruction(name, mode, cycles, extracycles=0):
def decorate(f):
opcode = int(f.__name__.split('_')[-1], 16)
instruct[opcode] = f
disasm[opcode] = (name, mode)
allcycles[opcode] = cycles
allextras[opcode] = extracycles
return f # Return the original function
return decorate
return instruction