set LMTime global at start

This commit is contained in:
Kelvin Sherlock 2013-07-14 16:45:06 -04:00
parent 9dc63fd4b7
commit 9aaf997fe3
3 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,9 @@
TODO
- tool to list iigs/mac resource fork (rlist)
1. scan file for debug names (starting at 4e56 - link a6), load into environment table (with tools)
2. address break, ^C break, etc - list reason *before* disasm line
4. ; commands - keep track of last address (;l to repeat...)
@ -46,6 +50,8 @@ CLibraries=$MPW:Libraries:CLibraries-$MPWVersion:
Done
----
- set the time global @ start up (Pascal res files)
- rbreak/wbreak/rwbreak - break on memory access
- orca/c : symfile support.

View File

@ -21,6 +21,8 @@
#include <toolbox/toolbox.h>
#include <toolbox/mm.h>
#include <toolbox/os.h>
#include <mpw/mpw.h>
#include <mplite/mplite.h>
@ -728,7 +730,7 @@ int main(int argc, char **argv)
// for the stack vs allocating it?
MM::Init(Memory, MemorySize, kGlobalSize);
OS::Init();
MPW::Init(argc, argv);

View File

@ -83,6 +83,12 @@ namespace OS
BootTime = std::chrono::steady_clock::now();
memoryWriteLong(0, MacOS::Ticks); // 0 ticks since boot.
//std::chrono::system_clock::now(), to_time_t
// set global variable Time to the current time
time_t now = UnixToMac(::time(NULL));
memoryWriteLong(now, MacOS::TimeLM);
return true;
}
@ -902,6 +908,7 @@ namespace OS
{
return t + EpochAdjust;
}
time_t MacToUnix(time_t t)
{
return t - EpochAdjust;