Skip to content

Commit d19fc60

Browse files
committed
fix interrupt
1 parent c0462c1 commit d19fc60

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

emulator/src/Chipset/Chipset.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ namespace casioemu {
9999

100100
cpu.Reset();
101101

102+
for (size_t ix = 0; ix < INT_COUNT; ix++) interrupts_active[ix] = false;
102103
interrupts_active[INT_RESET] = true;
103104
pending_interrupt_count = 1;
104105

@@ -193,16 +194,13 @@ namespace casioemu {
193194
case INT_RESET:
194195
exception_level = 0;
195196
break;
196-
197197
case INT_BREAK:
198198
case INT_NONMASKABLE:
199199
exception_level = 2;
200200
break;
201-
202201
case INT_EMULATOR:
203202
exception_level = 3;
204203
break;
205-
206204
default:
207205
exception_level = 1;
208206
break;
@@ -214,14 +212,14 @@ namespace casioemu {
214212
if (cpu.GetMasterInterruptEnable())
215213
cpu.Raise(exception_level, index);
216214
}
217-
} else {
215+
} else if (index) {
218216
cpu.Raise(exception_level, index);
219217
}
220218

221219
run_mode = RM_RUN;
222220

223221
// * TODO: introduce delay
224-
222+
if (!index) return;
225223
interrupts_active[index] = false;
226224
pending_interrupt_count--;
227225
}

0 commit comments

Comments
 (0)