Well, I fixed the rerecord counter.
I think anyway. I probably also broke a million different things, since my c++ experience is limited to a single class i took in HS. It appears to work correctly though (ie it compiles, and 30 seconds of testing indicates that it works as intended).
The problem was that when loading a save state, it would load the rerecord count from the .dtm that was saved with the save state, and increment it by 1. So if you were to load a single save state repeatedly, it would correctly count the rerecords. However, if you were then to load a different save state, it would discard your rerecord count, and load it from the save state that you just loaded.
Anyway, long story short, rerecord count is stored in two variables, so all i did was check if one was greater than the other, and set the lower one equal to the other if they weren't the same. As far as i can tell, this works perfectly, but if not, you're welcome to fix it for real.
Patch is at
http://dl.dropbox.com/u/11111638/0001-fix-rerecord-counter.patch
binaries (which also include natt's a/v sync hack) at:
64 bit -
http://www.mediafire.com/?6p629w0j0bmrcjr
32 bit -
http://www.mediafire.com/?6z6kuq3dv4o1cbe
edit: this is now in master.