wavelength 1.0.0
Loading...
Searching...
No Matches
ClockSyncTask Class Reference

Task of a guest that measures the clock of the host. More...

#include <clocksynctask.h>

Inheritance diagram for ClockSyncTask:
Collaboration diagram for ClockSyncTask:

Classes

class  Sample
 One answer of the host. More...

Public Member Functions

 ~ClockSyncTask () override=default
 Destroy the object.
void AddSample (float fRequestTime, float fHostTime)
 Note an answer of the host while the task runs, and finish once the answers suffice.
void FinishSync ()
 Finish the task and give JoinpadRT the median offset and the mean round trip.
Public Member Functions inherited from Task
 Task ()
 Construct an idle task.
virtual ~Task ()
 Release the task.
int Poll ()
 Report the state after giving a running task one poll.
void Start ()
 Enter the running state and call OnStart(), unless the task is already running.
void Stop ()
 Call OnStop() when the task is running, and return to the idle state.
void Finish (bool bSucceeded)
 End the task from outside its poll, and call OnStop() when it was running.
int GetState () const
 Report mState.

Static Public Attributes

static constexpr int kRequestInterval = 10
 The polls between two requests.
static constexpr int kSampleCount = 5
 The answers the task waits for.

Protected Member Functions

void OnStart () override
 Forget the answers, and ask at the next poll.
void OnPoll () override
 Ask the host for the time every kRequestInterval polls.
Protected Member Functions inherited from Task
virtual void OnStop ()
 Abandon the work.

Additional Inherited Members

Public Types inherited from Task
enum  State { kStateIdle = 0 , kStateRunning = 1 , kStateDone = 2 , kStateFailed = 3 }
 Values of mState. More...

Detailed Description

Task of a guest that measures the clock of the host.

The RTTI includes the name and records Task as the base. The vtable is at 0x003d4998, and the object is 0x1c bytes. The task asks the host for the time every kRequestInterval polls and keeps the answers. Once kSampleCount answers arrived, it gives JoinpadRT the median offset of the clocks.

Constructor & Destructor Documentation

◆ ~ClockSyncTask()

ClockSyncTask::~ClockSyncTask ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x0039a4b0
Ghidra address:
PAL: 0x00408d38

Member Function Documentation

◆ AddSample()

void ClockSyncTask::AddSample ( float fRequestTime,
float fHostTime )

Note an answer of the host while the task runs, and finish once the answers suffice.

The name is inferred.

Parameters
fRequestTimeThe clock of this console when it asked.
fHostTimeThe clock of the host when it answered.
Ghidra address:
NTSC-U/C: 0x0025c800
Ghidra address:
PAL: 0x00265860

◆ FinishSync()

void ClockSyncTask::FinishSync ( )

Finish the task and give JoinpadRT the median offset and the mean round trip.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0025caa8
Ghidra address:
PAL: 0x00265b08

◆ OnStart()

void ClockSyncTask::OnStart ( )
overrideprotectedvirtual

Forget the answers, and ask at the next poll.

Ghidra address:
NTSC-U/C: 0x0025c6e8
Ghidra address:
PAL: 0x00265748

Reimplemented from Task.

◆ OnPoll()

void ClockSyncTask::OnPoll ( )
overrideprotectedvirtual

Ask the host for the time every kRequestInterval polls.

Ghidra address:
NTSC-U/C: 0x0025c728
Ghidra address:
PAL: 0x00265788

Reimplemented from Task.

Member Data Documentation

◆ kRequestInterval

int ClockSyncTask::kRequestInterval = 10
staticconstexpr

The polls between two requests.

◆ kSampleCount

int ClockSyncTask::kSampleCount = 5
staticconstexpr

The answers the task waits for.


The documentation for this class was generated from the following file: