Okay. First of all, you take your ROM and a clean ROM too. Make a backup of your ROM. Load the emulator, and save somewhere where it's easy to reproduce the bug. In your case, in front of a PC would do it. Then you open both ROMs into a hex editor and start copying the first 0x10000 (65536) bytes from the clean ROM and paste them over your modified ROM. At this point, you try the ROM and see if the bug still happens. If the bug is still there, then delete the modified ROM, and copy the backup you made before. Using that backup copy, you do the same once more, except this time you copy the bytes ranging from 0x10000 to 0x1FFFF (before it was 0x0 - 0xFFFF). And so on, till you find the exact spot that makes the bug disappear. When you reach that point, tell me.