Incorporate changes from AW's master.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
e387a8aaac
commit
0aec7061c3
11 changed files with 57 additions and 73 deletions
|
@ -59,7 +59,6 @@ add_library(appleii SHARED
|
|||
linux/version.cpp
|
||||
linux/registry.cpp
|
||||
linux/keyboard.cpp
|
||||
linux/linuxvideo.cpp
|
||||
linux/linuxframe.cpp
|
||||
|
||||
linux/duplicates/Debug.cpp
|
||||
|
|
|
@ -81,8 +81,7 @@ void initialiseEmulator()
|
|||
SpkrInitialize();
|
||||
|
||||
MemInitialize();
|
||||
GetVideo().Initialize();
|
||||
VideoSwitchVideocardPalette(RGB_GetVideocard(), GetVideo().GetVideoType());
|
||||
GetFrame().Initialize();
|
||||
|
||||
GetCardMgr().GetDisk2CardMgr().Reset();
|
||||
HD_Reset();
|
||||
|
|
|
@ -287,9 +287,8 @@ void Game::keyboardEmulation()
|
|||
{
|
||||
video.IncVideoType();
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
video.VideoReinitialize();
|
||||
video.VideoRedrawScreen();
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (checkButtonPressed(RETRO_DEVICE_ID_JOYPAD_L))
|
||||
|
@ -299,9 +298,8 @@ void Game::keyboardEmulation()
|
|||
|
||||
video.SetVideoStyle(videoStyle);
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
video.VideoReinitialize();
|
||||
video.VideoRedrawScreen();
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (checkButtonPressed(RETRO_DEVICE_ID_JOYPAD_START))
|
||||
|
|
|
@ -321,9 +321,8 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference
|
|||
// be careful QRgb is opposite way round to COLORREF
|
||||
video.SetMonochromeRGB(RGB(color.red(), color.green(), color.blue()));
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
video.VideoReinitialize();
|
||||
video.VideoRedrawScreen();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -108,8 +108,7 @@ namespace
|
|||
MB_Initialize();
|
||||
SpkrInitialize();
|
||||
MemInitialize();
|
||||
GetVideo().Initialize();
|
||||
VideoSwitchVideocardPalette(RGB_GetVideocard(), GetVideo().GetVideoType());
|
||||
GetFrame().Initialize();
|
||||
|
||||
emulator->loadVideoSettings();
|
||||
emulator->displayLogo();
|
||||
|
@ -574,9 +573,8 @@ void QApple::on_actionNext_video_mode_triggered()
|
|||
GetAppleWindowTitle();
|
||||
myEmulatorWindow->setWindowTitle(QString::fromStdString(g_pAppTitle));
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
video.VideoReinitialize();
|
||||
video.VideoRedrawScreen();
|
||||
}
|
||||
|
||||
void QApple::loadStateFile(const QString & filename)
|
||||
|
|
|
@ -38,9 +38,8 @@ namespace
|
|||
Video & video = GetVideo();
|
||||
video.IncVideoType();
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
video.VideoReinitialize();
|
||||
video.VideoRedrawScreen();
|
||||
|
||||
updateWindowTitle(win);
|
||||
}
|
||||
|
@ -54,9 +53,8 @@ namespace
|
|||
|
||||
video.SetVideoStyle(videoStyle);
|
||||
|
||||
video.VideoReinitialize(false);
|
||||
video.Config_Save_Video();
|
||||
video.VideoReinitialize();
|
||||
video.VideoRedrawScreen();
|
||||
|
||||
updateWindowTitle(win);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "Interface.h"
|
||||
#include "linux/duplicates/PropertySheet.h"
|
||||
#include "linux/linuxframe.h"
|
||||
#include "linux/linuxvideo.h"
|
||||
|
||||
IPropertySheet& GetPropertySheet()
|
||||
{
|
||||
|
@ -19,6 +18,6 @@ FrameBase& GetFrame()
|
|||
|
||||
Video& GetVideo()
|
||||
{
|
||||
static LinuxVideo sg_LinuxVideo;
|
||||
return sg_LinuxVideo;
|
||||
static Video sg_Video;
|
||||
return sg_Video;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "StdAfx.h"
|
||||
#include "linux/linuxframe.h"
|
||||
#include "Interface.h"
|
||||
|
||||
void LinuxFrame::FrameDrawDiskLEDS(HDC hdc)
|
||||
{
|
||||
|
@ -42,3 +43,36 @@ void LinuxFrame::SetAltEnterToggleFullScreen(bool /* mode */)
|
|||
void LinuxFrame::SetLoadedSaveStateFlag(const bool /* bFlag */)
|
||||
{
|
||||
}
|
||||
|
||||
void LinuxFrame::Initialize()
|
||||
{
|
||||
static_assert(sizeof(bgra_t) == 4, "Invalid size of bgra_t");
|
||||
Video & video = GetVideo();
|
||||
|
||||
const size_t numberOfPixels = video.GetFrameBufferWidth() * video.GetFrameBufferHeight();
|
||||
const size_t numberOfBytes = sizeof(bgra_t) * numberOfPixels;
|
||||
myFramebufferbits.resize(numberOfBytes);
|
||||
video.Initialize(myFramebufferbits.data());
|
||||
}
|
||||
|
||||
void LinuxFrame::Destroy()
|
||||
{
|
||||
myFramebufferbits.clear();
|
||||
GetVideo().Destroy(); // this resets the Video's FrameBuffer pointer
|
||||
}
|
||||
|
||||
void LinuxFrame::VideoPresentScreen()
|
||||
{
|
||||
}
|
||||
|
||||
void LinuxFrame::ChooseMonochromeColor()
|
||||
{
|
||||
}
|
||||
|
||||
void LinuxFrame::Benchmark()
|
||||
{
|
||||
}
|
||||
|
||||
void LinuxFrame::DisplayLogo()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include "FrameBase.h"
|
||||
#include <vector>
|
||||
|
||||
class LinuxFrame : public FrameBase
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void Initialize();
|
||||
virtual void Destroy();
|
||||
|
||||
virtual void FrameDrawDiskLEDS(HDC hdc);
|
||||
virtual void FrameDrawDiskStatus(HDC hdc);
|
||||
virtual void FrameRefreshStatus(int, bool bUpdateDiskStatus = true);
|
||||
|
@ -17,4 +22,12 @@ public:
|
|||
virtual void SetAltEnterToggleFullScreen(bool mode);
|
||||
|
||||
virtual void SetLoadedSaveStateFlag(const bool bFlag);
|
||||
|
||||
virtual void VideoPresentScreen();
|
||||
virtual void ChooseMonochromeColor();
|
||||
virtual void Benchmark();
|
||||
virtual void DisplayLogo();
|
||||
|
||||
private:
|
||||
std::vector<uint8_t> myFramebufferbits;
|
||||
};
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
#include "StdAfx.h"
|
||||
|
||||
#include "linux/linuxvideo.h"
|
||||
#include "NTSC.h"
|
||||
|
||||
void LinuxVideo::Initialize()
|
||||
{
|
||||
static_assert(sizeof(bgra_t) == 4, "Invalid size of bgra_t");
|
||||
VideoResetState();
|
||||
|
||||
const int numberOfPixels = GetFrameBufferWidth() * GetFrameBufferHeight();
|
||||
g_pFramebufferbits = static_cast<uint8_t *>(calloc(sizeof(bgra_t), numberOfPixels));
|
||||
NTSC_VideoInit(g_pFramebufferbits);
|
||||
}
|
||||
|
||||
void LinuxVideo::Destroy()
|
||||
{
|
||||
free(g_pFramebufferbits);
|
||||
g_pFramebufferbits = nullptr;
|
||||
NTSC_Destroy();
|
||||
}
|
||||
|
||||
void LinuxVideo::VideoPresentScreen()
|
||||
{
|
||||
// TODO we should really implement this
|
||||
}
|
||||
|
||||
void LinuxVideo::ChooseMonochromeColor()
|
||||
{
|
||||
}
|
||||
|
||||
void LinuxVideo::Benchmark()
|
||||
{
|
||||
}
|
||||
|
||||
void LinuxVideo::DisplayLogo()
|
||||
{
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "Video.h"
|
||||
|
||||
class LinuxVideo : public Video
|
||||
{
|
||||
public:
|
||||
virtual void Initialize();
|
||||
virtual void Destroy();
|
||||
|
||||
virtual void VideoPresentScreen();
|
||||
virtual void ChooseMonochromeColor();
|
||||
virtual void Benchmark();
|
||||
virtual void DisplayLogo();
|
||||
};
|
Loading…
Add table
Reference in a new issue