gameboy superoptimizer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

24 lines
450 B

from gbso.insn import *
from gbso.optimize import optimize
from gbso.program import Program
from gbso.regs import R8, R16
rLCDC = 0xFF40
rIE = 0xFFFF
IEF_VBLANK = 1 << 0
prgm = Program(
outputs=set([R8.A]),
insns=[
LD_RR_NN(R16.HL, rLCDC),
RES_N_HL(7),
RES_N_HL(2),
LD_RR_NN(R16.HL, rIE),
LD_HL_N(IEF_VBLANK),
],
)
prgm_opt = optimize(prgm)
for insn in prgm_opt.insns:
print(insn.pretty())