mirror of
https://github.com/ksherlock/mpw.git
synced 2025-02-10 19:31:10 +00:00
TickCount
This commit is contained in:
parent
a14cd5eb5d
commit
97a89c1904
@ -6,11 +6,18 @@
|
|||||||
#include <cpu/CpuModule.h>
|
#include <cpu/CpuModule.h>
|
||||||
#include <cpu/fmem.h>
|
#include <cpu/fmem.h>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
#include "stackframe.h"
|
||||||
|
|
||||||
|
// todo -- have background thread to update Ticks and Time global variables?
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const long EpochAdjust = 86400 * (365 * (1970 - 1904) + 17); // 17 leap years.
|
const long EpochAdjust = 86400 * (365 * (1970 - 1904) + 17); // 17 leap years.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
namespace Time
|
namespace Time
|
||||||
{
|
{
|
||||||
@ -92,4 +99,21 @@ namespace Time
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t TickCount(uint16_t trap)
|
||||||
|
{
|
||||||
|
uint32_t ticks;
|
||||||
|
|
||||||
|
fprintf(stderr, "%04x TickCount()\n", trap);
|
||||||
|
|
||||||
|
//auto t = std::chrono::steady_clock::now();
|
||||||
|
ticks = 0;
|
||||||
|
|
||||||
|
// global Ticks
|
||||||
|
memoryWriteLong(ticks, 0x16A);
|
||||||
|
ToolReturn<4>(-1, ticks);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -13,6 +13,7 @@ namespace Time
|
|||||||
uint16_t ReadDateTime(uint16_t trap);
|
uint16_t ReadDateTime(uint16_t trap);
|
||||||
uint16_t SecondsToDate(uint16_t trap);
|
uint16_t SecondsToDate(uint16_t trap);
|
||||||
|
|
||||||
|
uint16_t TickCount(uint16_t trap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -79,6 +79,11 @@ namespace ToolBox {
|
|||||||
d0 = Time::SecondsToDate(trap);
|
d0 = Time::SecondsToDate(trap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// TickCount : LONGINT;
|
||||||
|
case 0xa975:
|
||||||
|
d0 = Time::TickCount(trap);
|
||||||
|
break;
|
||||||
|
|
||||||
// NewPtr [Sys, Clear] (logicalSize: Size): Ptr;
|
// NewPtr [Sys, Clear] (logicalSize: Size): Ptr;
|
||||||
case 0xa11e:
|
case 0xa11e:
|
||||||
case 0xa31e:
|
case 0xa31e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user