Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
3dc3bd56
There was an error fetching the commit references. Please try again later.
Commit
3dc3bd56
authored
11 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
fixed licensing issue with core_timing being GPL v2+ instead of Dolphin's GPL v2
parent
ef7cfa02
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/src/core_timing.cpp
+405
-421
405 additions, 421 deletions
src/core/src/core_timing.cpp
src/core/src/core_timing.h
+50
-66
50 additions, 66 deletions
src/core/src/core_timing.h
with
455 additions
and
487 deletions
src/core/src/core_timing.cpp
+
405
−
421
View file @
3dc3bd56
This diff is collapsed.
Click to expand it.
src/core/src/core_timing.h
+
50
−
66
View file @
3dc3bd56
// Copyright (c) 2012- PPSSPP Project / Dolphin Project.
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
// This program is free software: you can redistribute it and/or modify
#pragma once
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#ifndef CORE_CORE_TIMING_H_
#define CORE_CORE_TIMING_H_
// This is a system to schedule events into the emulated machine's future. Time is measured
// This is a system to schedule events into the emulated machine's future. Time is measured
// in main CPU clock cycles.
// in main CPU clock cycles.
...
@@ -38,88 +24,86 @@ class PointerWrap;
...
@@ -38,88 +24,86 @@ class PointerWrap;
extern
int
g_clock_rate_arm11
;
extern
int
g_clock_rate_arm11
;
inline
s64
msToCycles
(
int
ms
)
{
inline
s64
msToCycles
(
int
ms
)
{
return
g_clock_rate_arm11
/
1000
*
ms
;
return
g_clock_rate_arm11
/
1000
*
ms
;
}
}
inline
s64
msToCycles
(
float
ms
)
{
inline
s64
msToCycles
(
float
ms
)
{
return
(
s64
)(
g_clock_rate_arm11
*
ms
*
(
0.001
f
));
return
(
s64
)(
g_clock_rate_arm11
*
ms
*
(
0.001
f
));
}
}
inline
s64
msToCycles
(
double
ms
)
{
inline
s64
msToCycles
(
double
ms
)
{
return
(
s64
)(
g_clock_rate_arm11
*
ms
*
(
0.001
));
return
(
s64
)(
g_clock_rate_arm11
*
ms
*
(
0.001
));
}
}
inline
s64
usToCycles
(
float
us
)
{
inline
s64
usToCycles
(
float
us
)
{
return
(
s64
)(
g_clock_rate_arm11
*
us
*
(
0.000001
f
));
return
(
s64
)(
g_clock_rate_arm11
*
us
*
(
0.000001
f
));
}
}
inline
s64
usToCycles
(
int
us
)
{
inline
s64
usToCycles
(
int
us
)
{
return
(
g_clock_rate_arm11
/
1000000
*
(
s64
)
us
);
return
(
g_clock_rate_arm11
/
1000000
*
(
s64
)
us
);
}
}
inline
s64
usToCycles
(
s64
us
)
{
inline
s64
usToCycles
(
s64
us
)
{
return
(
g_clock_rate_arm11
/
1000000
*
us
);
return
(
g_clock_rate_arm11
/
1000000
*
us
);
}
}
inline
s64
usToCycles
(
u64
us
)
{
inline
s64
usToCycles
(
u64
us
)
{
return
(
s64
)(
g_clock_rate_arm11
/
1000000
*
us
);
return
(
s64
)(
g_clock_rate_arm11
/
1000000
*
us
);
}
}
inline
s64
cyclesToUs
(
s64
cycles
)
{
inline
s64
cyclesToUs
(
s64
cycles
)
{
return
cycles
/
(
g_clock_rate_arm11
/
1000000
);
return
cycles
/
(
g_clock_rate_arm11
/
1000000
);
}
}
namespace
CoreTiming
namespace
CoreTiming
{
{
void
Init
();
void
Shutdown
();
typedef
void
(
*
TimedCallback
)(
u64
userdata
,
int
cyclesLate
);
void
Init
();
void
Shutdown
();
u64
GetTicks
();
typedef
void
(
*
TimedCallback
)(
u64
userdata
,
int
cyclesLate
);
u64
GetIdleTicks
();
// Returns the event_type identifier.
u64
GetTicks
();
int
RegisterEvent
(
const
char
*
name
,
TimedCallback
callback
);
u64
GetIdleTicks
();
// For save states.
void
RestoreRegisterEvent
(
int
event_type
,
const
char
*
name
,
TimedCallback
callback
);
void
UnregisterAllEvents
();
// userdata MAY NOT CONTAIN POINTERS. userdata might get written and reloaded from disk,
// Returns the event_type identifier.
// when we implement state saves.
int
RegisterEvent
(
const
char
*
name
,
TimedCallback
callback
);
void
ScheduleEvent
(
s64
cyclesIntoFuture
,
int
event_type
,
u64
userdata
=
0
);
// For save states.
void
ScheduleEvent_Threadsafe
(
s64
cyclesIntoFuture
,
int
event_type
,
u64
userdata
=
0
);
void
RestoreRegisterEvent
(
int
event_type
,
const
char
*
name
,
TimedCallback
callback
);
void
ScheduleEvent_Threadsafe_Immediate
(
int
event_type
,
u64
userdata
=
0
);
void
UnregisterAllEvents
();
s64
UnscheduleEvent
(
int
event_type
,
u64
userdata
);
s64
UnscheduleThreadsafeEvent
(
int
event_type
,
u64
userdata
);
void
RemoveEvent
(
int
event_type
);
// userdata MAY NOT CONTAIN POINTERS. userdata might get written and reloaded from disk,
void
RemoveThreadsafeEvent
(
int
event_type
);
// when we implement state saves.
void
RemoveAllEvents
(
int
event_type
);
void
ScheduleEvent
(
s64
cyclesIntoFuture
,
int
event_type
,
u64
userdata
=
0
);
bool
IsScheduled
(
int
event_type
);
void
ScheduleEvent_Threadsafe
(
s64
cyclesIntoFuture
,
int
event_type
,
u64
userdata
=
0
);
void
Advance
(
);
void
ScheduleEvent_Threadsafe_Immediate
(
int
event_type
,
u64
userdata
=
0
);
void
MoveEvents
(
);
s64
UnscheduleEvent
(
int
event_type
,
u64
userdata
);
void
ProcessFifoWaitEvents
(
);
s64
UnscheduleThreadsafeEvent
(
int
event_type
,
u64
userdata
);
// Pretend that the main CPU has executed enough cycles to reach the next event.
void
RemoveEvent
(
int
event_type
);
void
Idle
(
int
maxIdle
=
0
);
void
RemoveThreadsafeEvent
(
int
event_type
);
void
RemoveAllEvents
(
int
event_type
);
bool
IsScheduled
(
int
event_type
);
void
Advance
();
void
MoveEvents
();
void
ProcessFifoWaitEvents
();
//
Clear all pending events. This should ONLY be done on
ex
i
t
or state load
.
//
Pretend that the main CPU has executed enough cycles to reach the n
ext
event
.
void
ClearPendingEvents
(
);
void
Idle
(
int
maxIdle
=
0
);
void
LogPendingEvents
();
// Clear all pending events. This should ONLY be done on exit or state load.
void
ClearPendingEvents
();
// Warning: not included in save states.
void
LogPendingEvents
();
void
RegisterAdvanceCallback
(
void
(
*
callback
)(
int
cyclesExecuted
));
std
::
string
GetScheduledEventsSummary
();
// Warning: not included in save states.
void
RegisterAdvanceCallback
(
void
(
*
callback
)(
int
cyclesExecuted
));
void
DoState
(
PointerWrap
&
p
);
std
::
string
GetScheduledEventsSummary
(
);
void
SetClockFrequencyMHz
(
int
cpuMhz
);
void
DoState
(
PointerWrap
&
p
);
int
GetClockFrequencyMHz
();
extern
int
slicelength
;
};
// namespace
void
SetClockFrequencyMHz
(
int
cpuMhz
);
int
GetClockFrequencyMHz
();
extern
int
slicelength
;
#endif // CORE_CORE_TIMING_H_
};
// namespace
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment