Beispiel #1
0
void CPU::ExecuteOneInstruction()
{
	switch (current_state_)
	{
	case State::Running:
		previous_pc_ = registers_.pc;
		ExecuteInstruction(FetchByte());
		break;
	case State::Halted:
		// NOP instructions are executed until Halted state ends
		NotifyMachineCycleLapse();
		break;
	case State::HaltBug:
		// PC increment is skipped once when fetching the next opcode (no extra cycles are lapsed)
		current_state_ = State::Running;
		previous_pc_ = registers_.pc;
		ExecuteInstruction(mmu_->ReadByte(registers_.pc));
		break;
	case State::Stopped:
		//TODO check for joypad input, since that is the only thing that can finish Stopped state
		return;
	}

	CheckInterrupts();
}
Beispiel #2
0
void Debugger::Run() {
  pc_modified_ = false;
  while (pc_ != kEndOfSimAddress) {
    if (pending_request()) RunDebuggerShell();
    ExecuteInstruction();
  }
}
Beispiel #3
0
void Step()
{
    DSPCore_CheckExceptions();

    g_dsp.step_counter++;

#if PROFILE
    g_dsp.err_pc = g_dsp.pc;

    ProfilerAddDelta(g_dsp.err_pc, 1);
    if (g_dsp.step_counter == 1)
    {
        ProfilerInit();
    }

    if ((g_dsp.step_counter & 0xFFFFF) == 0)
    {
        ProfilerDump(g_dsp.step_counter);
    }
#endif

    u16 opc = dsp_fetch_code();
    ExecuteInstruction(UDSPInstruction(opc));

    if (DSPAnalyzer::code_flags[g_dsp.pc - 1] & DSPAnalyzer::CODE_LOOP_END)
        HandleLoop();
}
Beispiel #4
0
void GBStackBrain::ThinkOne(GBRobot * robot, GBWorld * world) {
	GBStackInstruction ins = spec->ReadInstruction(pc++);
	remaining --; // currently all instructions take one cycle
	used ++;
	ExecuteInstruction(ins, robot, world);
}
Beispiel #5
0
GekkoF GekkoCPU::execStep()
{
	ExecuteInstruction();
}