Open Vulcalien opened 4 months ago
Hey @Vulcalien,
I'm saving the original value from REG_MGBA_ENABLE
(which is usually 0x8011
as it seems), then I write 0xC0DE
to it and then I restore the original value, which is 0x8011
in some cases and 0x0
in other cases.
So the original value can never be 0x1DEA
or 0xC0DE
. Except if it was enabled before, but then it stays enabled with the current implementation.
Tested current behavior in different emulators:
Maybe I'm wildly misunderstanding something? (which is very possible because I have a light fever)
Hey @Vulcalien could you please update me on the issue?
I still believe the stored value read from the Enable register should not be restored, since it's not a real read/write register. But I don't have time to test this right now.
I would test this scenario:
I suspect that after identify_mgba(), Debug will be disable instead. If that's not the case, then I was mistaken and this issue should be closed.
I haven't tested the code, but by looking at it I noticed you're reading the register's value and then writing the same value again. But the debug enable register, when read, does not return '0xc0de', but instead '0x1dea' or any other value.
So when restoring the register, it should look something like this: