mirror of https://github.com/ksherlock/mpw.git
use global names
This commit is contained in:
parent
7536e05a6c
commit
0d6874ae08
|
@ -22,6 +22,8 @@
|
|||
#include <toolbox/mm.h>
|
||||
#include <toolbox/os_internal.h>
|
||||
|
||||
#include <macos/sysequ.h>
|
||||
|
||||
extern char **environ;
|
||||
|
||||
|
||||
|
@ -134,7 +136,7 @@ namespace MPW
|
|||
std::memcpy(str32 + 1, name, l);
|
||||
while (l < 32) str32[l++] = 0;
|
||||
|
||||
std::memcpy(memoryPointer(0x0910), str32, 32);
|
||||
std::memcpy(memoryPointer(MacOS::CurApName), str32, 32);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <map>
|
||||
|
||||
#include <mplite/mplite.h>
|
||||
#include <macos/sysequ.h>
|
||||
|
||||
using ToolBox::Log;
|
||||
using namespace ToolBox::Errors;
|
||||
|
@ -45,7 +46,7 @@ namespace
|
|||
|
||||
inline uint16_t SetMemError(uint16_t error)
|
||||
{
|
||||
memoryWriteWord(error, 0x0220);
|
||||
memoryWriteWord(error, MacOS::MemErr);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <cpu/CpuModule.h>
|
||||
#include <cpu/fmem.h>
|
||||
|
||||
#include <macos/sysequ.h>
|
||||
|
||||
#include "os.h"
|
||||
#include "os_internal.h"
|
||||
#include "toolbox.h"
|
||||
|
@ -79,7 +81,7 @@ namespace OS
|
|||
bool Init()
|
||||
{
|
||||
BootTime = std::chrono::steady_clock::now();
|
||||
memoryWriteLong(0, 0x16A); // 0 ticks since boot.
|
||||
memoryWriteLong(0, MacOS::Ticks); // 0 ticks since boot.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -905,7 +907,7 @@ namespace OS
|
|||
if (secsPtr) memoryWriteLong(now, secsPtr);
|
||||
|
||||
// also set global variable Time.
|
||||
memoryWriteLong(now, 0x020c);
|
||||
memoryWriteLong(now, MacOS::TimeLM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -959,7 +961,7 @@ namespace OS
|
|||
|
||||
|
||||
// global Ticks
|
||||
memoryWriteLong(t, 0x16A);
|
||||
memoryWriteLong(t, MacOS::Ticks);
|
||||
ToolReturn<4>(-1, t);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include <cpu/CpuModule.h>
|
||||
#include <cpu/fmem.h>
|
||||
|
||||
#include <macos/sysequ.h>
|
||||
|
||||
|
||||
#include "stackframe.h"
|
||||
|
||||
|
@ -42,7 +44,7 @@ namespace
|
|||
|
||||
inline uint16_t SetResError(uint16_t error)
|
||||
{
|
||||
memoryWriteWord(error, 0x0a60);
|
||||
memoryWriteWord(error, MacOS::ResErr);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -261,7 +263,7 @@ namespace RM
|
|||
{
|
||||
Log("%04x ResError()\n", trap);
|
||||
|
||||
return memoryReadWord(0x0a60);
|
||||
return memoryReadWord(MacOS::ResErr);
|
||||
}
|
||||
|
||||
// SetResLoad (load: BOOLEAN);
|
||||
|
@ -273,7 +275,7 @@ namespace RM
|
|||
|
||||
Log("%04x SetResLoad(%04x)\n", trap, load);
|
||||
|
||||
memoryWriteByte(load ? 0xff : 0x00, 0x0a5e); // word or byte?
|
||||
memoryWriteByte(load ? 0xff : 0x00, MacOS::ResLoad); // word or byte?
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue