Skip to content

Commit

Permalink
added reset() to cpu (incomplete, only zeros the registers)
Browse files Browse the repository at this point in the history
  • Loading branch information
sztomi committed May 1, 2011
1 parent 1cfb1a8 commit 729fd17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mipscpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ namespace tememu
REG_OP_FUNC(op_mtlo, 0x13 << 4);
}

void MipsCPU::reset()
{
for ( int i = 0; i < gpr_count; ++i ) _GPR[i] = 0;
for ( int i = 0; i < fpr_count; ++i ) _FPR[i] = 0;
for ( int i = 0; i < fcr_count; ++i ) _FCR[i] = 0;
}

/**
* @brief Extracts the internal opcode for the function and dispatches the call.
*
Expand Down
1 change: 1 addition & 0 deletions src/mipscpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ namespace tememu
void loadProgram(boost::shared_ptr< std::vector<int32> >);
void stepProgram(int numSteps = 1);
void runProgram();
void reset();
int32 gprValue(int index) const { return _GPR[index]; }
int32 hi() const { return _HI; }
int32 lo() const { return _LO; }
Expand Down

0 comments on commit 729fd17

Please sign in to comment.