read16bug emulates a 6502 bug that caused the low byte to wrap without incrementing the high byte
(address uint16)
| 318 | // read16bug emulates a 6502 bug that caused the low byte to wrap without |
| 319 | // incrementing the high byte |
| 320 | func (cpu *CPU) read16bug(address uint16) uint16 { |
| 321 | a := address |
| 322 | b := (a & 0xFF00) | uint16(byte(a)+1) |
| 323 | lo := cpu.Read(a) |
| 324 | hi := cpu.Read(b) |
| 325 | return uint16(hi)<<8 | uint16(lo) |
| 326 | } |
| 327 | |
| 328 | // push pushes a byte onto the stack |
| 329 | func (cpu *CPU) push(value byte) { |