Compile & link (only) SaveState.cpp.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2017-05-30 21:11:18 +01:00
parent 5c4d499e14
commit c198c24a22
8 changed files with 67 additions and 5 deletions

View file

@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.3)
project(applewin)
add_library(appleii SHARED
source/SaveState.cpp
source/Pravets.cpp
source/Tape.cpp
source/YamlHelper.cpp
@ -22,6 +23,7 @@ add_library(appleii SHARED
source/linux/data.cpp
source/linux/dummies.cpp
source/linux/wwrapper.cpp
source/linux/state.cpp
source/Z80VICE/z80.cpp
source/Z80VICE/z80mem.cpp

View file

@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "SaveState_Structs_v1.h"
#include "YamlHelper.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Disk.h"
#include "Frame.h"
@ -48,8 +48,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h"
#include "z80emu.h"
#include "Configuration\Config.h"
#include "Configuration\IPropertySheet.h"
#include "Configuration/Config.h"
#include "Configuration/IPropertySheet.h"
#define DEFAULT_SNAPSHOT_NAME "SaveState.aws.yaml"
@ -122,8 +122,10 @@ static void Snapshot_LoadState_v1() // .aws v1.0.0.1, up to (and including) Appl
#if _MSC_VER >= 1600 // static_assert supported from VS2010 (cl.exe v16.00)
static_assert(kSnapshotSize_v1 == sizeof(APPLEWIN_SNAPSHOT_v1), "Save-state v1 struct size mismatch");
#else
#if 0
// A compile error here means sizeof(APPLEWIN_SNAPSHOT_v1) is wrong, eg. one of the constituent structs has been modified
typedef char VerifySizesAreEqual[kSnapshotSize_v1 == sizeof(APPLEWIN_SNAPSHOT_v1) ? 1 : -1];
#endif
#endif
if (kSnapshotSize_v1 != sizeof(APPLEWIN_SNAPSHOT_v1))
@ -138,10 +140,10 @@ static void Snapshot_LoadState_v1() // .aws v1.0.0.1, up to (and including) Appl
HANDLE hFile = CreateFile( g_strSaveStatePathname.c_str(),
GENERIC_READ,
0,
NULL,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
0);
if(hFile == INVALID_HANDLE_VALUE)
throw std::string("File not found: ") + g_strSaveStatePathname;

View file

@ -20,6 +20,7 @@ SS_CARDTYPE g_Slot5 = CT_Empty;
HANDLE g_hCustomRomF8 = INVALID_HANDLE_VALUE; // Cmd-line specified custom ROM at $F800..$FFFF
TCHAR g_sProgramDir[MAX_PATH] = TEXT(""); // Directory of where AppleWin executable resides
TCHAR g_sCurrentDir[MAX_PATH] = TEXT(""); // Also Starting Dir. Debugger uses this when load/save
const TCHAR *g_pAppTitle = TITLE_APPLE_2E_ENHANCED;
bool g_bRestart = false;
FILE* g_fh = NULL;

View file

@ -31,6 +31,17 @@ int const kVPresetLine = 256; // line when V state presets
int const kVSyncLines = 4; // lines per VSync duration
int const kVDisplayableScanLines = 192; // max displayable scanlines
eApple2Type GetApple2Type(void)
{
return g_Apple2Type;
}
void SetApple2Type(eApple2Type type)
{
g_Apple2Type = type;
SetMainCpuDefault(type);
}
void DeleteCriticalSection(CRITICAL_SECTION * criticalSection)
{
}

37
source/linux/state.cpp Normal file
View file

@ -0,0 +1,37 @@
#include "StdAfx.h"
#include "SerialComms.h"
#include "MouseInterface.h"
#include "Configuration/IPropertySheet.h"
void VideoReinitialize() { }
void KeybLoadSnapshot(YamlLoadHelper&) { }
std::string GetSnapshotCardName() { }
bool CMouseInterface::LoadSnapshot(YamlLoadHelper&, unsigned int, unsigned int) { return true; }
void SpkrLoadSnapshot(YamlLoadHelper&) { }
void KeybReset() { }
void MB_SaveSnapshot(YamlSaveHelper&, unsigned int) { }
void JoySaveSnapshot(YamlSaveHelper&) { }
void VideoResetState() { }
void JoyLoadSnapshot(YamlLoadHelper&) { }
void MB_LoadSnapshot(YamlLoadHelper&, unsigned int, unsigned int) { }
std::string CMouseInterface::GetSnapshotCardName() { }
void SetLoadedSaveStateFlag(bool) { }
void KeybSaveSnapshot(YamlSaveHelper&) { }
void CMouseInterface::Reset() { }
void SpkrSaveSnapshot(YamlSaveHelper&) { }
bool CSuperSerialCard::LoadSnapshot(YamlLoadHelper&, unsigned int, unsigned int) { return true; }
std::string CSuperSerialCard::GetSnapshotCardName() { return ""; }
std::string MB_GetSnapshotCardName() { return ""; }
void MB_Reset() { }
void Phasor_LoadSnapshot(YamlLoadHelper&, unsigned int, unsigned int) { }
void Phasor_SaveSnapshot(YamlSaveHelper&, unsigned int) { }
std::string Phasor_GetSnapshotCardName() { return ""; }
void CMouseInterface::SaveSnapshot(YamlSaveHelper&) { }
void IPropertySheet::ApplyNewConfig(CConfigNeedingRestart const&, CConfigNeedingRestart const&) { }
void FrameUpdateApple2Type() { }
void VideoLoadSnapshot(YamlLoadHelper&) { }
void SetCurrentImageDir(char const*) { }
void CMouseInterface::Uninitialize() { }
void CSuperSerialCard::SaveSnapshot(YamlSaveHelper&) { }
void VideoSaveSnapshot(YamlSaveHelper&) { }

View file

@ -232,6 +232,8 @@ typedef struct tagPOINT
#define CALLBACK
#define WM_USER 0x0400
#define _tcscat strcat
#define _tcscpy strcpy
#define _tcsdup strdup

View file

@ -273,3 +273,8 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
{
return FALSE;
}
BOOL WINAPI PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
return TRUE;
}

View file

@ -125,3 +125,5 @@ UINT64 _strtoui64(const char *, void *, int);
void GetLocalTime(SYSTEMTIME *t);
BOOL GetOpenFileName(LPOPENFILENAME lpofn);
BOOL WINAPI PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);