ShizZy
Emulator Developer
Howdy - I have a couple of questions for my fellow emu coders. One of my weakest skills is in the area of debugging, so I've been somewhat studying it latelly. From what I've gathered, here are the basic debugging methods:
-the "fine needle" method, going over your code line by line and reading available documents, checking that you are handling everything properly. This is by far the most redundent method, but it is bound to work. The only problem is if you're looking for bugs by reading code, and you're not quite sure how something works, you won't spot a bug.
-Tracing - taking your emu and comparing registers step by step with a proven emulator. This works well, until you get into all sorts of memory reads and writes and there's more to bugs that just opcode register manipulation. Also, it's somewhat tedious to trace with another emu when your first 5mb of instructions are corrected, going through them without overlooking a mistake yourself is very difficult.
-Reverse Fixing - running a rom that you know inside-out (preferably one that you made), so you know exactly how your emulator should be handling it. Then you know exactly what to check when something isn't right. Often combined with the trace method. Drawbacks are it'll require you to learn how to program for the system as well, which is more time consuming, but not a bad thing.
My question is - how do you guys go about debugging your emulators, especially those of you who have finished emulators? I'm going to need to grasp these concepts and techniques if I ever hope to finish mine. If you use a method similiar to these, can you describe in detail how you go about doing it? Big thanks
-the "fine needle" method, going over your code line by line and reading available documents, checking that you are handling everything properly. This is by far the most redundent method, but it is bound to work. The only problem is if you're looking for bugs by reading code, and you're not quite sure how something works, you won't spot a bug.
-Tracing - taking your emu and comparing registers step by step with a proven emulator. This works well, until you get into all sorts of memory reads and writes and there's more to bugs that just opcode register manipulation. Also, it's somewhat tedious to trace with another emu when your first 5mb of instructions are corrected, going through them without overlooking a mistake yourself is very difficult.
-Reverse Fixing - running a rom that you know inside-out (preferably one that you made), so you know exactly how your emulator should be handling it. Then you know exactly what to check when something isn't right. Often combined with the trace method. Drawbacks are it'll require you to learn how to program for the system as well, which is more time consuming, but not a bad thing.
My question is - how do you guys go about debugging your emulators, especially those of you who have finished emulators? I'm going to need to grasp these concepts and techniques if I ever hope to finish mine. If you use a method similiar to these, can you describe in detail how you go about doing it? Big thanks