| 152 | } |
| 153 | |
| 154 | type CPU struct { |
| 155 | Memory // memory interface |
| 156 | Cycles uint64 // number of cycles |
| 157 | PC uint16 // program counter |
| 158 | SP byte // stack pointer |
| 159 | A byte // accumulator |
| 160 | X byte // x register |
| 161 | Y byte // y register |
| 162 | C byte // carry flag |
| 163 | Z byte // zero flag |
| 164 | I byte // interrupt disable flag |
| 165 | D byte // decimal mode flag |
| 166 | B byte // break command flag |
| 167 | U byte // unused flag |
| 168 | V byte // overflow flag |
| 169 | N byte // negative flag |
| 170 | interrupt byte // interrupt type to perform |
| 171 | stall int // number of cycles to stall |
| 172 | table [256]func(*stepInfo) |
| 173 | } |
| 174 | |
| 175 | func NewCPU(console *Console) *CPU { |
| 176 | cpu := CPU{Memory: NewCPUMemory(console)} |
nothing calls this directly
no outgoing calls
no test coverage detected