classic mac os

This commit is contained in:
IoIxD 2026-04-15 20:21:20 -07:00
commit 5315f4ec4d
34 changed files with 369 additions and 51 deletions

View file

@ -32,6 +32,27 @@ void MwTimeSleep(int ms) {
nanosleep(&ts, NULL);
}
#elif defined(CLASSIC_MAC_OS)
static TMTask tm;
static int timer;
void timerUpdateFunc(void) {
timer += 1;
PrimeTime((QElemPtr)&tm, 1);
};
long MwTimeGetTick(void) {
UnsignedWide h;
Microseconds(&h);
return *(long*)&h;
}
void MwTimeSleep(int ms) {
tm.tmAddr = NewTimerProc(timerUpdateFunc);
tm.tmWakeUp = 0;
tm.tmReserved = 0;
InsTime((QElemPtr)&tm);
PrimeTime((QElemPtr)&tm, 1);
}
#elif defined(__unix__)
long MwTimeGetTick(void) {
struct timespec ts;