gianlucag / mos6502

A fast & simple MOS 6502 CPU emulator written in C++
MIT License
286 stars 56 forks source link

The reset vector is read in reverse order #14

Closed omarandlorraine closed 1 year ago

omarandlorraine commented 1 year ago

A real chip, and Mike Chambers' fake6502 as well, read the reset vector low byte first (i.e. $fffc) and then $fffd. But it seems like this emulator does it in reverse order.

I appreciate it's a tiny thing but it's showing as a difference in my test suite

What do we think? Do we care about such tiny differences?

omarandlorraine commented 1 year ago

Looks like the locus of the bug is line 826 of mos6502.cpp. But also, I don't know if C++ actually defines the order in which those reads happen. Can anyone shed any light on this?

Of course, if this is worth looking at, then also we could check if IRQ and NMI have the same issue.

gianlucag commented 1 year ago

Could you please fork the project and submit a pull request?