This commit is contained in:
Henrik Rydgård 2024-07-26 14:22:31 +02:00
parent 96c4ae4457
commit 9fb97add3f
5 changed files with 12 additions and 8 deletions

View File

@ -62,4 +62,4 @@ void ReportMessage(const char *message, ...);
// The same, but with a preformatted version (message is still the key.)
void ReportMessageFormatted(const char *message, const char *formatted);
}
} // namespace Reporting

View File

@ -160,14 +160,14 @@ void yield() {
#endif
}
TimeSpan::TimeSpan() {
Instant::Instant() {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
nativeStart_ = ts.tv_sec;
nsecs_ = ts.tv_nsec;
}
int64_t TimeSpan::ElapsedNanos() const {
int64_t Instant::ElapsedNanos() const {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
int64_t secs = ts.tv_sec - nativeStart_;
@ -179,7 +179,7 @@ int64_t TimeSpan::ElapsedNanos() const {
return secs * 1000000000ULL + nsecs;
}
double TimeSpan::ElapsedSeconds() const {
double Instant::ElapsedSeconds() const {
return (double)ElapsedNanos() * (1.0 / nanos);
}
@ -223,14 +223,14 @@ double time_now_unix_utc() {
return time_now_raw();
}
TimeSpan::TimeSpan() {
Instant::Instant() {
struct timeval tv;
gettimeofday(&tv, nullptr);
nativeStart_ = tv.tv_sec;
nsecs_ = tv.tv_usec;
}
int64_t TimeSpan::ElapsedNanos() const {
int64_t Instant::ElapsedNanos() const {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
@ -243,7 +243,7 @@ int64_t TimeSpan::ElapsedNanos() const {
return secs * 1000000000 + usecs * 1000;
}
double TimeSpan::ElapsedSeconds() const {
double Instant::ElapsedSeconds() const {
return (double)ElapsedNanos() * (1.0 / 1000000000.0);
}

View File

@ -40,6 +40,7 @@
#include <atomic>
#include <mutex>
#include <thread>
#include "Common/Net/Resolve.h"
#include "Common/Serialize/Serializer.h"

View File

@ -15,7 +15,10 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <string> // for some reason required for the 'new'.
#include "Common/Data/Random/Rng.h"
#include "Common/CommonTypes.h"
#include "Core/HLE/HLE.h"
#include "Core/HLE/FunctionWrappers.h"
#include "Core/HLE/sceMt19937.h"

View File

@ -200,7 +200,7 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst) {
mips->r[inst->dest] = mips->r[inst->src1] ^ inst->constant;
break;
case IROp::Neg:
mips->r[inst->dest] = -(s32)mips->r[inst->src1];
mips->r[inst->dest] = (u32)(-(s32)mips->r[inst->src1]);
break;
case IROp::Not:
mips->r[inst->dest] = ~mips->r[inst->src1];