Hello everybody.
I am currently working on extracting the instructions that Dolphin executes when it reaches a desyncing portion of a TAS.
To do this, my current algorithm is as follows:
1. Inside the function that's called when the user tries to frame advance, I check to see if I am at the frame that I want to check.
2. If we aren't, we frame advance normally. If we are there, then we go into a new section of code.
3. In this new section, we acquire the locks using Core:: PauseAndLock(true), and then execute PowerPC:: SingleStep() until we trigger the vsync of the next frame (more specifically, when Movie:: FrameUpdate() is called, I assume we've hit the end of the frame, although if this assumption is inaccurate, feel free to correct me on that).
4. During this stepping process, we check for differences in RAM between another TAS at the same block # (which has been through SingleStep() the same number of times since the start of the desyncing frame). This is used repeatedly to find the exact desyncing block.
5. After finding the desyncing block, I would like to output the block before the desync, the block of the desync, and the block after the desync to a text file so that I can look at them more closely.
To accomplish task 5, I am hoping to use the function LogGeneratedX86(...) from the file JitBase.cpp.
However, this function requires you to pass in various parameters like the size of the block, and other variables which I am not sure how to find. I could put the code to call this logging function inside of the Jit::SingleStep() code. However, even there, all I have is a pointer to the asm entry point that is about to be executed, and I don't know how to get the necessary information out of that.
If anyone could help me figure out how to use LogGeneratedX86(), I would greatly appreciate it. Also, as an aside, it seems that SingleStep() is called 600 times to go through an entire frame. This seems rather low to me, so I would be interested in hearing if anyone has any info on what this value should roughly be? (I am assuming that each call to SingleStep() represents a single block of code which is entered and executed).
Many thanks for the help!
I am currently working on extracting the instructions that Dolphin executes when it reaches a desyncing portion of a TAS.
To do this, my current algorithm is as follows:
1. Inside the function that's called when the user tries to frame advance, I check to see if I am at the frame that I want to check.
2. If we aren't, we frame advance normally. If we are there, then we go into a new section of code.
3. In this new section, we acquire the locks using Core:: PauseAndLock(true), and then execute PowerPC:: SingleStep() until we trigger the vsync of the next frame (more specifically, when Movie:: FrameUpdate() is called, I assume we've hit the end of the frame, although if this assumption is inaccurate, feel free to correct me on that).
4. During this stepping process, we check for differences in RAM between another TAS at the same block # (which has been through SingleStep() the same number of times since the start of the desyncing frame). This is used repeatedly to find the exact desyncing block.
5. After finding the desyncing block, I would like to output the block before the desync, the block of the desync, and the block after the desync to a text file so that I can look at them more closely.
To accomplish task 5, I am hoping to use the function LogGeneratedX86(...) from the file JitBase.cpp.
However, this function requires you to pass in various parameters like the size of the block, and other variables which I am not sure how to find. I could put the code to call this logging function inside of the Jit::SingleStep() code. However, even there, all I have is a pointer to the asm entry point that is about to be executed, and I don't know how to get the necessary information out of that.
If anyone could help me figure out how to use LogGeneratedX86(), I would greatly appreciate it. Also, as an aside, it seems that SingleStep() is called 600 times to go through an entire frame. This seems rather low to me, so I would be interested in hearing if anyone has any info on what this value should roughly be? (I am assuming that each call to SingleStep() represents a single block of code which is entered and executed).
Many thanks for the help!
