Skip to content

SetPC() not doing what i expect #25

Answered by dirkwhoffmann
RR7 asked this question in Q&A
Discussion options

You must be logged in to vote

The issue is the prefetch queue, as you've already pointed out. To redirect program execution, Moira has a separate function inside the debugger (see MoiraDebugger.h):

    //
    // Changing state
    //

    // Continues program execution at the specified address
    void jump(u32 addr);

The function first sets the PC and updates the prefetch queue afterward:

void
Debugger::jump(u32 addr)
{
    moira.reg.pc = addr & ~1;
    moira.fullPrefetch<C68000, POLL>();
}

jump is a public function, so you can call it via moira.debugger.jump(<addr>).

Your project sounds interesting. I'd like to see Moira inside an ST emulator someday.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RR7
Comment options

@mithrendal
Comment options

@RR7
Comment options

Answer selected by RR7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants