mirror of
https://github.com/st3fan/ewm.git
synced 2025-01-09 02:29:47 +00:00
Fixes #1 - Properly reset the cpu
This commit is contained in:
parent
c16b34f14a
commit
51093f364c
10
cpu.c
10
cpu.c
@ -306,6 +306,16 @@ void cpu_trace(struct cpu_t *cpu, uint8_t trace) {
|
|||||||
|
|
||||||
void cpu_reset(struct cpu_t *cpu) {
|
void cpu_reset(struct cpu_t *cpu) {
|
||||||
cpu->state.pc = _mem_get_word(cpu, 0xfffc);
|
cpu->state.pc = _mem_get_word(cpu, 0xfffc);
|
||||||
|
cpu->state.a = 0x00;
|
||||||
|
cpu->state.x = 0x00;
|
||||||
|
cpu->state.y = 0x00;
|
||||||
|
cpu->state.n = 0;
|
||||||
|
cpu->state.v = 0;
|
||||||
|
cpu->state.b = 0;
|
||||||
|
cpu->state.d = 0;
|
||||||
|
cpu->state.i = 1;
|
||||||
|
cpu->state.z = 0;
|
||||||
|
cpu->state.c = 0;
|
||||||
cpu->state.sp = 0x01ff;
|
cpu->state.sp = 0x01ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user