• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 … 5 6 7 8 9 … 117 Next »

Question Regarding Using LogGeneratedX86(...)
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Question Regarding Using LogGeneratedX86(...)
05-03-2021, 03:49 AM
#1
Lobsterzelda Offline
Junior Member
**
Posts: 18
Threads: 5
Joined: Apr 2021
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!  Big Grin
Find
Reply
05-03-2021, 04:08 AM
#2
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 9,074
Threads: 7
Joined: Oct 2014
Wouldn't it be fine to just output the value of the PC register? You can look up the corresponding code in Dolphin's debugger afterwards.
Find
Reply
05-03-2021, 04:17 AM
#3
Lobsterzelda Offline
Junior Member
**
Posts: 18
Threads: 5
Joined: Apr 2021
(05-03-2021, 04:08 AM)JosJuice Wrote: Wouldn't it be fine to just output the value of the PC register? You can look up the corresponding code in Dolphin's debugger afterwards.


I did output the PC register values for each single step to check for desyncs. I noticed that on the 191st block, the PC values become different, indicating that one of the TASes entered a different section of code at that point. 

However, I'm not sure how large the block starting with PC is, or how to output the block with the debugger.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma