From e47730e131589e7910b52ddc8f7409650104e017 Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Sun, 25 Jul 2021 11:50:35 +0200 Subject: [PATCH] Change PC externally --- core6502/execute.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core6502/execute.go b/core6502/execute.go index bc3af83..2ecc5ac 100644 --- a/core6502/execute.go +++ b/core6502/execute.go @@ -145,6 +145,11 @@ func (s *State) SetAXYP(regA uint8, regX uint8, regY uint8, regP uint8) { s.reg.setP(regP) } +// SetPC changes the program counter, as a JMP instruction +func (s *State) SetPC(pc uint16) { + s.reg.setPC(pc) +} + // Save saves the CPU state (registers and cycle counter) func (s *State) Save(w io.Writer) error { err := binary.Write(w, binary.BigEndian, s.cycles)