2019-11-23 20:34:24 +00:00
|
|
|
#include "StdAfx.h"
|
2020-06-24 08:34:01 +01:00
|
|
|
|
2021-01-10 11:47:44 +00:00
|
|
|
#include "linux/context.h"
|
2021-05-23 20:06:36 +01:00
|
|
|
#include "linux/linuxframe.h"
|
|
|
|
#include "linux/registry.h"
|
|
|
|
#include "linux/paddle.h"
|
|
|
|
#include "linux/duplicates/PropertySheet.h"
|
2021-01-10 11:47:44 +00:00
|
|
|
|
2020-12-20 16:35:44 +00:00
|
|
|
#include "Interface.h"
|
2021-05-23 20:06:36 +01:00
|
|
|
#include "Log.h"
|
2020-12-20 16:35:44 +00:00
|
|
|
|
2021-01-10 11:47:44 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
std::shared_ptr<FrameBase> sg_LinuxFrame;
|
|
|
|
}
|
|
|
|
|
2020-12-20 16:35:44 +00:00
|
|
|
IPropertySheet& GetPropertySheet()
|
|
|
|
{
|
|
|
|
static CPropertySheet sg_PropertySheet;
|
|
|
|
return sg_PropertySheet;
|
|
|
|
}
|
2020-12-27 20:25:42 +00:00
|
|
|
|
|
|
|
FrameBase& GetFrame()
|
|
|
|
{
|
2021-01-10 11:47:44 +00:00
|
|
|
return *sg_LinuxFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetFrame(const std::shared_ptr<FrameBase> & frame)
|
|
|
|
{
|
|
|
|
sg_LinuxFrame = frame;
|
2020-12-27 20:25:42 +00:00
|
|
|
}
|
2020-12-28 19:42:04 +00:00
|
|
|
|
|
|
|
Video& GetVideo()
|
|
|
|
{
|
2021-01-03 18:44:39 +00:00
|
|
|
static Video sg_Video;
|
|
|
|
return sg_Video;
|
2020-12-28 19:42:04 +00:00
|
|
|
}
|
2021-03-27 18:47:40 +00:00
|
|
|
|
2021-05-24 09:22:01 +01:00
|
|
|
Initialisation::Initialisation(
|
|
|
|
const std::shared_ptr<Registry> & registry,
|
|
|
|
const std::shared_ptr<FrameBase> & frame,
|
|
|
|
const std::shared_ptr<Paddle> & paddle
|
|
|
|
)
|
2021-03-27 18:47:40 +00:00
|
|
|
{
|
2021-05-24 09:22:01 +01:00
|
|
|
Registry::instance = registry;
|
2021-03-27 18:47:40 +00:00
|
|
|
SetFrame(frame);
|
2021-05-24 09:22:01 +01:00
|
|
|
Paddle::instance = paddle;
|
2021-03-27 18:47:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Initialisation::~Initialisation()
|
|
|
|
{
|
|
|
|
GetFrame().Destroy();
|
|
|
|
SetFrame(std::shared_ptr<FrameBase>());
|
2021-05-23 20:06:36 +01:00
|
|
|
|
|
|
|
Paddle::instance.reset();
|
|
|
|
Registry::instance.reset();
|
2021-05-27 13:40:57 +01:00
|
|
|
|
|
|
|
CloseHandle(g_hCustomRomF8);
|
|
|
|
g_hCustomRomF8 = INVALID_HANDLE_VALUE;
|
|
|
|
CloseHandle(g_hCustomRom);
|
|
|
|
g_hCustomRom = INVALID_HANDLE_VALUE;
|
2021-05-23 20:06:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Logger::Logger(const bool log)
|
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
{
|
|
|
|
LogInit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Logger::~Logger()
|
|
|
|
{
|
|
|
|
LogDone();
|
2021-03-27 18:47:40 +00:00
|
|
|
}
|