Close

Inspecting the 6502's emulator area!

A project log for NES Emulator (2) for the PIC32MZ-EF

A simple NES emulator for the PIC32MZ-EF microcontroller, complete with sound and controls.

nyh-workshopNYH-workshop 06/18/2018 at 05:400 Comments

As said before, some games refused to work with it. I found out why: there are some problems in the 6502 emulator. Using Kevin Horton's NES test , it is shown that some of the instructions were incorrectly emulated! Worst of all, the "Indirect Y" crashed in this test!

So, using the hints and the descriptions from the test, I managed to have the adc6502 and sbc6502 to temporarily ignore the decimal flag (it is not implemented in NES' processor) and then restore the flag state after calling.

Apart from that, the bvs6502 has the addressing mode changed back to the relative6502, according to the 6502's information.

Some of the games that previously didn't work properly had worked after I have fixed the emulator, but the NES test is still reporting that the "Indirect Y" is not wrapping up properly in JMP instruction, and "Indirect X" has a sta6502 not storing data where it is supposed to.

Well, at least it's better than nothing! I'm gonna try to get this test error-free in the future.

The github has been updated according to the changes too.

Discussions