How do you find bugs in your emulator?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Post by oRBIT2002 »

The entire log would be filled with lda $2002 if I started to save them in my log. A pretty much useless log unless i logged an entire frame (=lots of code).
User avatar
cpow
NESICIDE developer
Posts: 1097
Joined: Mon Oct 13, 2008 7:55 pm
Location: Minneapolis, MN
Contact:

Post by cpow »

oRBIT2002 wrote:The entire log would be filled with lda $2002 if I started to save them in my log. A pretty much useless log unless i logged an entire frame (=lots of code).
You'd have to capture only 4300 logged instructions in order to tell if you're spinning on such a loop and never getting past it in a frame.

29780ish cycles per frame. 4 cycles per lda $2002, 3 cycles per taken branch (assuming not page crossing). Multiplying and dividing gives me 4255 chances of that loop executing in a frame. If you see 4256 "lda/bpl" or equivalent looping combinations, you know you're stuck. The loop should exit before the end of the frame...
User avatar
oRBIT2002
Posts: 643
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Post by oRBIT2002 »

Here's the log of an entire frame. There's LOTS of lda $2002... So I guess the maincode is placed in the NMI...
http://dl.dropbox.com/u/2590713/ProWrestlingDump2.txt
Post Reply