Read16 reads two bytes using Read to return a double-word value
(address uint16)
| 310 | |
| 311 | // Read16 reads two bytes using Read to return a double-word value |
| 312 | func (cpu *CPU) Read16(address uint16) uint16 { |
| 313 | lo := uint16(cpu.Read(address)) |
| 314 | hi := uint16(cpu.Read(address + 1)) |
| 315 | return hi<<8 | lo |
| 316 | } |
| 317 | |
| 318 | // read16bug emulates a 6502 bug that caused the low byte to wrap without |
| 319 | // incrementing the high byte |