GB Emulator - Issues with cpu_instrs

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
Alyrikki256
Posts: 4
Joined: Sat Jun 09, 2018 4:29 am

GB Emulator - Issues with cpu_instrs

Post by Alyrikki256 » Tue Oct 09, 2018 5:21 am

Hi there! I've been working on my own Game Boy emulator for a while now (I made a post several months ago on here, but much progress has been made since).

Recently I've added MBC1 support so I can test the main cpu_instrs.gb test ROM.
It seems to run fine until it starts actually testing.

This is the output:

Code: Select all

cpu_instrs

01:05

Failed 1 tests.
So obviously, it's failing the first test, and the fifth sub-test. I checked the ASM of the fifth sub-test, and verified that all of the instructions are implemented correctly.
The bad instruction is most likely not in the test routine itself, but before it even gets there. My question is, how would I debug this? I really don't feel like using a working emulator and stepping over every line until they change. That would take forever.

Thanks!

Alyosha_TAS
Posts: 98
Joined: Wed Jun 15, 2016 11:49 am

Re: GB Emulator - Issues with cpu_instrs

Post by Alyosha_TAS » Sat Oct 13, 2018 7:17 am

I find the fastest way to do this is to log all executing instructions to a text file and then just compare against a log from a working emulator. If your emulator can't already do this I strongly suggest it as it has saved me countless hours.

Post Reply