Browse Source

Fix status register on power-on & reset

v2
Nathaniel Walizer 6 months ago
parent
commit
f35463f9d7
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/f6502.c

+ 2
- 2
src/f6502.c View File

@@ -394,14 +394,14 @@ static inline int f6502_write(nes_Memory* mem,


void f6502_init(f6502_Core* core) {
// TODO: Nothing for now
core->registers.P = (f6502_Status_B | f6502_Status_1);
}

void f6502_reset(f6502_Core* core) {
core->registers.PC = f6502_read16(&core->memory,
f6502_Vector_Reset),
core->registers.S -= 3;
core->registers.P |= (f6502_Status_B | f6502_Status_1);
core->registers.P |= f6502_Status_I;
}

void f6502_set_NMI(f6502_Core* core, bool active) {


Loading…
Cancel
Save