mirror of
https://github.com/ksherlock/mpw.git
synced 2025-01-08 22:30:25 +00:00
Add support for the microseconds toolbox call.
This commit is contained in:
parent
28d8900f3f
commit
d1c067e47a
@ -1039,6 +1039,31 @@ namespace OS
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint16_t Microseconds(uint16_t trap)
|
||||
{
|
||||
|
||||
// UnsignedWide is a uint64_t
|
||||
// Microseconds(UnsignedWide * microTickCount)
|
||||
// FOURWORDINLINE(0xA193, 0x225F, 0x22C8, 0x2280);
|
||||
|
||||
|
||||
uint32_t microTickCount;
|
||||
StackFrame<4>(microTickCount);
|
||||
|
||||
Log("%04x %s(%08x)\n", trap, __func__, microTickCount);
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
|
||||
uint64_t t = std::chrono::duration_cast< std::chrono::microseconds >(now - BootTime).count();
|
||||
|
||||
if (microTickCount)
|
||||
memoryWriteLongLong(t, microTickCount);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t Pack6(uint16_t trap)
|
||||
{
|
||||
char buffer[256];
|
||||
|
@ -73,6 +73,7 @@ namespace OS
|
||||
uint16_t Pack6(uint16_t trap);
|
||||
|
||||
uint16_t TickCount(uint16_t trap);
|
||||
uint16_t Microseconds(uint16_t trap);
|
||||
|
||||
uint16_t FSDispatch(uint16_t trap);
|
||||
uint16_t HFSDispatch(uint16_t trap);
|
||||
|
@ -278,6 +278,11 @@ namespace ToolBox {
|
||||
d0 = OS::TickCount(trap);
|
||||
break;
|
||||
|
||||
case 0xa193:
|
||||
d0 = OS::Microseconds(trap);
|
||||
break;
|
||||
|
||||
|
||||
case 0xa9ed:
|
||||
d0 = OS::Pack6(trap);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user