mirror of
https://github.com/autc04/Retro68.git
synced 2025-01-11 18:30:58 +00:00
LaunchAPPLServer: unload some segments
This commit is contained in:
parent
4162dcc32f
commit
3c071a0772
@ -28,6 +28,8 @@
|
|||||||
#include <Devices.h>
|
#include <Devices.h>
|
||||||
#include <Traps.h>
|
#include <Traps.h>
|
||||||
#include <LowMem.h>
|
#include <LowMem.h>
|
||||||
|
#include <SegLoad.h>
|
||||||
|
#include <Gestalt.h>
|
||||||
|
|
||||||
#include "MacSerialStream.h"
|
#include "MacSerialStream.h"
|
||||||
#include "AppLauncher.h"
|
#include "AppLauncher.h"
|
||||||
@ -438,21 +440,30 @@ int main()
|
|||||||
Boolean is128KROM = (ROM85 > 0);
|
Boolean is128KROM = (ROM85 > 0);
|
||||||
Boolean hasSysEnvirons = false;
|
Boolean hasSysEnvirons = false;
|
||||||
Boolean hasWaitNextEvent = false;
|
Boolean hasWaitNextEvent = false;
|
||||||
|
Boolean hasGestalt = false;
|
||||||
Boolean hasAppleEvents = false;
|
Boolean hasAppleEvents = false;
|
||||||
if (is128KROM)
|
if (is128KROM)
|
||||||
{
|
{
|
||||||
UniversalProcPtr trapUnimpl = GetToolTrapAddress(_Unimplemented);
|
UniversalProcPtr trapUnimpl = GetToolTrapAddress(_Unimplemented);
|
||||||
UniversalProcPtr trapSysEnv = GetOSTrapAddress(_SysEnvirons);
|
UniversalProcPtr trapSysEnv = GetOSTrapAddress(_SysEnvirons);
|
||||||
UniversalProcPtr trapWaitNextEvent = GetToolTrapAddress(_WaitNextEvent);
|
UniversalProcPtr trapWaitNextEvent = GetToolTrapAddress(_WaitNextEvent);
|
||||||
UniversalProcPtr trapAppleEvents = GetToolTrapAddress(_Pack8);
|
UniversalProcPtr trapGestalt = GetOSTrapAddress(_Gestalt);
|
||||||
|
|
||||||
hasSysEnvirons = (trapSysEnv != trapUnimpl);
|
hasSysEnvirons = (trapSysEnv != trapUnimpl);
|
||||||
hasWaitNextEvent = (trapWaitNextEvent != trapUnimpl);
|
hasWaitNextEvent = (trapWaitNextEvent != trapUnimpl);
|
||||||
hasAppleEvents = (trapAppleEvents != trapUnimpl);
|
hasGestalt = (trapGestalt != trapUnimpl);
|
||||||
|
|
||||||
|
if(hasGestalt)
|
||||||
|
{
|
||||||
|
long response = 0;
|
||||||
|
OSErr err = Gestalt(gestaltAppleEventsAttr, &response);
|
||||||
|
hasAppleEvents = err == noErr && response != 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const Boolean hasSysEnvirons = true;
|
const Boolean hasSysEnvirons = true;
|
||||||
const Boolean hasWaitNextEvent = true;
|
const Boolean hasWaitNextEvent = true;
|
||||||
|
const Boolean hasGestalt = true;
|
||||||
const Boolean hasAppleEvents = true;
|
const Boolean hasAppleEvents = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -574,6 +585,7 @@ int main()
|
|||||||
if(server.state == LaunchServer::State::launch)
|
if(server.state == LaunchServer::State::launch)
|
||||||
{
|
{
|
||||||
gSerialStream->close();
|
gSerialStream->close();
|
||||||
|
UnloadSeg((void*) &MacSerialStream::unloadSegDummy);
|
||||||
gPrefs.inSubLaunch = true;
|
gPrefs.inSubLaunch = true;
|
||||||
WritePrefs();
|
WritePrefs();
|
||||||
|
|
||||||
@ -621,6 +633,9 @@ int main()
|
|||||||
{
|
{
|
||||||
if(!appLauncher->IsRunning("\pRetro68App"))
|
if(!appLauncher->IsRunning("\pRetro68App"))
|
||||||
{
|
{
|
||||||
|
appLauncher.reset();
|
||||||
|
UnloadSeg((void*) &CreateAppLauncher);
|
||||||
|
UnloadSeg((void*) &CreateToolLauncher);
|
||||||
gSerialStream->open();
|
gSerialStream->open();
|
||||||
StartResponding(server, rStream);
|
StartResponding(server, rStream);
|
||||||
}
|
}
|
||||||
|
@ -96,3 +96,7 @@ void MacSerialStream::setBaud(int baud)
|
|||||||
else if(baud == 230400)
|
else if(baud == 230400)
|
||||||
Control(outRefNum, kSERD230KBaud, nullptr);
|
Control(outRefNum, kSERD230KBaud, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacSerialStream::unloadSegDummy()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -24,6 +24,8 @@ public:
|
|||||||
void open();
|
void open();
|
||||||
|
|
||||||
void setBaud(int baud);
|
void setBaud(int baud);
|
||||||
|
|
||||||
|
static void unloadSegDummy();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user