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.
 

21 lines
556 B

from collections import defaultdict
from dataclasses import dataclass, field
from typing import Dict
from gbso.cpu.regs import R8
@dataclass
class CPUState:
carry: int = 0
sp: int = 0
reg8: Dict[R8, int] = field(default_factory=lambda: defaultdict(lambda: 0))
memory: Dict[int, int] = field(default_factory=lambda: defaultdict(lambda: 0))
def copy(self) -> "CPUState":
return CPUState(
carry=self.carry,
sp=self.sp,
reg8=self.reg8.copy(),
memory=self.memory.copy(),
)