mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Fix exit to shell not working
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include "WindowManager.h"
|
#include "WindowManager.h"
|
||||||
|
|
||||||
#include "PLDrivers.h"
|
#include "PLDrivers.h"
|
||||||
|
#include "PLSysCalls.h"
|
||||||
|
|
||||||
int gpAppMain();
|
int gpAppMain();
|
||||||
void gpAppInit();
|
void gpAppInit();
|
||||||
@@ -30,7 +31,7 @@ void GpAppInterfaceImpl::ApplicationInit()
|
|||||||
|
|
||||||
int GpAppInterfaceImpl::ApplicationMain()
|
int GpAppInterfaceImpl::ApplicationMain()
|
||||||
{
|
{
|
||||||
return gpAppMain();
|
return PLSysCalls::MainExitWrapper(gpAppMain);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GpAppInterfaceImpl::PL_IncrementTickCounter(uint32_t count)
|
void GpAppInterfaceImpl::PL_IncrementTickCounter(uint32_t count)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "PLPasStr.h"
|
#include "PLPasStr.h"
|
||||||
#include "PLResources.h"
|
#include "PLResources.h"
|
||||||
#include "PLSound.h"
|
#include "PLSound.h"
|
||||||
|
#include "PLSysCalls.h"
|
||||||
#include "PLTimeTaggedVOSEvent.h"
|
#include "PLTimeTaggedVOSEvent.h"
|
||||||
#include "QDPixMap.h"
|
#include "QDPixMap.h"
|
||||||
#include "BitmapImage.h"
|
#include "BitmapImage.h"
|
||||||
@@ -114,9 +115,7 @@ void RedAlert (short errorNumber)
|
|||||||
// CenterAlert(rDeathAlertID);
|
// CenterAlert(rDeathAlertID);
|
||||||
|
|
||||||
dummyInt = PortabilityLayer::DialogManager::GetInstance()->DisplayAlert(rDeathAlertID, &substitutions);
|
dummyInt = PortabilityLayer::DialogManager::GetInstance()->DisplayAlert(rDeathAlertID, &substitutions);
|
||||||
//ExitToShell();
|
PLSysCalls::Exit(-1);
|
||||||
|
|
||||||
PL_NotYetImplemented_TODO("Exit");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- CreateOffScreenBitMap
|
//-------------------------------------------------------------- CreateOffScreenBitMap
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace PortabilityLayer
|
|||||||
|
|
||||||
HostSuspendCallID_Delay,
|
HostSuspendCallID_Delay,
|
||||||
HostSuspendCallID_CallOnVOSThread,
|
HostSuspendCallID_CallOnVOSThread,
|
||||||
HostSuspendCallID_ForceSyncFrame
|
HostSuspendCallID_ForceSyncFrame,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
#include "PLDrivers.h"
|
#include "PLDrivers.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
|
||||||
static void TranslateMouseInputEvent(const GpVOSEvent &vosEventBase, uint32_t timestamp, PortabilityLayer::EventQueue *queue)
|
static void TranslateMouseInputEvent(const GpVOSEvent &vosEventBase, uint32_t timestamp, PortabilityLayer::EventQueue *queue)
|
||||||
{
|
{
|
||||||
const GpMouseInputEvent &vosEvent = vosEventBase.m_event.m_mouseInputEvent;
|
const GpMouseInputEvent &vosEvent = vosEventBase.m_event.m_mouseInputEvent;
|
||||||
@@ -198,4 +201,24 @@ namespace PLSysCalls
|
|||||||
|
|
||||||
PortabilityLayer::SuspendApplication(PortabilityLayer::HostSuspendCallID_CallOnVOSThread, args, nullptr);
|
PortabilityLayer::SuspendApplication(PortabilityLayer::HostSuspendCallID_CallOnVOSThread, args, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static jmp_buf gs_mainExitWrapper;
|
||||||
|
static int gs_exitCode = 0;
|
||||||
|
|
||||||
|
void Exit(int exitCode)
|
||||||
|
{
|
||||||
|
gs_exitCode = exitCode;
|
||||||
|
longjmp(gs_mainExitWrapper, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int MainExitWrapper(int (*mainFunc)())
|
||||||
|
{
|
||||||
|
if (!setjmp(gs_mainExitWrapper))
|
||||||
|
{
|
||||||
|
int returnCode = mainFunc();
|
||||||
|
return returnCode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return gs_exitCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,4 +9,7 @@ namespace PLSysCalls
|
|||||||
void Sleep(uint32_t ticks);
|
void Sleep(uint32_t ticks);
|
||||||
void ForceSyncFrame();
|
void ForceSyncFrame();
|
||||||
void RunOnVOSThread(void(*callback)(void *context), void *context);
|
void RunOnVOSThread(void(*callback)(void *context), void *context);
|
||||||
|
void Exit(int exitCode);
|
||||||
|
|
||||||
|
int MainExitWrapper(int (*mainFunc)());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user