fixed reset to call reset on all IOUnits

git-svn-id: https://mspsim.svn.sourceforge.net/svnroot/mspsim/mspsim@13 23d1a52b-0c3c-0410-b72d-8f29ab48fe35
This commit is contained in:
joxe 2007-10-26 13:02:55 +00:00
parent 97fcbcea73
commit 943af9d98e
2 changed files with 15 additions and 4 deletions

View File

@ -213,10 +213,6 @@ public class MSP430 extends MSP430Core {
running = false;
}
public void reset() {
reg[PC] = memory[0xfffe] + (memory[0xffff] << 8);
}
public int getExecCount(int address) {
if (execCounter != null) {
return execCounter[address];

View File

@ -312,6 +312,20 @@ public class MSP430Core implements MSP430Constants {
}
}
private void resetIOUnits() {
for (int i = 0, n = lastIOUnitPos; i < n; i++) {
ioUnits[i].reset();
}
for (int i = 0, n = passiveIOUnits.length; i < n; i++) {
passiveIOUnits[i].reset();
}
}
public void reset() {
resetIOUnits();
reg[PC] = memory[0xfffe] + (memory[0xffff] << 8);
}
// Indicate that we have an interrupt now!
// We should only get same IOUnit for same interrupt level
public void flagInterrupt(int interrupt, IOUnit source, boolean triggerIR) {
@ -920,4 +934,5 @@ public class MSP430Core implements MSP430Constants {
writeRegister(SR, sr);
}
}
}