-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common.h
119 lines (82 loc) · 3.83 KB
/
Common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* This file is part of NEMIGABTL.
NEMIGABTL is free software: you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
NEMIGABTL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with
NEMIGABTL. If not, see <http://www.gnu.org/licenses/>. */
// Common.h
#pragma once
//////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
#define NEMIGABTL_VERSION_STRING "DEBUG"
#elif !defined(PRODUCT)
#define NEMIGABTL_VERSION_STRING "RELEASE"
#else
#include "Version.h"
#endif
//////////////////////////////////////////////////////////////////////
// Assertions checking - MFC-like ASSERT macro
#ifdef _DEBUG
BOOL AssertFailedLine(LPCSTR lpszFileName, int nLine);
#define ASSERT(f) (void) ((f) || !AssertFailedLine(__FILE__, __LINE__) || (DebugBreak(), 0))
#define VERIFY(f) ASSERT(f)
#else // _DEBUG
#define ASSERT(f) ((void)0)
#define VERIFY(f) ((void)f)
#endif // !_DEBUG
//////////////////////////////////////////////////////////////////////
// Alerts
void AlertWarning(LPCTSTR sMessage);
void AlertWarningFormat(LPCTSTR sFormat, ...);
BOOL AlertOkCancel(LPCTSTR sMessage);
//////////////////////////////////////////////////////////////////////
// DebugPrint
#if !defined(PRODUCT)
void DebugPrint(LPCTSTR message);
void DebugPrintFormat(LPCTSTR pszFormat, ...);
void DebugLogClear();
void DebugLogCloseFile();
void DebugLog(LPCTSTR message);
void DebugLogFormat(LPCTSTR pszFormat, ...);
#endif // !defined(PRODUCT)
//////////////////////////////////////////////////////////////////////
// Processor register names
const TCHAR* REGISTER_NAME[];
const int NEMIGA_SCREEN_WIDTH = 512;
const int NEMIGA_SCREEN_HEIGHT = 256;
void PrintOctalValue(TCHAR* buffer, WORD value);
void PrintHexValue(TCHAR* buffer, WORD value);
void PrintBinaryValue(TCHAR* buffer, WORD value);
BOOL ParseOctalValue(LPCTSTR text, WORD* pValue);
BOOL ParseOctalValue(LPCTSTR text, WORD* pValue);
LPCTSTR GetFileNameFromFilePath(LPCTSTR lpfilepath);
//////////////////////////////////////////////////////////////////////
void Test_Log(char eventtype, LPCTSTR message);
void Test_LogFormat(char eventtype, LPCTSTR format, ...);
inline void Test_LogInfo(LPCTSTR message) { Test_Log('i', message); }
inline void Test_LogError(LPCTSTR message) { Test_Log('E', message); }
void Test_Init(LPCTSTR sTestTitle, WORD configuration);
void Test_ChangeConfiguration(WORD configuration);
void Test_Done();
void Test_LogSummary();
void Test_LoadROMCartridge(int slot, LPCTSTR sFilePath);
void Test_AttachFloppyImage(int slot, LPCTSTR sFilePath);
void Test_AttachHardImage(int slot, LPCTSTR sFilePath);
void Test_CreateHardImage(BYTE sectors, BYTE heads, int cylinders, LPCTSTR sFilePath);
void Test_OpenTape(LPCTSTR sFilePath);
void Test_CreateTape(LPCTSTR sFilePath);
void Test_CloseTape();
void Test_SaveScreenshot(LPCTSTR sFileName);
void Test_CheckScreenshot(LPCTSTR sFileName);
void Test_SaveScreenshotSeria(LPCTSTR sFileNameTemplate, int count, int frameStep);
void Test_SaveAnimatedScreenshot(LPCTSTR sFileName, int count, int frameStep);
void Test_CopyFile(LPCTSTR sFileNameFrom, LPCTSTR sFileNameTo);
void Test_CreateDiskImage(LPCTSTR sFileName);
void Test_SaveStateImage(LPCTSTR sFileName);
void Test_LoadStateImage(LPCTSTR sFileName);
#define Test_Assert(f) {if (!(f)) Test_AssertFailed(__FILE__, __LINE__);}
void Test_AssertFailed(LPCSTR lpszFileName, int nLine);
//////////////////////////////////////////////////////////////////////