MCPcopy Index your code
hub / github.com/fogleman/nes / read16bug

Method read16bug

nes/cpu.go:320–326  ·  view source on GitHub ↗

read16bug emulates a 6502 bug that caused the low byte to wrap without incrementing the high byte

(address uint16)

Source from the content-addressed store, hash-verified

318// read16bug emulates a 6502 bug that caused the low byte to wrap without
319// incrementing the high byte
320func (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
329func (cpu *CPU) push(value byte) {

Callers 1

StepMethod · 0.95

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected