Bad News
There is a major emulator bug in Desmume somewhere. A month or two ago, the starting RNG seed when the game starts (frame 0) changed for no reason. I checked my backups and the backups on my other laptop that haven't been touched since the summer and NONE of my movies sync. I encountered this bug during the summer but the starting RNG seed returned to normal after a day so I thought I was getting tired or something. It seems the new RNG seed is here to stay for good this time so I spoke with a developer and unfortunately, he is getting the new RNG seed too. If anybody is able to get the WIP movies I uploaded to sync, please reset Desmume (return to frame 0), make a save state, and upload it. If the RNG seed can spontaneously change, then other areas might also being changing that isn't as noticeable. I also don't want to finish a new movie only to find out that all the work is lost to this bug.
Here is an old WIP for testing:
http://www.mediafire.com/?9tgprj0saehtuwc
It should be the test run I encoded and uploaded so I know it used to sync.
Good News
With a little help from a developer, I am able to dump the cpu registers when the RNG function is ran by the game. This means that I can trace back most of the data along with the return register which tells me what code wanted the RNG.
What I found out so far:
- Each enemy (only for the bottom screen) stores 8 bytes generated from 2 RNG seeds. Some stuff happens and a little while later, these 8 bytes are modified by 1 RNG seed. This happens for every enemy but only 1 enemy at a time with a few frames in between each. How it is decided when an enemy will have these bytes refreshed and what these 8 bytes are used for is currently unknown.
- A piece of code gets 2 RNG seeds every frame and stores it within a linked list I have not explored yet. I suspect this list contains important information about the battle so I will be tracing the head/tail of this linked list later.
Later, I will use this to track the item drop code and hopefully trace it to the location of the drop tables.