From 9aaf997fe3f43502fcdca5e10656591f737dae3a Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 14 Jul 2013 16:45:06 -0400 Subject: [PATCH] set LMTime global at start --- TODO.txt | 6 ++++++ bin/loader.cpp | 4 +++- toolbox/os.cpp | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/TODO.txt b/TODO.txt index b43ba97..c8ab374 100644 --- a/TODO.txt +++ b/TODO.txt @@ -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. diff --git a/bin/loader.cpp b/bin/loader.cpp index 0067f03..0824b5b 100644 --- a/bin/loader.cpp +++ b/bin/loader.cpp @@ -21,6 +21,8 @@ #include #include +#include + #include #include @@ -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); diff --git a/toolbox/os.cpp b/toolbox/os.cpp index 0555202..07cf43e 100644 --- a/toolbox/os.cpp +++ b/toolbox/os.cpp @@ -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;