mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-08 12:01:39 +12:00
[Kernel] Implement GetSystemTick
This commit is contained in:
parent
5bcdf4d063
commit
cbefe3c2d0
4 changed files with 19 additions and 0 deletions
|
@ -19,6 +19,7 @@ CPU::CPU(Memory& mem, Kernel& kernel) : mem(mem), env(mem, kernel, *this) {
|
|||
void CPU::reset() {
|
||||
setCPSR(CPSR::UserMode);
|
||||
setFPSCR(FPSCR::ThreadDefault);
|
||||
env.totalTicks = 0;
|
||||
|
||||
cp15->reset();
|
||||
cp15->setTLSBase(VirtualAddrs::TLSBase); // Set cp15 TLS pointer to the main thread's thread-local storage
|
||||
|
|
|
@ -26,6 +26,7 @@ void Kernel::serviceSVC(u32 svc) {
|
|||
case 0x22: arbitrateAddress(); break;
|
||||
case 0x23: svcCloseHandle(); break;
|
||||
case 0x24: waitSynchronization1(); break;
|
||||
case 0x28: getSystemTick(); break;
|
||||
case 0x2D: connectToPort(); break;
|
||||
case 0x32: sendSyncRequest(); break;
|
||||
case 0x38: getResourceLimit(); break;
|
||||
|
@ -108,6 +109,15 @@ void Kernel::svcCloseHandle() {
|
|||
regs[0] = SVCResult::Success;
|
||||
}
|
||||
|
||||
// u64 GetSystemTick()
|
||||
void Kernel::getSystemTick() {
|
||||
printf("GetSystemTick()\n");
|
||||
|
||||
u64 ticks = cpu.getTicks();
|
||||
regs[0] = u32(ticks);
|
||||
regs[1] = u32(ticks >> 32);
|
||||
}
|
||||
|
||||
// Result OutputDebugString(const char* str, s32 size)
|
||||
// TODO: Does this actually write an error code in r0 and is the above signature correct?
|
||||
void Kernel::outputDebugString() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue