|
resonance 1.0.1
|
Scheduler time, as a signed 64-bit count. More...
#include <time.h>
Public Member Functions | |
| OBStream & | Save (OBStream &stream) |
| Write the count. | |
| IBStream & | Load (IBStream &stream) |
| Read the count back. | |
| void | Print (std::ostream &stream) |
| Write the count to a diagnostic stream as a number of seconds. | |
Public Attributes | |
| long long | mValue |
Scheduler time, as a signed 64-bit count.
The type has no RTTI descriptor, because it is not polymorphic. Its name comes from the debugging symbols of the North American demo release. The demo's Print(), Save(), and Load() have the same instructions as this type's.
The width is fixed by the code that moves one around. Sch::TimedCommand stores two of them, and its constructor at 0x005d32f8 writes both with sd, while the scheduler run loop at 0x004aa848 compares one against the clock with a 64-bit signed load and the queueing paths at 0x004ac608 and 0x004ac698 compute one with daddu and dsubu. Eight bytes and 64-bit signed arithmetic are therefore measured rather than assumed.
Whether the original declared a class or a struct is undetermined, and so is the set of arithmetic operators it declared. Every arithmetic use in the image is inlined into its caller. No address therefore attaches to an operator, and none is declared here. The one member is public because the scheduler applies 64-bit arithmetic to it directly and the image exposes no accessor.
The count is in nanoseconds, and three independent measurements agree. Print() below divides it by the double 1000000000.0 at 0x0083c130 and appends the literal s at 0x0083c0e8, so one unit is one thousand-millionth of a second. Sch::Scheduler's clock scales its millisecond readings by 1.0e9 / 1000.0 at 0x005124c8 to produce one. The run loop at 0x004aa8a4 treats a gap of 6000000000 as six seconds of arrears.
A song position is the separate type Sch::Tick, in MIDI ticks at 480 per quarter note, and Sch::TempoMap converts between the two.
Write the count.
The low word and then the high word each go through a separate OBStream::WriteLE(). The binary reads the two halves with separate four-byte loads at 0x006100c8 and 0x006100e0, while Print() and the scheduler treat the member as one 64-bit value. The member is therefore a long long and the body splits it.
| stream | The stream to write to. |
Read the count back.
The low word and then the high word arrive through two separate IBStream::ReadLE() calls, the inverse of Save().
| stream | The stream to read from. |
| void Sch::Time::Print | ( | std::ostream & | stream | ) |
Write the count to a diagnostic stream as a number of seconds.
| stream | The stream to write to. |
| long long Sch::Time::mValue |
The count, in nanoseconds. +0x00